/* Airwave v17. Neutral media surfaces; glass is reserved for floating controls. */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --surface: #ffffff;
  --workspace: #ffffff;
  --raised: #efeff1;
  --input: #fafafa;
  --text: #1d1d1f;
  --muted: #636368;
  --accent: #262629;
  --on-accent: #ffffff;
  --signal: #b42335;
  --live: #935400;
  --border: #8e8e96;
  --line: #dedee3;
  --stroke-soft: #d5d5dc;
  --screen: #080809;
  --ambient: transparent;
  --veil: #14141666;
  --glass-surface: #fffffff0;
  --glass-rim: #ffffffd9;
  --shadow: #15151814;
  --selection: #e8e8ec;
  --selection-edge: #262629;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --heading: var(--font);
  --micro: .75rem;
  --small: .875rem;
  --body: 1.0625rem;
  --title: 2.125rem;
  --display: 2.5rem;
  --r1: 12px;
  --r2: 20px;
  --r3: 26px;
  --nav-gap: 112px;
  --nav-target: 52px;
  --mini-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  --mini-height: max(72px, 4.5rem);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101011;
  --panel: #1c1c1e;
  --surface: #1c1c1e;
  --workspace: #1c1c1e;
  --raised: #2a2a2d;
  --input: #161617;
  --text: #f5f5f7;
  --muted: #b3b3ba;
  --accent: #f5f5f7;
  --on-accent: #1c1c1e;
  --signal: #ffb0b8;
  --live: #eac078;
  --border: #7d7d86;
  --line: #38383d;
  --stroke-soft: #414147;
  --screen: #050505;
  --veil: #000000a8;
  --glass-surface: #242426ef;
  --glass-rim: #ffffff24;
  --shadow: #0000004d;
  --selection: #333337;
  --selection-edge: #f5f5f7;
}

