/* ==========================================================================
   LUMEN — HLS Player Console
   A quiet, broadcast-inspired interface built around the picture.
   ========================================================================== */

:root {
    color-scheme: dark;
    --bg: #070a08;
    --bg-raised: #0b0f0c;
    --panel: #0e1310;
    --panel-soft: #111813;
    --panel-bright: #151d16;
    --line: rgba(228, 255, 236, 0.09);
    --line-strong: rgba(228, 255, 236, 0.16);
    --text: #edf3ec;
    --text-soft: #c2cdc3;
    --muted: #96a499;
    --dim: #6f7c71;
    --accent: #d7ff72;
    --accent-deep: #b7e84a;
    --accent-ink: #0a0f07;
    --live: #ff5e4d;
    --cyan: #8ce7d5;
    --danger: #ff8174;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    --radius: 20px;
    --mono: "Cascadia Mono", "SFMono-Regular", "Roboto Mono", Consolas, monospace;
    --sans: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(1200px 700px at 50% -20%, rgba(53, 80, 56, 0.16), transparent 60%),
        var(--bg);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.24;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse at 50% 0%, black 10%, transparent 75%);
}

::selection {
    color: var(--accent-ink);
    background: var(--accent);
}

[hidden] {
    display: none !important;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.ambient {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(100px);
}

.ambient--top {
    width: 620px;
    height: 340px;
    top: -220px;
    left: 15%;
    background: rgba(155, 211, 92, 0.1);
}

.ambient--side {
    width: 380px;
    height: 500px;
    top: 38%;
    right: -300px;
    background: rgba(84, 158, 134, 0.08);
}

.app-shell {
    width: min(100%, 1660px);
    margin: 0 auto;
    padding: 0 34px 36px;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
    height: 88px;
    display: flex;
    align-items: center;
    gap: 28px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex: none;
    border-radius: 10px;
}

.brand-mark {
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    color: var(--accent-ink);
    background: var(--accent);
    border-radius: 11px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset, 0 8px 30px rgba(155, 223, 62, 0.16);
}

.brand-mark svg {
    width: 29px;
    height: 29px;
}

.brand-type {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-word {
    font-size: 17px;
    font-weight: 650;
    line-height: 1;
    letter-spacing: 0.18em;
}

.brand-sub {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.19em;
    line-height: 1.2;
}

.brand-badge {
    align-self: flex-start;
    margin-top: 4px;
    padding: 2px 5px;
    color: var(--accent);
    border: 1px solid rgba(215, 255, 114, 0.28);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 7.5px;
    letter-spacing: 0.1em;
}

.topbar-center {
    display: flex;
    flex: 1;
    justify-content: center;
}

.console-path {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.12em;
}

.console-path .faint {
    color: var(--dim);
    margin: 0 3px;
}

.pulse-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(215, 255, 114, 0.09);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: none;
}

.engine-tag {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.engine-tag b {
    color: var(--muted);
    font-weight: 500;
}

.health {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    color: var(--text-soft);
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.025);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.09em;
    white-space: nowrap;
}

.health-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 9px rgba(215, 255, 114, 0.7);
}

.health.is-offline {
    color: var(--danger);
    border-color: rgba(255, 129, 116, 0.18);
}

.health.is-offline .health-dot {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(255, 129, 116, 0.5);
}

/* --------------------------------------------------------------------------
   Source panel
   -------------------------------------------------------------------------- */

.source-panel {
    position: relative;
    margin-top: 24px;
    padding: 25px 28px 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.025), transparent 42%),
        linear-gradient(180deg, #0e1410, #0b0f0c);
}

.source-panel::after {
    content: "";
    position: absolute;
    top: 0;
    left: 28px;
    width: 78px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.source-intro {
    display: grid;
    grid-template-columns: auto minmax(240px, 1fr) auto;
    align-items: end;
    gap: 28px;
    margin-bottom: 20px;
}

.section-kicker {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.16em;
    white-space: nowrap;
}

.section-kicker span {
    color: var(--accent);
}

.source-copy h1 {
    margin: 6px 0 3px;
    font-size: clamp(24px, 2.1vw, 31px);
    font-weight: 450;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.source-copy h1 em {
    color: var(--accent);
    font-style: normal;
    font-weight: 500;
}

.source-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 11.5px;
    letter-spacing: 0.01em;
}

.secure-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 18px;
    border-left: 1px solid var(--line);
    color: var(--dim);
    font-family: var(--mono);
    font-size: 8.5px;
    line-height: 1.7;
    letter-spacing: 0.015em;
    white-space: nowrap;
}

.secure-note b {
    color: var(--muted);
    font-weight: 500;
}

.secure-icon {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    color: var(--accent);
    border: 1px solid rgba(215, 255, 114, 0.16);
    border-radius: 50%;
    background: rgba(215, 255, 114, 0.05);
}

.secure-icon svg {
    width: 15px;
    height: 15px;
}

.source-form {
    display: flex;
    align-items: stretch;
    gap: 9px;
}

.url-field {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: 58px;
    padding: 0 10px 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: rgba(4, 7, 5, 0.64);
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.url-field:focus-within {
    border-color: rgba(215, 255, 114, 0.48);
    background: rgba(5, 9, 6, 0.86);
    box-shadow: 0 0 0 4px rgba(215, 255, 114, 0.05);
}

.protocol-tag {
    display: inline-flex;
    flex: none;
    align-items: center;
    height: 27px;
    padding: 0 8px;
    color: var(--accent);
    border: 1px solid rgba(215, 255, 114, 0.19);
    border-radius: 6px;
    background: rgba(215, 255, 114, 0.055);
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.11em;
}

#sourceInput {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    color: var(--text);
    border: 0;
    outline: 0;
    background: transparent;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: -0.015em;
}

