@font-face {
    font-family: "GSans";
    src: url("/fonts/GSansVar.ttf")
         format("truetype-variations");
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "GSans";
    src: url("/fonts/GSansVar-Italic.ttf")
         format("truetype-variations");
    font-weight: 100 700;
    font-style: italic;
    font-display: swap;
}

:root {
  --bg: #0b1220;
  --panel: #111a2e;
  --panel-light: #16223c;
  --accent: #3b82f6;
  --accent-soft: #60a5fa;
  --text: #e6edf6;
  --text-dim: #9fb0cc;
  --border: #22304f;
  --success: #22c55e;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: "GSans", "Segoe UI", Arial, sans-serif;
    margin: 0;
    background: linear-gradient(180deg, #0b1220, #0e1730);
    color: var(--text);
    padding: 20px;
}

.container { max-width: 900px; margin: auto; padding: 24px 0 40px;}

/* ---- nav strip ---- */
.nav {
    display: table;
    gap: 8px;
    margin-bottom: 20px;
}

.nav a {
    display: inline-block;
    padding: 8px 16px;
    background: var(--panel);
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--border);
    transition: all .15s ease;
}

.nav a:hover {
    background: var(--panel-light);
    color: var(--text);
}

.nav a.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ---- sections ---- */
.section {
    margin-bottom: 20px;
    padding: 18px;
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

h1, h3, h5 {
    margin-bottom: 6px;
    margin-top: 0;
    font-weight: 600;
    color: #ffffff;
}

label { 
    display: block; 
    margin-top: 10px; 
    color: var(--text-dim);
}

input[type="number"],
select, #startTime, #endTime,
input[type="file"] {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    background: var(--panel-light);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* ---- radio mode toggle ---- */
.mode-toggle {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.mode-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-top: 0;
    padding: 8px 14px;
    background: var(--panel-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dim);
}

.mode-toggle input[type="radio"] { width: auto; }

.mode-toggle label:has(input:checked) {
    border-color: var(--accent);
    background: rgba(59,130,246,0.15);
    color: var(--accent-soft);
}

/* ---- time row ---- */
.time-row {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.time-row .field { flex: 1; }

.time-row .field label {
    margin-top: 0;
    font-size: 13px;
    color: var(--text-dim);
}

/* ---- button ---- */
button {
    margin-top: 20px;
    padding: 12px;
    background: var(--accent);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all .2s ease;
}

button:hover {
    background: var(--accent-soft);
}

/* ---- progress ---- */
#progressContainer {
    width: 100%;
    height: 10px;
    background: #0a0f1c;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 15px;
}

#progressBar {
    height: 100%;
    width: var(--progress-width, 0%);
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.2s;
}

#progressText {
    color: #fff;
    font-weight: bold;
    font-size: 13px;
}

/* ---- misc output ---- */
.output { margin-top: 15px; font-size: 14px; color: var(--text-dim); }

.hint   { font-size: 13px; color: var(--text-dim); margin-top: 6px; }

.status-done { color: var(--success); font-weight: bold; }

.status-text { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ---- log panel ---- */
#log {
    line-height: 18px;
    height: calc(18px * 30);
    overflow-y: auto;
    overflow-x: hidden;
    font-family: monospace;
    padding: 10px;
    border: 1px solid var(--border);
    background: #0a0f1c;
    color: #cfe3ff;
    white-space: pre-wrap;
    border-radius: 8px;
    margin-top: 10px;
}


/* FOOTER */
.footer {
    margin-top: 40px;
    padding: 20px;
    background: var(--panel);
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
}

/* COOKIE BANNER */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(17, 26, 46, 0.98);
    border-top: 1px solid var(--border);
    padding: 16px;
    z-index: 9999;
    backdrop-filter: blur(8px);
    display:none;
}
.cookie-banner.cookie-banner-visible {
    display: block;
}
.cookie-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
}

