/* DharmaTube UI. One stylesheet; every colour, radius, blur and size is a variable on :root.
   The layout, components, glass, spacing and motion follow the shared engine (docs/PORT-FT-2026-11-23.md, docs/DESIGN.md):
   light by default, dark under prefers-color-scheme and [data-theme=dark]. DharmaTube keeps its own accent, saffron, for
   one thing: where you are (active rail item, chip, tab, the current transcript line) and the logo.
   Glass only on floating layers: .appbar, .tabbar, .sub-strip, .sheet. Content stays solid. At most 3 glass blocks on
   screen, never nested. DharmaTube's own parts (names in many scripts, hero pages, series, languages) are at the end. */
/* Literata (OFL, public/fonts): Latin, IAST diacritics and Vietnamese. Every other script falls to the system's own font. */

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(/fonts/literata-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(/fonts/literata-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(/fonts/literata-vietnamese-wght-normal.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Literata Fallback: Georgia scaled to Literata's widths and line metrics, so that nothing moves when Literata arrives
   (finding F9: names and counts under a serif hero moved 26 px, CLS 0.25 on a throttled phone). Average advance of
   English text: Literata 400 0.484 em, 600 0.504; Georgia 0.446, Georgia Bold 0.520; measured on the hero names (Chromium
   and WebKit, 390 px) the regular face lands at 107 %. The overrides are Literata's ascent 1.177 and descent 0.308,
   divided by the size-adjust (fontTools, 2026-11-27). Layout preloads the Latin file on pages with a serif hero. */
@font-face {
  font-family: "Literata Fallback";
  font-style: normal;
  font-weight: 200 549;
  src: local("Georgia");
  size-adjust: 107%;
  ascent-override: 110%;
  descent-override: 28.8%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Literata Fallback";
  font-style: normal;
  font-weight: 550 900;
  src: local("Georgia Bold"), local("Georgia-Bold");
  size-adjust: 97%;
  ascent-override: 121.3%;
  descent-override: 31.8%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light;
  /* No Han font is named in the sans stack on purpose: with lang set on every title, the browser picks the right
     regional forms (Japanese 経, Traditional 經, Korean 경) from the system. The tail only helps systems without a default. */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Thai", "Sukhumvit Set", Thonburi, "Leelawadee UI", "Noto Sans Myanmar", "Myanmar Sangam MN", "Myanmar MN", "Myanmar Text", "Noto Sans Sinhala", "Sinhala Sangam MN", "Sinhala MN", "Iskoola Pota", "Noto Sans Khmer", "Khmer Sangam MN", "Khmer MN", "Noto Sans Lao", "Lao Sangam MN", "Lao MN", "Noto Serif Tibetan", Kailasa, "Microsoft Himalaya", "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Noto Sans Bengali", "Kohinoor Bangla", "Bangla Sangam MN", "Nirmala UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* card and row titles: the sans. The serif (Literata, --font-serif below) is kept for the names in
     many scripts on DharmaTube's hero pages, where IAST diacritics and source-language names are the content. */
  --font-title: var(--font-sans);
  --serif-han: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", STSong;
  --tail: "Noto Sans Thai", "Sukhumvit Set", Thonburi, "Leelawadee UI", "Noto Sans Myanmar", "Myanmar Sangam MN", "Myanmar MN", "Myanmar Text", "Noto Sans Sinhala", "Sinhala Sangam MN", "Sinhala MN", "Iskoola Pota", "Noto Sans Khmer", "Khmer Sangam MN", "Khmer MN", "Noto Sans Lao", "Lao Sangam MN", "Lao MN", "Noto Serif Tibetan", Kailasa, "Microsoft Himalaya", "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Noto Sans Bengali", "Kohinoor Bangla", "Bangla Sangam MN", "Nirmala UI";

  /* line height by script: stacked marks need room. Set per language below; everything else reads these. */
  --lh-title: 1.32;
  --lh-body: 1.5;

  /* 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);
  --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) */
  /* DharmaTube's accent: where you are, and the logo */
  --saffron: #d9730b;
  --saffron-ink: #8f4a00; /* saffron as text on white, 6:1 */
  --saffron-soft: rgb(217 115 11 / 0.12); /* behind active items */

  /* ---- glass material (docs/DESIGN.md §5; tune here) ----
     Clear glass: the content stays visible through it (little blur, a light tint), edged by a bright 1 px top line and
     a 0.5 px rim, with a soft specular sheen on floating pieces. Text never relies on the tint: fields and the selected
     tab carry their own fill (--glass-field), tab labels, header icons and the compact title a small feathered scrim
     (--glass-scrim-a), and labels and icons a soft halo right behind each glyph (--glass-halo). */
  --glass-rgb: 255 255 255;
  --glass-a-bar: 0.28; /* header, phone top bar */
  --glass-a-tab: 0.3; /* phone tab capsule: a light wash over a backdrop that stays sharp */
  --glass-a-strip: 0.66; /* subtitle strip (reading text) */
  --glass-a-sheet: 0.68; /* sheets / popovers (dense text, over a scrim) */
  --glass-blur: 6px;
  --glass-blur-tab: 3px; /* almost none: what is behind the capsule keeps its shapes (the frosted look comes from blur, not from the wash) */
  --glass-sat-tab: 160%;
  --glass-contrast-tab: 0.7; /* the backdrop is lifted towards light, so dark pictures do not swallow the labels */
  --glass-bright-tab: 1.2;
  --glass-lens: 7px; /* the band along the capsule's edge where the backdrop bends: more blur, a little brighter */
  --glass-lens-blur: 5px;
  --glass-lens-bright: 1.07;
  --glass-blur-sheet: 14px;
  --glass-sat: 180%;
  --glass-bright: 1.2; /* the backdrop itself is lifted towards light: a dark picture under the bar never swallows the logo */
  --glass-contrast: 0.7;
  --glass-hi: rgb(255 255 255 / 0.95); /* 1px top edge: where the light catches */
  --glass-rim: rgb(255 255 255 / 0.55); /* 0.5px bright rim all round (floating pieces), bottom line of bars */
  --glass-lo: rgb(0 0 0 / 0.04); /* faint bottom inner line */
  --glass-edge: rgb(0 0 0 / 0.08); /* 0.5px outer hairline: keeps the edge on a white page */
  --glass-shadow: 0 6px 20px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04);
  --glass-ring: inset 0 1px 0 0 var(--glass-hi), inset 0 0 0 0.5px var(--glass-rim), inset 0 -1px 0 0 var(--glass-lo), 0 0 0 0.5px var(--glass-edge), var(--glass-shadow);
  --glass-spec: 255 255 255;
  --glass-spec-a: 0.14; /* specular sheen, upper-left */
  --glass-spec-a2: 0.02;
  --glass-text-2: #1f1f24; /* secondary text on glass: near the primary colour, the glass no longer whitens what is under it */
  --glass-halo-rgb: 255 255 255;
  --glass-halo: 0 0 1px rgb(var(--glass-halo-rgb) / 0.9), 0 0 2px rgb(var(--glass-halo-rgb) / 0.7), 0 0 5px rgb(var(--glass-halo-rgb) / 0.4);
  --glass-halo-icon: drop-shadow(0 0 1px rgb(var(--glass-halo-rgb) / 0.9)) drop-shadow(0 0 3px rgb(var(--glass-halo-rgb) / 0.5));
  /* the tab labels' halo: 10 px text over any picture (measured 2026-11-20 over the home page's brightest and darkest
     thumbnails, the text against what is right around its glyphs: worst 2.5:1 light / 1.7:1 dark with --glass-halo,
     4.6:1 / 3.7:1 with this). Denser close to the glyph, softer out to 12 px; still no pad, the glass is unchanged */
  --glass-halo-label: 0 0 1px rgb(var(--glass-halo-rgb) / 1), 0 0 1px rgb(var(--glass-halo-rgb) / 1), 0 0 2px rgb(var(--glass-halo-rgb) / 1), 0 0 3px rgb(var(--glass-halo-rgb) / 1), 0 0 4px rgb(var(--glass-halo-rgb) / 0.9), 0 0 7px rgb(var(--glass-halo-rgb) / 0.7), 0 0 12px rgb(var(--glass-halo-rgb) / 0.45);
  /* dark theme: light text over a bright picture is the harder case, the graphite halo a little denser and wider */
  --glass-halo-label-dark: 0 0 1px rgb(var(--glass-halo-rgb) / 1), 0 0 1px rgb(var(--glass-halo-rgb) / 1), 0 0 2px rgb(var(--glass-halo-rgb) / 1), 0 0 3px rgb(var(--glass-halo-rgb) / 1), 0 0 4px rgb(var(--glass-halo-rgb) / 1), 0 0 6px rgb(var(--glass-halo-rgb) / 0.9), 0 0 9px rgb(var(--glass-halo-rgb) / 0.75), 0 0 14px rgb(var(--glass-halo-rgb) / 0.5);
  --glass-field: rgb(255 255 255 / 0.3); /* search field, language picker on glass: a lighter pane of the same glass */
  --glass-pick: rgb(120 120 128 / 0.16); /* the selected tab: the system's quiet grey, so it shows on a white page too */
  --glass-pick-ring: inset 0 0 0 0.5px rgb(255 255 255 / 0.55), inset 0 1px 0 0 rgb(255 255 255 / 0.8), 0 1px 2px rgb(0 0 0 / 0.05);
  --ask-fill: rgb(120 120 128 / 0.14); /* the Ask button: the system's quiet grey fill, a separate piece inside the outline */
  --glass-scrim-a: 0; /* no pads behind labels, icons or the compact title: glyphs carry a thin halo only */

  /* shape & size */
  --radius-s: 8px;
  --sq: 1; /* 1.55 where corners are continuous (corner-shape below): the radius grows so a corner keeps its visual size */
  --radius-m: calc(12px * var(--sq));
  --radius-l: calc(16px * var(--sq));
  --radius-xl: calc(28px * var(--sq));
  --gutter: 24px;
  --appbar-h: 56px;
  --rail-w: 240px;
  --rail-mini: 72px;
  --rail-space: 0px;
  --tabbar-h: 62px;
  --card-min: 300px;
  --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;
  --press-scale: 0.97; /* every press, touch or pointer: buttons, chips, tiles, tabs, cards (docs/DESIGN.md §4) */
  --dur-fade: 200ms;
  --dur-sheet: 320ms;
}

/* The serif stack is re-declared wherever a lang attribute sits, so a Han fallback follows the language of that element. */

html,
[lang] {
  --font-serif: "Literata", "Literata Fallback", var(--serif-han), var(--tail), Georgia, serif;
}
:lang(zh-Hant) {
  --serif-han: "Songti TC", "Noto Serif CJK TC", "Source Han Serif TC", PMingLiU;
}
:lang(ja) {
  --serif-han: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", "Source Han Serif";
}
:lang(ko) {
  --serif-han: AppleMyungjo, "Noto Serif CJK KR", "Source Han Serif K", Batang;
}

/* Literata is for Latin-script languages. Han, Hangul, Thai and the rest set their digits and brackets in the same face
   as their letters; scripts with no serif on most systems use the sans in the serif's place too. */

:lang(th),
:lang(lo),
:lang(km),
:lang(my),
:lang(si),
:lang(hi),
:lang(ne),
:lang(bn),
:lang(mr),
:lang(sa):not(:lang(sa-Latn)) {
  --font-serif: var(--font-sans);
}
:lang(vi) {
  --lh-title: 1.4;
  --lh-body: 1.58;
}
:lang(th),
:lang(lo) {
  --lh-title: 1.58;
  --lh-body: 1.72;
}
:lang(km),
:lang(my),
:lang(si),
:lang(hi),
:lang(ne),
:lang(bn),
:lang(mr) {
  --lh-title: 1.7;
  --lh-body: 1.8;
}
:lang(bo),
:lang(dz) {
  --lh-title: 1.95;
  --lh-body: 2.05;
}

/* romanised Sanskrit and Pali are Latin text, so they do not need the Devanagari line height */

:lang(sa-Latn),
:lang(pi-Latn) {
  --lh-title: 1.32;
  --lh-body: 1.5;
}

@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);
  --saffron: #f0a044;
  --saffron-ink: #f4b26a;
  --saffron-soft: rgb(240 160 68 / 0.17);
    --saffron: #f0a044;
    --saffron-ink: #f4b26a;
    --saffron-soft: rgb(240 160 68 / 0.17);
    --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: 46 46 50;
    --glass-a-bar: 0.26;
    --glass-a-tab: 0.3;
    --glass-sat-tab: 150%;
    --glass-contrast-tab: 0.8;
    --glass-bright-tab: 0.62;
    --glass-lens-bright: 0.9;
    --glass-bright: 0.66;
    --glass-contrast: 0.82;
    --glass-a-strip: 0.74;
    --glass-a-sheet: 0.7;
    --glass-sat: 170%;
    --glass-hi: rgb(255 255 255 / 0.24);
    --glass-rim: rgb(255 255 255 / 0.13);
    --glass-lo: rgb(0 0 0 / 0.2);
    --glass-edge: rgb(255 255 255 / 0.08);
    --glass-shadow: 0 8px 28px rgb(0 0 0 / 0.4);
    --glass-spec-a: 0.07;
    --glass-spec-a2: 0.02;
    --glass-text-2: #d6d6db;
    --glass-halo-rgb: 12 12 14;
    --glass-halo-label: var(--glass-halo-label-dark);
    --glass-field: rgb(255 255 255 / 0.1);
    --glass-pick: rgb(255 255 255 / 0.1);
    --glass-pick-ring: inset 0 0 0 0.5px rgb(255 255 255 / 0.2), inset 0 1px 0 0 rgb(255 255 255 / 0.3), 0 1px 2px rgb(0 0 0 / 0.25);
    --ask-fill: rgb(120 120 128 / 0.3);
  }
}
: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);
  --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: 46 46 50;
  --glass-a-bar: 0.26;
  --glass-a-tab: 0.3;
  --glass-sat-tab: 150%;
  --glass-contrast-tab: 0.8;
  --glass-bright-tab: 0.62;
  --glass-lens-bright: 0.9;
  --glass-bright: 0.66;
  --glass-contrast: 0.82;
  --glass-a-strip: 0.74;
  --glass-a-sheet: 0.7;
  --glass-sat: 170%;
  --glass-hi: rgb(255 255 255 / 0.24);
  --glass-rim: rgb(255 255 255 / 0.13);
  --glass-lo: rgb(0 0 0 / 0.2);
  --glass-edge: rgb(255 255 255 / 0.08);
  --glass-shadow: 0 8px 28px rgb(0 0 0 / 0.4);
  --glass-spec-a: 0.07;
  --glass-spec-a2: 0.02;
  --glass-text-2: #d6d6db;
  --glass-halo-rgb: 12 12 14;
  --glass-halo-label: var(--glass-halo-label-dark);
  --glass-field: rgb(255 255 255 / 0.1);
  --glass-pick: rgb(255 255 255 / 0.1);
  --glass-pick-ring: inset 0 0 0 0.5px rgb(255 255 255 / 0.2), inset 0 1px 0 0 rgb(255 255 255 / 0.3), 0 1px 2px rgb(0 0 0 / 0.25);
  --ask-fill: rgb(120 120 128 / 0.3);
}