#sourceInput::placeholder {
    color: #5f6d63;
    opacity: 1;
}

.slash-hint {
    display: grid;
    width: 20px;
    height: 20px;
    flex: none;
    place-items: center;
    color: var(--dim);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 9px;
    opacity: 0.9;
}

.field-button {
    display: grid;
    width: 33px;
    height: 33px;
    flex: none;
    place-items: center;
    padding: 0;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.field-button svg {
    width: 17px;
    height: 17px;
}

.field-button:hover {
    color: var(--text);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.load-button {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 22px;
    min-width: 151px;
    height: 58px;
    padding: 0 19px;
    color: var(--accent-ink);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 13px;
    background: var(--accent);
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 30px rgba(163, 225, 58, 0.1);
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.load-button svg {
    width: 17px;
    height: 17px;
    transition: transform 160ms ease;
}

.load-button:hover {
    background: #e5ff98;
    box-shadow: 0 10px 38px rgba(163, 225, 58, 0.2);
}

.load-button:hover svg {
    transform: translateX(2px);
}

.load-button:active {
    transform: translateY(1px);
}

.load-button.is-loading {
    cursor: progress;
}

.load-button.is-loading svg {
    animation: button-spin 1.2s linear infinite;
}

.transport-button {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 81px;
    height: 58px;
    padding: 0 10px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.025);
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.08em;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.transport-button:hover {
    color: var(--text);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.045);
}

.transport-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px rgba(140, 231, 213, 0.58);
}

.transport-button.is-proxy .transport-dot {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(215, 255, 114, 0.6);
}

.transport-button.is-direct .transport-dot {
    background: var(--muted);
    box-shadow: none;
}

.tiny-chevron {
    width: 12px !important;
    height: 12px !important;
    color: var(--dim);
}

.source-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 13px;
}

.demo-line {
    display: flex;
    align-items: center;
    gap: 12px;
}

.micro-label {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.14em;
    white-space: nowrap;
}

.demo-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    color: var(--text-soft);
    border: 0;
    background: transparent;
    font-size: 10.5px;
    transition: color 160ms ease;
}

.demo-link svg {
    width: 12px;
    height: 12px;
    color: var(--accent);
    transition: transform 160ms ease;
}

.demo-link:hover {
    color: var(--accent);
}

.demo-link:hover svg {
    transform: translate(1px, -1px);
}

.capability-line {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7.5px;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.capability-line span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.capability-line span + span::before {
    content: "/";
    margin-right: 14px;
    color: #354038;
}

.capability-line i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 7px rgba(215, 255, 114, 0.55);
}

/* Request headers ---------------------------------------------------------- */

.request-panel {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    animation: panel-in 180ms ease both;
}

.request-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.request-head h3 {
    margin: 3px 0 0;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.request-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 13px;
}

.request-fields label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.request-fields input {
    width: 100%;
    height: 38px;
    padding: 0 11px;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: 0;
    background: rgba(3, 6, 4, 0.64);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: normal;
    transition: border-color 160ms ease;
}

.request-fields input:focus {
    border-color: rgba(215, 255, 114, 0.4);
}

.request-fields input::placeholder {
    color: #4c584f;
}

.request-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 12px;
}

.request-foot p {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--dim);
    font-size: 9.5px;
}

.request-foot p svg {
    width: 13px;
    height: 13px;
    flex: none;
    color: var(--accent);
}

.request-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
}

.text-button {
    padding: 0;
    color: var(--muted);
    border: 0;
    background: transparent;
    font-size: 10.5px;
    transition: color 160ms ease;
}

.text-button:hover {
    color: var(--text);
}

.solid-button,
.outline-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 550;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.solid-button {
    color: var(--accent-ink);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: var(--accent);
}

.solid-button:hover {
    background: #e5ff98;
}

.solid-button svg,
.outline-button svg {
    width: 14px;
    height: 14px;
}

.solid-button.compact {
    height: 33px;
    padding: 0 13px;
    font-size: 9.5px;
}

.outline-button {
    color: var(--text);
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.045);
}

.outline-button:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------------------------
   Main stage
   -------------------------------------------------------------------------- */

.stage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 324px;
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

.player-column {
    min-width: 0;
}

.player-shell {
    min-width: 0;
}

.player-frame {
    position: relative;
    isolation: isolate;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 300px;
    overflow: hidden;
    color: #fff;
    border: 1px solid rgba(226, 255, 234, 0.11);
    border-radius: var(--radius);
    background: #020403;
    box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.player-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #020403;
    transform: rotate(var(--rotation, 0deg)) scale(var(--rotation-scale, 1));
    transition: transform 220ms ease;
}

.player-frame video::cue {
    color: #f7fff4;
    background: rgba(4, 8, 5, 0.78);
    font-family: var(--sans);
    font-size: 96%;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.player-frame:fullscreen {
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: #000;
}

.player-frame:fullscreen video {
    object-fit: contain;
}

.player-frame.is-theater {
    aspect-ratio: 21 / 9;
}

.player-scrim {
    position: absolute;
    right: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 1;
    transition: opacity 260ms ease;
}

.player-scrim--top {
    top: 0;
    height: 130px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.58), transparent);
}

.player-scrim--bottom {
    bottom: 0;
    height: 190px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.22) 60%, transparent);
}

/* Idle / no signal state ---------------------------------------------------- */

