/*
  Showbox for phones and tablets (/m). Dark theme matching TV mode, with the brighter kids
  theme on body.kids. Phones get a bottom tab bar, tablets (768px+) a side rail.
*/
:root {
  --bg: #0b0b0f;
  --bg-2: #16161d;
  --bg-3: #23232b;
  --line: rgba(255, 255, 255, 0.08);
  --fg: #fff;
  --muted: #a3a3ad;
  --dim: #6f6f7a;
  --accent: #e50914;
  --accent-fg: #fff;
  --brand: #ffb627;
  --catchup: #2563eb;
  --radius: 8px;
  --radius-lg: 14px;
  --gutter: 16px;
  --gap: 10px;
  --top-h: 52px;
  --tab-h: 58px;
  --rail: 0px;
  --cols: 3;
  /* a poster in a row: 3 and a bit across a phone, at most 168px (more across a desktop, T10 U2) */
  --row-card: min(168px, calc((100vw - var(--rail) - var(--pad-l) - var(--pad-r) - 2 * var(--gap)) / 3.25));
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --pad-l: max(var(--gutter), var(--sal));
  --pad-r: max(var(--gutter), var(--sar));
  color-scheme: dark;
}
body.kids {
  --bg: #0d1b3e;
  --bg-2: #142a5c;
  --bg-3: #1d3a78;
  --line: rgba(255, 255, 255, 0.12);
  --muted: #c9d6f5;
  --dim: #8ea3d6;
  --accent: #ffc107;
  --accent-fg: #0d1b3e;
  --brand: #ffc107;
  --radius: 16px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.playing {
  overflow: hidden;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
}
[hidden] {
  display: none !important;
}
.ic {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: none;
}
.ic svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* ---------- top bar ---------- */
#topbar {
  position: fixed;
  z-index: 40;
  top: 0;
  left: var(--rail);
  right: 0;
  height: calc(var(--top-h) + var(--sat));
  padding: var(--sat) var(--pad-r) 0 var(--pad-l);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  transition: background-color 0.2s;
}
#topbar.solid {
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--fg);
}
.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
}
.top-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.2s;
}
#topbar.solid .top-title {
  opacity: 1;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
}
.icon-btn:active {
  background: rgba(255, 255, 255, 0.12);
}
.back-btn {
  display: none;
  margin-left: -8px;
  background: rgba(0, 0, 0, 0.35);
}
#topbar.solid .back-btn {
  background: none;
}
body.sub .back-btn {
  display: inline-flex;
}
body.sub .brand {
  display: none;
}
body:not(.sub) .top-title {
  display: none;
}
#topbar .brand {
  flex: 1;
}
.avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  flex: none;
}
.avatar-btn .avatar {
  width: 100%;
  height: 100%;
  border-radius: 0;
}
.avatar-btn .avatar-letter {
  font-size: 18px;
}
body.no-profile #topbar,
body.no-profile:not(.admin-page) #tabbar {
  display: none;
}

/* ---------- tab bar (phones) / rail (tablets) ---------- */
#tabbar {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tab-h) + var(--sab));
  padding: 0 var(--sar) var(--sab) var(--sal);
  display: flex;
  background: rgba(14, 14, 19, 0.97);
  border-top: 1px solid var(--line);
}
body.kids #tabbar {
  background: rgba(13, 27, 62, 0.97);
}
.tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
}
.tab i {
  display: block;
  width: 24px;
  height: 24px;
}
.tab i svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}
.tab span {
  white-space: nowrap;
}
.tab.active {
  color: var(--fg);
}
body.kids .tab.active {
  color: var(--accent);
}
.rail-brand,
.rail-avatar,
.rail-admin {
  display: none;
}
/* T10 U3: Admin and My account, for admin logins (js/chrome.js sets the class);
   T12: My downloads for logins with Downloads access (body.dl-links) */
body:not(.admin-links) .admin-only,
body:not(.dl-links) .dl-only {
  display: none !important;
}

#main {
  padding-bottom: calc(var(--tab-h) + var(--sab) + 24px);
  min-height: 100vh;
}
body.no-profile:not(.admin-page) #main {
  padding-bottom: calc(var(--sab) + 24px);
}

@media (min-width: 768px) {
  :root {
    --rail: calc(84px + var(--sal));
    --gutter: 24px;
    --gap: 14px;
    --top-h: 60px;
    --pad-l: var(--gutter);
  }
  #tabbar {
    overflow-y: auto;
    top: 0;
    right: auto;
    width: var(--rail);
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: calc(var(--sat) + 10px) 0 calc(var(--sab) + 14px) var(--sal);
    border-top: 0;
    border-right: 1px solid var(--line);
    gap: 4px;
  }
  .tab {
    flex: none;
    height: 62px;
    margin: 0 8px;
    border-radius: 12px;
    font-size: 11.5px;
  }
  .tab.active {
    background: rgba(255, 255, 255, 0.08);
  }
  .rail-brand {
    display: block;
    text-align: center;
    margin-bottom: 12px;
  }
  .rail-brand img {
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto;
  }
  .rail-avatar {
    display: block;
    margin: auto auto 0;
    width: 44px;
    height: 44px;
  }
  .rail-brand, .rail-avatar, .rail-admin { flex-shrink: 0; }
  .rail-admin {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: auto 8px 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .rail-admin + .rail-avatar {
    margin-top: 0;
  }
  body:not(.admin-links):not(.dl-links) .rail-admin {
    display: none;
  }
  body:not(.admin-links):not(.dl-links) .rail-admin + .rail-avatar {
    margin-top: auto;
  }
  .rail-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 52px;
    border-radius: 12px;
    color: var(--dim);
    font-size: 10.5px;
    font-weight: 600;
    text-decoration: none;
  }
  .rail-link i {
    display: block;
    width: 20px;
    height: 20px;
  }
  .rail-link i svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
  }
  .rail-link:hover {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.06);
  }
  #topbar .avatar-btn:not(.rail-avatar) {
    display: none;
  }
  #topbar .brand {
    visibility: hidden;
  }
  #main {
    margin-left: var(--rail);
    padding-bottom: calc(var(--sab) + 32px);
  }
  body.no-profile:not(.admin-page) #main {
    margin-left: 0;
  }
  #toast {
    margin-left: calc(var(--rail) / 2);
  }
}
@media (min-width: 768px) and (max-height: 520px) {
  .rail-brand {
    display: none;
  }
  .tab {
    height: 50px;
  }
  .tab span,
  .rail-link span {
    display: none;
  }
  .rail-link {
    height: 40px;
  }
}

/* ---------- views ---------- */
.view {
  min-height: 60vh;
}
.view.pad-top {
  padding-top: calc(var(--top-h) + var(--sat) + 4px);
}
.view.no-hero {
  padding-top: calc(var(--top-h) + var(--sat) + 4px);
}
.page-title {
  font-size: 26px;
  font-weight: 800;
  padding: 4px var(--pad-r) 10px var(--pad-l);
}
body.kids .page-title {
  font-size: 30px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  padding: 18px var(--pad-r) 10px var(--pad-l);
}
.msg {
  padding: 40px var(--pad-r) 40px var(--pad-l);
  text-align: center;
  color: var(--muted);
}
.msg p {
  max-width: 420px;
  margin: 0 auto 16px;
}
.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.spinner.center {
  margin: 80px auto;
}
.spinner.small {
  width: 26px;
  height: 26px;
  border-width: 3px;
  margin: 20px auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
  background: var(--bg);
}
.boot-mark {
  width: 88px;
  height: 88px;
}
.noscript {
  padding: 40px 20px;
  text-align: center;
}
#toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--sab) + 16px);
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 22px;
  background: #f2f2f2;
  color: #111;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
  font-weight: 700;
  white-space: nowrap;
}
.btn:active {
  opacity: 0.75;
}
.btn.primary {
  background: #fff;
  color: #000;
}
body.kids .btn {
  border-radius: 24px;
}
body.kids .btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.chips {
  display: flex;
  gap: 8px;
}
.chip {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  background: var(--bg-3);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.chip.active {
  background: #fff;
  color: #000;
}
body.kids .chip.active {
  background: var(--accent);
  color: var(--accent-fg);
}
.segmented {
  display: flex;
  margin: 0 var(--pad-r) 12px var(--pad-l);
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-3);
}
.sheet .segmented {
  margin: 0 0 6px;
}
.seg {
  flex: 1;
  height: 36px;
  border-radius: 8px;
  font-weight: 700;
  color: var(--muted);
}
.seg.active {
  background: #fff;
  color: #000;
}
body.kids .seg.active {
  background: var(--accent);
  color: var(--accent-fg);
}
.progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 13.5px;
}
.meta .rating {
  color: #ffd54f;
  font-weight: 700;
}
/* T12: already in the Plex library (Plex's own orange, kept small) */
.plex-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(229, 160, 13, 0.6);
  border-radius: 4px;
  color: #e5a00d;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.2px;
}
.plex-badge.small {
  margin-left: 8px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 15px;
  vertical-align: 1px;
}
.plex-mark {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e5a00d;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
/* T11 K1: a title the provider dropped, kept in history, My List and Continue Watching: greyed,
   with "No longer available" (or "Only on Plex" in Plex's orange) instead of Play */
.gone-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 2px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
}
.gone-badge.plex {
  border-color: rgba(229, 160, 13, 0.6);
  color: #e5a00d;
}
.gone-badge.on-card {
  position: absolute;
  left: 6px;
  right: 6px;
  /* above Continue Watching's progress bar */
  bottom: 12px;
  justify-content: center;
  margin: 0;
  background: rgba(0, 0, 0, 0.72);
  font-size: 11px;
  white-space: normal;
  text-align: center;
  pointer-events: none;
}
.card.gone .card-img img,
.hist.gone .hist-poster img,
.ep.gone .ep-thumb img {
  /* darkened rather than see-through, so the title placeholder behind it doesn't show */
  filter: grayscale(1) brightness(0.55);
}
.ep.gone .ep-play {
  display: none;
}
.ep.gone:disabled {
  opacity: 1;
  pointer-events: none;
}
.btn.gone-btn:disabled {
  opacity: 0.55;
}
/* T12 X2: Watch on Plex, like the other details buttons with Plex's orange chevron */
.plex-btn .ic {
  color: #e5a00d;
}
/* hover only where there's a real pointer: on touch it sticks after a tap (T12 X5) */
@media (hover: hover) {
  .plex-btn:hover {
    box-shadow: inset 0 0 0 1.5px rgba(229, 160, 13, 0.6);
  }
}
/* T12 X3: Download to Plex; the progress fills the button from the left while it's active */
.dl-btn.queued,
.dl-btn.downloading,
.dl-btn.paused {
  background: linear-gradient(90deg, rgba(229, 160, 13, 0.38) var(--dl, 0%), rgba(255, 255, 255, 0.14) var(--dl, 0%));
}
.dl-btn.paused {
  color: #ffd54f;
}
.dl-btn.done {
  color: #e5a00d;
}
.dl-btn.done:disabled {
  opacity: 0.85;
}
.dl-btn.failed {
  box-shadow: inset 0 0 0 1.5px rgba(229, 9, 20, 0.7);
}
.dl-btn.failed .ic {
  color: #ff6b6b;
}
.sheet-text {
  margin: 0 0 14px;
  color: var(--muted);
}
/* T12 X6: "Status for future episodes" in the download question and the show's own button */
.future-choice {
  margin: 0 0 14px;
}
.future-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
}
.future-btn.on .ic {
  color: #e5a00d;
}
.future-btn.paused {
  color: #ffd54f;
}
.season-plex {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 8px;
}
.season-plex[hidden] {
  display: none;
}
.season-plex .btn {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13.5px;
}
.season-plex .ic {
  width: 18px;
  height: 18px;
}
/* an episode in Plex: the row and a Plex button beside it, sharing the row's line */
.ep-wrap {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.ep-wrap .ep {
  flex: 1;
  min-width: 0;
  border-bottom: 0;
}
.ep-plex {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 4px;
  border-radius: 50%;
  color: #e5a00d;
}
.ep-plex:active {
  background: rgba(229, 160, 13, 0.14);
}
@media (hover: hover) {
  .ep-plex:hover {
    background: rgba(229, 160, 13, 0.14);
  }
}
.ep-plex .ic {
  width: 20px;
  height: 20px;
}
/* T12 X4: an episode's Download to Plex icon beside its row: a ring fills while it downloads */
.ep-dl {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 4px;
  border-radius: 50%;
  color: var(--muted);
}
.ep-dl:active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
}
@media (hover: hover) {
  .ep-dl:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--fg);
  }
}
.ep-dl .ic {
  width: 20px;
  height: 20px;
}
.ep-dl.queued,
.ep-dl.downloading,
.ep-dl.paused {
  color: #e5a00d;
}
.ep-dl.queued::before,
.ep-dl.downloading::before,
.ep-dl.paused::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: conic-gradient(#e5a00d var(--dl, 0%), rgba(255, 255, 255, 0.16) var(--dl, 0%));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
}
.ep-dl.queued .ic {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}
.ep-dl.paused {
  color: #ffd54f;
}
.ep-dl.paused .ic {
  width: 14px;
  height: 14px;
}
.ep-dl-pct {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.ep-dl.done {
  color: #e5a00d;
}
.ep-dl.failed {
  color: #ff6b6b;
}
.ep-dl:disabled {
  opacity: 0.5;
}
/* T34: an episode's tick and "⋯" menu, the season's menu and the show's / film's More */
.ep-tick {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #69f0ae;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
body.kids .ep-tick {
  background: var(--accent);
  color: var(--accent-fg);
}
.ep-tick .ic {
  width: 16px;
  height: 16px;
}
.ep-more {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 44px;
  margin-left: 2px;
  border-radius: 50%;
  color: var(--muted);
}
.ep-more:active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
}
@media (hover: hover) {
  .ep-more:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--fg);
  }
}
.ep-more .ic {
  width: 22px;
  height: 22px;
}
.season-plex .season-more {
  width: 36px;
  height: 36px;
  margin-left: auto;
}
.d-buttons .btn.more-btn:not(.primary) {
  flex: none;
  min-width: 0;
  width: 56px;
  padding: 0;
}
.meta .watched-badge {
  margin-top: 0;
}
.chip.in-plex::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-radius: 50%;
  background: #e5a00d;
  vertical-align: 2px;
}

