/* ==========================================================================
   Taleclip Audio Studio — kit restyle (rebuild-audio-studio)
   Scope: #page-voiceover only. Kit tokens from
   revamp-ui/audio-studio-assets/design-tokens.css. Artwork:
   web/static/img/audio/*.svg (kit SVGs, copied verbatim).
   - No JS, ids, routes, or backend contracts changed here.
   - avatar.js rewrites .audio-tab inline color/border on every click, so
     tab-bar rules below use !important (same approach as tc-create.css).
   - Transcribe / Cleanup / Enhance / Compress / AudioGen panels are
     rendered by JS into empty shells; this file styles their emitted
     classes (ag-*, enh-*, cmp-*, cleanup-*, cl-*) without touching the JS.
   - Full-width rule: no Audio Studio page keeps a centered narrow cap.
     .cleanup-empty (720px) is widened; the transcript reading column
     .cl-script-inner keeps a deliberate 1100px readability cap inside a
     full-width workspace. Enhance modal caps are dialogs, not page caps.
   ========================================================================== */

#page-voiceover {
    --audio-bg: #090b22;
    --audio-panel: #171133;
    --audio-elevated: #24164b;
    --audio-border: #493079;
    --audio-primary: #a334f5;
    --audio-secondary: #3cdfff;
    --audio-text: #f5f2ff;
    --audio-muted: #a9a3c6;
    --audio-success: #10d89a;
    --audio-danger: #ef475b;
    --audio-radius: 16px;
    --audio-field-bg: #0b0e26;
    --audio-focus: rgba(60, 223, 255, 0.45);
}

/* ------------------------------------------------------------------ */
/* Shared panels, fields, buttons, focus, motion                       */
/* ------------------------------------------------------------------ */

#page-voiceover .card,
#page-voiceover .voiceover-input-card,
#page-voiceover .voiceover-actor-card,
#page-voiceover .voiceover-progress-card,
#page-voiceover .voiceover-result-card,
#page-voiceover .voiceover-help-card {
    background: var(--audio-panel);
    border: 1px solid var(--audio-border);
    border-radius: var(--audio-radius);
}

#page-voiceover .card-title,
#page-voiceover h2.card-title {
    color: var(--audio-text);
}

#page-voiceover input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),
#page-voiceover select,
#page-voiceover textarea {
    background: var(--audio-field-bg);
    border: 1px solid var(--audio-border);
    color: var(--audio-text);
    border-radius: 10px;
}
#page-voiceover input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]):focus,
#page-voiceover select:focus,
#page-voiceover textarea:focus {
    border-color: var(--audio-secondary);
    outline: none;
    box-shadow: 0 0 0 2px var(--audio-focus);
}
#page-voiceover input::placeholder,
#page-voiceover textarea::placeholder {
    color: var(--audio-muted);
}
#page-voiceover select,
#page-voiceover input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]) {
    min-height: 44px;
}
#page-voiceover textarea {
    line-height: 1.55;
}
#page-voiceover .form-group > label,
#page-voiceover label {
    color: var(--audio-text);
}
#page-voiceover .hint {
    color: var(--audio-muted);
}
#page-voiceover input[type=range] {
    accent-color: var(--audio-primary);
    min-height: 32px;
}
#page-voiceover input[type=checkbox] {
    accent-color: var(--audio-primary);
    width: 18px;
    height: 18px;
}

#page-voiceover .btn-primary,
#page-voiceover .ts-btn-primary,
#page-voiceover .parrot-btn-primary {
    min-height: 44px;
}
#page-voiceover .btn-secondary,
#page-voiceover .ts-btn-secondary,
#page-voiceover .parrot-btn-secondary,
#page-voiceover .parrot-btn-ghost {
    min-height: 44px;
    background: var(--audio-elevated);
    border: 1px solid var(--audio-border);
    color: var(--audio-text);
    border-radius: 10px;
}
#page-voiceover .btn-secondary:hover,
#page-voiceover .ts-btn-secondary:hover,
#page-voiceover .parrot-btn-secondary:hover,
#page-voiceover .parrot-btn-ghost:hover {
    border-color: var(--audio-secondary);
    color: var(--audio-text);
}