.idle-view {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    background:
        radial-gradient(75% 90% at 84% 22%, rgba(137, 196, 97, 0.16), transparent 58%),
        radial-gradient(55% 70% at 16% 86%, rgba(50, 114, 89, 0.15), transparent 68%),
        linear-gradient(120deg, #080d09 0%, #0d160f 56%, #09100b 100%);
}

.idle-grid {
    position: absolute;
    inset: 0;
    opacity: 0.42;
    background-image:
        linear-gradient(rgba(215, 255, 114, 0.043) 1px, transparent 1px),
        linear-gradient(90deg, rgba(215, 255, 114, 0.043) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 72% 40%, black 0%, transparent 72%);
}

.idle-grid::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 66%;
    width: 1px;
    background: linear-gradient(transparent, rgba(215, 255, 114, 0.18), transparent);
}

.idle-orbit {
    position: absolute;
    border: 1px solid rgba(215, 255, 114, 0.085);
    border-radius: 50%;
    pointer-events: none;
}

.orbit-a {
    width: 52vw;
    height: 52vw;
    min-width: 500px;
    min-height: 500px;
    top: -30%;
    right: -10%;
    box-shadow: 0 0 120px rgba(126, 200, 90, 0.035) inset;
}

.orbit-b {
    width: 37vw;
    height: 37vw;
    min-width: 360px;
    min-height: 360px;
    top: -19%;
    right: -2%;
    border-color: rgba(215, 255, 114, 0.12);
}

.orbit-a::before,
.orbit-b::before {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    top: 50%;
    left: -3px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 16px rgba(215, 255, 114, 0.8);
}

.orbit-b::before {
    top: 20%;
    left: 87%;
    width: 4px;
    height: 4px;
    opacity: 0.7;
}

.idle-word {
    position: absolute;
    right: -2%;
    bottom: -12%;
    color: transparent;
    font-size: clamp(140px, 17vw, 292px);
    font-weight: 700;
    line-height: 0.75;
    letter-spacing: -0.075em;
    opacity: 0.52;
    -webkit-text-stroke: 1px rgba(226, 255, 234, 0.075);
    pointer-events: none;
    user-select: none;
}

.idle-copy {
    position: absolute;
    top: 50%;
    left: clamp(28px, 6%, 78px);
    z-index: 2;
    width: min(48%, 500px);
    transform: translateY(-50%);
}

.idle-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.14em;
}

.idle-eyebrow i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 9px rgba(215, 255, 114, 0.8);
}

.idle-copy h2 {
    margin: 13px 0 13px;
    font-size: clamp(32px, 4.25vw, 65px);
    font-weight: 450;
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.idle-copy p {
    margin: 0;
    color: rgba(235, 245, 234, 0.5);
    font-size: clamp(10px, 0.92vw, 12px);
    line-height: 1.8;
}

.idle-action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding: 0 17px 0 6px;
    height: 39px;
    color: var(--text);
    border: 1px solid rgba(226, 255, 234, 0.17);
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.055);
    font-size: 10.5px;
    backdrop-filter: blur(14px);
    transition: background 160ms ease, border-color 160ms ease;
}

.idle-action:hover {
    border-color: rgba(215, 255, 114, 0.4);
    background: rgba(215, 255, 114, 0.09);
}

.idle-action-icon {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    color: var(--accent-ink);
    border-radius: 50%;
    background: var(--accent);
}

.idle-action-icon svg {
    width: 12px;
    height: 12px;
    margin-left: 1px;
}

.idle-tech {
    position: absolute;
    right: clamp(20px, 3.5%, 46px);
    bottom: 22px;
    display: flex;
    align-items: center;
    gap: 17px;
    color: rgba(226, 255, 234, 0.27);
    font-family: var(--mono);
    font-size: 7.5px;
    letter-spacing: 0.1em;
}

.idle-tech span + span::before {
    content: "/";
    margin-right: 17px;
    color: rgba(226, 255, 234, 0.12);
}

.idle-coord {
    position: absolute;
    top: 24px;
    right: clamp(20px, 3.5%, 46px);
    color: rgba(226, 255, 234, 0.22);
    font-family: var(--mono);
    font-size: 7.5px;
    letter-spacing: 0.14em;
}

.idle-coord span {
    margin: 0 7px;
    color: rgba(215, 255, 114, 0.45);
}

.player-frame.is-loaded .idle-view {
    display: none;
}

.player-frame[data-state="idle"] .controls,
.player-frame[data-state="idle"] .player-top-actions {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.player-frame[data-state="idle"] .player-scrim--bottom {
    opacity: 0.35;
}

/* Player overlays ----------------------------------------------------------- */

.player-top {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 19px;
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
}

.player-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
}

.stream-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 8px;
    color: rgba(245, 252, 244, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 6px;
    background: rgba(5, 9, 6, 0.42);
    font-family: var(--mono);
    font-size: 7.5px;
    letter-spacing: 0.09em;
    backdrop-filter: blur(12px);
}

.stream-badge.live {
    color: #fff;
    border-color: rgba(255, 94, 77, 0.35);
    background: rgba(134, 25, 17, 0.4);
}

.stream-badge.live i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 8px rgba(255, 94, 77, 0.85);
    animation: live-pulse 1.8s ease-in-out infinite;
}

.stream-badge.subtle {
    color: rgba(245, 252, 244, 0.48);
    border-color: rgba(255, 255, 255, 0.09);
    font-size: 7px;
}

.player-top-actions {
    pointer-events: auto;
}

