@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/SpaceGrotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/SpaceGrotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

:root {
  --bg: oklch(0.975 0.005 250);
  --bg2: #ffffff;
  --bg3: oklch(0.955 0.006 250);
  --line: oklch(0.905 0.007 255);
  --line2: oklch(0.85 0.01 255);
  --fg: oklch(0.24 0.014 258);
  --fg2: oklch(0.51 0.012 258);
  --fg3: oklch(0.66 0.012 258);
  --accent: oklch(0.52 0.14 258);
  --accent-fg: #fff;
  --accent-soft: oklch(0.945 0.035 258);
  --live: oklch(0.55 0.16 42);
  --live-soft: oklch(0.95 0.04 60);
  --scrim: oklch(0.2 0.02 258 / 0.42);
  --shadow: 0 1px 2px oklch(0.24 0.02 258 / 0.06), 0 8px 30px oklch(0.24 0.02 258 / 0.08);
  --chrow: 158px;
  --ppm: 3.6;
}

[data-theme='dark'] {
  --bg: oklch(0.18 0.012 258);
  --bg2: oklch(0.225 0.014 258);
  --bg3: oklch(0.255 0.014 258);
  --line: oklch(0.32 0.014 258);
  --line2: oklch(0.4 0.016 258);
  --fg: oklch(0.955 0.006 250);
  --fg2: oklch(0.74 0.012 255);
  --fg3: oklch(0.6 0.014 255);
  --accent: oklch(0.76 0.12 258);
  --accent-fg: oklch(0.18 0.012 258);
  --accent-soft: oklch(0.3 0.05 258);
  --live: oklch(0.79 0.14 62);
  --live-soft: oklch(0.32 0.06 62);
  --scrim: oklch(0.12 0.02 258 / 0.55);
  --shadow: 0 1px 2px #0006, 0 12px 40px #0007;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

body { padding-bottom: 96px; }

button { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-soft); }
h1, h2, h3 { margin: 0; }

.num { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

.sb::-webkit-scrollbar { height: 10px; width: 10px; }
.sb::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 10px; border: 3px solid var(--bg); }
.sb::-webkit-scrollbar-track { background: transparent; }
.nosb { scrollbar-width: none; }
.nosb::-webkit-scrollbar { display: none; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--bg2); color: var(--fg); padding: 12px 18px;
  border: 1px solid var(--line); border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

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

.shell { max-width: 1560px; margin: 0 auto; padding: 0 28px; }

/* ---------- header ---------- */

.head {
  display: flex; align-items: center; gap: 24px;
  padding: 22px 0 18px; border-bottom: 1px solid var(--line);
}
.brand { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; min-width: 170px; color: var(--fg); }
.brand:hover { text-decoration: none; }

.searchbtn {
  flex: 1; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; text-align: left; color: var(--fg3); max-width: 420px; font-size: 14.5px;
}
.searchbtn:hover { border-color: var(--line2); }
.searchbtn .kbd { margin-left: auto; font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }

