/* FashionTube UI v2. One stylesheet; every colour, radius, blur and size is a variable on :root.
   Light by default; dark under prefers-color-scheme and [data-theme=dark].
   Glass (see docs/DESIGN.md §5) only on floating layers: .appbar, .tabbar, .sub-strip, .sheet.
   Content (cards, chips, rail, boxes) stays solid. ≤ 3 glass blocks on screen, never nested. */

:root {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK SC", "Microsoft YaHei", "Apple SD Gothic Neo", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* palette (YouTube neutrals, ink accent) */
  --bg: #ffffff;
  --bg-rgb: 255 255 255;
  --bg-2: #f2f2f2; /* description box, thumbnails loading */
  --fill: rgb(0 0 0 / 0.05); /* chips, pills, inputs */
  --fill-2: rgb(0 0 0 / 0.09); /* hover */
  --fill-3: rgb(0 0 0 / 0.14); /* pressed */
  --text: #0f0f0f;
  --text-2: #3f3f46; /* 10:1 on white */
  --text-3: #5f5f66; /* 6.4:1 on white, 5.7:1 on --bg-2 */
  --separator: rgb(0 0 0 / 0.1);
  --accent: #0f0f0f;
  --accent-contrast: #ffffff;
  --link: #065fd4;
  --focus: #0a66ff;
  --select: #0a66ff;
  --select-bg: rgb(10 102 255 / 0.06);
  --band-0: #0f766e;
  --band-1: #3f3f46;
  --band-2: #8a5a00;
  --thumb-bg: #ececec;
  --overlay: rgb(0 0 0 / 0.8);
  --overlay-text: #ffffff;
  --seg-on: #ffffff;
  --seg-shadow: 0 1px 3px rgb(0 0 0 / 0.12), 0 0 0 0.5px rgb(0 0 0 / 0.04);
  --scrim: rgb(0 0 0 / 0.18);
  --shadow-pop: 0 12px 32px rgb(0 0 0 / 0.14);
  --live: #d6261d; /* LIVE badge only (sits on thumbnails, same in both themes) */

  /* ---- glass material (docs/DESIGN.md §5; tune here) ---- */
  --glass-rgb: 255 255 255;
  --glass-a-bar: 0.62; /* header, phone top bar */
  --glass-a-tab: 0.56; /* phone tab capsule */
  --glass-a-strip: 0.64; /* subtitle strip */
  --glass-a-sheet: 0.8; /* sheets / popovers (dense text, over a scrim) */
  --glass-blur: 20px;
  --glass-blur-sheet: 24px;
  --glass-sat: 180%;
  --glass-hi: rgb(255 255 255 / 0.75); /* 1px top inner highlight */
  --glass-lo: rgb(0 0 0 / 0.05); /* 1px bottom inner line */
  --glass-edge: rgb(0 0 0 / 0.07); /* 0.5px hairline */
  --glass-shadow: 0 8px 24px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04);
  --glass-spec: 255 255 255;
  --glass-spec-a: 0.35; /* specular sheen, upper-left */
  --glass-spec-a2: 0.08;
  --glass-text-2: #3a3a40; /* secondary text on glass, one step darker */

  /* shape & size */
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-xl: 28px;
  --gutter: 24px;
  --appbar-h: 56px;
  --rail-w: 240px;
  --rail-mini: 72px;
  --rail-space: 0px;
  --tabbar-h: 62px;
  --card-min: 320px;
  --logo-h: 28px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* motion: short, spring-like */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press: 120ms;
  --dur-fade: 200ms;
  --dur-sheet: 320ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f0f;
    --bg-rgb: 15 15 15;
    --bg-2: #222224;
    --fill: rgb(255 255 255 / 0.09);
    --fill-2: rgb(255 255 255 / 0.14);
    --fill-3: rgb(255 255 255 / 0.2);
    --text: #f1f1f1;
    --text-2: #cfcfd4;
    --text-3: #a8a8ae;
    --separator: rgb(255 255 255 / 0.12);
    --accent: #f1f1f1;
    --accent-contrast: #0f0f0f;
    --link: #3ea6ff;
    --focus: #3ea6ff;
    --select: #3ea6ff;
    --select-bg: rgb(62 166 255 / 0.1);
    --band-0: #5eead4;
    --band-1: #cfcfd4;
    --band-2: #fbbf24;
    --thumb-bg: #1f1f21;
    --seg-on: #48484c;
    --seg-shadow: 0 1px 3px rgb(0 0 0 / 0.4);
    --scrim: rgb(0 0 0 / 0.45);
    --shadow-pop: 0 12px 32px rgb(0 0 0 / 0.5);
    --glass-rgb: 30 30 32;
    --glass-a-bar: 0.58;
    --glass-a-tab: 0.52;
    --glass-a-strip: 0.6;
    --glass-a-sheet: 0.76;
    --glass-sat: 160%;
    --glass-hi: rgb(255 255 255 / 0.12);
    --glass-lo: rgb(0 0 0 / 0.35);
    --glass-edge: rgb(255 255 255 / 0.09);
    --glass-shadow: 0 8px 32px rgb(0 0 0 / 0.45);
    --glass-spec-a: 0.08;
    --glass-spec-a2: 0.02;
    --glass-text-2: #d6d6db;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0f;
  --bg-rgb: 15 15 15;
  --bg-2: #222224;
  --fill: rgb(255 255 255 / 0.09);
  --fill-2: rgb(255 255 255 / 0.14);
  --fill-3: rgb(255 255 255 / 0.2);
  --text: #f1f1f1;
  --text-2: #cfcfd4;
  --text-3: #a8a8ae;
  --separator: rgb(255 255 255 / 0.12);
  --accent: #f1f1f1;
  --accent-contrast: #0f0f0f;
  --link: #3ea6ff;
  --focus: #3ea6ff;
  --select: #3ea6ff;
  --select-bg: rgb(62 166 255 / 0.1);
  --band-0: #5eead4;
  --band-1: #cfcfd4;
  --band-2: #fbbf24;
  --thumb-bg: #1f1f21;
  --seg-on: #48484c;
  --seg-shadow: 0 1px 3px rgb(0 0 0 / 0.4);
  --scrim: rgb(0 0 0 / 0.45);
  --shadow-pop: 0 12px 32px rgb(0 0 0 / 0.5);
  --glass-rgb: 30 30 32;
  --glass-a-bar: 0.58;
  --glass-a-tab: 0.52;
  --glass-a-strip: 0.6;
  --glass-a-sheet: 0.76;
  --glass-sat: 160%;
  --glass-hi: rgb(255 255 255 / 0.12);
  --glass-lo: rgb(0 0 0 / 0.35);
  --glass-edge: rgb(255 255 255 / 0.09);
  --glass-shadow: 0 8px 32px rgb(0 0 0 / 0.45);
  --glass-spec-a: 0.08;
  --glass-spec-a2: 0.02;
  --glass-text-2: #d6d6db;
}

