/* CouchElephant stylesheet. The theme tokens come first; everything after
   them reaches for var(). tests/test_conventions.py holds that line. */
/* ---------------------------------------------------------------------------
   Theme tokens. Every colour in this stylesheet comes from here, so a theme is
   a swap of this block and nothing else. Dark is the default and its values are
   sampled from the logo; light is a warm paper that echoes the cream in it
   rather than a flat white, which would fight the amber.
   --------------------------------------------------------------------------- */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg:#040c15; --bg-rgb:4,12,21;
  --panel:#0b1621; --panel2:#12202d; --line:#1d2c3a;
  --text:#f2ede6; --dim:#7a838c;
  --accent:#f3a30b;          /* brand fill: buttons, the now line, active tabs */
  --accent-ink:#f3a30b;      /* the same amber as text, adjusted per theme */
  --on-accent:#1a1a1a;       /* text drawn on top of an accent fill */
  --on-solid:#fff;           /* text on a saturated green or red chip */
  --accent-soft:rgba(243,163,11,.12);
  --accent-bd:rgba(243,163,11,.40);
  --accent-glow:rgba(243,163,11,.55);
  --accent-ring:rgba(243,163,11,.25);
  --hover:#1a2b3a; --hover-bd:#2c4257;
  --live:#5e7990; --live-dot:#8ba7bd; --live-soft:rgba(94,121,144,.14);
  --ok:#4caf50;  --ok-fg:#8fd694; --ok-soft:rgba(76,175,80,.15);  --ok-bd:rgba(76,175,80,.35);
  --bad:#e5484d; --bad-fg:#ff8b8e; --bad-soft:rgba(229,72,77,.15); --bad-bd:rgba(229,72,77,.35);
  --warn-fg:#f3a30b; --warn-soft:rgba(229,160,13,.15); --warn-bd:rgba(229,160,13,.35);
  --info-fg:#8ab8ff; --info-soft:rgba(61,139,253,.15); --info-bd:rgba(61,139,253,.35);
  /* Announced, not booked. Violet is the one hue the schedule does not already
     spend: amber is ours, blue-grey is Plex's, and warn is amber again. */
  --wait:#a07cd6; --wait-fg:#b79ae0; --wait-soft:rgba(160,124,214,.14);
  --wait-bd:rgba(160,124,214,.45);
  /* The plate a channel logo sits on. Broadcasters ship white-on-transparent
     artwork, so this stays dark in BOTH themes; tinting the image instead
     would ruin the logos that do carry their own colour. */
  --tile:rgba(255,255,255,.05);
  --scrim:rgba(2,6,11,.72);
  --shadow:0 6px 18px rgba(0,0,0,.45);
  --shadow-lg:0 20px 48px rgba(0,0,0,.55);
}
[data-theme="light"] {
  color-scheme: light;
  --bg:#f4f1ec; --bg-rgb:244,241,236;
  --panel:#fffdfa; --panel2:#eae6de; --line:#d7d1c6;
  --text:#16222e; --dim:#5c6773;
  --accent:#e0940a;
  --accent-ink:#96620a;       /* amber text needs to darken or it vanishes on paper */
  --on-accent:#1a1a1a;
  --on-solid:#fff;
  --accent-soft:rgba(224,148,10,.16);
  --accent-bd:rgba(176,116,8,.55);
  --accent-glow:rgba(176,116,8,.45);
  --accent-ring:rgba(176,116,8,.30);
  --hover:#e6e1d7; --hover-bd:#c2baac;
  --live:#4b6d86; --live-dot:#3d5b72; --live-soft:rgba(75,109,134,.16);
  --ok:#2e7d32;  --ok-fg:#1e6323; --ok-soft:rgba(46,125,50,.14);  --ok-bd:rgba(46,125,50,.40);
  --bad:#c62828; --bad-fg:#a81f1f; --bad-soft:rgba(198,40,40,.12); --bad-bd:rgba(198,40,40,.38);
  --warn-fg:#8a5a00; --warn-soft:rgba(224,148,10,.18); --warn-bd:rgba(176,116,8,.38);
  --info-fg:#17539f; --info-soft:rgba(23,83,159,.12); --info-bd:rgba(23,83,159,.35);
  --wait:#6a48a0; --wait-fg:#5b3f8c; --wait-soft:rgba(122,88,176,.13);
  --wait-bd:rgba(106,72,160,.45);
  --tile:#1e2b38;
  --scrim:rgba(20,30,40,.42);
  --shadow:0 6px 18px rgba(22,34,46,.14);
  --shadow-lg:0 20px 48px rgba(22,34,46,.20);
}
/* Artwork that only works on one ground. The wordmark is two-tone cream and
   slate; on paper the cream half disappears, so light mode gets its own file. */
[data-theme="dark"] .lightonly,
[data-theme="light"] .darkonly { display:none !important }

:root{--chw:92px;--rowh:62px;--pxmin:5}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);
  -webkit-text-size-adjust:100%;
  font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
a{color:inherit;text-decoration:none}

/* ---- header ---- */
/* The header and the tab bar travel together, so one sticky wrapper holds
   both. Sticking them separately needs the tab bar to know the header's
   height, which changes the moment the header wraps on a phone. */
.topbar{position:sticky;top:0;z-index:10;background:var(--panel);
  border-bottom:1px solid var(--line)}
header{display:flex;align-items:center;gap:22px;padding:0 22px;height:72px;
  background:var(--panel);border-bottom:1px solid var(--line)}
header .brand{display:flex;align-items:center;gap:11px;height:100%}
.brand-text{display:flex;flex-direction:column;align-items:flex-start;gap:3px}
/* Fills the bar edge to edge. The artwork is cropped to its own bounds, so
   height:100% leaves no gap above or below. */
header .mark{height:100%;width:auto;display:block;align-self:stretch}
header .wordmark{height:21px;width:auto;display:block}
.tagline{font-size:12px;color:var(--dim);line-height:1;letter-spacing:.2px}
/* ---- tab bar ----
   Same shape as Ludodex: borderless tabs that dim when inactive, an underline
   that slides between them, and a burst of sparks on arrival. Ported from the
   React component to plain markup, and themed to CouchElephant's own colours.
   Adapted from CodeFronts "Particle Burst" CSS tabs (MIT). See THIRD_PARTY.md. */
/* No overflow here. A scroll container clips both axes, and the sparks that
   fly downward out of the bar were being cut off at its edge. Two short tabs
   fit the narrowest phone, so there is nothing to scroll. */
.pt-nav{position:relative;display:flex;gap:0;background:var(--panel)}
/* Each tab takes an equal share of the full width, label centred, the way
   Ludodex fills its main tab bar. The underline then spans the whole tab. */
.pt-tab{flex:1 1 0;text-align:center}
.pt-tab{display:inline-block;color:var(--text);opacity:.62;
  font-size:15px;font-weight:600;letter-spacing:.02em;
  padding:12px 18px;cursor:pointer;position:relative;white-space:nowrap;
  transition:color .2s,opacity .2s,background .12s}
.pt-tab:hover{opacity:.95;background:var(--accent-soft)}
.pt-tab.active{color:var(--accent-ink);opacity:1}
.pt-tab:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;border-radius:4px}
/* Sits on the wrapper's bottom border, which is why it hangs 1px below. */
.pt-line{position:absolute;bottom:-1px;left:0;height:2px;width:0;
  background:var(--accent);border-radius:2px;pointer-events:none;z-index:1}
.pt-line.move{transition:left .4s cubic-bezier(.65,0,.35,1),
  width .4s cubic-bezier(.65,0,.35,1)}
.pt-spark{position:absolute;width:5px;height:5px;border-radius:50%;
  pointer-events:none;z-index:5;
  animation:pt-fly .6s cubic-bezier(.2,.6,.4,1) forwards}
@keyframes pt-fly{
  from{transform:translate(0,0) scale(1);opacity:1}
  to{transform:translate(var(--dx),var(--dy)) scale(.3);opacity:0}
}
@media (prefers-reduced-motion:reduce){
  .pt-line.move{transition:none}
  .pt-spark{animation:none;opacity:0}
}
header .right{margin-left:auto;display:flex;align-items:center;gap:6px;font-size:13px;color:var(--dim)}
/* The gear is a nav destination as well as a button, so it shows the same
   "you are here" state the text tabs do. */
.iconbtn.on{color:var(--accent-ink);background:var(--panel2)}
/* A sync in flight, so the icon is not a button that appears to do nothing. */
.iconbtn.spinning svg{animation:spin .9s linear infinite}

/* The account menu. One icon, and everything about the person behind it,
   dark mode included, because that is a preference of theirs rather than of
   the server. Shape follows the same author's ludodex. */
.profile-wrap{position:relative}
.profile{display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;flex:0 0 34px;background:var(--panel2);
  border:1px solid var(--line);border-radius:50%;color:var(--dim);cursor:pointer;
  padding:0;transition:border-color .1s,color .1s}
.profile:hover,.profile.open{border-color:var(--accent);color:var(--text)}
.profile-menu{display:none;position:absolute;top:calc(100% + 8px);right:0;
  min-width:196px;background:var(--panel);border:1px solid var(--line);
  border-radius:10px;padding:12px;box-shadow:var(--shadow-lg);z-index:40}
.profile-menu.open{display:block}
.pm-name{color:var(--text);font-weight:600;font-size:14px}
.pm-sub{color:var(--dim);font-size:12px;margin-top:2px}
.pm-divider{height:1px;background:var(--line);margin:10px -12px}
.pm-item{display:block;width:100%;text-align:left;background:none;border:none;
  color:var(--dim);font:inherit;font-size:13px;padding:6px 8px;margin:0 -8px;
  border-radius:6px;cursor:pointer}