/* 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-halo: none;
    --glass-halo-icon: none;
    --glass-halo-label: none;
    --glass-halo-label-dark: none;
    --glass-scrim-a: 0;
  }
  .glass,
  .tabbar::after {
    -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-halo: none;
    --glass-halo-icon: none;
    --glass-halo-label: none;
    --glass-halo-label-dark: none;
    --glass-scrim-a: 0;
  }
}

/* ------------------------------------------------------------------ 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)) contrast(var(--glass-contrast)) brightness(var(--glass-bright));
  backdrop-filter: blur(var(--g-blur)) saturate(var(--glass-sat)) contrast(var(--glass-contrast)) brightness(var(--glass-bright));
}
.glass--tab {
  --g-a: var(--glass-a-tab);
  --g-blur: var(--glass-blur-tab);
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--glass-sat-tab)) contrast(var(--glass-contrast-tab)) brightness(var(--glass-bright-tab));
  backdrop-filter: blur(var(--g-blur)) saturate(var(--glass-sat-tab)) contrast(var(--glass-contrast-tab)) brightness(var(--glass-bright-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;
  corner-shape: 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%);
}

/* the glass is clear, so whatever scrolls under it can be as dark (light theme) or as bright (dark theme) as a
   thumbnail gets: labels and icons on glass carry a soft halo in the glass colour right behind each glyph (a local
   scrim; invisible over the page colour), fields carry their own fill */

.appbar :is(.brand, .appbar__title),
.tabbar__item,
.sub-strip__text {
  text-shadow: var(--glass-halo);
}
.appbar .icon-btn > .icon,
.tabbar__item > .icon {
  filter: var(--glass-halo-icon);
}
.appbar .brand__logo {
  filter: drop-shadow(0 0 1.5px rgb(var(--glass-halo-rgb) / var(--glass-scrim-a)));
}
.appbar .icon-btn {
  background-image: radial-gradient(closest-side, rgb(var(--glass-halo-rgb) / var(--glass-scrim-a)), rgb(var(--glass-halo-rgb) / var(--glass-scrim-a)) 55%, rgb(var(--glass-halo-rgb) / 0));
}
@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 / var(--lh-body) 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;
}

/* headings and short paragraphs never end on one lone word (or character). The longhand only: the shorthand would
   also reset the wrap mode (white-space: nowrap). Titles clamped to a line count (cards) keep the plain wrap, so the
   words they show do not change. */

.page-head__title,
.section__title,
.ai-chat__title,
.watch__title,
.channel-head__name,
.ent-card__name {
  text-wrap-style: balance;
}
.page-head__meta,
.section__lede,
.ai-chat__lead,
.ai-chip,
.empty {
  text-wrap-style: pretty;
}
: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:disabled {
  opacity: 0.4;
  pointer-events: none; /* no hover, press or tap feedback on a button that does nothing */
}
.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: calc(10px * var(--sq, 1));
  corner-shape: squircle;
  background: var(--fill);
  outline: none;
  font-size: 15px;
}
.input:focus {
  box-shadow: 0 0 0 2px var(--focus);
}
.input::placeholder {
  color: var(--text-3); /* the UA grey was ~3.3:1 on the dark fill */
}
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);
}
.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);
  box-shadow: inset 0 -1px 0 0 var(--glass-rim); /* the bright edge line above the hairline */
}
.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;
}

/* the logo is one <picture> (layout.tsx Brandmark): its source picks the dark file for the dark scheme, so only one file
   is downloaded. A [data-theme] override swaps the file here. */

.brand picture {
  display: contents;
}
:root[data-theme="dark"] .brand__logo {
  content: url("/brand/logo-dark.svg");
}
:root[data-theme="light"] .brand__logo {
  content: url("/brand/logo.svg");
}
.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, with its own fill so the text reads over
   anything under the clear bar) holding the input, the "/" hint and the sparkle "Ask" 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(--glass-field);
  transition: background-color var(--dur-fade);
}
.search-form:focus-within {
  background: var(--bg);
  /* the focus ring every control has (the violet outline is too faint to be the only sign) */
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.search-form__field {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}
.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(--text-3);
  opacity: 1;
}

/* WebKit shows its own clear button whenever the field has text, right next to Ask (Esc and select-all clear it) */

.search-form__input::-webkit-search-cancel-button {
  display: none;
}
.search-form__kbd {
  flex: none;
  min-width: 34px;
  pointer-events: none;
}
.search-form__kbd-tab {
  display: none;
}
.search-form:focus-within .search-form__kbd {
  display: none;
}

/* focused and empty with an example showing: "Tab" takes the example (app.js); mouse/keyboard devices only */

@media (hover: hover) and (pointer: fine) {
  .search-form.has-example:focus-within:has(.search-form__input:placeholder-shown) .search-form__kbd {
    display: inline-block;
  }
  .search-form:focus-within .search-form__kbd-slash {
    display: none;
  }
  .search-form:focus-within .search-form__kbd-tab {
    display: inline;
  }
}
.search-form__ask {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 32px;
  padding: 0 11px 0 8px;
  border: 0;
  border-radius: 999px;
  background: var(--ask-fill); /* a quiet grey piece of its own: no rim, no shadow, so it never reads as part of the outline */
  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__ask:hover {
  background: rgb(120 120 128 / 0.22);
}
.search-form__ask:active {
  transform: scale(var(--press-scale));
}

/* the ring inside the button: outside it, it would land on the field's own outline (4 px away) and replace it there */

.search-form__ask:focus-visible {
  outline-offset: -2px;
}
.search-form__ask-short {
  display: none;
}

/* ------------------------------------------------------------------ AI ring: the one expressive element
   The search-or-ask field and the /ask composer: the box's own hairline outline (1 px, 1.5 px on focus) is a closed
   warm-to-violet line, and two soft lights travel round it, once every --ai-lap. Nothing is drawn outside the box:
   no glow, no comet head. The mask keeps the colour on the outline, so the text is never touched.
   Brighter on hover and focus; a still gradient outline under prefers-reduced-motion. */

:root {
  --ai-lap: 7s;
  --ai-light: 68px; /* the travelling light: its length along the outline */
  --ai-line: linear-gradient(115deg, rgb(var(--ai-cool) / 0.5), rgb(var(--ai-mid) / 0.32) 55%, rgb(var(--ai-cool) / 0.42)); /* the still line: violet, so the warm lights read as moving */
  --ai-w: 1px; /* the outline: a hairline */
  --ai-ring-o: 0.8;
  --ai-hot: 255 122 40; /* warm orange */
  --ai-mid: 236 58 132; /* rose */
  --ai-cool: 118 70 255; /* violet */
  --ai-halo: 0.16; /* ask chips' hover ring */
  --ai-edge: linear-gradient(115deg, rgb(var(--ai-cool) / 0.5), rgb(var(--ai-mid) / 0.45), rgb(var(--ai-hot) / 0.55));
  --pop-bg: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ai-ring-o: 0.8;
    --ai-hot: 255 170 92;
    --ai-mid: 255 96 168;
    --ai-cool: 156 122 255;
    --ai-halo: 0.22;
    --pop-bg: #222224;
  }
}
:root[data-theme="dark"] {
  --ai-ring-o: 0.8;
  --ai-hot: 255 170 92;
  --ai-mid: 255 96 168;
  --ai-cool: 156 122 255;
  --ai-halo: 0.22;
  --pop-bg: #222224;
}

/* keep only the padding band: border box minus content box (both follow the border radius). The band's own
   background is the still line, closed all the way round; the lights travel over it. */

.ai-ring {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: var(--ai-w);
  border-radius: inherit;
  corner-shape: inherit;
  pointer-events: none;
  background: var(--ai-line);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: var(--ai-ring-o);
  transition: opacity var(--dur-fade) var(--ease-out);
}

/* the flow: two soft lights, half a lap apart, move along the outline itself at a steady speed (the path is this
   box's own rounded edge, the one `offset-path: inset(0 round var(--ai-r))` takes), so they go round the ends instead
   of jumping across. app.js moves them (.is-flowing) with transform keyframes along that edge: the compositor runs
   those in every engine, while Chromium runs an offset-distance animation on the main thread and repaints the header
   every frame. Only the part of each light that lies on the outline shows. One colour per stop, never `transparent`
   (WebKit draws a dark band). Without JavaScript, and where a pseudo-element cannot be animated, the still line stays. */

.ai-ring.is-flowing::before,
.ai-ring.is-flowing::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--ai-light);
  height: var(--ai-light);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(var(--ai-hot) / 1), rgb(var(--ai-hot) / 0.92) 16%, rgb(var(--ai-mid) / 0.72) 40%, rgb(var(--ai-cool) / 0.34) 68%, rgb(var(--ai-cool) / 0));
}
.search-form:hover,
.ai-composer:hover {
  --ai-ring-o: 1;
}
.search-form:focus-within,
.ai-composer:focus-within {
  --ai-w: 1.5px;
  --ai-ring-o: 1;
}