/* ---------- avatars ---------- */
.avatar {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
.avatar svg {
  position: absolute;
  top: 15%;
  left: 15%;
  width: 70%;
  height: 70%;
}
.avatar-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 44px;
  color: #fff;
}
.c-red { background: linear-gradient(135deg, #ff4b2b, #b20710); }
.c-orange { background: linear-gradient(135deg, #ffa040, #e65100); }
.c-yellow { background: linear-gradient(135deg, #ffd54f, #ff8f00); }
.c-green { background: linear-gradient(135deg, #66bb6a, #1b5e20); }
.c-teal { background: linear-gradient(135deg, #4db6ac, #00695c); }
.c-blue { background: linear-gradient(135deg, #64b5f6, #1565c0); }
.c-purple { background: linear-gradient(135deg, #ba68c8, #6a1b9a); }
.c-pink { background: linear-gradient(135deg, #f06292, #ad1457); }
.avatar.c-add {
  background: var(--bg-2);
  border: 2px dashed rgba(255, 255, 255, 0.2);
}
.avatar.c-add svg {
  fill: var(--muted);
}

/* ---------- profiles ---------- */
.view.profiles {
  min-height: 100vh;
  padding: calc(var(--sat) + 40px) var(--pad-r) 40px var(--pad-l);
  text-align: center;
}
.profiles-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--fg);
  margin-bottom: 32px;
}
.profiles-brand img {
  width: 36px;
  height: 36px;
}
.view.profiles h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 28px;
}
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 132px));
  justify-content: center;
  gap: 24px 22px;
}
@media (min-width: 480px) {
  .profiles-grid {
    grid-template-columns: repeat(3, minmax(0, 132px));
  }
}
@media (min-width: 900px) {
  .profiles-grid {
    grid-template-columns: repeat(4, 150px);
  }
}
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.profile {
  outline: none;
}
.profile .avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pname {
  margin-top: 10px;
  font-weight: 600;
  font-size: 16px;
  color: #ddd;
  transition: color 0.2s ease;
}
/* the profile used last: a faint ring */
.profile.current .avatar {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgba(255, 255, 255, 0.3);
}
/* Netflix-style: a white ring and a slight lift on hover, keyboard focus and while pressed */
.profile:focus-visible .avatar,
.profile.pressed .avatar {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #fff;
}
.profile:focus-visible .pname,
.profile.pressed .pname {
  color: #fff;
}
@media (hover: hover) {
  .profile:hover .avatar {
    transform: scale(1.06);
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #fff;
  }
  .profile:hover .pname {
    color: #fff;
  }
}
.plock {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--dim);
}
.profiles-status {
  margin-top: 24px;
}

.profiles-account {
  margin-top: 32px;
  font-size: 14px;
  color: var(--dim);
}
.profiles-account .link {
  color: var(--fg);
  text-decoration: underline;
  font-size: inherit;
}

/* ---------- sign in (R4) ---------- */
.signin-page {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  background: var(--bg);
  padding: calc(var(--sat) + 48px) var(--pad-r) 40px var(--pad-l);
  text-align: center;
}
.signin-page h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 24px;
}
.signin-form {
  max-width: 360px;
  margin: 0 auto;
  text-align: left;
}
.signin-form .text-input {
  width: 100%;
  margin-bottom: 16px;
}
.signin-form .btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

/* ---------- sign in a TV (F3) ---------- */
.link-view {
  padding: calc(var(--sat) + 72px) var(--pad-r) 40px var(--pad-l);
  text-align: center;
}
.link-view h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 24px;
}
.link-box {
  max-width: 360px;
  margin: 0 auto;
}
.link-box .text-input,
.link-box .btn {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}
.link-code {
  text-align: center;
  font-size: 22px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.link-device {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border-radius: 14px;
  background: var(--card, rgba(255, 255, 255, 0.06));
}
.link-device strong {
  font-size: 20px;
}
.link-device span {
  font-size: 18px;
  letter-spacing: 0.15em;
  color: var(--dim);
}
.link-note,
.link-done {
  margin: 16px 0 4px;
  color: var(--dim);
}
.link-done {
  color: var(--fg);
  font-size: 18px;
}

/* ---------- TV remote (F4) ---------- */
#topbar .remote-btn {
  margin-left: auto;
  margin-right: 8px;
}
#topbar .remote-btn[hidden] {
  display: none;
}
.remote-tv {
  text-align: center;
  color: var(--dim);
  margin-bottom: 16px;
}
.tv-picker {
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.remote-pad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  grid-template-rows: repeat(3, 72px);
  gap: 8px;
  justify-content: center;
  margin: 0 auto 16px;
}
.remote-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 18px;
  font-weight: 700;
}
.remote-key:active {
  background: rgba(255, 255, 255, 0.28);
}
.remote-key svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}
.remote-key.up { grid-column: 2; grid-row: 1; }
.remote-key.up svg { transform: rotate(180deg); }
.remote-key.left { grid-column: 1; grid-row: 2; }
.remote-key.ok { grid-column: 2; grid-row: 2; background: #fff; color: #000; }
.remote-key.right { grid-column: 3; grid-row: 2; }
.remote-key.down { grid-column: 2; grid-row: 3; }
.remote-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.remote-row .remote-key {
  height: 56px;
  flex: 1;
  max-width: 110px;
}
.remote-type .text-input {
  width: 100%;
  margin-bottom: 10px;
}
.remote-type .remote-row .btn {
  flex: 1;
  justify-content: center;
}

/* ---------- sheets ---------- */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.22s;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  padding: 8px max(18px, var(--sar)) calc(var(--sab) + 18px) max(18px, var(--sal));
  border-radius: 18px 18px 0 0;
  background: var(--bg-2);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet.tall {
  height: 80vh;
  height: 80dvh;
}
.sheet-wrap.open {
  pointer-events: auto;
}
.sheet-wrap.open .sheet-backdrop {
  opacity: 1;
}
.sheet-wrap.open .sheet {
  transform: none;
}
.sheet-grip {
  width: 40px;
  height: 4px;
  margin: 2px auto 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  flex: none;
}
.sheet-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 14px;
  flex: none;
}
.sheet-body {
  /* to the sheet's edges, so its scrollbar and sideways rows aren't cut off inside the padding */
  margin: 0 -18px;
  padding: 0 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.sheet-actions .btn {
  flex: 1;
}
@media (min-width: 768px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: 480px;
    max-height: 80vh;
    padding-bottom: 22px;
    border-radius: 18px;
    transform: translate(-50%, -45%);
    opacity: 0;
    transition: transform 0.2s, opacity 0.2s;
  }
  .sheet.tall {
    height: 70vh;
  }
  .sheet-wrap.open .sheet {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
  .sheet-grip {
    display: none;
  }
}
.cat-list {
  display: flex;
  flex-direction: column;
}
.cat-item {
  text-align: left;
  min-height: 48px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.cat-item.active {
  color: var(--accent);
  font-weight: 700;
}
.cat-item:active {
  background: rgba(255, 255, 255, 0.06);
}
.season-item {
  display: flex;
  align-items: center;
}
.seasons .select {
  max-width: none;
}
.seasons .count {
  align-self: center;
}

/* continue watching options */
.opt-head {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}
.opt-poster {
  position: relative;
  width: 84px;
  aspect-ratio: 2 / 3;
  flex: none;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
}
.opt-main {
  flex: 1;
  min-width: 0;
}
.opt-main h2 {
  font-size: 19px;
  margin-bottom: 4px;
}
.opt-sub {
  color: var(--muted);
  margin-bottom: 10px;
}
.opt-main .progress {
  margin-top: 8px;
}
.opt-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.opt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt-list .btn {
  justify-content: flex-start;
  min-height: 50px;
}

/* pin pad */
.pin-who {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  color: var(--muted);
}
.pin-who .avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.pin-who .avatar-letter {
  font-size: 17px;
}
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 22px 0 24px;
}
.pin-dots i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.pin-dots i.on {
  background: #fff;
  border-color: #fff;
}
.pin-dots.shake {
  animation: shake 0.4s;
}
@keyframes shake {
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  justify-content: center;
  gap: 14px 22px;
}
.key {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-3);
  font-size: 28px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.key:active {
  background: rgba(255, 255, 255, 0.3);
}
.key svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* new profile */
.np-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 17px;
}
.np-preview .avatar {
  width: 56px;
  height: 56px;
}
.np-preview .avatar-letter {
  font-size: 28px;
}
.text-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  font-size: 17px;
  outline: none;
}
.text-input:focus {
  border-color: rgba(255, 255, 255, 0.5);
}
.form-label {
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}
.form-error {
  min-height: 20px;
  margin-top: 10px;
  color: #ff6b6b;
  font-size: 14px;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.swatch {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 3px solid transparent;
}
.swatch.active {
  border-color: #fff;
}

/* ---------- cards, rows, grids ---------- */
.card {
  display: block;
  width: 100%;
  text-align: left;
  min-width: 0;
  /* a button centres its content: in a row or grid line with a two-line title, posters with a
     one-line title would sit lower */
  align-self: start;
}
.card-img {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
}
.card-img img,
.opt-poster img,
.d-poster img,
.ch-logo img,
.ep-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
img.broken {
  visibility: hidden;
}
.card-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  overflow: hidden;
  word-break: break-word;
}
.card-ph.poster-ph {
  container-type: inline-size;
  padding: 0;
  font-weight: 750;
  color: #f5f3fb;
  background: linear-gradient(150deg, #37324f, #14131d);
}
body.kids .card-ph.poster-ph {
  background: linear-gradient(135deg, #22407e, #142a5c);
}
.poster-ph-title {
  display: -webkit-box;
  width: 88%;
  overflow: hidden;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  font-size: 16px;
  font-size: clamp(10px, 13cqi, 32px);
  line-height: 1.12;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}
.card:active .card-img {
  transform: scale(0.97);
}
.card-img .progress {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
}
.card-title {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.3;
  color: #ddd;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.kids .card-title {
  font-weight: 700;
  color: var(--muted);
}
.card-sub {
  font-size: 12px;
  color: var(--dim);
}
.row {
  margin-top: 18px;
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
}
.row-title {
  font-size: 17px;
  font-weight: 700;
  padding: 0 var(--pad-r) 8px var(--pad-l);
}
body.kids .row-title {
  font-size: 20px;
}
.row-track {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  padding: 0 var(--pad-r) 4px var(--pad-l);
  scroll-padding: 0 var(--pad-l);
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.row-track::-webkit-scrollbar {
  display: none;
}
.row-track .card {
  flex: none;
  width: var(--row-card);
  scroll-snap-align: start;
}
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 16px var(--gap);
  padding: 0 var(--pad-r) 0 var(--pad-l);
}
@media (min-width: 520px) {
  :root { --cols: 4; }
}
@media (min-width: 700px) {
  :root { --cols: 5; }
}
@media (min-width: 960px) {
  :root { --cols: 6; }
}
@media (min-width: 1200px) {
  :root { --cols: 7; }
}
@media (min-width: 1500px) {
  :root { --cols: 8; }
}
.list-status {
  min-height: 1px;
}
.sentinel {
  height: 1px;
}

/* catalog toolbar */
.toolbar {
  position: sticky;
  top: calc(var(--top-h) + var(--sat));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px var(--pad-r) 12px var(--pad-l);
  background: var(--bg);
  overflow-x: auto;
  scrollbar-width: none;
}
.toolbar::-webkit-scrollbar {
  display: none;
}
.select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 60vw;
  height: 36px;
  padding: 0 10px 0 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: 700;
  flex: none;
}
.select-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.count {
  margin-left: auto;
  padding-left: 6px;
  color: var(--dim);
  font-size: 13px;
  white-space: nowrap;
}

/* live channels */
.list {
  display: flex;
  flex-direction: column;
  padding: 0 var(--pad-r) 0 var(--pad-l);
}
@media (min-width: 900px) {
  .list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }
}
.ch {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto 80px;
}
.ch:active {
  background: rgba(255, 255, 255, 0.05);
}
.ch-logo {
  position: relative;
  width: 64px;
  height: 48px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-3);
}
.ch-logo img {
  object-fit: contain;
  padding: 4px;
}
.ch-logo .card-ph {
  font-size: 18px;
}
.ch-main {
  flex: 1;
  min-width: 0;
}
.ch-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-epg {
  font-size: 13px;
  color: var(--muted);
}
.ch-epg .progress {
  height: 3px;
  margin: 4px 0 3px;
  max-width: 220px;
}
.ch-now,
.ch-next {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-next {
  color: var(--dim);
}
.ch-time {
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}

/* ---------- home: where the profile left off, the banner's first slide (D3) ---------- */
.hero-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  margin: 0 auto 14px;
  color: #d6d6dc;
  font-size: 13px;
  white-space: nowrap;
}
.hero-progress .progress {
  flex: 1;
}
@media (min-width: 768px) {
  .hero-progress {
    margin-left: 0;
  }
}
/* F12: Edit Home */
.home-edit {
  display: flex;
  justify-content: center;
  padding: 10px var(--pad-r) 34px var(--pad-l);
}
.home-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.home-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 4px 6px 4px 14px;
  border-radius: 12px;
  background: var(--bg-3);
}
.home-row-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-row.off .home-row-name {
  color: var(--muted);
  text-decoration: line-through;
}
.home-row-btn,
.home-row-hide {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  border-radius: 10px;
}
.home-row-btn .ic {
  width: 24px;
  height: 24px;
}
.home-row-btn.up .ic {
  transform: rotate(180deg);
}
.home-row-btn:disabled {
  opacity: 0.25;
}
.home-row-hide {
  min-width: 62px;
  padding: 0 10px;
  color: var(--muted);
  font-weight: 700;
}

/* ---------- home hero ---------- */
/* the slider moves with transforms; vertical swipes stay with the browser (pan-y), sideways
   ones are handled in js/views/home.js */
.hero {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.hero-track {
  display: flex;
  touch-action: pan-y;
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}
.hero-track.no-anim {
  transition: none;
}
.hero.dragging {
  cursor: grabbing;
}
.hero-slide {
  position: relative;
  flex: 0 0 100%;
  height: min(78vh, 135vw);
  min-height: 380px;
  overflow: hidden;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 20%;
  -webkit-user-drag: none;
  pointer-events: none;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 11, 15, 0.35) 0%, rgba(11, 11, 15, 0) 22%, rgba(11, 11, 15, 0) 40%, rgba(11, 11, 15, 0.85) 75%, var(--bg) 100%);
}
body.kids .hero-shade {
  background: linear-gradient(to bottom, rgba(13, 27, 62, 0.35) 0%, rgba(13, 27, 62, 0) 22%, rgba(13, 27, 62, 0) 40%, rgba(13, 27, 62, 0.85) 75%, var(--bg) 100%);
}
.hero-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34px;
  padding: 0 var(--pad-r) 0 var(--pad-l);
  text-align: center;
}
.hero-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.hero-title {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.hero-info .meta {
  justify-content: center;
  margin-bottom: 8px;
}
.hero-plot {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 640px;
  margin: 0 auto 14px;
  color: #d6d6dc;
  font-size: 14px;
}
.hero-info .btns {
  justify-content: center;
}
.hero-info .btn {
  min-width: 130px;
}
.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
}
/* small dots with a finger-sized tap area */
.hero-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
}
.hero-dot i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.4);
  transition: width 0.2s, background-color 0.2s;
}
.hero-dot.on i {
  width: 20px;
  background: #fff;
}
body.kids .hero-dot.on i {
  background: var(--accent);
}
@media (min-width: 768px) {
  .hero-slide {
    height: min(62vh, 52vw);
    min-height: 360px;
  }
  .hero-shade {
    background: linear-gradient(to right, rgba(11, 11, 15, 0.92) 0%, rgba(11, 11, 15, 0.5) 40%, rgba(11, 11, 15, 0) 70%), linear-gradient(to bottom, rgba(11, 11, 15, 0) 60%, var(--bg) 100%);
  }
  body.kids .hero-shade {
    background: linear-gradient(to right, rgba(13, 27, 62, 0.92) 0%, rgba(13, 27, 62, 0.5) 40%, rgba(13, 27, 62, 0) 70%), linear-gradient(to bottom, rgba(13, 27, 62, 0) 60%, var(--bg) 100%);
  }
  .hero-info {
    right: auto;
    width: min(560px, 55%);
    bottom: 48px;
    text-align: left;
  }
  .hero-info .meta,
  .hero-info .btns {
    justify-content: flex-start;
  }
  .hero-title {
    font-size: 40px;
  }
  .hero-plot {
    -webkit-line-clamp: 3;
    margin-left: 0;
  }
}

/* ---------- search ---------- */
.search-bar {
  position: sticky;
  top: calc(var(--top-h) + var(--sat));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 var(--pad-r) 0 var(--pad-l);
  padding: 0 4px 0 12px;
  height: 46px;
  border-radius: 12px;
  background: var(--bg-3);
  box-shadow: 0 -12px 0 var(--bg);
}
.search-ic {
  color: var(--muted);
}
.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
}
.search-input::-webkit-search-cancel-button {
  display: none;
}
.search-clear .ic {
  width: 20px;
  height: 20px;
}
.search-hint {
  padding: 48px var(--pad-r) 0 var(--pad-l);
  text-align: center;
  color: var(--dim);
}

