.sync-drawer {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    width: 340px;
    max-width: calc(100vw - 40px);
    background: var(--color-lightest);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-far);
    overflow: hidden;
    font: var(--text-font);
}

.sync-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--color-1);
    color: var(--color-1-reverse);
    cursor: pointer;
    user-select: none;
}

    .sync-drawer-header .sync-drawer-title {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 1rem;
    }

    .sync-drawer-header .sync-drawer-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        border-radius: 10px;
        background: var(--color-2);
        color: var(--color-lightest);
        font-size: .8rem;
    }

    .sync-drawer-header .sync-drawer-toggle {
        background: transparent;
        border: 0;
        color: inherit;
        cursor: pointer;
        padding: 2px 4px;
    }

.sync-drawer-body {
    max-height: 50vh;
    overflow-y: auto;
    padding: 8px 12px 12px 12px;
}

.sync-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light-color);
}

    .sync-item:last-child {
        border-bottom: 0;
    }

.sync-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sync-item-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sync-item-dismiss {
    background: transparent;
    border: 0;
    color: var(--color-gray);
    cursor: pointer;
    padding: 0 2px;
    flex: 0 0 auto;
}

    .sync-item-dismiss:hover {
        color: var(--color-darkest);
    }

.sync-item-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 4px 0;
}

.sync-item-bar {
    flex: 1 1 auto;
    height: 8px;
    background: var(--color-lighter);
    border-radius: 4px;
    overflow: hidden;
}

.sync-item-fill {
    height: 100%;
    width: 0;
    background: var(--color-success);
    transition: width .3s ease;
}

.sync-item-percent {
    flex: 0 0 auto;
    font-size: .8rem;
    color: var(--sub-text-color);
    min-width: 34px;
    text-align: right;
}

.sync-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sync-item-message {
    font-size: .85rem;
    color: var(--sub-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The Pause/Resume and Cancel buttons sit side by side, so spacing is handled here with a small
   gap rather than the shared 20px .left-margined utility, which pushed them too far apart. */
.sync-item-controls {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sync-item.completed .sync-item-fill {
    background: var(--color-success);
}

.sync-item.completed .sync-item-message {
    color: var(--color-success);
}

.sync-item.failed .sync-item-fill {
    background: var(--color-error);
}

.sync-item.failed .sync-item-message {
    color: var(--color-error);
}