/* ------------------------------------------------------------------ Ask buttons (header pill, /ask send)
   A soft light sweeps across the button every 5 s, the sparkle's three stars twinkle out of phase, and the edge
   and stars carry the ring's gradient. The label stays plain text on a solid fill (contrast unchanged). */

.ask-btn {
  position: relative;
  isolation: isolate;
  --sheen: var(--ai-hot);
  --sheen-a: 0.3;
}
.ask-btn__sheen {
  position: absolute;
  inset: 0;
  z-index: -1; /* above the button's fill, under its label and icon */
  overflow: hidden;
  border-radius: inherit;
  corner-shape: inherit;
  pointer-events: none;
}
.ask-btn__sheen::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60%;
  background: linear-gradient(105deg, rgb(var(--sheen) / 0) 0%, rgb(var(--sheen) / var(--sheen-a)) 50%, rgb(var(--sheen) / 0) 100%);
  transform: translateX(-110%);
  will-change: transform;
  animation: ask-sheen 5s ease-in-out 1.2s infinite;
}
@keyframes ask-sheen {
  0% {
    transform: translateX(-110%);
  }
  26%,
  100% {
    transform: translateX(185%);
  }
}
.ask-spark {
  position: relative;
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
}
.ask-spark__star {
  position: absolute;
  inset: 0;
}

/* the stars twinkle only while the box is pointed at or in use: at rest the header has one motion, the outline's lights */

.ask-btn:hover .ask-spark__star,
.ask-btn:focus-visible .ask-spark__star,
.search-form:focus-within .ask-spark__star,
.ai-composer:focus-within .ask-spark__star {
  will-change: transform, opacity;
  animation: ask-twinkle 2.8s ease-in-out infinite;
}
.ask-spark__star--0 {
  transform-origin: 41.7% 42%;
}
.ask-spark__star--1 {
  transform-origin: 72.9% 22.9%;
  animation-delay: -0.95s;
}
.ask-spark__star--2 {
  transform-origin: 70.8% 70%;
  animation-delay: -1.9s;
}
@keyframes ask-twinkle {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  38% {
    transform: scale(0.68);
    opacity: 0.45;
  }
  54% {
    transform: scale(1.14);
    opacity: 1;
  }
  68% {
    transform: scale(1);
  }
}
.ai-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.ai-grad__a {
  stop-color: rgb(var(--ai-cool));
}
.ai-grad__b {
  stop-color: rgb(var(--ai-mid));
}
.ai-grad__c {
  stop-color: rgb(var(--ai-hot));
}
@media (prefers-reduced-motion: reduce) {/* a still gradient outline; no flow, sweep or twinkle */
  
  .ai-ring::before,
  .ai-ring::after {
    display: none;
  }
  .ask-spark__star {
    animation: none;
  }
  .ask-btn__sheen {
    display: none;
  }
}

/* example questions typed over the empty field (app.js; aria-hidden). The native placeholder is hidden only once
   app.js has taken over (.has-hint), so it still shows without JavaScript and under reduced motion. contain:
   strict keeps the typing from touching the layout around it. */

.ask-hint {
  position: absolute;
  inset-block: 0;
  inset-inline: 4px;
  overflow: hidden;
  contain: strict;
  /* the placeholder's colour, not the text's: an example must never look typed (walkthrough 11-28) */
  color: var(--text-3);
  font-size: 15px;
  line-height: 40px;
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: var(--hint-o, 1);
  pointer-events: none;
}

/* a typewriter caret in the ring's rose; hidden while the field has focus (the real caret is there) */

.ask-hint::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-inline-start: 1px;
  border-radius: 1px;
  vertical-align: -0.18em;
  background: rgb(var(--ai-mid));
  opacity: 0;
}
/* the caret only while an example is being typed or erased: a caret blinking after a resting example read as text
   already in the field */
.ask-hint.is-live.is-typing::after {
  opacity: 1;
}
:focus ~ .ask-hint::after {
  visibility: hidden;
}
.has-hint .search-form__input::placeholder,
.has-hint .ai-composer__input::placeholder {
  color: transparent;
}
.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

/* language: a round translate button and a small menu of the languages that have strings (a <details>; app.js adds
   Escape, outside click and arrow keys). Solid, not glass: it opens inside the glass header, and glass is never
   nested. */

.lang-menu {
  position: relative;
}
.lang-menu__btn {
  list-style: none;
}
.lang-menu__btn::-webkit-details-marker {
  display: none;
}
.lang-menu__btn::marker {
  content: "";
}
.lang-menu[open] > .lang-menu__btn {
  background: var(--fill-2);
}
.lang-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: -4px;
  z-index: 60;
  min-width: 196px;
  /* eleven languages: on a short screen (a phone in landscape) the list scrolls inside the menu */
  max-height: calc(100vh - var(--appbar-h, 56px) - 16px);
  max-height: calc(100dvh - var(--appbar-h, 56px) - 16px - var(--safe-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: calc(16px * var(--sq, 1));
  corner-shape: squircle;
  background: var(--pop-bg);
  box-shadow: 0 0 0 0.5px var(--separator), var(--shadow-pop);
  transform-origin: top right;
}
[dir="rtl"] .lang-menu__panel {
  transform-origin: top left;
}
.lang-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  padding-inline: 14px 10px;
  border-radius: calc(16px * var(--sq, 1) - 6px); /* the panel's radius minus its 6 px padding: an even gap at the corner */
  corner-shape: squircle;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.lang-menu__item:hover {
  background: var(--fill);
}
.lang-menu__item:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.lang-menu__item[aria-current] {
  background: var(--fill);
  font-weight: 650;
}
.lang-menu__item .icon {
  width: 18px;
  height: 18px;
}
@media (pointer: coarse) {
  .lang-menu__item {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .lang-menu[open] .lang-menu__panel {
    animation: lang-pop 160ms var(--ease-out);
  }
  @keyframes lang-pop {
    from {
      opacity: 0;
      transform: translateY(-4px) scale(0.96);
    }
  }
}

/* ------------------------------------------------------------------ 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 {
  margin: -2px -6px;
  padding: 2px 6px;
  border-radius: 6px; /* its focus ring is rounded like the rows' */
}
.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: calc(10px * var(--sq, 1));
  corner-shape: squircle;
  font-size: 14px;
  color: var(--text);
  transition: background-color var(--dur-press);
}
.rail__item:hover {
  background: var(--fill);
}
.rail__item.is-active {
  background: var(--saffron-soft);
  color: var(--saffron-ink);
  font-weight: 600;
}
.rail__item--shelf {
  gap: 16px;
  min-height: 36px;
}
.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--shelves {
    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--shelves,
html:not(.rail-open) body[data-page="watch"] .rail__group--shelves {
    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(--saffron-ink);
  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: 14px;
}
.page-head__kicker a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.page-head__title {
  font-size: 32px;
  line-height: max(1.18, var(--lh-title));
  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: max(1.3, var(--lh-title));
  font-weight: 700;
  letter-spacing: -0.012em;
}
.section__lede {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 14px;
}

/* Home: one line saying what the site is, above the first shelf; it leads to About. */

.home__intro {
  margin: 2px 0 22px;
  max-width: 62ch;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: balance;
}
.home__intro a {
  color: inherit;
  text-decoration: none;
}
.home__intro a:hover,
.home__intro a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.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 state (components.tsx Empty, after coss ui's Empty): icon in a soft disc, a title, one line of help, actions.
   --compact is the same block in one row, for an empty shelf on a page that has other content. */

.empty {
  padding: 32px 0;
  color: var(--text-3);
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--text-2);
}
.empty--compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}
.empty--compact .empty__icon {
  flex: none;
  width: 36px;
  height: 36px;
  margin: 0;
}
.empty--compact .empty__icon .icon {
  width: 20px;
  height: 20px;
}
.empty__title {
  display: block;
  color: var(--text);
  font-weight: 600;
}
.empty__help {
  display: block;
  margin-top: 4px;
  max-width: 60ch;
}
/* the keyboard line where there is a keyboard, the touch line on a touch screen (finding F13) */
.empty__touch {
  display: none;
}
@media (hover: none) {
  .empty__keys {
    display: none;
  }
  .empty__touch {
    display: inline;
  }
}

/* a thumbnail YouTube no longer has (its 404 picture, or none: finding F8): the box's own calm fill and a faint mark,
   set by app.js */
.thumb-missing {
  visibility: hidden;
}
.thumb-gone {
  position: relative;
  background: var(--thumb-bg);
}
.thumb-gone::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 32px;
  height: 32px;
  background: var(--text-3);
  opacity: 0.5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Cpath d='m10 9.5 4.5 2.5-4.5 2.5z'/%3E%3Cpath d='M4 4l16 16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Cpath d='m10 9.5 4.5 2.5-4.5 2.5z'/%3E%3Cpath d='M4 4l16 16'/%3E%3C/svg%3E") center / contain no-repeat;
}
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--fill);
}
.empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
@media (hover: hover) and (pointer: fine) {
  .scroller[data-can-prev] .scroller__arrow--prev,
  .scroller[data-can-next] .scroller__arrow--next {
    display: grid;
  }

/* a chip reached with Tab scrolls clear of the arrows (96 px on the chips row, 40 px elsewhere) */

  
  .scroller .chips-bar__track {
    scroll-padding-inline: 100px;
  }
  .scroller .sr-bar__track {
    scroll-padding-inline: 44px;
  }
}
.local-note {
  margin: 0 0 24px;
  color: var(--text-2);
}

/* skeleton (public/feedback.js, the watch page's transcript): grey shapes where text or cards are on their way.
   A slow pulse; still under prefers-reduced-motion. Always aria-hidden; the region that waits carries aria-busy. */

.skeleton {
  display: block;
  border-radius: 6px;
  background: var(--fill-2);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  50% {
    opacity: 0.45;
  }
}
.skeleton-lines {
  display: grid;
  gap: 10px;
  padding: 4px 0;
}
.skeleton--line {
  height: 12px;
}
.skeleton--short {
  width: 64%;
}
.skeleton--meta {
  width: 42%;
  height: 10px;
}
.skeleton--time {
  width: 36px;
  height: 12px;
  margin-top: 4px;
}
.skeleton-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.skeleton-card__thumb {
  aspect-ratio: 16 / 9;
  margin-bottom: 4px;
  border-radius: var(--radius-m);
}
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}

/* toasts (public/feedback.js, after coss ui's Toast): ink on paper turned over, at the bottom edge; at most three */

.toasts {
  position: fixed;
  inset-inline-start: 24px;
  bottom: 24px;
  z-index: 60;
  width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}
.toasts__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 6px 6px 16px;
  border-radius: var(--radius-m);
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-pop);
  font-size: 14px;
  line-height: 1.4;
  pointer-events: auto;
  transition: opacity var(--dur-fade) var(--ease-out), transform var(--dur-fade) var(--ease-out);
}
.toast__text {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  overflow-wrap: anywhere;
}
.toast__action {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1px currentColor;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 36px;
  cursor: pointer;
}
.toast__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: 0.75;
  cursor: pointer;
}
.toast__close:hover,
.toast__action:hover {
  opacity: 1;
  background: rgb(var(--bg-rgb) / 0.12);
}
.toast__close:focus-visible,
.toast__action:focus-visible {
  outline: 2px solid var(--accent-contrast);
  outline-offset: 1px;
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
}
@starting-style {
  .toast {
    opacity: 0;
    transform: translateY(10px);
  }
}
@media (max-width: 767.98px) {/* above the floating tab bar, or above the software keyboard when one is up */
  
  .toasts {
    inset-inline: 16px;
    width: auto;
    bottom: calc(var(--tabbar-h) + max(10px, var(--safe-bottom)) + 12px);
  }
  html.kb-open .toasts {
    bottom: calc(var(--kb-inset, 0px) + 12px);
  }
  .toast__action,
  .toast__close {
    min-width: 44px;
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-leaving {
    transform: none;
  }
}
.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: 96px; /* wide enough that the chevron sits on the solid part, never on a label */
  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) 55%, 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) 55%, 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(--saffron-soft);
  color: var(--saffron-ink);
  font-weight: 600;
}
.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;
}