/* ---------- details ---------- */
.d-hero {
  position: relative;
  height: min(60vw, 52vh);
  min-height: 220px;
  overflow: hidden;
  background: var(--bg-2);
}
.d-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
}
.d-backdrop.from-poster {
  filter: blur(18px) brightness(0.7);
  transform: scale(1.15);
}
.d-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 11, 15, 0.45) 0%, rgba(11, 11, 15, 0) 30%, rgba(11, 11, 15, 0.2) 60%, var(--bg) 100%);
}
body.kids .d-shade {
  background: linear-gradient(to bottom, rgba(13, 27, 62, 0.45) 0%, rgba(13, 27, 62, 0) 30%, rgba(13, 27, 62, 0.2) 60%, var(--bg) 100%);
}
.d-body {
  position: relative;
  margin-top: -64px;
  padding: 0 var(--pad-r) 0 var(--pad-l);
}
.d-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 16px;
}
.d-poster {
  position: relative;
  width: 104px;
  aspect-ratio: 2 / 3;
  flex: none;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.d-main {
  flex: 1;
  min-width: 0;
  padding-bottom: 4px;
}
.d-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 6px;
}
.d-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.d-buttons .btn.primary {
  flex: 1 1 100%;
}
.d-buttons .btn:not(.primary) {
  flex: 1 1 0;
}
.d-progress {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  order: -1;
}
.d-progress .progress {
  flex: 1;
}
.d-plot {
  color: #d6d6dc;
  margin-bottom: 12px;
  max-width: 760px;
}
@media (max-width: 767px) {
  .d-plot:not(.open) {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
.d-credits {
  color: var(--muted);
  font-size: 13.5px;
  max-width: 760px;
}
.d-credits div {
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.d-credits b {
  color: var(--dim);
  font-weight: 600;
}
.d-extra {
  margin: 18px calc(-1 * var(--pad-r)) 0 calc(-1 * var(--pad-l));
}
@media (min-width: 768px) {
  .d-hero {
    height: min(50vh, 44vw);
  }
  .d-body {
    margin-top: -120px;
  }
  .d-poster {
    width: 170px;
  }
  .d-title {
    font-size: 34px;
  }
  .d-buttons .btn.primary,
  .d-buttons .btn:not(.primary) {
    flex: none;
    min-width: 150px;
  }
  .d-progress {
    flex: 0 1 360px;
    order: 0;
  }
}

/* seasons + episodes */
.seasons {
  position: sticky;
  top: calc(var(--top-h) + var(--sat));
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 10px var(--pad-r) 12px var(--pad-l);
  background: var(--bg);
  overflow-x: auto;
  scrollbar-width: none;
}
.seasons::-webkit-scrollbar {
  display: none;
}
.episodes {
  display: flex;
  flex-direction: column;
  padding: 0 var(--pad-r) 0 var(--pad-l);
}
@media (min-width: 1000px) {
  .episodes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }
}
.ep {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto 110px;
}
.ep:active {
  background: rgba(255, 255, 255, 0.05);
}
/* D3: the episode Play would start */
.ep-next {
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.ep.up-next .ep-thumb {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.ep-thumb {
  position: relative;
  width: 40%;
  max-width: 200px;
  aspect-ratio: 16 / 9;
  flex: none;
  align-self: flex-start;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
}
.ep-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ep-play .ic {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}
.ep-thumb .progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 0;
}
.ep-info {
  flex: 1;
  min-width: 0;
}
.ep-title {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.3;
}
.ep-meta {
  font-size: 12.5px;
  color: var(--dim);
  margin: 2px 0 4px;
}
.ep-plot {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- player ---------- */
.player {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
}
.p-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
.player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.p-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--sat) + 6px) max(12px, var(--sar)) 8px max(8px, var(--sal));
  z-index: 3;
}
.p-titles {
  flex: 1;
  min-width: 0;
}
.p-title {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-sub {
  font-size: 13px;
  color: #c8c8cf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-via {
  font-size: 12px;
  color: #9a9aa3;
  white-space: nowrap;
}
/* F9: a phone's top bar has no room for "via kev · Data saver" beside the title and the buttons; the Quality
   button's dot says the data saver is on */
@media (max-width: 599px) {
  .p-top .p-via {
    display: none;
  }
}
.p-quality-btn {
  position: relative;
}
.p-quality-btn.saver::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.p-live-nav {
  display: flex;
}
.live-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e50914;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  vertical-align: 2px;
}
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: none;
  color: #fff;
}
.p-btn:active {
  background: rgba(255, 255, 255, 0.18);
}
.p-btn .ic {
  width: 26px;
  height: 26px;
}
/* native (HLS, iOS): the device's own controls, our bar sits above the video */
.player.native .p-top {
  order: -1;
  background: #000;
}
.player.native .p-center,
.player.native .p-center-live,
.player.native .p-bottom {
  display: none;
}
/* custom (MP4, Android): our controls float over the video and hide after a few seconds */
.player.custom .p-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}
.player.custom .p-live-nav {
  display: none;
}
.p-ui {
  transition: opacity 0.25s;
}
.player.ui-off .p-ui {
  opacity: 0;
  pointer-events: none;
}
.player.ui-off {
  cursor: none;
}
.p-center,
.p-center-live {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 36px;
}
.player.is-live .p-center,
.player:not(.is-live) .p-center-live {
  display: none;
}
.p-center .p-btn,
.p-center-live .p-btn {
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.35);
}
.p-center .p-btn .ic,
.p-center-live .p-btn .ic {
  width: 32px;
  height: 32px;
}
.p-center .p-play,
.p-center-live .p-play {
  width: 72px;
  height: 72px;
}
.p-center .p-play .ic,
.p-center-live .p-play .ic {
  width: 40px;
  height: 40px;
}
.p-bottom {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px max(14px, var(--sar)) calc(var(--sab) + 8px) max(14px, var(--sal));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}
.player.is-live .p-bottom {
  display: none;
}
.p-seek-label {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  min-height: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}
.p-seek-label:empty {
  display: none;
}
.p-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.p-time {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: center;
}
.p-range {
  --buf: 0%;
  flex: 1;
  min-width: 0;
  height: 32px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  --pct: 0%;
}
.p-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  /* played | loaded (K3) | not loaded yet */
  background: linear-gradient(to right, var(--accent) var(--pct), rgba(255, 255, 255, 0.55) var(--pct), rgba(255, 255, 255, 0.55) var(--buf, var(--pct)), rgba(255, 255, 255, 0.22) var(--buf, var(--pct)));
}
.p-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
}
.p-range::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
}
.p-range::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
}
.p-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
}
.p-range:disabled {
  opacity: 0.4;
}
.p-loading {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}
.player.busy .p-center,
.player.busy .p-center-live {
  visibility: hidden;
}
.p-loading-text {
  font-size: 14px;
  color: #ddd;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
.p-msg {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 40px));
  padding: 22px;
  border-radius: 16px;
  background: rgba(22, 22, 29, 0.96);
  text-align: center;
}
.p-msg h2 {
  font-size: 19px;
  margin-bottom: 8px;
}
.p-msg p {
  color: #ccc;
  margin-bottom: 18px;
}
.p-msg .btns {
  justify-content: center;
}
/* T23: the next-episode box, bottom right over the credits (above the seek bar), full width on phones */
.p-next {
  position: absolute;
  z-index: 4;
  right: max(24px, var(--sar));
  bottom: calc(var(--sab) + 92px);
  width: min(380px, calc(100% - 32px));
  padding: 18px 20px 20px;
  border-radius: 16px;
  background: rgba(22, 22, 29, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  cursor: auto;
}
.p-next-head {
  color: #bbb;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.p-next.still .p-next-head {
  color: #fff;
  font-size: 16px;
}
.p-next-title {
  font-weight: 700;
  font-size: 18px;
  margin: 4px 0 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-next .btns {
  flex-wrap: nowrap;
}
.p-next .btn {
  flex: 1;
}
.p-ring {
  display: inline-flex;
  width: 22px;
  height: 22px;
}
.p-ring[hidden] {
  display: none;
}
.p-ring svg {
  width: 22px;
  height: 22px;
}
.p-ring circle {
  fill: none;
  stroke-width: 2.5;
}
.p-ring-bg {
  stroke: rgba(0, 0, 0, 0.18);
}
.p-ring-fg {
  stroke: currentColor;
  stroke-dasharray: 56.55;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}
@media (max-width: 599px) {
  .p-next {
    left: max(16px, var(--sal));
    right: max(16px, var(--sar));
    width: auto;
  }
}
.p-tap {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.p-tap .ic {
  width: 72px;
  height: 72px;
  padding: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

/* T26: the mini player, a 16:9 window over the page: a corner on tablets and computers (dragged to
   another one), across the bottom above the tab bar on phones. Its own controls: play / pause,
   picture in picture, close; a tap anywhere else goes back to full size */
.p-mini-ui {
  display: none;
}
.player.mini {
  inset: auto;
  z-index: 90;
  width: clamp(300px, 33vw, 480px);
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
}
.player.mini.dragging {
  cursor: grabbing;
  touch-action: none;
}
.player.mini[data-corner="br"],
.player.mini[data-corner="tr"] {
  right: calc(var(--sar) + 16px);
}
.player.mini[data-corner="bl"],
.player.mini[data-corner="tl"] {
  left: calc(var(--rail, 0px) + 16px);
}
.player.mini[data-corner="br"],
.player.mini[data-corner="bl"] {
  bottom: calc(var(--sab) + 16px);
}
.player.mini[data-corner="tr"],
.player.mini[data-corner="tl"] {
  top: calc(var(--sat) + var(--top-h) + 12px);
}
@media (max-width: 767px) {
  .player.mini[data-corner] {
    top: auto;
    left: calc(var(--sal) + 8px);
    right: calc(var(--sar) + 8px);
    bottom: calc(var(--tab-h) + var(--sab) + 8px);
    width: auto;
    border-radius: 10px;
  }
  /* the end of the page can still be scrolled out from under the window */
  body.mini-playing #main {
    padding-bottom: calc(var(--tab-h) + var(--sab) + 32px + (100vw - 16px) * 9 / 16);
  }
}
.player.mini .p-ui,
.player.mini .p-menu,
.player.mini .p-osd,
.player.mini .p-subs,
.player.mini .p-loading-text {
  display: none;
}
.player.mini .p-mini-ui {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0.35));
  transition: opacity 0.2s;
}
@media (hover: hover) and (pointer: fine) {
  .player.mini:not(:hover):not(.paused):not(:focus-within) .p-mini-ui {
    opacity: 0;
  }
}
.p-mini-top {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
}
.p-mini-top .p-btn {
  width: 40px;
  height: 40px;
}
.p-mini-top .p-btn .ic {
  width: 22px;
  height: 22px;
}
.p-mini-mid {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.p-mini-mid .p-btn {
  width: 52px;
  height: 52px;
  background: rgba(0, 0, 0, 0.4);
}
.p-mini-mid .p-btn .ic {
  width: 30px;
  height: 30px;
}
.player.mini.busy .p-mini-mid {
  visibility: hidden;
}
.p-mini-prog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
}
.p-mini-prog span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}
.player.mini.is-live .p-mini-prog {
  display: none;
}
/* an error, the next episode and "Tap to play" fit the small window */
.player.mini .p-msg {
  width: calc(100% - 24px);
  padding: 10px 12px;
  border-radius: 10px;
}
.player.mini .p-msg h2 {
  font-size: 14px;
  margin: 0;
}
.player.mini .p-msg p,
.player.mini .p-msg .btns {
  display: none;
}
.player.mini .p-next {
  z-index: 4;
  left: 6px;
  right: 6px;
  bottom: 8px;
  width: auto;
  padding: 8px 10px;
  border-radius: 10px;
}
.player.mini .p-next-head {
  font-size: 12px;
}
.player.mini .p-next-title {
  display: none;
}
.player.mini .p-next .btns {
  margin-top: 6px;
  gap: 6px;
}
.player.mini .p-next .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}
.player.mini .p-tap span {
  display: none;
}
.player.mini .p-tap .ic {
  width: 52px;
  height: 52px;
  padding: 12px;
}

/* keyboard feedback: volume, mute, an HLS skip (T10 U2) */
.p-osd {
  position: absolute;
  z-index: 6;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 17px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.p-osd.on {
  opacity: 1;
}

/* ---------- desktop with a mouse (T10 U2) ----------
   Everything here waits for (hover: hover) and (pointer: fine), so phones and tablets keep their
   touch layout: arrows on rows, a hover card on posters, more posters across wide screens */
.row-body {
  position: relative;
}
.row-arrow,
.hover-card {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .row-arrow {
    display: flex;
    position: absolute;
    z-index: 3;
    top: 0;
    height: calc(100% - 4px);
    width: max(44px, var(--pad-l));
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
  }
  .row-body.posters .row-arrow {
    height: calc(var(--row-card) * 1.5);
  }
  .row-arrow.prev {
    left: 0;
    background: linear-gradient(to right, color-mix(in srgb, var(--bg) 92%, transparent), transparent);
  }
  .row-arrow.next {
    right: 0;
    background: linear-gradient(to left, color-mix(in srgb, var(--bg) 92%, transparent), transparent);
  }
  .row-body:hover .row-arrow {
    opacity: 1;
  }
  .row-body .row-arrow.off {
    opacity: 0;
    pointer-events: none;
  }
  .row-arrow .ic {
    width: 40px;
    height: 40px;
    transition: transform 0.15s;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
  }
  .row-arrow:hover .ic {
    transform: scale(1.2);
  }
  .card .card-img img {
    transition: filter 0.2s;
  }
  .card:hover .card-img img {
    filter: brightness(1.12);
  }

  .hover-card {
    display: flex;
    position: fixed;
    z-index: 60;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-2);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line);
    opacity: 0;
    transform: scale(var(--from, 0.9));
    transition: opacity 0.18s, transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .hover-card.flip {
    flex-direction: row-reverse;
  }
  .hover-card.open {
    opacity: 1;
    transform: none;
  }
  .hc-media {
    position: relative;
    flex: none;
    width: var(--pw);
    height: 100%;
    background: var(--bg-3);
    cursor: pointer;
  }
  .hc-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .hc-media .badge-new {
    top: 10px;
    left: 10px;
  }
  .hc-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 16px 16px 14px;
  }
  .hc-btns {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
  }
  .hc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
    transition: box-shadow 0.15s, background 0.15s;
  }
  .hc-btn:hover {
    box-shadow: inset 0 0 0 2px #fff;
    background: rgba(255, 255, 255, 0.12);
  }
  .hc-btn .ic {
    width: 20px;
    height: 20px;
  }
  .hc-btn.play {
    color: #000;
    background: #fff;
    box-shadow: none;
  }
  .hc-btn.play:hover {
    background: #e2e2e2;
  }
  .hc-btn.play[aria-disabled="true"] {
    opacity: 0.5;
  }
  .hc-btn.more {
    margin-left: auto;
  }
  .hc-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hc-meta {
    margin-top: 4px;
    font-size: 12.5px;
  }
  .hc-plot {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: var(--plot-lines, 6);
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hover-card.loading .hc-plot {
    min-height: 3em;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--bg-3), transparent);
    opacity: 0.6;
  }
  body.kids .hc-btn.play {
    background: var(--accent);
    color: var(--accent-fg);
  }
}

/* wider screens with a mouse: more posters across each row (with a peek at the next one) and
   more columns in the grids */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
  :root {
    --row-n: 5.3;
    --row-card: calc((100vw - var(--rail) - var(--pad-l) - var(--pad-r)) / var(--row-n) - var(--gap));
  }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1280px) {
  :root { --row-n: 6.3; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1400px) {
  :root { --row-n: 7.3; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1500px) {
  :root {
    --gutter: 40px;
    --gap: 16px;
    --row-n: 8.3;
  }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1800px) {
  :root {
    --cols: 9;
    --row-n: 9.3;
  }
}
@media (hover: hover) and (pointer: fine) and (min-width: 2200px) {
  :root {
    --cols: 10;
    --row-n: 10.3;
  }
}

/* T59: See all after a row's title, and the genre chips over the Kids browse rows */
.row-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 10px;
  padding: 2px 4px 2px 8px;
  border-radius: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  vertical-align: middle;
}
.row-more svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
@media (hover: hover) {
  .row-more:hover {
    background: var(--bg-3);
  }
}
.browse-chips {
  padding: 0 var(--pad-r) 4px var(--pad-l);
  overflow-x: auto;
  scrollbar-width: none;
}
.browse-chips::-webkit-scrollbar {
  display: none;
}
/* T60: the grid's filter bar (two lines on a phone); a set filter is filled in */
.filter-bar {
  flex-wrap: wrap;
  gap: 8px;
}
.filter-bar .select {
  max-width: 46vw;
  border-color: rgba(255, 255, 255, 0.22);
  font-weight: 600;
}
.filter-bar .select.on {
  background: #fff;
  border-color: #fff;
  color: #000;
}
body.kids .filter-bar .select.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.filter-clear {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: var(--bg-3);
  color: var(--muted);
}
.filter-clear .ic {
  width: 18px;
  height: 18px;
}
/* Kids: big posters, about two and a bit across a phone and fewer across a desktop */
body.kids {
  --row-card: min(220px, calc((100vw - var(--rail) - var(--pad-l) - var(--pad-r) - var(--gap)) / 2.3));
}
body.kids .grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px var(--gap);
}
body.kids .card-title {
  font-size: 15px;
}
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
  body.kids {
    --row-card: calc((100vw - var(--rail) - var(--pad-l) - var(--pad-r)) / (var(--row-n) - 1.5) - var(--gap));
  }
  body.kids .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

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