/* system "reduce transparency" and engines without backdrop-filter: same colours, nearly opaque */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-a-bar: 0.96;
    --glass-a-tab: 0.96;
    --glass-a-strip: 0.96;
    --glass-a-sheet: 0.97;
  }
  .glass {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass-a-bar: 0.96;
    --glass-a-tab: 0.96;
    --glass-a-strip: 0.96;
    --glass-a-sheet: 0.97;
  }
}

/* ------------------------------------------------------------------ glass material */
.glass {
  --g-a: var(--glass-a-bar);
  --g-blur: var(--glass-blur);
  background-color: rgb(var(--glass-rgb) / var(--g-a));
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--g-blur)) saturate(var(--glass-sat));
}
.glass--tab {
  --g-a: var(--glass-a-tab);
}
.glass--strip {
  --g-a: var(--glass-a-strip);
}
.glass--sheet {
  --g-a: var(--glass-a-sheet);
  --g-blur: var(--glass-blur-sheet);
}
/* floating pieces (tab capsule, sheets, desktop subtitle strip) add a specular sheen, upper-left.
   One colour at two alphas, never `transparent` (WebKit draws a dark band). */
.sheet.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgb(var(--glass-spec) / var(--glass-spec-a)) 0%, rgb(var(--glass-spec) / var(--glass-spec-a2)) 38%, rgb(var(--glass-spec) / 0) 62%);
}
@media (prefers-contrast: more) {
  .glass {
    box-shadow: inset 0 0 0 1px var(--text-3) !important;
  }
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px / 1.45 var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img,
iframe,
svg {
  display: block;
  max-width: 100%;
}
.icon {
  flex: none;
}
a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
h1,
h2,
h3,
p {
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--fill);
  box-shadow: inset 0 -1px 0 var(--separator);
  font: 500 12px/1.4 var(--font-mono);
  text-align: center;
  color: var(--text-2);
}
.muted {
  color: var(--text-3);
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  inset-inline-start: 16px;
  top: -100px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
}
.skip-link:focus {
  top: calc(8px + var(--safe-top));
}
[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------ controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-press), transform var(--dur-press) var(--ease-out);
}
.btn:hover {
  background: var(--fill-2);
}
.btn:active {
  background: var(--fill-3);
}
.btn--primary,
.btn--primary:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn--primary:active {
  opacity: 0.85;
}
.btn--small {
  min-height: 32px;
  padding: 0 14px;
  font-size: 13px;
}
.btn--quiet {
  background: transparent;
  color: var(--text-2);
}
.btn .icon {
  width: 18px;
  height: 18px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color var(--dur-press);
}
.icon-btn:hover {
  background: var(--fill);
}
.icon-btn:active {
  background: var(--fill-2);
}
.input {
  min-height: 40px;
  min-width: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  outline: none;
  font-size: 15px;
}
.input:focus {
  box-shadow: 0 0 0 2px var(--focus);
}
select.input {
  padding-inline-end: 28px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  background: var(--fill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.pill:hover {
  background: var(--fill-2);
}
.pill__letter {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 11px;
  font-weight: 700;
}
.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 11px;
  font-weight: 700;
}

/* ------------------------------------------------------------------ app bar (glass, edge to edge) */
.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: var(--safe-top);
  border-bottom: 0.5px solid transparent;
  transition: border-color var(--dur-fade);
}
html.is-scrolled .appbar {
  border-bottom-color: var(--glass-edge);
}
.appbar__row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) minmax(0, 640px) minmax(max-content, 1fr);
  align-items: center;
  gap: 16px;
  height: var(--appbar-h);
  padding: 0 16px 0 calc(8px + var(--safe-left));
}
.appbar__start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 6px;
  border-radius: 8px;
  transition: opacity var(--dur-fade);
}
.brand__logo {
  display: block;
  height: var(--logo-h);
  width: auto;
}
.brand__logo--dark {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand__logo--light {
    display: none;
  }
  :root:not([data-theme="light"]) .brand__logo--dark {
    display: block;
  }
}
:root[data-theme="dark"] .brand__logo--light {
  display: none;
}
:root[data-theme="dark"] .brand__logo--dark {
  display: block;
}
.brand__word {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: var(--logo-h);
  white-space: nowrap;
}
.appbar__title {
  display: none;
}
/* search or ask: one pill (inset field on the glass bar, not glass itself) holding the input,
   the "/" hint and the sparkle "Ask FashionTube" button (YouTube's search + Ask pattern) */
.search-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 40px;
  padding-inline-end: 4px;
  border-radius: 999px;
  background: var(--fill);
  transition: background-color var(--dur-fade), box-shadow var(--dur-fade);
}
.search-form:focus-within {
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--separator), 0 0 0 4px var(--select-bg);
}
.search-form__icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  padding-inline-start: 14px;
  color: var(--text-3);
  pointer-events: none;
}
.search-form__input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 4px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 15px;
}
.search-form__input::placeholder {
  color: var(--glass-text-2);
  opacity: 0.8;
}
.search-form__kbd {
  flex: none;
  pointer-events: none;
}
.search-form:focus-within .search-form__kbd {
  display: none;
}
.search-form__ask {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 32px;
  padding: 0 12px 0 9px;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: 0 0 0 0.5px var(--separator), 0 1px 2px rgb(0 0 0 / 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-press), transform var(--dur-press) var(--ease-out);
}
.search-form:focus-within .search-form__ask {
  background: var(--fill);
  box-shadow: none;
}
.search-form__ask:hover {
  background: var(--fill-2);
}
.search-form__ask .icon {
  width: 18px;
  height: 18px;
}
.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.lang-form {
  display: flex;
}
.lang-form__select {
  height: 36px;
  max-width: 132px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.lang-form__select:hover {
  background: var(--fill-2);
}

/* ------------------------------------------------------------------ rail (solid) */
.rail {
  position: fixed;
  top: calc(var(--appbar-h) + var(--safe-top));
  bottom: 0;
  inset-inline-start: 0;
  z-index: 35;
  display: none;
  width: var(--rail-w);
  padding: 8px 12px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--fill-2) transparent;
  background: var(--bg);
}
.rail__group + .rail__group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--separator);
}
.rail__heading {
  padding: 6px 12px 4px;
  font-size: 15px;
  font-weight: 600;
}
.rail__heading a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rail__item {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  transition: background-color var(--dur-press);
}
.rail__item:hover {
  background: var(--fill);
}
.rail__item.is-active {
  background: var(--fill);
  font-weight: 600;
}
.rail__item--tier {
  gap: 16px;
  min-height: 36px;
}
.rail__letter {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: var(--fill);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}
.rail__item--tier.is-active .rail__letter {
  background: var(--accent);
  color: var(--accent-contrast);
}
.rail__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-scrim {
  position: fixed;
  inset: 0;
  z-index: 34;
  background: var(--scrim);
}