/* dark: the type label ("Venue", "City") on the grey chip inside the description box was 4.3:1 */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .about-box .chip__type {
    color: var(--text-2);
  }
}
:root[data-theme="dark"] .about-box .chip__type {
  color: var(--text-2);
}

/* ------------------------------------------------------------------ video cards (solid content) */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr));
  gap: 40px 16px;
}
.video-grid + .video-grid {
  margin-top: 40px;
}
.card {
  position: relative;
  min-width: 0;
  border-radius: calc(14px * var(--sq, 1));
  corner-shape: squircle;
}
.card.is-selected,
.channel-row.is-selected {
  outline: 2px solid var(--select);
  outline-offset: 6px;
}

/* keyboard focus on a card's title link rings the whole card: the title's own outline was cut off by the
   two-line clamp (overflow: hidden) */

@supports selector(:has(*)) {
  .card__link:focus-visible {
    outline: none;
  }
  .card:has(.card__link:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: 6px;
  }
}
.card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-m);
  corner-shape: squircle;
  --cc-r: 12px; /* the same radius for Safari's continuous corner (end of file) */
  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;
}

/* an upcoming stream's start on its own line, one line high: app.js rewrites it in the viewer's time zone
   ("Starts in 3 hours · Wed, Nov 5, 1:00 PM"), longer than the server's text, and the card must not grow when it does
   (the whole time is in its title) */

.card__sub > .countdown {
  flex: 1 0 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.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,
.card__link {
  font-family: var(--font-title);
  line-height: var(--lh-title);
}
.card__title {
  font-size: 16.5px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
/* the AI mark before the original title (components.tsx OrigLine): the title above is an AI translation */
.ai-tag--orig {
  margin-inline-end: 6px;
  padding: 0 5px;
  font-size: 10.5px;
  line-height: 1.5;
  vertical-align: 1px;
}
.card__orig {
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-3);
  font-size: 13px;
  line-height: var(--lh-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__meta {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 13.5px;
  line-height: var(--lh-body);
  min-width: 0;
}

/* the channel line's target reaches 24 px (20 px line on desktop, 18 px on phones) without moving anything: padding
   inside, the same margin taken back outside */

.card__channel {
  display: block;
  margin-block: -3px;
  padding-block: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__channel:hover {
  color: var(--text);
}
.card__sub {
  display: flex;
  flex-wrap: wrap;
}

/* the separator trails its item, so a wrapped line never starts with a dot; none before an upcoming stream's start,
   which has a line of its own (nothing follows on the same line) */

.card__sub > :is(span, time):not(:last-child):not(:has(+ .countdown))::after {
  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 feedback: the picture gives a little under a finger that rests on it and springs back when it lifts.
     .is-pressed comes from app.js, not :active: iOS Safari also sets :active when the finger goes on to scroll the
     page, so the picture under the finger shrank as the feed began to move */
  
  .card__thumb {
    transition: transform 320ms var(--ease-out);
  }
  .card.is-pressed .card__thumb {
    transform: scale(var(--press-scale));
    transition-duration: var(--dur-press);
  }

/* 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-block: 0;
  padding-inline: 12px 16px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background-color var(--dur-press), transform var(--dur-press) var(--ease-out);
}
.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;
    --cc-r: calc(8px / 1.55); /* not scaled by --sq here: drawn at 8 px */
  }
  .video-grid--compact .card__body {
    display: block;
    padding-top: 0;
  }
  .video-grid--compact .card__avatar {
    display: none;
  }
  .video-grid--compact .card__title {
    font-size: 14.5px;
  }
  .video-grid--compact .card__orig {
    font-size: 12px;
  }
  .video-grid--compact .card__meta {
    font-size: 12.5px;
  }
  .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: 18.5px;
    font-weight: 600;
  }
  .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);
  }

/* the related list's 168 px picture: a 32 px circle 4 px from its top and end, with a 44 px hit area round it */

  
  .video-grid--compact .card .later-btn {
    inset-inline-start: 132px;
    width: 32px;
    height: 32px;
  }
  .video-grid--compact .card .later-btn::after {
    content: "";
    position: absolute;
    inset: -6px;
  }
}

/* shelf: bigger cards or type columns, 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;
}

@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));
}

/* the phone "More" rows (teachers, subjects, languages, live, traditions, 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;
}
.sheet-list.more-rows {
  /* both classes: .sheet-list (below) sets padding 0 at the same weight and came later, so icons sat 4 px from the edge */
  margin: 0 0 12px;
  padding: 0 12px;
  border: 0;
  border-radius: calc(14px * var(--sq, 1));
  corner-shape: squircle;
  background: var(--bg-2);
}

/* rows sit 12 px inside the group: a pressed row's radius is the group's minus that gap; the hairlines still run to
   the group's edge */

.sheet-list.more-rows .sheet-list__row {
  border-radius: calc(14px * var(--sq, 1) - 12px);
}
.sheet-list.more-rows li + li .sheet-list__row::before {
  inset-inline-end: -12px;
}

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

.avatar {
  width: var(--avatar-size, 40px);
  height: var(--avatar-size, 40px);
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--thumb-bg);
  box-shadow: 0 0 0 0.5px var(--separator); /* a logo on white keeps its circle on a white page */
}
.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);
  corner-shape: squircle;
}
.channel-row:hover {
  background: var(--fill);
}
.channel-row__body {
  min-width: 0;
}
.channel-row__name {
  display: block;
  min-height: 24px; /* WCAG 2.2 target size (finding F17); the whole row is the link's target too (::after) */
  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;
}
.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 {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  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: 16px;
  max-width: 1754px;
  margin: 0 auto;
}
.watch__stage,
.watch__info,
.watch__side {
  min-width: 0;
}

/* wide: the transcript sits beside the player at the player's height, the way YouTube places it, so the title stays in view */

@media (min-width: 1180px) {
  .watch {
    grid-template-columns: minmax(0, 1fr) 402px;
    grid-template-rows: auto 1fr;
    gap: 0 24px;
    align-items: start;
  }
  .watch__stage {
    grid-column: 1;
    grid-row: 1;
  }
  .watch__info {
    grid-column: 1;
    grid-row: 2;
  }
  .watch__side {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .watch[data-transcript="yes"] .transcript {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    height: 0;
    min-height: 100%;
    margin: 0;
  }
  .watch[data-transcript="yes"] .transcript__list {
    flex: 1;
    min-height: 0;
    max-height: none;
  }
  .watch[data-transcript="yes"] .watch__side {
    grid-row: 2;
    margin-top: 24px;
  }
}
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-m);
  corner-shape: squircle;
  --cc-r: 12px;
  background: #000;
}
.player__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* the video's picture under the frame until YouTube's player paints over it (hqdefault is 4:3 with bars: `cover`
   crops them in the 16:9 box, and the pillars of a vertical video in the 9:16 one) */

.player__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* YouTube's page is light while it loads: in the dark theme a frame of another colour scheme gets an opaque (white)
   canvas; the same scheme keeps it transparent, so the black stage shows until the player paints */

.player__frame,
.player iframe {
  color-scheme: light;
}

/* 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;
  padding-inline-start: 18px;
  border-radius: var(--radius-l);
  corner-shape: squircle;
}
.sub-strip__text {
  grid-row: 1 / span 2;
  min-width: 0;
}

/* no status under the picker (none yet, or empty): no row gap either, so the text centres on the picker */

.sub-strip:not(:has(.ai-sub-status:not(:empty))) {
  row-gap: 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;
  }
}

/* the original row: an "AI transcript" tag when a model wrote the transcript itself, then the line */

.sub-strip__orig-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.sub-strip__orig {
  min-width: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  line-height: var(--lh-title);
}
.sub-strip__tr-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}
.sub-strip__tr-row:has(.sub-strip__tr:empty) {
  display: none;
}
.sub-strip__tr {
  color: var(--glass-text-2);
  font-size: 15px;
  line-height: var(--lh-title);
}

/* no transcript yet: a plain statement and the way to YouTube replace the two text rows */

.sub-strip__none {
  display: none;
}
.sub-strip[data-state="none"] .sub-strip__text,
.sub-strip[data-state="none"] .sub-strip__lang,
.sub-strip[data-state="none"] .ai-sub-status {
  display: none;
}
/* No lines to show: the band is not a band. One quiet line in the page (no glass, not pinned on phones: finding F15),
   with the way to YouTube's auto-translate behind a disclosure. Set by the server, or by watch.js when the transcript
   file turns out to be missing. */
body[data-page="watch"] .sub-strip[data-state="none"] {
  position: relative;
  top: auto;
  z-index: auto;
  display: block;
  min-height: 0;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.sub-strip[data-state="none"] .sub-strip__none {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  color: var(--text-2);
  font-size: 14px;
  line-height: var(--lh-body);
}
.sub-strip__none-title {
  font-size: inherit;
  font-weight: 400;
}
.sub-strip__none-more > summary {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-3);
  text-underline-offset: 3px;
  cursor: pointer;
  list-style: none;
}
.sub-strip__none-more > summary::-webkit-details-marker {
  display: none;
}
.sub-strip__none-more[open] {
  flex-basis: 100%;
}
.sub-strip__none-hint {
  max-width: 60ch;
  margin: 6px 0 10px;
  color: var(--text-2);
  font-size: 14px;
}
.ai-tag {
  display: inline-block;
  flex: none;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--fill-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
}
.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(--glass-field);
  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-block: 0;
  padding-inline: 32px 14px; /* room for the globe at the start */
  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: max(1.3, var(--lh-title));
  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);
  corner-shape: squircle;
  background: var(--bg-2);
}
.about-box__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: 14px;
  font-weight: 500;
}
.about-box__meta a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.summary {
  margin-top: 8px;
}
.summary__title {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
}
.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;
}
.about-box .chip--static {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--separator);
}
.chip--static:hover {
  background: transparent;
}
.description {
  margin-top: 10px;
}
.description summary {
  display: block;
  list-style: none;
  color: var(--text-2);
  font-size: 14px;
  line-height: var(--lh-body);
  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;
}

/* "Ask about this video" (ai.js fills it; ai.css styles the inside). The box is drawn here with ai.css's own values
   and the height of what goes in (label 22 + 8 + the 44 px field, padding 30), so it is in place from the first paint
   and nothing below it moves when ai.js and ai.css arrive. Without scripts there is nothing to put in it. */