.pm-item:hover{background:var(--accent-soft);color:var(--text)}
.pm-theme-label{display:inline-flex;align-items:center;gap:8px}
/* Both glyphs are drawn and the wrong one hidden, so switching does not
   flicker and costs no second request. */
[data-theme="dark"] .pm-theme .i-moon,
[data-theme="light"] .pm-theme .i-sun{display:none}

main{padding:22px;max-width:1400px;margin:0 auto}
/* The grid guide wants the whole width, and owns the only scrollbar on the
   page: the body must not scroll behind it or you get two. */
body.gridpage{overflow:hidden}
body.gridpage main{max-width:none;padding-bottom:0}
h1{font-size:20px;margin:0 0 4px}
.sub{color:var(--dim);font-size:13px;margin-bottom:18px}
.card{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:16px;margin-bottom:18px}
table{width:100%;border-collapse:collapse;font-size:14px}
th{text-align:left;color:var(--dim);font-weight:600;font-size:12px;text-transform:uppercase;
  letter-spacing:.5px;padding:8px 10px;border-bottom:1px solid var(--line)}
td{padding:9px 10px;border-bottom:1px solid var(--line);vertical-align:top}
tr:last-child td{border-bottom:none}
tr:hover td{background:var(--panel2)}
.pill{display:inline-block;padding:1px 8px;border-radius:10px;font-size:11px;font-weight:600;
  border:1px solid var(--line);color:var(--dim)}
.pill.live{background:var(--info-soft);border-color:var(--info-bd);color:var(--info-fg)}
.pill.ok{background:var(--ok-soft);border-color:var(--ok-bd);color:var(--ok-fg)}
.pill.warn{background:var(--warn-soft);border-color:var(--warn-bd);color:var(--warn-fg)}
.pill.bad{background:var(--bad-soft);border-color:var(--bad-bd);color:var(--bad-fg)}
.help.bad{color:var(--bad-fg)}
/* Whose feature, in the same two colours the guide and the record options use. */
.pill.ce{background:var(--accent-soft);border-color:var(--accent-bd);color:var(--accent-ink)}
.pill.plexsrc{background:var(--live-soft);border-color:var(--live);color:var(--live-dot)}
.dim{color:var(--dim)}
.chcell{white-space:nowrap;color:var(--dim);display:flex;align-items:center;gap:8px}
.chlogo{width:46px;height:26px;object-fit:contain;flex:0 0 46px;
  background:var(--tile);border-radius:4px;padding:2px}
.chtext{line-height:1.15;font-size:12px}

/* ---- grid guide ---- */
/* Height is set at runtime from the element's own position, because guessing
   it with a calc() breaks the moment anything above it wraps or changes. */
.gridwrap{overflow:auto;background:var(--panel);border:1px solid var(--line);
  border-radius:8px;position:relative;height:420px;
  -webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.gridinner{position:relative;width:max-content;min-width:100%}
.ghead{display:flex;position:sticky;top:0;z-index:3}
.gcorner{position:sticky;left:0;z-index:4;flex:0 0 var(--chw);width:var(--chw);
  height:34px;display:flex;align-items:center;padding:0 12px;background:var(--panel2);
  border-right:1px solid var(--line);border-bottom:1px solid var(--line);
  font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--dim)}
.gtimes{position:relative;height:34px;background:var(--panel2);
  border-bottom:1px solid var(--line)}
.gtick{position:absolute;top:0;height:34px;display:flex;align-items:center;
  padding-left:8px;font-size:12px;color:var(--dim);border-left:1px solid var(--line);
  white-space:nowrap}
.growr{display:flex;border-bottom:1px solid var(--line)}
.growr:last-child{border-bottom:none}
/* Logo only, the way Plex does it. The number and callsign appear on hover,
   and stay visible for the handful of channels with no logo. */
.gchcol{position:sticky;left:0;z-index:2;flex:0 0 var(--chw);width:var(--chw);display:flex}
.gch{position:relative;flex:1;min-width:0;
  display:flex;align-items:center;justify-content:center;padding:0 10px;
  background:var(--panel);border-right:1px solid var(--line);cursor:default}
.gch img{width:62px;height:38px;object-fit:contain;
  background:var(--tile);border-radius:4px;padding:3px}
.gch .n{font-size:12px;line-height:1.2;color:var(--dim);text-align:center}
.gch:not(.nologo) .n{position:absolute;left:calc(100% + 8px);top:50%;
  transform:translateY(-50%);white-space:nowrap;background:var(--panel2);
  border:1px solid var(--line);border-radius:6px;padding:5px 9px;z-index:6;
  opacity:0;pointer-events:none;transition:opacity .12s ease;
  box-shadow:var(--shadow)}
.gch:not(.nologo):hover .n{opacity:1}
.gch:not(.nologo):hover{background:var(--panel2)}
.glane{position:relative;height:var(--rowh)}
/* No overflow:hidden here. It would make the block its own scroll container,
   which stops the sticky label below from tracking the guide's scrollport. */
.gprog{position:absolute;top:4px;bottom:4px;padding:0;cursor:pointer;
  background:var(--panel2);border:1px solid var(--line);border-radius:5px;
  display:flex;flex-direction:column;justify-content:center}
.gprog:hover{background:var(--hover);border-color:var(--hover-bd)}
/* A long programme scrolls past the left edge, taking its title with it. This
   pins the label just clear of the channel column so it stays readable for as
   long as any part of the block is on screen. */
/* Nudged by script rather than position:sticky. Sticky fails on exactly the
   case that matters: when the title is wider than the block, fit-content
   clamps to max-width:100%, the label fills the block and has nowhere to
   slide. A transform has no such limit. */
.gpin{padding:6px 9px;width:100%;min-width:0;box-sizing:border-box;
  will-change:transform}
.gprog .t{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis}
.gprog .m{font-size:11px;color:var(--dim);white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis}
.gprog.live{border-color:var(--accent-bd)}
.gprog.drm{opacity:.5}
/* Who asked for the recording. Amber is CouchElephant's own colour, so its
   recordings wear it; Plex's own get its blue-grey. The dot repeats the
   distinction for anyone who cannot separate the two hues. */
.gprog.sched-ce{border-color:var(--accent);background:var(--accent-soft)}
.gprog.sched-plex{border-color:var(--live);background:var(--live-soft)}
.gprog .rec{display:inline-block;width:7px;height:7px;border-radius:50%;
  margin-right:5px;vertical-align:middle}
.gprog.sched-ce .rec{background:var(--accent)}
.gprog.sched-plex .rec{background:var(--live-dot)}
.legend{display:flex;gap:16px;align-items:center;margin:0 0 10px;font-size:12px;
  color:var(--dim);flex-wrap:wrap}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend i{width:9px;height:9px;border-radius:50%;display:inline-block}
.legend i.ce{background:var(--accent)}
.legend i.plex{background:var(--live-dot)}
.legend i.wait{background:var(--wait)}

/* ---- filter panel (same shape as Ludodex: searchable, sectioned, tri-state) ---- */
.fwrap{position:relative}
.fbtn{display:inline-flex;align-items:center;gap:7px}
.fbtn.on{border-color:var(--accent);color:var(--accent-ink);background:var(--accent-soft)}
.fmenu{position:absolute;top:calc(100% + 8px);left:0;z-index:40;width:440px;
  max-width:92vw;background:var(--panel);border:1px solid var(--line);
  border-radius:9px;box-shadow:var(--shadow-lg);display:none}
.fmenu.open{display:block}
.fhead{display:flex;align-items:center;justify-content:space-between;
  padding:12px 14px;border-bottom:1px solid var(--line);font-weight:600;font-size:14px}
.fclose{display:none}
.fclear{background:transparent;border:none;color:var(--accent-ink);cursor:pointer;
  font-size:12px;padding:2px 4px}
.fsearch{width:calc(100% - 24px);margin:12px}
.fapplied{padding:0 12px 10px;display:flex;flex-wrap:wrap;gap:6px}
.fchip{display:inline-flex;align-items:center;gap:6px;font-size:12px;padding:3px 8px;
  border-radius:12px;border:1px solid var(--line);background:var(--panel2);
  color:var(--text);cursor:pointer}
.fchip .tag{font-size:10px;text-transform:uppercase;letter-spacing:.4px;font-weight:700}
.fchip.incl .tag{color:var(--ok-fg)}
.fchip.excl .tag{color:var(--bad-fg)}
.fchip .xx{color:var(--dim)}
.fscroll{max-height:min(52vh,440px);overflow:auto;border-top:1px solid var(--line)}
.fgrid{display:grid;grid-template-columns:1fr 46px 46px;align-items:center}
.fgh{position:sticky;top:0;background:var(--panel2);font-size:10px;
  text-transform:uppercase;letter-spacing:.5px;color:var(--dim);padding:7px 10px;
  border-bottom:1px solid var(--line);z-index:1}
.fgh.c{text-align:center}
.fsec{grid-column:1/-1;display:flex;align-items:center;gap:8px;width:100%;
  background:var(--panel2);border:none;border-top:1px solid var(--line);
  color:var(--text);padding:8px 10px;font-size:12px;font-weight:600;cursor:pointer;
  text-align:left}
.fsec .chev{transition:transform .15s ease;color:var(--dim)}
.fsec .chev.open{transform:rotate(90deg)}
.fsec .n{margin-left:auto;color:var(--dim);font-weight:500;font-size:11px}
.frow-name{padding:6px 10px;font-size:13px;display:flex;align-items:center;gap:8px;
  min-width:0}
.frow-name img{width:26px;height:16px;object-fit:contain;flex:0 0 26px;
  background:var(--tile);border-radius:3px}
.frow-name span.t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.frow-name span.c{margin-left:auto;color:var(--dim);font-size:11px}
.fcell{display:flex;align-items:center;justify-content:center;padding:6px 0}
.fbox{width:16px;height:16px;border-radius:4px;border:1px solid var(--line);
  background:var(--panel2);cursor:pointer;display:block}