@media (min-width: 768px) {
  body {
    --rail-space: var(--rail-mini);
  }
  .rail {
    display: block;
  }
  /* drawer (tablet, watch page, or collapsed desktop): full rail over the content */
  html.rail-open .rail {
    width: var(--rail-w);
    box-shadow: var(--shadow-pop);
  }
}
@media (min-width: 1280px) {
  body {
    --rail-space: var(--rail-w);
  }
  .rail-collapsed body,
  body[data-page="watch"] {
    --rail-space: var(--rail-mini);
  }
}
/* mini rail: icon over a 10 px label, primary items + About only */
@media (min-width: 768px) and (max-width: 1279.98px) {
  html:not(.rail-open) .rail {
    width: var(--rail-mini);
    padding: 4px;
    scrollbar-width: none;
  }
  html:not(.rail-open) .rail__group + .rail__group {
    margin-top: 0;
    padding-top: 0;
    border: 0;
  }
  html:not(.rail-open) .rail__group--tiers {
    display: none;
  }
  html:not(.rail-open) .rail__item {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-height: 72px;
    padding: 0 2px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
  }
  html:not(.rail-open) .rail__item.is-active {
    font-weight: 700;
  }
  html:not(.rail-open) .rail__label {
    max-width: 100%;
  }
}
@media (min-width: 1280px) {
  html.rail-collapsed:not(.rail-open) .rail,
  html:not(.rail-open) body[data-page="watch"] .rail {
    width: var(--rail-mini);
    padding: 4px;
    scrollbar-width: none;
  }
  html.rail-collapsed:not(.rail-open) .rail__group + .rail__group,
  html:not(.rail-open) body[data-page="watch"] .rail__group + .rail__group {
    margin-top: 0;
    padding-top: 0;
    border: 0;
  }
  html.rail-collapsed:not(.rail-open) .rail__group--tiers,
  html:not(.rail-open) body[data-page="watch"] .rail__group--tiers {
    display: none;
  }
  html.rail-collapsed:not(.rail-open) .rail__item,
  html:not(.rail-open) body[data-page="watch"] .rail__item {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-height: 72px;
    padding: 0 2px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
  }
  html.rail-collapsed:not(.rail-open) .rail__item.is-active,
  html:not(.rail-open) body[data-page="watch"] .rail__item.is-active {
    font-weight: 700;
  }
}

/* ------------------------------------------------------------------ page / main / footer */
.page {
  margin-inline-start: var(--rail-space);
  min-width: 0;
}
.main {
  max-width: 1760px;
  margin: 0 auto;
  padding: 16px var(--gutter) 48px;
  min-height: 70vh;
}
.site-footer {
  max-width: 1760px;
  margin: 0 auto;
  padding: 20px var(--gutter) 40px;
  color: var(--text-3);
  font-size: 13px;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin-bottom: 6px;
}
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--text-2);
  font-weight: 500;
}
.site-footer__links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fixture-banner {
  padding: 8px var(--gutter);
  background: var(--bg-2);
  color: var(--band-2);
  font-size: 13px;
  text-align: center;
}

/* ------------------------------------------------------------------ heads, sections, segmented */
.page-head {
  margin: 12px 0 24px;
}
.page-head__kicker {
  margin-bottom: 6px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-head__title {
  font-size: 32px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.022em;
  overflow-wrap: anywhere;
}
.page-head__meta {
  max-width: 68ch;
  margin-top: 6px;
  color: var(--text-2);
  font-size: 15px;
}
.page-head .segmented {
  margin-top: 20px;
}
.section {
  margin-bottom: 48px;
}
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section__title {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.012em;
}
.section__lede {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 14px;
}
.section__more {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.section__more:hover {
  background: var(--fill);
}
.empty {
  padding: 32px 0;
  color: var(--text-3);
}
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--fill);
}
.segmented__item {
  display: inline-grid;
  place-items: center;
  min-width: 96px;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: background-color var(--dur-press);
}
.segmented__item.is-active {
  background: var(--seg-on);
  box-shadow: var(--seg-shadow);
  color: var(--text);
  font-weight: 600;
}

