/* Sonalize Root Stylesheet - Neutral Surface Palette, Dual-Ring Identity & DSP Visualisations */

/* Self-Hosted Local Fonts */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/poppins-600.woff2') format('woff2');
}

@font-face {
    /* one variable font covers every weight used (400, 500, 600) */
    font-family: 'Figtree';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('fonts/figtree.woff2') format('woff2');
}

@font-face {
    font-family: 'Cascadia Mono';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/cascadia-mono.woff2') format('woff2');
}

/* Design Tokens - Light Mode (Default) */
:root {
    --ground: #F4F4F4;
    --surface: #FFFFFF;
    --raised: #F9F9F9;
    --line: #E3E3E3;
    --line-2: #D2D2D2;
    --ink: #222222;
    --ink-2: #555555;
    --ink-3: #696969;
    --accent: #222222;
    --track-a: #0683AA;
    --track-a-text: #222222;
    --on-accent: #FFFFFF;
    --score-high: #B91C1C;
    --score-mid: #A3530D;
    --score-low: #2C6E49;
    --track-b: #C05008;
    --track-b-text: #222222;
    --status-high: #DC2626;
    --status-low: #2C6E49;
    --r-in: 4px;
    --r-ctrl: 8px;
    --r-card: 12px;
    --r-sheet: 16px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --elev-card: 0 1px 2px rgb(0 0 0 / .06), 0 10px 28px -14px rgb(0 0 0 / .22);
    --font-head: 'Poppins', system-ui, -apple-system, sans-serif;
    --font-ui: 'Figtree', system-ui, -apple-system, sans-serif;
    --font-mono: 'Cascadia Mono', 'SF Mono', Consolas, ui-monospace, monospace;

    /* Legacy mapping for backward compatibility */
    --bg-base: var(--ground);
    --bg-surface: var(--surface);
    --bg-card: var(--surface);
    --bg-card-hover: var(--raised);
    --border-subtle: var(--line);
    --border-bright: var(--line-2);
    --text-primary: var(--ink);
    --text-secondary: var(--ink-2);
    --text-muted: var(--ink-3);
}

/* Dark Mode Tokens */
:root[data-theme="dark"] {
    --ground: #141414;
    --surface: #1C1C1C;
    --raised: #222222;
    --line: #2F2F2F;
    --line-2: #3C3C3C;
    --ink: #E9E9E9;
    --ink-2: #B7B7B7;
    --ink-3: #9B9B9B;
    --accent: #E9E9E9;
    --track-a: #1490B9;
    --track-a-text: #E9E9E9;
    --on-accent: #141414;
    --score-high: #F87171;
    --score-mid: #EE8A33;
    --score-low: #7ECFA4;
    --track-b: #D2590D;
    --track-b-text: #E9E9E9;
    --status-high: #DC2626;
    --status-low: #7ECFA4;
    --elev-card: 0 1px 2px rgb(0 0 0 / .4), 0 12px 28px -12px rgb(0 0 0 / .7);

    --bg-base: var(--ground);
    --bg-surface: var(--surface);
    --bg-card: var(--surface);
    --bg-card-hover: var(--raised);
    --border-subtle: var(--line);
    --border-bright: var(--line-2);
    --text-primary: var(--ink);
    --text-secondary: var(--ink-2);
    --text-muted: var(--ink-3);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ground: #141414;
        --surface: #1C1C1C;
        --raised: #222222;
        --line: #2F2F2F;
        --line-2: #3C3C3C;
        --ink: #E9E9E9;
        --ink-2: #B7B7B7;
        --ink-3: #9B9B9B;
        --accent: #E9E9E9;
        --track-a: #1490B9;
        --track-a-text: #E9E9E9;
        --on-accent: #141414;
        --score-high: #F87171;
        --score-mid: #EE8A33;
        --score-low: #7ECFA4;
        --track-b: #D2590D;
        --track-b-text: #E9E9E9;
        --status-high: #DC2626;
        --status-low: #7ECFA4;
        --elev-card: 0 1px 2px rgb(0 0 0 / .4), 0 12px 28px -12px rgb(0 0 0 / .7);

        --bg-base: var(--ground);
        --bg-surface: var(--surface);
        --bg-card: var(--surface);
        --bg-card-hover: var(--raised);
        --border-subtle: var(--line);
        --border-bright: var(--line-2);
        --text-primary: var(--ink);
        --text-secondary: var(--ink-2);
        --text-muted: var(--ink-3);
    }
}