.ai-panel {
  display: grid;
  gap: 16px;
  min-height: 104px;
  margin-top: 12px;
  padding: 14px 16px 16px;
  border-radius: var(--radius-m);
  corner-shape: squircle;
  background: var(--bg-2);
}
@media (scripting: none) {
  .ai-panel:empty {
    display: none;
  }
}
.transcript__ai-note {
  padding: 8px 0 0;
  color: var(--text-3);
  font-size: 12.5px;
}
.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(44vh, 380px);
  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: calc(10px * var(--sq, 1));
  corner-shape: squircle;
  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);
}
[dir="rtl"] .transcript__line.is-current {
  box-shadow: inset -3px 0 0 var(--select);
}
.transcript__time {
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.9;
  font-variant-numeric: tabular-nums;
}
.transcript__text {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.transcript__tr {
  color: var(--text-2);
  font-size: 14px;
}
.transcript__loading {
  display: grid;
  gap: 6px;
  padding: 8px;
  color: var(--text-3);
}

/* a transcript row's shape: time, then a line of text */

.transcript__skeleton {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
}

/* ------------------------------------------------------------------ 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: calc(10px * var(--sq, 1));
  corner-shape: squircle;
  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;
}

/* ---- sort and filters (src/views/search.tsx SortSwitch, FilterChips): Relevance | Newest at the end of the search
   bar's row (the entity page's segmented control), then one row of upload-date and length chips that scrolls when it
   does not fit; the active chip carries a × (a tap removes it). Touch: 44 px targets (chip ::after, segmented items). */

.search-bar:has(~ .sr-bar) {
  margin-bottom: 10px;
}
.sr-sort {
  flex: none;
  margin-inline-start: auto;
}
.sr-sort .segmented__item {
  min-width: 80px;
}
.sr-bar {
  margin: 0 0 28px;
}

/* the query in the heading: two lines at most, however long it is (finding F10) */
.search-page .page-head__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.sr-bar__track {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.sr-bar__track::-webkit-scrollbar {
  display: none;
}
.sr-bar .chip .icon {
  width: 16px;
  height: 16px;
  margin-inline-end: -3px;
}
.sr-note {
  order: 2;
  color: var(--text-2);
  font-size: 14px;
}
.sr-empty--filter {
  order: 2; /* right under the chips, before the entity card and channels */
}
.sr-empty__clear {
  margin-top: 12px;
}
.sr-empty__ask {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  min-height: 44px;
}
.sr-empty--filter .sr-empty__ask {
  margin-left: 8px;
}
@media (pointer: coarse) {
  .sr-bar .chip::after {
    content: "";
    position: absolute;
    inset: -6px -4px;
  }
  .sr-sort .segmented__item {
    height: 44px;
  }
}
@media (max-width: 767.98px) {
  .sr-sort .segmented__item {
    min-width: 0;
    flex: none;
    height: 40px; /* with the track's 2 px padding the control is 44 px tall, like the Filters button beside it */
    padding: 0 12px;
  }

/* the chips run edge to edge */

  
  .sr-bar {
    margin: 0 calc(-1 * var(--gutter)) 20px;
  }
  .sr-bar__track {
    padding: 6px var(--gutter);
  }

/* Phones (finding F10): the first result belongs on the first screen. The query heading at a body-title size, upload
   date and length only in the Filters sheet (one chip row: the content types), less space between. */

  .search-page .page-head {
    margin: 0 0 10px;
  }
  .search-page .page-head__title {
    font-size: 20px;
    line-height: 1.3;
    letter-spacing: -0.01em;
  }
  .search-page .sr-bar:not(.sr-bar--type) {
    display: none;
  }
  .search-page .sr-bar--type {
    margin-bottom: 12px;
  }
  .search-page .sr {
    gap: 22px;
  }
}
.local-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -8px 0 28px;
}

/* ------------------------------------------------------------------ composed search page (src/views/search.tsx)
   One column in reading order on phones and tablets (the two wrappers are display: contents and each section has an
   order); from 1200 px the entity card, channels, related topics and the guide link stand in a side column. */

.sr {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.sr-main,
.sr-side {
  display: contents;
}
.sr-answer { order: 1; }
.sr-videos--first { order: 2; }
.ent-card { order: 3; }
.sr-videos--rest { order: 4; }
.sr-channels { order: 5; }
.sr-empty { order: 6; }
.sr-late { order: 7; }
.sr-pager { order: 8; }
.sr-topics { order: 9; }
.sr-pager:empty,
.sr-pager:not(:has(*)) {
  display: none;
}
.sr .pager {
  margin-top: 0;
}
.sr .empty {
  padding: 8px 0 0;
}
.sr-side__title {
  margin-bottom: 10px;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.008em;
}
.sr-late .section__lede {
  margin-bottom: 16px;
}
.sr-channels .channel-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  margin: 0 -8px;
}
@media (min-width: 1200px) {
  .sr--side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 0 48px;
    align-items: start;
  }
  .sr--side .sr-main,
  .sr--side .sr-side {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .sr--side .sr-main {
    gap: 32px;
  }
  .sr--side .sr-side {
    gap: 28px;
  }
  .sr--side .sr-channels .channel-list {
    grid-template-columns: minmax(0, 1fr);
  }

/* the list cards share the column with the side: a smaller thumbnail */

  
  .sr--side .video-grid--list .card {
    grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  }
  .sr--side .video-grid--list .card .later-btn {
    inset-inline-start: 252px;
  }
}

/* ---- "Ask": the AI entry. Restrained: a hairline in the AI gradient, the sparkle in the same colours, a soft tint
   when its answer is open. No motion beyond the press. */

.ask-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}
.ask-row__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}
.ask-row__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.ask-chip {
  --chip-bg: var(--bg);
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(var(--chip-bg), var(--chip-bg)) padding-box,
    var(--ai-edge) border-box;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-align: start;
  transition: box-shadow var(--dur-fade) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.ask-chip:hover {
  box-shadow: 0 0 0 3px rgb(var(--ai-mid) / var(--ai-halo));
}
.ask-chip.is-active {
  background:
    linear-gradient(rgb(var(--ai-mid) / 0.08), rgb(var(--ai-mid) / 0.08)) padding-box,
    linear-gradient(var(--chip-bg), var(--chip-bg)) padding-box,
    var(--ai-edge) border-box;
  font-weight: 600;
}
.ask-chip:active {
  transform: scale(var(--press-scale));
}

/* a search with fewer than 3 videos: the first question is the main offer (tinted, a soft violet halo), but it waits for
   a tap like the others: an answer costs one of the visitor's free ones */

.sr-answer[data-mode="thin"] .ask-chip:first-child:not(.is-active) {
  min-height: 40px;
  background:
    linear-gradient(rgb(var(--ai-mid) / 0.1), rgb(var(--ai-mid) / 0.1)) padding-box,
    linear-gradient(var(--chip-bg), var(--chip-bg)) padding-box,
    var(--ai-edge) border-box;
  box-shadow: 0 0 0 3px rgb(var(--ai-mid) / var(--ai-halo));
  font-weight: 600;
}
.ai-spark {
  flex: none;
}

/* the answer: a placeholder of the panel's size until /ai.js mounts it; one line when it is off */

.sr-answer {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.sr-answer__panel {
  min-width: 0;
}
.answer-wait {
  display: grid;
  gap: 12px;
  padding: 18px 20px 22px;
  border-radius: var(--radius-l);
  corner-shape: squircle;
  background: var(--bg-2);
}
.answer-wait__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}
.answer-wait i {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--fill-2);
}
.answer-wait i:nth-of-type(1) {
  width: 92%;
}
.answer-wait i:nth-of-type(2) {
  width: 76%;
}
.answer-wait i:nth-of-type(3) {
  width: 48%;
}
@media (prefers-reduced-motion: no-preference) {
  .answer-wait i {
    background: linear-gradient(100deg, var(--fill) 30%, var(--fill-3) 50%, var(--fill) 70%) 0 0 / 220% 100%;
    animation: answer-wait 1.6s ease-in-out infinite;
  }
}
@keyframes answer-wait {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}
/* Phones (finding F10): the answer keeps a fixed height while it streams (nothing under it jumps) and is cut there,
   about its first lines, so the first talk stays on the first screen; "Read the whole answer" (search.js) opens it. */
.sr-answer__more {
  justify-self: start;
}
@media (max-width: 767.98px) {
  .sr-answer__panel:not(.is-open):not([hidden]) {
    position: relative;
    max-height: var(--answer-cap, 200px);
    overflow: hidden;
  }
  .sr-answer__panel:not(.is-open).is-cut::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 56px;
    pointer-events: none;
    background: linear-gradient(rgb(var(--bg-rgb) / 0), rgb(var(--bg-rgb) / 1));
  }
}
.sr-answer__line {
  color: var(--text-3);
  font-size: 14px;
}
.sr-answer__line a {
  color: var(--link);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 2px;
}

/* the entity the query names */

.ent-card {
  --chip-bg: var(--bg-2);
  padding: 18px 20px 20px;
  border-radius: var(--radius-l);
  corner-shape: squircle;
  background: var(--bg-2);
}
.ent-card__kicker {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ent-card__name {
  margin-top: 4px;
  font-size: 26px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.018em;
  overflow-wrap: anywhere;
}
.ent-card__name a:hover {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 3px;
}
.ent-card__meta {
  display: flex;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--text-2);
  font-size: 14px;
}
.ent-card__meta > :not(:last-child)::after {
  content: "·";
  padding: 0 6px;
  color: var(--text-3);
}

/* controls on the grey card are raised: white in light; in dark a lighter grey, not the page's black (holes) */

.ent-card {
  --raised: #fff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ent-card {
    --raised: rgb(255 255 255 / 0.08);
  }
}
:root[data-theme="dark"] .ent-card {
  --raised: rgb(255 255 255 / 0.08);
}
.ent-card .chip {
  background: var(--raised);
}
.ent-card .chip:hover {
  background: var(--fill-2);
}
.ent-card__open {
  margin-top: 16px;
  gap: 2px;
  padding-inline-end: 10px;
  background: var(--raised);
}
.ent-card__open:hover {
  background: var(--fill-2);
}
.chip .chip__count {
  margin-inline-start: 2px;
  font-variant-numeric: tabular-nums;
}
.chip.is-active .chip__count {
  color: inherit;
  opacity: 0.72;
}

/* ------------------------------------------------------------------ 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: calc(22px * var(--sq, 1));
  corner-shape: squircle;
}
.sheet.glass {
  box-shadow: var(--glass-ring);
}
.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: calc(12px * var(--sq, 1));
  corner-shape: squircle;
  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);
}

/* the phone "More" tab: the languages as a grouped list, current one checked */

.more-rows__caption {
  margin: 20px 4px 6px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
}
.lang-list .lang-list__row {
  grid-template-columns: minmax(0, 1fr) 24px;
}
.sheet-list.lang-list li + li .sheet-list__row::before {
  inset-inline-start: 4px;
}
.lang-list__row[aria-current] {
  font-weight: 600;
}
.sheet-list__row.lang-list__row[aria-current] .icon:last-child {
  color: var(--text);
  opacity: 1;
}
.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);
}
/* upload date and length in the phone's Filters sheet (search.tsx SheetChoices): radio chips */
.sheet-form__choices {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}
.sheet-form__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sheet-form__chip {
  height: 40px;
  cursor: pointer;
}
.sheet-form__chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sheet-form__chip:has(input:checked) {
  background: var(--saffron-soft);
  color: var(--saffron-ink);
  font-weight: 600;
}
.sheet-form__chip:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.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 {
    display: none;
  }

/* the language switch stays one tap away on phones (finding F16): the translate button at the end of the logo row;
     the keyboard-help button has no use there */

  .header-tools {
    position: absolute;
    top: 0;
    inset-inline-end: calc(10px + var(--safe-right));
    height: var(--appbar-h);
  }
  .header-tools [data-help-open] {
    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 .ask-hint {
    line-height: 44px;
  }
  .search-form__kbd {
    display: none;
  }
  .search-form__ask {
    position: relative;
    gap: 4px;
    height: 34px;
    padding: 0 11px 0 8px;
    font-size: 13px;
  }
  .search-form__ask::after {
    content: ""; /* 44 px hit area */
    position: absolute;
    inset: -5px -5px -5px -2px;
  }

/* phones: the short "Ask" label instead of the long one, so the example questions in the field have room to be read.
     The long label stays for screen readers (it is the button's name). */

  
  .search-form__ask-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .search-form__ask-short {
    display: inline;
  }
  .brand__word {
    font-size: 19px;
  }
  .appbar__title {
    position: absolute;
    left: 50%;
    top: calc(var(--appbar-h) / 2);
    display: block;
    max-width: 62%;
    overflow: hidden;
    padding: 0 4px;
    border-radius: 999px;
    background: rgb(var(--glass-halo-rgb) / var(--glass-scrim-a)); /* local scrim, feathered by the shadow */
    box-shadow: 0 0 10px 6px rgb(var(--glass-halo-rgb) / var(--glass-scrim-a));
    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%);
  }

/* scrolled, the two-row bar is one frosted piece and the field has a solid fill (walkthrough 11-28: list text and the
     page's large title showed between the compact title and the field and through the field, worst on WebKit). At the
     top of a page, where only the page colour is under it, the bar stays clear. */

  html.is-scrolled .appbar.glass {
    --g-a: 0.95;
    --g-blur: 24px;
  }
  html.is-scrolled .search-form {
    background: rgb(var(--bg-rgb) / 0.96);
    box-shadow: inset 0 0 0 0.5px var(--glass-edge);
  }