/* ------------------------------------------------------------------ horizontal scrollers (chips, shelf) */
.scroller {
  position: relative;
}
.scroller__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.14), 0 0 0 0.5px var(--separator);
  transform: translateY(-50%);
  cursor: pointer;
}
.scroller__arrow--prev {
  inset-inline-start: 0;
}
.scroller__arrow--next {
  inset-inline-end: 0;
}
@media (hover: hover) and (pointer: fine) {
  .scroller[data-can-prev] .scroller__arrow--prev,
  .scroller[data-can-next] .scroller__arrow--next {
    display: grid;
  }
}
[dir="rtl"] .scroller__arrow .icon {
  transform: scaleX(-1);
}
.chips-bar {
  margin: 0 calc(-1 * var(--gutter)) 20px;
}
.chips-bar__track {
  display: flex;
  gap: 10px;
  padding: 6px var(--gutter);
  overflow-x: auto;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.chips-bar__track::-webkit-scrollbar,
.shelf::-webkit-scrollbar {
  display: none;
}
/* fade the track under the arrows (solid page colour: one colour, two alphas) */
.chips-bar .scroller__arrow {
  width: 64px;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}
.chips-bar .scroller__arrow--prev {
  justify-content: start;
  padding-inline-start: var(--gutter);
  background: linear-gradient(90deg, rgb(var(--bg-rgb) / 1) 45%, rgb(var(--bg-rgb) / 0));
}
.chips-bar .scroller__arrow--next {
  justify-content: end;
  padding-inline-end: var(--gutter);
  background: linear-gradient(270deg, rgb(var(--bg-rgb) / 1) 45%, rgb(var(--bg-rgb) / 0));
}
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  max-width: 100%;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--fill);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--dur-press), transform var(--dur-press) var(--ease-out);
}
.chip:hover {
  background: var(--fill-2);
}
.chip.is-active {
  background: var(--accent);
  color: var(--accent-contrast);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip__type,
.chip__count {
  color: var(--text-3);
  font-size: 12px;
}
.chip__name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------------ video cards (solid content) */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr));
  gap: 40px 16px;
}
.card {
  position: relative;
  min-width: 0;
  border-radius: 14px;
}
.card.is-selected,
.channel-row.is-selected {
  outline: 2px solid var(--select);
  outline-offset: 6px;
}
.card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--thumb-bg);
}
.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card__dur--live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--live) !important;
  letter-spacing: 0.02em;
}
.card__live-dot,
.chip__live-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.chip--live .chip__live-dot {
  background: var(--live);
}
.chip--live.is-active .chip__live-dot {
  background: currentColor;
}
.countdown {
  color: var(--text-2);
  font-weight: 500;
}
.card__dur {
  position: absolute;
  inset-inline-end: 8px;
  bottom: 8px;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--overlay);
  color: var(--overlay-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.card__body {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding-top: 12px;
}
.card__avatar {
  align-self: start;
}
.card__title {
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.card__meta {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 14px;
  line-height: 20px;
  min-width: 0;
}
.card__channel {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__channel:hover {
  color: var(--text);
}
.card__sub {
  display: flex;
  flex-wrap: wrap;
}
.card__sub > :is(span, time) + :is(span, time)::before {
  content: "·";
  padding: 0 5px;
}
.card__note {
  color: var(--text-3);
  font-size: 13px;
}

/* watch later: overlay on the thumbnail for mouse users, in the meta row for touch */
.later-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--overlay);
  color: var(--overlay-text);
  cursor: pointer;
}
.later-btn .icon {
  width: 20px;
  height: 20px;
}
.later-btn__icon {
  display: grid;
  place-items: center;
}
.later-btn__icon--on,
.later-btn[aria-pressed="true"] .later-btn__icon--off {
  display: none;
}
.later-btn[aria-pressed="true"] .later-btn__icon--on {
  display: grid;
}
.card .later-btn {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  opacity: 0;
  transition: opacity var(--dur-press);
}
.card:hover .later-btn,
.card.is-selected .later-btn,
.card .later-btn:focus-visible,
.card .later-btn[aria-pressed="true"] {
  opacity: 1;
}
@media (hover: none), (pointer: coarse) {
  /* touch: the whole card is one link (YouTube app); avatar and watch-later sit above it */
  .card__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
  }
  .card__channel {
    pointer-events: none;
  }
  .card__avatar {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: -4px;
  }
  .card__body {
    grid-template-columns: 36px minmax(0, 1fr) 44px;
  }
  .card .later-btn {
    position: relative;
    z-index: 2;
    width: 44px;
    height: 44px;
    margin: -10px -10px 0 0;
    opacity: 1;
    background: transparent;
    color: var(--text-2);
  }
  .card .later-btn[aria-pressed="true"] {
    color: var(--text);
  }
}
.later-btn--label {
  display: inline-flex;
  gap: 6px;
  width: auto;
  min-height: 36px;
  height: auto;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.later-btn--label:hover {
  background: var(--fill-2);
}

/* compact cards (watch sidebar): thumb left, text right */
.video-grid--compact {
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 768px) {
  .video-grid--compact .card {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 10px;
  }
  .video-grid--compact .card__thumb {
    border-radius: 8px;
  }
  .video-grid--compact .card__body {
    display: block;
    padding-top: 0;
  }
  .video-grid--compact .card__avatar {
    display: none;
  }
  .video-grid--compact .card__title {
    font-size: 14px;
    line-height: 20px;
  }
  .video-grid--compact .card__meta {
    font-size: 12px;
    line-height: 18px;
  }
  .video-grid--compact .card .later-btn {
    top: 4px;
    width: 28px;
    height: 28px;
    inset-inline-end: auto;
    inset-inline-start: 136px;
  }
  /* search results: list layout like YouTube / HackerTube */
  .video-grid--list {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 1100px;
  }
  .video-grid--list .card {
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
    gap: 16px;
  }
  .video-grid--list .card__body {
    padding-top: 2px;
    grid-template-columns: minmax(0, 1fr);
  }
  .video-grid--list .card__avatar {
    display: none;
  }
  .video-grid--list .card__title {
    font-size: 18px;
    line-height: 26px;
    font-weight: 500;
  }
  .video-grid--list .card .later-btn {
    inset-inline-end: auto;
    inset-inline-start: 312px;
  }
}
@media (min-width: 768px) and ((hover: none) or (pointer: coarse)) {
  .video-grid--compact .card .later-btn,
  .video-grid--list .card .later-btn {
    position: absolute;
    top: 4px;
    width: 44px;
    height: 44px;
    margin: 0;
    background: var(--overlay);
    color: var(--overlay-text);
  }
}

/* shelf (home Runway row): bigger cards, horizontal */
.scroller--shelf .scroller__arrow {
  top: calc((min(44vw, 440px) * 9 / 16) / 2);
}
.shelf {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * 16px) / 2.6);
  gap: 16px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.shelf .card {
  scroll-snap-align: start;
}
.shelf .card__title {
  font-size: 17px;
  line-height: 23px;
}
@media (min-width: 1700px) {
  .shelf {
    grid-auto-columns: calc((100% - 3 * 16px) / 3.4);
  }
}

/* home shelves: 6 cards, never more than 3 per row (2 rows on desktop); phones show 4 (see phone block) */
.video-grid--shelf {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--card-min), calc((100% - 32px) / 3))), 1fr));
}