/* Reset & Global Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: clip;
    background-color: var(--ground);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Enforce Tabular Nums for all quantitative metrics */
.tabular,
.metric-val,
.detail-val,
.gauge-number,
.progress-percentage,
.apparent-pill,
.segment-pct,
.time-val {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: clip;
}

/* Top Navigation Bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--elev-card);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.brand-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
}

.brand-title {
    font-family: var(--font-head);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1.2;
}

.brand-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--ink-2);
    font-weight: 400;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-demo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 32px;
    padding: 0 0.85rem;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-demo:hover:not(:disabled) {
    background: var(--line);
    border-color: var(--line-2);
}

.btn-demo-distinct {
    border-color: var(--line);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--r-ctrl);
    background: var(--raised);
    border: 1px solid var(--line);
    color: var(--ink-2);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.btn-icon:hover {
    color: var(--ink);
    background: var(--line);
}

/* Main Workspace Container */
.main-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

/* Secondary Mode Switcher (Batch Folder Scan) */
.mode-tabs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    padding: 0.35rem 0.5rem;
}

.mode-pills {
    display: flex;
    gap: 0.35rem;
}

.mode-pill {
    padding: 0.4rem 0.9rem;
    border-radius: var(--r-ctrl);
    border: none;
    background: transparent;
    color: var(--ink-2);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mode-pill.active {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Cards & Surfaces */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--elev-card);
}

/* Dual Dropzones Grid */
.dropzones-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.track-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    border-radius: var(--r-card);
}

.track-card.accent-track-a {
    border-top: 3px solid var(--track-a);
}

.track-card.accent-track-b {
    border-top: 3px solid var(--track-b);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.track-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}

.track-subtitle {
    font-size: 0.75rem;
    color: var(--ink-2);
}

.tab-pills {
    display: flex;
    background: var(--raised);
    padding: 3px;
    border-radius: var(--r-ctrl);
    border: 1px solid var(--line);
}

.tab-pill {
    padding: 0.3rem 0.65rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--ink-2);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-pill.active {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--line-2);
    border-radius: var(--r-ctrl);
    padding: 2rem 1.25rem;
    background: var(--raised);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    text-align: center;
}

.dropzone:hover, .dropzone.active-drag {
    border-color: var(--accent);
    background: var(--surface);
}

.hidden-file-input {
    display: none;
}

.dropzone-icon {
    color: var(--ink-2);
    margin-bottom: 0.5rem;
}

.dropzone-text {
    font-size: 0.875rem;
    color: var(--ink-2);
}

.dropzone-prompt {
    color: var(--ink);
    font-weight: 600;
}

.dropzone-formats {
    font-size: 0.75rem;
    color: var(--ink-3);
    margin-top: 0.35rem;
    font-family: var(--font-mono);
}

.url-input-box {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.85rem 0;
}

.url-input-row {
    display: flex;
    gap: 0.5rem;
}