/* The initial shell also follows the system before its saved preference loads. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    color-scheme: dark;
    --bg: #101011; --panel: #1c1c1e; --surface: #1c1c1e;
    --workspace: #1c1c1e; --raised: #2a2a2d; --input: #161617;
    --text: #f5f5f7; --muted: #b3b3ba; --accent: #f5f5f7;
    --on-accent: #1c1c1e; --signal: #ffb0b8; --live: #eac078;
    --border: #7d7d86; --line: #38383d; --stroke-soft: #414147;
    --screen: #050505; --veil: #000000a8;
    --glass-surface: #242426ef; --glass-rim: #ffffff24; --shadow: #0000004d;
    --selection: #333337; --selection-edge: #f5f5f7;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.5;
}
button, input, select, textarea { font-family: inherit; }
button, a, input, select { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}
button:disabled { cursor: default; }
button:hover { filter: none; }
button:active { transform: none; }
::selection { background: var(--text); color: var(--surface); }

.sidebar { background: var(--surface); border-color: var(--line); }
.sidebar-shade.visible { backdrop-filter: none; -webkit-backdrop-filter: none; }
.brand, .app-brand { color: var(--text); font-weight: 750; }
.brand-dot, .sidebar .brand-dot { color: var(--text); }
.brand img, .app-brand img { border-radius: 10px; }
.workspace-label, .eyebrow { color: var(--muted); letter-spacing: .1em; }
.nav-item { color: var(--muted); border-radius: 12px; min-height: 48px; }
.nav-item svg { color: inherit; width: 21px; height: 21px; }
.nav-item.active, .nav-item.active svg { background: var(--raised); color: var(--text); }
.nav-item.active { font-weight: 650; }
.nav-item:hover { color: var(--text); background: var(--raised); }
.nav-count, .active .nav-count, .small-pill, .count-pill {
  background: var(--raised); color: var(--muted); border-color: var(--line);
  font-size: var(--micro); font-weight: 550;
}
.nav-item.active .nav-count { background: var(--surface); color: var(--text); }
.rail-library { border-color: var(--line); }
.rail-library .text-button { color: var(--muted); }
.source-status, .profile-dot, .footer-dot, .status-dot,
.connection-badge > span:first-child { background: var(--live); box-shadow: none; }
.profile, .source-prompt { border-color: var(--line); }
.profile span:not(.profile-dot), .source-prompt p { color: var(--muted); }
.avatar { background: var(--raised); color: var(--text); border-color: var(--line); }
.source-prompt { background: var(--bg); }

.topbar { border-color: var(--line); background: transparent; }
.breadcrumb #breadcrumb { font-size: 1rem; font-weight: 600; color: var(--text); }
.topbar-right { gap: 4px; }
.icon-button, .tiny-button {
  color: var(--muted); min-width: 44px; min-height: 44px;
  width: 44px; height: 44px; border-radius: 50%;
}
.icon-button svg { width: 21px; height: 21px; }
.icon-button:hover, .tiny-button:hover { color: var(--text); background: var(--raised); }
.page-heading { align-items: end; margin-bottom: 28px; }
.page-heading h1 {
  font-family: var(--font); font-size: clamp(2.125rem, 3vw, 2.5rem);
  font-weight: 750; line-height: 1.14; letter-spacing: -.045em; margin: 0 0 10px;
}
.page-heading h1 span { color: var(--text); }
.page-heading p { color: var(--muted); font-size: .9375rem; line-height: 1.5; }
.page-heading .connection-badge { margin-bottom: 2px; }
.connection-badge {
  background: transparent; border-color: var(--line); color: var(--muted);
  font-size: var(--micro); padding: 7px 10px;
}

.button, .text-button, .source-item .button, .settings-block .button {
  min-height: 44px; font-size: .9375rem; line-height: 1.35; font-weight: 600;
}
.button { padding: 12px 17px; border-radius: 12px; }
.button.primary, .primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent); filter: none; opacity: .88; }
.button.secondary, .glass { background: var(--surface); border-color: var(--stroke-soft); color: var(--text); }
.button.secondary:hover, .glass:hover { background: var(--raised); border-color: var(--border); }
.button.danger, .danger { color: var(--signal); border-color: var(--stroke-soft); background: transparent; }
.text-button { color: var(--text); white-space: normal; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }

.library-toolbar { gap: 16px; margin-bottom: 24px; }
.active-source-control { font-size: var(--small); color: var(--muted); }
.active-source-control select, .search-box, .player-search input,
form input:not([type=file]), .settings-input, .settings-content .settings-input {
  background: var(--surface); color: var(--text); border: 1px solid var(--stroke-soft);
  border-radius: 13px; font-size: max(16px, 1rem); min-height: 48px;
}
.search-box { color: var(--muted); height: 48px; padding-inline: 14px; }
.search-box input { color: var(--text); font-size: max(16px, 1rem); }
.search-box svg { width: 20px; height: 20px; }
input::placeholder, .search-box input::placeholder, form input::placeholder,
.settings-input::placeholder { color: var(--muted); opacity: 1; font-size: 1rem; }
input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
}
form label { color: var(--text); font-size: 1rem; font-weight: 500; }
.or-divider::before, .or-divider::after { background: var(--line); }
.file-drop { background: var(--bg); border-color: var(--border); color: var(--text); }
.file-drop input { min-height: 44px; }
.source-tabs { background: var(--raised); border: 0; padding: 4px; }
.source-tabs button { color: var(--muted); font-size: var(--small); font-weight: 550; }
.source-tabs button[aria-selected=true] {
  background: var(--surface); color: var(--text); box-shadow: 0 1px 4px var(--shadow);
}
.privacy-note, .or-divider, .settings-block p, .setting-row p,
.settings-block .muted, .dialog-intro { color: var(--muted); }
.form-error { color: var(--signal); background: var(--surface); border-color: var(--signal); }

.tv-workspace { gap: 20px; }
.category-pane { background: transparent; border: 0; }
.category-pane .pane-heading { padding: 12px 12px 20px; }
.pane-heading h2, .pane-heading h3 { font-weight: 650; letter-spacing: -.02em; }
.category-list { padding: 0 4px 8px; }
.category-row { font-size: .9375rem; padding: 11px 12px; color: var(--muted); gap: 10px; }
.category-row > span:last-child { color: var(--muted); opacity: 1; }
.category-row.active {
  color: var(--text); background: var(--selection); font-weight: 650;
  border-color: var(--selection); box-shadow: inset 3px 0 0 var(--selection-edge);
}
.category-row:hover { color: var(--text); background: var(--raised); }
.channel-pane, .watch-pane { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.channel-pane > .section-heading { padding: 18px 20px; border-color: var(--line); }
.channel-pane .section-heading h2 { font-size: 1.125rem; font-weight: 650; letter-spacing: -.02em; }
.channel-pane .section-heading p { color: var(--muted); font-size: var(--micro); }
.channel-pane .section-heading > div:first-child { min-width: 0; }
.channel-pane .layout-options .icon-button { width: 44px; min-width: 44px; min-height: 44px; }
.layout-options .icon-button.selected, .layout-options .selected { color: var(--text); background: var(--raised); }
.channel-row { border-color: var(--line); }
.channel-row.is-watching { background: var(--raised); box-shadow: inset 3px 0 0 var(--selection-edge); }
.channel-tune { padding: 16px 12px 16px 18px; gap: 12px; min-height: 88px; }
.channel-number { color: var(--muted); font-size: var(--micro); }
.channel-tune:hover { background: var(--raised); }
.channel-copy strong { font-size: 1rem; font-weight: 600; line-height: 1.45; letter-spacing: -.012em; }
.channel-copy > span { color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.channel-row .channel-mark {
  width: 46px; height: 46px; border-radius: 12px; background: var(--bg);
  color: var(--text); border-color: var(--line); font-size: .875rem;
}
.row-play { color: var(--text); }
.row-favourite { color: var(--muted); }
.row-favourite.saved { color: var(--text); }
.row-favourite:hover { background: var(--raised); }
.channel-rows.list-layout .channel-tune { min-height: 72px; }
.channel-rows.list-layout .channel-mark { width: 38px; height: 38px; }
.preview-screen { background: var(--bg); }
.preview-screen h2 { color: var(--text); font-size: 1.375rem; font-weight: 650; letter-spacing: -.025em; }
.preview-watermark { color: var(--border); }
.preview-screen p { color: var(--muted); }
.programme-detail p, .programme-time { color: var(--muted); }
.bottom-note, .empty-state, .source-item { border-color: var(--line); background: var(--surface); }
.note-logo, .source-icon, .channel-mark { background: var(--raised); color: var(--text); border-color: var(--line); }
.source-manager { border-color: var(--line); background: var(--surface); }
.source-index, .connection-facts { border-color: var(--line); }
.source-choice { border-radius: 12px; }
.source-choice.selected { background: var(--raised); border-color: var(--line); }
.source-choice small, .connection-title p, .connection-facts dt, .connection-note p { color: var(--muted); }
.connection-title h2 { font-size: 1.75rem; letter-spacing: -.035em; }
.connection-facts dd { color: var(--text); }
.connection-note, .saved-playback-servers { border-color: var(--line); }
.connection-note { background: var(--bg); }
.saved-playback-servers code, .playback-approval code { color: var(--text); }
.saved-playback-servers p { color: var(--muted); }

dialog { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: 0 24px 90px var(--shadow); }
dialog::backdrop { background: var(--veil); backdrop-filter: none; -webkit-backdrop-filter: none; }
.dialog-heading h2 { color: var(--text); font-size: 1.625rem; font-weight: 700; letter-spacing: -.035em; }
.dialog-heading .eyebrow { letter-spacing: .09em; }
.settings-navigation { background: var(--bg); border-color: var(--line); }
.settings-navigation button { color: var(--muted); }
.settings-navigation button[aria-pressed=true] { background: var(--surface); color: var(--text); font-weight: 650; }
.settings-console > .dialog-heading, .settings-block, .setting-row { border-color: var(--line); }
.settings-content strong { font-size: 1.125rem; font-weight: 650; letter-spacing: -.015em; }
.settings-content .setting-row strong { font-size: 1rem; font-weight: 600; }
.settings-content .settings-block p { font-size: .9375rem; line-height: 1.65; }
.settings-input-label { color: var(--text); font-size: .9375rem; }
.setting-row input { width: 52px; height: 44px; min-height: 44px; background: none; border: 0; }
.setting-row input::before { width: 46px; height: 28px; left: 3px; top: 8px; border: 1px solid var(--border); background: var(--raised); }
.setting-row input::after { width: 22px; height: 22px; left: 7px; top: 12px; background: var(--muted); }
.setting-row input:checked::before { left: 3px; background: var(--accent); border-color: var(--accent); }
.setting-row input:checked::after { left: 27px; background: var(--on-accent); }
.appearance-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; gap: 4px; margin-top: 16px; border-radius: 14px; background: var(--raised); }
.appearance-options button, .appearance-options label { display: flex; align-items: center; justify-content: center; min-height: 48px; min-width: 0; border-radius: 10px; color: var(--muted); font-size: .9375rem; margin: 0; cursor: pointer; }
.appearance-options button[aria-pressed=true], .appearance-options label:has(input:checked) { color: var(--text); background: var(--surface); font-weight: 650; box-shadow: 0 1px 4px var(--shadow); }
.appearance-options input[type=radio] { width: 16px; height: 16px; min-height: 16px; margin: 0 8px 0 0; accent-color: var(--accent); }

.player-dialog { color: var(--text); background: var(--surface); }
.cinema-player .player-heading, .inline-player .player-heading,
.player-heading, .player-footer, .inline-player .player-footer, .playback-hints { background: var(--surface); border-color: var(--line); }
.cinema-player .player-heading { gap: 10px; }
.player-heading h2 { color: var(--text); font-weight: 650; letter-spacing: -.02em; }
.player-heading p, .player-footer, .quality-label, #player-info { color: var(--muted); }
.player-footer select { color: var(--text); background: var(--raised); border-color: var(--stroke-soft); border-radius: 9px; font-size: .9375rem; }
.player-status { background: #18181bdd; color: #f5f5f7; border: 1px solid #ffffff24; border-radius: 8px; }
.player-message { color: var(--text); background: var(--surface); border-color: var(--line); max-height: none; }
.player-message > strong { color: var(--signal); font-size: 1.0625rem; }
.player-message p { color: var(--muted); font-size: .9375rem; }
.player-programme { color: var(--muted); border-color: var(--line); }
.playback-approval { background: var(--bg); border-color: var(--border); }
.channel-stepper, .player-browser { border-color: var(--line); }
.player-channel-option { color: var(--text); border-radius: 12px; }
.player-channel-option.selected { background: var(--raised); box-shadow: inset 3px 0 0 var(--selection-edge); }
.player-channel-option > svg { color: var(--text); }
.player-channel-option small, .player-search { color: var(--muted); }
.player-grabber {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 28px;
  padding: 0; margin: 0; cursor: grab; touch-action: none; background: var(--surface);
  border-radius: 20px 20px 0 0; color: var(--muted);
}
.player-grabber span { display: block; width: 36px; height: 5px; border-radius: 999px; background: var(--border); }
.player-grabber:active { cursor: grabbing; }
.player-grabber:focus-visible { outline-offset: -4px; }
.player-heading { touch-action: none; }
.is-dragging { transition: none !important; user-select: none; }
.mini-caption, .mini-controls { display: none; }

.mobile-nav {
  --nav-surface: var(--glass-surface); --nav-ink: var(--muted); --nav-selected: var(--text);
  --nav-rim: var(--glass-rim); --nav-solid: var(--surface);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px;
  max-width: 420px; padding: 6px; border-color: var(--glass-rim);
  background: var(--glass-surface); border-radius: 30px;
  box-shadow: 0 4px 26px var(--shadow), inset 0 1px 0 var(--glass-rim);
  backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2);
}
.mobile-nav-indicator {
  width: calc((100% - 12px) / 3); background: var(--selection); border: 0;
  border-radius: 25px; box-shadow: none;
}
.mobile-nav button { font-size: .75rem; color: var(--muted); font-weight: 550; min-height: 52px; }
.mobile-nav button svg { width: 23px; height: 23px; }
.mobile-nav button[aria-current=page] { color: var(--text); font-weight: 700; }
.main::after { height: calc(100px + env(safe-area-inset-bottom, 0px)); backdrop-filter: none; -webkit-backdrop-filter: none; }
.toast { background: var(--text); color: var(--surface); border-color: var(--text); border-radius: 14px; box-shadow: 0 6px 24px var(--shadow); }
body.has-mini-player .page-content { padding-bottom: calc(var(--mini-height) + 130px + env(safe-area-inset-bottom, 0px)); }
body.has-mini-player .toast { bottom: calc(180px + env(safe-area-inset-bottom, 0px)); }

/* Same video and engine, reflowed into an accessory instead of recreated. */
.player-dialog.player-mini[open] {
  display: grid; grid-template-columns: 88px minmax(0, 1fr) 88px; align-items: center;
  position: fixed; inset: auto 12px var(--mini-bottom); z-index: 34;
  width: calc(100% - 24px); max-width: 428px; min-width: 0; height: var(--mini-height);
  min-height: var(--mini-height); max-height: var(--mini-height); margin: 0 auto; padding: 8px; gap: 8px;
  border: 1px solid var(--glass-rim); border-radius: 20px; overflow: hidden;
  background: var(--glass-surface); color: var(--text);
  box-shadow: 0 6px 30px var(--shadow), inset 0 1px 0 var(--glass-rim);
  backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2);
}
.player-mini > .player-heading, .player-mini > .player-grabber,
.player-mini .player-footer, .player-mini .player-browser, .player-mini .playback-hints,
.player-mini .player-programme, .player-mini .player-message, .player-mini .channel-stepper,
.player-mini .pip-browser-help, .player-mini .player-status { display: none; }
.player-mini .cinema-layout { display: block; grid-column: 1; grid-row: 1; width: 88px; min-width: 0; }
.player-mini .cinema-stage { width: 88px; min-width: 0; }
.player-mini .video-container { width: 88px; height: 50px; max-height: 50px; aspect-ratio: 16/9; border-radius: 11px; overflow: hidden; background: #050505; }
.player-mini video { width: 88px; height: 50px; max-height: 50px; object-fit: contain; background: #050505; }
.player-mini .mini-caption {
  display: flex; grid-column: 2; grid-row: 1; flex-direction: column; justify-content: center;
  align-items: flex-start; text-align: left; min-width: 0; min-height: 48px; padding: 2px 0; gap: 3px;
}
.mini-caption #mini-title { display: block; color: var(--text); font-size: .875rem; font-weight: 650; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mini-caption #mini-subtitle { display: block; color: var(--muted); font-size: .75rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.player-mini .mini-controls { display: flex; grid-column: 3; grid-row: 1; justify-content: flex-end; align-items: center; gap: 0; width: 88px; min-width: 0; }
.player-mini .mini-controls .icon-button { flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; padding: 10px; color: var(--text); }
.player-mini .mini-controls .icon-button svg { width: 20px; height: 20px; }
/* If expand is a separate button, its hit region lives over the thumbnail. */
.player-mini .mini-controls #mini-expand { position: absolute; left: 8px; top: 10px; width: 88px; height: 50px; border-radius: 11px; background: #00000020; color: #ffffff; }
.player-mini .mini-controls #mini-expand:hover { background: #00000050; }
.player-mini .mini-controls #mini-expand svg { width: 18px; height: 18px; opacity: .9; }
.player-mini #mini-toggle { background: var(--raised); border-radius: 50%; }
.player-mini #mini-close { color: var(--muted); }

@media (min-width: 1100px) {
  :root { --rail: 216px; --category: 170px; --channel-list: 340px; }
  .sidebar { padding: 30px 16px; }
  .sidebar .nav-item { min-height: 46px; font-size: .9375rem; }
  .topbar { height: 72px; padding-inline: 32px; }
  .page-content { padding: 32px 32px 40px; }
  .page-heading { margin-bottom: 30px; }
  .channel-rows { max-height: calc(100dvh - 310px); }
  .category-list { max-height: calc(100dvh - 330px); }
  .player-dialog.player-mini[open] {
    inset: auto 24px 24px auto; width: 360px; max-width: 360px;
    grid-template-columns: 88px minmax(0, 1fr) 88px; margin: 0;
  }
  body.has-mini-player .page-content { padding-bottom: 40px; }
  body.has-mini-player .toast { bottom: 116px; }
}

@media (max-width: 1099px) {
  .category-list { padding: 2px 0 10px; gap: 8px; }
  .category-row { background: var(--surface); border: 1px solid var(--line); padding: 10px 16px; font-size: .9375rem; }
  .category-row.active { color: var(--on-accent); background: var(--accent); border-color: var(--accent); box-shadow: none; }
  .category-row.active > span:last-child { color: var(--on-accent); }
  .channel-tune { padding: 16px; }
  .player-dialog.player-expanded { border-radius: 22px; }
}

@media (max-width: 700px) {
  .topbar { height: calc(64px + env(safe-area-inset-top, 0px)); padding-inline: 16px; border-bottom: 0; }
  .breadcrumb #breadcrumb { font-size: 1rem; }
  .page-content { padding: 14px 16px calc(var(--nav-gap) + env(safe-area-inset-bottom, 0px)); }
  .page-heading { margin-bottom: 24px; }
  .page-heading h1 { font-size: 2.125rem; margin-bottom: 8px; }
  .page-heading p { font-size: .9375rem; max-width: 28em; }
  .library-toolbar { gap: 12px; margin-bottom: 16px; }
  .active-source-control { font-size: .875rem; gap: 12px; }
  .active-source-control select { font-size: 1rem; }
  .category-list { margin-bottom: 0; }
  .channel-pane { border-radius: 18px; }
  .channel-pane > .section-heading { padding: 14px 14px 14px 18px; }
  .channel-pane .section-heading p { display: none; }
  .channel-tune { min-height: 86px; gap: 12px; padding: 16px 8px 16px 14px; }
  .channel-number { display: none; }
  .channel-copy strong { font-size: 1.0625rem; line-height: 1.35; }
  .channel-copy > span { font-size: .8125rem; }
  .channel-row .channel-mark { width: 44px; height: 44px; }
  .row-favourite { margin-right: 4px; }
  .row-play { display: none; }
  .layout-options .icon-button { width: 44px; min-width: 44px; }
  .source-index { padding-inline: 16px; }
  .source-choice { width: 218px; padding: 14px 10px; }
  .connection-detail { padding: 22px 20px; }
  .connection-title h2 { font-size: 1.5rem; }
  .connection-actions .button { flex-basis: calc(50% - 8px); font-size: .875rem; }
  .connection-facts { gap: 22px; }
  .connection-facts dd { font-size: .9375rem; }
  .settings-navigation { background: var(--bg); }
  .settings-navigation button { font-size: .75rem; white-space: normal; line-height: 1.35; }
  .settings-content { padding: 24px 20px; }
  .setting-row { gap: 18px; }
  .setting-row p { font-size: .9375rem; }
  .player-dialog.player-expanded { border-radius: 0; }
  .cinema-player .player-heading { padding: 6px 14px 16px; }
  .cinema-player .player-heading h2 { font-size: 1.0625rem; max-width: none; line-height: 1.35; }
  .cinema-player .player-heading p { font-size: .8125rem; }
  .cinema-player .player-heading .eyebrow { display: none; }
  .cinema-player .player-tools { gap: 0; }
  .cinema-player .player-tools .icon-button { width: 44px; min-width: 44px; }
  .cinema-player .player-footer { padding: 10px 16px; }
  .cinema-player .player-footer > div { gap: 4px; }
  .quality-label { font-size: .8125rem; gap: 6px; }
  #player-info { font-size: .8125rem; }
  .player-browser { padding: 8px 16px 24px; }
  .player-browser .pane-heading .eyebrow { display: none; }
  .player-browser .pane-heading h3 { font-size: 1.25rem; }
  .channel-stepper { padding: 16px; }
  .channel-stepper .button { font-size: .875rem; }
  .bottom-note { align-items: flex-start; padding: 20px; }
  .bottom-note .text-button { margin-left: 0; }
}

@media (max-width: 360px) {
  .page-content { padding-inline: 12px; }
  .topbar { padding-inline: 12px; }
  .channel-copy strong { font-size: 1rem; }
  .channel-tune { gap: 10px; padding-left: 12px; }
  .channel-row .channel-mark { width: 38px; height: 38px; }
  .channel-pane > .section-heading { padding-left: 14px; }
  .mobile-nav { left: 12px; right: 12px; }
  .player-dialog.player-mini[open] { gap: 6px; grid-template-columns: 88px minmax(0, 1fr) 88px; }
  .mini-caption #mini-title { font-size: .8125rem; }
  .mini-caption #mini-subtitle { font-size: .75rem; }
  .connection-facts { grid-template-columns: 1fr; }
  .connection-actions .button { flex-basis: 100%; }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .mobile-nav, .player-dialog.player-mini[open] {
    background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none;
    border-color: var(--border); box-shadow: none;
  }
  .mobile-nav-indicator { background: var(--raised); border: 1px solid var(--border); }
  .main::after { display: none; }
}
@media (prefers-contrast: more) {
  :root, html[data-theme] { --line: var(--border); --stroke-soft: var(--border); --muted: var(--text); }
  .sidebar, .topbar, dialog, .source-item, .layout-options, .filter-chip,
  form input:not([type=file]) { border-color: var(--border); }
  .mobile-nav button { color: var(--text); }
  dialog::backdrop { background: var(--veil); }
  .category-row.active { outline: 1px solid var(--text); outline-offset: -2px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .mobile-nav, .player-dialog.player-mini[open] { background: var(--surface); border-color: var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