/* /browse: every tier as a row, A → Z */
.tier-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 0 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tier-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 8px 4px;
  border-bottom: 0.5px solid var(--separator);
  border-radius: 0;
  color: var(--text);
  transition: background-color var(--dur-press);
}
.tier-row:hover .tier-row__name {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tier-row:active {
  background: var(--fill);
}
.tier-row__letter {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 15px;
  font-weight: 700;
}
.tier-row__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tier-row__name {
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}
.tier-row__full {
  overflow: hidden;
  color: var(--text-3);
  font-size: 13px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tier-row__counts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--text-3);
  font-size: 12px;
  line-height: 17px;
  font-variant-numeric: tabular-nums;
  text-align: end;
  white-space: nowrap;
}
.tier-row > .icon {
  color: var(--text-3);
  opacity: 0.6;
}
[dir="rtl"] .tier-row > .icon {
  transform: scaleX(-1);
}
/* the phone "More" rows (live, runway, history, about, language): an iOS grouped list; the rail covers them on desktop */
.browse-page__more {
  display: none;
}
.browse-page__heading {
  margin: 0 0 8px;
}
.more-rows {
  margin: 0 0 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: var(--bg-2);
}
.more-rows.sheet-list--single {
  padding: 0 8px 0 12px;
}

/* search page: AI answer card (only for question-like queries; the model runs on the button press) */
.ai-card {
  margin: 0 0 36px;
  padding: 18px 20px 20px;
  border-radius: var(--radius-l);
  background: var(--bg-2);
}
.ai-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-card__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
}
.ai-card__title {
  font-size: 17px;
  font-weight: 700;
  line-height: 22px;
}
.ai-card__lede {
  max-width: 70ch;
  margin-top: 8px;
  color: var(--text-2);
  font-size: 14px;
}
.ai-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.ai-card[data-state="done"] [data-ai-run],
.ai-card[data-state="done"] [data-ai-lede] {
  display: none;
}
.ai-card[data-state="done"] .ai-card__actions {
  order: 2;
  margin-top: 18px;
}
.ai-card {
  display: flex;
  flex-direction: column;
}
.ai-card__out:empty {
  display: none;
}
.ai-card__out {
  margin-top: 14px;
}
.ai-card__answer p {
  max-width: 72ch;
  font-size: 16px;
  line-height: 1.65;
}
.ai-card__answer p + p {
  margin-top: 10px;
}
.ai-card__ref {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin: 0 2px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--fill-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 2px;
}
.ai-card__ref:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}
.ai-card__note {
  color: var(--text-2);
  font-size: 14px;
}
.ai-card__sources {
  margin: 20px 0 12px;
  font-size: 15px;
  font-weight: 700;
}

/* browse tiles: cover image + label underneath */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 24px 16px;
}
.tile {
  display: block;
  min-width: 0;
  border-radius: var(--radius-m);
  transition: transform var(--dur-press) var(--ease-out);
}
.tile__img {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--thumb-bg);
}
.tile__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile__text {
  display: block;
  padding-top: 10px;
}
.tile__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}
.tile__letter {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 11px;
  font-weight: 700;
}
.tile__count {
  display: block;
  margin-top: 2px;
  padding-inline-start: 30px;
  color: var(--text-3);
  font-size: 13px;
}
.tile:hover .tile__name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ channels */
.avatar {
  width: var(--avatar-size, 40px);
  height: var(--avatar-size, 40px);
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--thumb-bg);
}
.avatar--letter {
  display: inline-grid;
  place-items: center;
  background: var(--fill-2);
  color: var(--text-2);
  font-weight: 700;
  font-size: calc(var(--avatar-size, 40px) * 0.42);
}
.channel-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 4px 16px;
}
.channel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 64px;
  padding: 8px;
  border-radius: var(--radius-m);
}
.channel-row:hover {
  background: var(--fill);
}
.channel-row__body {
  min-width: 0;
}
.channel-row__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.channel-row__name::after {
  content: "";
  position: absolute;
  inset: 0;
}
.channel-row {
  position: relative;
}
.channel-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  color: var(--text-3);
  font-size: 13px;
}
.band {
  font-weight: 600;
}
.band--0 {
  color: var(--band-0);
}
.band--1 {
  color: var(--band-1);
}
.band--2 {
  color: var(--band-2);
}
.channel-head {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 12px 0 24px;
}
.channel-head__body {
  min-width: 0;
}
.channel-head__name {
  font-size: 32px;
}
.channel-head__stats {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 14px;
}
.channel-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 14px;
}
.channel-head__why {
  max-width: 72ch;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 14px;
}
.channel-head__actions {
  margin-top: 14px;
}
.channel-page__tab {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--separator);
}