.glass-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 27px;
    padding: 0 9px;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(5, 9, 6, 0.4);
    font-size: 9px;
    backdrop-filter: blur(12px);
    transition: color 160ms ease, background 160ms ease;
}

.glass-button svg {
    width: 13px;
    height: 13px;
}

.glass-button:hover,
.glass-button.is-active {
    color: var(--accent);
    background: rgba(5, 9, 6, 0.72);
}

.big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 8;
    display: grid;
    width: 88px;
    height: 88px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    transform: translate(-50%, -50%);
    transition: transform 180ms ease, opacity 180ms ease;
}

.big-play:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.big-play-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(5, 9, 6, 0.28);
    backdrop-filter: blur(10px);
}

.big-play-core {
    position: relative;
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    color: var(--accent-ink);
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
}

.big-play-core svg {
    width: 20px;
    height: 20px;
    margin-left: 2px;
}

.buffering {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.66);
    font-family: var(--mono);
    font-size: 7.5px;
    letter-spacing: 0.16em;
    pointer-events: none;
}

.buffering-ring {
    width: 38px;
    height: 38px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.error-view {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 20;
    width: min(430px, calc(100% - 40px));
    padding: 25px 25px 23px;
    border: 1px solid rgba(255, 129, 116, 0.22);
    border-radius: 15px;
    background: rgba(13, 16, 14, 0.91);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    text-align: center;
    backdrop-filter: blur(22px);
    transform: translate(-50%, -50%);
}

.error-icon {
    display: grid;
    width: 39px;
    height: 39px;
    margin: 0 auto 12px;
    place-items: center;
    color: var(--danger);
    border: 1px solid rgba(255, 129, 116, 0.25);
    border-radius: 50%;
    background: rgba(255, 129, 116, 0.08);
}

.error-icon svg {
    width: 18px;
    height: 18px;
}

.error-kicker {
    color: var(--danger);
    font-family: var(--mono);
    font-size: 7.5px;
    letter-spacing: 0.16em;
}

.error-view h3 {
    margin: 8px 0 6px;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.error-view p {
    max-height: 66px;
    margin: 0;
    overflow: auto;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.codec-hint {
    margin: 12px 0 0;
    color: var(--dim);
    font-size: 9px;
    line-height: 1.55;
}

.stats-overlay {
    position: absolute;
    top: 64px;
    right: 19px;
    z-index: 14;
    width: 270px;
    padding: 13px 14px;
    border: 1px solid rgba(215, 255, 114, 0.14);
    border-radius: 10px;
    background: rgba(5, 9, 6, 0.86);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
    font-family: var(--mono);
    backdrop-filter: blur(18px);
    animation: pop-in 150ms ease both;
}

.stats-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 9px;
    color: var(--accent);
    border-bottom: 1px solid rgba(215, 255, 114, 0.13);
    font-size: 7.5px;
    letter-spacing: 0.13em;
}

.stats-rows {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.stats-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    font-size: 8.5px;
}

.stats-row span {
    color: var(--dim);
    letter-spacing: 0.04em;
}

.stats-row b {
    color: var(--text-soft);
    font-weight: 500;
    text-align: right;
}

/* Controls ------------------------------------------------------------------ */

.controls {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 12;
    padding: 0 18px 14px;
    transition: opacity 220ms ease, transform 220ms ease;
}

.player-frame.is-playing.is-controls-hidden .controls,
.player-frame.is-playing.is-controls-hidden .player-top {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
}

.player-frame.is-playing.is-controls-hidden .player-scrim {
    opacity: 0.2;
}

.player-frame.is-playing.is-controls-hidden {
    cursor: none;
}

.timeline {
    position: relative;
    height: 20px;
    cursor: pointer;
    touch-action: none;
    outline: none;
}

.timeline-hitbox {
    position: absolute;
    inset: -5px 0;
}

.timeline-track {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 3px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-50%);
    transition: height 130ms ease;
}

.timeline:hover .timeline-track,
.timeline.is-scrubbing .timeline-track {
    height: 5px;
}

.timeline-buffered {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: rgba(255, 255, 255, 0.27);
}

.timeline-played {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(215, 255, 114, 0.3);
}

.timeline-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 11px;
    height: 11px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: #12200d;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 120ms ease, transform 120ms ease;
}

.timeline:hover .timeline-thumb,
.timeline:focus-visible .timeline-thumb,
.timeline.is-scrubbing .timeline-thumb {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.timeline-tooltip {
    position: absolute;
    bottom: 22px;
    left: 50%;
    padding: 4px 6px;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(4, 7, 5, 0.9);
    font-family: var(--mono);
    font-size: 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 100ms ease;
    white-space: nowrap;
}

.timeline:hover .timeline-tooltip,
.timeline.is-scrubbing .timeline-tooltip {
    opacity: 1;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 1px;
}

.control-group {
    display: flex;
    align-items: center;
    min-width: 0;
}

.control-group--right {
    gap: 3px;
}

.control-button {
    position: relative;
    display: grid;
    width: 37px;
    height: 37px;
    flex: none;
    place-items: center;
    padding: 0;
    color: rgba(249, 255, 248, 0.82);
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.control-button svg {
    width: 19px;
    height: 19px;
}

.control-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.control-button:active {
    transform: scale(0.94);
}

.play-button {
    margin-right: 2px;
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
}

.play-button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.control-button .icon-pause,
.control-button .icon-compress {
    display: none;
}

.player-frame.is-playing .play-button .icon-play {
    display: none;
}

.player-frame.is-playing .play-button .icon-pause {
    display: block;
}

.player-frame.is-muted .icon-volume {
    display: none;
}

.player-frame.is-muted .icon-muted {
    display: block;
}

.control-button .icon-muted {
    display: none;
}

.player-frame:fullscreen .icon-expand {
    display: none;
}

.player-frame:fullscreen .icon-compress {
    display: block;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.time-sep,
.time-muted {
    color: rgba(255, 255, 255, 0.42);
}

.volume-control {
    display: flex;
    align-items: center;
}

.volume-slider-wrap {
    display: flex;
    align-items: center;
    width: 0;
    overflow: hidden;
    opacity: 0;
    transition: width 180ms ease, opacity 180ms ease;
}

.volume-control:hover .volume-slider-wrap,
.volume-control:focus-within .volume-slider-wrap {
    width: 69px;
    opacity: 1;
}

.volume-slider {
    width: 58px;
    height: 18px;
    margin: 0 7px 0 2px;
    cursor: pointer;
    appearance: none;
    background: transparent;
}

.volume-slider::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 99px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.84) var(--volume, 100%), rgba(255, 255, 255, 0.2) var(--volume, 100%));
}