.cookie-text {
    flex: 1;
    min-width: 260px;
    color: var(--text-dim);
    font-size: 13px;
}

/* toggles */
.cookie-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text);
    background: var(--panel-light);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.cookie-option input {
    transform: scale(1.1);
}

/* buttons */
.cookie-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cookie-btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 13px;
    background: var(--panel-light);
    color: var(--text);
}

.cookie-accept {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.cookie-reject {
    background: transparent;
}

.footer {
    margin-top: 40px;
    padding: 24px 20px;
    background: var(--panel);
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
}

/* layout */
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

.footer h4 {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text);
}

/* links */
.footer a {
    display: block;
    color: var(--text-dim);
    text-decoration: none;
    margin: 3px 0;
}

.footer a:hover {
    color: var(--accent-soft);
}

/* message form */
.msg-box {
    margin-top: 8px;
    display: flex;
    gap: 6px;
}

.msg-box input {
    flex: 1;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel-light);
    color: var(--text);
    font-size: 12px;
}

.msg-box button {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-size: 12px;
}

.msg-status {
    transition: color .15s ease;
}

.msg-status-ok {
    color: #9fb0cc;
}

.msg-status-error {
    color: #f87171;
}

/* ============================================================
   Disabled button state
============================================================ */

.is-disabled {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

/* bottom line */
.footer-bottom {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.hidden {
    display: none;
}

.mt8 {
    margin-top: 8px;
}

.mt12 {
    margin-top: 12px;
}

.mt30 {
    margin-top: 30px;
}

.maxw120 {
    max-width: 120px;
}

/* ============================================================
   logger.css
   CSP-safe styles for logger.js
============================================================ */

/* ------------------------------------------------------------
   normal log lines
------------------------------------------------------------ */

.log-line {
    padding: 4px 8px;
    border-bottom: 1px solid #222;
    color: #ccc;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ------------------------------------------------------------
   JSON containers
------------------------------------------------------------ */

.json-container {
    margin-left: calc(var(--json-depth, 0) * 12px);
    font-family: monospace;
}

/* ------------------------------------------------------------
   collapsible titles
------------------------------------------------------------ */

.json-toggle {
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}

.json-toggle-object {
    color: #6cf;
}

.json-toggle-array {
    color: #fc6;
}

/* ------------------------------------------------------------
   rows / values
------------------------------------------------------------ */

.json-row {
    padding: 2px 0;
    color: #ddd;
}

.json-key {
    color: #9f9;
}

/* ------------------------------------------------------------
   array items
------------------------------------------------------------ */

.json-array-item {
    padding: 2px 0;
    color: #ccc;
}

.vidRes1{
    display:flex; 
    align-items:center; 
    gap:10px; 
    margin-bottom:8px;
}

.vidContr{
    width:100%; 
    max-width:480px; 
    border-radius:6px; 
}


/* ------------------------------------------------------------
   Download items
------------------------------------------------------------ */

.download-item {
    margin-top: 14px;
}

/* ------------------------------------------------------------
   Download all button
------------------------------------------------------------ */

.download-all-btn {
    margin-top: 18px;
    padding: 12px 20px;
    width: 100%;

    background: #28a745;
    border: none;

    color: #fff;
    font-size: 15px;
    font-weight: bold;

    cursor: pointer;
    border-radius: 6px;

    transition: background .15s ease;
}

.download-all-btn:hover {
    background: #218838;
}

.download-all-btn.is-disabled {
    opacity: 0.7;
    cursor: wait;
}

/* ------------------------------------------------------------
   Hidden anchor for downloads
------------------------------------------------------------ */

.hidden-download-anchor {
    display: none;
}


/* ------------------------------------------------------------
   custom resolution panel
------------------------------------------------------------ */

#customRes {
    transition: opacity .15s ease;
}

/* ------------------------------------------------------------
   audio/video settings panels
------------------------------------------------------------ */

#videoSettingsPanel,
#audioSettingsPanel {
    transition: opacity .15s ease;
}

/* ------------------------------------------------------------
   FLAC hint
------------------------------------------------------------ */

#flacHint {
    transition: opacity .15s ease;
}