.fbox.on{background:var(--accent);border-color:var(--accent)}
.fbox.ex.on{background:var(--bad);border-color:var(--bad)}
.fempty{padding:22px;text-align:center;color:var(--dim);font-size:13px}

/* Loading state while another slice of guide is on its way. Sits over the edge
   being extended, so it reads as "more is coming here" rather than a page-wide
   spinner that hides what you were already reading. */
.gload{position:absolute;z-index:5;display:flex;align-items:center;
  justify-content:center;gap:9px;font-size:12px;letter-spacing:.4px;
  color:var(--dim);pointer-events:none;opacity:0;transition:opacity .15s ease}
.gload.on{opacity:1}
.gload.bottom{left:0;right:0;bottom:0;height:96px;
  background:linear-gradient(to bottom,rgba(var(--bg-rgb),0),rgba(var(--bg-rgb),.88) 55%)}
.gload.right{top:0;bottom:0;right:0;width:150px;flex-direction:column;
  background:linear-gradient(to right,rgba(var(--bg-rgb),0),rgba(var(--bg-rgb),.88) 55%)}
.spin{width:16px;height:16px;border-radius:50%;border:2px solid var(--accent-ring);
  border-top-color:var(--accent);animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation-duration:2s}}
.gnow{position:absolute;top:0;bottom:0;width:2px;background:var(--accent);z-index:1;
  pointer-events:none;box-shadow:0 0 6px var(--accent-glow)}
.gnow::before{content:'';position:absolute;top:0;left:-4px;width:10px;height:10px;
  border-radius:50%;background:var(--accent)}

/* ---- programme overlay ---- */
.ovl{position:fixed;inset:0;background:var(--scrim);z-index:50;display:none;
  align-items:center;justify-content:center;padding:24px}
.ovl.show{display:flex}
/* Down only. Nothing in the panel is meant to scroll sideways, and the box's
   own border rounds scrollWidth 2px past clientWidth, which is enough to put a
   scrollbar across the bottom of a panel that fits. */
.ovlbox{background:var(--panel);border:1px solid var(--line);border-radius:10px;
  width:min(720px,100%);max-height:min(86vh,860px);
  overflow-x:hidden;overflow-y:auto;box-shadow:var(--shadow-lg)}
.ovlhead{display:flex;gap:16px;padding:20px 22px 16px;border-bottom:1px solid var(--line)}
.ovlthumb{width:104px;height:150px;object-fit:cover;border-radius:6px;flex:0 0 104px;
  background:var(--panel2)}
.ovlmeta{min-width:0;flex:1}
.ovlmeta h2{margin:0 0 4px;font-size:20px;line-height:1.25}
.ovlmeta .parent{color:var(--dim);font-size:13px;margin-bottom:8px}
.ovlmeta .sum{font-size:13px;color:var(--dim);margin-top:10px;line-height:1.5}
.ovlclose{margin-left:auto;align-self:flex-start;background:transparent;border:none;
  color:var(--dim);font-size:22px;line-height:1;cursor:pointer;padding:0 2px}
.ovlclose:hover{color:var(--text)}
/* Facts about one thing, in the failure panel. Two columns so the labels line
   up and the eye can drop straight down the values. */
dl.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:0;font-size:13px}
dl.kv dt{color:var(--dim)}
dl.kv dd{margin:0}
/* The server's own words. Monospace and wrapped, because an error is read
   character by character and a truncated one is worse than none. */
.errbox{margin:0;padding:10px 12px;border-radius:6px;font-size:12px;line-height:1.5;
  background:var(--bad-soft);border:1px solid var(--bad-bd);color:var(--bad-fg);
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  white-space:pre-wrap;word-break:break-word;max-height:220px;overflow:auto}
.ovlsec{padding:16px 22px;border-bottom:1px solid var(--line)}
.ovlsec:last-child{border-bottom:none}
.ovlsec h3{margin:0 0 10px;font-size:11px;text-transform:uppercase;letter-spacing:.6px;
  color:var(--dim);font-weight:600}
/* The settings in force on a booking: a label column that stays put and a
   value column that reads down cleanly, so a wrong number is easy to spot. */
.setlist{display:grid;grid-template-columns:auto 1fr;gap:4px 18px;margin:0}
.setlist dt{color:var(--dim);font-size:13px}
.setlist dd{margin:0;font-size:13px}
@media (max-width:520px){.setlist{grid-template-columns:1fr;gap:0 0}
  .setlist dd{margin:0 0 8px}}

.air{display:flex;align-items:center;gap:12px;padding:9px 10px;border-radius:6px;
  border:1px solid transparent}
.air+.air{margin-top:4px}
.air.best{border-color:var(--accent-bd);background:var(--accent-soft)}
.air img{width:40px;height:24px;object-fit:contain;flex:0 0 40px;
  background:var(--tile);border-radius:3px;padding:2px}
.air .when{font-size:13px}
.air .ch{font-size:12px;color:var(--dim)}
.air .act{margin-left:auto}
.ovlfoot{padding:16px 22px;display:flex;gap:10px;flex-wrap:wrap;align-items:center}

/* ---- record options, rendered from Plex's own template ---- */
/* What to record: this broadcast, the whole series, or the team. */
.pickrow{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:6px;
  border:1px solid var(--line);cursor:pointer;background:var(--panel2)}
.pickrow+.pickrow{margin-top:6px}
.pickrow.on{border-color:var(--accent);background:var(--accent-soft)}
.pickrow input{margin:0;flex:0 0 auto;accent-color:var(--accent)}
.pickrow .note{margin-left:auto;text-align:right}
/* Two columns while they fit. Label left, control right, so the eye runs down
   the labels the way it does in Plex's own dialog. */
.optgrid{display:grid;grid-template-columns:1fr 1fr;gap:8px 18px}
.optrow{display:flex;align-items:center;gap:9px;font-size:13px;min-width:0}
.optlabel{color:var(--dim);min-width:0;flex:1 1 auto;display:flex;
  align-items:center;overflow:visible}