.volume-slider::-moz-range-track {
    height: 3px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.2);
}

.volume-slider::-moz-range-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.84);
}

.volume-slider::-webkit-slider-thumb {
    width: 9px;
    height: 9px;
    margin-top: -3px;
    appearance: none;
    border: 0;
    border-radius: 50%;
    background: #fff;
}

.volume-slider::-moz-range-thumb {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 50%;
    background: #fff;
}

.text-control {
    display: inline-flex;
    width: auto;
    min-width: 34px;
    gap: 4px;
    padding: 0 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.075);
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.02em;
}

.text-control:hover {
    background: rgba(255, 255, 255, 0.14);
}

.text-control svg {
    width: 15px;
    height: 15px;
}

.quality-control {
    min-width: 52px;
}
.quality-control .tiny-chevron {
    width: 10px;
    height: 10px;
}

.speed-control {
    min-width: 37px;
    font-size: 9px;
}

.active-dot {
    position: absolute;
    right: 6px;
    bottom: 7px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0;
}

.active-dot.is-on {
    opacity: 1;
}

.live-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 29px;
    margin-right: 5px;
    padding: 0 9px;
    color: #fff;
    border: 1px solid rgba(255, 94, 77, 0.36);
    border-radius: 6px;
    background: rgba(139, 28, 20, 0.45);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.02em;
    transition: background 150ms ease;
}

.live-button i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--live);
}

.live-button:hover {
    background: rgba(181, 37, 26, 0.58);
}

.player-frame.is-live-edge .live-button {
    color: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.08);
}

/* Popover menus ------------------------------------------------------------- */

.popover {
    position: absolute;
    right: 17px;
    bottom: 72px;
    z-index: 30;
    width: 265px;
    max-height: min(390px, calc(100% - 100px));
    overflow: hidden auto;
    border: 1px solid rgba(226, 255, 234, 0.13);
    border-radius: 12px;
    background: rgba(12, 17, 13, 0.96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(22px);
    animation: pop-in 140ms ease both;
    scrollbar-width: thin;
    scrollbar-color: #354236 transparent;
}

.popover-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px 10px;
    color: var(--muted);
    border-bottom: 1px solid rgba(226, 255, 234, 0.08);
    background: rgba(12, 17, 13, 0.96);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.1em;
}

.popover-body {
    padding: 7px;
}

.popover-section + .popover-section {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid rgba(226, 255, 234, 0.07);
}

.popover-section-label {
    padding: 6px 8px 5px;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: 0.11em;
}

.menu-option {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 9px;
    min-height: 32px;
    padding: 6px 8px;
    color: var(--text-soft);
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 10px;
    text-align: left;
}

.menu-option:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
}

.menu-option.is-selected {
    color: var(--accent);
    background: rgba(215, 255, 114, 0.065);
}

.menu-option .menu-check {
    display: grid;
    width: 13px;
    height: 13px;
    flex: none;
    place-items: center;
    color: var(--accent);
    opacity: 0;
}

.menu-option.is-selected .menu-check {
    opacity: 1;
}

.menu-option .menu-check svg {
    width: 12px;
    height: 12px;
}

.menu-option .menu-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-option .menu-note {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7.5px;
    white-space: nowrap;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    padding: 2px;
}

.menu-grid button {
    height: 29px;
    color: var(--muted);
    border: 1px solid rgba(226, 255, 234, 0.08);
    border-radius: 5px;
    background: transparent;
    font-family: var(--mono);
    font-size: 8.5px;
}

.menu-grid button:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

.menu-grid button.is-selected {
    color: var(--accent);
    border-color: rgba(215, 255, 114, 0.28);
    background: rgba(215, 255, 114, 0.07);
}

.menu-action {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 34px;
    padding: 7px 9px;
    color: var(--text-soft);
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 10px;
    text-align: left;
}

.menu-action:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
}

.menu-action.is-selected .menu-note {
    color: var(--accent);
}

.menu-action .action-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.menu-action svg {
    width: 15px;
    height: 15px;
    color: var(--muted);
}

.menu-action .menu-note {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7.5px;
}

.menu-empty {
    padding: 14px 9px;
    color: var(--dim);
    font-size: 9.5px;
    text-align: center;
}

.menu-hint {
    padding: 8px 9px 4px;
    color: var(--dim);
    font-size: 8.5px;
    line-height: 1.5;
}

/* Toasts / seek feedback ---------------------------------------------------- */