.headright { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.seg { display: flex; background: var(--bg3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  height: 38px; padding: 0 16px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 500; background: transparent; color: var(--fg3);
}
.seg button[aria-pressed='true'] {
  background: var(--bg2); color: var(--fg);
  box-shadow: 0 1px 2px oklch(0.2 0.02 258 / 0.12);
}

.pillbtn {
  height: 44px; padding: 0 16px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; font-size: 14.5px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; gap: 9px; color: var(--fg);
}
.pillbtn:hover { border-color: var(--line2); }
.pillbtn .dot { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); display: inline-block; }
.pillbtn .count { font-size: 12px; color: var(--fg3); }
.pillbtn .ico, .searchbtn .ico { display: none; }
.themebtn { font-weight: 500; gap: 0; }

/* Channel logos arrive in every possible colour and aspect ratio, from a 0.5 portrait
   mark to a 4.7 wordmark, and some are pure white. A fixed tile with object-fit keeps
   them optically equal and always legible; in dark mode the tile is dimmed rather than
   dropped, since a transparent logo would vanish half the time. */
.chlogo {
  display: block; width: 108px; height: 36px; object-fit: contain; flex-shrink: 0;
  background: #fff; border-radius: 7px; padding: 5px 8px;
  box-shadow: inset 0 0 0 1px oklch(0.5 0.01 258 / 0.12);
}
.chlogo.sm { width: 62px; height: 22px; padding: 2px 5px; border-radius: 5px; }
[data-theme='dark'] .chlogo { background: oklch(0.93 0.004 250); box-shadow: none; }
.chip + .nm, .chlogo + .nm { margin-left: 2px; }

/* ---------- day strip ---------- */

.daybar { display: flex; align-items: center; gap: 18px; padding: 16px 0 14px; }
.days { display: flex; gap: 6px; overflow-x: auto; flex: 1; }
.day {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 68px; height: 52px; border-radius: 10px; cursor: pointer; font-weight: 500;
  border: 1px solid var(--line); background: var(--bg2); color: var(--fg); text-decoration: none;
}
.day:hover { text-decoration: none; border-color: var(--line2); }
.day .wd { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; }
.day .dd { font-size: 14.5px; font-weight: 500; }
.day[aria-current='page'] { background: var(--accent); border-color: transparent; color: var(--accent-fg); }
.day.past { color: var(--fg3); }
.day.past[aria-current='page'] { color: var(--accent-fg); }

.datepick {
  height: 52px; padding: 0 14px; background: transparent; border: 1px dashed var(--line2);
  border-radius: 10px; color: var(--fg2); font-size: 13.5px; cursor: pointer; white-space: nowrap;
  position: relative;
}
.datepick:hover { color: var(--fg); border-color: var(--fg3); }
.datepick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ---------- discovery hint ---------- */

.hint {
  display: flex; align-items: center; gap: 14px; padding: 11px 16px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg2);
}
.hint p { margin: 0; font-size: 13.5px; color: var(--fg2); }
.hint .go { margin-left: auto; background: transparent; border: none; color: var(--accent); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.hint .x { background: transparent; border: none; color: var(--fg3); font-size: 16px; cursor: pointer; line-height: 1; padding: 4px; }

/* ---------- now on air ---------- */

.now { margin-bottom: 26px; }
.now-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.now-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.clock { font-size: 13px; color: var(--live); display: flex; align-items: center; gap: 6px; }
.clock .beat { width: 6px; height: 6px; border-radius: 50%; background: var(--live); display: inline-block; animation: pulse 2.4s infinite; }
.now-date { font-size: 13px; color: var(--fg3); }

.nowrow { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.nowcard {
  flex: 0 0 236px; text-align: left; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 9px;
  color: var(--fg);
}
.nowcard:hover { border-color: var(--line2); text-decoration: none; }
.nowcard .top { display: flex; align-items: center; gap: 8px; }
.nowcard .remain { margin-left: auto; font-size: 11.5px; color: var(--fg3); }
.nowcard .t {
  font-size: 15px; font-weight: 500; line-height: 1.28; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px;
}
.nowcard .nxt { display: flex; gap: 7px; font-size: 12px; color: var(--fg3); align-items: baseline; }
.nowcard .nxt .n2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg2); }

.track { height: 4px; border-radius: 3px; background: var(--bg3); overflow: hidden; display: block; }
.track > i { display: block; height: 100%; background: var(--live); border-radius: 3px; }

.chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 20px; min-width: 38px; padding: 0 7px; border-radius: 5px;
  color: #fff; font-variant-numeric: tabular-nums; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.02em; white-space: nowrap; flex-shrink: 0;
}
.chip.big { height: 22px; min-width: 44px; font-size: 11px; }

/* ---------- grid ---------- */

