/* 
   Style.css - Minimal Overrides for Tailwind CSS 
   Most styles are handled by Tailwind utility classes in index.html.
*/

/* Toast Animations */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.toast-item {
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-item.hiding {
    animation: fadeOut 0.3s forwards;
}

.account-balance-pill,
.admin-console-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.74);
    color: #d1d5db;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.account-balance-pill.hidden,
.admin-console-link.hidden,
.admin-console.hidden,
.admin-ledger-panel.hidden,
.admin-form-field.hidden,
.admin-action-error.hidden {
    display: none;
}

.admin-console-link {
    color: #c7d2fe;
    text-decoration: none;
}

.admin-console-link:hover {
    border-color: rgba(129, 140, 248, 0.45);
    background: rgba(79, 70, 229, 0.18);
    color: #eef2ff;
}

.account-balance-label {
    color: #8b95a7;
    font-size: 0.68rem;
    font-weight: 800;
}

.account-balance-value {
    color: #86efac;
    font-variant-numeric: tabular-nums;
}

.account-balance-frozen {
    color: #fcd34d;
    font-variant-numeric: tabular-nums;
}

.account-balance-divider {
    width: 1px;
    height: 0.9rem;
    background: rgba(255, 255, 255, 0.12);
}

.admin-console {
    flex: none;
    width: 100%;
    max-height: 42vh;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #0b0f17;
    padding: 1rem clamp(1rem, 3vw, 1.5rem);
}

.admin-console-header,
.admin-ledger-header,
.admin-audit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.admin-console-header h2,
.admin-audit-header h3 {
    margin: 0;
    color: #f9fafb;
    font-size: 1rem;
    font-weight: 800;
}

.admin-console-header p,
.admin-ledger-header span,
.admin-audit-header p {
    margin: 0.2rem 0 0;
    color: #6b7280;
    font-size: 0.75rem;
}

.admin-console-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-primary-button,
.admin-secondary-button,
.admin-row-actions button,
#adminLedgerCloseBtn {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 800;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.admin-primary-button {
    background: #4f46e5;
    color: #fff;
}

.admin-primary-button:hover {
    background: #6366f1;
}

.admin-secondary-button,
#adminLedgerCloseBtn {
    background: rgba(31, 41, 55, 0.9);
    color: #d1d5db;
}

.admin-secondary-button:hover,
#adminLedgerCloseBtn:hover {
    background: rgba(55, 65, 81, 0.95);
}

.admin-users-table,
.admin-ledger-panel,
.admin-audit-panel,
.admin-billing-panel {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0.75rem;
    overflow: hidden;
    background: rgba(17, 24, 39, 0.72);
}

.admin-billing-panel {
    margin-bottom: 0.75rem;
    padding: 0.9rem 1rem;
}

.admin-billing-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.admin-billing-summary h3 {
    margin: 0;
    color: #f9fafb;
    font-size: 0.9rem;
    font-weight: 800;
}

.admin-billing-summary p {
    margin: 0.2rem 0 0;
    color: #6b7280;
    font-size: 0.74rem;
}

.admin-billing-current {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: #c7d2fe;
}

.admin-billing-current span {
    color: #f9fafb;
    font-size: 1.1rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.admin-billing-current small {
    color: #6b7280;
    font-size: 0.7rem;
}

.admin-billing-form {
    display: grid;
    grid-template-columns: minmax(8rem, 0.55fr) minmax(12rem, 1fr) auto;
    gap: 0.65rem;
    align-items: end;
}

.admin-billing-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: #7c8597;
    font-size: 0.7rem;
    font-weight: 800;
}

.admin-billing-form input {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.9);
    color: #f9fafb;
    padding: 0.55rem 0.65rem;
    outline: none;
}

.admin-billing-form input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.55);
}

.admin-shot-cost-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.7rem;
    margin-top: 0.55rem;
    color: #7c8597;
    font-size: 0.68rem;
    font-weight: 800;
}

.admin-shot-cost-breakdown span {
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.1);
    padding: 0.2rem 0.45rem;
    color: #c7d2fe;
}