/* ------------------------------------------------------------------ watch */
.watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  max-width: 1754px;
  margin: 0 auto;
}
@media (min-width: 1180px) {
  .watch {
    grid-template-columns: minmax(0, 1fr) 402px;
    align-items: start;
  }
}
.watch__main {
  min-width: 0;
}
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: #000;
}
.player__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* subtitle strip: glass, directly below the player, never over it */
.sub-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  min-height: 72px;
  margin-top: 12px;
  padding: 12px 12px 12px 18px;
  border-radius: var(--radius-l);
}
.sub-strip__text {
  grid-row: 1 / span 2;
  min-width: 0;
}
.sub-strip__lang {
  grid-column: 2;
  grid-row: 1;
}
/* ai.js translation status (text or a small "Translate" button) under the language picker */
.sub-strip .ai-sub-status {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  max-width: 22ch;
  text-align: end;
}
.sub-strip[data-tr-state="loading"] .ai-sub-status {
  animation: tr-pulse 1.2s ease-in-out infinite;
}
.sub-strip[data-tr-state="limit"] .ai-sub-status,
.sub-strip[data-tr-state="error"] .ai-sub-status {
  color: var(--text);
  font-weight: 500;
}
.sub-strip[data-tr-state="loading"] .sub-strip__tr {
  opacity: 0.55;
}
@keyframes tr-pulse {
  50% {
    opacity: 0.45;
  }
}
.sub-strip__orig {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}
.sub-strip__tr {
  margin-top: 2px;
  color: var(--glass-text-2);
  font-size: 15px;
  line-height: 1.4;
}
.sub-strip__tr:empty {
  display: none;
}
.sub-strip__tr.is-placeholder {
  font-size: 13px;
}
.sub-strip:not([data-state="live"]) .sub-strip__orig {
  color: var(--glass-text-2);
  font-size: 14px;
  font-weight: 500;
}
.sub-strip__lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text);
}
.sub-strip__lang:hover {
  background: var(--fill-2);
}
.sub-strip__lang .icon {
  position: absolute;
  inset-inline-start: 11px;
  pointer-events: none;
  color: var(--glass-text-2);
}
.sub-strip__lang select {
  height: 100%;
  padding: 0 14px 0 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.watch__title {
  margin-top: 16px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.channel-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 12px;
}
.channel-line__channel {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.channel-line__text {
  display: grid;
  min-width: 0;
}
.channel-line__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
}
.channel-line__sub {
  color: var(--text-3);
  font-size: 13px;
}
.channel-line__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.about-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
}
.about-box__meta {
  font-size: 14px;
  font-weight: 600;
}
.summary {
  margin-top: 8px;
}
.summary__title {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.summary__text {
  margin-top: 4px;
  line-height: 1.55;
}
.watch__entities {
  margin-top: 12px;
}
.about-box .chip {
  height: 28px;
  background: var(--fill-2);
  font-size: 13px;
}
.description {
  margin-top: 10px;
}
.description summary {
  display: block;
  list-style: none;
  color: var(--text-2);
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}
.description summary::-webkit-details-marker {
  display: none;
}
.description__preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.description__more {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--text);
  font-weight: 600;
}
.description[open] .description__preview,
.description[open] .description__more {
  display: none;
}
.description__body {
  margin-top: 0;
  color: var(--text-2);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ai-panel {
  margin-top: 16px;
}
.transcript {
  margin-top: 28px;
}
.transcript__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--separator);
}
.transcript__title {
  font-size: 20px;
  font-weight: 700;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
}
.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.transcript__list {
  position: relative;
  max-height: min(56vh, 520px);
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}
.transcript__line {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: start;
  cursor: pointer;
}
.transcript__line:hover {
  background: var(--fill);
}
.transcript__line.is-current {
  background: var(--select-bg);
  box-shadow: inset 3px 0 0 var(--select);
}
.transcript__time {
  color: var(--link);
  font: 500 12px/1.9 var(--font-mono);
}
.transcript__text {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.transcript__tr {
  color: var(--text-2);
  font-size: 14px;
}
.transcript__loading {
  padding: 12px 8px;
  color: var(--text-3);
}

/* ------------------------------------------------------------------ search page / local pages */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}
.search-bar__field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 320px;
  min-width: 0;
  max-width: 560px;
}
.search-bar__field .icon {
  position: absolute;
  inset-inline-start: 12px;
  color: var(--text-3);
  pointer-events: none;
}
.search-bar__input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 38px;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  outline: none;
  font-size: 16px; /* ≥16 px: iOS does not zoom on focus */
}
.search-bar__input:focus {
  box-shadow: 0 0 0 2px var(--focus);
}
.search-bar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.search-bar__filters select.input {
  max-width: 260px;
}
.search-bar__filters input.input {
  width: 160px;
}
.search-bar__sheet-btn {
  display: none;
}
.local-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -8px 0 28px;
}
.local-toolbar__status {
  color: var(--text-3);
  font-size: 13px;
}

/* ------------------------------------------------------------------ pager / prose / keys */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
}
.prose {
  max-width: 680px;
}
.prose h2 {
  margin: 32px 0 12px;
  font-size: 20px;
}
.prose p {
  margin-bottom: 12px;
  color: var(--text-2);
  line-height: 1.6;
}
.prose p a,
.legal-links a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 2px;
}
.legal .prose h2 {
  margin-top: 28px;
  font-size: 17px;
}
.legal-links {
  margin-top: 20px;
}
.keys {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 10px 16px;
  margin: 0;
  font-size: 14px;
}
.keys dt {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}
.keys dd {
  margin: 0;
  color: var(--text-2);
}

/* ------------------------------------------------------------------ sheets (glass) */
.sheet {
  position: fixed;
  max-width: none;
  max-height: none;
  padding: 8px 20px 20px;
  border: 0;
  color: var(--text);
  overflow: auto;
  overscroll-behavior: contain;
}
.sheet::backdrop {
  background: var(--scrim);
}
.sheet,
.sheet--center {
  margin: auto;
  width: min(420px, calc(100vw - 48px));
  border-radius: 22px;
}
.sheet.glass {
  box-shadow:
    inset 0 1px 0 0 var(--glass-hi),
    inset 0 -1px 0 0 var(--glass-lo),
    inset 0 0 0 0.5px var(--glass-edge),
    var(--glass-shadow);
}
.sheet__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}
.sheet__grabber {
  display: none;
}
.sheet__title {
  font-size: 17px;
  font-weight: 600;
}
.sheet__close {
  width: 32px;
  height: 32px;
  background: var(--fill);
  color: var(--glass-text-2);
}
.sheet__close:hover {
  background: var(--fill-2);
}
.sheet-list {
  margin: 4px 0 12px;
  padding: 0;
  list-style: none;
}
.sheet-list__row {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  padding: 0 4px;
  border-radius: 12px;
  font-size: 16px;
  color: var(--text);
}
.sheet-list li + li .sheet-list__row::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 42px 0;
  height: 0.5px;
  background: var(--separator);
}
.sheet-list__row .icon:last-child {
  color: var(--glass-text-2);
  opacity: 0.6;
}
.sheet-list__row:active {
  background: var(--fill);
}
.sheet-list--single {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-top: 0.5px solid var(--separator);
  padding-top: 8px;
}
.sheet-list__row--field {
  grid-template-columns: 24px minmax(0, 1fr);
}
.sheet-list--single .lang-form__select {
  height: 40px;
  max-width: 160px;
  font-size: 15px;
}
.sheet-form {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}
.sheet-form__label {
  margin-top: 8px;
  color: var(--glass-text-2);
  font-size: 13px;
  font-weight: 600;
}
.sheet-form .input {
  width: 100%;
  min-height: 44px;
  background: var(--fill);
}
.sheet-form__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.sheet-form__actions .btn {
  min-height: 48px;
  font-size: 16px;
}
.sheet .keys {
  padding-bottom: 4px;
}

/* ------------------------------------------------------------------ phone tab bar (floating glass capsule) */
.tabbar {
  display: none;
}