/* the tab capsule: frosted enough that titles and the footer under it do not run into its labels (walkthrough 11-28) */

  .tabbar .glass--tab,
  .glass--tab.tabbar {
    --g-a: 0.76;
    --g-blur: 12px;
  }
  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-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

/* 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: var(--glass-ring);
    -webkit-user-select: none;
    user-select: none;
  }
  .tabbar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    corner-shape: 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%);
  }

/* the lens: along the edge the backdrop bends (more blur, a touch brighter), the middle stays clear. A band cut
     with the same mask as the AI ring; it sits on the capsule itself, so the two glass layers are never nested */

  
  .tabbar::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    padding: var(--glass-lens);
    border-radius: inherit;
    pointer-events: none;
    -webkit-backdrop-filter: blur(var(--glass-lens-blur)) brightness(var(--glass-lens-bright));
    backdrop-filter: blur(var(--glass-lens-blur)) brightness(var(--glass-lens-bright));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  }
  .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 {
    /* the padding holds the halo (overflow is hidden for the "…", so a tighter box would cut the halo into a pill),
       the margin takes it back: the layout and the text's width are unchanged. Taps go to the tab under it. */
    max-width: calc(100% + 12px);
    margin: -10px -6px;
    padding: 10px 12px;
    pointer-events: none;
    overflow: hidden;
    border-radius: 999px;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 600;
    line-height: 12px;
    text-shadow: var(--glass-halo-label);
  }

/* an unselected tab's label sits on a small feathered scrim in the glass colour (invisible over the page colour,
     there when a dark picture, or a bright one in the dark theme, passes under the clear capsule) */

  
  .tabbar__item:not(.is-active) .tabbar__label {
    background: rgb(var(--glass-halo-rgb) / var(--glass-scrim-a));
    box-shadow: 0 0 6px 2px rgb(var(--glass-halo-rgb) / var(--glass-scrim-a));
  }
  .tabbar__item.is-active {
    background: var(--glass-pick);
    box-shadow: var(--glass-pick-ring);
    color: var(--text);
  }
  .tabbar__item.is-active .icon {
    stroke-width: 2.2;
  }

/* the narrowest phones (a folded phone's cover screen, 344 px): the whole word fits (de "Startseite", fr "Recherche",
     pt "Mais tarde"); the text gets the item's full width and a little less tracking */

  
  @media (max-width: 359.98px) {
    .tabbar {
      padding-inline: 3px;
    }
    .tabbar__label {
      max-width: calc(100% + 20px);
      margin-inline: -10px;
      padding-inline: 10px;
      letter-spacing: -0.02em;
    }
  }

/* 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;
  }

/* imagery first: edge-to-edge thumbnails in feeds */

  
  .video-grid {
    gap: 28px;
  }
  .video-grid + .video-grid {
    margin-top: 28px;
  }
  .video-grid > .card .card__thumb,
  .video-grid--compact > .card .card__thumb {
    margin: 0 calc(-1 * var(--gutter));
    border-radius: 0;
    --cc-r: 0px;
  }
  .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;
  }

/* 44 px targets */

  
  .btn,
  .btn--small,
  .later-btn--label,
  .section__more {
    min-height: 44px;
  }
  .segmented__item {
    min-width: 0;
    flex: 1 1 auto;
    height: 40px;
    padding: 0 10px;
    white-space: nowrap; /* "Regional style" wrapped into two lines inside a four-way control */
  }
  .page-head .segmented {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .page-head .segmented::-webkit-scrollbar {
    display: none;
  }
  .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__body {
    align-self: stretch; /* the full width, so the button below spans it (not the longest text line) */
  }
  .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);
    corner-shape: squircle;
  }
  .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;
  }

/* 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;
    /* 16:9 of the width, but never under 200 px: YouTube's minimum player viewport (a 320 px phone gives 180) */
    height: calc(max(200px, var(--stage-w) * 9 / 16) + var(--safe-top));
    margin: 0 calc(-1 * var(--gutter));
    border-top: var(--safe-top) solid #000;
    border-radius: 0;
    --cc-r: 0px;
    aspect-ratio: auto;
  }
  .sub-strip {
    position: sticky;
    top: calc(max(200px, (100vw - var(--safe-left) - var(--safe-right)) * 9 / 16) + var(--safe-top));
    z-index: 30;
    min-height: 70px;
    margin: 0 calc(-1 * var(--gutter));
    /* 14 px on top: the language picker stays a thumb's width below YouTube's progress bar and fullscreen button */
    padding: 14px calc(10px + var(--safe-right)) 8px calc(16px + var(--safe-left));
    border-radius: 0;
    border-bottom: 0.5px solid var(--glass-edge);
    box-shadow: inset 0 -1px 0 0 var(--glass-rim);
  }
  .sub-strip__orig {
    font-size: 16px;
  }
  .sub-strip__tr {
    font-size: 14px;
  }
  .watch__title {
    margin-top: 14px;
    font-size: 18px;
    line-height: 1.32;
  }

/* the actions wrap to a second row when they do not fit (fr at 344 px, any language at 320 px): a row that scrolled
     sideways left the last pill half off the screen with nothing to say there was more */

  
  .channel-line__actions {
    flex-wrap: wrap;
    width: 100%;
  }
  .channel-line__actions > * {
    flex: none; /* a long label (de, fr, pt) moves its pill to the next row instead of breaking inside it */
    white-space: nowrap;
  }
  .watch__side {
    margin-top: 32px;
  }
  .transcript__list {
    max-height: 60vh;
  }
  .transcript__line {
    min-height: 44px;
  }

/* composed search page, entity pages, "Start here" */

  
  .sr {
    gap: 28px;
  }
  .ask-row {
    display: grid;
    gap: 8px;
  }
  .ask-row__chips {
    flex-wrap: nowrap;
    margin: 0 calc(-1 * var(--gutter));
    padding: 3px var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ask-row__chips::-webkit-scrollbar {
    display: none;
  }
  .ask-chip {
    flex: none;
    min-height: 40px;
    max-width: 82vw;
  }
  .ask-chip::after {
    content: "";
    position: absolute;
    inset: -2px -2px;
  }
  .answer-wait {
    padding: 16px;
  }
  .ent-card {
    padding: 16px;
  }
  .ent-card__name {
    font-size: 24px;
  }
  .ent-card__open {
    width: 100%;
  }
  .sr-channels .channel-list {
    margin: 0 -8px;
  }
}

/* ================================================================== phones on their side
   A phone in landscape is 812–932 px wide, so it gets the tablet layout (header + mini rail), but its notch, rounded
   corners and home indicator sit at the sides and the bottom. The safe-area insets are 0 on desktops and tablets,
   so these rules change nothing there. */

@media (min-width: 768px) {
  .appbar__row {
    padding-right: calc(16px + var(--safe-right));
  }
  .rail {
    inset-inline-start: var(--safe-left);
    padding-bottom: calc(24px + var(--safe-bottom));
  }
  .page {
    margin-inline-start: calc(var(--rail-space) + var(--safe-left));
    margin-inline-end: var(--safe-right);
  }
  .site-footer {
    padding-bottom: calc(40px + var(--safe-bottom));
  }
}

/* the phone layout's 44 px touch sizes for the tablet layout on a touch screen: a phone on its side, an unfolded
   folding phone, a tablet */

@media (pointer: coarse) and (min-width: 768px) {
  .btn,
  .btn--small,
  .later-btn--label,
  .section__more,
  .input,
  .toggle,
  .description__more,
  .site-footer__links a,
  .channel-line__channel {
    min-height: 44px;
  }
  .icon-btn,
  .segmented__item,
  .sub-strip__lang,
  .search-form,
  .brand {
    height: 44px;
  }
  .icon-btn,
  .site-footer__links a {
    min-width: 44px;
  }
  .site-footer__links a {
    justify-content: center;
  }
  .chip::after,
  .pill::after,
  .search-form__ask::after {
    content: "";
    position: absolute;
    inset: -8px -4px;
  }
  .pill,
  .search-form__ask {
    position: relative;
  }
  .search-form .ask-hint {
    line-height: 44px;
  }
}

/* touch: the small chips in the description box (28 px) and under a Short (30 px) get a 44 px hit area too */

@media (pointer: coarse) {
  .about-box .chip::after {
    content: "";
    position: absolute;
    inset: -8px -3px;
  }
}

/* Immersive watch page on a phone in landscape (short, wide, touch): the player fills the screen inside
   the safe area, black around it; header, rail and tab bar are hidden, so nothing of ours sits on or under
   YouTube's controls (its settings menu is drawn inside the iframe and gets the full height). The player is not
   pinned: scrolling down reaches the title, tags and related videos. */

@media (orientation: landscape) and (max-height: 540px) and (pointer: coarse) {
  body[data-page="watch"] .appbar,
body[data-page="watch"] .rail,
body[data-page="watch"] .tabbar {
    display: none;
  }
  body[data-page="watch"] {
    --rail-space: 0px;
  }
  body[data-page="watch"] .page {
    margin-inline: 0;
    padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
  }
  body[data-page="watch"] .main {
    padding-top: 0;
  }
  body[data-page="watch"] .player {
    position: relative;
    top: auto;
    z-index: auto;
    width: auto;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    margin: 0 calc(-1 * var(--gutter) - var(--safe-right)) 0 calc(-1 * var(--gutter) - var(--safe-left));
    border: 0;
    border-radius: 0;
    --cc-r: 0px;
    aspect-ratio: auto;
  }
  body[data-page="watch"] .player__frame,
  body[data-page="watch"] .player__poster {
    top: 0;
    left: var(--safe-left);
    width: calc(100% - var(--safe-left) - var(--safe-right));
    height: calc(100% - var(--safe-bottom));
  }
  body[data-page="watch"] .sub-strip {
    position: relative;
    top: auto;
    z-index: 0;
    min-height: 64px;
    margin: 12px 0 0;
    padding: 10px 12px;
    padding-inline-start: 18px;
    border-radius: var(--radius-l);
    corner-shape: squircle;
    border-bottom: 0;
  }
}

/* The pinned player only where there is room for it: the phone layout pins player and subtitle strip at the top while
   the page scrolls under them, which suits a screen taller than wide. In a window that is not (a desktop at 200 % zoom
   is 640 × 400 px: player 360, strip 70 and the tab bar 62 would cover all of it) or very short, they scroll with the
   page like the rest. */

@media (max-width: 767.98px) and (min-aspect-ratio: 8/9), (max-width: 767.98px) and (max-height: 479.98px) {
  .player,
  .sub-strip {
    position: relative;
    top: auto;
  }
}

/* ================================================================== wide phones
   A folding phone (folded: wider and much shorter than other phones; open: between phone and tablet), a small tablet
   in portrait, a phone on its side below 768 px. Still the phone layout (tab bar, pinned player), but logo and search
   share one header row (the fixed bars cost less of the height), cards come two across instead of one giant card per
   screen, and the tab bar and sheets stop growing. Fluid, not tied to one device: 560–767 px wide, or from 440 px when
   the screen is not tall (width at least 3/5 of the height). */

@media (min-width: 560px) and (max-width: 767.98px), (min-width: 440px) and (max-width: 767.98px) and (min-aspect-ratio: 3/5) {
  .appbar__row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    column-gap: 14px;
    padding-block: 4px;
  }
  .search-form {
    margin-bottom: 0;
  }
  .header-tools {
    position: static;
    height: auto;
  }

/* one row leaves no room for the compact title: the logo stays */

  
  .appbar__title {
    display: none;
  }
  html.title-collapsed .brand {
    opacity: 1;
    pointer-events: auto;
  }

/* feeds and related videos: two across, thumbnails inset and rounded, no avatar (the channel name
     is in the meta line) */

  
  .video-grid,
  .video-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
  }
  .video-grid > .card .card__thumb,
  .video-grid--compact > .card .card__thumb {
    margin: 0;
    border-radius: var(--radius-m);
    corner-shape: squircle;
    --cc-r: 12px;
  }
  .card__body {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }
  .card__avatar {
    display: none;
  }