.url-input {
    flex: 1;
    background: var(--raised);
    border: 1px solid var(--line-2);
    border-radius: var(--r-ctrl);
    padding: 0.5rem 0.85rem;
    color: var(--ink);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.url-input:focus {
    border-color: var(--accent);
}

.btn-fetch {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: var(--r-ctrl);
    padding: 0 1.1rem;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    height: 34px;
}

.btn-fetch:hover:not(:disabled) {
    opacity: 0.92;
}

.btn-fetch:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Songs found from a pasted link or name, each with its Apple Music link (Apple's preview terms) */
.preview-matches {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.preview-match {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-card);
}

.preview-match img {
    border-radius: 6px;
    flex: none;
}

.preview-match-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.preview-match-text .track-name,
.preview-match-text .track-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-source-kind.preview-kind {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.preview-note {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-left: 3px solid var(--accent);
    background: var(--bg-surface);
    font-size: 0.9rem;
}

/* Apple's official badge, unaltered (their identity guidelines), linking to the song */
.store-link {
    display: inline-block;
    margin-top: 4px;
    padding: 3px 0;
    line-height: 0;
}

.store-link img {
    display: block;
}

.lookup-error {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.selected-track-box {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    padding: 0.85rem 1rem;
}

.track-icon-wrapper {
    color: var(--accent);
    background: var(--surface);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--line);
    flex-shrink: 0;
}

.track-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.track-source-kind {
    font-size: 0.75rem;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.track-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--ink-3);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--r-in);
}

.btn-clear:hover {
    color: var(--status-high);
}

/* 4-Stem Melody / Bass Isolation Selector */
.stem-selector-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    margin-top: 0.25rem;
}

.stem-label {
    font-size: 0.75rem;
    color: var(--ink-2);
    font-weight: 600;
}

.stem-pills {
    display: flex;
    gap: 0.35rem;
}

.stem-chip {
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.stem-chip:hover {
    border-color: var(--accent);
    color: var(--ink);
}

.stem-chip.active {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
    font-weight: 600;
}

/* Action Controls (Verb-First Buttons, Solid Flat Fills) */
.action-controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.85rem;
    margin: 0.25rem 0;
}

.btn-analyze {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: var(--r-ctrl);
    padding: 0.65rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 40px;
    transition: opacity 0.15s ease;
}

.btn-analyze:hover:not(:disabled) {
    opacity: 0.92;
}

.btn-analyze:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--raised);
    color: var(--ink-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-ctrl);
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    min-height: 40px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--line);
    color: var(--ink);
}

/* Error Banner */
.error-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid var(--status-high);
    border-radius: var(--r-ctrl);
    padding: 0.85rem 1.15rem;
    color: var(--status-high);
    font-size: 0.875rem;
}

/* Live DSP Processing Card & Active Spinner */
.progress-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: var(--surface);
    border-color: var(--line);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.progress-title {
    font-family: var(--font-head);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
}

.progress-percentage {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
}

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.3s var(--ease);
}

.progress-ticker {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: var(--raised);
    padding: 0.45rem 0.75rem;
    border-radius: var(--r-in);
    border-left: 3px solid var(--accent);
    color: var(--ink-2);
}

.stage-pills-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.stage-pill {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-in);
    font-size: 0.75rem;
    color: var(--ink-3);
}

.stage-pill.active {
    border-color: var(--accent);
    color: var(--ink);
    background: var(--surface);
    font-weight: 600;
}

.stage-pill.completed {
    border-color: var(--status-low);
    color: var(--status-low);
}

/* Active DSP Processing Spinner Animation */
@keyframes spin-cw { to { transform: rotate(360deg); } }
@keyframes spin-ccw { to { transform: rotate(-360deg); } }

.sonalize-spinner[data-running="true"] .ring-a {
    transform-origin: -12px 0;
    animation: spin-cw 1.8s linear infinite;
}

.sonalize-spinner[data-running="true"] .ring-b {
    transform-origin: 12px 0;
    animation: spin-ccw 1.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .sonalize-spinner[data-running="true"] .ring-a,
    .sonalize-spinner[data-running="true"] .ring-b {
        animation: none;
        opacity: 0.75;
    }
}

/* Results Dashboard */
.results-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Hero Score Card */
.hero-score-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.75rem 2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    position: relative;
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-width: 62%;
}