#page-voiceover :focus-visible {
    outline: 2px solid var(--audio-secondary);
    outline-offset: 2px;
}
#page-voiceover button:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    #page-voiceover *,
    #page-voiceover *::before,
    #page-voiceover *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Progress bars: one gradient treatment everywhere */
#page-voiceover .progress-bar-container,
#page-voiceover .progress-bar,
#page-voiceover .ag-progress-track,
#page-voiceover .enh-progress-bar,
#page-voiceover .cmp-progress-bar {
    border-radius: 999px;
    overflow: hidden;
}
#page-voiceover .progress-bar,
#page-voiceover .ag-progress-bar,
#page-voiceover .enh-progress-fill,
#page-voiceover .cmp-progress-fill,
#page-voiceover #transcribeProgressBar,
#page-voiceover #transcribeStatusBar,
#page-voiceover #avatarProgressFill {
    background: linear-gradient(90deg, var(--audio-primary), var(--audio-secondary)) !important;
}

/* ------------------------------------------------------------------ */
/* Hero: the existing .voiceover-header becomes the cinematic hero.    */
/* The h1 keeps .page-title because avatar.js rewrites its text per    */
/* tab (AI Voiceover / Text-to-Speech); the art + scrim stay put.      */
/* ------------------------------------------------------------------ */

#page-voiceover .voiceover-header {
    background:
        linear-gradient(90deg, rgba(9, 11, 34, 0.94) 0%, rgba(23, 16, 72, 0.62) 52%, rgba(9, 11, 34, 0.25) 100%),
        url("/static/img/audio/audio_hero.svg") right center / cover no-repeat,
        var(--audio-bg);
    border: 1px solid var(--audio-border);
    border-radius: var(--audio-radius);
    padding: 22px 24px;
    min-height: 132px;
    align-items: center;
    margin-bottom: 18px;
}
#page-voiceover .voiceover-header .page-title {
    margin-bottom: 4px;
    font-size: 1.9rem;
    line-height: 1.15;
    background: linear-gradient(90deg, #f5f2ff 0%, #c084fc 55%, #3cdfff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
#page-voiceover .voiceover-header .breadcrumb-page {
    margin-bottom: 6px;
}
#page-voiceover .voiceover-header .breadcrumb-page .breadcrumb-item {
    color: var(--audio-muted);
}
#page-voiceover .voiceover-header .page-subtitle {
    color: var(--audio-muted);
    font-size: 0.95rem;
    margin-bottom: 0;
}
#page-voiceover .voiceover-header .admin-only-cleanup {
    background: rgba(9, 11, 34, 0.65) !important;
    min-height: 36px;
}

/* ------------------------------------------------------------------ */
/* Persistent tab bar: violet pills with kit SVG icons.                */
/* avatar.js sets inline color/borderBottomColor/fontWeight on click;  */
/* !important is required (same as tc-create.css).                     */
/* ------------------------------------------------------------------ */

#page-voiceover #audioTabBar {
    gap: 8px !important;
    padding: 2px 2px 10px !important;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    flex-wrap: nowrap !important;
    border-bottom: 1px solid var(--audio-border) !important;
}
#page-voiceover #audioTabBar .audio-tab {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 0 auto;
    min-height: 44px !important;
    padding: 10px 16px !important;
    border-radius: 12px !important;
    border: 1px solid var(--audio-border) !important;
    border-bottom: 1px solid var(--audio-border) !important;
    background: rgba(23, 17, 51, 0.65) !important;
    color: var(--audio-text) !important;
    font-size: 0.95em !important;
    font-weight: 600 !important;
    white-space: nowrap;
    cursor: pointer;
}
#page-voiceover #audioTabBar .audio-tab .audio-tab-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    display: block;
}
#page-voiceover #audioTabBar .audio-tab:hover {
    border-color: var(--audio-secondary) !important;
    color: #fff !important;
}
#page-voiceover #audioTabBar .audio-tab.active {
    background: linear-gradient(135deg, var(--audio-primary), #7c3aed) !important;
    border-color: var(--audio-primary) !important;
    border-bottom-color: var(--audio-primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 18px rgba(163, 52, 245, 0.45);
}
#page-voiceover #audioTabBar .audio-tab.active .audio-tab-icon {
    filter: brightness(0) invert(1);
}