.toast-stack {
    position: absolute;
    top: 59px;
    right: 18px;
    z-index: 40;
    display: flex;
    width: min(290px, calc(100% - 36px));
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
    padding: 9px 11px;
    color: var(--text-soft);
    border: 1px solid rgba(226, 255, 234, 0.12);
    border-left: 2px solid var(--accent);
    border-radius: 6px;
    background: rgba(9, 13, 10, 0.92);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-size: 10px;
    line-height: 1.45;
    backdrop-filter: blur(16px);
    animation: toast-in 180ms ease both;
}

.toast.is-error {
    border-left-color: var(--danger);
}

.toast.is-info {
    border-left-color: var(--cyan);
}

.seek-flash {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 18;
    padding: 7px 12px;
    color: var(--accent);
    border: 1px solid rgba(215, 255, 114, 0.18);
    border-radius: 7px;
    background: rgba(7, 11, 8, 0.78);
    font-family: var(--mono);
    font-size: 11px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: seek-pop 700ms ease both;
}

/* Now playing strip --------------------------------------------------------- */

.now-playing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 22px;
    margin-top: 10px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(13, 18, 14, 0.72);
}

.now-main {
    min-width: 0;
}

.now-main h2 {
    margin: 4px 0 3px;
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-url {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 7px;
    padding: 0;
    color: var(--dim);
    border: 0;
    background: transparent;
    font-family: var(--mono);
    font-size: 8.5px;
    text-align: left;
}

.source-url span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-url svg {
    width: 11px;
    height: 11px;
    flex: none;
    opacity: 0;
    transition: opacity 150ms ease;
}

.source-url:hover {
    color: var(--text-soft);
}

.source-url:hover svg {
    opacity: 1;
}

.now-stats {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.3vw, 30px);
}

.now-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.now-stat span {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: 0.07em;
}

.now-stat b {
    color: var(--text-soft);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.now-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-button {
    display: grid;
    width: 33px;
    height: 33px;
    place-items: center;
    padding: 0;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.icon-button svg {
    width: 15px;
    height: 15px;
}

.icon-button:hover {
    color: var(--text);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
}

.icon-button:disabled {
    opacity: 0.35;
}

.icon-button.small {
    width: 28px;
    height: 28px;
    border-color: transparent;
}

.icon-button.tiny {
    width: 22px;
    height: 22px;
    border-color: transparent;
}

.icon-button.tiny svg {
    width: 12px;
    height: 12px;
}

/* --------------------------------------------------------------------------
   Right rail
   -------------------------------------------------------------------------- */

.side-rail {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 12px;
}

.side-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.024), transparent 45%), var(--panel);
}

.side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7.5px;
    letter-spacing: 0.12em;
}

.side-head .micro-label {
    color: var(--dim);
    font-size: 7px;
}

.status-live-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--dim);
    transition: background 200ms ease, box-shadow 200ms ease;
}

.side-card.is-playing .status-live-dot {
    background: var(--accent);
    box-shadow: 0 0 9px rgba(215, 255, 114, 0.65);
}

.status-readout {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 12px;
}

#statusLabel {
    color: var(--text);
    font-family: var(--mono);
    font-size: 23px;
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.equalizer {
    display: flex;
    height: 20px;
    align-items: flex-end;
    gap: 2px;
    padding-bottom: 2px;
}

.equalizer i {
    width: 2px;
    height: 22%;
    border-radius: 2px;
    background: var(--accent);
    opacity: 0.36;
    transform-origin: bottom;
    animation: eq 1.1s ease-in-out infinite;
}

.equalizer i:nth-child(2) { height: 55%; animation-delay: -0.35s; }
.equalizer i:nth-child(3) { height: 85%; animation-delay: -0.7s; }
.equalizer i:nth-child(4) { height: 42%; animation-delay: -0.2s; }
.equalizer i:nth-child(5) { height: 65%; animation-delay: -0.55s; }

.side-card:not(.is-playing) .equalizer i {
    animation-play-state: paused;
    opacity: 0.15;
    height: 20%;
}

.status-sub {
    margin: 4px 0 15px;
    color: var(--muted);
    font-size: 10px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.metric-grid > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    padding: 8px 9px;
    border: 1px solid rgba(226, 255, 234, 0.055);
    border-radius: 7px;
    background: rgba(3, 6, 4, 0.35);
}

.metric-grid span {
    color: var(--dim);
    font-size: 8px;
}

.metric-grid b {
    overflow: hidden;
    color: var(--text-soft);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.buffer-block {
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid var(--line);
}

.buffer-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: 0.09em;
}

.buffer-label b {
    color: var(--muted);
    font-weight: 500;
}

.buffer-track {
    height: 3px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
}

.buffer-track span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent));
    transition: width 350ms linear;
}

.signal-list {
    display: grid;
    gap: 0;
    margin: 9px 0 0;
}

.signal-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(226, 255, 234, 0.055);
}

.signal-list > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.signal-list dt {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7.5px;
    letter-spacing: 0.04em;
}

.signal-list dd {
    margin: 0;
    color: var(--text-soft);
    font-family: var(--mono);
    font-size: 8.5px;
    text-align: right;
}

.signal-list dd.truncate {
    max-width: 164px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 13px;
    margin-top: 12px;
}

.shortcut-grid > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
}

kbd {
    display: inline-flex;
    min-width: 19px;
    height: 19px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    color: var(--text-soft);
    border: 1px solid rgba(226, 255, 234, 0.13);
    border-bottom-color: rgba(226, 255, 234, 0.24);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.035);
    font-family: var(--mono);
    font-size: 7.5px;
    line-height: 1;
}