.hero-subheading {
    font-family: var(--font-head);
    font-size: 0.75rem;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.hero-heading {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    width: fit-content;
    background: var(--raised);
    border: 1px solid var(--line-2);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.hero-description {
    font-size: 0.875rem;
    color: var(--ink-2);
    line-height: 1.45;
}

.hero-gauge-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gauge-bg-circle {
    stroke: var(--line);
}

.gauge-progress-circle {
    transition: stroke-dashoffset 0.8s var(--ease);
}

.gauge-value-overlay {
    position: absolute;
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.gauge-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.gauge-pct {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink-2);
    margin-left: 2px;
}

/* Share Proof Action Bar */
.share-proof-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    padding: 0.6rem 0.85rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.share-proof-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-2);
}

.share-proof-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.btn-proof-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 28px;
    padding: 0 0.65rem;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: var(--r-in);
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-proof-action:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Sub-scores Grid */
.sub-scores-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.15rem;
}

@media (max-width: 1280px) {
    .sub-scores-grid { grid-template-columns: repeat(2, 1fr); }
}

.sample-banner {
    border-left: 3px solid var(--status-high, var(--accent));
    margin-bottom: 1.15rem;
}

.sample-text {
    font-size: 0.875rem;
    color: var(--ink-2, var(--ink));
    line-height: 1.5;
}

.sub-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 3px solid var(--line-2);
}

.sub-card.sub-harmonic { border-top-color: var(--track-a); }
.sub-card.sub-melody { border-top-color: var(--accent); }
.sub-card.sub-timbre { border-top-color: var(--track-b); }
.sub-card.sub-groove { border-top-color: var(--status-low); }

.sub-card-top {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sub-card-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sub-weight-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-3);
    background: var(--raised);
    padding: 0.15rem 0.45rem;
    border-radius: var(--r-in);
    border: 1px solid var(--line);
}

.sub-metric-pct {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
}

.sub-title {
    font-family: var(--font-head);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
}

.sub-bar-track {
    width: 100%;
    height: 5px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.sub-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    transition: width 0.4s var(--ease);
}

.sub-details-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.75rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
}

.sub-detail-item {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.detail-label {
    color: var(--ink-2);
    flex-shrink: 0;
}

.detail-val {
    color: var(--ink);
    font-weight: 500;
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Theory Card */
.theory-card {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.section-title {
    font-family: var(--font-head);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink);
}

.section-subtitle {
    font-size: 0.75rem;
    color: var(--ink-2);
}

/* Candidate Overlap Windows (Top-3 Chips) */
.candidate-windows-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.4rem 0.6rem;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
}

.candidate-window-chip {
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    color: var(--ink-2);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.candidate-window-chip:hover {
    border-color: var(--accent);
    color: var(--ink);
}

.candidate-window-chip.active {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
    font-weight: 600;
}

/* Commonplace Cadence Chip */
.cadence-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--raised);
    border: 1px solid var(--line-2);
    color: var(--ink-2);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Synchronised Overlap Crossfader Studio */
.overlap-player-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--elev-card);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.player-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.2rem;
}

.player-desc {
    font-size: 0.75rem;
    color: var(--ink-2);
    line-height: 1.4;
    max-width: 620px;
}

/* Superimposed Waveform & Transient Canvas */
.waveform-transient-container {
    width: 100%;
    height: 90px;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    position: relative;
    overflow: hidden;
}

.waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.waveform-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--ink-2);
    padding: 0.2rem 0.4rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-swatch {
    width: 10px;
    height: 3px;
    border-radius: 2px;
}

.swatch-track-a { background: var(--track-a); }
.swatch-track-b { background: var(--track-b); }
.swatch-transient { background: var(--status-low); }

/* Tonal Strategy Buttons */
.key-strategy-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    padding: 0.5rem 0.75rem;
}

.strategy-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-2);
}

.key-mode-group {
    display: flex;
    gap: 0.4rem;
}