.gridwrap {
  border: 1px solid var(--line); border-radius: 14px; overflow: auto;
  max-height: 74vh; background: var(--bg2); position: relative;
}
.canvas { position: relative; min-width: 100%; }
.rowtrack, .rulertrack { display: flex; flex: 0 0 auto; }
.dayseg { position: relative; flex: 0 0 auto; height: 100%; }
.ruler .dayseg { height: 38px; }
.ruler .dayseg + .dayseg::before,
.rowtrack .dayseg + .dayseg::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--line2); z-index: 2;
}
/* The day label rides along with its segment so you always know where you are. */
.daymark {
  position: sticky; left: calc(var(--chrow) + 6px); z-index: 7; display: inline-block; margin: 8px 0 0 6px;
  padding: 3px 9px; border-radius: 6px; background: var(--bg3); color: var(--fg2);
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  white-space: nowrap; pointer-events: none;
}

.ruler {
  position: sticky; top: 0; z-index: 6; height: 38px; display: flex;
  background: var(--bg2); border-bottom: 1px solid var(--line);
}
.ruler .corner {
  position: sticky; left: 0; z-index: 8; width: var(--chrow); flex: 0 0 var(--chrow);
  height: 38px; background: var(--bg2);
  border-right: 1px solid var(--line); display: flex; align-items: center; padding: 0 14px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3);
}
.tick {
  position: absolute; top: 0; height: 38px; border-left: 1px solid var(--line);
  padding-left: 8px; display: flex; align-items: center; font-size: 12px;
  color: var(--fg2); pointer-events: none;
}
.tick.half { color: transparent; opacity: 0.5; }

.nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--live); z-index: 4; pointer-events: none; }
.nowflag {
  position: absolute; top: 7px; z-index: 4; background: var(--live); color: #fff;
  font-size: 11px; font-weight: 600; padding: 3px 6px; border-radius: 5px; pointer-events: none;
}

.grow { position: relative; height: 78px; border-bottom: 1px solid var(--line); background: var(--bg3); display: flex; }
.grow.alt { background: var(--bg2); }
.grow:last-child { border-bottom: none; }
.grow .chcell {
  position: sticky; left: 0; z-index: 5; width: var(--chrow); flex: 0 0 var(--chrow);
  height: 100%; background: inherit;
  border-right: 1px solid var(--line); display: flex; align-items: center; padding: 0 14px;
}

.blk {
  position: absolute; top: 5px; height: 68px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; cursor: pointer;
  display: flex; flex-direction: column; gap: 1px; text-align: left; color: var(--fg);
  /* clip, not hidden: hidden would make the block its own scroll container and the
     sticky labels below would have nothing to stick to. */
  overflow: clip;
}
.blk:hover { border-color: var(--line2); text-decoration: none; }
/* Keeps a three-hour film's title on screen while the grid scrolls under it. The
   content-based width is what gives the sticky label room to slide; stretched to the
   full block it would have nowhere to go. The offset clears the sticky channel gutter —
   pinned to 0 the label would slide underneath it and vanish. */
.blk > span { position: sticky; left: calc(var(--chrow) + 9px); width: max-content; max-width: 100%; }
.blk .bt { font-size: 11px; color: var(--fg3); font-weight: 500; line-height: 1; }
.blk .bn {
  font-size: 13px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  flex: 0 1 auto; min-height: 0;
}
.blk .bm { margin-top: auto; font-size: 11px; color: var(--fg3); }
.blk.narrow { padding: 6px; }
.blk.narrow .bn { font-size: 12px; }
.blk.narrow .bm, .blk.tiny .bm { display: none; }
.blk.tiny { padding: 6px 4px; }
.blk.tiny .bt, .blk.tiny .bn { font-size: 11px; }
/* A five-minute filler is unreadable at true scale, so lift it out on demand. */
.blk:hover, .blk:focus-visible { z-index: 3; min-width: 176px; }
.blk:hover .bm, .blk:focus-visible .bm { display: block; }
.blk.past { opacity: 0.62; }
.blk.pause {
  background: transparent; border-style: dashed; border-color: var(--line);
  cursor: default; color: var(--fg3); justify-content: center;
}
.blk.pause .bn { font-size: 12px; font-weight: 400; color: var(--fg3); }
.blk.pause .bt { color: var(--fg3); opacity: 0.7; }
.blk.pause:hover { min-width: 0; border-color: var(--line); }
.blk.tiny.pause .bn { display: none; }
.blk.live { background: var(--live-soft); border-color: var(--live); }
.blk.live .bt { color: var(--live); }