.shortcut-grid span {
    width: 100%;
    margin-top: 1px;
    color: var(--dim);
    font-size: 8.5px;
}

/* --------------------------------------------------------------------------
   Lower panels
   -------------------------------------------------------------------------- */

.lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.history-panel,
.notes-panel {
    min-width: 0;
    padding: 19px 20px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(13, 18, 14, 0.58);
}

.panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 13px;
}

.panel-head h2 {
    margin: 5px 0 0;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.history-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 5px 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: background 150ms ease, border-color 150ms ease;
}

.history-item:hover {
    border-color: rgba(226, 255, 234, 0.06);
    background: rgba(255, 255, 255, 0.025);
}

.history-index {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7.5px;
}

.history-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    color: var(--text-soft);
    border: 0;
    background: transparent;
    text-align: left;
}

.history-main:hover {
    color: var(--accent);
}

.history-title {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-url {
    overflow: hidden;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7.5px;
    white-space: nowrap;
}

.history-badge {
    padding: 2px 4px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 3px;
    font-size: 6.5px;
    letter-spacing: 0.05em;
}

.history-remove {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    padding: 0;
    color: var(--dim);
    border: 0;
    border-radius: 5px;
    background: transparent;
    opacity: 0;
    transition: opacity 150ms ease, color 150ms ease, background 150ms ease;
}

.history-item:hover .history-remove,
.history-remove:focus-visible {
    opacity: 1;
}

.history-remove:hover {
    color: var(--danger);
    background: rgba(255, 129, 116, 0.08);
}

.history-remove svg {
    width: 13px;
    height: 13px;
}

.history-empty {
    display: flex;
    min-height: 102px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 14px;
    border: 1px dashed rgba(226, 255, 234, 0.09);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.012);
}

.history-empty span {
    color: var(--muted);
    font-size: 11px;
}

.history-empty small {
    color: var(--dim);
    font-size: 9px;
}

.notes-panel {
    background:
        radial-gradient(420px 170px at 90% 0%, rgba(112, 173, 79, 0.08), transparent 65%),
        rgba(13, 18, 14, 0.58);
}

.note-feature {
    display: flex;
    gap: 11px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.note-feature:first-of-type {
    margin-top: 8px;
}

.note-icon {
    display: grid;
    width: 28px;
    height: 28px;
    flex: none;
    place-items: center;
    color: var(--accent);
    border: 1px solid rgba(215, 255, 114, 0.14);
    border-radius: 7px;
    background: rgba(215, 255, 114, 0.045);
}

.note-icon svg {
    width: 14px;
    height: 14px;
}

.note-feature h3 {
    margin: 1px 0 4px;
    font-size: 11.5px;
    font-weight: 500;
}

.note-feature p {
    margin: 0;
    color: var(--muted);
    font-size: 9.5px;
    line-height: 1.65;
}

.tech-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: 0.08em;
}

.tech-strip span + span::before {
    content: "·";
    margin-right: 12px;
    color: var(--dim);
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 26px;
    padding: 16px 2px 0;
    color: var(--dim);
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.03em;
}

.footer > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mini {
    color: var(--accent);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
}

/* --------------------------------------------------------------------------
   Theater mode
   -------------------------------------------------------------------------- */

.stage-grid.is-theater {
    grid-template-columns: minmax(0, 1fr);
}

.stage-grid.is-theater .side-rail {
    display: none;
}

.stage-grid.is-theater .player-frame {
    aspect-ratio: 21 / 9;
}

.stage-grid.is-theater .player-column {
    width: 100%;
}

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

@media (max-width: 1320px) {
    .app-shell {
        padding-right: 26px;
        padding-left: 26px;
    }

    .stage-grid {
        grid-template-columns: minmax(0, 1fr) 302px;
    }

    .source-intro {
        gap: 20px;
    }

    .secure-note {
        font-size: 8px;
    }

    .topbar-center {
        display: none;
    }

    .topbar-actions {
        margin-left: auto;
    }
}