.btn-key-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 28px;
    padding: 0 0.65rem;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: var(--r-ctrl);
    color: var(--ink-2);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-key-mode:hover {
    color: var(--ink);
    border-color: var(--accent);
}

.btn-key-mode.active {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
    font-weight: 600;
}

.player-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.player-buttons-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-player-play {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 32px;
    padding: 0 1rem;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    font-size: 0.8125rem;
    border-radius: var(--r-ctrl);
    border: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.btn-player-play:hover {
    opacity: 0.92;
}

.btn-player-play.is-playing {
    background: var(--status-high);
}

/* Polarity Null Test Button (Ø) */
.btn-null-test {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 32px;
    padding: 0 0.75rem;
    background: var(--raised);
    border: 1px solid var(--line-2);
    border-radius: var(--r-ctrl);
    color: var(--ink-2);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-null-test:hover {
    color: var(--ink);
    border-color: var(--accent);
}

.btn-null-test.active {
    background: var(--status-high);
    color: #FFFFFF;
    border-color: var(--status-high);
}

.btn-export-clip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 32px;
    padding: 0 0.85rem;
    background: var(--raised);
    border: 1px solid var(--line-2);
    border-radius: var(--r-ctrl);
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-export-clip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Crossfader Range Control */
.crossfader-container {
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.crossfader-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.crossfader-label-a { color: var(--track-a-text); }
.crossfader-label-mix {
    font-family: var(--font-mono);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 0.15rem 0.5rem;
    border-radius: var(--r-in);
}
.crossfader-label-b { color: var(--track-b-text); }

.crossfader-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--line-2);
    outline: none;
    cursor: pointer;
}

.crossfader-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.preset-buttons-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.preset-btn {
    flex: 1;
    height: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--r-in);
    cursor: pointer;
    transition: all 0.15s ease;
}

.preset-btn:hover {
    color: var(--ink);
    border-color: var(--line-2);
}

.preset-btn.active-a {
    color: var(--track-a-text);
    border-color: var(--track-a);
    font-weight: 600;
}

.preset-btn.active-mix {
    color: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
}

.preset-btn.active-b {
    color: var(--track-b-text);
    border-color: var(--track-b);
    font-weight: 600;
}

/* Visualisations Grid: Polar Radar, DTW Heatmap, MFCC Contour */
.visualisations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
    margin-top: 0.5rem;
}

.vis-card {
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.vis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vis-title {
    font-family: var(--font-head);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
}

.vis-canvas-container {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Theory Table */
.table-container {
    overflow-x: auto;
}

.theory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.theory-table th, .theory-table td {
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.theory-table th {
    background: var(--raised);
    color: var(--ink-2);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.col-track-a { color: var(--track-a-text) !important; }
.col-track-b { color: var(--track-b-text) !important; }

.param-name {
    color: var(--ink-2);
    font-weight: 600;
    width: 28%;
}

.key-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background: var(--raised);
    border: 1px solid var(--line-2);
    border-radius: var(--r-in);
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--ink);
}

.apparent-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background: var(--raised);
    color: var(--status-low);
    font-weight: 600;
    border-radius: var(--r-in);
    border: 1px solid var(--line-2);
}

/* Structured 2-Column HTML Rows for Forensic Narrative */
.narrative-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.narrative-grid {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    overflow: hidden;
}

.narrative-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.narrative-row:last-child {
    border-bottom: none;
}

.narrative-label {
    padding: 0.75rem 1rem;
    background: var(--raised);
    border-right: 1px solid var(--line);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-2);
}

.narrative-value {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--ink);
    line-height: 1.5;
}

/* Exact About Modal Spec (Section 6 & 7) */
dialog.ontiqo-about {
    width: 360px;
    padding: 28px 24px 24px;
    border-radius: var(--r-sheet);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--elev-card);
    outline: none;
}

dialog.ontiqo-about::backdrop {
    background: rgb(0 0 0 / 0.30);
}

@media (prefers-color-scheme: dark) {
    dialog.ontiqo-about::backdrop {
        background: rgb(0 0 0 / 0.50);
    }
}