/* ------------------------------------------------------------------ */
/* Voiceover panel: two-column creator + preview                       */
/* ------------------------------------------------------------------ */

#page-voiceover .voiceover-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 16px;
}
#page-voiceover .voiceover-input-card {
    padding: 22px;
}
#page-voiceover .voiceover-input-card .card-title {
    font-size: 1.05rem;
}
#page-voiceover .avatar-picker-kicker {
    color: var(--audio-secondary);
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
#page-voiceover .avatar-provider-note {
    color: var(--audio-muted);
    font-size: 0.82em;
}
#page-voiceover .avatar-gallery-status {
    color: var(--audio-muted);
}
#page-voiceover .presenter-avatar-grid > * {
    border-radius: 12px;
}
#page-voiceover .custom-avatar-details summary {
    cursor: pointer;
    color: var(--audio-text);
    font-weight: 600;
    min-height: 44px;
    display: flex;
    align-items: center;
}
#page-voiceover .upload-area {
    border: 2px dashed var(--audio-border);
    border-radius: var(--audio-radius);
    background: rgba(163, 52, 245, 0.05);
    min-height: 180px;
}
#page-voiceover .upload-area:hover,
#page-voiceover .upload-area:focus-within {
    border-color: var(--audio-secondary);
}
#page-voiceover .upload-placeholder {
    color: var(--audio-muted);
}
#page-voiceover .upload-placeholder .upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#page-voiceover .upload-placeholder .upload-icon img {
    width: 32px;
    height: 32px;
}
#page-voiceover .upload-hint {
    color: var(--audio-muted);
}
#page-voiceover .voice-settings-grid {
    gap: 14px;
}
#page-voiceover .voice-select-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
#page-voiceover .voice-select-row .form-select {
    flex: 1;
    min-width: 0;
}
#page-voiceover .voice-preview-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: 1px solid var(--audio-border);
    background: var(--audio-elevated);
    color: var(--audio-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#page-voiceover .voice-preview-btn:hover {
    border-color: var(--audio-secondary);
}
#page-voiceover .voice-preview-btn .preview-icon img {
    width: 16px;
    height: 16px;
    display: block;
}
#page-voiceover .voice-preview-progress-bar {
    background: linear-gradient(90deg, var(--audio-primary), var(--audio-secondary));
}
#page-voiceover #generateAvatarBtn {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--audio-primary), #7c3aed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
#page-voiceover #generateAvatarBtn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
#page-voiceover #generateAvatarBtn .btn-text img {
    width: 20px;
    height: 20px;
    vertical-align: -4px;
    filter: brightness(0) invert(1);
}
#page-voiceover #didApiKeyGroup input[type=password] {
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* Right column: actor card keeps the violet radial glow, retinted */
#page-voiceover #selectedActorCard {
    background:
        radial-gradient(420px 220px at 50% 38%, rgba(163, 52, 245, 0.38), transparent 72%),
        var(--audio-panel);
    border: 1px solid var(--audio-border);
    border-radius: var(--audio-radius);
}
#page-voiceover .primary-actor-badge {
    border: 1px solid var(--audio-border);
    background: var(--audio-elevated);
    color: var(--audio-muted);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}
#page-voiceover .actor-preview-empty {
    color: var(--audio-muted);
}
#page-voiceover .actor-card-notes {
    color: var(--audio-muted);
}
#page-voiceover .voiceover-help-card h3 {
    color: var(--audio-text);
}
#page-voiceover .voiceover-help-card ul {
    color: var(--audio-muted);
}
#page-voiceover .result-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
#page-voiceover .result-actions .btn-primary img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}
#page-voiceover .result-video,
#page-voiceover .result-audio {
    width: 100%;
    border-radius: 12px;
    background: #05060f;
}

/* ------------------------------------------------------------------ */
/* Transcribe panel                                                    */
/* ------------------------------------------------------------------ */