/* ------------------------------------------------------------
   safer button disabled visuals
------------------------------------------------------------ */

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ------------------------------------------------------------
   optional fade utility
------------------------------------------------------------ */

.fade-panel {
    transition:
        opacity .15s ease,
        transform .15s ease;
}

/* Bitrate mode radios */
#bitrateModeGroup .radioGroup,
#bitrateModeRow .radioGroup {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

#bitrateModeGroup .radioGroup label,
#bitrateModeRow .radioGroup label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    line-height: 1.2;
    margin: 0;
}

#bitrateModeGroup input[type="radio"],
#bitrateModeRow input[type="radio"] {
    margin: 0;
    vertical-align: middle;
    position: relative;
    top: -1px; /* fine alignment tweak */
    flex-shrink: 0;
}
#mergeList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#mergeList .section {
    margin: 0;
    cursor: move;
}

body.loading::before {
    content: "Loading processing engine... (this may take a few minutes)";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 9999;
}


#startBtn {
        width: 100%;
}


/* FIX FOOTER MESSAGE BOX ALIGNMENT */
.msg-box {
    align-items: center;
}

.msg-box input {
    margin-top: 0 !important;
    padding: 6px 8px;   /* override global 8px */
    height: 32px;
    line-height: 1;
}

.msg-box button {
    margin-top: 0 !important;  /* kills global button rule */
    padding: 6px 10px;         /* match compact footer UI */
    font-size: 12px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-lang {
    display: flex;
    align-items: center;
    gap: 10px;
}



/* =========================================================
   Draggable cursor
   ========================================================= */

#timelineCursor {
    position: absolute;

    top: 0;
    bottom: 0;

    width: 2px;

    background: #ffeb3b;

    cursor: ew-resize;

    left: var(--tl-cursor-left, 0%);

    z-index: 20;

    box-shadow:
        0 0 4px rgba(255,235,59,0.6),
        0 0 10px rgba(255,235,59,0.25);
}

#timelineCursor::before {
    content: '';

    position: absolute;

    left: -7px;
    right: -7px;
    top: 0;

    height: 100%;

    cursor: ew-resize;
}

#timelineCursor::after {
    content: '';

    position: absolute;

    top: -4px;
    left: -5px;

    width: 12px;
    height: 8px;

    background: #ffeb3b;

    border-radius: 2px;

    box-shadow: 0 0 6px rgba(255,235,59,0.35);
}

/* =========================================================
   Legend
   ========================================================= */

#timelineLegend {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #aaa;
    margin-top: 6px;
    align-items: center;
    flex-wrap: wrap;
}

#timelineRangeHint {
    margin-left: auto;
    color: #888;
}

.lg-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.08),
        0 1px 2px rgba(0,0,0,0.25);
}

.lg-swatch--video {
    background: #e74c3c;
}

.lg-swatch--audio {
    background: #27ae60;
}

.lg-swatch--text {
    background: #3498db;
}

/* =========================================================
   Position input
   ========================================================= */

.tl-pos-input {
    width: 9em;
}

/* =========================================================
   Trim buttons
   ========================================================= */

#timelineSection button {
    margin-left: 6px;
}

/* =========================================================
   Responsive safety
   ========================================================= */

@media (max-width: 900px) {

    #timelineLabels {
        width: 120px;
    }

    .tl-label {
        font-size: 11px;
    }

    #timelineLegend {
        gap: 8px;
    }
}


/* ============================================================
   Compact mux cards
============================================================ */

.mux-track-controls {
    display: grid;
    grid-template-columns: 1.4fr auto;
    gap: 10px 14px;
    align-items: center;
    margin-top: 8px;
}