.ontiqo-about .about-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--ink-2);
    border-radius: var(--r-ctrl);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ontiqo-about .about-close:hover {
    color: var(--ink);
    background: var(--raised);
}

.ontiqo-about .about-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.ontiqo-about .about-name {
    margin-top: 12px;
    font: 600 20px/1.2 var(--font-head);
    color: var(--ink);
}

.ontiqo-about .about-ver {
    margin-top: 2px;
    font-size: 0.8125rem;
    color: var(--ink-2);
}

.ontiqo-about .about-desc {
    margin-top: 12px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--ink-2);
}

.ontiqo-about .about-links {
    margin-top: 16px;
    font-size: 0.8125rem;
    color: var(--ink-2);
    display: flex;
    justify-content: center;
    gap: 8px;
}

.ontiqo-about .about-links a {
    color: var(--accent);
    text-decoration: none;
}

.ontiqo-about .about-links a:hover {
    text-decoration: underline;
}

.ontiqo-about .about-company {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--ink-2);
}

/* Calm Point-of-Need Unlock Modal Sheet (380px wide, 16px radius) */
dialog.unlock-sheet {
    width: 380px;
    max-width: calc(100vw - 32px);
    padding: 24px;
    border-radius: var(--r-sheet);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--elev-card);
    outline: none;
}

dialog.unlock-sheet::backdrop {
    background: rgb(0 0 0 / 0.35);
}

.unlock-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.unlock-title {
    font-family: var(--font-head);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink);
}

.unlock-desc {
    font-size: 0.875rem;
    color: var(--ink-2);
    line-height: 1.45;
    margin-bottom: 16px;
}

.unlock-dev-box {
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.unlock-dev-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.unlock-dev-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--ink);
    cursor: pointer;
}

.unlock-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Settings Modal Dialog */
dialog.settings-modal {
    width: 440px;
    max-width: calc(100vw - 32px);
    padding: 24px;
    border-radius: var(--r-sheet);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--elev-card);
    outline: none;
}

dialog.settings-modal::backdrop {
    background: rgb(0 0 0 / 0.35);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.settings-title {
    font-family: var(--font-head);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink);
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.settings-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
}

.theme-options {
    display: flex;
    background: var(--raised);
    padding: 3px;
    border-radius: var(--r-ctrl);
    border: 1px solid var(--line);
}

.theme-btn {
    flex: 1;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--ink-2);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.theme-btn.active {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.licence-status-box {
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.licence-status-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
}

.licence-status-desc {
    font-size: 0.75rem;
    color: var(--ink-2);
    line-height: 1.4;
}

/* Footer & Legal Line */
.app-footer {
    margin-top: auto;
    padding: 1.5rem 1.25rem;
    border-top: 1px solid var(--line);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
}

.footer-links a {
    color: var(--ink-2);
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-legal-row {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    color: var(--ink-3);
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .dropzones-grid {
        grid-template-columns: 1fr;
    }
    .sub-scores-grid {
        grid-template-columns: 1fr;
    }
    .visualisations-grid {
        grid-template-columns: 1fr;
    }
    .hero-score-card {
        flex-direction: column;
        gap: 1.25rem;
        align-items: flex-start;
        padding: 1.25rem;
    }
    .hero-left {
        max-width: 100%;
    }
    .hero-gauge-wrapper {
        align-self: center;
    }
    .narrative-row {
        grid-template-columns: 1fr;
    }
    .narrative-label {
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    .navbar-actions {
        width: 100%;
        justify-content: space-between;
    }
    .main-container {
        padding: 1rem 0.75rem 2rem;
    }
    .action-controls-row {
        flex-direction: column;
        width: 100%;
    }
    .btn-analyze, .btn-secondary {
        width: 100%;
    }
    .theory-table th, .theory-table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.75rem;
    }
}

/* Sonalize Clearance Radar & Redacted Teaser Styles (Blueprint Page 4, 8 & 9) */
.catalogue-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.catalogue-intro-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.catalogue-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(41, 171, 226, 0.12);
    color: var(--ink-2);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    width: fit-content;
}

.catalogue-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink);
}