/* ---------- profile icons, PINs, profile page, history (phase 4) ---------- */
.avatar-icon {
  position: absolute;
  top: 14%;
  left: 14%;
  width: 72%;
  height: 72%;
  -webkit-user-drag: none;
  pointer-events: none;
}
.plock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.plock .ic {
  width: 13px;
  height: 13px;
}
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 10px;
}
.icon-choice {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.icon-choice img {
  position: absolute;
  top: 14%;
  left: 14%;
  width: 72%;
  height: 72%;
  pointer-events: none;
}
.icon-choice.active {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px #fff;
}
.form-note {
  margin: 6px 0 4px;
  color: var(--muted);
  font-size: 13.5px;
}
.pin-input {
  margin-top: 8px;
  letter-spacing: 6px;
  font-variant-numeric: tabular-nums;
}
.pin-input::placeholder {
  letter-spacing: normal;
}
.pin-hint {
  margin-top: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.pin-msg {
  min-height: 20px;
  margin: -12px 0 12px;
  text-align: center;
  color: #ff8a80;
  font-size: 14px;
}
.keypad.locked {
  opacity: 0.35;
  pointer-events: none;
}
.btn.danger {
  background: #e50914;
  color: #fff;
}
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.link-btn {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 0;
}

.view.me {
  padding-left: var(--pad-l);
  padding-right: var(--pad-r);
}
.me .section-title {
  padding-left: 0;
  padding-right: 0;
}
.me-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 18px;
}
.avatar.big {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  flex: none;
}
.avatar.big .avatar-letter {
  font-size: 40px;
}
.me-name h1 {
  font-size: 26px;
  font-weight: 800;
}
.me-sub {
  color: var(--muted);
  font-size: 13.5px;
}
.me-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.me-actions .btn {
  flex: 1 1 140px;
}
/* B4: the profile's Notifications switch on this device */
.me-notify {
  margin: 18px 0 4px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.notify-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.playback-setting + .playback-setting {
  margin-top: 14px;
}
.notify-text {
  flex: 1;
  min-width: 0;
}
.notify-title {
  font-weight: 700;
  font-size: 16px;
}
.notify-sub {
  color: var(--muted);
  font-size: 13.5px;
}
.notify-hint {
  margin-top: 10px;
}
.notify-test {
  margin-top: 6px;
  padding-bottom: 0;
}
.switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  border-radius: 16px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  transition: background 0.2s;
}
.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s;
}
.switch.on {
  background: var(--brand);
}
.switch.on .switch-knob {
  transform: translateX(20px);
}
.switch:disabled {
  opacity: 0.45;
}
.switch:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.me-hist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.history {
  display: flex;
  flex-direction: column;
}
.hist-row {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  max-height: 140px;
  transition: max-height 0.22s ease, opacity 0.22s ease;
}
.hist-row.removing {
  max-height: 0;
  opacity: 0;
  border-bottom-width: 0;
}
.hist-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-right: 18px;
  background: #b20710;
  color: #fff;
  font-weight: 700;
}
.hist {
  position: relative;
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  text-align: left;
  background: var(--bg);
  touch-action: pan-y;
  transition: transform 0.2s ease;
  -webkit-touch-callout: none;
}
.hist-row.dragging .hist {
  transition: none;
}
.hist-poster {
  position: relative;
  width: 56px;
  aspect-ratio: 2 / 3;
  flex: none;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-3);
}
.hist-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hist-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.hist-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-when {
  font-size: 12.5px;
  color: var(--dim);
}
.hist-info .progress {
  margin-top: 4px;
  max-width: 220px;
}
.hist-done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: #69f0ae;
  font-size: 12.5px;
  font-weight: 700;
}
body.kids .hist-done {
  color: var(--accent);
}
.hist-done .ic {
  width: 15px;
  height: 15px;
}

/* player: audio track menu */
.p-menu {
  position: absolute;
  z-index: 6;
  top: calc(var(--sat) + 58px);
  right: max(12px, var(--sar));
  min-width: 220px;
  max-width: calc(100% - 24px);
  max-height: 60%;
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: rgba(22, 22, 29, 0.97);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.p-sleep-menu .btn {
  display: block;
  width: 100%;
  text-align: left;
}
.p-sleep-menu .btn[aria-pressed="true"] {
  background: var(--accent);
  color: #101015;
}
.p-menu-title {
  padding: 8px 10px 6px;
  color: #9a9aa3;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.p-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px 0 6px;
  border-radius: 10px;
  text-align: left;
  font-weight: 600;
}
.p-menu-item:active,
.p-menu-item.on {
  background: rgba(255, 255, 255, 0.08);
}
.p-menu-check {
  display: inline-flex;
  width: 22px;
}
.p-menu-check .ic {
  width: 20px;
  height: 20px;
}
/* F19: the Chapters menu: the name, then where it starts */
.p-chapters-menu {
  min-width: 260px;
  max-width: min(420px, calc(100% - 24px));
}
.p-menu-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-menu-time {
  flex: none;
  padding-left: 12px;
  color: #9a9aa3;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
/* F23: the end-of-film box has up to three buttons: they wrap onto a second line */
.p-film-end {
  width: min(460px, calc(100% - 32px));
}
.p-film-end .btns {
  flex-wrap: wrap;
}
.p-film-end .btn {
  flex: 1 1 auto;
}
/* N2: "This series only" closes an episode's audio and subtitle menus */
.p-menu-series {
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 10px 10px;
}
.p-menu-series.on {
  background: none;
}

/* ---------- phase 5: no free account (J4), follow (K5), subtitles (K2) ---------- */
.needs-slot[aria-disabled="true"] {
  opacity: 0.45;
  filter: grayscale(1);
}
.ep.needs-slot[aria-disabled="true"] {
  opacity: 0.6;
}
.follow-btn.on {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5);
}
.follow-btn:disabled {
  opacity: 0.6;
}
.badge-new {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--brand);
  color: #111;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.my-stuff-playlists {
  max-width: 420px;
  padding: 0 var(--pad-r) 20px var(--pad-l);
}
.p-subs {
  position: absolute;
  z-index: 2;
  left: 5%;
  right: 5%;
  bottom: 8%;
  text-align: center;
  pointer-events: none;
  transition: bottom 0.25s;
}
.p-subs span {
  display: inline;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: clamp(16px, 4.4vmin, 34px);
  font-weight: 600;
  line-height: 1.45;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
[data-caption-size="small"].p-subs span { font-size: clamp(13px, 3.3vmin, 26px); }
[data-caption-size="large"].p-subs span { font-size: clamp(20px, 5.4vmin, 44px); }
[data-caption-contrast="yellow"].p-subs span { color: #fff275; }
[data-caption-background="clear"].p-subs span { background: transparent; }
[data-caption-background="solid"].p-subs span { background: #000; }
/* above our controls when they show; above the native bar in HLS mode */
.player.custom:not(.ui-off) .p-subs {
  bottom: calc(var(--sab) + 96px);
}
.player.native .p-subs {
  bottom: 64px;
}
/* O2: My List toggle on details */
.mylist-btn.on {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5);
}
.mylist-btn:disabled {
  opacity: 0.6;
}

/* ---------- H6: cast strip, people, person page ---------- */
.d-related {
  margin: 8px calc(-1 * var(--pad-r)) 0 calc(-1 * var(--pad-l));
}
.person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 84px;
  flex: none;
  text-align: center;
}
.face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  box-shadow: inset 0 0 0 1px var(--line);
}
.face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.face img:not(.ok) {
  opacity: 0;
}
.face-initials {
  font-weight: 800;
  font-size: 22px;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.face.big {
  width: 96px;
  height: 96px;
  flex: none;
}
.face.big .face-initials {
  font-size: 32px;
}
.person-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.person-sub {
  font-size: 11.5px;
  color: var(--dim);
}
.person:active .face {
  transform: scale(0.95);
}
.people-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 var(--pad-r) 4px var(--pad-l);
  scrollbar-width: none;
}
.people-list::-webkit-scrollbar {
  display: none;
}
.person-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px var(--pad-r) 8px var(--pad-l);
}
.person-head h1 {
  font-size: 26px;
  font-weight: 800;
}

.parent-pin {
  margin-top: 12px;
}
.parent-pin .form-note {
  margin-bottom: 8px;
}