#page-voiceover #audioPanel-transcribe .card {
    padding: 24px;
}
#page-voiceover #audioPanel-transcribe h2 {
    color: var(--audio-text);
}
#page-voiceover #audioPanel-transcribe p {
    color: var(--audio-muted);
}
#page-voiceover #ytTranscribeCard {
    border: 1px solid var(--audio-border) !important;
    border-radius: var(--audio-radius) !important;
    background: linear-gradient(180deg, rgba(163, 52, 245, 0.10), rgba(60, 223, 255, 0.04)) !important;
}
#page-voiceover #ytTranscribeCard .yt-card-icon img {
    width: 22px;
    height: 22px;
    display: block;
}
#page-voiceover #ytTranscribeUrl {
    background: var(--audio-field-bg) !important;
    border: 1px solid var(--audio-border) !important;
    color: var(--audio-text) !important;
}
#page-voiceover .ts-btn-primary {
    background: linear-gradient(135deg, var(--audio-primary), #7c3aed);
    border: 1px solid var(--audio-primary);
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}
#page-voiceover .ts-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
#page-voiceover #transcribeDropZone {
    border-color: var(--audio-border) !important;
    background: rgba(163, 52, 245, 0.05) !important;
    border-radius: var(--audio-radius) !important;
}
#page-voiceover #transcribeDropZone:hover,
#page-voiceover #transcribeDropZone:focus-within {
    border-color: var(--audio-secondary) !important;
}
#page-voiceover #transcribeDropZone .dropzone-icon img {
    width: 36px;
    height: 36px;
}
#page-voiceover #transcribeQueue {
    border-color: var(--audio-border) !important;
    border-radius: 12px !important;
    background: var(--audio-panel);
}
#page-voiceover #transcribeMediaInfo {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--audio-border);
    border-radius: 10px;
}
#page-voiceover #transcribeText,
#page-voiceover #ytTranscribeText {
    background: var(--audio-field-bg) !important;
    border: 1px solid var(--audio-border) !important;
    color: var(--audio-text) !important;
    border-radius: 10px !important;
}
#page-voiceover #transcribeLangBadge {
    background: var(--audio-primary) !important;
}

/* ------------------------------------------------------------------ */
/* Cleanup panel (JS-rendered by modules/cleanup.js)                   */
/* Full-width: the 720px centered empty state is widened; the          */
/* transcript reading column keeps a 1100px readability cap inside    */
/* an otherwise full-width workspace.                                  */
/* ------------------------------------------------------------------ */

#page-voiceover #audioPanel-cleanup .card {
    padding: 20px;
}
#page-voiceover #audioPanel-cleanup h2 {
    color: var(--audio-text);
}
#page-voiceover #audioPanel-cleanup .cleanup-empty {
    max-width: none !important;
    margin: 0 !important;
    padding: 24px 4px !important;
}
#page-voiceover #audioPanel-cleanup .cleanup-shell,
#page-voiceover #audioPanel-cleanup .cl-scenes {
    max-width: none;
}
#page-voiceover #audioPanel-cleanup .cl-script-inner {
    max-width: 1100px !important;
}
#page-voiceover #audioPanel-cleanup .cleanup-drop {
    border-color: var(--audio-border);
    background: rgba(163, 52, 245, 0.05);
}
#page-voiceover #audioPanel-cleanup .cleanup-drop:hover {
    border-color: var(--audio-secondary);
}
#page-voiceover #audioPanel-cleanup .cl-btn {
    min-height: 44px;
    border-radius: 10px;
}
#page-voiceover #audioPanel-cleanup .cl-chip {
    border-color: var(--audio-border);
    background: var(--audio-elevated);
    color: var(--audio-text);
}
#page-voiceover #audioPanel-cleanup .cl-playbar,
#page-voiceover #audioPanel-cleanup .cleanup-waveform {
    background: var(--audio-panel);
    border: 1px solid var(--audio-border);
    border-radius: 12px;
}

/* ------------------------------------------------------------------ */
/* Enhance panel (JS-rendered by modules/audioEnhance.js)              */
/* ------------------------------------------------------------------ */