.catalogue-desc {
    font-size: 0.875rem;
    color: var(--ink-2);
    line-height: 1.5;
}

.skip-id-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--ink-2);
}





/* Redacted Teaser Result Card (Page 9) */
.teaser-result-card {
    background: var(--surface);
    border: 1.5px solid var(--score-mid);
    border-radius: var(--r-card);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 0 8px 24px rgba(238, 138, 51, 0.12);
}

.teaser-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.teaser-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(238, 138, 51, 0.15);
    color: var(--score-mid);
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
}

.teaser-peak-metric {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
}

.teaser-candidates-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.teaser-candidate-row {
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.redacted-block {
    display: inline-block;
    background: #3A3D40;
    color: #3A3D40;
    user-select: none;
    border-radius: 4px;
    padding: 0.1rem 0.5rem;
    font-family: monospace;
    letter-spacing: 0.1em;
}

.candidate-meta-tags {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: var(--ink-2);
}

.candidate-score-badge {
    background: rgba(238, 138, 51, 0.12);
    color: var(--score-mid);
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Unlock CTA Box (Pricing Tiers) */
.unlock-cta-box {
    background: var(--raised);
    border: 1px solid var(--line-2);
    border-radius: var(--r-ctrl);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.unlock-cta-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
}

.pricing-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
}

.pricing-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    transition: border-color 0.15s ease;
}

.pricing-card:hover {
    border-color: var(--accent);
}

.pricing-card-popular {
    border-color: var(--accent);
    background: rgba(238, 138, 51, 0.04);
}

.pricing-title {
    font-size: 0.8125rem;
    color: var(--ink-2);
    font-weight: 600;
}

.pricing-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
}

.pricing-sub {
    font-size: 0.75rem;
    color: var(--ink-3);
}

.btn-unlock-tier {
    margin-top: 0.5rem;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.btn-unlock-tier:hover {
    opacity: 0.9;
}

.btn-unlock-popular {
    background: var(--accent);
}

/* 20-File Local Folder Cap Notification */
.folder-cap-notice {
    background: rgba(41, 171, 226, 0.08);
    border: 1px solid rgba(41, 171, 226, 0.3);
    border-radius: var(--r-ctrl);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--ink);
    gap: 1rem;
}


/* Placeholder for features that are not built yet */
.coming-soon-card { max-width: 600px; margin: 0 auto; padding: 24px; }
.coming-soon-text { margin-top: 12px; color: var(--ink-2); line-height: 1.5; }

.candidate-windows-label { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); margin-right: 4px; }

/* Check a folder */
.batch-results { overflow-x: auto; }
.batch-table { min-width: 640px; }
.batch-flag { color: var(--score-high); font-weight: 600; font-size: 0.75rem; }
.batch-verdict { color: var(--ink-2); font-size: 0.75rem; }

/* Recent comparisons */
.recent-cases { padding: 0.9rem 1.15rem; }
.recent-cases-title { cursor: pointer; font-weight: 600; color: var(--ink); }
.recent-cases-note { font-size: 0.8125rem; color: var(--ink-2); margin: 0.5rem 0; }
.recent-cases-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.recent-case { display: flex; gap: 0.5rem; align-items: center; }
.recent-case-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-ctrl); padding: 0.5rem 0.75rem; color: var(--ink); cursor: pointer; }
.recent-case-open:hover { border-color: var(--accent); }
.recent-case-names { font-size: 0.875rem; font-weight: 600; overflow-wrap: anywhere; }
.recent-case-meta { font-size: 0.75rem; color: var(--ink-2); }