.mux-meta-row {
    min-width: 0;
}

.mux-time-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mux-time-row input {
    width: 110px;
}

.mux-speed-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
}

.mux-speed-wrap input[type="range"] {
    width: 120px;
}

.mux-track-controls label {
    margin-top: 0;
    font-size: 12px;
}

.mux-track-controls input[type="text"],
.mux-track-controls input[type="number"] {
    padding: 6px 8px;
    height: 32px;
    margin-top: 0;
}

.mux-subtitle-options {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.mux-preview {
    margin-top: 6px;
    font-size: 12px;
}



/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {
    .mux-track-controls {
        grid-template-columns: 1fr;
    }

    .mux-track-controls > div {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    .mux-track-controls > div:has(.mux-start),
    .mux-track-controls > div:has(.mux-end),
    .mux-track-controls > div:has(.mux-offset) {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Compact mux cards
============================================================ */

.mux-track-controls {
    display: grid;
    grid-template-columns: 1.4fr auto;
    gap: 10px 14px;
    align-items: center;
    margin-top: 8px;
}

.mux-meta-row {
    min-width: 0;
}

.mux-time-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mux-time-row input {
    width: 110px;
}

.mux-speed-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
}

.mux-speed-wrap input[type="range"] {
    width: 120px;
}

.mux-track-controls label {
    margin-top: 0;
    font-size: 12px;
}

.mux-track-controls input[type="text"],
.mux-track-controls input[type="number"] {
    padding: 6px 8px;
    height: 32px;
    margin-top: 0;
}

.mux-subtitle-options {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.mux-preview {
    margin-top: 6px;
    font-size: 12px;
}



/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {
    .mux-track-controls {
        grid-template-columns: 1fr;
    }

    .mux-track-controls > div {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    .mux-track-controls > div:has(.mux-start),
    .mux-track-controls > div:has(.mux-end),
    .mux-track-controls > div:has(.mux-offset) {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Compact mux cards
============================================================ */

.mux-card-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.mux-card-main {
    min-width: 0;
}

.mux-card-side {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    justify-content: center;
}

.mux-file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mux-file-meta {
    margin-top: 4px;
}

.mux-time-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.mux-field {
    display: flex;
    flex-direction: column;
    min-width: 110px;
}

.mux-field label {
    margin-top: 0;
    margin-bottom: 4px;
    font-size: 12px;
}

.mux-field input {
    margin-top: 0 !important;
    height: 32px;
    padding: 6px 8px;
}

/* Offset input + "Get File" button side-by-side */
.mux-offset-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mux-offset-row .mux-offset {
    flex: 1;
    min-width: 80px;
    max-width: 110px;
}

.mux-get-file-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    margin-top: 0;
}

/* Download link produced by "Get File" */
.mux-getfile-dl {
    margin-top: 6px;
    font-size: 12px;
}

.mux-getfile-dl.hidden {
    display: none;
}

.mux-speed-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.mux-speed-wrap label {
    margin: 0;
    font-size: 12px;
}

.mux-speed-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mux-speed-inline input[type="range"] {
    width: 130px;
}

.mux-speed-value {
    min-width: 42px;
    text-align: right;
    font-size: 13px;
    color: var(--text-dim);
}

.mux-subtitle-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.mux-subtitle-options label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

@media (max-width: 760px) {

    .mux-card-grid {
        grid-template-columns: 1fr;
    }

    .mux-card-side {
        align-items: stretch;
    }

    .mux-speed-wrap {
        align-items: stretch;
    }

    .mux-subtitle-options {
        justify-content: flex-start;
    }

    .mux-speed-inline input[type="range"] {
        width: 100%;
    }
}

    #startBtn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: opacity .2s ease;
    }

#startBtn.loadingBtn {
        pointer-events: none;
        opacity: 0.85;
    }

    /* spinner */
    #startBtn.loadingBtn::after {
        content: "";
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255,255,255,.35);
        border-top-color: #fff;
        border-radius: 50%;
        animation: compressSpin .7s linear infinite;
    }

    /* optional text dim */
    #startBtn.loadingBtn span {
        opacity: 0.9;
    }

    @keyframes compressSpin {
        to {
            transform: rotate(360deg);
        }
    }

/* ============================================================
   demuxer.css
   Styles specific to the Browser Media Demuxer.
   Complements avrJ.css — assumes a dark slate theme.
   No inline styles (strict CSP).
   ============================================================ */

/* ── detected-stream cards (pre-extraction) ──────────────── */

.dmx-stream-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.dmx-stream-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.dmx-stream-detail {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 56ch;
}

/* ── result cards (post-extraction) ──────────────────────── */

.dmx-result-card {
    border-left: 3px solid #334155;
}

.dmx-result-card--error {
    border-left-color: #ef4444;
    opacity: 0.8;
}

.dmx-result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dmx-result-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.dmx-result-meta {
    font-size: 0.78rem;
    margin-left: auto;
}

/* ── type badges ─────────────────────────────────────────── */

.dmx-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.48rem;
    border-radius: 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.5;
    flex-shrink: 0;
}