.admin-user-row {
    display: grid;
    grid-template-columns: minmax(9rem, 1.15fr) 6rem minmax(9rem, 1fr) minmax(18rem, 1.7fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-user-row:first-child {
    border-top: 0;
}

.admin-user-head {
    background: rgba(31, 41, 55, 0.6);
    color: #7c8597;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-user-main,
.admin-balance-stack,
.admin-ledger-row > div:first-child,
.admin-audit-main,
.admin-audit-target {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.admin-user-main strong,
.admin-balance-stack span,
.admin-ledger-row strong,
.admin-audit-main strong {
    color: #e5e7eb;
    font-size: 0.82rem;
}

.admin-user-main span,
.admin-balance-stack small,
.admin-ledger-row span,
.admin-ledger-row small,
.admin-audit-main span,
.admin-audit-main small,
.admin-audit-target span,
.admin-audit-target small,
.admin-audit-row time,
.admin-audit-pagination {
    color: #6b7280;
    font-size: 0.72rem;
}

.admin-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 900;
}

.admin-status.active {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}

.admin-status.disabled {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

.admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.admin-row-actions button {
    background: rgba(31, 41, 55, 0.75);
    color: #cbd5e1;
}

.admin-row-actions button:hover:not(:disabled) {
    border-color: rgba(129, 140, 248, 0.45);
    background: rgba(79, 70, 229, 0.18);
    color: #eef2ff;
}

.admin-row-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.admin-ledger-panel {
    margin-top: 0.75rem;
    padding: 1rem;
}

.admin-audit-panel {
    margin-top: 0.75rem;
    padding: 1rem;
}

.admin-ledger-list {
    display: grid;
    gap: 0.5rem;
}

.admin-audit-list {
    display: grid;
}

.admin-ledger-row,
.admin-audit-row {
    display: grid;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-ledger-row {
    grid-template-columns: minmax(12rem, 1fr) 7rem 10rem;
}

.admin-audit-row {
    grid-template-columns: minmax(14rem, 1fr) minmax(12rem, 0.8fr) 10rem;
}

.admin-ledger-row:first-child,
.admin-audit-row:first-child {
    border-top: 0;
}

.admin-audit-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-audit-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.admin-ledger-row .positive {
    color: #86efac;
}

.admin-ledger-row .negative {
    color: #fca5a5;
}

.admin-empty {
    padding: 1rem;
    color: #6b7280;
    font-size: 0.82rem;
}

.admin-error-text,
.admin-action-error {
    color: #fca5a5;
}

.admin-action-form {
    display: grid;
    gap: 0.9rem;
}

.admin-form-field {
    display: grid;
    gap: 0.35rem;
}

.admin-form-field label {
    color: #9ca3af;
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-form-field input,
.admin-form-field textarea {
    width: 100%;
    border: 1px solid #374151;
    border-radius: 0.65rem;
    background: #111827;
    color: #f9fafb;
    padding: 0.7rem 0.8rem;
    outline: none;
}

.admin-form-field input:focus,
.admin-form-field textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.55);
}

.admin-action-error {
    border: 1px solid rgba(248, 113, 113, 0.22);
    border-radius: 0.65rem;
    background: rgba(127, 29, 29, 0.18);
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
}

.admin-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

@media (max-width: 900px) {
    .account-balance-pill {
        display: none;
    }

    .admin-console {
        max-height: 60vh;
    }

    .admin-console-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-console-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .admin-billing-summary,
    .admin-billing-form {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .admin-billing-current {
        align-items: flex-start;
    }

    .admin-user-row,
    .admin-ledger-row,
    .admin-audit-row {
        grid-template-columns: 1fr;
    }

    .admin-user-head {
        display: none;
    }
}

.production-panel {
    overflow: hidden;
    border: 1px solid rgb(31 41 55);
    border-radius: 1rem;
    background: rgba(17, 24, 39, 0.8);
}

.production-panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgb(31 41 55);
}

.production-panel-body {
    padding: 1.25rem;
}

.production-panel-list-item {
    padding: 0.875rem 1.25rem;
}

.production-shot-error {
    margin-top: 0.5rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid rgba(245, 158, 11, 0.24);
    border-radius: 0.75rem;
    background: rgba(245, 158, 11, 0.08);
    color: rgba(252, 211, 77, 0.95);
    font-size: 0.75rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.production-subtitle-cue-input {
    display: block;
    width: 100%;
    min-height: 4.25rem;
    margin-top: 0.5rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.72);
    color: rgba(229, 231, 235, 0.96);
    font-size: 0.8125rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.production-subtitle-cue-input:focus {
    border-color: rgba(129, 140, 248, 0.9);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4);
    background: rgba(17, 24, 39, 0.92);
}

.production-panel-list-empty {
    padding: 1rem 1.25rem;
}

.production-timeline {
    background: rgba(0, 0, 0, 0.3);
}

.production-timeline-header {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgb(31 41 55);
    background: rgba(31, 41, 55, 0.5);
}

.reference-panel {
    display: grid;
    gap: 0.75rem;
}

.reference-panel-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.reference-panel-title {
    display: block;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.reference-panel-subtitle {
    margin-top: 0.25rem;
    color: #5f6878;
    font-size: 0.75rem;
    line-height: 1.35;
}

.reference-count {
    flex-shrink: 0;
    color: #7c8597;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.75rem;
}

.reference-type-segment {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0.875rem;
    background: rgba(17, 24, 39, 0.82);
}

.reference-type-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.25rem;
    border-radius: 0.625rem;
    color: #8b95a7;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.reference-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 0.35rem;
    background: rgba(148, 163, 184, 0.1);
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 800;
}

.reference-type-btn:hover {
    color: #d1d5db;
    background: rgba(55, 65, 81, 0.55);
}

.reference-type-btn.active {
    color: #f8fafc;
    background: rgba(79, 70, 229, 0.92);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22);
}

.reference-type-btn.active .reference-type-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.reference-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
}

.reference-role-select {
    min-width: 0;
    min-height: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.875rem;
    background: rgba(31, 41, 55, 0.55);
    color: #e5e7eb;
}

.reference-role-select:focus-within,
.reference-role-select.open {
    border-color: rgba(99, 102, 241, 0.9);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.reference-role-select {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.625rem 0 1rem;
}

.reference-role-select > span {
    color: #6b7280;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.reference-role-button {
    min-width: 0;
    width: 100%;
    min-height: 2.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 0;
    background: transparent;
    color: #f8fafc;
    font-size: 0.875rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.reference-role-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f8fafc;
}

.reference-role-chevron {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9999px;
    color: #94a3b8;
    transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.reference-role-select.open .reference-role-chevron {
    transform: rotate(180deg);
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
}

.reference-role-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 35;
    display: grid;
    gap: 0.25rem;
    padding: 0.375rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0.875rem;
    background: #111827;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
}

.reference-role-menu.hidden {
    display: none;
}

.reference-role-option {
    min-height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.75rem;
    border-radius: 0.625rem;
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: 700;
    text-align: left;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.reference-role-option:hover,
.reference-role-option.active {
    background: rgba(79, 70, 229, 0.9);
    color: #ffffff;
}

.reference-role-option.active::after {
    content: "✓";
    color: #ffffff;
    font-size: 0.75rem;
}

.reference-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
}

.reference-primary-btn {
    min-height: 2.55rem;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    font-weight: 800;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.reference-primary-btn {
    background: #4f46e5;
    color: #ffffff;
}

.reference-primary-btn:hover {
    background: #6366f1;
}

.reference-asset-list {
    display: grid;
    gap: 0.5rem;
}

.reference-empty-state {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 3rem;
    padding: 0 0.875rem;
    border: 1px dashed rgba(148, 163, 184, 0.18);
    border-radius: 0.875rem;
    color: #687285;
    font-size: 0.8125rem;
}

.reference-empty-state-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    font-weight: 800;
}

.reference-asset-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.75rem;
    padding: 0.65rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.875rem;
    background: rgba(15, 23, 42, 0.6);
    overflow: hidden;
}

.reference-thumb,
.reference-preview-btn {
    width: 3.25rem;
    height: 3.25rem;
    flex-shrink: 0;
    border-radius: 0.75rem;
}

.reference-preview-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.85);
    color: #c7d2fe;
    cursor: pointer;
}