/* About: fade in with the backdrop */
dialog.ontiqo-about[open] { animation: about-in 160ms var(--ease); }
dialog.ontiqo-about[open]::backdrop { animation: about-fade 160ms ease-out; }
@keyframes about-in { from { opacity: 0; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes about-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    dialog.ontiqo-about[open], dialog.ontiqo-about[open]::backdrop { animation: none; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Shared result (proof link) */
.shared-result { display: flex; flex-direction: column; gap: 0.75rem; overflow-x: auto; }
.shared-note { font-size: 0.875rem; color: var(--ink-2); line-height: 1.5; }
.shared-score strong { font-size: 1.5rem; color: var(--ink); }
.shared-score span { color: var(--ink-2); }
.receipt-pill { border-radius: 999px; padding: 0.45rem 0.9rem; font-size: 0.875rem; font-weight: 600; border: 1px solid var(--line-2); }
.receipt-pill.ok { color: var(--score-low); border-color: var(--score-low); }
.receipt-pill.mismatch { color: var(--score-high); border-color: var(--score-high); }

/* Hero lockup (empty state) */
.hero-lockup { display: flex; align-items: center; gap: 1.25rem; padding: 0.5rem 0.25rem; color: var(--ink); }
.hero-mark { flex-shrink: 0; color: var(--ink); line-height: 0; }
.hero-mark svg { height: 120px; width: auto; display: block; }
.hero-headline { font-family: var(--font-head); font-size: 1.5rem; font-weight: 600; color: var(--ink); margin: 0 0 0.25rem; }
.hero-sub { font-size: 1rem; color: var(--ink-2); margin: 0; line-height: 1.5; }
@media (max-width: 600px) {
    .hero-lockup { flex-direction: column; text-align: center; }
}

/* Printed / PDF report: the result only, in light colours whatever the theme */
.print-watermark { display: none; }
@media print {
    :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
        --ground: #FFFFFF !important; --surface: #FFFFFF !important; --raised: #F9F9F9 !important;
        --line: #DDDDDD !important; --line-2: #CCCCCC !important;
        --ink: #111111 !important; --ink-2: #444444 !important; --ink-3: #555555 !important;
        --accent: #222222 !important; --track-a-text: #222222 !important; --track-b-text: #222222 !important;
        --score-high: #B91C1C !important; --score-mid: #A3530D !important; --score-low: #2C6E49 !important;
        --elev-card: none !important;
    }
    body { background: #FFFFFF !important; }
    .navbar, .mode-tabs-bar, .dropzones-grid, .action-controls-row, .recent-cases, .hero-lockup,
    .progress-card, .share-proof-bar, .feedback-toast, .overlap-player-card, .btn-proof-action, .app-footer, .error-banner, dialog { display: none !important; }
    .card { break-inside: avoid; box-shadow: none !important; }
    .print-watermark { display: block; text-align: center; font-size: 0.75rem; color: #555555; margin: 1rem 0; }
    a { color: inherit; text-decoration: none; }
}

/* Opt-in closer melody check (vocal separation) under the Analyse button */
.closer-melody {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

.closer-melody input {
    margin-top: 3px;
    flex: none;
}

.progress-elapsed {
    flex: none;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

/* Shown by index.html until the app has loaded, then removed */
#boot-splash {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-family: system-ui, sans-serif;
    color: var(--ink-2, #555);
}

#boot-splash .boot-bar {
    width: 180px;
    height: 4px;
    border-radius: 2px;
    background: var(--line, #ddd);
    overflow: hidden;
}

#boot-splash .boot-bar::after {
    content: "";
    display: block;
    width: 40%;
    height: 100%;
    background: var(--accent, #222222);
    animation: boot-slide 1.2s ease-in-out infinite;
}

@keyframes boot-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

@media (prefers-reduced-motion: reduce) {
    #boot-splash .boot-bar::after { animation: none; width: 100%; opacity: 0.5; }
}

/* "Alpha" beside the name while the app is an early version */
.alpha-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    vertical-align: middle;
    text-transform: uppercase;
}
