:root {
  --bg: #fff;
  --ink: #0f0f0f;
  --muted: #606060;
  --subtle: #f2f2f2;
  --line: #e6e6e6;
  --chip: #f8f8f8;
  --accent: #ff0033;
  --ok: #168a46;
  --bad: #d93025;
  --idle: #7a7a7a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.10);
  --radius: 12px;
  --max: 1720px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.boot {
  min-height: 80vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.channel-top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 260px minmax(0, 620px) max-content;
  gap: 24px;
  align-items: center;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
  letter-spacing: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
}

.search-shell {
  position: relative;
}

.search-shell input {
  width: 100%;
  height: 42px;
  padding: 0 18px;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search-shell input:focus {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.top-actions {
  display: flex;
  gap: 8px;
  justify-self: end;
}

.generate-link {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.generate-link:hover {
  background: var(--subtle);
  border-color: #cfcfcf;
}

.generate-link:active {
  transform: scale(0.98);
}

.channel,
.watch {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 28px 90px;
}

.channel-hero {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 22px;
  align-items: center;
  padding: 12px 0 22px;
  border-bottom: 1px solid var(--line);
}

.channel-logo {
  width: 96px;
  height: 96px;
  display: block;
  object-fit: contain;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  font-weight: 700;
}

.channel-tagline {
  max-width: 620px;
  line-height: 1.5;
}

h1 {
  margin: 4px 0 2px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

p {
  margin: 0;
  color: var(--muted);
}

.tabs {
  height: 52px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.tabs a {
  padding: 0 0 13px;
  color: var(--muted);
  font-weight: 650;
}

.tabs a.active {
  color: var(--ink);
  border-bottom: 3px solid var(--ink);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 42px 24px;
}

.video-card[hidden] {
  display: none;
}

.no-results {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.no-results[hidden] {
  display: none;
}

.no-results h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  letter-spacing: 0;
}

.thumb-link,
.thumb {
  display: block;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #080808;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.thumb video,
.thumb img,
.main-player video,
.queue-thumb video,
.queue-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}

.thumb-sheen {
  position: absolute;
  inset: auto 0 0;
  height: 26%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  background: var(--idle);
}

.thumb .status-dot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  border-radius: 0;
}

.status-dot.built {
  background: var(--accent);
}

.status-dot.failed {
  background: var(--bad);
}

.status-dot.unchanged {
  background: var(--idle);
}

.thumb.no-video {
  display: grid;
  place-items: center;
  color: #fff;
}

.card-row {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 10px;
  margin-top: 12px;
}

.video-title {
  font-size: 19px;
  line-height: 1.25;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.video-title:hover,
.related-title:hover,
.queue-title:hover {
  text-decoration: underline;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  padding: 0;
  background: #fff;
  color: #111;
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover {
  background: var(--subtle);
  border-color: #d0d0d0;
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-button.copied {
  background: #111;
  border-color: #111;
  color: #fff;
}

.video-meta,
.video-submeta,
.queue-meta,
.related-meta {
  color: var(--muted);
  font-size: 14px;
}

.video-meta {
  margin-top: 4px;
}

/* one-line curated description under the card title */
.video-desc {
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* hover preview clip — sits over the static thumb, revealed while hovering */
.thumb-preview {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.thumb.previewing .thumb-preview {
  opacity: 1;
}

.warn {
  color: var(--bad);
}

.debug-index {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.section-title,
.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  font-weight: 800;
}

.debug-table {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.debug-row {
  display: grid;
  grid-template-columns: 12px 1.1fr 140px 100px 1.2fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.debug-row:first-child {
  border-top: 0;
}

.debug-row span {
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 26px;
}

.watch.watch-wide {
  max-width: none;
  grid-template-columns: minmax(0, 1fr);
}

.watch.watch-wide .main-player {
  border-radius: 8px;
}

.watch.watch-wide .watch-side {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
}

.watch-player-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.watch-player-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.side-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.main-player {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.main-player video {
  object-fit: contain;
}

.player-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
}

.watch-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 20px 0 18px;
  border-bottom: 1px solid var(--line);
}

.watch-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  font-weight: 650;
}

.mode-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip);
}

.mode-switch a,
.mode-switch span {
  min-width: 104px;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.mode-switch a.active {
  background: #111;
  color: #fff;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.14);
}

.mode-switch .disabled {
  opacity: 0.45;
}

.layout-toggle {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.layout-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.layout-toggle:hover {
  border-color: #111;
  background: var(--subtle);
}

.layout-toggle:active {
  transform: scale(0.98);
}

.layout-toggle.active {
  background: #111;
  border-color: #111;
  color: #fff;
}

.watch-title-row h1 {
  font-size: clamp(26px, 3vw, 38px);
}

.watch-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.side-card,
.debug-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
}

.queue {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.queue-item {
  display: grid;
  grid-template-columns: 28px 132px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
}

.queue-item:hover,
.queue-item.active {
  background: var(--subtle);
}

.queue-item.active {
  box-shadow: inset 4px 0 0 #111;
}

.queue-item.disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.queue-item.disabled:hover {
  background: transparent;
}

.queue-index {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.queue-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #111;
}

.queue-thumb span {
  position: absolute;
  right: 5px;
  bottom: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.queue-copy {
  min-width: 0;
}

.queue-title-row,
.narration-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.queue-title {
  font-weight: 720;
  line-height: 1.22;
}

.how-to-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid #111;
  border-radius: 999px;
  background: #fff2ad;
  color: #111;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.debug-panel {
  margin-top: 18px;
}

.debug-panel summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  cursor: pointer;
  list-style: none;
}

.debug-panel summary::-webkit-details-marker {
  display: none;
}

.debug-panel summary::after {
  content: "Show details";
  flex: 0 0 auto;
  align-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.debug-panel[open] summary {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.debug-panel[open] summary::after {
  content: "Hide details";
}

.panel-kicker {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 800;
}

.panel-head h2 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.segment-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.badge,
.pill {
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--chip);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge.built {
  color: var(--ok);
  background: #e9f6ee;
}

.badge.failed {
  color: var(--bad);
  background: #fcebea;
}

.badge.unchanged {
  color: var(--idle);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: none;
}

.debug-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 18px;
  padding-top: 16px;
}

.debug-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.debug-panel:not([open]) .debug-grid {
  display: none;
}

.script-box p {
  white-space: pre-wrap;
  color: var(--ink);
  margin-top: 8px;
}

.artifact-box {
  display: grid;
  gap: 8px;
  align-content: start;
}

.artifact {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--chip);
}

.artifact:hover {
  border-color: #111;
}

.artifact span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 800;
}

.artifact b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.artifact.missing {
  opacity: 0.58;
}

.narration-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.narration-head {
  padding-block: 20px;
  padding-inline: 20px;
  text-align: start;
}

.narration-head h2 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.narration-head > p {
  margin-top: 12px;
}

.narration-list {
  display: grid;
}

/* The transcript a watch page carries in its static html (for search and readers
   without JavaScript). app.js replaces it on load with the full watch page. */
.watch.static-transcript {
  display: block;
  max-width: 860px;
}

.static-transcript > p {
  color: var(--muted);
  line-height: 1.5;
}

.static-transcript .narration-panel > h2 {
  margin: 0;
  padding: 16px 20px;
  font-size: 13px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.static-transcript .narration-cue {
  cursor: default;
}

.narration-cue {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background 140ms ease;
}

.narration-cue:first-child {
  border-top: 0;
}

.narration-cue:hover,
.narration-cue:focus-visible {
  background: var(--subtle);
}

.narration-cue:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.22);
  outline-offset: -3px;
}

.narration-cue h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

.narration-title-row {
  margin-bottom: 6px;
}

.narration-cue > div {
  min-width: 0;
}

.narration-cue p {
  color: var(--ink);
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.narration-link {
  color: inherit;
  font-weight: 700;
  text-decoration-line: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.narration-link:hover,
.narration-link:focus-visible {
  text-decoration-thickness: 2px;
}

.narration-time {
  align-self: start;
  min-width: 54px;
  padding: 7px 9px;
  border: 1px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.narration-cue:hover .narration-time,
.narration-cue:focus-visible .narration-time {
  transform: translateY(-1px);
  background: #fff;
  color: #111;
}

@media (prefers-reduced-motion: reduce) {
  .narration-cue,
  .narration-time {
    transition: none;
  }
}

.related-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.related {
  display: grid;
  grid-template-columns: 142px 1fr;
  gap: 11px;
  align-items: start;
}

.related .thumb {
  border-radius: 9px;
}

.related .duration {
  font-size: 11px;
}

.related-title {
  font-weight: 730;
  line-height: 1.25;
}

/* ── Course ─────────────────────────────────────────────────────────────────
   The numbered series. Episode numbers sit in front of every title; a series is
   its own block in the grid; on a watch page the series is a playlist. */
.episode-number {
  margin-right: 0.4em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.course-series + .course-series {
  margin-top: 36px;
}

.course-series[hidden] {
  display: none;
}

.series-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.playlist {
  padding: 0;
  overflow: hidden;
}

.playlist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--chip);
}

.playlist-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.playlist-nav {
  display: flex;
  gap: 6px;
}

.playlist-step {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}

a.playlist-step:hover {
  background: var(--subtle);
}

.playlist-step.disabled {
  opacity: 0.35;
}

.playlist-step svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.playlist-list {
  display: grid;
  gap: 2px;
  max-height: 460px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.playlist-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
  padding: 6px 8px 6px 12px;
  border-radius: 10px;
}

.playlist-item:hover,
.playlist-item.active {
  background: var(--subtle);
}

.playlist-item.active {
  box-shadow: inset 4px 0 0 var(--ink);
}

.playlist-thumb .thumb {
  border-radius: 8px;
}

.playlist-thumb .duration {
  font-size: 11px;
}

.playlist-thumb .status-dot {
  display: none;
}

.playlist-title {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.playlist-item.active .playlist-title {
  font-weight: 800;
}

@media (max-width: 1180px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .watch {
    grid-template-columns: 1fr;
  }
  .watch-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .channel-top {
    height: auto;
    grid-template-columns: 1fr max-content;
    gap: 12px;
    padding: 14px 16px;
  }
  .search-shell {
    grid-column: 1 / -1;
  }
  .channel,
  .watch {
    padding: 18px 14px 70px;
  }
  .channel-hero {
    grid-template-columns: 72px 1fr;
  }
  .channel-logo {
    width: 68px;
    height: 68px;
  }
  .video-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .debug-row {
    grid-template-columns: 12px 1fr;
  }
  .debug-row span:nth-last-child(-n + 3) {
    display: none;
  }
  .watch-title-row,
  .watch-player-head,
  .debug-panel summary {
    display: block;
  }
  .watch-player-controls {
    display: flex;
    justify-content: stretch;
    margin-top: 12px;
  }
  .side-card-head {
    display: grid;
    grid-template-columns: 1fr;
  }
  .watch-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 0;
  }
  .language-picker {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
  .version-picker {
    flex: 1 1 auto;
  }
  .version-picker select {
    min-width: 0;
    flex: 1;
  }
  .mode-switch {
    width: 100%;
  }
  .mode-switch a,
  .mode-switch span {
    flex: 1;
    min-width: 0;
  }
  .layout-toggle {
    justify-content: center;
    width: 100%;
  }
  .watch.watch-wide .watch-side {
    grid-template-columns: 1fr;
  }
  .debug-panel summary::after {
    display: inline-block;
    margin-top: 12px;
  }
  .queue-item {
    grid-template-columns: 24px 120px 1fr;
  }
  .debug-grid {
    grid-template-columns: 1fr;
  }
  .narration-cue {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }
  .narration-head {
    padding-block: 16px;
    padding-inline: 16px;
  }
  .related {
    grid-template-columns: 120px 1fr;
  }
}

/* Language deep links + version dropdown on the watch page. */
.language-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.language-picker > span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.language-picker > div {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--chip);
}
.language-picker a {
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.language-picker a.active {
  background: #111;
  color: #fff;
}

/* Version dropdown on the watch page — older cuts, not shown full-size. */
.version-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
}
.version-picker label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.version-picker select {
  appearance: auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--chip);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.version-picker select:hover {
  border-color: var(--ink);
}

/* copy-paste prompt block on the watch page */
.prompt-card {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--subtle);
  overflow: hidden;
}
.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.prompt-copy {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.prompt-copy:hover { border-color: var(--ink); }
.prompt-copy.copied {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.prompt-text {
  margin: 0;
  padding: 14px 16px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}

/* ---------- grouped sections on the channel front ---------- */
.video-group {
  margin-bottom: 46px;
}

.video-group[hidden] {
  display: none;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 13px
;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.group-title .group-count {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--subtle);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

/* ── Shorts ─────────────────────────────────────────────────────────────────
   Vertical video as a channel section: the same group heading as the others,
   portrait cards in a denser grid (six across on desktop, two on a phone). */
.shorts-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 28px 16px;
}
@media (max-width: 1180px) {
  .shorts-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shorts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
}
.short-card .thumb-link { display: block; }
.short-card .video-title {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.3;
}
.reel-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
}
.reel-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.reel-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: opacity 0.15s ease;
}
.reel-frame.playing .reel-play { opacity: 0; }
.reel-frame.playing:hover .reel-play { opacity: 1; }
.reel-badge,
.reel-dur {
  position: absolute;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.7rem;
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
}
.reel-badge { top: 8px; left: 8px; }
.reel-dur   { bottom: 8px; right: 8px; }
.reel-title {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.3;
}
.reel-summary {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  opacity: 0.65;
}
.reel-workflow {
  font-size: 0.78rem;
  text-decoration: none;
  opacity: 0.85;
}
.reel-workflow:hover { text-decoration: underline; }

/* ── Reel page ──────────────────────────────────────────────────────────────
   Its own page, reached by pressing a short in its section. Mirrors the watch page
   so arriving here feels like arriving at a module: same top bar, same shell,
   a large vertical player instead of a landscape one. */
.reel-stage {
  max-width: 420px;
  margin: 0 auto 24px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}
.reel-player {
  width: 100%;
  aspect-ratio: 9 / 16;
  display: block;
  object-fit: contain;
  background: #000;
}
.reel-meta h1 {
  margin: 0 0 10px;
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.reel-page-summary {
  margin: 0 0 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.72;
}
.reel-cta {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--fg, #111);
  color: var(--bg, #fff);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.reel-cta:hover { opacity: 0.88; }
.reel-back {
  display: block;
  margin-top: 18px;
  font-size: 0.85rem;
  text-decoration: none;
  opacity: 0.6;
}
.reel-back:hover { text-decoration: underline; }

.reel-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-play { pointer-events: none; }

/* Keep portrait covers intact alongside landscape tutorials in the home grid. */
.home-grid .reel-frame { aspect-ratio: 16 / 9; }
.home-grid .reel-frame :is(img, video) { width: 100%; height: 100%; object-fit: contain; }