/* search results stay one per row, thumbnail left (the page splits them into runs that two columns leave ragged) */

  
  .video-grid--list {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .video-grid--list > .card {
    display: grid;
    grid-template-columns: minmax(0, 45%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }
  .video-grid--list .card__body {
    padding-top: 0;
  }
  .shelf {
    grid-auto-columns: 58%;
  }
  .tabbar {
    max-width: 520px;
    margin-inline: auto;
  }
  .sheet:not(.sheet--center) {
    max-width: 560px;
    margin-inline: auto;
  }
}

/* ------------------------------------------------------------------ motion */

@media (pointer: coarse) {/* .is-pressed from app.js (a finger resting on it, not one starting a scroll; see the cards above) */
  
  .btn.is-pressed,
.chip.is-pressed,
.tabbar__item.is-pressed,
.segmented__item.is-pressed,
.later-btn--label.is-pressed {
    transform: scale(var(--press-scale));
  }
}
@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-old(root),
  ::view-transition-new(root) {
    animation-duration: 180ms;
  }
}

/* the cross-document crossfade: its opt-in (@view-transition) is an inline <style> in every page's head (layout.tsx);
   under reduced motion the pages swap without animation */

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
@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,
  .header-tools [data-help-open] {
    display: none; /* keyboard hints on a touch screen */
  }
}
@media print {
  .appbar,
  .rail,
  .tabbar,
  .sub-strip {
    position: static;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---------------------------------------------------------------- right to left (Arabic)
   The layout itself uses logical properties. These rules cover what those cannot:
   - Titles, names, descriptions and subtitles come from YouTube in any script. Each takes its direction from its own
     text, so a Latin title keeps its "?" and its ellipsis at its end. Titles and names carry dir="auto" in the
     markup and align to their own start (WebKit misplaces a line-clamp ellipsis when an LTR title is right-aligned);
     shorter text filled in by scripts gets unicode-bidi: plaintext and stays on the page's right edge.
   - Chevrons (.icon--dir) point the way the reading goes. */

[dir="rtl"] :is(.page-head__title, .summary__text, .transcript__orig, .transcript__tr, .sub-strip__orig, .sub-strip__tr) {
  unicode-bidi: plaintext;
  text-align: right;
}
[dir="rtl"] .icon--dir {
  transform: scaleX(-1);
}

/* Arabic type: Chromium's -apple-system has no Arabic glyphs, so each one fell through to Arial (small and thin); the
   systems' own Arabic faces come before it. The language menus' "العربية" (lang="ar") gets them on every page. */

html:lang(ar) {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}
[lang="ar"]:not(html) {
  font-family: -apple-system, BlinkMacSystemFont, "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}
html:lang(ar) .tabbar__label {
  font-size: 11px; /* 10 px Arabic is not legible */
}
@media (prefers-reduced-motion: no-preference) {
  html[dir="rtl"].rail-open .rail {
    animation-name: rail-in-rtl; /* the rail slides in from the right */
  }
  @keyframes rail-in-rtl {
    from {
      transform: translateX(24px);
      opacity: 0;
    }
  }
}

/* the header's Ask button while today's free answers are used up (public/ai-limit.js via app.js): quieter, the sparkle
   grey, a title saying until when; it still opens /ask, where the limit card shows at once */

.search-form[data-ai-limit] .search-form__ask {
  color: var(--text-3);
}
.search-form[data-ai-limit] .search-form__ask .ask-spark {
  opacity: 0.5;
  filter: grayscale(1);
}

/* ================================================================== pointer feedback on video cards */

@media (hover: hover) and (pointer: fine) {/* pointer feedback: the picture lifts a little towards the pointer and settles back when pressed (the corner
     radius never changes: a card keeps its shape) */
  
  .card__thumb {
    transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
  }
  .card:hover .card__thumb {
    transform: scale(1.018);
    box-shadow: 0 10px 28px rgb(0 0 0 / 0.16), 0 2px 6px rgb(0 0 0 / 0.08);
  }
  .card:active .card__thumb {
    transform: scale(var(--press-scale));
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
    transition-duration: var(--dur-press);
  }
}

/* ================================================================== continuous corners
   Rounded rectangles (cards, pictures, sheets, panels) carry `corner-shape: squircle` next to their radius: the
   curve eases into the straight edge the way Apple's corners do, instead of a quarter circle meeting a line. Where
   the engine draws it, the radius grows by --sq so the corner keeps its visual size. Capsules and circles stay
   round. */

@supports (corner-shape: squircle) {
  :root {
    --sq: 1.55;
  }
}

/* Safari (27.0) has no corner-shape but draws clip-path: shape(), so the pictures get the same continuous corner as a
   path: video thumbnails, the player, the AI answer's video cards. Never anything with a shadow, an
   outline that must show or glass: the clip would cut them (a card's focus ring is on the card, outside its picture).
   Each picture sets --cc-r, its radius before --sq; the curve reaches --cc-r × 1.55 along each edge, like
   corner-shape's, with its handles 0.08 of that from the corner (fitted to Chromium's squircle at 6×). The
   quarter-circle border-radius gives way to the path. */

@supports (clip-path: shape(from 0 0, line to 1px 1px, close)) and (not (corner-shape: squircle)) {/* not yet .player and .short__frame: they hold the YouTube frame, and full screen from inside a clipped parent has
     not been tried in the real Safari (2026-11-19). Add them back once it has. */
  
  .card__thumb,
.ai-vcard__media {
    --cc-a: calc(var(--cc-r, 0px) * 1.55);
    --cc-c: calc(var(--cc-a) * 0.08);
    border-radius: 0 !important;
    clip-path: shape(
      from 0 var(--cc-a),
      curve to var(--cc-a) 0 with 0 var(--cc-c) / var(--cc-c) 0,
      hline to calc(100% - var(--cc-a)),
      curve to 100% var(--cc-a) with calc(100% - var(--cc-c)) 0 / 100% var(--cc-c),
      vline to calc(100% - var(--cc-a)),
      curve to calc(100% - var(--cc-a)) 100% with 100% calc(100% - var(--cc-c)) / calc(100% - var(--cc-c)) 100%,
      hline to var(--cc-a),
      curve to 0 calc(100% - var(--cc-a)) with var(--cc-c) 100% / 0 calc(100% - var(--cc-c)),
      close
    );
  }

/* the pointer's hover shadow would be cut in half: the lift stays, the shadow goes */

  
  .card:hover .card__thumb,
.card:active .card__thumb {
    box-shadow: none;
  }
}

/* ================================================================== DharmaTube: type-led parts */
/* ---- a run of names, each in its own script (lang set per item) ---- */

.names {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline; /* names in different scripts share one baseline */
  gap: 0.1em 0.9em;
  color: var(--text-3);
  font-size: 13.5px;
}
.names__item {
  line-height: var(--lh-title);
}
.names--l {
  margin-top: 14px;
  gap: 0.15em 1em;
  color: var(--text-2);
  font-size: clamp(18px, 1.9vw, 24px);
}
.names--l .names__item {
  font-family: var(--font-serif);
}

/* Tibetan and Burmese faces sit small at the same point size */

.names__item:lang(bo),
.names__item:lang(my) {
  font-size: 1.12em;
}

/* Kailasa draws Tibetan about two thirds the height of Latin at the same size. Inside a row of names Tibetan keeps a
   plain line height: its own (--lh-title 1.95, for paragraphs of Tibetan) made the item taller than its neighbours. */

.names__item:lang(bo):not(:lang(bo-Latn)),
.names__item:lang(dz) {
  font-size: 1.32em;
  line-height: 1.25;
}
.section--subjects .section__head {
  margin-bottom: 8px;
}

/* the subject shelf: columns of type, ruled like a table of contents, not boxes */

.shelf--subjects {
  grid-auto-columns: minmax(280px, calc((100% - 2px) / 3.4));
  gap: 0;
  padding-bottom: 8px;
}
.subject {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 24px 4px;
  border-inline-start: 0.5px solid var(--separator);
  scroll-snap-align: start;
}
.subject:first-child {
  padding-inline-start: 0;
  border: 0;
}
.subject__name {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.008em;
  line-height: var(--lh-title);
}
.subject__link {
  font-family: var(--font-serif);
  line-height: var(--lh-title);
}
.subject__link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.subject:hover .subject__link {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 4px;
}
.subject .names {
  margin-top: 6px;
  min-height: 3em;
  align-content: flex-start;
}
.tcounts {
  margin: auto 0 0;
  padding-top: 12px;
  font-size: 14px;
}
.tcounts__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-top: 0.5px solid var(--separator);
}
.tcounts dd {
  margin: 0;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ---- hero pages: /text /topic /practice /teacher ---- */

.hero {
  max-width: 1040px;
  margin: 12px 0 36px;
}
.hero__kind {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  color: var(--text-3);
  font-size: 14px;
}
.hero__kind a:hover,
.movement__name a:hover,
.movement__all:hover,
.jump__item:hover span:first-child {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 3px;
}
.hero__name {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: clamp(46px, 5.8vw, 80px);
  font-weight: 500;
  letter-spacing: -0.016em;
  line-height: max(1.08, calc(var(--lh-title) - 0.14));
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.hero__gloss {
  max-width: 54ch;
  text-wrap: pretty;
  margin-top: 18px;
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: max(1.5, var(--lh-body));
}
.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin-top: 14px;
  color: var(--text-3);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.hero__facts a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero__study {
  padding-top: 24px;
  border-top: 1px solid var(--text);
}
.hero__study-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.008em;
  line-height: var(--lh-title);
}
.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 22px;
  margin-top: 12px;
}
.jump__item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 32px;
  font-size: 15px;
  font-weight: 500;
}
.jump__n {
  color: var(--text-3);
  font-size: 13.5px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 8px;
}
.filter-row__label {
  flex: none;
  color: var(--text-3);
  font-size: 14px;
}
.filter-row__scroller {
  flex: 1;
  min-width: 0;
}
.filter-row__track {
  display: flex;
  gap: 6px;
  padding: 3px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-row__track::-webkit-scrollbar {
  display: none;
}
.filter-row .scroller__arrow {
  width: 36px;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}
.filter-row .scroller__arrow--prev {
  background: linear-gradient(90deg, rgb(var(--bg-rgb) / 1) 45%, rgb(var(--bg-rgb) / 0));
}
.filter-row .scroller__arrow--next {
  background: linear-gradient(270deg, rgb(var(--bg-rgb) / 1) 45%, rgb(var(--bg-rgb) / 0));
}
.chip--filter {
  height: 30px;
  padding: 0 11px;
  font-size: 13.5px;
}
.chip--filter .chip__count {
  font-variant-numeric: tabular-nums;
}
.chip.is-active .chip__count {
  color: inherit;
}

/* the track scrolls, so it clips what overflows it: room for the focus ring on every side, and an item brought into
   view (the selected one on load, the focused one by the arrow keys) stops clear of the scroll arrows */

.filter-row__track {
  margin: -2px -4px;
  padding: 5px 4px;
  scroll-padding-inline: 40px;
}

/* the arrows sit over the track's edges, which reach 4px past the row */

.filter-row .scroller__arrow--prev {
  inset-inline-start: -4px;
}
.filter-row .scroller__arrow--next {
  inset-inline-end: -4px;
}
.hero__filtered {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 14px;
}

/* one tradition: the name in a sticky margin, its talks beside it */

.movement {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 0 28px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 0.5px solid var(--separator);
  scroll-margin-top: calc(var(--appbar-h) + var(--safe-top) + 8px);
}
.movement__head {
  position: sticky;
  top: calc(var(--appbar-h) + var(--safe-top) + 20px);
  align-self: start;
}
.movement__name {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.006em;
  line-height: var(--lh-title);
}
.movement__count {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.movement__all {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
}
.movement__body {
  min-width: 0;
}
.lead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  gap: 20px;
  padding-bottom: 16px;
}
.lead__thumb,
.talk__thumb,
.series-card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--thumb-bg);
}
.talk__thumb {
  border-radius: var(--radius-s);
}
.lead__thumb img,
.talk__thumb img,
.series-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lead__title,
.lead__title a {
  line-height: var(--lh-title);
}
.lead__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
}
.lead__title a:hover,
.talk__link:hover,
.series-card__title a:hover,
.erow__link:hover,
.terms__item dt a:hover,
.others__tradition a:hover,
.series-nav__name:hover {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 3px;
}
.lead__summary {
  margin-top: 8px;
  max-width: 60ch;
  color: var(--text-2);
  font-size: 14.5px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.talk {
  position: relative;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 12px 0;
  border-top: 0.5px solid var(--separator);
}
.talk.is-selected,
.lead.is-selected,
.subject.is-selected,
.erow.is-selected {
  outline: 2px solid var(--select);
  outline-offset: 4px;
  border-radius: 4px;
}
.talk .card__dur,
.series-card__thumb .card__dur {
  inset-inline-end: 4px;
  bottom: 4px;
  font-size: 11px;
}
.talk__text {
  min-width: 0;
}
.talk__title,
.talk__link {
  font-family: var(--font-title);
  line-height: var(--lh-title);
}
.talk__title {
  font-size: 16.5px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.talk__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  margin-top: 3px;
  color: var(--text-3);
  font-size: 13px;
}
.talk__channel:hover {
  color: var(--text);
}
.flag {
  color: var(--text-2);
}
.talk .later-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--text-3);
  opacity: 0;
  transition: opacity var(--dur-press);
}
.talk:hover .later-btn,
.talk.is-selected .later-btn,
.talk .later-btn:focus-visible,
.talk .later-btn[aria-pressed="true"] {
  opacity: 1;
}
.talk__part {
  align-self: start;
  color: var(--text-3);
  font: 500 17px/1.4 "Literata", var(--font-sans);
  font-variant-numeric: tabular-nums;
  text-align: end;
}
.series-list .talk {
  grid-template-columns: 30px 124px minmax(0, 1fr) auto;
}
.hero__co {
  margin: 36px 0 0;
}
.hero__co .section__title {
  font-size: 19px;
}
.hero__co .section__head {
  margin-bottom: 10px;
}
.hero__note {
  margin-top: 28px;
  max-width: 72ch;
  color: var(--text-2);
  font-size: 14px;
}
.hero__note summary {
  cursor: pointer;
  font-weight: 500;
}
.hero__note p {
  margin-top: 6px;
}