#page-voiceover #audioPanel-enhance .enh-host {
    background: transparent;
}
#page-voiceover #audioPanel-enhance .enh-card {
    background: var(--audio-panel) !important;
    border: 1px solid var(--audio-border) !important;
    border-radius: var(--audio-radius) !important;
    color: var(--audio-text);
}
#page-voiceover #audioPanel-enhance .enh-drop {
    border: 2px dashed var(--audio-border);
    border-radius: var(--audio-radius);
    background: rgba(163, 52, 245, 0.05);
}
#page-voiceover #audioPanel-enhance .enh-drop:hover {
    border-color: var(--audio-secondary);
}
#page-voiceover #audioPanel-enhance .enh-btn {
    min-height: 44px;
    border-radius: 10px;
    font-weight: 600;
}
#page-voiceover #audioPanel-enhance .enh-preset-chip {
    min-height: 44px;
    border: 1px solid var(--audio-border);
    background: var(--audio-elevated);
    color: var(--audio-text);
    border-radius: 999px;
}
#page-voiceover #audioPanel-enhance .enh-preset-chip:hover,
#page-voiceover #audioPanel-enhance .enh-preset-chip[aria-pressed="true"] {
    border-color: var(--audio-primary);
    background: rgba(163, 52, 245, 0.25);
}
#page-voiceover #audioPanel-enhance .enh-chip {
    border: 1px solid var(--audio-border);
    background: var(--audio-elevated);
    color: var(--audio-text);
    border-radius: 999px;
}
#page-voiceover #audioPanel-enhance .enh-history {
    background: var(--audio-panel);
    border: 1px solid var(--audio-border);
    border-radius: var(--audio-radius);
}
#page-voiceover #audioPanel-enhance input[type=range] {
    accent-color: var(--audio-primary);
}
#page-voiceover #audioPanel-enhance .enh-error-banner {
    border-color: var(--audio-danger);
    background: rgba(239, 71, 91, 0.12);
    color: var(--audio-text);
    border-radius: 10px;
}
#page-voiceover #audioPanel-enhance .enh-info-banner {
    border-color: var(--audio-border);
    background: rgba(60, 223, 255, 0.08);
    color: var(--audio-text);
    border-radius: 10px;
}

/* ------------------------------------------------------------------ */
/* Compress panel (JS-rendered by modules/audioCompress.js)            */
/* ------------------------------------------------------------------ */

#page-voiceover #audioPanel-compress .cmp-host {
    background: var(--audio-panel);
    border: 1px solid var(--audio-border);
    border-radius: var(--audio-radius);
    padding: 20px;
}
#page-voiceover #audioPanel-compress .cmp-row {
    background: var(--audio-elevated);
    border: 1px solid var(--audio-border);
    border-radius: 12px;
}
#page-voiceover #audioPanel-compress .cmp-row-name {
    color: var(--audio-text);
}
#page-voiceover #audioPanel-compress .cmp-row-meta,
#page-voiceover #audioPanel-compress .cmp-row-error {
    color: var(--audio-muted);
}
#page-voiceover #audioPanel-compress .cmp-row-error {
    color: var(--audio-danger);
}
#page-voiceover #audioPanel-compress .cmp-badge {
    border: 1px solid var(--audio-border);
    background: var(--audio-elevated);
    color: var(--audio-text);
    border-radius: 999px;
}
#page-voiceover #audioPanel-compress button {
    min-height: 44px;
}

/* ------------------------------------------------------------------ */
/* AudioGen panel (JS-rendered by modules/audiogen.js)                 */
/* The rendered h1 + subtitle overlapped before; give them clear       */
/* block layout and line-height.                                       */
/* ------------------------------------------------------------------ */