/* ================================================================== phone (< 768 px): iOS layout */
@media (max-width: 767.98px) {
  :root {
    --gutter: 16px;
    --appbar-h: 44px;
    --logo-h: 24px;
  }
  body {
    font-size: 15px;
  }
  /* two rows inside the one glass bar: logo (44) + search-or-ask field (44, full width) */
  .appbar__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--appbar-h) auto;
    gap: 0;
    height: auto;
    padding: 0 calc(16px + var(--safe-right)) 0 calc(16px + var(--safe-left));
  }
  .appbar__start {
    margin-inline-start: -6px; /* the brand link's own 6 px padding: logo lines up with the 16 px gutter */
  }
  .appbar__menu,
  .header-tools {
    display: none;
  }
  .search-form {
    height: 44px;
    margin-bottom: 8px;
    padding-inline-end: 5px;
  }
  .search-form__icon {
    padding-inline-start: 12px;
  }
  .search-form__input {
    font-size: 16px; /* ≥ 16 px: iOS Safari does not zoom on focus */
    text-overflow: ellipsis;
  }
  .search-form__input::placeholder {
    font-size: 15px; /* placeholder may be smaller than the 16 px text (no zoom); fits "Search or ask a question" */
  }
  .search-form__kbd {
    display: none;
  }
  .search-form__ask {
    gap: 4px;
    height: 34px;
    padding: 0 10px 0 8px;
    font-size: 12.5px;
  }
  .brand__word {
    font-size: 19px;
  }
  .appbar__title {
    position: absolute;
    left: 50%;
    top: calc(var(--appbar-h) / 2);
    display: block;
    max-width: 62%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
    font-weight: 600;
    opacity: 0;
    transform: translate(-50%, calc(-50% + 4px));
    transition: opacity var(--dur-fade), transform var(--dur-fade) var(--ease-out);
    pointer-events: none;
  }
  html.title-collapsed .appbar__title {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  html.title-collapsed .brand {
    opacity: 0;
    pointer-events: none;
  }

  .page {
    padding-bottom: calc(var(--tabbar-h) + max(10px, var(--safe-bottom)) + 8px);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
  }
  .main {
    padding-top: 8px;
    padding-bottom: 24px;
  }
  .site-footer {
    padding-bottom: 16px;
  }
  .site-footer__links a {
    min-height: 44px;
  }

  /* iOS large title */
  .page-head {
    margin: 4px 0 20px;
  }
  .page-head__title {
    font-size: 34px;
    line-height: 41px;
    letter-spacing: -0.012em;
  }
  .page-head__meta {
    font-size: 15px;
  }
  .section {
    margin-bottom: 36px;
  }
  .section__title {
    font-size: 20px;
  }

  /* bottom tab bar */
  .tabbar {
    position: fixed;
    left: max(16px, var(--safe-left));
    right: max(16px, var(--safe-right));
    bottom: max(10px, var(--safe-bottom));
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: var(--tabbar-h);
    padding: 5px;
    border-radius: 999px;
    box-shadow:
      inset 0 1px 0 0 var(--glass-hi),
      inset 0 -1px 0 0 var(--glass-lo),
      inset 0 0 0 0.5px var(--glass-edge),
      var(--glass-shadow);
    -webkit-user-select: none;
    user-select: none;
  }
  .tabbar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(160deg, rgb(var(--glass-spec) / var(--glass-spec-a)) 0%, rgb(var(--glass-spec) / var(--glass-spec-a2)) 38%, rgb(var(--glass-spec) / 0) 62%);
  }
  .tabbar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--glass-text-2);
    transition: background-color var(--dur-press), transform var(--dur-press) var(--ease-out);
  }
  .tabbar__item .icon {
    width: 24px;
    height: 24px;
  }
  .tabbar__label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 600;
    line-height: 12px;
  }
  .tabbar__item.is-active {
    background: var(--fill);
    color: var(--text);
  }
  .tabbar__item.is-active .icon {
    stroke-width: 2.2;
  }

  /* chips row bleeds to the edges */
  .chips-bar {
    margin-bottom: 12px;
  }
  .chip {
    height: 34px;
  }
  .chip::after {
    content: "";
    position: absolute;
    inset: -5px -5px;
  }

  /* home shelves: 4 cards on phones */
  .video-grid--shelf > :nth-child(n + 5) {
    display: none;
  }
  .browse-page__more {
    display: block;
    margin-bottom: 28px;
  }
  .tier-row {
    grid-template-columns: 34px minmax(0, 1fr) auto 16px;
    gap: 12px;
    min-height: 60px;
  }
  .tier-row__letter {
    width: 34px;
    height: 34px;
  }
  .ai-card {
    margin-bottom: 28px;
    padding: 16px;
  }
  .ai-card .btn {
    flex: 1 1 auto;
  }
  .ai-card .video-grid > .card .card__thumb {
    margin: 0;
    border-radius: var(--radius-m);
  }

  /* imagery first: edge-to-edge thumbnails in feeds */
  .video-grid {
    gap: 28px;
  }
  .video-grid > .card .card__thumb,
  .video-grid--compact > .card .card__thumb {
    margin: 0 calc(-1 * var(--gutter));
    border-radius: 0;
  }
  .card.is-selected {
    outline-offset: 2px;
  }
  .card__body {
    padding-top: 10px;
  }
  .card__title {
    font-size: 15px;
    line-height: 21px;
    font-weight: 500;
  }
  .card__meta {
    font-size: 13px;
    line-height: 18px;
  }
  .shelf {
    grid-auto-columns: 82%;
    gap: 12px;
  }
  .shelf .card__title {
    font-size: 15px;
    line-height: 21px;
  }
  .tiles {
    grid-template-columns: 1fr 1fr;
    gap: 18px 12px;
  }
  .tile__name {
    font-size: 14px;
  }
  .tile__letter {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  .tile__count {
    padding-inline-start: 28px;
    font-size: 12px;
  }

  /* 44 px targets */
  .btn,
  .btn--small,
  .later-btn--label,
  .section__more {
    min-height: 44px;
  }
  .segmented__item {
    min-width: 0;
    flex: 1;
    height: 40px;
  }
  .page-head .segmented {
    display: flex;
  }
  .input {
    min-height: 44px;
    font-size: 16px;
  }
  .sub-strip__lang {
    height: 44px;
  }
  .description__more {
    min-height: 44px;
  }
  .brand {
    height: 44px;
  }
  .segmented__item {
    height: 44px;
  }
  .pill {
    position: relative;
  }
  .pill::after {
    content: "";
    position: absolute;
    inset: -8px 0;
  }
  .channel-line__channel {
    min-height: 44px;
  }
  .toggle {
    min-height: 44px;
  }

  /* channel */
  .channel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-top: 4px;
  }
  .channel-head .avatar {
    --avatar-size: 72px !important;
  }
  .channel-head__name {
    font-size: 28px;
    line-height: 34px;
  }
  .channel-head__actions .btn {
    width: 100%;
  }
  .channel-row__name::after {
    inset: 0;
  }

  /* search tab */
  .search-bar {
    flex-wrap: nowrap;
    margin-bottom: 24px;
  }
  .search-bar__field {
    flex: 1 1 auto;
    max-width: none;
  }
  .search-bar__input {
    height: 44px;
  }
  .search-bar__filters {
    display: none;
  }
  .search-bar__sheet-btn {
    display: inline-flex;
    flex: none;
    padding: 0 14px;
  }
  .search-bar__sheet-btn.is-on {
    background: var(--accent);
    color: var(--accent-contrast);
  }
  .search-bar__sheet-btn.is-on .count-badge {
    background: var(--accent-contrast);
    color: var(--accent);
  }
  .local-toolbar {
    margin-top: -4px;
  }

  /* sheets: float above the bottom edge (iOS 26) */
  .sheet:not(.sheet--center) {
    inset: auto max(8px, var(--safe-left)) calc(8px + var(--safe-bottom)) max(8px, var(--safe-right));
    width: auto;
    margin: 0;
    max-height: calc(100dvh - var(--safe-top) - 40px);
    padding: 6px 18px 18px;
    border-radius: var(--radius-xl);
  }
  .sheet__grabber {
    position: absolute;
    top: 0;
    left: 50%;
    display: block;
    width: 36px;
    height: 5px;
    margin-left: -18px;
    border-radius: 999px;
    background: var(--fill-3);
  }
  .sheet__head {
    padding-top: 10px;
  }
  .sheet__close {
    width: 44px;
    height: 44px;
    margin-inline-end: -6px;
  }

  /* watch: pinned stage (player + strip), page scrolls under the strip */
  body[data-page="watch"] .appbar {
    display: none;
  }
  body[data-page="watch"] .main {
    padding-top: 0;
  }
  .watch {
    display: block;
  }
  .watch__main {
    display: contents;
  }
  /* player and strip are two sticky siblings: a glass layer inside a sticky parent only samples that
     parent's own layer (no blur of the page under it in either engine), so the strip sticks on its own */
  .watch__stage {
    display: contents;
  }
  .player {
    --stage-w: calc(100vw - var(--safe-left) - var(--safe-right));
    position: sticky;
    top: 0;
    z-index: 31;
    height: calc(var(--stage-w) * 9 / 16 + var(--safe-top));
    margin: 0 calc(-1 * var(--gutter));
    border-top: var(--safe-top) solid #000;
    border-radius: 0;
    aspect-ratio: auto;
  }
  .sub-strip {
    position: sticky;
    top: calc((100vw - var(--safe-left) - var(--safe-right)) * 9 / 16 + var(--safe-top));
    z-index: 30;
    min-height: 64px;
    margin: 0 calc(-1 * var(--gutter));
    padding: 8px calc(10px + var(--safe-right)) 8px calc(16px + var(--safe-left));
    border-radius: 0;
    border-bottom: 0.5px solid var(--glass-edge);
  }
  .sub-strip__orig {
    font-size: 16px;
  }
  .sub-strip__tr {
    font-size: 14px;
  }
  .watch__title {
    margin-top: 14px;
    font-size: 18px;
    line-height: 1.32;
  }
  .channel-line__actions {
    flex-wrap: nowrap;
    width: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .channel-line__actions::-webkit-scrollbar {
    display: none;
  }
  .watch__side {
    margin-top: 32px;
  }
  .transcript__list {
    max-height: 60vh;
  }
  .transcript__line {
    min-height: 44px;
  }
}

