body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-dark, #0c0c0c);
    color: var(--text-primary, #f0f0f0);
    min-height: 100vh;
}
.app-container {
    display: flex;
    min-height: 100vh;
}
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width, 200px);
    padding: 10px 20px;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.page-header h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary, #a0a0a0);
}
.back-link {
    color: var(--text-secondary, #a0a0a0);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.back-link:hover {
    color: #8b5cf6;
}

/* Preview Layout — one-page 3-zone grid (Ben 2026-07-24 v2).
   Left: business (prices + royalty + settlement + toggles + Publish) ·
   Center: editable metadata · Right: visual (3D + label image + sleeve/holes/vinyl). */
.preview-layout {
    display: grid;
    /* Right track widened 2026-07-25 to hold the 2D artwork + 3D preview side-by-side. */
    grid-template-columns: minmax(330px, 390px) minmax(420px, 1fr) minmax(440px, 560px);
    gap: 20px;
    max-width: 1960px;
    align-items: start;
}

/* LEFT — business rail: everything needed to publish, always on screen. */
.cover-section {
    position: sticky;
    top: 12px;
    align-self: start;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* Hard no-scroll-to-publish guarantee: on short viewports where the business
   rail overflows, the Publication block stays pinned at the column's bottom edge. */
.cover-section .pipeline-steps {
    position: sticky;
    bottom: 0;
    background: var(--bg-primary, #0f0f0f);
    padding-top: 8px;
    z-index: 2;
}
body.label-light .cover-section .pipeline-steps {
    background: var(--bg-primary, #f7f6f3);
}

/* RIGHT — visual rail: 2D artwork + 3D preview (side-by-side) + sleeve/holes/vinyl controls. */
.action-rail {
    position: sticky;
    top: 12px;
    align-self: start;
    overflow: hidden;
    max-width: 560px;
}
/* 2D artwork LEFT, 3D preview RIGHT — side-by-side on the wide desktop rail
   (Ben 2026-07-25). Collapses back to a stack on narrow viewports (media queries). */
.preview-visual-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.preview-visual-row > .image-gallery,
.preview-visual-row > .rail-3d {
    flex: 1 1 0;
    min-width: 0;
}
.pricing-hint {
    font-size: 10px;
    color: var(--text-muted, #8a8a8a);
    margin-top: 3px;
}

/* ≤1339px: fall back to a 2-column stack (the visual rail rejoins the left column). */
@media (max-width: 1339px) {
    .preview-layout {
        grid-template-columns: 360px 1fr;
        max-width: 1100px;
    }
    .action-rail {
        grid-column: 1;
        position: static;
        overflow: visible;
        max-width: none;
    }
    /* The rail rejoins the narrow left column here — re-stack 2D over 3D. */
    .preview-visual-row { flex-direction: column; }
    .cover-section .pipeline-steps { position: static; }
    .details-section {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}
/* ≤720px: single column. */
@media (max-width: 720px) {
    .preview-layout { grid-template-columns: 1fr; }
    .cover-section { position: static; max-height: none; overflow-y: visible; }
    .details-section { grid-column: 1; grid-row: auto; }
    .action-rail { grid-column: 1; position: static; max-width: none; }
    .preview-visual-row { flex-direction: column; }
}
/* Image Gallery */
.image-gallery {
    margin-bottom: 10px;
}
.main-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-tint-strong);
    cursor: pointer;
    margin-bottom: 6px;
}
.main-image:hover {
    opacity: 0.95;
}
.thumbnail-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    max-width: 100%;
}
.thumbnail {
    width: 44px;
    height: 44px;
    border-radius: 3px;
    object-fit: cover;
    background: var(--bg-tint-medium);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    border: 2px solid transparent;
}
.thumbnail:hover {
    opacity: 0.9;
}
.thumbnail.active {
    opacity: 1;
    border-color: var(--accent-light);
}

/* Convert to Black button */
.convert-black-btn {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 6px 12px;
    background: var(--bg-tint-strong);
    color: var(--text-secondary, #a0a0a0);
    border: 1px solid var(--border-tint-strong);
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}
.convert-black-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-light);
    border-color: rgba(196, 149, 106, 0.3);
}
.image-action-btns {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.image-action-btns .convert-black-btn {
    flex: 1;
    margin-top: 0;
}
.convert-black-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Product Header - Compact */
.product-header {
    margin-bottom: 12px;
}
.product-artist {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #f0f0f0);
    margin: 0 0 2px 0;
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.product-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary, #f0f0f0);
    margin: 0 0 6px 0;
}
.product-meta {
    font-size: 14px;
    color: var(--text-secondary, #a0a0a0);
    display: flex;
    align-items: center;
    gap: 5px;
}
.product-meta .separator {
    color: var(--text-muted, #8a8a8a);
}

/* Details Section */
.details-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Card - Minimal */
.card {
    background: transparent;
    border-radius: 0;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid var(--border-tint-medium);
}
.card:last-child {
    border-bottom: none;
}
.card-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted, #8a8a8a);
    margin-bottom: 8px;
    padding-bottom: 0;
    border-bottom: none;
}

/* Field Row */
.field-row {
    display: flex;
    margin-bottom: 12px;
}
.field-row:last-child {
    margin-bottom: 0;
}
.field-label {
    width: 120px;
    flex-shrink: 0;
    color: var(--text-secondary, #a0a0a0);
    font-size: 14px;
}
.field-value {
    flex: 1;
    color: var(--text-primary, #f0f0f0);
}
.field-value a {
    color: #8b5cf6;
    text-decoration: none;
}
.field-value a:hover {
    text-decoration: underline;
}

/* Tags */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}
.status-badge.pending { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.status-badge.approved { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.status-badge.live { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.status-badge.on_hold { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.status-badge.rejected { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Tracklist with Play Buttons */
.tracklist-with-audio {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tracklist-with-audio .track-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-tint-soft);
    gap: 10px;
}
.tracklist-with-audio .track-row:last-child {
    border-bottom: none;
}
.track-play-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b5cf6;
    transition: all 0.2s;
    flex-shrink: 0;
}
.track-play-btn:hover {
    background: rgba(139, 92, 246, 0.4);
}
.track-play-btn.playing {
    background: #8b5cf6;
    color: var(--text-primary, #f0f0f0);
}
.track-play-btn svg {
    width: 14px;
    height: 14px;
}
.track-position {
    width: 28px;
    font-size: 13px;
    color: var(--text-muted, #8a8a8a);
    font-weight: 600;
    flex-shrink: 0;
}
.track-name {
    flex: 1;
    color: var(--text-primary, #f0f0f0);
    font-size: 15px;
}
.tracklist-with-audio .track-no-audio {
    opacity: 0.4;
}
.tracklist-with-audio .track-no-audio .track-play-btn {
    opacity: 0.3;
    cursor: not-allowed;
}
.track-delete-preview-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ef4444;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s, background 0.15s;
}
.track-delete-preview-btn:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.15);
}

/* Replace-audio (canonical label-edit flow: player + pack update) */
.track-replace-preview-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--accent-emphasis, #8b5cf6);
    font-size: 15px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s, background 0.15s;
}
.track-replace-preview-btn:hover {
    opacity: 1;
    background: rgba(139, 92, 246, 0.15);
}
body.label-light .track-replace-preview-btn:hover {
    background: rgba(76, 29, 149, 0.12);
}

/* Description */
.description {
    line-height: 1.7;
    color: var(--text-primary, #f0f0f0);
    font-size: 15px;
}

/* Pricing Card */
.pricing-card {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.price-box {
    text-align: center;
    padding: 20px;
    background: var(--bg-tint-medium);
    border-radius: 8px;
}
.price-label {
    font-size: 12px;
    color: var(--text-secondary, #a0a0a0);
    margin-bottom: 8px;
    text-transform: uppercase;
}
.price-value {
    font-size: 28px;
    font-weight: 600;
    color: #10b981;
}
.price-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-tint-soft);
    background: var(--bg-tint-strong);
    color: var(--text-primary, #f0f0f0);
    font-size: 18px;
    text-align: center;
}
.price-input:focus {
    outline: none;
    border-color: #10b981;
}
.margin-info {
    text-align: center;
    color: var(--text-secondary, #a0a0a0);
    font-size: 13px;
    margin-top: 16px;
}

/* Actions */
.actions-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-lg {
    flex: 1;
    padding: 16px 24px;
    font-size: 16px;
}
.btn-primary {
    background: #8b5cf6;
    color: var(--text-primary, #f0f0f0);
}
.btn-primary:hover {
    background: #7c3aed;
}
.btn-success {
    background: #10b981;
    color: var(--text-primary, #f0f0f0);
}
.btn-success:hover {
    background: #059669;
}
.btn-danger {
    background: #ef4444;
    color: var(--text-primary, #f0f0f0);
}
.btn-danger:hover {
    background: #dc2626;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-tint-soft);
    color: var(--text-secondary, #a0a0a0);
}
.btn-outline:hover {
    border-color: #8b5cf6;
    color: var(--text-primary, #f0f0f0);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Audio Preview - Compact */
.audio-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.audio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid var(--border-tint-medium);
}
.audio-item:last-child {
    border-bottom: none;
}
.audio-item audio {
    flex: 1;
    height: 28px;
}
.audio-name {
    font-size: 13px;
    color: var(--text-secondary, #a0a0a0);
    min-width: 100px;
}

/* Loading */
.loading-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-secondary, #a0a0a0);
}

/* Load-failure state: a slow/hung backend yields a retryable message, never an infinite spinner. */
.load-error {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-secondary, #a0a0a0);
}
.load-error-retry {
    margin-top: 12px;
    padding: 8px 20px;
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    background: var(--accent-emphasis, #8b5cf6);
    color: var(--text-on-accent, #fff);
    font-weight: 500;
    cursor: pointer;
}
.load-error-retry:hover {
    background: var(--accent-light, #a78bfa);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: var(--text-primary, #f0f0f0);
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}
.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Entity Check Badges */
.entity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.entity-badge.exists {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}
.entity-badge.new {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}
.entity-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Warning Card */
.warning-card {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}
.warning-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.warning-list li {
    padding: 8px 0;
    color: #f59e0b;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.warning-list li::before {
    content: 'Alert';
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    cursor: default;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tint-soft);
    border: none;
    color: var(--text-primary, #f0f0f0);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-close:hover { background: var(--bg-tint-soft); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tint-strong);
    border: none;
    color: var(--text-primary, #f0f0f0);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-nav:hover { background: var(--bg-tint-soft); }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

/* Image delete button on thumbnails */
.thumb-wrapper {
    position: relative;
    display: inline-block;
}
.thumb-delete {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #0f0f1a;
    color: var(--text-primary, #f0f0f0);
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
}
.thumb-wrapper:hover .thumb-delete { display: flex; }

/* Editable role badge on a thumbnail (2026-07-14).
   Was a pointer-events:none span — you could see that an image was tagged
   `sleeve_front` but had no way to say "no, that's macaron A". Now a button. */
.thumb-role {
    position: absolute;
    bottom: 2px;
    left: 2px;
    max-width: calc(100% - 4px);
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.68);
    color: var(--accent-emphasis, #c4956a);
    font-size: 8px;
    line-height: 1;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 2;
}
.thumb-role:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: var(--accent-emphasis, #c4956a);
}
/* No role yet — visible enough to invite a click, quiet enough not to shout. */
/* Images doctrine v2 — per-thumb shop-visibility toggle (auto/on/off cycle) */
.thumb-publish {
    position: absolute;
    top: 2px;
    left: 2px;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.68);
    font-size: 8px;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    z-index: 2;
    color: var(--text-muted, #8a8a8a);
}
.thumb-publish:hover { background: rgba(0, 0, 0, 0.85); border-color: var(--accent-emphasis, #c4956a); }
.thumb-publish--on { color: #34d399; }
.thumb-publish--off { color: #f87171; }

.thumb-role--unset {
    color: var(--text-muted, #8a8a8a);
    font-style: italic;
}

.sleeve-picker-note {
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted, #8a8a8a);
    font-size: 10px;
}

/* ---- Shared role-picker modal (upload + role edit) ----
   Styled with tokens rather than the previous hardcoded #111117/#1a1a1e cssText,
   which was invisible in light mode. */
.role-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.role-picker-panel {
    background: var(--bg-card, #111117);
    color: var(--text-primary, #e6e6ea);
    border: 1px solid var(--border, #2a2a34);
    border-radius: 10px;
    max-width: 560px;
    width: 100%;
    max-height: 88vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.role-picker-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border, #2a2a34);
    font-size: 13px;
    font-weight: 600;
}
.role-picker-body {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.role-picker-hint {
    margin: 0 0 4px;
    color: var(--text-muted, #a0a0a8);
    font-size: 11px;
    line-height: 1.5;
}
.role-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--border, #2a2a34);
    border-radius: 6px;
    background: var(--bg-card-hover, #16161c);
}
.role-picker-row-name {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.role-picker-row-select { flex: 0 0 220px; }
.upload-role-select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    background: var(--bg-input, #1a1a1e);
    color: var(--text-primary, #e6e6ea);
    border: 1px solid var(--border, #3a3a44);
    font-size: 12px;
}
.role-picker-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border, #2a2a34);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.role-picker-btn {
    padding: 7px 14px;
    border-radius: 5px;
    background: transparent;
    color: var(--text-secondary, #c0c0c8);
    border: 1px solid var(--border, #3a3a44);
    cursor: pointer;
    font-size: 12px;
}
.role-picker-btn--primary {
    background: #8b5cf6;
    color: var(--text-on-accent, #fff);
    border: none;
    font-weight: 600;
}
.role-picker-btn--primary:hover { background: #7c3aed; }

/* Editable field */
.editable {
    cursor: pointer;
    border-bottom: 1px dashed var(--border-tint-soft);
    padding-bottom: 2px;
    transition: border-color 0.2s;
}
.editable:hover {
    border-bottom-color: #8b5cf6;
}
.edit-input, .edit-textarea, .edit-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary, #f0f0f0);
    font-size: inherit;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.edit-textarea {
    min-height: 80px;
    resize: vertical;
    line-height: 1.6;
}
.edit-input:focus, .edit-textarea:focus, .edit-select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}
.edit-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.edit-save, .edit-cancel {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}
.edit-save { background: #10b981; color: #fff; }
.edit-cancel { background: var(--bg-tint-strong); color: var(--text-secondary, #a0a0a0); }

/* Image Drop Zone */
.image-dropzone {
    border: 1px dashed rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    color: var(--text-muted, #8a8a8a);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 6px;
}
.image-dropzone:hover, .image-dropzone.dragover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
    color: #a78bfa;
}
.image-dropzone.uploading {
    pointer-events: none;
    opacity: 0.6;
}
.restore-btn {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}
.restore-btn:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: #fbbf24;
}

/* MP3 Drop Zone */
.mp3-dropzone {
    border: 1px dashed rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    color: var(--text-muted, #8a8a8a);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}
.mp3-dropzone:hover, .mp3-dropzone.dragover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
    color: #a78bfa;
}
.mp3-dropzone.uploading {
    pointer-events: none;
    opacity: 0.6;
}

/* Audio Player Enhancements */
.audio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tint-soft);
    border-radius: 8px;
    border: 1px solid var(--border-tint-medium);
}
.audio-item:hover {
    background: var(--bg-tint-medium);
}
.audio-track-info {
    min-width: 140px;
}
.audio-track-name {
    font-weight: 500;
    color: var(--text-primary, #f0f0f0);
    font-size: 14px;
}
.audio-track-position {
    font-size: 12px;
    color: var(--text-secondary, #a0a0a0);
}
.audio-item audio {
    flex: 1;
    height: 36px;
}
.audio-item audio::-webkit-media-controls-panel {
    background: var(--bg-tint-strong);
}

/* ============================================
   Admin Actions Block - Compact Design
   ============================================ */
.admin-actions-block {
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-tint-soft);
    border-radius: 8px;
    border: 1px solid var(--border-tint-medium);
}

/* Row 1: Pricing columns (2 columns) */
.pricing-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

.pricing-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pricing-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #8a8a8a);
}

.pricing-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pricing-input-wrapper .currency {
    color: var(--text-secondary, #a0a0a0);
    font-size: 14px;
}

.pricing-input-wrapper input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-tint-soft);
    background: var(--bg-tint-strong);
    color: var(--text-primary, #f0f0f0);
    font-size: 15px;
    font-weight: 600;
    transition: border-color 0.2s;
}

.pricing-input-wrapper input:focus {
    outline: none;
    border-color: #10b981;
}

.pricing-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 0;
}

.pricing-value-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0;
}

.pricing-value-col .b2c-value,
.pricing-value-row #b2c-price {
    font-size: 20px;
    font-weight: 600;
    color: #10b981;
}

/* B2C editable input */
.pricing-input-wrapper input#b2c-price {
    color: #10b981;
    font-weight: 600;
}
.pricing-input-wrapper input#b2c-price:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.ledger-unit-row {
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border-tint-medium);
    border-radius: 6px;
    background: var(--bg-tint-soft);
}

.ledger-unit-row .pricing-label {
    margin-bottom: 4px;
    display: block;
}

.ledger-unit-row input {
    color: #f59e0b;
    font-weight: 600;
}

.ledger-unit-row input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.28);
}

/* --- Royalty proposal block (SSOT 3-tier) ------------------------------- */
/* plan: ~/.claude/plans/luminous-sprouting-twilight.md */

.ledger-unit-row.ledger-unit-proposal {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.07);
}

.ledger-unit-row.ledger-unit-confirmed {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.06);
}

.ledger-unit-row.ledger-unit-pending,
.ledger-unit-row.ledger-unit-manual {
    border-color: var(--border-tint-medium);
    background: var(--bg-tint-soft);
}

.pricing-readonly-value {
    font-size: 16px;
    font-weight: 700;
    color: #f3f4f6;
    padding: 4px 0;
}

.pricing-readonly-value.muted {
    color: var(--text-muted, #8a8a8a);
    font-weight: 500;
    font-size: 13px;
}

/* Compact minimalist 2-line variant — Ben 2026-06-24 "trop d'infos poubelles" */

.proposal-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 4px 0 8px;
    flex-wrap: wrap;
}

.proposal-eur {
    font-size: 18px;
    font-weight: 700;
    color: #fbbf24;
    letter-spacing: -0.01em;
}

.proposal-meta {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary, #9ca3af);
    background: var(--bg-tint-soft);
    padding: 2px 7px;
    border-radius: 4px;
}

.proposal-warn {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.proposal-warn.warn-legacy {
    background: rgba(220, 38, 38, 0.16);
    color: #f87171;
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.proposal-warn.warn-missing-agreement {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Various-Artists collapse notice (Ben directive 2026-07-13). Tells the operator, before
   publish, that this compilation ships ONE "Various Artists" musicartist term rather than
   one garbage term per track. Amber = informational status accent (theme-token safe). */
.va-collapse-badge {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.va-collapse-badge strong {
    font-weight: 700;
}

.proposal-details {
    display: inline-block;
    margin-left: 2px;
}

.proposal-details-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--border-tint-medium);
    background: var(--bg-tint-soft);
    color: var(--text-secondary, #9ca3af);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.proposal-details-toggle::-webkit-details-marker { display: none; }

.proposal-details-toggle:hover {
    background: var(--bg-tint-medium);
    color: #e5e7eb;
}

.proposal-details[open] .proposal-details-toggle {
    background: var(--bg-tint-strong);
    color: #e5e7eb;
}

.proposal-reasoning {
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted, #8a8a8a);
    /* hidden until <details> is open */
    margin-top: 6px;
    flex-basis: 100%;
}

.confirmed-marker {
    font-size: 10px;
    font-weight: 500;
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

.proposal-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-confirm-proposal {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.45);
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    flex-grow: 1;
}

.btn-confirm-proposal:hover {
    background: rgba(16, 185, 129, 0.28);
    color: #6ee7b7;
}

.btn-override-manually {
    background: var(--bg-tint-soft);
    color: var(--text-secondary, #9ca3af);
    border: 1px solid var(--border-tint-medium);
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-override-manually:hover {
    background: var(--bg-tint-strong);
}

.ledger-unit-override {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-tint-medium);
}

.ledger-unit-override .pricing-input-wrapper {
    flex-grow: 1;
}

.btn-confirm-override {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.45);
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-confirm-override:hover {
    background: rgba(245, 158, 11, 0.28);
}

/* --- Light theme overrides (label-light.css discipline) ----------------- */

body.label-light .ledger-unit-row.ledger-unit-proposal {
    border-color: rgba(180, 90, 0, 0.4);
    background: rgba(250, 204, 21, 0.10);
}

body.label-light .ledger-unit-row.ledger-unit-confirmed {
    border-color: rgba(5, 150, 105, 0.4);
    background: rgba(5, 150, 105, 0.08);
}

body.label-light .pricing-readonly-value {
    color: #111827;
}

body.label-light .proposal-eur {
    color: #b45309;
}

body.label-light .proposal-meta {
    color: #4b5563;
    /* var(--bg-tint-soft) on light theme already = rgba(0,0,0,0.025), too pale here.
       Use a slightly darker tint for badge readability. */
    background: var(--bg-tint-medium);
}

body.label-light .proposal-reasoning {
    color: #4b5563;
}

body.label-light .proposal-warn.warn-legacy {
    background: rgba(220, 38, 38, 0.10);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.45);
}

body.label-light .proposal-warn.warn-missing-agreement {
    background: rgba(245, 158, 11, 0.10);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.45);
}

body.label-light .va-collapse-badge {
    background: rgba(245, 158, 11, 0.10);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.45);
}

body.label-light .proposal-details-toggle {
    background: var(--bg-tint-medium);
    color: #4b5563;
    border-color: var(--border-tint-strong);
}

body.label-light .proposal-details-toggle:hover {
    background: var(--bg-tint-strong);
    color: #111827;
}

body.label-light .proposal-details[open] .proposal-details-toggle {
    background: var(--bg-tint-strong);
    color: #111827;
}

body.label-light .confirmed-marker {
    color: #047857;
    background: rgba(5, 150, 105, 0.10);
}

body.label-light .btn-confirm-proposal {
    background: rgba(5, 150, 105, 0.12);
    color: #047857;
    border-color: rgba(5, 150, 105, 0.45);
}

body.label-light .btn-confirm-proposal:hover {
    background: rgba(5, 150, 105, 0.22);
    color: #064e3b;
}

body.label-light .btn-override-manually {
    color: #374151;
    border-color: var(--border-tint-strong);
}

body.label-light .btn-override-manually:hover {
    background: var(--bg-tint-strong);
}

body.label-light .btn-confirm-override {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.45);
}

body.label-light .btn-confirm-override:hover {
    background: rgba(245, 158, 11, 0.22);
}

.price-help {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.35;
    color: var(--text-muted, #8a8a8a);
}

.pricing-margin {
    font-size: 10px;
    color: var(--text-muted, #8a8a8a);
    background: var(--bg-tint-medium);
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

/* Row 2: Release Date (full width) */
.date-row {
    margin-bottom: 8px;
}

.date-row .pricing-label {
    margin-bottom: 3px;
    display: block;
}

.date-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-tint-soft);
    background: var(--bg-tint-strong);
    color: var(--text-primary, #f0f0f0);
    font-size: 13px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.date-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

/* Color scheme fix for date picker */
.date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Pre-order YOYAKU.IO toggle */
.preorder-row {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.preorder-toggle-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preorder-label {
    font-size: 12px;
    font-weight: 600;
    color: #a78bfa;
    letter-spacing: 0.03em;
}

.kurtezy-hint {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-muted, #8a8a8a);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-tint-strong);
    border-radius: 20px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #8b5cf6;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.preorder-info {
    margin-top: 6px;
    font-size: 11px;
    color: #a78bfa;
    padding-left: 2px;
}

/* Legacy Publish button (unused) */
.btn-publish {
    display: none;
}

/* Row 3: Status action buttons */
.status-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-approve {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.btn-approve:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10b981;
}

.btn-approve:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Blocked Approve: red lock, not green. Approval publishes the release LIVE,
   so a blocked state (no ledger unit price) must look blocked, not inviting. */
.btn-approve.btn-approve-blocked,
.btn-approve.btn-approve-blocked:disabled {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    opacity: 0.85;
    cursor: not-allowed;
}

.btn-hold {
    background: transparent;
    border: 1px solid var(--border-tint-soft);
    color: var(--text-secondary, #a0a0a0);
}

.btn-hold:hover {
    background: var(--bg-tint-medium);
    border-color: var(--border-tint-soft);
    color: var(--text-primary, #f0f0f0);
}

.btn-primary-slim {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #8b5cf6;
}

.btn-primary-slim:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: #8b5cf6;
}

.btn-link {
    background: transparent;
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    text-decoration: none;
}

.btn-link:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
}

/* Pipeline Steps UI - Compact */
.pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pipeline-step {
    position: relative;
    padding: 10px;
    border-radius: 6px;
}

.pipeline-step.completed {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.pipeline-step.active {
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.pipeline-step.disabled {
    background: var(--bg-tint-soft);
    border: 1px solid var(--border-tint-medium);
    opacity: 0.5;
}

.pipeline-step-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.pipeline-step-number {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.pipeline-step.completed .pipeline-step-number {
    background: #10b981;
    color: var(--text-primary, #f0f0f0);
}

.pipeline-step.active .pipeline-step-number {
    background: #8b5cf6;
    color: var(--text-primary, #f0f0f0);
}

.pipeline-step.disabled .pipeline-step-number {
    background: var(--bg-tint-strong);
    color: var(--text-muted, #8a8a8a);
}

.pipeline-step-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #f0f0f0);
    white-space: nowrap;
}

.pipeline-step.disabled .pipeline-step-title {
    color: var(--text-muted, #8a8a8a);
}

.pipeline-step-status {
    margin-left: auto;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

.pipeline-step-status.done {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.pipeline-step-status.current {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.pipeline-step-status.hold {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.pipeline-step-actions {
    display: flex;
    gap: 8px;
}

.pipeline-step-actions .btn-action {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
}

.publication-step .pipeline-step-number,
.pipeline-step.completed .pipeline-step-number {
    width: auto;
    min-width: 20px;
    padding: 0 7px;
    border-radius: 999px;
}

.secondary-actions {
    margin-top: 8px;
}

/* Final publish button */
.btn-publish-final {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--text-primary, #f0f0f0);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-publish-final:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-publish-final:disabled {
    background: var(--bg-tint-strong);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #ef4444;
    opacity: 1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-publish-final svg {
    width: 18px;
    height: 18px;
}

.btn-publish-final:disabled svg {
    display: none;
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   Button Loading States & Spinner
   ============================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-tint-soft);
    border-top-color: var(--text-primary, #f0f0f0);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

.btn-action.loading,
.btn-publish-final.loading {
    pointer-events: none;
    opacity: 0.85;
    position: relative;
}

.btn-action.loading .btn-spinner {
    border-color: var(--border-tint-medium);
    border-top-color: currentColor;
}

/* Progress steps indicator */
.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--bg-tint-soft);
    border-radius: 6px;
    font-size: 12px;
    animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted, #8a8a8a);
    transition: color 0.2s;
}

.progress-step.active {
    color: #a78bfa;
}

.progress-step.done {
    color: #10b981;
}

.progress-step-icon {
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.progress-step.active .progress-step-icon::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(167, 139, 250, 0.3);
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

.progress-step.done .progress-step-icon::after {
    content: '\2713';
    font-size: 12px;
    font-weight: 700;
}

.progress-step.waiting .progress-step-icon::after {
    content: '\2022';
    font-size: 10px;
}

/* Enhanced toast with icon */
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

/* Ledger publish gate badges */
.ledger-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 8px 0;
}
.ledger-badge {
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}
.ledger-badge.ok {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.35);
}
.ledger-badge.err {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.35);
}
.ledger-badge.warn {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border-color: rgba(234, 179, 8, 0.35);
}
.publish-block-reason {
    margin-top: 6px;
    font-size: 11px;
    color: #ef4444;
    font-style: italic;
}

/* --- Manufacturing link block (SSOT 4-tier) ----------------------------- */
/* Plan: ~/.claude/plans/luminous-sprouting-twilight.md v2 (2026-06-24) */
/* Resolver: backend/services/manufacturing-link-resolver.js */
/* Rule 4b: no emoji ; CSS state classes only */

.manuf-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin: 6px 0;
    border: 1px solid var(--border-tint-medium);
    border-radius: 6px;
    background: var(--bg-tint-soft);
    font-size: 12px;
    flex-wrap: wrap;
}

.manuf-link-row.manuf-link-linked {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.05);
}

.manuf-link-row.manuf-link-fuzzy {
    border-color: rgba(196, 149, 106, 0.45);
    background: rgba(196, 149, 106, 0.06);
}

.manuf-link-row.manuf-link-supplied {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.06);
}

.manuf-link-row.manuf-link-unlinked {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
}

.manuf-link-badge {
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.manuf-link-badge.linked   { background: rgba(34, 197, 94, 0.15);  color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }
.manuf-link-badge.fuzzy    { background: rgba(196, 149, 106, 0.15); color: #c4956a; border: 1px solid rgba(196, 149, 106, 0.35); }
.manuf-link-badge.supplied { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.manuf-link-badge.unlinked { background: rgba(239, 68, 68, 0.15);  color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.manuf-link-badge.degraded { background: var(--bg-tint-medium); color: var(--text-muted, #8a8a8a); border: 1px solid var(--border-tint-medium); }

.manuf-link-text {
    color: var(--text-secondary, #c8c8d0);
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manuf-link-action.subtle {
    background: transparent;
    border: 1px solid var(--border-tint-medium);
    color: var(--text-secondary, #9a9ab0);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
}

.manuf-link-action.subtle:hover {
    background: var(--bg-tint-medium);
}

.manuf-link-action.primary {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #a78bfa;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.manuf-link-action.primary:hover {
    background: rgba(139, 92, 246, 0.3);
}

.manuf-link-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary, #9a9ab0);
    cursor: pointer;
    font-size: 11px;
}

.manuf-link-check input[type="checkbox"] {
    cursor: pointer;
}

/* --- Light theme overrides ---------------------------------------------- */

body.label-light .manuf-link-row.manuf-link-linked {
    border-color: rgba(22, 163, 74, 0.4);
    background: rgba(22, 163, 74, 0.06);
}

body.label-light .manuf-link-row.manuf-link-fuzzy {
    border-color: rgba(180, 83, 9, 0.4);
    background: rgba(245, 158, 11, 0.08);
}

body.label-light .manuf-link-row.manuf-link-supplied {
    border-color: rgba(124, 58, 237, 0.4);
    background: rgba(124, 58, 237, 0.06);
}

body.label-light .manuf-link-row.manuf-link-unlinked {
    border-color: rgba(220, 38, 38, 0.4);
    background: rgba(220, 38, 38, 0.05);
}

body.label-light .manuf-link-badge.linked   { background: rgba(22, 163, 74, 0.15);  color: #15803d; border-color: rgba(22, 163, 74, 0.45); }
body.label-light .manuf-link-badge.fuzzy    { background: rgba(180, 83, 9, 0.15);   color: #92400e; border-color: rgba(180, 83, 9, 0.45); }
body.label-light .manuf-link-badge.supplied { background: rgba(124, 58, 237, 0.15); color: #6d28d9; border-color: rgba(124, 58, 237, 0.45); }
body.label-light .manuf-link-badge.unlinked { background: rgba(220, 38, 38, 0.15);  color: #b91c1c; border-color: rgba(220, 38, 38, 0.45); }

body.label-light .manuf-link-text { color: #1f2937; }

body.label-light .manuf-link-action.primary {
    background: rgba(124, 58, 237, 0.18);
    color: #5b21b6;
    border-color: rgba(124, 58, 237, 0.5);
}

body.label-light .manuf-link-action.primary:hover {
    background: rgba(124, 58, 237, 0.28);
}

body.label-light .manuf-link-action.subtle {
    color: #374151;
    border-color: var(--border-tint-strong);
}

body.label-light .manuf-link-action.subtle:hover {
    background: var(--bg-tint-strong);
}

body.label-light .manuf-link-check {
    color: #374151;
}

/* === v3-F3 — Fuzzy candidates modal ====================================== */
/* Plan: ~/.claude/plans/luminous-sprouting-twilight.md v3 §F3
 * Triggered from renderManufacturingLinkBlock fuzzy state "[N other(s)]"
 * button. Lists all candidates from the resolver (top 3) with per-row
 * [Link this MO] actions + Label-supplied / Create-MO fallbacks. 3 escape
 * paths: ESC + click-outside + X. */

.manuf-fuzzy-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.manuf-fuzzy-modal {
    background: var(--bg-card, #1f1f1f);
    border: 1px solid var(--border-tint-medium);
    border-radius: 8px;
    min-width: 480px;
    max-width: 720px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.manuf-fuzzy-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-tint-medium);
}

.manuf-fuzzy-modal-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #f0f0f0);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.manuf-fuzzy-modal-close {
    background: transparent;
    border: 1px solid var(--border-tint-medium);
    color: var(--text-secondary, #c8c8d0);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}

.manuf-fuzzy-modal-close:hover {
    background: var(--bg-tint-medium);
    color: var(--text-primary, #f0f0f0);
}

.manuf-fuzzy-modal-body {
    padding: 16px 18px 18px;
    overflow-y: auto;
}

.manuf-fuzzy-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
    font-size: 12px;
}

.manuf-fuzzy-table thead th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-tint-medium);
    color: var(--text-muted, #8a8a8a);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 10px;
}

.manuf-fuzzy-table tbody td {
    padding: 10px;
    border-bottom: 1px solid var(--border-tint-soft);
    color: var(--text-secondary, #c8c8d0);
    vertical-align: middle;
}

.manuf-fuzzy-table tbody tr:last-child td {
    border-bottom: none;
}

.manuf-fuzzy-table code {
    color: var(--text-primary, #f0f0f0);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
}

.manuf-fuzzy-cross-label {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

.manuf-fuzzy-modal-fallback {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-tint-medium);
}

.manuf-fuzzy-fallback-text {
    margin: 0;
    flex: 1 1 100%;
    font-size: 11px;
    color: var(--text-muted, #8a8a8a);
}

/* --- Light theme overrides for fuzzy modal ------------------------------ */
body.label-light .manuf-fuzzy-modal-overlay {
    background: rgba(15, 23, 42, 0.45);
}

body.label-light .manuf-fuzzy-modal {
    background: #ffffff;
}

body.label-light .manuf-fuzzy-modal-title {
    color: #111827;
}

body.label-light .manuf-fuzzy-modal-close {
    color: #374151;
    border-color: var(--border-tint-strong);
}

body.label-light .manuf-fuzzy-modal-close:hover {
    background: var(--bg-tint-strong);
    color: #111827;
}

body.label-light .manuf-fuzzy-table thead th {
    color: #6b7280;
}

body.label-light .manuf-fuzzy-table tbody td {
    color: #374151;
}

body.label-light .manuf-fuzzy-table code {
    color: #111827;
}

body.label-light .manuf-fuzzy-cross-label {
    background: rgba(180, 83, 9, 0.15);
    color: #92400e;
}

body.label-light .manuf-fuzzy-fallback-text {
    color: #6b7280;
}

/* --- Settlement block (one release, one ledger — Ben 2026-07-10) ---------- */
/* SSOT: backend/config/settlement-modes.js */
/* Rule 4b: no emoji ; CSS state classes only. Tokens only (no hardcoded hex   */
/* on color-family props except the shared accent scale used by sibling blocks) */

.settlement-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 8px;
    margin: 6px 0;
    border: 1px solid var(--border-tint-medium);
    border-radius: 6px;
    background: var(--bg-tint-soft);
    font-size: 12px;
}

.settlement-row.settlement-supplied_invoice,
.settlement-row.settlement-supplied_consignment {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.06);
}

.settlement-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.settlement-select {
    flex: 1 1 180px;
    min-width: 160px;
    background: var(--bg-card, #1a1a1a);
    color: var(--text-primary, #ddd);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 12px;
}

.settlement-action {
    border: 1px solid var(--border-tint-medium);
    background: var(--bg-tint-medium);
    color: var(--text-primary, #ddd);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.settlement-action.primary {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.4);
    color: #a78bfa;
}

.settlement-action:hover {
    filter: brightness(1.15);
}

.settlement-pill {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.settlement-pill.legacy {
    background: var(--bg-tint-medium);
    color: var(--text-muted, #8a8a8a);
    border: 1px solid var(--border-tint-medium);
}

.settlement-help {
    font-size: 10.5px;
    color: var(--text-muted, #8a8a8a);
    line-height: 1.35;
}

.settlement-help a {
    color: #a78bfa;
    text-decoration: underline;
}

/* Neutral (non-blocking) ledger badge for supplied settlement modes */
.ledger-badge.neutral {
    background: var(--bg-tint-medium);
    color: var(--text-muted, #8a8a8a);
    border-color: var(--border-tint-medium);
}

/* Royalty proposer — not applicable (supplied settlement) */
.ledger-unit-row.ledger-unit-na .pricing-readonly-value.muted {
    color: var(--text-muted, #8a8a8a);
}

/* Light theme overrides */
body.label-light .settlement-row.settlement-supplied_invoice,
body.label-light .settlement-row.settlement-supplied_consignment {
    border-color: rgba(124, 58, 237, 0.45);
    background: rgba(124, 58, 237, 0.08);
}

body.label-light .settlement-select {
    background: var(--bg-card, #ffffff);
    color: #1f2937;
}

body.label-light .settlement-action {
    color: #374151;
}

body.label-light .settlement-action.primary {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.45);
    color: #6d28d9;
}

body.label-light .settlement-help {
    color: #6b7280;
}

body.label-light .settlement-help a {
    color: #6d28d9;
}

body.label-light .settlement-pill.legacy {
    color: #6b7280;
}

body.label-light .ledger-badge.neutral {
    color: #6b7280;
}

/* Axis C 2026-07-12 — net-earnings visibility (cost/unit + net) when LINKED.
   Palette coherent with proposal (amber) / confirmed (green). */
.royalty-economics {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-tint-medium);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.royalty-cost-row,
.royalty-net-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
}
.royalty-economics .econ-k {
    color: var(--text-secondary, #9ca3af);
    font-weight: 500;
}
.royalty-economics .econ-v {
    font-weight: 700;
    color: #f3f4f6;
    margin-left: auto;
}
.royalty-net-row.econ-net-pos .econ-v { color: #34d399; }
.royalty-net-row.econ-net-neg .econ-v { color: #f87171; }
.econ-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
    background: var(--bg-tint-soft);
    padding: 1px 6px;
    border-radius: 4px;
}
.royalty-cost-row.econ-pending .econ-v.muted {
    color: var(--text-muted, #8a8a8a);
    font-weight: 500;
}
.royalty-cost-row.econ-pending .price-help {
    flex-basis: 100%;
    font-size: 11px;
    color: var(--text-muted, #8a8a8a);
}
body.label-light .royalty-economics .econ-k { color: #6b7280; }
body.label-light .royalty-economics .econ-v { color: #111827; }
body.label-light .royalty-net-row.econ-net-pos .econ-v { color: #059669; }
body.label-light .royalty-net-row.econ-net-neg .econ-v { color: #dc2626; }

/* ── Thumbnail drag reorder (2026-07-16) ── */
.thumb-wrapper[draggable="true"] { cursor: grab; }
.thumb-wrapper[draggable="true"]:active { cursor: grabbing; }
.thumb-wrapper.thumb-dragging { opacity: .4; outline: 2px dashed #8b5cf6; }

/* ============================================
   EDIT HISTORY PANEL (right column, 2026-07-16)
   Collapsible drawer: audit feed + pending change request (approval flow).
   ============================================ */
.edit-history-panel {
    position: fixed;
    top: 80px;
    right: 0;
    z-index: 900;
    width: 340px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    transform: translateX(340px);
    transition: transform 0.2s ease;
    pointer-events: none;
}
.edit-history-panel.open { transform: translateX(0); }
.edit-history-panel .ehp-toggle {
    pointer-events: auto;
    position: absolute;
    left: -92px;
    top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #e5e7eb);
    background: var(--bg-card, #161616);
    border: 1px solid var(--border, #2a2a2a);
    border-right: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
}
.edit-history-panel.has-pending .ehp-toggle {
    border-color: var(--accent-emphasis, #c4956a);
}
.ehp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    color: #0a0a0a;
    background: var(--accent-emphasis, #c4956a);
}
.edit-history-panel .ehp-body {
    pointer-events: auto;
    overflow-y: auto;
    background: var(--bg-card, #161616);
    border: 1px solid var(--border, #2a2a2a);
    border-right: none;
    border-radius: 10px 0 0 10px;
    padding: 12px;
}
.ehp-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-secondary, #9ca3af);
    margin: 10px 0 6px;
}
.ehp-empty { font-size: 12px; color: var(--text-secondary, #9ca3af); padding: 6px 0; }
.ehp-entry {
    padding: 7px 0;
    border-bottom: 1px solid var(--border, #2a2a2a);
}
.ehp-entry:last-child { border-bottom: none; }
.ehp-entry-meta { font-size: 10px; color: var(--text-secondary, #9ca3af); margin-bottom: 2px; }
.ehp-entry-summary { font-size: 12px; color: var(--text-primary, #e5e7eb); line-height: 1.4; }
.ehp-entry.is-failed .ehp-entry-summary { color: #f87171; }
.ehp-prop { font-size: 10px; color: #34d399; font-weight: 600; }
.ehp-fail { font-size: 10px; color: #f87171; font-weight: 700; }
.ehp-pending-card {
    border: 1px solid var(--accent-emphasis, #c4956a);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 6px;
    background: var(--bg-tint-soft, rgba(196, 149, 106, 0.06));
}
.ehp-pending-head { font-size: 12px; font-weight: 700; color: var(--accent-emphasis, #c4956a); }
.ehp-pending-meta { font-size: 10px; color: var(--text-secondary, #9ca3af); margin: 2px 0 8px; }
.ehp-pending-detail { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.ehp-diff-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; }
.ehp-diff-key { font-weight: 600; color: var(--text-primary, #e5e7eb); }
.ehp-diff-val { color: var(--text-secondary, #9ca3af); word-break: break-word; }
.ehp-new-file {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #0a0a0a;
    background: var(--accent-emphasis, #c4956a);
    border-radius: 4px;
    padding: 1px 5px;
}
.ehp-diff-row audio { width: 100%; height: 28px; }
.ehp-pending-actions { display: flex; gap: 8px; }
.ehp-btn {
    flex: 1;
    padding: 7px 0;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.ehp-approve { background: var(--accent-emphasis, #c4956a); color: #0a0a0a; }
.ehp-reject { background: var(--bg-card-hover, #222); color: var(--text-primary, #e5e7eb); border: 1px solid var(--border, #2a2a2a); }
.ehp-pending-note { font-size: 10px; color: var(--text-secondary, #9ca3af); margin-top: 8px; font-style: italic; }

/* Inline 2-step confirm + persistent status line (replaces suppressible native confirm()) */
.ehp-cancel { background: var(--bg-card-hover, #222); color: var(--text-secondary, #9ca3af); border: 1px solid var(--border, #2a2a2a); }
.ehp-pending-msg { margin-top: 8px; font-size: 11px; line-height: 1.4; border-radius: 6px; padding: 6px 8px; }
.ehp-pending-msg.is-info { color: var(--text-secondary, #9ca3af); background: var(--bg-card-hover, #1c1c1c); }
.ehp-pending-msg.is-ok { color: #10b981; background: rgba(16, 185, 129, 0.10); }
.ehp-pending-msg.is-error { color: #f87171; background: rgba(248, 113, 113, 0.10); }
.ehp-reject-form { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.ehp-reject-note {
    width: 100%; box-sizing: border-box; resize: vertical;
    background: var(--bg-card, #141414); color: var(--text-primary, #e5e7eb);
    border: 1px solid var(--border, #2a2a2a); border-radius: 6px; padding: 6px 8px; font-size: 12px;
}
.ehp-reject-notify { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary, #9ca3af); }
.ehp-reject-btns { display: flex; gap: 8px; }
body.label-light .ehp-pending-msg.is-info { background: rgba(0, 0, 0, 0.04); color: var(--text-secondary, #6b7280); }
body.label-light .ehp-reject-note { background: var(--bg-card, #ffffff); color: var(--text-primary, #111827); border-color: var(--border, #d1d5db); }

/* ============================================
   PENDING REQUEST — diff card + full-detail modal (2026-07-21)
   The card carries "what changed"; the modal carries everything, including the
   fields that did NOT change and the untruncated text / image comparisons.
   ============================================ */
.ehp-diff-summary {
    font-size: 11px; font-weight: 700; line-height: 1.4; margin-bottom: 6px;
    color: var(--accent-emphasis, #c4956a);
}
.ehp-diff-row.is-changed .ehp-diff-key { color: var(--accent-emphasis, #c4956a); }
.ehp-diff-row.is-warn .ehp-diff-key { color: #f59e0b; }
.ehp-diff-row.is-none .ehp-diff-val { font-style: italic; }
.ehp-btn.ehp-detail {
    width: 100%; margin-bottom: 8px;
    background: var(--bg-card-hover, #222); color: var(--text-primary, #e5e7eb);
    border: 1px solid var(--border, #2a2a2a);
}

.ehp-detail-modal-overlay {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(0, 0, 0, 0.66); /* THEME-AUDITED: modal backdrop scrim */
    display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 16px; overflow-y: auto;
}
.ehp-detail-modal {
    width: 100%; max-width: 860px;
    background: var(--bg-card, #141414);
    border: 1px solid var(--border, #2a2a2a); border-radius: 10px;
    display: flex; flex-direction: column; max-height: calc(100vh - 80px);
}
.ehp-detail-modal-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px 8px;
}
.ehp-detail-modal-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-primary, #e5e7eb); }
.ehp-detail-modal-close {
    background: none; border: none; cursor: pointer; font-size: 13px; font-weight: 700;
    color: var(--text-secondary, #9ca3af); padding: 4px 8px;
}
.ehp-detail-modal-meta { padding: 0 16px 10px; font-size: 11px; color: var(--text-secondary, #9ca3af); }
.ehp-detail-modal-body { padding: 0 16px 12px; overflow-y: auto; flex: 1; }
.ehp-detail-modal-footer {
    display: flex; gap: 8px; padding: 12px 16px;
    border-top: 1px solid var(--border, #2a2a2a);
}
.ehp-detail-summary { font-size: 12px; font-weight: 700; color: var(--accent-emphasis, #c4956a); margin-bottom: 10px; }
.ehp-detail-summary.is-none { color: var(--text-secondary, #9ca3af); font-weight: 500; font-style: italic; }
.ehp-detail-warn {
    font-size: 11px; line-height: 1.5; color: #f59e0b;
    background: rgba(245, 158, 11, 0.10); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px;
}
.ehp-detail-h {
    margin: 14px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-secondary, #9ca3af);
}
.ehp-detail-field {
    border: 1px solid var(--border, #2a2a2a); border-radius: 8px;
    padding: 8px 10px; margin-bottom: 8px;
}
.ehp-detail-field.is-changed { border-color: var(--accent-emphasis, #c4956a); }
.ehp-detail-field.is-unchanged { opacity: 0.65; }
.ehp-detail-field-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.ehp-detail-key { font-size: 12px; font-weight: 700; color: var(--text-primary, #e5e7eb); }
.ehp-detail-state { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary, #9ca3af); }
.ehp-detail-field.is-changed .ehp-detail-state { color: var(--accent-emphasis, #c4956a); }
.ehp-detail-ba { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ehp-detail-col-head { font-size: 10px; text-transform: uppercase; color: var(--text-secondary, #9ca3af); margin-bottom: 4px; }
.ehp-detail-text {
    margin: 0; white-space: pre-wrap; word-break: break-word; overflow-x: auto;
    font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; line-height: 1.5;
    color: var(--text-secondary, #9ca3af);
    background: var(--bg-card-hover, #1c1c1c); border-radius: 6px; padding: 6px 8px;
    max-height: 260px; overflow-y: auto;
}
.ehp-detail-text.is-after { color: var(--text-primary, #e5e7eb); }
.ehp-detail-img { width: 100%; max-width: 100%; height: auto; border-radius: 6px; display: block; }
.ehp-detail-img-none {
    font-size: 11px; font-style: italic; color: var(--text-secondary, #9ca3af);
    background: var(--bg-card-hover, #1c1c1c); border-radius: 6px; padding: 16px; text-align: center;
}
.ehp-detail-audio { width: 100%; height: 30px; margin-top: 8px; }
@media (max-width: 640px) {
    .ehp-detail-ba { grid-template-columns: 1fr; }
}
body.label-light .ehp-detail-modal { background: var(--bg-card, #ffffff); border-color: var(--border, #d1d5db); }
body.label-light .ehp-detail-modal-footer { border-top-color: var(--border, #d1d5db); }
body.label-light .ehp-detail-field { border-color: var(--border, #d1d5db); }
body.label-light .ehp-detail-text,
body.label-light .ehp-detail-img-none { background: rgba(0, 0, 0, 0.04); color: var(--text-secondary, #6b7280); }
body.label-light .ehp-detail-text.is-after { color: var(--text-primary, #111827); }
body.label-light .ehp-btn.ehp-detail { background: var(--bg-card, #ffffff); color: var(--text-primary, #111827); border-color: var(--border, #d1d5db); }

/* Busy state while an audio replace is in flight (per-SKU lock UI mirror) */
.audio-replace-busy .track-replace-preview-btn,
.audio-replace-busy #mp3-dropzone {
    pointer-events: none;
    opacity: 0.4;
}

/* Light theme */
body.label-light .edit-history-panel .ehp-toggle,
body.label-light .edit-history-panel .ehp-body {
    background: var(--bg-card, #ffffff);
    border-color: var(--border, #d1d5db);
}
body.label-light .ehp-pending-card {
    border-color: var(--accent-emphasis, #4c1d95);
    background: rgba(76, 29, 149, 0.05);
}
body.label-light .ehp-pending-head { color: var(--accent-emphasis, #4c1d95); }
body.label-light .ehp-new-file,
body.label-light .ehp-approve { background: var(--accent-emphasis, #4c1d95); color: #ffffff; }
body.label-light .ehp-badge { background: var(--accent-emphasis, #4c1d95); color: #ffffff; }