.reference-preview-btn:hover {
    border-color: rgba(129, 140, 248, 0.55);
    background: rgba(30, 41, 59, 0.95);
}

.reference-thumb {
    display: block;
    object-fit: cover;
    background: rgba(15, 23, 42, 0.85);
}

.reference-thumb-fallback {
    font-size: 1rem;
    font-weight: 800;
}

.reference-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.55));
    font-size: 1rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}

.reference-asset-main {
    min-width: 0;
}

.reference-asset-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.reference-alias {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e0e7ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.8125rem;
    font-weight: 800;
}

.reference-role,
.reference-type-badge {
    flex-shrink: 0;
    border-radius: 9999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.625rem;
    font-weight: 800;
    line-height: 1.45;
}

.reference-role {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}

.reference-type-badge {
    background: rgba(148, 163, 184, 0.1);
    color: #9ca3af;
}

.reference-url {
    margin-top: 0.35rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #8b95a7;
    font-size: 0.75rem;
    line-height: 1.35;
}

.reference-url.previewable {
    cursor: pointer;
}

.reference-url.previewable:hover {
    color: #c7d2fe;
}

.reference-note {
    margin-top: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6b7280;
    font-size: 0.6875rem;
}

.reference-asset-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.reference-insert-btn,
.reference-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    border-radius: 0.625rem;
    font-size: 0.75rem;
    font-weight: 800;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.reference-insert-btn {
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
}