#page-voiceover #audioPanel-audiogen .audiogen-shell {
    gap: 16px;
}
#page-voiceover #audioPanel-audiogen .audiogen-header h1.page-title {
    line-height: 1.2;
    margin: 0 0 4px 0;
    font-size: 1.6rem;
    background: linear-gradient(90deg, #f5f2ff 0%, #c084fc 55%, #3cdfff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
#page-voiceover #audioPanel-audiogen .audiogen-header .page-subtitle {
    margin: 0;
    line-height: 1.5;
    color: var(--audio-muted);
}
#page-voiceover #audioPanel-audiogen .audiogen-status {
    background: var(--audio-panel);
    border: 1px solid var(--audio-border);
    border-radius: 12px;
    color: var(--audio-muted);
}
#page-voiceover #audioPanel-audiogen .audiogen-status .ag-stat b {
    color: var(--audio-text);
}
#page-voiceover #audioPanel-audiogen .ag-mode-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
#page-voiceover #audioPanel-audiogen .ag-mode-btn {
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid var(--audio-border);
    background: rgba(23, 17, 51, 0.65);
    color: var(--audio-text);
    font-weight: 600;
    cursor: pointer;
}
#page-voiceover #audioPanel-audiogen .ag-mode-btn.active {
    background: linear-gradient(135deg, var(--audio-primary), #7c3aed);
    border-color: var(--audio-primary);
    color: #fff;
}
#page-voiceover #audioPanel-audiogen .audiogen-layout .card {
    background: var(--audio-panel);
    border: 1px solid var(--audio-border);
    border-radius: var(--audio-radius);
}
#page-voiceover #audioPanel-audiogen .ag-hint {
    color: var(--audio-muted);
}
#page-voiceover #audioPanel-audiogen .ag-toggle input {
    accent-color: var(--audio-secondary);
}
#page-voiceover #audioPanel-audiogen .ag-range {
    accent-color: var(--audio-primary);
}
#page-voiceover #audioPanel-audiogen .ag-error {
    border: 1px solid var(--audio-danger);
    background: rgba(239, 71, 91, 0.12);
    color: var(--audio-text);
    border-radius: 10px;
}
#page-voiceover #audioPanel-audiogen .ag-history {
    background: var(--audio-panel);
    border: 1px solid var(--audio-border);
    border-radius: var(--audio-radius);
}
#page-voiceover #audioPanel-audiogen .ag-hist-item {
    border-bottom: 1px solid var(--audio-border);
}
#page-voiceover #audioPanel-audiogen .ag-hist-item:last-child {
    border-bottom: none;
}
#page-voiceover #audioPanel-audiogen .ag-hist-name {
    color: var(--audio-text);
}
#page-voiceover #audioPanel-audiogen .ag-hist-meta,
#page-voiceover #audioPanel-audiogen .ag-hist-prompt {
    color: var(--audio-muted);
}
#page-voiceover #audioPanel-audiogen .ag-h-play,
#page-voiceover #audioPanel-audiogen .ag-h-dl,
#page-voiceover #audioPanel-audiogen .ag-h-del,
#page-voiceover #audioPanel-audiogen .ag-h-asset {
    min-height: 40px;
    min-width: 40px;
    border-radius: 10px;
    border: 1px solid var(--audio-border);
    background: var(--audio-elevated);
    color: var(--audio-text);
}
#page-voiceover #audioPanel-audiogen .ag-player {
    width: 100%;
}
#page-voiceover #audioPanel-audiogen .ag-sug {
    border: 1px solid var(--audio-border);
    background: var(--audio-elevated);
    color: var(--audio-text);
    border-radius: 999px;
    min-height: 36px;
}

/* ------------------------------------------------------------------ */
/* Parrot panel                                                        */
/* ------------------------------------------------------------------ */