.dmx-badge--video {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.32);
}

.dmx-badge--audio {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.32);
}

.dmx-badge--subtitle {
    background: rgba(139, 92, 246, 0.18);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.32);
}

/* ── media players ───────────────────────────────────────── */

.dmx-player-wrap {
    width: 100%;
}

video.dmx-player {
    width: 100%;
    max-height: 380px;
    border-radius: 0.375rem;
    background: #000;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

audio.dmx-player {
    width: 100%;
    display: block;
}

/* ── subtitle preview ────────────────────────────────────── */

.dmx-sub-preview {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0.375rem;
    padding: 0.7rem 0.9rem;
    max-height: 9rem;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #94a3b8;
    line-height: 1.55;
}

/* ── download row ────────────────────────────────────────── */

.dmx-dl-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.dmx-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.9rem;
    border-radius: 0.375rem;
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.28);
    text-decoration: none;
    font-size: 0.83rem;
    font-weight: 500;
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.dmx-dl-btn:hover {
    background: rgba(59, 130, 246, 0.26);
    border-color: rgba(59, 130, 246, 0.52);
    text-decoration: none;
}

/* ── file size label inside dl row ──────────────────────── */

.dmx-size-label {
    font-size: 0.78rem;
    opacity: 0.65;
}


.dmx-hidden { 
    display: none !important;
}

/* ── probe waiter (shown right under the file input) ─────── */
 
.dmx-probe-waiter {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.55rem;
    padding: 0.5rem 0.8rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 0.375rem;
    font-size: 0.85rem;
    color: #93c5fd;
}
 
.dmx-probe-waiter-text {
    line-height: 1.3;
}
 
.dmx-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid rgba(147, 197, 253, 0.25);
    border-top-color: #93c5fd;
    display: inline-block;
    animation: dmx-spin 0.8s linear infinite;
    flex-shrink: 0;
}
 
@keyframes dmx-spin {
    to { transform: rotate(360deg); }
}
 
/* ── file size label inside dl row ──────────────────────── */
 
.dmx-size-label {
    font-size: 0.78rem;
    opacity: 0.65;
}
/* ============================================================
   mixer.css
   Styles for the Browser Audio Mixer.
   Complements avrD.css — no inline styles (strict CSP).
   ============================================================ */

/* ── Load actions ─────────────────────────────────────────── */

.mixer-load-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mixer-load-actions button {
    margin-top: 0;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

#clearAllBtn {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.32);
    color: #fca5a5;
}

#clearAllBtn:hover {
    background: rgba(239, 68, 68, 0.26);
    color: #fecaca;
}

/* ── Track card ───────────────────────────────────────────── */