.reference-insert-btn:hover {
    background: rgba(99, 102, 241, 0.28);
    color: #ffffff;
}

.reference-remove-btn {
    background: rgba(127, 29, 29, 0.18);
    color: #fca5a5;
    padding: 0 0.55rem;
}

.reference-remove-btn:hover {
    background: rgba(220, 38, 38, 0.24);
    color: #fecaca;
}

.reference-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.86);
    backdrop-filter: blur(10px);
    transition: opacity 160ms ease, visibility 160ms ease;
}

.reference-preview-dialog {
    width: min(92vw, 56rem);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1rem;
    background: #0f172a;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.reference-preview-header,
.reference-preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.reference-preview-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    border-bottom: 0;
}

.reference-preview-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e5e7eb;
    font-weight: 800;
}

.reference-preview-meta {
    margin-top: 0.2rem;
    color: #94a3b8;
    font-size: 0.75rem;
}

.reference-preview-close {
    width: 2rem;
    height: 2rem;
    border-radius: 0.625rem;
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    font-size: 1.35rem;
    line-height: 1;
}

.reference-preview-close:hover {
    background: rgba(148, 163, 184, 0.18);
    color: #ffffff;
}

.reference-preview-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 18rem;
    max-height: 70vh;
    padding: 1rem;
    background: #020617;
}

.reference-preview-media img,
.reference-preview-media video {
    max-width: 100%;
    max-height: 66vh;
    border-radius: 0.75rem;
    object-fit: contain;
    background: #000000;
}

.reference-preview-link {
    color: #a5b4fc;
    font-size: 0.8125rem;
    font-weight: 700;
}

.reference-preview-link:hover {
    color: #c7d2fe;
}

.post-production-controls {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    background: rgba(31, 41, 55, 0.3);
}

.audio-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem;
    padding: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    background: rgba(17, 24, 39, 0.7);
}

.audio-mode-option {
    min-width: 0;
    cursor: pointer;
}

.audio-mode-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.55rem 0.625rem;
    border-radius: 0.55rem;
    color: #8b95a7;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.audio-mode-option:hover span {
    color: #d1d5db;
    background: rgba(55, 65, 81, 0.55);
}

.audio-mode-option input:checked + span {
    color: #ffffff;
    background: #4b5563;
}

.post-production-select {
    display: grid;
    gap: 0.45rem;
}

.post-production-select > span {
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 700;
}

.post-production-select > input {
    min-height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    background: rgba(17, 24, 39, 0.82);
    color: #e5e7eb;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    outline: none;
}

.post-production-select > input:focus {
    border-color: rgba(99, 102, 241, 0.9);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.post-production-select > input:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.post-production-custom-select {
    min-height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(17, 24, 39, 0.82);
}

.post-production-custom-select.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.post-production-custom-select.disabled .reference-role-button {
    cursor: not-allowed;
    color: #64748b;
}

.voice-speaker-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    transition: opacity 0.15s ease;
}

.voice-speaker-controls.disabled {
    opacity: 0.55;
}

@media (max-width: 520px) {
    .reference-compose {
        grid-template-columns: 1fr;
    }

    .audio-mode-grid {
        grid-template-columns: 1fr;
    }

    .reference-asset-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .reference-asset-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}