/* ---------- My account (T10): admin logins, from the Account links ---------- */
/* reached from Who's watching too, before a profile is chosen: the top bar (with Back) shows alone */
body.no-profile.sub #topbar {
  display: flex;
  left: 0;
}
/* Admin keeps the rail before a profile is chosen, so the top bar starts after it */
body.no-profile.admin-page #topbar {
  left: var(--rail);
}
body.no-profile #profileBtn {
  display: none;
}
.rail-link.active {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
}
.view.account {
  max-width: 980px;
}
body.no-profile .view.account {
  margin: 0 auto;
}
.account-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
}
.account-mark svg {
  width: 62%;
  height: 62%;
  fill: var(--muted);
}
.account-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (min-width: 900px) {
  .account-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.account-body > .msg,
.account-body > .spinner {
  grid-column: 1 / -1;
}
.account-card {
  padding: 4px 22px 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.account-card > .form-note {
  margin-bottom: 4px;
}
.account-form {
  max-width: none;
  margin: 0;
}
.account-form .text-input {
  margin-bottom: 0;
}
.account-form .form-label {
  display: block;
}
.account-form .form-note {
  margin-top: 8px;
}
.account-devices {
  list-style: none;
  margin: 0;
  padding: 0;
}
.account-device {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.account-device:last-child {
  border-bottom: 0;
}
.account-device-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.account-this {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1;
}
.account-device-when {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- a channel's guide and catch-up (T10 U4) ---------- */
.ch-item {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto 80px;
}
.ch-item > .ch {
  flex: 1;
  min-width: 0;
  border-bottom: 0;
  content-visibility: visible;
}
.ch-guide {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 56px;
  min-height: 56px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.ch-guide:active {
  background: rgba(255, 255, 255, 0.08);
}
.ch-catchup {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--catchup);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  vertical-align: 1px;
}
.g-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  max-width: 1000px;
  padding: 6px var(--pad-r) 8px var(--pad-l);
}
.ch-logo.g-logo {
  width: 84px;
  height: 63px;
}
.g-head-main {
  flex: 1 1 180px;
  min-width: 0;
}
.g-name {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}
.g-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}
.g-note:empty {
  display: none;
}
.g-note.none {
  color: var(--dim);
}
.g-elsewhere:empty {
  display: none;
}
.g-elsewhere-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: rgba(37, 99, 235, 0.18);
  color: #9ec0ff;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.g-elsewhere-link .ic {
  flex: none;
  width: 18px;
  height: 18px;
}
.g-elsewhere-link:active {
  background: rgba(37, 99, 235, 0.3);
}
.g-head-btns {
  flex: none;
}
@media (max-width: 599px) {
  .g-head-btns,
  .g-head-btns .btn {
    width: 100%;
  }
}
.g-bar {
  padding-top: 6px;
}
.g-list {
  max-width: 1000px;
  padding: 0 var(--pad-r) 32px var(--pad-l);
}
.g-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}
.g-row-head {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 8px;
  text-align: left;
  border-radius: var(--radius);
}
.g-row-head:active {
  background: rgba(255, 255, 255, 0.05);
}
.g-time {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 48px;
  font-variant-numeric: tabular-nums;
}
.g-start {
  font-weight: 700;
}
.g-end {
  color: var(--dim);
  font-size: 12.5px;
}
.g-main {
  flex: 1;
  min-width: 0;
}
.g-title {
  font-weight: 700;
  line-height: 1.3;
}
.g-title .live-badge {
  vertical-align: 1px;
}
.g-desc {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.g-row.past .g-start,
.g-row.past .g-title {
  color: var(--muted);
}
.g-row.now {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 3px 0 0 var(--accent);
}
.g-row.now .progress {
  height: 3px;
  max-width: 280px;
  margin: 7px 0 2px;
}
.g-play {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: 2px;
  border-radius: 50%;
  background: var(--catchup);
  color: #fff;
}
.g-play .ic {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}
.g-play:active {
  filter: brightness(1.2);
}
/* a programme's sheet */
.g-sheet-when {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.g-sheet-desc {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.45;
}
.g-why {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.g-sheet .g-elsewhere-link {
  margin-top: 10px;
}
.g-sheet-actions {
  flex-direction: column;
}
@media (min-width: 600px) {
  .g-sheet-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
.catchup-badge {
  background: var(--catchup);
}
@media (hover: hover) and (pointer: fine) {
  .ch-guide:hover {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.08);
  }
  .g-row-head:hover {
    background: rgba(255, 255, 255, 0.05);
  }
  .g-play:hover {
    filter: brightness(1.2);
  }
  .g-elsewhere-link:hover {
    background: rgba(37, 99, 235, 0.3);
  }
}

/* ---------- My downloads (T12): #/downloads, rows like the watch history ---------- */
.view.mydl {
  max-width: 980px;
}
.mydl-banner {
  margin: 0 0 6px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgba(229, 160, 13, 0.16);
  color: #ffd54f;
  font-size: 14px;
}
.mydl .form-note {
  margin: 0 0 6px;
}
.mydl-note {
  margin-top: 8px !important;
}
.mydl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.mydl-row .hist {
  flex: 1;
  min-width: 0;
  background: none;
}
.mydl-row.child .hist {
  padding: 8px 0 8px 68px;
}
.mydl-row.group .hist-title {
  white-space: normal;
}
.mydl-row .hist-sub {
  white-space: normal;
}
.mydl-row.downloading .hist-sub {
  color: var(--fg);
}
.mydl-row.paused .hist-sub {
  color: #ffd54f;
}
.mydl-row.failed .hist-sub {
  color: #ff6b6b;
}
.mydl-row.in-plex .hist-sub {
  color: #e5a00d;
  font-weight: 700;
}
.mydl-row .hist-info .progress {
  max-width: 320px;
}
.mydl-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex: none;
}
.btn.sm {
  min-height: 34px;
  padding: 0 12px;
  gap: 6px;
  font-size: 13.5px;
}
.btn.sm .ic {
  width: 16px;
  height: 16px;
}
.mydl-state {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  height: 24px;
  margin-top: 4px;
  padding: 0 10px;
  font-size: 12px;
}
.mydl-state.on {
  background: rgba(229, 160, 13, 0.2);
  color: #e5a00d;
}
.mydl-state.paused {
  color: #ffd54f;
}
@media (hover: hover) {
  .mydl-main:hover .hist-title {
    text-decoration: underline;
  }
}
/* phones: the buttons go under the title, beside where the poster ends */
@media (max-width: 520px) {
  .mydl-row {
    flex-wrap: wrap;
    gap: 0;
  }
  .mydl-row .hist {
    flex-basis: 100%;
  }
  .mydl-row.child .hist {
    padding-left: 20px;
  }
  .mydl-actions {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    margin: -4px 0 10px 68px;
  }
  .mydl-row.child .mydl-actions {
    margin-left: 20px;
  }
}

/* ---------- Live TV favourites and recently watched (B6) ---------- */
.ch-star {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 56px;
  border-radius: var(--radius);
  color: var(--dim);
}
.ch-star.on {
  color: var(--star, #ffc107);
}
.ch-star:active {
  background: rgba(255, 255, 255, 0.08);
}
.ch-star:disabled {
  opacity: 0.6;
}
.live-sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: var(--pad-r);
}
.live-sec-head .row-title {
  flex: 1;
  padding-bottom: 0;
}
.live-favs {
  margin-bottom: 6px;
}
.live-favs .list {
  margin-top: 4px;
}
/* reordering reads top to bottom: one column, even where channels sit in two */
.live-favs .list.fav-editing {
  display: flex;
  flex-direction: column;
  max-width: 760px;
}
.live-sec-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px var(--pad-r) 4px var(--pad-l);
  color: var(--muted);
  font-size: 14px;
}
.live-sec-hint .ic {
  width: 18px;
  height: 18px;
}
.live-all-title {
  margin-top: 18px;
}
.live-chips {
  contain-intrinsic-size: auto 90px;
}
.live-chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 220px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--bg-2);
  text-align: left;
  scroll-snap-align: start;
}
.live-chip:active {
  background: var(--bg-3);
}
.live-chip .ch-logo {
  width: 56px;
  height: 42px;
}
.lc-main {
  flex: 1;
  min-width: 0;
}
.lc-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-now {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-now:empty {
  display: none;
}
.fav-edit {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.fav-edit .ch-logo {
  width: 56px;
  height: 42px;
}
.fav-edit .ch-name {
  flex: 1;
  min-width: 0;
}
.fav-grip {
  display: none;
  color: var(--dim);
  cursor: grab;
}
.fav-move {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: var(--fg);
  background: var(--bg-3);
}
.fav-move:disabled {
  opacity: 0.3;
}
.fav-edit.dragging {
  opacity: 0.4;
}
.fav-edit.drop-before {
  box-shadow: inset 0 2px 0 var(--accent);
}
.fav-edit.drop-after {
  box-shadow: inset 0 -2px 0 var(--accent);
}
@media (hover: hover) and (pointer: fine) {
  .fav-grip {
    display: flex;
  }
  .fav-edit {
    cursor: grab;
  }
  .ch-star:hover {
    color: var(--star, #ffc107);
    background: rgba(255, 255, 255, 0.08);
  }
  .live-chip:hover {
    background: var(--bg-3);
  }
  .fav-move:not(:disabled):hover {
    filter: brightness(1.3);
  }
}

/* ---------- Admin in the app (B7): #/admin, admin logins on a wide screen with a mouse ---------- */
.view.admin {
  padding-top: calc(var(--top-h) + var(--sat) + 4px);
}
.adm {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 36px;
  max-width: 1440px;
  padding: 8px var(--pad-r) 48px var(--pad-l);
}
.adm-nav {
  position: sticky;
  top: calc(var(--top-h) + var(--sat) + 12px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adm-nav-title {
  padding: 14px 12px 10px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.adm-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
}
.adm-nav-link .ic {
  width: 20px;
  height: 20px;
}
.adm-nav-link:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
}
.adm-nav-link.active {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
}
.adm-main {
  min-width: 0;
}
.adm-head {
  margin: 8px 0 20px;
}
.adm-head h1 {
  font-size: 26px;
  font-weight: 800;
}
.adm-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13.5px;
}
.adm-sub.bad,
.adm-fact-value.bad {
  color: #ff8a80;
}
.adm-h2 {
  margin: 32px 0 12px;
  font-size: 18px;
  font-weight: 700;
}
.adm-card {
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.adm-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.adm-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
}
.adm-card-title .ic {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.adm-more {
  flex: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.adm-more:hover {
  color: var(--fg);
}
.adm-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.adm-note.dim {
  color: var(--dim);
}
.adm-empty {
  padding: 4px 0;
  color: var(--muted);
}
/* needs attention */
.adm-allgood {
  display: flex;
  align-items: center;
  gap: 16px;
}
.adm-allgood-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  color: #66bb6a;
  background: rgba(102, 187, 106, 0.14);
}
.adm-allgood-title {
  font-size: 16px;
  font-weight: 700;
}
.adm-allgood .adm-note {
  margin-top: 2px;
}
.adm-attention.bad {
  border-color: rgba(255, 82, 82, 0.35);
}
.adm-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--bg-3);
  font-size: 12.5px;
  font-weight: 700;
}
.adm-alerts,
.adm-streams {
  list-style: none;
  margin: 0;
  padding: 0;
}
.adm-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.adm-alert:first-child {
  border-top: 0;
}
.adm-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  flex: none;
  border-radius: 50%;
  background: #ffb74d;
}
.adm-alert.bad .adm-dot {
  background: #ff5252;
}
.adm-alert-text {
  flex: 1;
  min-width: 0;
}
.adm-alert-title {
  font-weight: 700;
}
.adm-alert-detail {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
/* happening now */
.adm-now {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.adm-now .adm-wide {
  grid-column: 1 / -1;
}
.adm-fact {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.adm-fact:last-child {
  border-bottom: 0;
}
.adm-fact-label {
  flex: none;
  color: var(--muted);
}
.adm-fact-value {
  min-width: 0;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}
.adm-fact-value.dim {
  color: var(--dim);
}
.adm-stream {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.adm-stream:last-child {
  border-bottom: 0;
}
.adm-stream.stale {
  opacity: 0.6;
}
.adm-stream-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.adm-stream-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13.5px;
}
.adm-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}
.adm-card-foot {
  margin-top: 6px;
  border-top: 1px solid var(--line);
}
.adm-card-foot .adm-fact {
  padding-bottom: 0;
}
.adm-dl-title {
  margin: 4px 0 10px;
  font-weight: 700;
}
/* Admin > Downloads (B7 A5) */
.adm-tag.good {
  background: rgba(102, 187, 106, 0.16);
  color: #81c784;
}
.adm-tag.warn {
  background: rgba(255, 183, 77, 0.16);
  color: #ffb74d;
}
.adm-tag.bad {
  background: rgba(255, 82, 82, 0.16);
  color: #ff8a80;
}
.adm-tag.info {
  background: rgba(100, 160, 255, 0.16);
  color: #90caf9;
}
.adm-note.bad,
.adm-dl-meta.bad {
  color: #ff8a80;
}
.adm-dl-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;
}
.adm-dl-head .adm-sub {
  grid-column: 1;
}
.adm-dl-head-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.adm-dl {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.adm-dl > .adm-slot:empty {
  display: none;
}
.adm-dl-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.adm-dl-off {
  border-color: rgba(255, 183, 77, 0.35);
}
.adm-dl-off .adm-note {
  margin-top: 4px;
}
.adm-dl-count {
  color: var(--dim);
  font-weight: 600;
}
.adm-dl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.btn.adm-dl-quiet {
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn.adm-dl-quiet:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
}
.adm-dl-now-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 6px 0 12px;
  font-size: 17px;
  font-weight: 700;
}
.adm-dl-who {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}
.adm-dl-now .progress {
  height: 6px;
  border-radius: 3px;
}
.adm-dl-num {
  font-variant-numeric: tabular-nums;
}
.adm-dl-rules {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}
.adm-dl-rules li + li {
  margin-top: 6px;
}
.adm-dl-diskrow + .adm-dl-diskrow {
  margin-top: 12px;
}
.adm-dl-diskrow .adm-fact {
  border-bottom: 0;
  padding-bottom: 6px;
}
.adm-dl-diskrow .adm-fact-label strong {
  color: var(--fg);
}
.progress.adm-dl-disk {
  height: 6px;
  border-radius: 3px;
}
.progress.adm-dl-disk i {
  background: #66bb6a;
}
.progress.adm-dl-disk.low i {
  background: #ff5252;
}
.adm-dl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
}
.adm-dl-chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.adm-dl-chip:hover {
  color: var(--fg);
}
.adm-dl-chip.on {
  background: var(--fg);
  color: #000;
  box-shadow: none;
}
.adm-dl-th,
.adm-dl-tr {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.adm-dl-th span:first-child,
.adm-dl-tr span:first-child {
  text-align: left;
}
.adm-dl-th {
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.adm-dl-tr {
  border-radius: 8px;
}
.adm-dl-tr:hover {
  background: rgba(255, 255, 255, 0.04);
}
.adm-dl-tr.on {
  background: rgba(255, 255, 255, 0.08);
}
.adm-dl-login {
  font-weight: 700;
}
.adm-dl-link {
  color: var(--fg);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.adm-dl-list {
  display: flex;
  flex-direction: column;
}
.adm-dl-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px 170px 230px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.adm-dl-list > .adm-dl-item:first-child,
.adm-dl-list > .adm-dl-group:first-child > .adm-dl-item:first-child {
  border-top: 0;
}
.adm-dl-item.child {
  padding-left: 22px;
}
.adm-dl-grouphead .adm-dl-name {
  font-weight: 800;
}
.adm-dl-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}
a.adm-dl-name:hover {
  text-decoration: underline;
}
.adm-dl-item.child .adm-dl-name {
  font-weight: 600;
}
.adm-dl-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.adm-dl-whocol {
  margin-top: 0;
}
.adm-dl-more {
  margin: 4px 0 6px 22px;
  font-size: 13.5px;
  align-self: flex-start;
}
.adm-dl-group {
  display: flex;
  flex-direction: column;
}
.adm-dl-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.adm-dl-pager .adm-note {
  margin: 0;
}
.adm-dl-show {
  grid-template-columns: 44px minmax(0, 1fr) 150px 210px 300px;
}
.adm-dl-poster {
  position: relative;
  width: 44px;
  aspect-ratio: 2 / 3;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg-3);
}
.adm-dl-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.adm-dl-poster .card-ph {
  font-size: 8px;
}
@media (max-width: 1279px) {
  .adm-dl-item {
    grid-template-columns: minmax(0, 1fr) 170px 230px;
  }
  .adm-dl-item .adm-dl-whocol {
    display: none;
  }
  .adm-dl-show {
    grid-template-columns: 44px minmax(0, 1fr) 140px 230px;
  }
}
/* Admin > Catalogue & Plex and System (B7 A6) */
.adm-h3 {
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.adm-card .adm-table.adm-ktable {
  font-size: 13.5px;
}
.adm-ktable th {
  padding: 6px 12px 6px 0;
}
.adm-ktable td {
  padding: 8px 12px 8px 0;
  vertical-align: top;
}
.adm-card .adm-ktable th:first-child,
.adm-card .adm-ktable td:first-child {
  padding-left: 0;
}
.adm-cat-refresh .adm-ktable th:not(:first-child),
.adm-cat-refresh .adm-ktable td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.adm-cat-refresh .adm-ktable td:first-child {
  font-weight: 600;
}
.adm-ktable tr.adm-kminor td {
  color: var(--muted);
}
.adm-ktable tr.adm-kminor td:first-child {
  font-weight: 400;
}
.adm-ktable td.adm-kgood {
  color: #81c784;
}
.adm-ktable td.adm-kwarn {
  color: #ffb74d;
}
.adm-ktable .adm-knowrap {
  white-space: nowrap;
}
.adm-ktable .adm-kdim {
  color: var(--dim);
}
.adm-kstreak {
  margin-left: 6px;
  color: var(--dim);
  font-size: 12px;
}
.adm-cat-running {
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.adm-cat-running .progress {
  height: 6px;
  margin: 10px 0 0;
  border-radius: 3px;
}
.adm-cat-done {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.adm-cat-done .adm-fact {
  border-bottom: 0;
}
.adm-cat-done .progress {
  height: 6px;
  border-radius: 3px;
}
.adm-cat-done .progress i {
  background: #66bb6a;
}
.adm-cat-counts {
  margin-top: 14px;
}
.adm-sys-files {
  margin-top: 2px;
}
/* the sections */
.adm-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.adm-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.adm-link:hover {
  background: var(--bg-3);
}
.adm-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  color: var(--muted);
  background: var(--bg-3);
}
.adm-link-icon .ic {
  width: 20px;
  height: 20px;
}
.adm-link-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.adm-link-label {
  font-size: 15px;
  font-weight: 700;
}
@media (max-width: 1279px) {
  .adm-now,
  .adm-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* ---------- Admin > Accounts & connections (B7 A4): provider accounts, Now, Overview, History, the VPN ---------- */
.adm-tabs {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  border-bottom: 1px solid var(--line);
}
.adm-tab {
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
}
.adm-tab:hover {
  color: var(--fg);
}
.adm-tab.active {
  color: var(--fg);
  border-bottom-color: var(--brand);
}
.adm-acc,
.adm-cx {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.adm-toolbar.adm-acc-toolbar {
  margin-bottom: 0;
}
.adm-acc > .adm-slot:empty,
.adm-cx > .adm-slot:empty {
  display: none;
}
.adm-acc-summary {
  margin: 0;
  font-size: 14px;
}
.adm-acc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.adm-acc-card {
  display: flex;
  flex-direction: column;
}
.adm-acc-card.off {
  opacity: 0.75;
}
.adm-acc-card.bad {
  border-color: rgba(255, 82, 82, 0.35);
}
.adm-acc-card.editing {
  border-color: rgba(255, 255, 255, 0.25);
}
.adm-acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.adm-acc-name {
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.adm-acc-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  font-size: 14.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.adm-acc-dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--dim);
}
.adm-acc-status.good .adm-acc-dot {
  background: #66bb6a;
}
.adm-acc-status.warn .adm-acc-dot {
  background: #ffb74d;
}
.adm-acc-status.bad {
  color: #ff8a80;
}
.adm-acc-status.bad .adm-acc-dot {
  background: #ff5252;
}
.adm-acc-status.dim {
  color: var(--muted);
}
.adm-acc-streams {
  margin-top: 6px;
  padding-left: 17px;
}
.adm-acc-facts {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}
.adm-acc-facts .adm-fact {
  padding: 7px 0;
  font-size: 13.5px;
}
.adm-acc-when {
  color: var(--muted);
  font-weight: 500;
}
.adm-acc-foot {
  margin-top: auto;
  padding-top: 12px;
}
.adm-acc-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.adm-acc-actions-end {
  display: flex;
  gap: 8px;
}
.adm-acc-spacer {
  flex: 1;
}
.adm-acc-confirm {
  margin-top: 12px;
}
.adm-acc-confirm .adm-note {
  margin: 4px 0 8px;
}
.adm-acc-form .adm-acc-head {
  margin-bottom: 4px;
}
.adm-acc-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.adm-acc-field .form-label {
  display: block;
  margin: 12px 0 6px;
}
.adm-acc-form .adm-check {
  margin-top: 12px;
}
.adm-acc-form .form-error:empty {
  margin: 4px 0;
}
.adm-acc-add {
  max-width: 820px;
}
/* the VPN */
.adm-vpn-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
}
.segmented.adm-vpn-modes,
.segmented.adm-cx-window {
  margin: 0;
}
.adm-vpn-modes .seg,
.adm-cx-window .seg {
  flex: none;
  min-width: 96px;
  padding: 0 14px;
}
.adm-vpn-state {
  display: flex;
  align-items: center;
  gap: 10px;
}
.adm-vpn-since {
  margin: 0;
}
.adm-vpn-actions {
  margin-top: 12px;
}
.adm-vpn-test {
  margin: 0;
}
.adm-vpn-test.good {
  color: #81c784;
}
.adm-vpn-test.bad {
  color: #ff8a80;
}
.adm-vpn-remembered {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.adm-vpn-sub {
  font-size: 13.5px;
  font-weight: 700;
}
.adm-vpn-traffic {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.adm-vpn-traffic-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.adm-vpn-traffic-chip {
  display: grid;
  gap: 5px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.adm-vpn-traffic-label {
  color: var(--muted);
  font-size: 13.5px;
}
.adm-vpn-traffic-values {
  font-size: 13.5px;
  font-weight: 700;
}
.adm-vpn-titles {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.adm-vpn-titles li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.adm-vpn-titles li:first-child {
  border-top: 0;
}
/* Now, Overview and History */
.adm-cx-off {
  border-color: rgba(255, 183, 77, 0.35);
}
.adm-cx-off .adm-note {
  margin: 0;
}
.adm-cx-two {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
}
.adm-cx-tablehead {
  padding: 10px 22px 0;
}
.adm-cx-tablehead .adm-note {
  margin: 0;
}
.adm-cx-pad {
  padding: 4px 22px 12px;
}
.adm-cx-use {
  white-space: nowrap;
}
.progress.adm-cx-bar {
  display: inline-block;
  width: 90px;
  height: 6px;
  margin-right: 10px;
  border-radius: 3px;
  vertical-align: middle;
}
.progress.adm-cx-bar i {
  background: #66bb6a;
}
.adm-cx-err {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}
.adm-toolbar.adm-cx-toolbar {
  flex-wrap: wrap;
  margin-bottom: 0;
}
.adm-cx-toolbar .adm-note {
  margin: 0;
}
.adm-select.adm-cx-account {
  width: auto;
  min-width: 200px;
}
.adm-cx-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.adm-cx-tile {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.adm-cx-tile-value {
  overflow: hidden;
  font-size: 22px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-cx-tile-label {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}
.adm-cx-coverage {
  margin: 0;
  color: #ffb74d;
}
.adm-cx-scroll {
  overflow-x: auto;
}
.adm-cx-table td,
.adm-cx-table th {
  white-space: nowrap;
}
.adm-table.adm-cx-table td:not(:first-child),
.adm-table.adm-cx-table th:not(:first-child) {
  padding-left: 8px;
  padding-right: 8px;
}
.adm-sort button {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.adm-sort.on,
.adm-sort button:hover {
  color: var(--fg);
}
.adm-warn-text {
  color: #ffb74d;
}
.adm-heat {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 6px 12px;
  align-items: center;
}
.adm-heat-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-heat-label:hover {
  color: var(--fg);
}
.adm-heat-row {
  display: flex;
  gap: 1px;
  height: 22px;
}
.adm-heat-cell {
  display: inline-block;
  flex: 1;
  min-width: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
}
.adm-heat-cell.used {
  background: #43a047;
}
.adm-heat-cell.used.half {
  opacity: 0.5;
}
.adm-heat-cell.down {
  background: rgba(255, 82, 82, 0.6);
}
.adm-heat-cell.nodata {
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 5px);
}
.adm-heat-axis {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 12px;
}
.adm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12.5px;
}
.adm-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.adm-legend .adm-heat-cell,
.adm-tl-key {
  display: inline-block;
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}
.adm-tl {
  position: relative;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  overflow: hidden;
}
.adm-tl-seg {
  position: absolute;
  top: 0;
  bottom: 0;
}
.adm-tl-seg.in_use,
.adm-tl-key.in_use {
  background: #43a047;
}
.adm-tl-seg.idle,
.adm-tl-key.idle {
  background: rgba(255, 255, 255, 0.06);
}
.adm-tl-seg.down,
.adm-tl-key.down {
  background: rgba(255, 82, 82, 0.6);
}
.adm-tl-seg.nodata,
.adm-tl-key.nodata {
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 5px);
}
.adm-tl-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--dim);
  font-size: 12px;
}
@media (max-width: 1180px) {
  .adm-acc-grid,
  .adm-cx-two {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ---------- Admin > Logins & profiles (B7 A2, A3): the list, a login's page, Add a person ---------- */
.adm-crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}
.adm-crumb .ic {
  width: 16px;
  height: 16px;
}
.adm-crumb:hover {
  color: var(--fg);
}
.adm-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.adm-head-badges {
  display: inline-flex;
  gap: 6px;
}
.adm-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 10px;
  background: rgba(255, 182, 39, 0.16);
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 700;
  vertical-align: middle;
}
.adm-head-badges .adm-badge {
  margin-left: 0;
}
.adm-badge.dim {
  background: var(--bg-3);
  color: var(--muted);
}
.adm-tag.bad,
.adm-note.bad {
  color: #ff8a80;
}
.adm-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.adm-dim {
  color: var(--dim);
}
/* the list */
.adm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.adm-search {
  max-width: 360px;
  height: 42px;
  font-size: 15px;
}
.adm-add {
  margin-left: auto;
}
.adm-table-card {
  padding: 6px 0;
}
.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.adm-table th {
  padding: 10px 14px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.adm-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
.adm-table th:first-child,
.adm-table td:first-child {
  padding-left: 22px;
}
.adm-row {
  cursor: pointer;
}
.adm-row:hover td {
  background: rgba(255, 255, 255, 0.03);
}
.adm-login-name {
  font-weight: 700;
}
.adm-login-name:hover {
  text-decoration: underline;
}
.adm-yes {
  display: inline-flex;
  color: #66bb6a;
}
.adm-yes.dim {
  color: var(--dim);
}
.adm-yes .ic {
  width: 18px;
  height: 18px;
}
.adm-no {
  color: var(--dim);
}
.adm-profiles-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.adm-avatars {
  display: inline-flex;
}
.avatar.adm-av {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  margin-left: -4px;
  box-shadow: 0 0 0 2px var(--bg-2);
}
.avatar.adm-av:first-child {
  margin-left: 0;
}
.avatar.adm-av .avatar-letter {
  font-size: 12px;
}
.adm-av-more {
  margin-left: 6px;
  color: var(--dim);
  font-size: 12px;
}
/* a login's page */
.adm-login {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.adm-login .adm-slot:empty {
  display: none;
}
.adm-login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.adm-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.adm-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  border-color: rgba(255, 183, 77, 0.35);
}
.adm-hint .adm-dot {
  margin-top: 0;
}
.adm-note-top {
  margin: 0 0 6px;
}
.adm-toggles {
  display: flex;
  flex-direction: column;
}
.adm-toggle {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.adm-toggle:first-child {
  border-top: 0;
}
.adm-toggle-text {
  flex: 1;
  min-width: 0;
}
.adm-toggle-label {
  font-weight: 600;
}
.adm-toggle-hint {
  margin-top: 1px;
  color: var(--muted);
  font-size: 13px;
}
.adm-checks {
  display: flex;
  flex-direction: column;
}
.adm-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.adm-check:first-child {
  border-top: 0;
}
.adm-check input {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--brand);
  cursor: pointer;
}
.adm-check-label {
  font-weight: 600;
}
.adm-check-extra {
  margin-left: auto;
  color: var(--dim);
  font-size: 13px;
}
.adm-form {
  display: flex;
  flex-direction: column;
}
.adm-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.adm-card .text-input {
  height: 42px;
  font-size: 15px;
}
.adm-form .form-error {
  min-height: 0;
  margin: 8px 0;
}
.adm-form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.adm-devices {
  list-style: none;
  margin: 0;
  padding: 0;
}
.adm-device {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.adm-device:first-child {
  border-top: 0;
}
.adm-device-text {
  flex: 1;
  min-width: 0;
}
.adm-device-name {
  font-weight: 600;
}
.adm-device-sub {
  margin-top: 1px;
  color: var(--muted);
  font-size: 13px;
}
.adm-confirm-slot {
  flex: none;
}
.adm-confirm {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.adm-confirm-q {
  font-weight: 600;
}
.adm-foot-actions {
  padding-top: 12px;
}
.btn.sm.danger-outline {
  background: transparent;
  border: 1px solid rgba(255, 82, 82, 0.5);
  color: #ff8a80;
}
.btn.sm.danger-outline:hover {
  background: rgba(255, 82, 82, 0.1);
}
.adm-danger .adm-note {
  margin-bottom: 14px;
}
.adm-inline-confirm {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 82, 82, 0.35);
  background: rgba(255, 82, 82, 0.06);
}
.adm-inline-confirm .adm-confirm-q {
  margin-bottom: 8px;
}
.adm-inline-confirm .adm-form-actions {
  margin-top: 12px;
}
.adm-footprint {
  margin: 4px 0 8px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.6;
}
.avatar.adm-av-md {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.avatar.adm-av-md .avatar-letter {
  font-size: 18px;
}
.adm-pname {
  font-weight: 700;
}
.adm-fresh {
  border-color: rgba(102, 187, 106, 0.4);
}
.adm-fresh .adm-card-title .ic {
  color: #66bb6a;
}
.adm-secret-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.adm-secret-row .text-input.adm-secret {
  max-width: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}
/* the merge dialog */
.sheet.adm-sheet {
  width: 560px;
}
.adm-select {
  height: 42px;
  font-size: 15px;
}
.adm-merge-preview {
  min-height: 60px;
}
.adm-give {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
/* Add a person */
.adm-add-form {
  max-width: 760px;
}
.adm-step {
  display: flex;
  gap: 16px;
  padding: 18px 22px;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.adm-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 800;
}
.adm-step-body {
  flex: 1;
  min-width: 0;
}
.adm-step-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 28px;
}
.adm-step-note {
  margin: 0 0 12px;
}
.adm-step .text-input.adm-name {
  max-width: 320px;
}
.adm-new-profiles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.adm-new-profiles:empty {
  display: none;
}
.adm-new-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 150px 36px;
  align-items: center;
  gap: 10px;
}
.adm-new-profile .pin-input {
  margin-top: 0;
}
.segmented.adm-seg {
  margin: 0;
}
.adm-seg .seg {
  height: 34px;
}
.adm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--muted);
}
.adm-icon-btn:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
}
.adm-icon-btn .ic {
  width: 18px;
  height: 18px;
}
.adm-add-actions {
  padding: 4px 0 0 66px;
}
.adm-add-actions .form-error {
  margin: 0 0 10px;
}
@media (max-width: 1279px) {
  .adm-login-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* a login's profiles (B7 A3) */
.adm-card-head .adm-count {
  margin-left: auto;
}
.adm-profiles {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.adm-profile {
  border-top: 1px solid var(--line);
}
.adm-profile:first-child {
  border-top: 0;
}
.adm-phead {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 0;
  text-align: left;
}
.adm-phead:hover .adm-pchev {
  color: var(--fg);
}
.adm-psum {
  flex: 1;
  min-width: 0;
}
.adm-psum-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.adm-psum-name .adm-pname {
  margin-right: 4px;
}
.adm-psum-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}
.adm-tag .ic {
  width: 12px;
  height: 12px;
  margin-right: 3px;
}
.adm-tag.xxx {
  background: rgba(229, 9, 20, 0.18);
  color: #ff8a80;
}
.adm-tag.dim {
  color: var(--dim);
}
.adm-pchev {
  flex: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  background: var(--bg-3);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.adm-profile.open .adm-pchev {
  color: var(--fg);
}
.adm-peditor {
  margin: 2px 0 14px 50px;
  padding: 4px 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.adm-prow {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.adm-prow:first-child {
  border-top: 0;
}
.adm-prow-label {
  padding-top: 9px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}
.adm-prow-body {
  min-width: 0;
}
.adm-prow .text-input {
  max-width: 260px;
}
.adm-prow .segmented.adm-seg {
  max-width: 220px;
}
.adm-prow .adm-toggle {
  padding: 0;
}
.adm-prow-look .swatches {
  margin-bottom: 12px;
}
.adm-prow-look .icon-grid {
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 8px;
  max-width: 560px;
}
.adm-look-save {
  margin-top: 10px;
}
.adm-look-save:has(> [hidden]:only-child) {
  display: none;
}
.text-input.pin-input.adm-pin {
  width: 130px;
  margin-top: 0;
}
.adm-lockout {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: rgba(255, 183, 77, 0.1);
  color: #ffcc80;
  font-size: 13.5px;
}
.adm-history:empty {
  display: none;
}
.adm-history {
  margin-top: 10px;
}
.adm-hlist {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
  font-size: 13.5px;
}
.adm-hlist li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.adm-hlist li:first-child {
  border-top: 0;
}
.adm-htitle {
  min-width: 0;
  overflow-wrap: anywhere;
}
.adm-select.adm-move {
  max-width: 220px;
}
.adm-padd {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.adm-new-profile.adm-new-profile-one {
  grid-template-columns: minmax(0, 260px) 170px 150px;
}
.adm-padd .adm-note {
  margin: 8px 0 12px;
}
/* Admin > Notifications (B7 A6b) */
.adm-nt {
  align-items: start;
}
.adm-nt .adm-toggle .btn.sm {
  flex: none;
}
.adm-nt .adm-h3:first-of-type {
  margin-top: 10px;
}
.avatar.adm-av-sm {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 7px;
}
.avatar.adm-av-sm .avatar-letter {
  font-size: 14px;
}
.adm-nt-pname {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.adm-nt-devices {
  color: var(--muted);
  font-size: 13px;
}
.adm-nt-devices.dim {
  color: var(--dim);
}
.adm-nt-times {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 4px 0 8px;
}
.adm-nt-times[hidden] {
  display: none;
}
.adm-nt-time {
  width: 150px;
}
.adm-nt .adm-card > .btn.sm {
  margin-top: 4px;
}
@media (max-width: 1100px) {
  .adm-nt {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* System's tables stay inside their card: long messages wrap, anything wider scrolls in the card */
.adm-sys-table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }
.adm-sys-health .adm-ktable td { overflow-wrap: anywhere; }
@media (max-width: 1180px) {
  .adm-sys-two { grid-template-columns: minmax(0, 1fr); }
}

/* Keep an open Admin view readable when its desktop window is narrowed. */
@media (max-width: 767px) {
  .adm { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .adm-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    min-width: 0;
  }
  .adm-nav-title { display: none; }
  .adm-nav-link { flex: none; }
  .adm-dl-two { grid-template-columns: minmax(0, 1fr); }
  .adm-tabs { min-width: 0; overflow-x: auto; }
  .adm-tab { flex: none; }
  .adm-card { min-width: 0; padding: 16px; }
  .adm-card-head, .adm-toolbar { flex-wrap: wrap; }
  .adm-toolbar > .text-input { min-width: 0; max-width: 100%; }
  .adm-card .adm-table { display: block; max-width: 100%; overflow-x: auto; }
  .adm-fact { flex-wrap: wrap; gap: 4px 16px; }
  .adm-fact-value { max-width: 100%; }
}
@media (max-width: 480px) {
  .adm-alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 12px;
  }
  .adm-alert > .adm-more { grid-column: 2; justify-self: start; }
  .adm-alert-title { overflow-wrap: anywhere; }
  .adm-now, .adm-links { grid-template-columns: minmax(0, 1fr); }
  .adm-peditor { margin-left: 0; padding-inline: 12px; }
  .adm-prow { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .adm-prow-label { padding-top: 0; }
  .adm-fact { flex-direction: column; }
  .adm-fact-value { text-align: left; }
}

/* Episode calendar: local air dates for followed and wanted shows (T35). */
.calendar-page { padding: calc(var(--top-h) + 24px) var(--gutter) 32px; }
.calendar-controls { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 24px 0; }
.calendar-controls h2 { font-size: 1.25rem; }
.calendar-day { margin: 24px 0; }
.calendar-day h3 { color: var(--muted); margin-bottom: 10px; }
.calendar-episode { display: grid; gap: 6px; width: 100%; text-align: left; margin: 8px 0; padding: 16px; background: var(--bg-2); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.calendar-episode span { color: var(--muted); }
.calendar-episode:hover, .calendar-episode:focus-visible { border-color: var(--accent); }

@media (max-width: 767px) {
  .calendar-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .calendar-controls h2 {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }
  .calendar-controls .btn { width: 100%; padding-left: 8px; padding-right: 8px; font-size: 14px; }
}
@media (max-width: 360px) {
  #tabbar .tab { font-size: 10px; letter-spacing: -0.1px; }
}

/* Short labels leave breathing room when all seven phone destinations are visible. */
.tab .nav-compact { display: none; }
@media (max-width: 767px) {
  .tab .nav-full { display: none; }
  .tab .nav-compact { display: block; }
}

/* T40: Year in review (#/year) */
.yr {
  max-width: 1120px;
  margin: 0 auto;
  padding-bottom: 32px;
}
.yr-hero {
  padding: 12px 0 8px;
}
.yr-year {
  display: inline-block;
  font-size: clamp(72px, 18vw, 148px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  background: linear-gradient(100deg, var(--accent), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.yr-who {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
}
.yr-empty {
  margin-top: 28px;
  font-size: 18px;
  color: var(--muted);
}
.yr-totals {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px 40px;
  margin: 22px 0 8px;
}
.yr-hours-n {
  font-size: clamp(64px, 15vw, 120px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.yr-hours-l {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}
.yr-counts {
  display: flex;
  gap: 28px;
  padding-bottom: 6px;
}
.yr-counts .yr-num {
  font-size: 36px;
}
.yr-block {
  margin-top: 30px;
}
.yr-h {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}
.yr-num {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  word-break: break-word;
}
.yr-label {
  font-size: 13.5px;
  color: var(--muted);
}
.yr-rank {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.yr-rank-item {
  position: relative;
  min-width: 0;
  text-align: left;
}
.yr-rank-img {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
}
.yr-rank-img img,
.yr-channel-logo img,
.yr-moment-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.yr-rank-n {
  position: absolute;
  z-index: 1;
  left: 8px;
  top: 4px;
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.yr-rank-name {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yr-rank-sub,
.yr-channel-sub,
.yr-moment-sub,
.yr-moment-when {
  font-size: 12.5px;
  color: var(--dim);
}
.yr-rank-item.gone .yr-rank-img img,
.yr-moment.gone .yr-moment-img img {
  filter: grayscale(1);
  opacity: 0.6;
}
.yr-channels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.yr-channel {
  position: relative;
  min-width: 0;
}
.yr-channel-logo {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}
.yr-channel-logo img {
  object-fit: contain;
  padding: 14%;
}
.yr-channel-n {
  position: absolute;
  z-index: 1;
  left: 8px;
  top: 4px;
  font-size: 22px;
  font-weight: 900;
  color: var(--muted);
}
.yr-channel-name {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yr-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.yr-facts .yr-stat {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
}
.yr-facts .yr-label {
  margin-top: 4px;
}
.yr-binge-what {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
}
.yr-moments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.yr-moment {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  text-align: left;
  min-width: 0;
}
.yr-moment-img {
  position: relative;
  flex: none;
  width: 64px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-3);
}
.yr-moment-info {
  min-width: 0;
}
.yr-moment-name {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}
@media (max-width: 767px) {
  .yr-rank,
  .yr-channels {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 calc(-1 * var(--pad-r)) 0 calc(-1 * var(--pad-l));
    padding: 0 var(--pad-r) 0 var(--pad-l);
  }
  .yr-rank::-webkit-scrollbar,
  .yr-channels::-webkit-scrollbar {
    display: none;
  }
  .yr-rank-item {
    flex: none;
    width: 36vw;
  }
  .yr-channel {
    flex: none;
    width: 34vw;
  }
  .yr-counts {
    gap: 22px;
  }
  .yr-counts .yr-num {
    font-size: 30px;
  }
  .yr-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .yr-facts .yr-stat {
    padding: 14px;
  }
  .yr-facts .yr-num {
    font-size: 24px;
  }
}
/* ---------- Admin > a profile > What they can watch (N1) ---------- */
.adm-wt-who .avatar {
  flex: none;
}
.segmented.adm-wt-seg {
  display: inline-flex;
  margin: 0 0 18px;
}
.adm-wt-seg .seg {
  flex: none;
  padding: 0 16px;
}
.adm-wt-toolbar .adm-wt-seg {
  margin: 0;
}
.adm-wt-toolbar .adm-search {
  flex: 1 1 260px;
}
.adm-wt-count {
  margin: 0 0 0 auto;
  white-space: nowrap;
}
.adm-wt-row {
  margin-bottom: 22px;
}
.adm-wt-row-title {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 700;
}
.adm-wt-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.adm-wt-track .adm-wt-tile {
  flex: none;
  width: 150px;
}
.adm-wt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px 12px;
}
.adm-wt-grid > .adm-empty,
.adm-wt-grid > .spinner,
.adm-wt-grid > .msg {
  grid-column: 1 / -1;
}
.adm-wt-tile {
  min-width: 0;
}
.adm-wt-img {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
}
.adm-wt-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.adm-wt-tile.is-hidden .adm-wt-img img {
  opacity: 0.3;
  filter: grayscale(1);
}
.adm-wt-tile.is-hidden .card-ph {
  color: transparent;
}
.adm-wt-age,
.adm-wt-state {
  position: absolute;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
}
.adm-wt-age {
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}
.adm-wt-state {
  left: 6px;
  right: 6px;
  bottom: 6px;
  text-align: center;
  background: rgba(255, 183, 77, 0.92);
  color: #000;
}
.adm-wt-tile.is-allowed .adm-wt-state {
  background: rgba(129, 199, 132, 0.92);
}
.adm-wt-state[hidden] {
  display: none;
}
.adm-wt-name {
  margin-top: 6px;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.adm-wt-year {
  min-height: 16px;
  color: var(--dim);
  font-size: 12px;
}
.adm-wt-acts {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}
.adm-wt-act {
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--bg-3);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.adm-wt-act:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.14);
}
.adm-wt-act.on {
  background: #ffb74d;
  color: #000;
}
.adm-wt-act.on[data-rule="allow"] {
  background: #81c784;
}
.adm-wt-act:disabled {
  opacity: 0.6;
}
.adm-wt-more {
  justify-content: center;
  margin-top: 18px;
}
.adm-wt-list + .adm-wt-list {
  margin-top: 16px;
}
.adm-wt-lines {
  list-style: none;
}
.adm-wt-line {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.adm-wt-line:first-child {
  border-top: 0;
}
.adm-wt-thumb {
  position: relative;
  flex: none;
  width: 40px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-3);
}
.adm-wt-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.adm-wt-line-text {
  flex: 1;
  min-width: 0;
}
.adm-wt-line-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.adm-wt-line .adm-dim {
  font-size: 13px;
}

/* Admin > Insights (O1 I2). Series colours: categorical order s1..s5, checked for colour-blind separation
   on --bg-2; errors use the status red. */
.ins {
  --ins-s1: #3987e5;
  --ins-s2: #d95926;
  --ins-s3: #199e70;
  --ins-s4: #c98500;
  --ins-s5: #d55181;
  --ins-err: #ff6e6e;
}
.ins-tiles .adm-cx-tile.warn .adm-cx-tile-value {
  color: #ffb74d;
}
.ins-tiles .adm-cx-tile.bad .adm-cx-tile-value {
  color: #ff8a80;
}
.ins-card {
  min-width: 0;
}
.ins-charts {
  display: grid;
  gap: 20px 28px;
}
.ins-charts-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ins-charts-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.ins-chart {
  min-width: 0;
  margin: 0;
}
.ins-chart-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.ins-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  font-weight: 500;
  font-size: 12px;
}
.ins-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ins-key {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.ins-chart-body {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 8px;
}
.ins-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 140px;
  margin: -7px 0;
  color: var(--dim);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.ins-plot-wrap {
  height: 140px;
}
.ins-plot {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ins-x {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--dim);
  font-size: 11.5px;
  white-space: nowrap;
}
.ins-grid {
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.ins-grid.base {
  stroke: rgba(255, 255, 255, 0.2);
}
.ins-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.ins-line.s1 { stroke: var(--ins-s1); }
.ins-line.s2 { stroke: var(--ins-s2); }
.ins-line.s3 { stroke: var(--ins-s3); }
.ins-line.s4 { stroke: var(--ins-s4); }
.ins-line.s5 { stroke: var(--ins-s5); }
.ins-bar.s1, .ins-key.s1 { fill: var(--ins-s1); background: var(--ins-s1); }
.ins-key.s2 { background: var(--ins-s2); }
.ins-key.s3 { background: var(--ins-s3); }
.ins-key.s4 { background: var(--ins-s4); }
.ins-key.s5 { background: var(--ins-s5); }
.ins-bar.err, .ins-key.err { fill: var(--ins-err); background: var(--ins-err); }
.ins-hit {
  fill: transparent;
}
.ins-hit:hover {
  fill: rgba(255, 255, 255, 0.08);
}
/* tables: fit the card, long names and SQL wrap */
.ins-table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}
.adm-card .ins-table {
  table-layout: fixed;
  font-size: 13.5px;
}
.ins-table th,
.ins-table td {
  padding: 8px 10px;
}
.ins-table th,
.ins-table th button {
  white-space: normal;
  vertical-align: bottom;
  overflow-wrap: normal;
}
.adm-card .ins-table th:first-child,
.adm-card .ins-table td:first-child {
  padding-left: 0;
}
.ins-table th.num,
.ins-table td.num {
  width: 96px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ins-table th.num:last-child,
.ins-table td.num:last-child {
  padding-right: 0;
}
.ins-table th.when {
  width: 128px;
}
.ins-table td.when {
  white-space: normal;
}
@media (max-width: 1279px) {
  .ins-table th.num { width: 74px; }
  .ins-table th.when { width: 112px; }
}
.ins-table th.ins-wide {
  width: auto;
}
.ins-table td.ins-wide {
  overflow-wrap: anywhere;
}
.ins-table th.num .adm-sort button,
.ins-table th.num button {
  text-align: right;
}
.ins-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.ins-sql {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.ins-row {
  cursor: pointer;
}
.ins-row:hover td,
.ins-row.open td {
  background: rgba(255, 255, 255, 0.03);
}
.ins-row:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: -2px;
}
.ins-row.open .ins-sql {
  display: none;
}
.ins-row.open td.ins-wide::before {
  content: "▾";
  color: var(--dim);
}
.ins-more td {
  padding-top: 0;
  border-top: 0;
  background: rgba(255, 255, 255, 0.03);
}
.ins-sql-full {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ins-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
}
.adm-card .ins-runs {
  font-size: 13px;
}
.ins-runs td {
  padding: 6px 10px 6px 0;
  border-top: 1px solid var(--line);
}
.adm-card .ins-runs td:first-child {
  padding-left: 0;
}
.ins-runs td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ins-err {
  color: var(--muted);
  overflow-wrap: anywhere;
}
@media (max-width: 1180px) {
  .ins-charts-2 { grid-template-columns: minmax(0, 1fr); }
}
.ins-store {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  color: var(--dim);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.ins-store .adm-note {
  flex-basis: 100%;
  margin: 0;
}

/* Admin > Insights > Errors (O1 I6) */
.segmented.ins-tabs {
  align-self: flex-start;
}
.ins-tabs .seg {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 0 16px;
  text-decoration: none;
}
.err-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.err-filters .seg,
.ins .adm-card-head .adm-seg .seg {
  flex: none;
  padding: 0 14px;
}
.err-table td.ins-wide {
  padding-top: 10px;
  padding-bottom: 10px;
}
.err-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--fg);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.err-title:hover {
  text-decoration: underline;
}
.err-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  overflow-wrap: anywhere;
}
.err-head-text {
  min-width: 0;
}
.adm-head h1.err-h1 {
  font-size: 21px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.err-tiles .adm-cx-tile-value {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.err-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1279px) {
  .err-columns { grid-template-columns: minmax(0, 1fr); }
}
.err-stack {
  margin: 0;
  padding: 0;
  list-style: none;
}
.err-frame {
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.err-frame:first-child {
  border-top: 0;
}
.err-frame.app {
  border-left: 3px solid var(--ins-err);
  background: rgba(255, 110, 110, 0.07);
  color: var(--fg);
}
.err-frame-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: space-between;
}
.err-fn {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.err-where {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.err-code {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.err-folded {
  padding: 4px 10px;
  border-top: 1px solid var(--line);
}
.err-message {
  margin: 0 0 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.err-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
  font-size: 13px;
}
.err-fact {
  display: contents;
}
.err-fact dt {
  color: var(--muted);
}
.err-fact dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.err-subhead {
  margin: 16px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.err-crumbs {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
}
.err-crumbs li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}
.err-crumb-time {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.err-crumb-msg {
  flex-basis: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.err-msg-cell {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}
.err-seg .seg {
  white-space: nowrap;
}
.err-actions {
  display: flex;
  gap: 8px;
}
.err-events th.err-where-col {
  width: 30%;
}
.err-events th.err-release-col {
  width: 150px;
}
.err-events th.err-device-col {
  width: 90px;
}
.err-events td.err-where-col {
  overflow-wrap: anywhere;
}
.err-sort .seg {
  flex: none;
  padding: 0 14px;
}
@media (max-width: 1279px) {
  .err-events th.err-where-col { width: 24%; }
  .err-events th.err-release-col { width: 96px; }
  .err-events .err-device-col { display: none; }
}

/* Admin > Insights: slow-request traces (O1 I7) */
.trc-route {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.trc-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(57, 135, 229, 0.16);
  color: #8fbcf2;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  line-height: 16px;
  text-decoration: none;
  white-space: nowrap;
}
a.trc-mark:hover {
  background: rgba(57, 135, 229, 0.28);
}
.trc-glyph {
  width: 12px;
  height: 10px;
  fill: currentColor;
}
.trc-list td.when a {
  color: var(--fg);
  text-decoration: none;
}
.trc-list-row {
  cursor: pointer;
}
.trc-list-row:hover td {
  background: rgba(255, 255, 255, 0.03);
}
.trc-list-row:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: -2px;
}
.trc-list td.when {
  width: 150px;
}
.adm-card .trc-list td.num {
  width: 72px;
  padding-right: 16px;
}
.trc-list-dom {
  width: auto;
}
.trc-dom-head {
  margin-right: 8px;
  color: var(--muted);
  white-space: nowrap;
}
.trc-dom-what {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow-wrap: anywhere;
}
.trc-h1 {
  font-size: 20px;
  overflow-wrap: anywhere;
}
.trc-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.trc-total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trc-total.zero {
  color: var(--dim);
}
.trc-key {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.trc-fall {
  font-size: 12.5px;
}
.trc-key.sql, .trc-bar.sql { background: var(--ins-s1); fill: var(--ins-s1); }
.trc-key.call, .trc-bar.call { background: var(--ins-s2); fill: var(--ins-s2); }
.trc-key.wait, .trc-bar.wait { background: var(--ins-s5); fill: var(--ins-s5); }
.trc-key.span, .trc-bar.span { background: var(--ins-s3); fill: var(--ins-s3); }
.trc-key.other { background: #8a8a96; }
.trc-bar.request { fill: #55555f; }
.trc-row {
  display: grid;
  grid-template-columns: minmax(0, 38%) minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: start;
  padding: 3px 0;
  border-top: 1px solid var(--line);
}
.trc-row.trc-axis {
  border-top: 0;
  color: var(--dim);
  font-size: 11.5px;
}
.trc-label {
  display: flex;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
  outline-offset: 2px;
}
.trc-row.k-request .trc-label,
.trc-axis .trc-label {
  cursor: default;
}
.trc-label:focus-visible {
  outline: 2px solid var(--fg);
}
.trc-kind {
  flex: none;
  width: 42px;
  color: var(--dim);
  font-size: 11px;
  line-height: 18px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.trc-kind.sql { color: #8fbcf2; }
.trc-kind.call { color: #f0a07e; }
.trc-kind.wait { color: #ec9ab8; }
.trc-kind.span { color: #6fd0ab; }
.trc-text {
  min-width: 0;
  overflow: hidden;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trc-row.open .trc-label {
  grid-column: 1 / -1;
}
.trc-row.open .trc-track {
  grid-column: 2;
}
.trc-row.open .trc-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.trc-row.open {
  background: rgba(255, 255, 255, 0.03);
}
.trc-row.k-request .trc-text {
  font-weight: 600;
}
.trc-track {
  min-width: 0;
}
.trc-svg {
  display: block;
  width: 100%;
  height: 18px;
}
.trc-tick {
  stroke: var(--line);
  stroke-width: 1;
}
.trc-ticks {
  display: grid;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.trc-ticks.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trc-ticks.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.trc-ticks.n6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.trc-ticks.n7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.trc-ticks.n8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.trc-ticks.n9 { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.trc-ticks.n10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.trc-tick-cell {
  position: relative;
  height: 16px;
}
.trc-tick-at {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
}
.trc-tick-cell:first-child .trc-tick-at {
  transform: none;
}
.trc-tick-end {
  position: absolute;
  right: 0;
}
.trc-ms {
  color: var(--muted);
  line-height: 18px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.trc-more {
  margin: 8px 0 0;
  color: var(--dim);
}
@media (max-width: 1279px) {
  .trc-row { grid-template-columns: minmax(0, 34%) minmax(0, 1fr) 58px; }
}

/* Admin > Insights: promote markers (O1 I5) and the Front end card (I4) */
.ins-marker {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}
.ins-marker-hit {
  fill: transparent;
}
.ins-marker-hit:hover {
  fill: rgba(255, 255, 255, 0.14);
}
.ins-subhead {
  margin: 20px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.ins-table th.ins-dev {
  width: 96px;
}
.ins-delta {
  font-variant-numeric: tabular-nums;
}
.ins-delta.bad {
  color: #ff8a80;
}
.ins-delta.good {
  color: #81c784;
}

/* Admin > Insights > Releases (O1 I5) */
.rel-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rel-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13.5px;
}
.rel-subject {
  color: var(--fg);
  overflow-wrap: anywhere;
}
.rel-windows {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  margin: 0 0 12px;
  font-size: 13px;
}
.rel-windows dt {
  display: inline;
  margin-right: 6px;
  color: var(--dim);
}
.rel-windows dd {
  display: inline;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.rel-table th.num {
  width: 140px;
}
.rel-list {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
}
.rel-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}
.rel-list .err-title {
  overflow-wrap: anywhere;
}

.watch-now-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
}
.watch-now-results .card {
  width: 100%;
}

/* ---------- F1 / D3: one row per channel, and the desktop time grid ---------- */
.ch-versions {
  margin-left: 8px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  vertical-align: 1px;
}
/* a phone's row has room for Catch-up, not the versions too: they're on the channel's guide */
@media (max-width: 599px) {
  .ch .ch-versions {
    display: none;
  }
}
.g-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.g-versions[hidden] {
  display: none;
}
.lg-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.lg-step {
  display: inline-flex;
  align-items: center;
  padding-left: 8px;
  padding-right: 8px;
}
.lg-step .ic {
  width: 18px;
  height: 18px;
}
.lg-range {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.lg {
  --lg-ch: 300px;
  --lg-row: 64px;
  position: relative;
  padding: 0 var(--pad-r) 32px var(--pad-l);
}
.lg-ruler {
  position: sticky;
  top: calc(var(--top-h) + var(--sat) + var(--lg-bar, 60px));
  z-index: 4;
  display: grid;
  grid-template-columns: var(--lg-ch) 1fr;
  height: 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.lg-times {
  position: relative;
}
.lg-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding-left: 6px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.lg-body {
  position: relative;
}
.lg-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 2px;
  margin-left: -1px;
  background: var(--accent);
  pointer-events: none;
}
.lg-now-line[hidden] {
  display: none;
}
.lg-row {
  display: grid;
  grid-template-columns: var(--lg-ch) 1fr;
  height: var(--lg-row);
  border-bottom: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto var(--lg-row);
}
.lg-ch-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-right: 8px;
}
.lg-ch {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 6px 0 0;
  border-radius: var(--radius);
  text-align: left;
}
.lg-ch .ch-logo {
  width: 64px;
  height: 48px;
}
.lg-ch-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.lg-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lg-meta {
  display: flex;
  align-items: center;
  margin-top: 2px;
}
.lg-meta .ch-versions {
  margin-left: 0;
  margin-right: 8px;
}
.lg-meta .ch-catchup {
  margin-left: 0;
}
.lg-ch-cell .ch-star {
  width: 36px;
  min-height: 44px;
}
.lg-guide {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 44px;
  border-radius: var(--radius);
  color: var(--muted);
}
.lg-guide .ic {
  width: 20px;
  height: 20px;
}
.lg-track {
  position: relative;
  overflow: hidden;
}
.lg-prog {
  position: absolute;
  top: 4px;
  bottom: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  overflow: hidden;
}
.lg-prog.now {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.18);
}
.lg-prog.past {
  color: var(--dim);
}
.lg-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lg-when {
  margin-top: 2px;
  color: var(--dim);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.lg-track.failed {
  background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 255, 255, 0.03) 8px 16px);
}
@media (hover: hover) {
  .lg-ch:hover,
  .lg-guide:hover {
    background: rgba(255, 255, 255, 0.06);
  }
  .lg-prog:hover {
    background: rgba(255, 255, 255, 0.14);
  }
}
.lg-ch:focus-visible,
.lg-prog:focus-visible,
.lg-guide:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: -2px;
}

.d-reactions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.d-reactions:empty { display: none; }
.reaction-toggle.btn {
  width: 36px;
  min-width: 36px;
  padding-inline: 0;
  justify-content: center;
}
.reaction-toggle[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}
.thumb-down svg { transform: rotate(180deg); }
.title-lookup {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  margin-block: 0 12px;
  border-radius: 12px;
  background: var(--bg-3);
}

.programme-bell { display: inline-flex; color: var(--accent); vertical-align: middle; margin-right: 0.5em; }
.programme-reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 8px;
}

/* ---------- D3: navigation and search ---------- */
/* phones: five tabs (Calendar sits under TV Shows and the profile page, XXX on the profile page) */
.phone-only { display: none; }
@media (max-width: 767px) {
  #tabbar .rail-only { display: none !important; }
  .phone-only { display: inline-flex; }
}
/* the desktop's search is in the top bar, on every page; the Search tab and the page's own field are the
   phone's and tablet's (the same rule as js/views/search.js topSearchMedia) */
.top-search { display: none; }
@media (min-width: 1024px) and (hover: hover) {
  #tabbar .no-top-search { display: none; }
  .view .search-bar { display: none; }
  .top-search {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 380px;
    min-width: 220px;
    height: 40px;
    margin-left: auto;
    padding: 0 2px 0 12px;
    border-radius: 20px;
    background: rgba(20, 20, 26, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--muted);
  }
  #topbar.solid .top-search { background: var(--bg-3); border-color: transparent; }
  .top-search:focus-within { border-color: rgba(255, 255, 255, 0.5); color: var(--fg); }
  .top-search-ic { display: block; width: 20px; height: 20px; flex: none; }
  .top-search-ic svg { width: 100%; height: 100%; fill: currentColor; }
  .top-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: none;
    outline: none;
    color: var(--fg);
    font-size: 15px;
    -webkit-appearance: none;
    appearance: none;
  }
  .top-search input::-webkit-search-cancel-button { display: none; }
  .top-search-clear { width: 34px; height: 34px; }
  .top-search-clear .ic { width: 18px; height: 18px; }
  /* the search page under the top bar's field */
  .view .search-results { padding-top: 8px; }
}
/* F2: Search before anything is typed */
.search-start { padding-top: 6px; }
.search-start-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-right: var(--pad-r);
}
.search-start .chips {
  flex-wrap: wrap;
  margin: 0 var(--pad-r) 8px var(--pad-l);
}
.search-recent .chip,
.browse-chips .chip:has(.ic) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.search-recent .chip .ic { width: 16px; height: 16px; opacity: 0.7; }
.search-recent .chip span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.search-genres .chip { height: 38px; padding: 0 16px; font-size: 15px; color: var(--fg); }
.search-none { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.browse-chips .chip .ic { width: 16px; height: 16px; }


.programme-reminders-sheet .sheet-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.programme-reminder-row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.programme-reminder-row > .btn { flex: none; }
.programme-reminders-sheet h3 { margin: 12px 0 0; }
.keyword-form { display: flex; align-items: center; gap: 8px; }
.keyword-form .title-lookup { flex: 1; min-width: 0; margin: 0; }
.keyword-form button { flex: none; white-space: nowrap; }
.keyword-matches { color: var(--muted); margin: 0; }

/* F22: a playlist, one line per entry: play from here, then move up / down and remove */
.playlist-list { margin-bottom: 12px; }
.playlist-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.playlist-row:first-child { border-top: 0; }
.playlist-play {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 4px 8px 4px 4px;
  border-radius: 10px;
  text-align: left;
}
.playlist-play:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); }
.playlist-play:disabled { opacity: 0.45; }
.playlist-play > .ic { width: 22px; height: 22px; flex: none; }
.playlist-text { display: flex; flex-direction: column; min-width: 0; }
.playlist-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-edit { width: 38px; height: 38px; color: var(--muted); }
.playlist-edit:hover:not(:disabled) { color: var(--fg); background: rgba(255, 255, 255, 0.08); }
.playlist-edit:disabled { opacity: 0.25; }
.playlist-edit .ic { width: 20px; height: 20px; }
.playlist-empty { color: var(--muted); }
/* the foot of Home: its buttons apart, and stacked on a narrow phone */
.home-edit { gap: 10px; flex-wrap: wrap; }
/* F13: the filters as rows of chips in the sheet (sheets don't stack) */
.wn-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.wn-chips {
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -18px;
  padding: 0 18px;
  scroll-padding: 0 18px;
}
.wn-chips::-webkit-scrollbar { display: none; }
/* N5: the TMDB matches, a name and its button per line */
.wanted-results { margin-top: 14px; }
.wanted-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.wanted-row:first-child { border-top: 0; }
.wanted-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.wanted-row .btn { flex: none; }
/* F17: Admin > Insights > Playback */
.pb-filters { flex-wrap: wrap; align-items: center; }
.pb-search { flex: 1 1 260px; min-width: 200px; max-width: 420px; height: 36px; }
.pb-reason { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.pb-table td { vertical-align: top; }
.pb-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
.pb-steps { list-style: none; margin: 0; padding: 0; }
.pb-step {
  display: grid;
  grid-template-columns: 72px 64px 170px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.pb-step:first-child { border-top: 0; }
.pb-at { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.pb-src { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.pb-step.from-player .pb-src { color: #8ab4ff; }
.pb-step-name { font-weight: 700; }
.pb-step.bad .pb-step-name { color: #ff6b6b; }
.pb-step.warn .pb-step-name { color: #ffb74d; }
.pb-detail { color: var(--muted); overflow-wrap: anywhere; }
.adm-overview .adm-now + .adm-now { margin-top: 16px; }
/* F18: Admin > Catalogue > Possible replacements */
.adm-rv-list { list-style: none; margin: 0; padding: 0; }
.adm-rv { padding: 12px 0; border-top: 1px solid var(--line); }
.adm-rv:first-child { border-top: 0; padding-top: 4px; }
.adm-rv-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: start; }
.adm-rv-side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-rv-name { font-weight: 700; overflow-wrap: anywhere; }
.adm-rv-arrow { color: var(--dim); padding-top: 14px; }
.adm-rv-arrow .ic { width: 20px; height: 20px; }
.adm-rv-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Keep results in place while their replacement loads. */
.refreshing {
  opacity: 0.55;
}

.my-stuff-playlists .section-title {
  padding-inline: 0;
}

.my-stuff-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.my-stuff-head > .btn {
  margin-right: var(--pad-r);
}

/* Send title: the profiles as buttons with room between them */
.send-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
/* Admin › Accounts: the VPN cards and the Add a VPN form apart, like the other cards */
.adm-vpn-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.adm-vpn-list > .btn {
  align-self: flex-start;
}
.adm-vpn-list .adm-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.adm-vpn-list .adm-card-head,
.adm-vpn-list .adm-card .adm-note {
  margin: 0;
}
.adm-vpn-list .adm-card .segmented {
  align-self: flex-start;
}
.adm-vpn-list input[type="file"].text-input {
  height: auto;
  padding: 9px 12px;
}
.adm-vpn-list .adm-form-actions {
  margin-top: 4px;
}
.adm-vpn-list .form-error:empty {
  display: none;
}
/* F27: Matches on Live TV and in search, one card per match */
.sports .row-track,
.search-results .row-track {
  display: flex;
  gap: 10px;
}
.match-card {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 220px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg-2);
  text-align: left;
  scroll-snap-align: start;
}
.match-card:hover,
.match-card:active {
  background: var(--bg-3);
}
.match-when {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.match-card.live .match-when {
  align-self: flex-start;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-fg);
}
.match-teams {
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.match-teams span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.match-count {
  color: var(--dim);
  font-size: 12px;
}
/* F27: Live TV's title with its Sports button; crests on the match cards */
.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.live-head .page-title {
  margin-bottom: 0;
}
.match-side {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.match-side span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.match-crest {
  flex: none;
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.sports .sports-row + .sports-row {
  margin-top: 8px;
}
.sports .row-track {
  display: flex;
  gap: 10px;
}
.live-head {
  padding-right: var(--pad-r);
}

/* D1 (16 Nov): Admin on a phone. Tables with a header row stack (views/admin/shell.js labels each cell with its
   column in data-label): one card-like row each, its first cell as the title, then "label  value" lines. */
@media (max-width: 600px) {
  .adm-table.adm-stack,
  .adm-table.adm-stack tbody {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }
  .adm-table.adm-stack thead {
    display: none;
  }
  .adm-table.adm-stack tr {
    display: block;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
  }
  .adm-table.adm-stack tbody tr:first-child {
    border-top: 0;
  }
  .adm-table.adm-stack td {
    display: grid;
    grid-template-columns: minmax(84px, 36%) minmax(0, 1fr);
    align-items: baseline;
    gap: 12px;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 3px 0 !important;
    border: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .adm-table.adm-stack td::before {
    content: attr(data-label);
    color: var(--dim);
    font-size: 13px;
    text-align: left;
  }
  .adm-table.adm-stack td:first-child {
    display: block;
    padding-bottom: 6px !important;
    font-weight: 700;
    text-align: left;
  }
  .adm-table.adm-stack td:first-child::before,
  .adm-table.adm-stack td[data-label=""]::before {
    content: none;
  }
  .adm-table.adm-stack td[data-label=""] {
    display: block;
  }
  .adm-table.adm-stack td:empty {
    display: none;
  }
  .ins-table-wrap,
  .adm-sys-table-wrap,
  .adm-cx-scroll {
    overflow: visible;
    max-width: 100%;
  }
}
/* Admin has its own section menu: the app's tabs stay out of the way on a phone */
@media (max-width: 767px) {
  body.admin-page #tabbar {
    display: none;
  }
  body.admin-page #main {
    padding-bottom: calc(var(--sab) + 24px);
  }
}
/* Touch screens: Admin's buttons, switches and segmented controls at a thumb's size */
@media (pointer: coarse), (max-width: 767px) {
  .adm .btn.sm,
  .adm .seg,
  .adm .adm-tab,
  .adm .adm-nav-link {
    min-height: 44px;
  }
  /* the switch looks the same; its tap area reaches 44 px */
  .adm .switch::after {
    content: "";
    position: absolute;
    inset: -7px -4px;
  }
  .adm .adm-login-name,
  .adm .adm-crumb {
    display: inline-block;
    padding: 12px 0;
  }
}
/* Insights' four tabs share the phone's width instead of 110 px each (they made the page 462 px wide) */
@media (max-width: 600px) {
  .segmented.ins-tabs {
    align-self: stretch;
    max-width: 100%;
  }
  .ins-tabs .seg {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 4px;
    font-size: 13.5px;
  }
}
/* D1: Admin on a phone. One section picker instead of the sideways strip, kept in reach under the top bar;
   a header's actions (Insights' range, Pause all) on their own line under the subtitle. */
.adm-nav-select {
  display: none;
}
@media (max-width: 600px) {
  .adm-nav {
    position: sticky;
    top: calc(var(--top-h) + var(--sat));
    z-index: 30;
    margin: 0 calc(-1 * var(--pad-r)) 0 calc(-1 * var(--pad-l));
    padding: 8px var(--pad-r) 8px var(--pad-l);
    background: var(--bg);
    overflow: visible;
  }
  .adm-nav .adm-nav-link {
    display: none;
  }
  .adm-nav-select {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 40px 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23aaa'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 10px center / 24px;
    color: var(--fg);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    appearance: none;
    -webkit-appearance: none;
  }
  .adm-dl-head-actions {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-top: 12px;
  }
  .adm-dl-head-actions > .segmented {
    margin: 0;
  }
  .adm-dl-head-actions > .segmented .seg {
    flex: 1 1 0;
  }
}
/* a section's own tabs (Accounts: Provider accounts, Now, Overview, History) wrap instead of hiding the last */
@media (max-width: 600px) {
  .adm-tabs {
    flex-wrap: wrap;
    overflow: visible;
  }
}
/* D1: folded cards on a phone (views/admin/shell.js foldCards): the header (and a provider account's status line)
   only; a chevron says which way it goes */
@media (max-width: 600px) {
  .adm-foldable > .adm-card-head,
  .adm-foldable > .adm-acc-head {
    position: relative;
    min-height: 44px;
    padding-right: 32px;
    cursor: pointer;
  }
  .adm-foldable > .adm-card-head::after,
  .adm-foldable > .adm-acc-head::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 4px;
    width: 9px;
    height: 9px;
    margin-top: -7px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform 0.15s;
  }
  .adm-foldable.adm-folded > .adm-card-head::after,
  .adm-foldable.adm-folded > .adm-acc-head::after {
    margin-top: -3px;
    transform: rotate(-45deg);
  }
  .adm-foldable.adm-folded > :not(.adm-card-head):not(.adm-acc-head):not(.adm-acc-status) {
    display: none !important;
  }
  .adm-foldable.adm-folded > .adm-card-head,
  .adm-foldable.adm-folded > .adm-acc-head {
    margin-bottom: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .adm-foldable > .adm-card-head::after,
  .adm-foldable > .adm-acc-head::after {
    transition: none;
  }
}
/* the Sort picker of a stacked table (views/admin/shell.js sortPicker): phones only */
.adm-sort-pick {
  display: none;
}
@media (max-width: 600px) {
  .adm-sort-pick {
    display: block;
    width: auto;
    max-width: 100%;
    height: 44px;
    margin: 4px 16px 8px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23aaa'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center / 22px;
    color: var(--fg);
    font: inherit;
    font-size: 15px;
    appearance: none;
    -webkit-appearance: none;
  }
}