.mixer-track-card {
    margin-bottom: 10px;
}

/* ── Card header ──────────────────────────────────────────── */

.mixer-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.mixer-track-color-dot {
    width: 12px;
    height: 12px;
    min-width: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mixer-track-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.mixer-remove-btn {
    margin-top: 0;
    padding: 3px 10px;
    font-size: 12px;
    line-height: 1.5;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #fca5a5;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    height: auto;
    min-width: unset;
}

.mixer-remove-btn:hover {
    background: rgba(239, 68, 68, 0.24);
}


/* ── Settings grid ────────────────────────────────────────── */

.mixer-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px 16px;
    align-items: end;
}

.mixer-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mixer-field label {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mixer-field input[type="number"] {
    margin-top: 0;
    height: 32px;
    padding: 5px 8px;
    font-size: 13px;
    width: 100%;
}

input[type="range"] {
    width: 100%;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
}

.mix-volume-value,
.mix-speed-value {
    font-size: 11px;
    color: var(--accent-soft);
    font-weight: 600;
    min-width: 36px;
    text-align: right;
}

/* ── Preview line ─────────────────────────────────────────── */

.mixer-preview {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-dim);
    min-height: 16px;
    font-family: monospace;
}



/* ── Checkbox label ───────────────────────────────────────── */

.mixer-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-top: 0;
    color: var(--text);
    font-size: 14px;
}

input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ── Download link ────────────────────────────────────────── */

#downloads a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: 0.4rem;
    background: rgba(59, 130, 246, 0.13);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.28);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 12px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

#downloads a:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
}

/* ── Mixed result inline player ───────────────────────────── */

.mixer-result-player {
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.mixer-result-canvas {
    display: block;
    width: 100%;
    height: 80px;
    background: #0a0f1c;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-top: 0;
    cursor: crosshair;
}

/* ── Result player seek/playhead bar (always visible, draggable) ── */

.mixer-result-seek-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    left: 0%;
    background: #fbbf24;
    box-shadow:
        0 0 5px rgba(251, 191, 36, 0.85),
        0 0 12px rgba(251, 191, 36, 0.35);
    transform: translateX(-50%);
    z-index: 10;
    border-radius: 1px;
    cursor: ew-resize;
    pointer-events: all;
}

.mixer-result-seek-bar::before {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    top: 0;
    height: 100%;
    cursor: ew-resize;
}

.mixer-result-seek-bar::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -5px;
    width: 12px;
    height: 8px;
    background: #fbbf24;
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.4);
}

/* ============================================================
   Mixer Timeline
   (mirrors the muxer timeline but with mix- prefix elements)
   ============================================================ */

#mixTimelineWrap {
    display: flex;
    background: #1a1a1a;
    border: 1px solid #2e2e2e;
    border-radius: 4px;
    padding: 6px 0;
    user-select: none;
    overflow: hidden;
    margin-top: 8px;
}

#mixTimelineLabels {
    flex-shrink: 0;
    width: 160px;
    border-right: 1px solid #2e2e2e;
    background: #181818;
    z-index: 2;
}

#mixTimelineTracks {
    flex: 1;
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.mix-tl-label {
    height: 22px;
    line-height: 22px;
    padding: 0 8px;
    font-size: 12px;
    color: #ddd;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    background: rgba(255,255,255,0.012);
    border-left: 3px solid transparent;
}

.mix-tl-row {
    position: relative;
    height: 22px;
    display: flex;
    align-items: center;
    padding: 0 4px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    overflow: hidden;
}

.mix-tl-row:nth-child(even) {
    background: rgba(255,255,255,0.012);
}

.mix-tl-bar {
    position: absolute;
    height: 14px;
    top: 4px;
    border-radius: 8px;
    min-width: 3px;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.08),
        inset 0 -1px 0 rgba(0,0,0,0.2),
        0 1px 3px rgba(0,0,0,0.3);
    transition: left 120ms ease, width 120ms ease;
    opacity: 0.85;
}

