:root {
  color-scheme: dark;
  --bg: #111025;
  --rail: #201c43;
  --row: #15252d;
  --field: #14232c;
  --hover: #23404c;
  --line: #30444c;
  --accent: #bbabff;
  --theme-accent: #bbabff;
  --selection: #573f86;
  --text: #f5f6fc;
  --muted: #b4c0d0;
  --rail-width: clamp(8.7rem, 13vw, 11rem);
  font: 16px/1.38 Roboto, 'Segoe UI', sans-serif;
}
.theme-card[data-theme=default] { --bg:#111025; --rail:#201c43; --row:#15252d; --selection:#573f86; --theme-accent:#bbabff; }
:root[data-theme=sapphire], .theme-card[data-theme=sapphire] { --bg:#0d1b31; --rail:#15294c; --row:#14263d; --line:#355176; --field:#142942; --hover:#254667; --selection:#244f80; --theme-accent:#8dc4ff; }
:root[data-theme=aurora], .theme-card[data-theme=aurora] { --bg:#12162b; --rail:#252347; --row:#1b293c; --line:#514a71; --field:#252c47; --hover:#404b64; --selection:#413769; --theme-accent:#c0a9ff; }
:root[data-theme=emerald], .theme-card[data-theme=emerald] { --bg:#0b211d; --rail:#12382f; --row:#142e28; --line:#386153; --field:#16362d; --hover:#28544a; --selection:#23584a; --theme-accent:#83e1bd; }
:root[data-theme=sunset], .theme-card[data-theme=sunset] { --bg:#26171e; --rail:#402434; --row:#38272d; --line:#704852; --field:#3a2732; --hover:#624350; --selection:#65384a; --theme-accent:#ffac91; }
:root[data-theme=graphite], .theme-card[data-theme=graphite] { --bg:#191b21; --rail:#242831; --row:#282c36; --line:#474e5a; --field:#30343d; --hover:#454b59; --selection:#404a5d; --theme-accent:#c1d2e6; }
:root[data-theme=clear-glass], .theme-card[data-theme=clear-glass] { --bg:#111e29; --rail:#213542; --row:#1c2d39; --line:#41606e; --field:#243944; --hover:#355363; --selection:#2b5266; --theme-accent:#ade6ef; }
:root[data-theme=liquid-glass], .theme-card[data-theme=liquid-glass] { --bg:#181d29; --rail:#30384f; --row:#282d40; --line:#526075; --field:#2e3a51; --hover:#415574; --selection:#455271; --theme-accent:#bfd5ff; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; min-width: 0; }
button, input, select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: .65rem .8rem;
  background: var(--field);
}
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button:not(:disabled):hover { background: var(--hover); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
input { width: 100%; }
input::placeholder { color: var(--text); opacity: .9; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.45rem, 2.6vw, 2rem); font-weight: 650; }
h2 { font-size: 1.45rem; font-weight: 500; }
a { color: var(--accent); }
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-width);
  padding: .9rem .6rem;
  background: var(--rail);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
}
.rail button { display: flex; align-items: center; gap: .42rem; min-height: 2.85rem; text-align: left; border: 0; background: transparent; color: var(--muted); padding: .45rem .35rem; }
.rail .nav-icon { flex: 0 0 1.85rem; font-size: 1.6rem; line-height: 1; text-align: center; }
.rail .nav-label { font-size: .9rem; white-space: nowrap; }
.rail button[aria-current] { background: var(--accent); color: var(--on-accent, #17112c); }
#settingsNav { margin-top: auto; }
main { margin-left: var(--rail-width); padding: 1rem clamp(.8rem, 1.7vw, 1.4rem); }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .85rem; }
.masthead select { width: min(16rem, 50%); }
.browse { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(13rem, 1.43fr) minmax(20rem, 1.96fr); align-items: start; gap: .68rem; }
.column { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .55rem; min-width: 0; height: calc(100dvh - 6rem); }
.rows { display: grid; align-content: start; overflow: auto; scrollbar-color: #6b7184 transparent; scrollbar-width: thin; }
.rows button { min-height: 3.1rem; border-radius: 0; border: 0; text-align: left; }
#categories button { background: transparent; }
#categories button[aria-pressed=true] { background: var(--selection); }
#items button { display: flex; gap: .55rem; align-items: center; background: var(--row); }
#items button:nth-child(even) { background: color-mix(in srgb, var(--row), var(--bg) 21%); }
#items button[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--accent); }
#items button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-icon { position: relative; display: inline-grid; place-items: center; flex: 0 0 2.45rem; width: 2.45rem; height: 1.9rem; background: #273a47; border-radius: 4px; font-size: .8rem; font-weight: 650; color: #ded7ff; }
.channel-icon.has-logo { color: transparent; background: #e9eff1; }
.channel-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: .13rem; opacity: 0; z-index: 1; }
.channel-logo.loaded { opacity: 1; }
.channel-logo.fallback-logo { z-index: 0; }
.picture { aspect-ratio: 16/9; background: #0b0c14; overflow: hidden; }
.picture video, .standby { width: 100%; height: 100%; }
.standby { display: grid; place-items: center; background: radial-gradient(ellipse, #1d2038, #0b0c14 72%); }
.standby img { width: min(52%, 13rem); height: auto; }
.actions { display: flex; gap: .25rem; margin: .25rem 0 .65rem; }
.actions button { min-height: 2.75rem; }
.actions #watch, .actions #fullscreen { flex: 1 1 0; }
.actions #favourite { flex: none; width: 2.75rem; padding-inline: 0; }
.details { display: grid; gap: .3rem; max-height: 17rem; overflow: auto; }
.muted, .details p, .sign-heading p { color: var(--muted); }
.programme { border-left: 3px solid transparent; padding-left: .55rem; }
.programme:first-of-type { border-color: var(--accent); }
.programme time { color: var(--accent); font-size: .9rem; }
.programme-progress { display: block; appearance: none; border: 0; height: .26rem; width: 100%; margin: .35rem 0 .25rem; background: var(--line); color: var(--accent); }
.programme-progress::-webkit-progress-bar { background: var(--line); }
.programme-progress::-webkit-progress-value { background: var(--accent); }
.programme-progress::-moz-progress-bar { background: var(--accent); }
#status, #signStatus { margin: .65rem 0; color: #ffdca5; }
main[data-view=guide] { display: flex; flex-direction: column; height: 100dvh; }
main[data-view=guide] .masthead { margin-bottom: .5rem; }
main[data-view=guide] .masthead h1 { font-size: 1.5rem; }
main[data-view=guide] .browse { display: block; }
main[data-view=guide] .column { display: none; }
main[data-view=guide] .preview { display: grid; grid-template-columns: clamp(9rem, 25%, 16rem) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: 'video details' 'video actions'; gap: .25rem .85rem; align-items: start; }
main[data-view=guide] .picture { grid-area: video; align-self: start; }
main[data-view=guide] .actions { grid-area: actions; margin: 0; max-width: 25rem; }
main[data-view=guide] .actions button { min-height: 2rem; padding: .25rem .4rem; font-size: .9rem; }
main[data-view=guide] .details { grid-area: details; gap: .16rem; align-content: start; max-height: 7.4rem; }
main[data-view=guide] .details h2 { font-size: clamp(1rem, 2.2vw, 1.45rem); }
main[data-view=guide] .programme { border: 0; padding: 0; }
main[data-view=guide] .guide-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.guide { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: .4rem; margin-top: .55rem; }
.guide-toolbar { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(7rem, 17rem) 1fr; align-items: center; gap: .45rem; }
.guide-toolbar button, .guide-toolbar select, .guide-toolbar input { padding: .32rem .52rem; min-height: 2.15rem; font-size: .9rem; }
.guide-time-controls { justify-self: end; display: flex; gap: .22rem; }
.guide-time-controls button { min-width: 2.15rem; }
.guide-grid { --station-width: clamp(9rem, 21vw, 13rem); --tick-width: clamp(8rem, 15vw, 12.5rem); --schedule-width: calc(var(--tick-width) * 12); --row-height: 2.42rem; --guide-cell: color-mix(in srgb, var(--accent) 18%, var(--rail)); flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-color: #6b7184 transparent; scrollbar-width: thin; border: 1px solid var(--line); border-radius: 6px; }
.guide-ruler, .guide-row { display: grid; grid-template-columns: var(--station-width) var(--schedule-width); width: calc(var(--station-width) + var(--schedule-width)); height: var(--row-height); }
.guide-ruler { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.guide-corner, .guide-station { position: sticky; left: 0; z-index: 3; background: var(--bg); }
.guide-corner { display: flex; align-items: center; padding: 0 .5rem; font-size: .8rem; color: var(--accent); white-space: nowrap; }
.guide-rows, .guide-track { position: relative; }
.guide-rows { width: calc(var(--station-width) + var(--schedule-width)); }
.guide-row { position: absolute; left: 0; }
.guide-station { display: flex; align-items: center; min-width: 0; gap: .35rem; border: 0; border-radius: 0; padding: 0 .38rem; text-align: left; font-size: .86rem; }
.guide-station-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-station .channel-icon { flex: 0 0 2.05rem; width: 2.05rem; height: 1.48rem; }
.guide-number { flex: 0 0 1.45rem; color: var(--muted); text-align: right; font-size: .76rem; }
.guide-station.playing { color: var(--accent); }
.guide-station.playing::after { content: '▸'; }
.guide-tick { position: absolute; width: 8.333333%; height: 100%; display: flex; align-items: end; padding: 0 .36rem .25rem; font-size: .86rem; color: var(--muted); border-left: 1px solid var(--line); }
.guide-track { height: 100%; background: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px var(--tick-width)); }
.guide-track::after { content: ''; position: absolute; left: var(--now-position, -100%); width: 1px; inset-block: 0; background: var(--accent); z-index: 2; pointer-events: none; }
.guide-now-tick { position: absolute; left: var(--now-position, -100%); top: 0; z-index: 3; min-width: max-content; background: var(--accent); color: var(--on-accent); padding: 0 .25rem; border-radius: 0 0 4px 0; font-size: .7rem; }
.guide-cell { position: absolute; inset-block: 1px; border: 0; border-radius: 2px; padding: 0 .42rem; background: var(--guide-cell); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: .9rem; }
.guide-cell.past { background: color-mix(in srgb, var(--guide-cell), var(--bg) 46%); color: var(--muted); }
.guide-cell:focus-visible { z-index: 2; }
.guide-cell[aria-current=true] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent), transparent 58%); }
.guide-gap { position: absolute; inset-block: 1px; display: flex; align-items: center; padding: 0 .42rem; color: var(--muted); font-size: .8rem; }
dialog { width: min(29rem, calc(100% - 2rem)); border: 1px solid #3c355f; background: #18162e; color: var(--text); border-radius: 13px; padding: clamp(1rem, 3vw, 1.8rem); }
dialog::backdrop { background: #0b0b1bd9; }
.sign-heading { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.25rem; }
.sign-heading button { margin-left: auto; }
.sign-logo { width: 4rem; height: auto; }
#login { display: grid; gap: .75rem; }
#login label { display: grid; gap: .3rem; color: var(--muted); }
.login-actions { display: grid; grid-auto-rows: 1fr; gap: .55rem; }
.login-actions button { min-height: 2.75rem; }
.primary { background: var(--accent); color: var(--on-accent, #1b1530); font-weight: 650; }
.primary:not(:disabled):hover { background: color-mix(in srgb, var(--accent), var(--field) 15%); }
.connected { margin: 0 0 1rem; color: var(--muted); }
#pairing { margin-top: .9rem; padding: .7rem; border: 1px solid var(--line); border-radius: 7px; }
#pairing .qr { display: grid; gap: .65rem; justify-items: center; text-align: center; }
#pairing canvas { width: min(14.5rem, 100%); height: auto; aspect-ratio: 1; background: #fff; image-rendering: pixelated; }
#pairing .pair-code { font-size: 1.2rem; font-weight: 650; color: var(--accent); }
#pairing .pair-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
#accounts.subscription-picker { width: min(36rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); }
.subscription-picker #pairing { display: grid; gap: 1rem; margin: 0; padding: 0; border: 0; }
.subscription-list { display: grid; align-content: start; gap: .55rem; max-height: min(46dvh, 23rem); padding: .15rem; overflow-y: auto; scrollbar-width: thin; }
.subscription-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .85rem; min-height: 3.75rem; border: 1px solid var(--line); border-radius: 8px; padding: .65rem .85rem; background: var(--row); cursor: pointer; }
.subscription-row:has(input:focus-visible) { border-color: var(--accent); outline: 1px solid var(--accent); }
.subscription-row:has(input:disabled) { cursor: default; }
.subscription-row input { width: 1.18rem; height: 1.18rem; margin: 0; accent-color: var(--accent); }
.subscription-details { display: grid; gap: .12rem; overflow-wrap: anywhere; }
.subscription-plan { color: var(--muted); font-size: .9rem; }
.subscription-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .55rem; }
.subscription-actions button { min-height: 2.75rem; }
@media (max-width: 365px) { .subscription-actions { grid-auto-flow: row; } }
.archive { display: grid; gap: .4rem; margin-top: .35rem; }
.archive button { text-align: left; }
.utility-page { max-width: 68rem; }
.service-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: .8rem; }
.service-card, .settings-card { min-width: 0; display: grid; align-content: start; gap: .7rem; padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--row); }
.service-card { align-content: stretch; grid-template-rows: auto 1fr auto; }
.service-card button { min-height: 2.75rem; align-self: end; margin-top: .3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-card h2 { overflow-wrap: anywhere; }
.service-card dl { display: grid; align-content: start; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1rem; margin: .1rem 0; }
.service-card dt { color: var(--muted); }
.service-card dd { margin: 0; overflow-wrap: anywhere; }
.page-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; max-width: 33rem; margin-top: .9rem; }
.page-actions button { min-height: 2.75rem; }
.settings-card { max-width: 49rem; }
.settings-fields { display: grid; gap: .75rem; }
.settings-fields label { display: grid; gap: .3rem; color: var(--muted); }
.settings-fields fieldset { padding: .6rem .7rem .7rem; min-inline-size: 0; margin: 0; border: 1px solid var(--line); border-radius: 7px; }
.settings-fields legend { padding-inline: .25rem; }
.theme-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: .55rem; }
.theme-card { display: grid; align-content: start; gap: .35rem; padding: .36rem; text-align: left; font-size: .85rem; }
.theme-card[aria-pressed=true], .accent-choice[aria-pressed=true], .custom-accent.custom-selected { box-shadow: inset 0 0 0 2px var(--accent); }
.theme-preview { aspect-ratio: 16/9; display: grid; grid-template: 2fr 1fr / 25% 1fr; gap: 9% 5%; background: var(--bg); padding: 7%; border-radius: 4px; }
.theme-menu { grid-row: 1 / 3; background: linear-gradient(var(--theme-accent) 0 20%, var(--rail) 20%); border-radius: 2px; }
.theme-hero { background: linear-gradient(135deg, var(--selection), var(--rail)); border-radius: 3px; border-bottom: 2px solid var(--theme-accent); }
.theme-tiles { background: repeating-linear-gradient(to right, var(--row) 0 28%, transparent 28% 36%); }
.accent-choices { display: flex; flex-wrap: wrap; gap: .4rem; }
.accent-choice { display: flex; align-items: center; min-height: 2.5rem; gap: .45rem; padding: .35rem .55rem; font-size: .86rem; }
.accent-swatch { width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--swatch, linear-gradient(135deg, var(--theme-accent) 50%, var(--rail) 50%)); border: 1px solid var(--line); }
.settings-fields .custom-accent { display: flex; align-items: center; gap: .6rem; width: fit-content; margin-top: .6rem; border: 1px solid var(--line); border-radius: 7px; padding: .3rem .55rem; font-size: .9rem; }
.settings-fields input[type=color] { width: 3rem; height: 1.9rem; padding: .16rem; }
@media (max-width: 850px) {
  .browse { grid-template-columns: minmax(8rem, 1fr) minmax(10rem, 1.3fr); }
  .column { height: 30vh; min-height: 11rem; }
  .preview { grid-column: 1 / -1; }
}
@media (max-width: 510px) {
  main { margin-left: 0; padding-bottom: 4.4rem; }
  .rail { inset: auto 0 0; width: auto; z-index: 2; flex-direction: row; justify-content: space-evenly; padding: .3rem; }
  .rail button { flex: 1; flex-direction: column; justify-content: center; gap: .15rem; padding: .3rem .1rem; }
  .rail .nav-icon { flex: none; }
  .rail .nav-label { white-space: normal; overflow-wrap: anywhere; text-align: center; font-size: .76rem; }
  .menu-collapsed .nav-label { display: none; }
  #settingsNav { margin-top: 0; }
  .browse { grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); }
  .preview { grid-row: 1; }
  main[data-view=guide] { padding-bottom: 4rem; }
  main[data-view=guide] .preview { grid-template-columns: minmax(6.8rem, 36%) minmax(0, 1fr); gap: .25rem .45rem; }
  main[data-view=guide] .details { max-height: 5.65rem; }
  main[data-view=guide] .guide-description { -webkit-line-clamp: 1; }
  main[data-view=guide] .actions #favourite { width: 1.8rem; }
  .guide-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: .25rem; }
  .guide-toolbar input, .guide-toolbar select, .guide-toolbar button { font-size: .77rem; min-height: 2rem; padding: .2rem .3rem; }
  .guide-time-controls button { min-width: 1.4rem; }
  .guide-grid { --station-width: 7.2rem; --tick-width: 7rem; --row-height: 2.25rem; }
  .guide-number { display: none; }
  .guide-station { font-size: .73rem; padding-inline: .25rem; }
  .guide-station .channel-icon { flex-basis: 1.55rem; width: 1.55rem; height: 1.2rem; }
}

@font-face {
  font-family: Roboto;
  src: url("roboto.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root[data-theme="mbs"], .theme-card[data-theme="mbs"] {
  --bg: #0B1018;
  --rail: #0F1622;
  --row: #152031;
  --field: #121B2A;
  --hover: #26354B;
  --line: #29384E;
  --text: #EDF3FD;
  --muted: #AAB9CF;
  --accent: #FF9900;
  --theme-accent: #FF9900;
  --selection: #332618;
  --on-accent: #111018;
  --rail-width: 10.4rem;
  font-family: Roboto, "Segoe UI", sans-serif;
}

:root { background: var(--bg); }
body { margin: 0; background: var(--bg); }
body:has(#accounts[open]), body.install-page {
  background: radial-gradient(ellipse at 72% 8%, #172942 0%, #0F1724 35%, #0B1018 76%);
}
.rail {
  padding: 1.15rem .66rem .85rem;
  border-right: 1px solid var(--line);
}
.rail-brand {
  display: grid;
  place-items: center start;
  min-height: 3.55rem;
  padding: .15rem .58rem .75rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}
.rail-brand img { display: block; width: min(100%, 7.25rem); height: auto; }
.rail button { min-height: 2.95rem; padding-inline: .55rem; }
.rail button[aria-current] {
  background: color-mix(in srgb, var(--accent) 12%, var(--rail));
  box-shadow: inset 3px 0 var(--accent);
  color: var(--text);
}
.rail button[aria-current] .nav-icon { color: var(--accent); }
.rail-label-logo { display: none; }
.browser-title { display: flex; min-width: 0; align-items: center; gap: .62rem; }
.masthead { min-height: 2.85rem; margin-bottom: 1rem; }
.masthead h1 { font-size: clamp(1.55rem, 2vw, 2rem); font-weight: 700; letter-spacing: -.025em; }
.masthead select { width: min(14rem, 48%); }
input::placeholder { color: var(--muted); opacity: 1; }

.column .rows {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--row) 42%, var(--bg));
}
.column .rows button + button { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.rows button { padding-inline: .75rem; }
#categories button[aria-pressed="true"] {
  background: var(--selection);
  box-shadow: inset 3px 0 var(--accent);
  color: var(--text);
  font-weight: 600;
}
#items button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 19%, var(--bg)); }
.channel-icon { background: #21334A; color: #D7E5FB; }
.picture {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080D14;
}
.picture video { display: block; object-fit: contain; }
.standby { background: radial-gradient(ellipse, #1A2B45 0%, #0B111C 74%); }
.standby img { width: min(56%, 11rem); }
.actions { gap: .48rem; margin-block: .6rem .72rem; }
.actions #watch:not(:disabled) { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.actions #watch:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 82%, white); }
.details { padding: .78rem .85rem; border: 1px solid var(--line); border-radius: 9px; background: var(--row); }
.details:empty { display: none; }
.details h2 { font-size: 1.28rem; font-weight: 700; }
.details > p { font-size: .86rem; }
.programme + .programme { margin-top: .4rem; }
.programme p { font-size: .89rem; }

main[data-view="guide"] .masthead { margin-bottom: .7rem; }
main[data-view="guide"] .preview {
  grid-template-columns: clamp(10rem, 25%, 17.5rem) minmax(0, 1fr);
  gap: .42rem 1rem;
}
main[data-view="guide"] .details { padding: .58rem .7rem; max-height: none; }
main[data-view="guide"] .actions { margin: 0; }
.guide-grid { --guide-cell: color-mix(in srgb, var(--row) 82%, var(--line)); --row-height: 2.55rem; border-radius: 9px; }
.guide-station, .guide-corner { background: color-mix(in srgb, var(--row) 55%, var(--bg)); border-right: 1px solid var(--line); }
.guide-station { border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.guide-cell[aria-current="true"] { background: var(--hover); }
.guide-cell.past { background: color-mix(in srgb, var(--row), var(--bg) 45%); }
.guide-cell:focus-visible, .guide-cell[aria-current="true"]:focus-visible {
  background: var(--selection);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

dialog, body.install-page main {
  width: min(29rem, calc(100% - 2rem));
  border: 1px solid #31435C;
  color: var(--text);
  border-radius: 16px;
  padding: clamp(1.25rem, 3.4vw, 2.1rem);
  background: linear-gradient(150deg, var(--row), var(--rail) 68%);
  box-shadow: 0 22px 65px #03070D80;
}
dialog::backdrop { background: #080E1760; }
.sign-heading { display: grid; gap: .7rem; margin-bottom: 1.5rem; }
.sign-heading button { position: absolute; top: .85rem; right: .85rem; }
.sign-logo, .install-logo { display: block; width: 8.8rem; height: auto; margin-bottom: .24rem; }
.sign-heading h1, .install-page h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.025em; }
.sign-heading p { margin-top: .22rem; }
#login { gap: .94rem; }
#login label, .install-page label { font-size: .9rem; font-weight: 500; color: var(--muted); }
#login label input, #login label select, .install-page input { min-height: 2.95rem; color: var(--text); font-size: 1rem; }
.login-actions { margin-top: .25rem; gap: .55rem; }
.login-actions button { min-height: 2.95rem; }
.primary:focus-visible, .actions #watch:focus-visible { outline: 2px solid #FFD598; outline-offset: 2px; }

body.install-page { box-sizing: border-box; display: grid; place-items: center; min-height: 100dvh; padding-block: 1.2rem; }
.install-page main { box-sizing: border-box; margin: 0; padding-bottom: 1.7rem; }
.install-page header { display: grid; justify-content: start; gap: .7rem; padding-bottom: 1.35rem; border-bottom: 1px solid var(--line); }
.install-page h1 { margin: 0; }
.install-page .card { border: 0; background: transparent; margin: 1.15rem 0 0; padding: 0; }
.install-page input { box-sizing: border-box; background: var(--field); border-color: var(--line); }
.install-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.install-page .card button { width: 100%; margin-top: .45rem; min-height: 2.95rem; background: var(--accent); color: #111018; font-weight: 700; }
.install-page #status:empty { display: none; }
.install-page #status { margin-top: .75rem; }

@media (max-width: 510px) {
  .rail { padding: .34rem; gap: .18rem; border: 0; border-top: 1px solid var(--line); }
  .rail-brand { display: none; }
  .rail button { min-height: 2.8rem; padding-inline: .1rem; }
  .rail button[aria-current] { box-shadow: inset 0 2px var(--accent); }
  .rail .nav-icon { font-size: 1.24rem; }
  .rail .nav-label { font-size: clamp(.53rem, 2.48vw, .66rem); letter-spacing: -.015em; white-space: nowrap; }
  .rail-label-logo { display: block; width: 3.45rem; }
  .masthead h1 { font-size: 1.32rem; white-space: nowrap; }
  .masthead select { padding-inline: .43rem; font-size: .8rem; }
  .column input { font-size: .84rem; padding-inline: .55rem; }
  .actions button { font-size: .86rem; }
  .details { max-height: 14rem; gap: .24rem; }
  .rows button { padding-inline: .45rem; }
  .channel-icon { flex-basis: 1.82rem; width: 1.82rem; height: 1.55rem; font-size: .7rem; }
  main[data-view="guide"] .preview { grid-template-columns: minmax(6.6rem, 35%) minmax(0, 1fr); gap: .28rem .5rem; }
  main[data-view="guide"] .details { padding: .35rem .43rem; max-height: 6rem; }
}