@media (max-width: 1100px) {
    .stage-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .side-rail {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .side-card {
        min-width: 0;
    }

    .lower-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr);
    }

    .now-stats {
        display: none;
    }

    .now-playing {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

@media (max-width: 900px) {
    .source-intro {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .secure-note {
        display: none;
    }

    .capability-line {
        gap: 12px;
    }

    .capability-line span + span::before {
        margin-right: 8px;
    }

    .lower-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .notes-panel {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 20px;
    }

    .notes-panel > .section-kicker,
    .notes-panel > .tech-strip {
        grid-column: 1 / -1;
    }

    .note-feature {
        border-bottom: 0;
        padding: 11px 0;
    }

    .notes-panel > .tech-strip {
        margin-top: 4px;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 760px) {
    .app-shell {
        padding: 0 15px 28px;
    }

    .topbar {
        height: 72px;
        gap: 14px;
    }

    .brand-mark {
        width: 35px;
        height: 35px;
        border-radius: 9px;
    }

    .brand-word {
        font-size: 15px;
    }

    .brand-badge,
    .engine-tag {
        display: none;
    }

    .health {
        padding: 6px 8px;
        font-size: 7px;
    }

    .source-panel {
        margin-top: 14px;
        padding: 18px 15px 15px;
        border-radius: 15px;
    }

    .source-panel::after {
        left: 15px;
    }

    .source-intro {
        display: block;
        margin-bottom: 15px;
    }

    .source-copy {
        margin-top: 8px;
    }

    .source-copy h1 {
        margin-top: 4px;
        font-size: 24px;
    }

    .source-copy p {
        font-size: 10px;
    }

    .source-form {
        flex-wrap: wrap;
        gap: 7px;
    }

    .url-field {
        width: 100%;
        height: 52px;
        flex-basis: 100%;
        border-radius: 11px;
    }

    .slash-hint {
        display: none;
    }

    #sourceInput {
        font-size: 11px;
    }

    .load-button {
        flex: 1;
        height: 48px;
        min-width: 0;
        justify-content: space-between;
        border-radius: 10px;
    }

    .transport-button {
        width: 77px;
        height: 48px;
        border-radius: 10px;
    }

    .source-foot {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-top: 12px;
    }

    .capability-line {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 6.8px;
    }

    .capability-line span + span::before {
        margin-right: 5px;
    }

    .request-fields {
        grid-template-columns: 1fr;
    }

    .request-foot {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .stage-grid {
        gap: 12px;
        margin-top: 12px;
    }

    .player-frame {
        aspect-ratio: 16 / 10;
        min-height: 220px;
        border-radius: 14px;
    }

    .idle-copy {
        left: 22px;
        width: min(68%, 420px);
    }

    .idle-copy h2 {
        margin: 10px 0;
        font-size: clamp(28px, 8vw, 43px);
    }

    .idle-copy p {
        display: none;
    }

    .idle-action {
        height: 34px;
        margin-top: 15px;
        padding-right: 13px;
        font-size: 9.5px;
    }

    .idle-action-icon {
        width: 24px;
        height: 24px;
    }

    .idle-word {
        right: -3%;
        bottom: -4%;
        font-size: 34vw;
    }

    .orbit-a {
        width: 80vw;
        height: 80vw;
        min-width: 350px;
        min-height: 350px;
        top: -35%;
        right: -20%;
    }

    .orbit-b {
        min-width: 250px;
        min-height: 250px;
        width: 56vw;
        height: 56vw;
    }

    .idle-tech,
    .idle-coord {
        display: none;
    }

    .player-top {
        padding: 12px;
    }

    .stream-badge {
        height: 21px;
        font-size: 6.5px;
    }

    .glass-button {
        height: 24px;
        padding: 0 7px;
    }

    .glass-button span {
        display: none;
    }

    .controls {
        padding: 0 9px 7px;
    }

    .timeline {
        height: 17px;
    }

    .control-row {
        gap: 2px;
    }

    .control-group--right {
        gap: 0;
    }

    .control-button {
        width: 32px;
        height: 32px;
    }

    .control-button svg {
        width: 17px;
        height: 17px;
    }

    .control-button.optional,
    .speed-control,
    #theaterBtn {
        display: none;
    }

    .time-display {
        margin-left: 4px;
        font-size: 8.5px;
        gap: 4px;
    }

    .volume-control {
        display: none;
    }

    .text-control {
        padding: 0 5px;
        font-size: 7.5px;
    }

    .quality-control {
        width: auto;
        min-width: 49px;
        padding: 0 4px;
    }
    .quality-control #qualityLabel {
        font-size: 8px;
    }
    .quality-control .tiny-chevron {
        width: 8px;
        height: 8px;
    }

    .big-play {
        width: 72px;
        height: 72px;
    }

    .big-play-core {
        width: 45px;
        height: 45px;
    }

    .now-playing {
        margin-top: 8px;
        padding: 11px 12px;
        border-radius: 11px;
    }

    .now-main h2 {
        margin-top: 2px;
        font-size: 14px;
    }

    .now-actions {
        display: none;
    }

    .side-rail {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .side-card {
        padding: 13px;
        border-radius: 11px;
    }

    .shortcuts-card {
        display: none;
    }

    .status-sub {
        margin-bottom: 10px;
    }

    .lower-grid {
        margin-top: 12px;
        gap: 12px;
    }

    .history-panel,
    .notes-panel {
        padding: 15px 13px;
        border-radius: 12px;
    }

    .history-item {
        grid-template-columns: 18px minmax(0, 1fr) auto;
    }

    .history-meta {
        display: none;
    }

    .history-remove {
        opacity: 1;
    }

    .notes-panel {
        display: block;
    }

    .note-feature {
        padding: 10px 0;
    }

    .footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        margin-top: 18px;
        font-size: 7px;
    }

    .popover {
        right: 8px;
        bottom: 51px;
        width: min(265px, calc(100% - 16px));
        max-height: calc(100% - 70px);
    }

    .stats-overlay {
        top: 46px;
        right: 10px;
        width: 230px;
    }

    .toast-stack {
        top: 44px;
        right: 10px;
        width: min(250px, calc(100% - 20px));
    }

    .error-view {
        padding: 18px 16px;
    }

    .error-view h3 {
        font-size: 15px;
    }

    .error-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 420px) {
    .brand-sub {
        display: none;
    }

    .brand-mark {
        width: 33px;
        height: 33px;
    }

    .player-frame {
        aspect-ratio: 4 / 3;
    }

    .idle-copy {
        width: 74%;
    }

    .idle-copy h2 {
        font-size: 30px;
    }

    .idle-eyebrow {
        font-size: 7px;
    }

    .time-display {
        display: none;
    }

    .toast {
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes button-spin {
    to { transform: rotate(360deg); }
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@keyframes eq {
    0%, 100% { transform: scaleY(0.45); }
    50% { transform: scaleY(1); }
}

@keyframes pop-in {
    from { opacity: 0; transform: translateY(4px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes panel-in {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes seek-pop {
    0% { opacity: 0; transform: translate(-50%, -40%) scale(0.95); }
    18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    75% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -58%) scale(1); }
}