#page-voiceover #audioPanel-parrot .parrot-shell {
    background: var(--audio-panel);
    border: 1px solid var(--audio-border);
    border-radius: var(--audio-radius);
    padding: 20px;
}
#page-voiceover #audioPanel-parrot .parrot-header h1.page-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(90deg, #f5f2ff 0%, #c084fc 55%, #3cdfff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
#page-voiceover #audioPanel-parrot .parrot-header h1.page-title img {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
}
#page-voiceover #audioPanel-parrot .parrot-header .page-subtitle {
    color: var(--audio-muted);
    margin: 4px 0 0 0;
}
#page-voiceover #audioPanel-parrot .parrot-usage {
    border: 1px solid var(--audio-border);
    background: var(--audio-elevated);
    color: var(--audio-text);
    border-radius: 999px;
    padding: 8px 14px;
}
#page-voiceover #audioPanel-parrot .parrot-usage-count {
    color: var(--audio-secondary);
    font-weight: 700;
}
#page-voiceover #audioPanel-parrot .parrot-voices h2,
#page-voiceover #audioPanel-parrot .parrot-label {
    color: var(--audio-text);
}
#page-voiceover #audioPanel-parrot .parrot-voice-card {
    background: var(--audio-elevated);
    border: 1px solid var(--audio-border);
    border-radius: 12px;
    min-height: 44px;
    cursor: pointer;
}
#page-voiceover #audioPanel-parrot .parrot-voice-card:hover {
    border-color: var(--audio-secondary);
}
#page-voiceover #audioPanel-parrot .parrot-voice-card[aria-checked="true"],
#page-voiceover #audioPanel-parrot .parrot-voice-card.selected {
    border-color: var(--audio-primary);
    background: rgba(163, 52, 245, 0.25);
    box-shadow: 0 0 0 1px var(--audio-primary);
}
#page-voiceover #audioPanel-parrot .parrot-voice-name {
    color: var(--audio-text);
}
#page-voiceover #audioPanel-parrot .parrot-voice-tags {
    color: var(--audio-muted);
}
#page-voiceover #audioPanel-parrot .parrot-voice-preview-btn {
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    border: 1px solid var(--audio-border);
    background: var(--audio-panel);
    color: var(--audio-text);
}
#page-voiceover #audioPanel-parrot .parrot-textarea {
    background: var(--audio-field-bg);
    border: 1px solid var(--audio-border);
    color: var(--audio-text);
    border-radius: 12px;
}
#page-voiceover #audioPanel-parrot .parrot-text-meta {
    color: var(--audio-muted);
}
#page-voiceover #audioPanel-parrot .parrot-btn-primary {
    background: linear-gradient(135deg, var(--audio-primary), #7c3aed);
    border: 1px solid var(--audio-primary);
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
#page-voiceover #audioPanel-parrot .parrot-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
#page-voiceover #audioPanel-parrot .parrot-btn-primary .parrot-btn-icon img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    vertical-align: -3px;
}
#page-voiceover #audioPanel-parrot .parrot-status {
    color: var(--audio-muted);
}
#page-voiceover #audioPanel-parrot .parrot-error {
    border: 1px solid var(--audio-danger);
    background: rgba(239, 71, 91, 0.12);
    color: var(--audio-text);
    border-radius: 10px;
}
#page-voiceover #audioPanel-parrot .parrot-result {
    background: #05060f;
    border: 1px solid var(--audio-border);
    border-radius: 12px;
}
#page-voiceover #audioPanel-parrot .parrot-result-empty {
    color: var(--audio-muted);
}
#page-voiceover #audioPanel-parrot .parrot-result-empty-icon img {
    width: 36px;
    height: 36px;
}
#page-voiceover #audioPanel-parrot .parrot-result-video {
    border-radius: 10px;
}
#page-voiceover #audioPanel-parrot .parrot-result-actions img {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
}
#page-voiceover #audioPanel-parrot .parrot-result-actions .parrot-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1100px) {
    #page-voiceover .voiceover-layout {
        grid-template-columns: 1fr;
    }
    #page-voiceover #audioPanel-audiogen .audiogen-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    #page-voiceover .voiceover-page {
        padding: 12px;
    }
    #page-voiceover .voiceover-header {
        min-height: 0;
        padding: 16px;
        /* Drop the hero art on narrow screens: the waveform/headphone art
         * sits behind the wrapping subtitle and hurts contrast at 390px. */
        background: linear-gradient(135deg, #171048, var(--audio-bg));
        text-align: left;
    }
    #page-voiceover .voiceover-header .page-title,
    #page-voiceover .voiceover-header .breadcrumb-page,
    #page-voiceover .voiceover-header .page-subtitle {
        text-align: left;
    }
    #page-voiceover .voiceover-header .page-title {
        font-size: 1.5rem;
    }
    #page-voiceover #audioTabBar {
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 4px;
        padding-right: 4px;
    }
    #page-voiceover .voiceover-input-card {
        padding: 16px;
    }
    #page-voiceover #audioPanel-transcribe .card,
    #page-voiceover #audioPanel-cleanup .card,
    #page-voiceover #audioPanel-parrot .parrot-shell {
        padding: 16px;
    }
    #page-voiceover .voice-settings-grid {
        grid-template-columns: 1fr;
    }
}