.showpast { display: none; }
.dayseg.spacer { background: repeating-linear-gradient(135deg, var(--bg3) 0 12px, transparent 12px 24px); }
.endcap {
  position: absolute; top: 38px; bottom: 0; width: 300px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 0 28px; text-align: center;
  background: repeating-linear-gradient(135deg, var(--bg3) 0 12px, var(--bg2) 12px 24px);
  border-left: 2px solid var(--line2);
  pointer-events: none;
}
.endcap[data-endcap='back'] { border-left: none; border-right: 2px solid var(--line2); }
.endcap strong { font-size: 14px; font-weight: 600; }
.endcap span { font-size: 12.5px; color: var(--fg3); line-height: 1.45; }
.gridloading {
  position: absolute; top: 38px; bottom: 0; width: 120px; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--fg3);
}
.gridhelp { display: flex; gap: 20px; padding: 12px 4px 0; font-size: 12.5px; color: var(--fg3); flex-wrap: wrap; }

/* ---------- list ---------- */

.cols { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.col { flex: 0 0 300px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); overflow: hidden; }
.col > header {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg2); z-index: 2;
}
.col > header .nm { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

.row {
  display: flex; gap: 12px; width: 100%; padding: 11px 14px; min-height: 52px;
  align-items: flex-start; cursor: pointer; text-align: left; background: transparent;
  border: none; border-top: 1px solid var(--line); color: var(--fg);
}
.col .row:first-of-type { border-top: none; }
.row:hover { background: var(--bg3); text-decoration: none; }
.row .rt { font-size: 14px; font-weight: 500; width: 44px; flex-shrink: 0; color: var(--fg2); padding-top: 1px; }
.row .body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.row .rn { font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.28; }
.row .rs { font-size: 12.5px; color: var(--fg3); }
.row .prog { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.row .prog .track { flex: 1; }
.row .prog .rr { font-size: 11px; color: var(--live); white-space: nowrap; }
.row.past { opacity: 0.55; }
.row.live { background: var(--live-soft); }
.row.live .rt { color: var(--live); }

/* ---------- phone ---------- */

.phonebar, .chipbar { display: none; }

@media (max-width: 900px) {
  /* Height of the sticky day bar — the channel chips park directly underneath it. */
  .shell { padding: 0 16px; --pbh: 62px; }
  /* The 10px gap below the header lives on the day bar instead, so that once the bar
     sticks it keeps the same breathing room against the top of the screen. */
  .head { gap: 10px; padding: 16px 0 2px; border-bottom: none; }
  .brand { min-width: 0; font-size: 19px; }
  .searchbtn { flex: 0 0 44px; max-width: 44px; height: 44px; padding: 0; justify-content: center; }
  .searchbtn .lbl, .searchbtn .kbd { display: none; }
  .headright { gap: 8px; }
  .seg { display: none; }
  .pillbtn { width: 44px; padding: 0; justify-content: center; }
  .pillbtn .lbl, .pillbtn .count, .pillbtn .dot { display: none; }
  .pillbtn .ico { display: block; font-size: 15px; }
  .themebtn { width: 44px; padding: 0; justify-content: center; }

  .daybar { display: none; }
  /* Stays put while the day scrolls, so switching days never needs a scroll back up.
     The negative gutter lets its background bleed over the shell padding, otherwise
     rows would slide past in the 16px margins. */
  .phonebar {
    display: flex; align-items: center; gap: 8px;
    position: sticky; top: 0; z-index: 16; background: var(--bg);
    margin: 0 -16px; padding: 8px 16px 10px;
  }
  .phonebar .nav {
    width: 44px; height: 44px; border-radius: 11px; background: var(--bg2);
    border: 1px solid var(--line); cursor: pointer; flex-shrink: 0; color: var(--fg);
    display: flex; align-items: center; justify-content: center; font-size: 18px; text-decoration: none;
  }
  .phonebar .cur {
    flex: 1; height: 44px; border-radius: 11px; background: var(--bg2); border: 1px solid var(--line);
    font-size: 14.5px; font-weight: 500; display: flex; align-items: center; justify-content: center;
    gap: 8px; position: relative; cursor: pointer;
  }
  .phonebar .cur .dd { font-size: 12.5px; color: var(--fg3); }
  .phonebar .cur input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

  .now { margin-bottom: 14px; }
  .nowrow { gap: 9px; }
  .nowcard { flex: 0 0 205px; padding: 12px; }
  .nowcard .nxt { display: none; }

  .gridwrap, .gridhelp { display: none; }

  .chipbar {
    display: flex; gap: 7px; overflow-x: auto;
    position: sticky; top: var(--pbh); z-index: 15; background: var(--bg);
    border-bottom: 1px solid var(--line);
    margin: 0 -16px; padding: 8px 16px 12px;
  }
  .chipbar button {
    height: 38px; padding: 0 14px; border-radius: 19px; cursor: pointer; white-space: nowrap;
    font-size: 13.5px; font-weight: 500; flex-shrink: 0;
    border: 1px solid var(--line); background: var(--bg2); color: var(--fg2);
  }
  /* The chip holds a light logo tile, so mark the selection with a ring rather than a
     background swap, which would vanish against the tile in dark mode. */
  .chipbar button[aria-pressed='true'] {
    border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--bg2);
  }
  .chipbar button { padding: 0 8px; display: flex; align-items: center; }

  .cols { display: block; overflow: visible; padding-bottom: 0; }
  .col { flex: none; width: 100%; border: none; border-radius: 0; background: transparent; }
  .col > header { display: none; }
  .col[data-phone-hidden] { display: none; }
  .row { padding: 13px 12px; border-radius: 10px; border-top: 1px solid var(--line); }
  .row .rt { font-size: 15px; width: 48px; }
  .row .rn { font-size: 15.5px; }

  .col:not(.show-past) .row.past { display: none; }
  .showpast {
    display: block; width: 100%; margin: 4px 0 2px; padding: 11px 12px; border-radius: 10px;
    border: 1px dashed var(--line2); background: transparent; color: var(--fg2);
    font-size: 13.5px; cursor: pointer; text-align: center;
  }
  .col.show-past .showpast { display: none; }
}

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

.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); backdrop-filter: blur(2px); border: none; width: 100%; height: 100%; cursor: default; }