/* ---- index pages ---- */

.erows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 0 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.erow {
  position: relative;
  padding: 11px 0 12px;
  border-top: 0.5px solid var(--separator);
}
.erow__link {
  display: block;
  font-size: 20px;
  font-weight: 500;
  line-height: var(--lh-title);
  overflow-wrap: anywhere;
}
.erow__link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.erow .names {
  margin-top: 1px;
  overflow: hidden;
  flex-wrap: nowrap;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, #000 86%, rgb(0 0 0 / 0));
  mask-image: linear-gradient(90deg, #000 86%, rgb(0 0 0 / 0));
}
.erow__gloss {
  margin-top: 1px;
  color: var(--text-2);
  font-size: 14px;
}
.erow__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ---- languages ---- */

.lang-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 0 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lang-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 16px;
  padding: 14px 0;
  border-top: 0.5px solid var(--separator);
}
.lang-row__own {
  grid-column: 1;
  font-size: 30px;
  font-weight: 500;
  line-height: var(--lh-title);
}
.lang-row:hover .lang-row__own {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 4px;
}
.lang-row__name {
  grid-column: 1;
  color: var(--text-3);
  font-size: 14px;
}
.lang-row__counts {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  color: var(--text-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: end;
  white-space: nowrap;
}

/* ---- series ---- */

.shelf--series .series-card {
  scroll-snap-align: start;
  min-width: 0;
}
.series-card__title {
  margin-top: 10px;
  font-size: 16.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.series-card__title a {
  font-family: var(--font-title);
  line-height: var(--lh-title);
}
.series-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  margin-top: 3px;
  color: var(--text-3);
  font-size: 13px;
}
.series-page__start {
  margin-top: 16px;
}
.series-list {
  max-width: 980px;
}
.series-nav {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
}
.series-nav__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
}
.series-nav__name {
  font-family: var(--font-title);
  font-size: 15.5px;
  font-weight: 600;
}
.series-nav__pos {
  color: var(--text-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.series-nav__steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.series-step {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  border-radius: 8px;
}
.series-step--next {
  justify-content: flex-end;
  text-align: end;
}
.series-step .icon {
  color: var(--text-3);
}
.series-step__text {
  display: grid;
  min-width: 0;
}
.series-step__label {
  color: var(--text-3);
  font-size: 12px;
}
.series-step__title {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- watch page modules ---- */

.watch__orig {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin-top: 6px;
  color: var(--text-3);
  font-size: 13px;
}
.card__orig--inline {
  margin: 0;
  overflow: visible;
  white-space: normal;
}
.note--restricted {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 14px;
}
.module-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.004em;
  line-height: var(--lh-title);
}
.terms,
.others {
  margin-top: 28px;
}
.terms__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 0 28px;
  margin: 10px 0 0;
}
.terms__item {
  padding: 9px 0 10px;
  border-top: 0.5px solid var(--separator);
}
.terms__item dt a {
  font-size: 17px;
  font-weight: 500;
  line-height: var(--lh-title);
}
.terms__item dd {
  margin: 1px 0 0;
  color: var(--text-2);
  font-size: 14px;
}
.others__group {
  margin-top: 14px;
}
.others__tradition {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  font-size: 16.5px;
  font-weight: 600;
}
.others__n {
  color: var(--text-3);
  font: 400 13px var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.others__all {
  margin-top: 14px;
}
.about__words {
  color: var(--text) !important;
  font-size: 23px;
  line-height: max(1.4, var(--lh-title)) !important;
}
.tradition-page__schools,
.tax-page__siblings {
  margin: -8px 0 28px;
}
.channel-head__meta a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose p a {
  color: var(--text);
}

/* ---- touch: one stretched link per row, like the cards ---- */

@media (hover: none), (pointer: coarse) {
  /* a course card is one link too (its title was a 19 px line, walkthrough 11-28) */
  .series-card {
    position: relative;
  }
  .series-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
  }
  /* the tradition and language links under a channel's name: a 44 px hit area, same look */
  .channel-head__meta a {
    position: relative;
  }
  .channel-head__meta a::after {
    content: "";
    position: absolute;
    inset: -12px -4px;
  }
  .talk__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
  }
  .lead__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
  }
  .talk__channel {
    pointer-events: none;
  }
  .lead .talk__channel {
    pointer-events: none;
  }
  .talk .later-btn {
    position: relative;
    z-index: 2;
    width: 44px;
    height: 44px;
    margin: -6px -8px 0 -6px;
    opacity: 1;
  }
  .talk .later-btn[aria-pressed="true"] {
    color: var(--saffron-ink);
  }
}

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

@media (max-width: 767.98px) {/* 44 px targets without making the lines look taller */
  
  .search-form__ask {
    position: relative;
  }
  .search-form__ask::after {
    content: "";
    position: absolute;
    inset: -5px 0;
  }
  .hero__kind a,
  .about-box__meta a {
    padding: 11px 0;
    margin: -11px 0;
  }
  .movement__name a {
    display: inline-block;
    padding: 5px 0;
    margin: -5px 0;
  }
  .jump {
    gap: 0 22px;
    margin-top: 2px;
  }
  .jump__item {
    align-items: center;
    min-height: 44px;
  }
  .about-box .chip {
    height: 34px;
  }
  .movement__all {
    padding-inline: 4px;
  }
  .shelf--subjects {
    grid-auto-columns: 74%;
    gap: 0;
  }
  .subject__name {
    font-size: 26px;
  }
  .hero {
    margin: 4px 0 28px;
  }
  .names--l {
    margin-top: 12px;
    font-size: 18px;
  }
  .hero__study {
    padding-top: 20px;
  }
  .hero__study-title {
    font-size: 24px;
  }
  .filter-row {
    display: block;
    margin: 12px calc(-1 * var(--gutter)) 4px;
  }
  .filter-row__label {
    display: block;
    margin: 0 var(--gutter) 4px;
  }
  .filter-row__track {
    margin: -2px 0;
    padding: 5px var(--gutter);
    scroll-padding: 0 var(--gutter);
  }
  .chip--filter {
    height: 34px;
  }
  .movement {
    display: block;
    margin-top: 20px;
    padding-top: 18px;
  }
  .movement__head {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 10px;
    margin-bottom: 12px;
  }
  .movement__all {
    min-height: 44px;
    margin: -10px 0 -10px auto;
  }
  .lead {
    display: block;
  }
  .lead__thumb {
    margin: 0 calc(-1 * var(--gutter)) 10px;
    border-radius: 0;
  }
  .lead__title {
    font-size: 20px;
  }
  .talk {
    grid-template-columns: 108px minmax(0, 1fr) 30px;
    gap: 12px;
  }
  .movement:not(.movement--list) .movement__rows > :nth-child(n + 6) {
    display: none;
  }
  .series-list .talk {
    grid-template-columns: 22px 92px minmax(0, 1fr) 30px;
    gap: 8px;
  }
  .erows,
  .lang-list {
    gap: 0;
  }
  .page-head__title {
    font-size: 34px;
  }
  .about__words {
    font-size: 21px;
  }
  .series-card__title {
    font-size: 16px;
  }
}

/* h4 has no reset in the base block; the rows and lead titles are the only h4s */

.lead__title,
.talk__title {
  margin: 0;
}

/* Tibetan gets its own font in every role. Han fonts built for GB 18030 carry Tibetan letters without the shaping,
   so a Han font earlier in a stack draws dotted circles. Latin in the same element still takes Literata. */

:lang(bo):not(:lang(bo-Latn)),
:lang(dz) {
  font-family: "Literata", Kailasa, "Noto Serif Tibetan", "Microsoft Himalaya", Jomolhari, serif !important;
}

@media (max-width: 767.98px) {
  .sub-strip__tr-row {
    display: block;
  }
  .sub-strip__tr-row .ai-tag {
    margin-inline-end: 6px;
  }
  .sub-strip__lang {
    max-width: 124px;
  }
  .sub-strip__lang select {
    width: 100%;
    text-overflow: ellipsis;
  }
}

@media (max-width: 767.98px) {
  .transcript__line {
    grid-template-columns: 42px minmax(0, 1fr);
  }
}
@media (max-width: 767.98px) {
  .page-head__kicker a {
    display: inline-block;
    padding: 13px 0;
    margin: -13px 0;
  }
}

/* taxonomy chips: /browse, home and search (schools under each tradition, then content types) */

.tax__title {
  margin: 4px 0 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}
.tax__title:not(:first-child) {
  margin-top: 22px;
}
.tax__group {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr);
  gap: 8px 12px;
  align-items: start;
  margin-bottom: 12px;
}
.tax__head {
  padding-top: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.tax__head:hover {
  color: var(--saffron-ink);
}
.chip--static {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--fill-2);
  color: var(--text-2);
}
.chip--static:hover {
  background: transparent;
}
.pill--small {
  height: 24px; /* WCAG 2.2 target size (finding F17) */
  padding: 0 9px;
  font-size: 12px;
}
.pill--content {
  background: var(--saffron-soft);
  color: var(--saffron-ink);
}
.channel-row__meta .pill {
  color: var(--text-2);
}
.channel-row__meta .pill--content {
  color: var(--saffron-ink);
}
.tax-page__siblings {
  margin: -8px 0 24px;
}
@media (max-width: 600px) {
  .tax__group {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .tax__head {
    padding-top: 0;
  }
}
.page-head__kicker a {
  display: inline-block;
  min-width: 44px;
}
@media (max-width: 600px) {
  .tax__head {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  .tax__group {
    gap: 0;
  }

/* sibling schools / content types: one swipeable row on phones */

  
  .tax-page__siblings {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -16px;
    padding-inline: 16px;
    scrollbar-width: none;
  }
  .tax-page__siblings::-webkit-scrollbar {
    display: none;
  }
}

/* ---- DharmaTube's accent on the tab capsule: the selected tab keeps the clear lozenge, in saffron ---- */

@media (max-width: 767.98px) {
  .tabbar__item.is-active {
    color: var(--saffron-ink);
  }
}