.mix-tl-bar:hover {
    opacity: 1;
    transform: scaleY(1.06);
    z-index: 5;
}

/* ── Timeline cursor ──────────────────────────────────────── */

#mixTimelineCursor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ffeb3b;
    cursor: ew-resize;
    left: 0;
    z-index: 20;
    box-shadow:
        0 0 4px rgba(255, 235, 59, 0.65),
        0 0 10px rgba(255, 235, 59, 0.28);
}

#mixTimelineCursor::before {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    top: 0;
    height: 100%;
    cursor: ew-resize;
}

#mixTimelineCursor::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -5px;
    width: 12px;
    height: 8px;
    background: #ffeb3b;
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(255, 235, 59, 0.4);
}

/* ── Timeline legend / range hint ────────────────────────── */

#mixTimelineLegend {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    align-items: center;
    flex-wrap: wrap;
}

#mixTimelineRangeHint {
    margin-left: auto;
    color: #666;
}

/* Buttons inside combined section need smaller left margins */
#combinedSection button {
    margin-left: 6px;
}


.main-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:24px;
    align-items:start;
}

@media (max-width: 900px){
    .main-grid{
        grid-template-columns:1fr;
    }
}

.result-box{
    min-height:220px;
    word-break:break-word;
}



/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 760px) {
    .mixer-settings-grid {
        grid-template-columns: 1fr 1fr;
    }

    #mixTimelineLabels {
        width: 110px;
    }

    .mix-tl-label {
        font-size: 11px;
    }
}

@media (max-width: 500px) {
    .mixer-settings-grid {
        grid-template-columns: 1fr;
    }

    .mixer-load-actions {
        flex-direction: column;
    }

    .mixer-load-actions button {
        width: 100%;
    }
}

.generator-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    align-items: start;
}

.generator-section .section {
    margin: 0;
}

.password-output {
    position: relative;
    margin-top: 16px;
}

.password-display {
    width: 100%;
    min-height: 90px;
    resize: none;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color: #fff;
    padding: 18px;
    font-size: 1rem;
    line-height: 1.5;
    font-family: monospace;
    overflow-wrap: anywhere;
}

.generator-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.option-row label {
    cursor: pointer;
}

.range-wrapper {
    margin-top: 16px;
}

.range-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.strength-box {
    margin-top: 18px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
}

.strength-bar {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,.08);
    margin-top: 10px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: width .25s ease;
    background: linear-gradient(
        90deg,
        #3b82f6,
        #60a5fa
    );
}

.strength-text {
    margin-top: 10px;
}

.mono {
    font-family: monospace;
}



/* =========================================
   INLINE RESULT SECTION
========================================= */

.result-wrapper {
    margin-top: 28px;
}

#resultSection {
    animation: fadeIn 0.25s ease;
}

#resultSection.hidden {
    display: none;
}

.result-box {
    margin-top: 12px;
}

/* Optional:
   prevents oversized width when grid CSS
   was previously expecting 2 columns
*/
.main-grid {
    grid-template-columns: 1fr !important;
}

/* =========================================================
   CHECKER 2-COLUMN LAYOUT
========================================================= */

.checker-layout{
    display:grid;
    grid-template-columns:minmax(320px, 480px) 1fr;
    gap:24px;
    align-items:start;
}

.inputsection{
    min-width:0;
}

.result-wrapper{
    min-width:0;
    height:100%;
}

#resultSection{
    display:block;
    height:100%;
}

#resultSection.hidden{
    display:none;
}

.result-box{
    min-height:240px;
}

/* MOBILE */
@media (max-width: 900px){

    .checker-layout{
        grid-template-columns:1fr;
    }

    .result-wrapper{
        margin-top:12px;
    }
}

@media (max-width: 900px) {

    .generator-grid {
        grid-template-columns: 1fr;
    }

}