.drawer {
  position: fixed; z-index: 61; top: 0; right: 0; width: min(520px, 94vw); height: 100dvh;
  background: var(--bg2); border-left: 1px solid var(--line); box-shadow: var(--shadow);
}
.drawer .inner { height: 100%; overflow-y: auto; }

@media (max-width: 900px) {
  .drawer { top: auto; bottom: 0; right: 0; left: 0; width: 100%; height: 88dvh; border-left: none; border-radius: 22px 22px 0 0; }
}

.dhead {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; background: var(--bg2); border-bottom: 1px solid var(--line);
}
.dhead .tr { font-size: 13px; color: var(--fg2); }
.iconbtn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; font-size: 15px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--fg);
}
.dhead .iconbtn { margin-left: auto; }

.hero { height: 236px; display: flex; align-items: center; justify-content: center; background: var(--bg3); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero.empty { height: 96px; }
.hero .ph { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3); background: var(--bg2); padding: 5px 9px; border-radius: 6px; }

.dbody { padding: 20px 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.dbody h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.18; }
.dbody .orig { font-size: 14.5px; color: var(--fg3); font-style: italic; }
.dbody .tags { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.tag { font-size: 12.5px; padding: 4px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.tag.rate { background: transparent; border: 1px solid var(--line); color: var(--fg); font-weight: 400; }
.tag.rerun { background: transparent; border: 1px dashed var(--line2); color: var(--fg3); font-weight: 400; }
.dbody .desc { margin: 0; font-size: 15.5px; line-height: 1.62; max-width: 54ch; }
.dbody .desc.missing { color: var(--fg3); font-style: italic; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.facts div { background: var(--bg2); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.facts dt, .facts .k { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg3); }
.facts dd, .facts .v { margin: 0; font-size: 14.5px; font-weight: 500; }

.again { display: flex; flex-direction: column; gap: 10px; }
.again h3 { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--fg2); }
.again a {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg2); color: var(--fg);
}
.again a:hover { text-decoration: none; border-color: var(--line2); }
.again .dy { font-size: 14px; }
.again .tm { margin-left: auto; font-size: 14px; font-weight: 500; }
.again .rr { font-size: 11px; color: var(--fg3); }
.permalink { font-size: 11.5px; color: var(--fg3); border-top: 1px solid var(--line); padding-top: 14px; word-break: break-all; }

/* ---------- search ---------- */

.searchbox {
  position: fixed; z-index: 71; top: 11vh; left: 50%; transform: translateX(-50%);
  width: min(720px, 92vw); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
}
@media (max-width: 900px) { .searchbox { top: 12px; width: calc(100vw - 24px); } }
.searchbox .top { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.searchbox input {
  flex: 1; border: none; outline: none; background: transparent; font-family: inherit;
  font-size: 20px; font-weight: 450; letter-spacing: -0.015em; color: var(--fg); min-width: 0;
}
.searchbox .esc { border: 1px solid var(--line); background: transparent; border-radius: 7px; padding: 5px 9px; font-size: 11px; color: var(--fg3); cursor: pointer; }
.results { max-height: 60vh; overflow-y: auto; padding: 8px 0 12px; }
.results .msg { padding: 18px 20px 22px; font-size: 14px; color: var(--fg3); }
.results .gh { padding: 12px 20px 4px; display: flex; align-items: baseline; gap: 10px; }
.results .gh .d { font-size: 13px; font-weight: 600; }
.results .gh .c { font-size: 11.5px; color: var(--fg3); }
.hit {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 11px 20px;
  background: transparent; border: none; border-top: 1px solid var(--line); cursor: pointer;
  text-align: left; color: var(--fg);
}
.hit:hover, .hit:focus-visible { background: var(--bg3); text-decoration: none; }
.hit .tm { font-size: 15px; font-weight: 500; width: 52px; flex-shrink: 0; }
.hit .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.hit .n { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit .s { font-size: 12.5px; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- my channels ---------- */

.panel {
  position: fixed; z-index: 81; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(600px, 94vw); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
}
.panel > header { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel > header h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.panel .lede { padding: 14px 20px 0; font-size: 13.5px; color: var(--fg2); line-height: 1.5; margin: 0; }
.panel .list { max-height: 56vh; overflow-y: auto; padding: 12px 14px 6px; display: flex; flex-direction: column; gap: 4px; }
.prow { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; background: transparent; opacity: 0.55; }
.prow.on { background: var(--bg3); opacity: 1; }
.prow .box {
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--line2);
  background: transparent; color: var(--accent-fg); flex-shrink: 0;
}
.prow.on .box { border-color: transparent; background: var(--accent); }
.prow .nm { font-size: 14.5px; font-weight: 500; flex: 1; }
.prow .gp { font-size: 12px; color: var(--fg3); }
.prow .mv { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 12px; color: var(--fg); flex-shrink: 0; }
.prow .mv:disabled { opacity: 0.3; cursor: default; }
.panel > footer { display: flex; gap: 10px; padding: 14px 20px 20px; border-top: 1px solid var(--line); }
.btn {
  height: 42px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line);
  background: transparent; font-size: 14px; cursor: pointer; color: var(--fg);
}
.btn.primary { border: none; background: var(--accent); color: var(--accent-fg); font-weight: 600; padding: 0 20px; margin-left: auto; }

/* ---------- static pages ---------- */

.page { padding: 28px 0 60px; }
.page h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 10px; }
.page p { color: var(--fg2); line-height: 1.6; max-width: 62ch; }
.empty-state { padding: 48px 0; color: var(--fg3); font-size: 15px; }

.detailpage { max-width: 720px; margin: 0 auto; padding: 0 28px 60px; }
.detailpage .hero { border-radius: 14px; border: 1px solid var(--line); margin-top: 16px; }
.backlink { display: inline-flex; align-items: center; gap: 8px; padding: 18px 0; font-size: 14px; }

.foot { border-top: 1px solid var(--line); margin-top: 34px; padding: 20px 0 0; font-size: 12.5px; color: var(--fg3); display: flex; flex-direction: column; gap: 14px; }
.fmeta { display: flex; gap: 16px; flex-wrap: wrap; }
.chlist { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.chlist a { color: var(--fg2); }
.chlist a:hover { color: var(--fg); }
.chlist [aria-current='page'] { color: var(--fg); font-weight: 500; }

/* ---------- channel page ---------- */

.chpage { max-width: 720px; }
.chhead { display: flex; align-items: center; gap: 14px; padding: 22px 0 6px; }
.chhead h1 { font-size: 25px; letter-spacing: -0.02em; }
.chhead .sub { font-size: 13.5px; color: var(--fg3); margin-top: 3px; }
.chlogo.big { width: 148px; height: 50px; padding: 7px 11px; border-radius: 9px; }
/* Unlike the list view's columns this shows the whole day, past programmes included —
   it is what a search engine indexes and what someone arriving cold expects to read. */
.chcol { border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); overflow: hidden; margin-top: 14px; }
.chcol .row:first-of-type { border-top: none; }
.chnav { display: flex; gap: 18px; flex-wrap: wrap; padding: 18px 0 4px; font-size: 13.5px; }

/* The logo is the click target, so the anchor must not add a box of its own. */
.chlink { display: inline-flex; border-radius: 7px; }
.chlink:hover { text-decoration: none; }
.chlink:hover .chlogo { box-shadow: inset 0 0 0 1px oklch(0.5 0.01 258 / 0.12), 0 0 0 2px var(--accent); }
[data-theme='dark'] .chlink:hover .chlogo { box-shadow: 0 0 0 2px var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

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

/* ---------- consent ---------- */

/* Pinned to the bottom rather than covering the page: the schedule stays readable
   while the choice is open, which is the point of asking rather than blocking. */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  max-width: 760px; margin: 0 auto; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--bg2);
  box-shadow: 0 6px 28px oklch(0.2 0.02 258 / 0.16);
}
.consent p { margin: 0; flex: 1; min-width: 220px; font-size: 13px; line-height: 1.45; color: var(--fg2); }
.consent p a { color: var(--accent); white-space: nowrap; }
.consent .cbtns { display: flex; gap: 8px; margin-left: auto; }
/* Both choices carry the same weight; a quiet decline button would be dark-patterned. */
.consent button {
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg); color: var(--fg); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.consent button:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 520px) {
  .consent .cbtns { width: 100%; margin-left: 0; }
  .consent button { flex: 1; }
}