/* desktop sub-strip floats as a card; phone strip is an edge-to-edge bar (above) */
@media (min-width: 768px) {
  .sub-strip.glass {
    z-index: 0;
  }
  .sub-strip.glass::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(160deg, rgb(var(--glass-spec) / var(--glass-spec-a)) 0%, rgb(var(--glass-spec) / var(--glass-spec-a2)) 38%, rgb(var(--glass-spec) / 0) 62%);
  }
  .sub-strip.glass {
    box-shadow:
      inset 0 1px 0 0 var(--glass-hi),
      inset 0 -1px 0 0 var(--glass-lo),
      inset 0 0 0 0.5px var(--glass-edge),
      var(--glass-shadow);
  }
  .card__thumb {
    transition: border-radius var(--dur-fade) var(--ease-out);
  }
  .card:hover .card__thumb {
    border-radius: 6px;
  }
  .video-grid--compact .card:hover .card__thumb {
    border-radius: 4px;
  }
}

/* ------------------------------------------------------------------ motion */
@media (pointer: coarse) {
  .btn:active,
  .chip:active,
  .tile:active,
  .tabbar__item:active,
  .segmented__item:active,
  .later-btn--label:active {
    transform: scale(0.96);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] {
    transition: transform var(--dur-sheet) var(--ease-sheet), opacity var(--dur-fade) var(--ease-out);
  }
  .sheet[open]::backdrop {
    transition: background-color var(--dur-sheet) var(--ease-out);
  }
  @starting-style {
    .sheet[open] {
      transform: translateY(16px) scale(0.98);
      opacity: 0;
    }
    .sheet[open]::backdrop {
      background-color: rgb(0 0 0 / 0);
    }
  }
  html.rail-open .rail {
    animation: rail-in 240ms var(--ease-sheet);
  }
  @keyframes rail-in {
    from {
      transform: translateX(-24px);
      opacity: 0;
    }
  }
  @view-transition {
    navigation: auto;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 180ms;
  }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 767.98px) {
  @starting-style {
    .sheet[open]:not(.sheet--center) {
      transform: translateY(105%);
      opacity: 1;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}
@media (hover: none) {
  .search-form__kbd {
    display: none;
  }
}
@media print {
  .appbar,
  .rail,
  .tabbar,
  .sub-strip {
    position: static;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