.optname{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
/* Every row the same height, so the grid reads as a grid rather than as a
   ragged column of whatever each label needed. */
.optrow{min-height:36px}
/* The control takes half the row and no more. Sized on its content it
   claimed whatever its longest option needed, and squeezed the label until
   "Detect commercials" read "Detect com...". The dropdown truncates its own
   text now, which is the one that can afford to. */
.optrow select,.optrow input[type=number],.optrow input[type=text]{
  flex:0 1 50%;max-width:50%;min-width:0;padding:5px 8px;font-size:13px}
.optrow select{text-overflow:ellipsis}
.optrow input[type=number]{width:82px}
.optrow input[type=checkbox]{width:17px;height:17px;accent-color:var(--accent);flex:0 0 auto}
/* Whose feature is this. Amber is CouchElephant throughout the app, and the
   blue-grey is the one the guide already uses for Plex's own recordings, so
   every page teaches the same colour. A small rectangle beside each option,
   rather than two separate lists the reader has to join back together. */
.own{display:inline-block;width:10px;height:14px;border-radius:2px;flex:0 0 10px}
.own.ce{background:var(--accent)}
.own.plex{background:var(--live-dot)}
/* ---- smart filter builder ----
   A tree of groups. Depth is shown by an indent and a rail down the left, so a
   nested group reads as belonging to the one above it without a box in a box
   in a box, which stops fitting on a phone at about two levels. */
.sfgroup{border:1px solid var(--line);border-radius:10px;background:var(--panel2);
  padding:10px;margin:8px 0}
.sfgroup .sfgroup{background:var(--panel);margin-left:12px;
  border-left:3px solid var(--accent-bd)}
.sfhead{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.sfhead .sfmatch{font-size:12px;color:var(--dim)}
.sfhead select{padding:3px 8px;font-size:12px}
.sfhead .sfdel{margin-left:auto}
.sfrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 0}
.sfrow select,.sfrow input{padding:5px 8px;font-size:13px;min-width:0}
.sfrow .sffield{flex:0 0 auto;min-width:120px}
.sfrow .sfcmp{flex:0 0 auto;min-width:120px}
.sfrow .sfval{flex:1 1 140px;min-width:110px}
.sfrow .sfblank{display:inline-flex;align-items:center;gap:5px;font-size:11px;
  color:var(--dim);white-space:nowrap}
.sfrow .sfx{flex:0 0 auto}
.sfacts{display:flex;gap:8px;margin-top:6px;flex-wrap:wrap}
.sfempty{font-size:12px;color:var(--dim);padding:4px 0}
/* The count, and the warning that comes with a loose filter. */
.sfcount{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px;
  padding:10px 12px;border:1px solid var(--line);border-radius:10px;
  background:var(--panel2);font-size:13px}
.sfcount b{font-size:16px}
.sfcount.warn{border-color:var(--warn-bd);background:var(--warn-soft);
  color:var(--warn-fg)}
.sfcount.bad{border-color:var(--bad-bd);background:var(--bad-soft);color:var(--bad-fg)}
.sfsample{margin-top:10px;max-height:210px;overflow:auto;border:1px solid var(--line);
  border-radius:10px}
.sfsample table{width:100%;border-collapse:collapse;font-size:12px}
.sfsample td{padding:6px 10px;border-bottom:1px solid var(--line)}
.sfsample tr:last-child td{border-bottom:0}
@media (max-width:640px){
  .sfrow .sffield,.sfrow .sfcmp,.sfrow .sfval{flex:1 1 100%}
  .sfgroup .sfgroup{margin-left:6px}
}
.ownkey{display:flex;gap:16px;align-items:center;font-size:11px;color:var(--dim);
  margin:0 0 12px;text-transform:uppercase;letter-spacing:.4px}
.ownkey span{display:inline-flex;align-items:center;gap:6px}
.ownkey .own{height:11px}

/* The verdict. Which system ends up owning this recording, said before the
   user presses the button rather than discovered afterwards. */
.optbar{padding:11px 22px;font-size:13px;line-height:1.45;
  border-bottom:1px solid var(--line);display:flex;gap:10px;align-items:flex-start}
.optbar .own{margin-top:2px;height:16px}
.optbar.plex{background:var(--live-soft);color:var(--text);
  box-shadow:inset 3px 0 0 var(--live)}
.optbar.ce{background:var(--accent-soft);color:var(--text);
  box-shadow:inset 3px 0 0 var(--accent)}

/* The collapsible option sections: Plex settings, Filter networks, Filter
   channels. Closed until opened, each with a short summary on its header. */
.optsecs{margin-top:10px;display:flex;flex-direction:column;gap:8px}
.optsec{border:1px solid var(--line);border-radius:8px;background:var(--panel2)}
.optsec>summary{display:flex;align-items:center;gap:10px;padding:9px 10px;
  cursor:pointer;list-style:none;font-size:13px;user-select:none}
.optsec>summary::-webkit-details-marker{display:none}
.optsec>summary svg{flex:0 0 auto;color:var(--dim);transition:transform .12s}
.optsec[open]>summary svg{transform:rotate(180deg)}
.optsec .secname{font-weight:600}
.optsec .secsum{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;color:var(--dim);font-size:12px}
.optsec .secsum.set{color:var(--accent-ink)}
.optsec.na>summary{opacity:.5;cursor:default}
.optsec[open]>summary{border-bottom:1px solid var(--line)}
.secbody{padding:10px 8px}
.secbody .optgrid{gap:8px 10px}
.secbody .note{margin-bottom:8px}
.multiq{width:100%;margin-bottom:6px;padding:6px 8px;font-size:13px}
.multibody{display:block;max-height:250px;overflow:auto}
.multirow{display:flex;align-items:center;gap:9px;padding:5px 6px;border-radius:5px;
  cursor:pointer;font-size:13px}
.multirow:hover{background:var(--panel)}
.multirow input{width:15px;height:15px;margin:0;flex:0 0 15px;accent-color:var(--accent)}
.multirow .mt{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.multirow .mn{margin-left:auto;padding-left:10px;color:var(--dim);font-size:11px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:45%}
.multinone{display:block;padding:16px;text-align:center;color:var(--dim);font-size:13px}
/* An explanation, on demand.
   Plex writes a long summary for each of its settings, and inline they were up
   to twenty lines each. The mark is small and the words arrive on hover or on
   keyboard focus, so a row stays one row. */
.opthelp{display:inline-flex;align-items:center;justify-content:center;
  width:15px;height:15px;margin-left:6px;border-radius:50%;flex:0 0 auto;
  border:1px solid var(--line);background:var(--panel2);color:var(--dim);
  font-size:10px;font-weight:700;cursor:help;vertical-align:middle}
.opthelp:hover,.opthelp:focus-visible{border-color:var(--accent-bd);
  color:var(--accent-ink);background:var(--accent-soft);outline:none}
/* The tooltip itself lives on the body, not on the mark. Every panel it could
   appear in scrolls, and a scrolling ancestor clips an absolutely positioned
   child; the text was being cut off at the panel edge. Fixed, on the body,
   positioned by ce.js and clamped to the window. */
.tipbox{position:fixed;z-index:200;max-width:min(320px,86vw);padding:9px 12px;
  border-radius:8px;border:1px solid var(--line);background:var(--panel);
  color:var(--text);box-shadow:var(--shadow-lg);font-size:12px;line-height:1.45;
  pointer-events:none;opacity:0;visibility:hidden;transition:opacity .12s;
  top:0;left:0}
.tipbox.on{opacity:1;visibility:visible}

/* ---- sub-tabs ----
   A second row under the main tabs, for the sections inside one page. Quieter
   than the main bar on purpose: it divides a page, it does not change page. */
.subtabs{display:flex;gap:4px;margin:0 0 16px;border-bottom:1px solid var(--line)}
.subtab{padding:8px 15px;background:none;border:none;border-bottom:2px solid transparent;
  color:var(--dim);font:inherit;font-size:14px;font-weight:600;cursor:pointer;
  margin-bottom:-1px;white-space:nowrap}
.subtab:hover{color:var(--text)}
.subtab.on{color:var(--accent-ink);border-bottom-color:var(--accent)}
.subtab .n{font-weight:400;font-size:12px;color:var(--dim);margin-left:6px}
/* A view switch inside a section: agenda or calendar. Segmented, because the
   two show the same thing and only one can be on. */
.viewsw{display:inline-flex;border:1px solid var(--line);border-radius:8px;
  overflow:hidden}
.viewsw button{background:var(--panel2);border:none;border-radius:0;color:var(--dim);
  font-size:13px;padding:6px 13px;cursor:pointer}
.viewsw button+button{border-left:1px solid var(--line)}
.viewsw button.on{background:var(--accent);color:var(--on-accent);font-weight:600}

/* ---- agenda ---- */
.agenda{display:flex;flex-direction:column}
.agday{position:sticky;top:0;z-index:1;background:var(--bg);padding:9px 2px 7px;
  font-size:12px;text-transform:uppercase;letter-spacing:.5px;color:var(--dim);
  border-bottom:1px solid var(--line)}
.agrow{display:flex;align-items:center;gap:12px;padding:10px 8px;cursor:pointer;
  border-bottom:1px solid var(--line);border-radius:6px}
.agrow:hover{background:var(--panel2)}
.agrow .agwhen{flex:0 0 92px;font-size:13px;color:var(--dim);white-space:nowrap}
.agrow img{width:44px;height:26px;flex:0 0 44px;object-fit:contain;padding:2px;
  border-radius:4px;background:var(--tile)}
.agrow .agtitle{min-width:0;display:flex;flex-direction:column;line-height:1.3}
.agrow .agtitle b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.agrow .agwhy{margin-left:auto;text-align:right;font-size:12px;color:var(--dim);
  display:flex;align-items:center;gap:8px;flex:0 0 auto}
.agend{padding:20px;text-align:center;color:var(--dim);font-size:13px}
/* A stand-in booking: the guide's generic name under the matchup, and the
   note that says why they differ. */
.agrow .agalias{display:flex;align-items:center;gap:6px;white-space:nowrap}
.infotip{position:relative;display:inline-flex;align-items:center;cursor:help;
  outline:none}
.infotip > i{display:inline-flex;align-items:center;justify-content:center;
  width:15px;height:15px;border-radius:50%;font:italic 600 10px/1 Georgia,serif;
  color:var(--info-fg);background:var(--info-soft);border:1px solid var(--info-bd)}
.infotip:focus-visible > i{box-shadow:0 0 0 2px var(--accent-ring)}
.infotip .tipbody{display:none;position:absolute;left:0;top:calc(100% + 6px);
  z-index:5;width:min(320px,80vw);padding:10px 12px;border-radius:8px;
  white-space:normal;font-size:12px;line-height:1.45;color:var(--text);
  background:var(--panel2);border:1px solid var(--line);
  box-shadow:0 6px 18px rgba(0,0,0,.35)}
.infotip:hover .tipbody,.infotip:focus .tipbody{display:block}
/* A booking Plex refused. Loud on purpose: this row is the only warning that
   something you asked for will not record, and it used to be no row at all.
   The bar and the word both say it, so colour alone never carries it. */
.agrow.fail{background:var(--bad-soft);border-left:4px solid var(--bad);
  border-bottom-color:var(--bad-bd)}
.agrow.fail:hover{background:var(--bad-soft);filter:brightness(1.08)}
.agrow.fail .agtitle b{color:var(--bad-fg)}
.agrow.fail .agerr{display:block;font-size:11px;color:var(--bad-fg);opacity:.9;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---- calendar ---- */
.calhead{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.calhead .m{font-size:15px;font-weight:600;min-width:170px}
.calgrid{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;
  background:var(--line);border:1px solid var(--line);border-radius:8px;overflow:hidden}
.caldow{background:var(--panel2);padding:7px 8px;font-size:11px;text-transform:uppercase;
  letter-spacing:.5px;color:var(--dim);text-align:center}
.calday{background:var(--panel);min-height:106px;padding:6px 7px;font-size:12px;
  display:flex;flex-direction:column;gap:3px}
.calday.out{background:var(--bg);opacity:.55}
.calday.today .cald{color:var(--accent-ink);font-weight:700}
.cald{font-size:12px;color:var(--dim);margin-bottom:2px}
.calitem{display:flex;align-items:center;gap:5px;font-size:11px;line-height:1.25;
  padding:3px 5px;border-radius:4px;cursor:pointer;background:var(--panel2);
  border-left:3px solid var(--live)}
.calitem.ce{border-left-color:var(--accent);background:var(--accent-soft)}
/* Announced, not booked. DASHED carries the meaning, colour only reinforces it:
   the plan card already says "a plan is dashed", and a colour-blind reader gets
   the same answer from the border style alone. Default cursor because there is
   no programme to open yet, which is what waiting means. */
.calitem.wait{border-left:3px dashed var(--wait);background:var(--wait-soft);
  color:var(--wait-fg);cursor:default}
.calitem.wait:hover{background:var(--wait-soft)}
/* Same failure, same weight, in the month view. A solid red bar against the
   dashed amber of "waiting": one is a plan, the other is a fault. */
.calitem.fail{border-left:3px solid var(--bad);background:var(--bad-soft);
  color:var(--bad-fg);font-weight:600}
.calitem.fail:hover{background:var(--bad-soft);filter:brightness(1.08)}
.calitem:hover{background:var(--hover)}
.calitem span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.calmore{font-size:11px;color:var(--dim);padding-left:5px}
/* The band under the grid, for expectations that name a month or a year but no
   day. They cannot go in a cell without inventing a broadcast date, and they
   must not vanish, so they sit below the month they belong to. */
.calwait{margin-top:12px;padding:10px 12px;border:1px dashed var(--wait-bd);
  border-radius:8px;background:var(--wait-soft)}
.calwait h3{margin:0 0 2px;font-size:13px;color:var(--wait-fg);font-weight:600}
.calwait .sub{margin:0 0 8px}
.calwaitrow{display:flex;align-items:baseline;gap:8px;font-size:12px;padding:2px 0}
.calwaitrow b{font-weight:600}
.calwaitrow .cwwhen{color:var(--dim);font-size:11px;white-space:nowrap}

/* ---- passes ---- */
.passrow{display:flex;align-items:center;gap:12px;padding:12px;cursor:pointer;
  border:1px solid var(--line);border-radius:9px;margin-bottom:8px;
  background:var(--panel)}
.passrow:hover{border-color:var(--accent-bd)}
.passrow.open{border-color:var(--accent)}
.passrow .pmeta{min-width:0;display:flex;flex-direction:column;line-height:1.3}
.passrow .pmeta b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.passrow .pacts{margin-left:auto;display:flex;gap:6px;flex:0 0 auto}
.passdetail{border:1px solid var(--line);border-top:none;border-radius:0 0 9px 9px;
  margin:-9px 0 8px;padding:14px;background:var(--panel2)}
.passdetail table{font-size:13px}
@media (max-width:700px){
  .agrow{flex-wrap:wrap}
  .agrow .agwhy{margin-left:0;flex:0 0 100%;justify-content:flex-start;text-align:left}
  .calday{min-height:74px}
  .calitem span{display:none}
  .subtabs{overflow-x:auto;scrollbar-width:none}
  .subtabs::-webkit-scrollbar{display:none}
}

/* Page heading with an action beside it. The plus is the only way to start a
   schedule from here, so it sits with the title rather than buried in a card. */
.pagehead{display:flex;align-items:flex-start;justify-content:space-between;
  gap:16px;margin-bottom:18px}
.addbtn{display:inline-flex;align-items:center;justify-content:center;
  width:38px;height:38px;flex:0 0 38px;border-radius:9px;cursor:pointer;
  background:var(--accent);color:var(--on-accent);border:1px solid var(--accent);
  padding:0;line-height:0}
.addbtn:hover{filter:brightness(1.08)}

/* Picking what a new schedule follows. */
.rpicked{font-size:13px;color:var(--dim);margin-bottom:9px}
.rpicked b{color:var(--dim)}
.rpicked b.set{color:var(--accent-ink)}
.rq{width:100%;margin-bottom:8px}
.rlist{max-height:230px;overflow:auto;border:1px solid var(--line);border-radius:7px;
  background:var(--panel2)}
/* The catalogue is 1,310 teams, so the list needs room and a way to narrow it
   before scrolling is the only tool. */
.rlist.tall{max-height:320px}
.rleagues{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
.rleagues button{padding:3px 10px;font-size:12px;border-radius:20px}
.rleagues button.on{background:var(--accent);color:var(--on-accent);
  border-color:var(--accent);font-weight:600}
.rcount{font-size:11px;color:var(--dim);margin:6px 0 0}
/* A team the guide is not carrying yet. Following it is allowed; it just has
   nothing to book until the season starts. */
.rrow .rlg{margin-left:auto;color:var(--dim);font-size:11px;white-space:nowrap;
  padding-left:10px}
.rrow .rsoon{color:var(--dim);font-size:11px;white-space:nowrap;
  border:1px solid var(--line);border-radius:20px;padding:1px 7px}
.rrow .rnow{color:var(--accent-ink);background:var(--accent-soft);
  border:1px solid var(--accent-bd);border-radius:20px;padding:1px 7px;
  font-size:11px;white-space:nowrap}
.rrow{display:flex;align-items:center;gap:10px;width:100%;text-align:left;
  background:none;border:none;border-bottom:1px solid var(--line);color:var(--text);
  font:inherit;font-size:13px;padding:8px 10px;cursor:pointer}
.rrow:last-child{border-bottom:none}
.rrow:hover{background:var(--hover)}
.rrow.on{background:var(--accent-soft);color:var(--accent-ink);font-weight:600}
.rrow .rt{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rrow .rn{margin-left:auto;color:var(--dim);font-size:11px;white-space:nowrap;
  padding-left:10px}
/* The source limit gets the full width. Its label carries a second line of
   explanation, and in a half-width cell that line was clipped. */
.optrow.wide{grid-column:1/-1}
.optrow.wide .optname{white-space:normal;overflow:visible}
/* Allowed to shrink. Fixed at 320 it pushed the panel 2px wider than its own
   box, which is all it takes to put a scrollbar across the bottom. */
.optgrid>*{min-width:0}

@media (max-width:700px){
  .optgrid{grid-template-columns:1fr}
  .pickrow .note{display:none}
  .optbar{padding:11px 16px}
  .multibody{max-height:210px}
}
/* The result of pressing Record. It used to be dim grey at the bottom of a
   scrollable panel, which is indistinguishable from nothing happening. */
.ovlfoot .note.said{color:var(--text)}
.ovlfoot .note.said.bad{color:var(--bad-fg)}
.ovlfoot .note.said.ok{color:var(--ok-fg)}
.note{font-size:12px;color:var(--dim)}
/* Preview mode blocks every write to Plex. Say so at the top, where the
   Record buttons are, instead of leaving the user to press a dead button. */
.ovlnote{margin:0;border-radius:0;border-left:none;border-right:none;border-top:none}
.ovlnote .row{margin-top:8px}

.tiny{font-size:12px}
/* What made this schedule: a followed team, or an ordinary programme. Colour
   carries the same split as the guide, so the two pages agree. */
.kind{display:inline-flex;align-items:center;justify-content:center;
  width:24px;height:24px;border-radius:6px;border:1px solid var(--line);
  background:var(--panel2)}
.kind.sports{color:var(--accent-ink);border-color:var(--accent-bd);
  background:var(--accent-soft)}
.kind.series{color:var(--dim)}
.kind.smart{color:var(--accent-ink);border-color:var(--accent-bd);
  background:var(--accent-soft)}
tr.off td{opacity:.55}
button.tiny{padding:3px 9px;font-size:12px}
details.card>summary{list-style:none}
details.card>summary::-webkit-details-marker{display:none}
details.card>summary::before{content:'\25B8 ';color:var(--dim)}
details.card[open]>summary::before{content:'\25BE '}
input,select,button{font:inherit;background:var(--panel2);color:var(--text);
  border:1px solid var(--line);border-radius:6px;padding:7px 10px}
input:focus,select:focus{outline:1px solid var(--accent)}
button{cursor:pointer}
button:disabled{opacity:.55;cursor:default}
button.primary{background:var(--accent);color:var(--on-accent);border-color:var(--accent);font-weight:600}
button.danger{background:transparent;color:var(--bad-fg);border-color:var(--bad-bd)}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:16px;max-width:520px}
.field label{font-size:12px;text-transform:uppercase;letter-spacing:.5px;color:var(--dim)}
.field .help{font-size:12px;color:var(--dim)}
.daybar,.tabbar{display:flex;gap:6px;overflow-x:auto;padding-bottom:10px;margin-bottom:14px;
  -webkit-overflow-scrolling:touch}
.daybar a,.tabbar a{padding:6px 12px;border-radius:6px;background:var(--panel2);border:1px solid var(--line);
  font-size:13px;white-space:nowrap;color:var(--dim)}
.daybar a.on,.tabbar a.on{background:var(--accent);color:var(--on-accent);border-color:var(--accent);font-weight:600}
.tabbar{margin-bottom:10px}
.recrow.hit{outline:2px solid var(--accent);border-radius:6px}
.recheading{margin:22px 0 8px;font-size:16px}
.gstar{position:absolute;top:0;left:0;z-index:3;border:none;background:transparent;
  color:var(--dim);font-size:18px;line-height:1;width:28px;height:28px;padding:0;
  cursor:pointer;opacity:.6}
.gstar:hover,.gstar:focus-visible,.gstar.on{opacity:1}
.gstar.on{color:var(--accent)}
.banner{padding:10px 14px;border-radius:6px;margin-bottom:16px;font-size:14px}
.banner.warn{background:var(--warn-soft);border:1px solid var(--warn-bd);color:var(--warn-fg)}
.banner.bad{background:var(--bad-soft);border:1px solid var(--bad-bd);color:var(--bad-fg)}
.banner.ok{background:var(--ok-soft);border:1px solid var(--ok-bd);color:var(--ok-fg)}
.banner a{text-decoration:underline}
.empty{padding:28px;text-align:center;color:var(--dim)}
.filterbar{margin-bottom:14px}
/* Collapsed, this is a square button. The input must give up its padding and
   the flex gap as well as its width, or the box stays wide and the icon looks
   pushed to the left inside it. */
.searchbox{display:flex;align-items:center;gap:0;background:var(--panel);
  border:1px solid var(--line);border-radius:8px;padding:3px;
  transition:padding .18s ease}
.searchbox.open{gap:6px;padding:3px 8px 3px 3px}
.searchbox input{border:none;background:transparent;width:0;padding:0;opacity:0;
  transition:width .18s ease,opacity .18s ease,padding .18s ease}
.searchbox.open input{width:290px;padding:5px 4px;opacity:1}
.searchbox input:focus{outline:none}
.iconbtn{display:inline-flex;align-items:center;justify-content:center;
  width:32px;height:32px;flex:0 0 32px;border-radius:6px;background:transparent;
  border:none;padding:0;color:var(--dim);cursor:pointer;line-height:0}
.iconbtn:hover{color:var(--text);background:var(--panel2)}
.iconbtn svg{display:block}
/* The sign-in screen. Nothing else on the page, so it centres in what is
   left below the header. */
body.signin main{max-width:none;display:flex;justify-content:center;
  align-items:flex-start;padding-top:8vh}
/* The setup screen already says there is no server; the page banner saying it
   again lands beside the card rather than in it. */
body.signin>main>.banner{display:none}
body.signin .pt-nav{display:none}
.signin-card{width:min(400px,100%);text-align:left}
.signin-mark{height:74px;width:auto;display:block;margin:0 auto 10px}
.signin-card h1{text-align:center}
.signin-card .sub{text-align:center}
.signin-card .field{max-width:none}
.signin-card button.primary{width:100%;padding:10px}

/* ---- settings window ----
   Sections down the left, sub-tabs across the top of each, content scrolling
   on the right. Shape taken from the same author's ludodex. The gear opens it
   over whatever page you were on; /settings renders the same file whole. */
.settings-window{position:relative;display:flex;width:100%;max-width:940px;
  height:80vh;max-height:700px;background:var(--panel);border:1px solid var(--line);
  border-radius:12px;overflow:hidden}
.settings-nav{flex:0 0 202px;background:var(--bg);border-right:1px solid var(--line);
  padding:16px 10px;display:flex;flex-direction:column;gap:4px;overflow:auto}
.settings-title{font-size:12px;text-transform:uppercase;letter-spacing:.6px;
  color:var(--dim);padding:4px 10px 10px}
.settings-search{width:100%;margin:2px 0 8px;padding:8px 10px;font-size:13px}
.nav-item{display:flex;align-items:center;gap:9px;width:100%;text-align:left;
  padding:9px 11px;background:none;border:none;border-radius:8px;color:var(--text);
  font:inherit;font-size:14px;cursor:pointer}
.nav-item:hover{background:var(--panel2)}
.nav-item.sel{background:var(--accent-soft);color:var(--accent-ink);font-weight:600}
.nav-item .hits{margin-left:auto;font-size:11px;color:var(--dim);font-weight:400}
.nav-none{padding:10px;font-size:13px;color:var(--dim)}
.settings-main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0}
.settings-tabs{display:flex;gap:4px;padding:14px 24px 0;
  border-bottom:1px solid var(--line);flex:0 0 auto}
.settings-tabs:empty{display:none}
.settings-tabs .tab{padding:8px 14px;background:none;border:none;
  border-bottom:2px solid transparent;color:var(--dim);font:inherit;font-size:14px;
  cursor:pointer;margin-bottom:-1px;white-space:nowrap}
.settings-tabs .tab:hover{color:var(--text)}
.settings-tabs .tab.sel{color:var(--accent-ink);border-bottom-color:var(--accent)}
.settings-content{padding:18px 24px 24px;overflow-y:auto;overscroll-behavior:contain;
  flex:1 1 auto;min-height:0;-webkit-overflow-scrolling:touch}
.settings-content h2{margin:0 0 6px;font-size:19px}
.settings-content h3{margin:0 0 5px;font-size:14px}
.settings-content p.dim{color:var(--dim);font-size:13px;margin:0 0 18px}
.settings-content .field{max-width:none}
.setblock{border-top:1px solid var(--line);margin-top:22px;padding-top:18px}
.connect-img{display:block;background:white;padding:8px;border-radius:6px}
.setclose{position:absolute;top:10px;right:12px;background:transparent;border:none;
  color:var(--dim);font-size:24px;line-height:1;cursor:pointer;padding:0 4px;z-index:2}
.setclose:hover{color:var(--text)}
/* The result of a check, said plainly. A tick or a cross carries the answer,
   and the sentence beside it carries the reason, which is the half that tells
   you what to do next. */
/* display:flex beats the hidden attribute, so an empty box was drawn before
   anything had been checked. */
/* A checkbox with its label beside it, used all over the backup panels. */
.chk{display:flex;align-items:center;gap:8px;margin:8px 0;font-size:13px}
.chk input[type=checkbox]{flex:0 0 auto;width:auto}
.bkjob{margin-bottom:14px}
.verdict[hidden]{display:none}
.verdict{display:flex;align-items:flex-start;gap:10px;margin-top:12px;
  padding:11px 13px;border-radius:8px;font-size:13px;line-height:1.45;
  border:1px solid var(--line);background:var(--panel2)}
.verdict.ok{border-color:var(--ok-bd);background:var(--ok-soft)}
.verdict.bad{border-color:var(--bad-bd);background:var(--bad-soft)}
.vmark{flex:0 0 20px;width:20px;height:20px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:13px;font-weight:700;line-height:1;margin-top:1px}
.verdict.ok .vmark{background:var(--ok);color:var(--on-solid)}
.verdict.ok .vmark::before{content:"\2713"}
.verdict.bad .vmark{background:var(--bad);color:var(--on-solid)}
.verdict.bad .vmark::before{content:"\2715"}
.verdict.busy .vmark{background:var(--panel);border:2px solid var(--accent-ring);
  border-top-color:var(--accent);animation:spin .7s linear infinite}
.verdict .vtext{min-width:0}

/* Channel artwork. One row per channel, its logo shown on the plate it will
   actually appear on, so a white logo is judged against the right ground. */
.chlist{border:1px solid var(--line);border-radius:8px;max-height:46vh;overflow:auto}
.chrow{display:flex;align-items:center;gap:12px;padding:9px 12px;
  border-bottom:1px solid var(--line);font-size:13px}
.chrow:last-child{border-bottom:none}
.chrow[hidden]{display:none}
.chart{width:54px;height:32px;flex:0 0 54px;object-fit:contain;padding:3px;
  border-radius:4px;background:var(--tile)}
.chmeta{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.chmeta b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chsrc{margin-left:auto;flex:0 0 auto}
.chacts{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.chup{cursor:pointer}
.btnlike{display:inline-block;padding:3px 9px;font-size:12px;border-radius:6px;
  border:1px solid var(--line);background:var(--panel2);color:var(--text)}
.chup:hover .btnlike{border-color:var(--accent);color:var(--accent-ink)}
.chsay{flex:0 0 100%;font-size:12px;color:var(--dim);padding-left:66px}
.chsay.bad{color:var(--bad-fg)}
.chsay.ok{color:var(--ok-fg)}
.chsay:empty{display:none}
.chrow{flex-wrap:wrap}
.lgrow .lgsel{margin-left:auto;max-width:60%}
.lgrow .chsay{padding-left:0}
@media (max-width:700px){
  .chsrc{order:5}
  .chsay{padding-left:0}
}

.saved{font-size:12px;color:var(--ok-fg);opacity:0;transition:opacity .15s ease}
.saved.on{opacity:1}
.saved.bad{color:var(--bad-fg)}
/* A hit from the search, so a match is visible without hunting the panel. */
.sethit{outline:2px solid var(--accent);outline-offset:6px;border-radius:4px}

/* On its own page the window fills what is left below the tabs. */
body.setpage main{max-width:none;padding:18px;display:flex;justify-content:center}
body.setpage .settings-window{height:calc(100vh - 190px);max-height:none}
/* In the overlay it is the whole dialog, so the usual panel chrome is dropped. */
.ovl.settings .ovlbox{background:transparent;border:none;box-shadow:none;
  width:min(940px,100%);max-height:none;overflow:visible}

@media (max-width:860px){
  .settings-window{flex-direction:column;height:auto;max-height:none}
  /* One scrolling row, not a wrapped block. Without nowrap the search box
     takes the first line and pushes every section under it. */
  .settings-nav{flex:0 0 auto;flex-direction:row;flex-wrap:nowrap;align-items:center;
    overflow-x:auto;gap:6px;padding:10px;border-right:none;
    border-bottom:1px solid var(--line);scrollbar-width:none}
  .settings-nav>#setnav{display:flex;gap:6px;flex:0 0 auto}
  .settings-nav::-webkit-scrollbar{display:none}
  .settings-title{display:none}
  .settings-search{flex:0 0 190px;width:190px;margin:0}
  .nav-item{flex:0 0 auto;white-space:nowrap;padding:9px 13px}
  .settings-tabs{overflow-x:auto;padding:12px 16px 0;scrollbar-width:none}
  .settings-tabs::-webkit-scrollbar{display:none}
  .settings-content{padding:16px 16px 24px}
  body.setpage main{padding:0}
  body.setpage .settings-window{height:auto;border-radius:0;border-left:none;
    border-right:none}
  .ovl.settings{padding:0;align-items:stretch}
  .ovl.settings .ovlbox{border-radius:0;height:100%}
  .settings-window{border-radius:0}
}

footer{margin:38px 0 14px;text-align:center;font-size:12px;letter-spacing:1.6px;
  text-transform:uppercase;color:var(--dim);opacity:.7}
footer .divider{height:5px;width:auto;display:block;margin:0 auto 12px}

/* ---------------------------------------------------------------------------
   Phones and small tablets. The header wraps to two lines rather than crushing
   the nav, the grid gives up pixels per minute so a useful span of time fits
   across a narrow screen, and every popover becomes a bottom sheet, which is
   where a thumb already is.
   --------------------------------------------------------------------------- */
@media (max-width:860px){
  header{height:auto;padding:0 12px;gap:10px;flex-wrap:wrap;row-gap:0}
  header .brand{height:56px}
  header .mark{height:46px;align-self:center}
  header .wordmark{height:18px}
  .tagline{font-size:11px}
  header .right{gap:4px;height:52px}
  .pt-tab{font-size:14px;padding:10px 8px}
  /* A scrollbar under the day strip is noise on a touch screen, where the
     strip is dragged rather than scrolled by a bar. */
  .daybar,.tabbar{scrollbar-width:none}
  .daybar::-webkit-scrollbar,.tabbar::-webkit-scrollbar{display:none}
  main{padding:14px}
  h1{font-size:18px}
  .sub{margin-bottom:14px}
  .card{padding:12px;overflow-x:auto}
  th,td{padding:7px 8px}
}
@media (max-width:700px){
  :root{--chw:66px;--rowh:56px;--pxmin:3.2}
  /* Below this the wordmark and the controls cannot share a line, and the
     controls are the half you can press. The mark alone still says whose app
     this is. */
  header .wordmark,.tagline{display:none}
  header .brand{height:48px}
  header .mark{height:40px}
  header .right{height:48px}
  .legend{font-size:11px;gap:9px}
  .gch img{width:46px;height:30px;padding:2px}
  .gprog .t{font-size:12px}
  .gprog .m{display:none}          /* no room for a second line at this height */
  .gpin{padding:5px 7px}
  .gtick{font-size:11px;padding-left:6px}
  /* Hover has no meaning on a touch screen, so the channel number rides along
     under the logo instead of waiting for a pointer that never arrives. */
  .gch{flex-direction:column;justify-content:center;gap:2px;padding:0 4px}
  .gch:not(.nologo) .n{position:static;transform:none;opacity:1;background:none;
    border:none;padding:0;font-size:10px;box-shadow:none}
  .gload.right{width:96px}

  /* Full-height sheet. A centred dialog on a phone leaves useless margins and
     puts the action buttons under the browser chrome. */
  .ovl{padding:0;align-items:flex-end}
  .ovlbox{width:100%;max-height:92vh;border-radius:14px 14px 0 0;border-bottom:none}
  .ovlhead{padding:16px 16px 14px;gap:12px}
  .ovlthumb{width:74px;height:106px;flex:0 0 74px}
  .ovlmeta h2{font-size:17px}
  .ovlsec,.ovlfoot{padding:14px 16px}
  .air{flex-wrap:wrap;gap:8px}
  .air .act{margin-left:auto}
  .air .act button{padding:8px 14px}

  /* The filter panel becomes a sheet too, anchored to the viewport rather than
     to a button that may itself be scrolled off. */
  .fmenu{position:fixed;left:0;right:0;bottom:0;top:auto;width:auto;max-width:none;
    border-radius:14px 14px 0 0;border-bottom:none;box-shadow:var(--shadow-lg)}
  .fmenu.open{display:flex;flex-direction:column;max-height:86vh}
  .fscroll{max-height:none;flex:1}
  .fclose{display:inline-flex;background:transparent;border:none;color:var(--dim);
    font-size:22px;line-height:1;padding:0 4px;cursor:pointer}
  .fhead{padding:14px}
  .fgrid{grid-template-columns:1fr 52px 52px}
  .fcell{padding:9px 0}
  .fbox{width:20px;height:20px}

  /* A six column table in 390px is unreadable, and scrolling each card
     sideways to find a title is worse. Each row becomes a block instead: the
     icon holds a left rail, everything else stacks down the right of it. */
  table.stack,table.stack tbody{display:block}
  table.stack tr:first-child{display:none}      /* the header row */
  table.stack tr{display:grid;grid-template-columns:26px 1fr;gap:3px 10px;
    padding:11px 2px;border-bottom:1px solid var(--line);align-items:start}
  table.stack tr:last-child{border-bottom:none}
  table.stack td{display:block;padding:0;border:none;white-space:normal !important;
    grid-column:2}
  /* Row 1 of the left rail. Spanning a fixed count instead reserved that many
     grid rows and left a block of dead space under every row. */
  table.stack td:first-child{grid-column:1;grid-row:1}
  table.stack td:empty{display:none}
  table.stack tr:hover td{background:none}
  table.stack td[style*="text-align:right"]{text-align:left !important}
  /* Label and value pairs (About, Last sync): label above value, nothing
     squeezed into the icon rail, and the first row is data, not a header. */
  table.kv tr:first-child{display:grid}
  table.kv tr{grid-template-columns:1fr}
  table.kv td:first-child,table.kv td{grid-column:1;grid-row:auto}

  .searchbox{flex:1;min-width:0}
  .searchbox.open{flex:1}
  .searchbox.open input{width:100%;min-width:0}
  .filterbar{flex-wrap:nowrap}
  .field{max-width:none}
  /* On the grid page every line above the guide is a line stolen from it. The
     page heading only repeats the nav tab that is already highlighted. */
  body.gridpage main{padding:10px}
  body.gridpage h1{display:none}
  body.gridpage .sub{font-size:12px;margin-bottom:9px}
  body.gridpage .daybar,body.gridpage .tabbar{padding-bottom:7px;margin-bottom:9px}
  body.gridpage .legend{font-size:11px;gap:10px;margin-bottom:8px}
  footer{margin:26px 0 10px}
}
/* A phone held sideways has plenty of width and almost no height. Everything
   above the guide has to give way, or the grid is squeezed into a strip that
   cannot scroll because the grid page deliberately locks the body. */
@media (max-width:1000px) and (max-height:560px){
  body.gridpage h1,
  body.gridpage .sub,
  body.gridpage .legend{display:none}
  body.gridpage main{padding:8px}
  body.gridpage .daybar,body.gridpage .tabbar{margin-bottom:8px;padding-bottom:5px}
  body.gridpage .filterbar{margin-bottom:8px}
  body.gridpage .topbar{position:static}
  body.gridpage .pt-tab{padding:8px 14px;font-size:13px}
}

/* Comfortable touch targets, only where the pointer is actually coarse. */
@media (pointer:coarse){
  button,.iconbtn,.daybar a,.tabbar a{min-height:38px}
  .iconbtn{width:38px;height:38px;flex:0 0 38px}
  .profile{width:38px;height:38px;flex:0 0 38px}
}

/* ---- Health notices -------------------------------------------------------
   A problem with Plex badges the sync button rather than adding a fourth icon
   to the bar. A stale guide is a sync problem, and it belongs on the control
   you would reach for anyway.

   The badge sits over the button's top-right corner and is its own control:
   reading what is wrong must not start a sync. */
.sync-wrap{position:relative;display:inline-flex}
.sync-badge{position:absolute;top:-2px;right:-3px;width:15px;height:15px;
  display:inline-flex;align-items:center;justify-content:center;padding:0;
  border-radius:50%;border:2px solid var(--bg);cursor:pointer;
  font:700 10px/1 system-ui,sans-serif;color:var(--on-solid);background:var(--bad);z-index:2}
.sync-badge.warn{background:var(--warn-fg)}
/* One slow pulse. Enough to catch the eye on a page you were already reading,
   not enough to be a thing you want to make stop. */
@media (prefers-reduced-motion:no-preference){
  .sync-wrap.has-notices .sync-badge{animation:noticepulse 2.4s ease-in-out infinite}
}
@keyframes noticepulse{
  0%,100%{box-shadow:0 0 0 0 var(--bad-soft)}
  50%{box-shadow:0 0 0 5px transparent}
}
.notice-menu{display:none;position:absolute;top:calc(100% + 10px);right:-8px;
  width:330px;max-width:calc(100vw - 24px);background:var(--panel);
  border:1px solid var(--line);border-radius:10px;padding:12px;
  box-shadow:var(--shadow-lg);z-index:40}
.notice-menu.open{display:block}
.nm-head{color:var(--text);font-weight:600;font-size:14px;margin-bottom:10px}
.nm-item{border-left:2px solid var(--bad-bd);padding:0 0 0 10px;margin:10px 0}
.nm-item.warn{border-left-color:var(--warn-bd)}
.nm-title{color:var(--bad-fg);font-weight:600;font-size:13px}
.nm-item.warn .nm-title{color:var(--warn-fg)}
.nm-detail{color:var(--text);font-size:12.5px;line-height:1.45;margin-top:3px;white-space:pre-line}
.nm-hint{color:var(--dim);font-size:12px;line-height:1.45;margin-top:5px}
.nm-since{color:var(--dim);font-size:11px;margin-top:5px}
/* A suggestion. It borrows the warn colours because it is yellow to the eye,
   but it is a different class of thing and only it can be dismissed. */
.nm-item.tip{border-left-color:var(--warn-bd)}
.nm-item.tip .nm-title{color:var(--warn-fg)}
.sync-badge.tip{background:var(--warn-fg)}
/* Quiet on purpose: waving off a suggestion is not what the panel is for. */
.nm-dismiss{margin-top:6px;font:inherit;font-size:11px;padding:3px 8px;
  border-radius:6px;border:1px solid var(--line);background:none;
  color:var(--dim);cursor:pointer}
.nm-dismiss:hover{color:var(--text);border-color:var(--accent)}
.nm-dismiss:disabled{opacity:.55;cursor:default}
/* A plan is not a booking. Dashed and dimmer on purpose: nothing here will
   record until the guide carries it. */
.plan{display:flex;align-items:center;gap:10px;padding:8px 10px;margin:6px 0;
  border:1px dashed var(--line);border-radius:8px;color:var(--dim);font-size:13px}
.plan-title{color:var(--text);font-weight:600}
/* `hidden` is a UA rule (`display:none`) and ANY author `display` beats it, so
   `.plan{display:flex}` above kept every folded row on screen. Specificity of
   class+attribute puts it back. */
.plan[hidden]{display:none}
.plan-when{margin-left:auto}
.plan-src{font-size:11px;text-transform:uppercase;letter-spacing:.04em}
/* The fold control when a season is longer than the card opens. Deliberately
   not styled like a `.plan` row: it names a count and an action, and looking
   like a row would read as another thing you are waiting for. */
.plan-more{font-size:12px;color:var(--dim);padding:6px 10px 2px;background:none;
  border:0;cursor:pointer;font-family:inherit;text-align:left;display:block}
.plan-more:hover{color:var(--text);text-decoration:underline}
.plan-more:focus-visible{outline:2px solid var(--accent-ring);outline-offset:2px}
/* The sync the icon used to do, moved into the panel and named. It has to
   read as an action rather than as one more line of the report, so it gets a
   border and the full width. */
.nm-sync{margin:12px 0 0}
.nm-syncbtn{display:block;width:100%;font:inherit;font-size:13px;text-align:center;
  padding:7px 10px;border-radius:7px;border:1px solid var(--line);
  background:var(--panel2);color:var(--text);cursor:pointer}
.nm-syncbtn:hover{background:var(--accent-soft);border-color:var(--accent);color:var(--text)}
.nm-syncbtn:disabled{opacity:.55;cursor:default}
.nm-foot{color:var(--dim);font-size:11px;border-top:1px solid var(--line);
  margin:10px -12px -12px;padding:9px 12px}

/* ---------------------------------------------------------------------------
   Live TV. Rows of cards, the same three the Apple TV app opens on. Amber is a
   recording CouchElephant makes; blue-grey is one Plex makes, as everywhere.
   --------------------------------------------------------------------------- */
.tvhead{font-size:15px;margin:22px 0 10px}
.tvrow{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:14px}
.tvrow.small{grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:8px}
.tvrow > .empty{grid-column:1/-1}
.tvcard{background:var(--panel);border:1px solid var(--line);border-radius:10px;
  overflow:hidden;display:flex;flex-direction:column}
.tvcard.locked{opacity:.78}
.tvart{aspect-ratio:16/9;background:var(--panel2) center/cover no-repeat;
  display:flex;align-items:center;justify-content:center}
.tvart.none img{max-width:46%;max-height:46%;object-fit:contain}
.tvart.none span{font-size:26px;font-weight:700;color:var(--dim)}
.tvbody{padding:11px 13px 13px;display:flex;flex-direction:column;gap:3px;flex:1 1 auto}
.tvbadges{min-height:20px}
.tvtitle{font-size:15px;line-height:1.25}
.tvbtns{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto;padding-top:10px}
.tvlock{margin-top:auto;padding-top:10px;font-size:12px;color:var(--dim)}
.tvbar{height:4px;border-radius:2px;background:var(--line);margin-top:8px;overflow:hidden}
.tvbar i{display:block;height:100%;background:var(--accent)}
.tvchan{display:flex;align-items:center;gap:11px;text-align:left;padding:9px 11px;
  background:var(--panel);border:1px solid var(--line);border-radius:8px;
  color:var(--text);cursor:pointer;min-width:0}
.tvchan:hover{background:var(--hover);border-color:var(--hover-bd)}
.tvchan img{width:52px;height:30px;flex:0 0 52px;object-fit:contain;padding:2px;
  background:var(--tile);border-radius:4px}
.tvnum{width:52px;flex:0 0 52px;text-align:center;font-weight:700;color:var(--dim)}
.tvchbody{display:flex;flex-direction:column;min-width:0;line-height:1.3}
.tvchbody b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tvplayer[hidden]{display:none}
.tvplayer{position:fixed;inset:0;z-index:200;background:var(--bg);display:flex;
  flex-direction:column}
.tvpbar{display:flex;align-items:center;gap:8px;padding:10px 14px;
  border-bottom:1px solid var(--line)}
.tvptitle{margin-right:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap}
.tvlivebtn{border-color:var(--accent-bd);color:var(--accent-ink)}
.tvplogo{height:30px;width:52px;object-fit:contain;padding:2px;background:var(--tile);
  border-radius:4px;flex:0 0 52px}
.tvpnum{font-weight:700;color:var(--dim)}
.tvpinfo{width:2em;padding-left:0;padding-right:0;font-style:italic;font-family:Georgia,serif;
  font-weight:700;border-radius:50%}
.tvplayer button[aria-pressed="true"],.tvpinfo[aria-expanded="true"]{
  border-color:var(--accent-bd);color:var(--accent-ink)}
.tvpabout{padding:10px 14px;border-bottom:1px solid var(--line);max-height:30vh;overflow:auto}
.tvpabout p{margin:4px 0 0;line-height:1.45;max-width:70ch}
.tvplayer video{flex:1 1 auto;min-height:0;width:100%;background:var(--bg)}
.tvpskip{position:absolute;right:24px;bottom:84px;z-index:2;font-size:1.05em;
  padding:10px 18px;background:var(--panel);border-color:var(--accent-bd);color:var(--accent-ink)}
.tvpskip[hidden]{display:none}
/* The guide over live TV: the guide page in a frame over the lower part of
   the picture, which plays on above it. */
.tvpguidebox{position:absolute;left:0;right:0;bottom:0;height:60%;z-index:3;
  border-top:2px solid var(--accent);background:transparent;box-shadow:0 -12px 40px rgba(0,0,0,.5)}
.tvpguidebox[hidden]{display:none}
.tvpguidebox iframe{width:100%;height:100%;border:0;display:block}
/* The guide page inside it: only the grid. */
body.guideoverlay .topbar,body.guideoverlay h1,body.guideoverlay .sub,
body.guideoverlay .daybar,body.guideoverlay .tabbar,body.guideoverlay .filterbar,body.guideoverlay .legend,
body.guideoverlay #gstatus,body.guideoverlay footer{display:none}
body.guideoverlay main{padding:0}
body.guideoverlay .gridwrap{border:0;border-radius:0}
/* Half see-through, so the picture shows behind the guide. The channel column
   and the time row are backed more heavily so programmes scrolling under them
   do not muddle the labels. Overlay only; the Guide page is unchanged. */
html:has(body.guideoverlay),body.guideoverlay{background:transparent}
body.guideoverlay .gridwrap{background:rgba(var(--bg-rgb),.55)}
body.guideoverlay .gprog{background:rgba(var(--bg-rgb),.45);
  -webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
body.guideoverlay .gprog:hover{background:rgba(var(--bg-rgb),.8)}
body.guideoverlay .gprog.sched-ce,body.guideoverlay .gprog.sched-plex{
  background-color:rgba(var(--bg-rgb),.5)}
body.guideoverlay .gch,body.guideoverlay .gcorner,body.guideoverlay .gtimes{
  background:rgba(var(--bg-rgb),.8)}
body.guideoverlay .gprog .t{text-shadow:0 1px 2px rgba(0,0,0,.8)}
.tvpmsg{position:absolute;left:0;right:0;top:50%;text-align:center;color:var(--dim);
  padding:0 20px;pointer-events:none}
/* A channel in the guide that can be watched: it says so when pointed at. */
.gch.watch{cursor:pointer}
.gch.watch:hover img,.gch.watch:focus-visible img{outline:2px solid var(--accent);outline-offset:2px}
/* The Recorded list on the Recordings page: a row per recording, and a row
   per programme that has more than one. */
.recrow,.recgroup{display:flex;align-items:center;gap:12px;padding:10px 8px;
  border-bottom:1px solid var(--line)}
.recrow .pmeta{min-width:0;display:flex;flex-direction:column;line-height:1.3;margin-right:auto}
.recrow .pacts{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.recgroup{cursor:pointer}
.recgroup:hover{background:var(--panel2)}
.recgroup .chev{color:var(--dim);width:14px}
.recgroup .tiny{margin-left:auto}
.recin{padding-left:26px}
.retrysay.bad{color:var(--bad-fg)}
.handerr{padding:0 8px 8px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}

/* Update banner: administrators only, above the header. */
.updatebar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;padding:8px 16px;
  background:var(--panel);border-bottom:1px solid var(--border,rgba(128,128,128,.35));font-size:14px}
.updatebar[hidden]{display:none}
.updatebar .ub-text{font-weight:600}
.updatebar .ub-note{opacity:.8}
.updatebar button{padding:4px 12px;cursor:pointer}

/* Sign in with Plex */
.psi-code { font: 700 2.4rem/1.2 ui-monospace, monospace; letter-spacing: .35em;
  padding: 8px 0 8px .35em; text-align: center; }
.psi-server { display: block; width: 100%; margin: 6px 0; }
.psi-or { margin: 10px 0 0; }

/* ---- issue reports ---- */
/* Above the settings window, which is itself an overlay. */
.ovl.report{z-index:90}
.reportbox{width:min(480px,100%);padding:22px}
.reportbox h2{margin:0 0 12px;font-size:18px}
.reportbox p{margin:0 0 12px;line-height:1.45}
.reportsum{padding:8px 10px;border-radius:6px;background:var(--panel2);
  border:1px solid var(--line);font-size:13px;overflow-wrap:anywhere}
.reportfield{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;
  font-size:12px;text-transform:uppercase;letter-spacing:.5px;color:var(--dim)}
.reportfield textarea,.reportfield input{width:100%;box-sizing:border-box;
  text-transform:none;letter-spacing:0;font-size:14px}
.reportfield textarea{resize:vertical;min-height:96px;font:inherit;font-size:14px;
  background:var(--panel2);color:var(--text);border:1px solid var(--line);
  border-radius:6px;padding:7px 10px}
.reportfield textarea:focus{outline:1px solid var(--accent)}
.reportfoot{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.reportmsg{min-height:1.2em;margin:0 0 10px;font-size:13px;overflow-wrap:anywhere}
.reportmsg.bad{color:var(--bad-fg)}
.reportmsg.ok{color:var(--ok-fg)}
.reportmsg.warn{color:var(--warn-fg)}
.reportbtn{margin-left:6px;vertical-align:baseline}
@media (max-width:640px){
  .reportbox{padding:18px 16px calc(18px + env(safe-area-inset-bottom))}
  .reportfoot button{flex:1}
}
