/* ==========================================================================
   YouTubeToTranscript — single stylesheet, no build step.
   Layout is mobile-first; breakpoints only widen it.
   ========================================================================== */

:root {
  --red: #ef4444;
  --red-dark: #dc2626;
  --red-soft: #fee2e2;
  --red-ink: #7f1d1d;

  --ink: #16181d;
  --ink-2: #3f444d;
  --ink-3: #6b7280;
  --line: #e5e7eb;
  --line-2: #f1f3f5;

  --bg: #ffffff;
  --bg-2: #f8fafc;
  --surface: #ffffff;
  --nav-bg: rgb(255 255 255 / 88%);
  --badge-bg: rgb(255 255 255 / 75%);
  --on-ink: #ffffff;

  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 8px 24px -12px rgb(16 24 40 / 18%);
  --shadow-lg: 0 4px 8px rgb(16 24 40 / 6%), 0 24px 48px -16px rgb(16 24 40 / 24%);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1140px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

img { max-width: 100%; height: auto; }

a { color: var(--red-dark); }
a:hover { color: var(--red); }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--line-2);
  padding: 0.15em 0.4em;
  border-radius: 5px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 0; top: 0; z-index: 100; transform: translateY(-120%);
  background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { transform: none; }

/* --------------------------------------------------------------- buttons */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.2;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { box-shadow: var(--shadow); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.btn--primary { --btn-bg: var(--red); --btn-fg: #fff; border-color: transparent; }
.btn--primary:hover { --btn-bg: var(--red-dark); color: #fff; }
.btn--ghost { background: transparent; }
.btn--sm { padding: 6px 12px; font-size: 0.84rem; }
.btn--lg { padding: 14px 28px; font-size: 1.02rem; }
.btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn__spinner { display: none; width: 14px; height: 14px; }
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy .btn__spinner {
  display: block;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- nav/foot */

.nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
}
.nav__brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1.02rem; color: var(--ink); text-decoration: none;
}
.nav__brand svg { width: 26px; height: 26px; fill: var(--red); }
.nav__links { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav__links a {
  color: var(--ink-2); text-decoration: none; font-size: .9rem; font-weight: 500;
  padding: 7px 11px; border-radius: 8px;
}
.nav__links a:hover { background: var(--bg-2); color: var(--ink); }

.nav__burger {
  display: none; margin-left: auto; flex-direction: column; gap: 4px;
  width: 40px; height: 36px; padding: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 8px;
}
.nav__burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 760px) {
  .nav__burger { display: flex; }
  .nav__links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--surface);
    border-bottom: 1px solid var(--line); padding: 10px 16px 16px; gap: 2px;
  }
  .nav__links.is-open { display: flex; }
  .nav__brand span { font-size: .95rem; }
}

.footer {
  margin-top: 56px; padding: 32px 20px; border-top: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink-3); font-size: .85rem; text-align: center;
}
.footer__legal { margin: 0 0 8px; }
.footer__disclaimer { margin: 0 auto 14px; max-width: 62ch; }
.footer__links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.footer__links a { color: var(--ink-2); }

/* ------------------------------------------------------------------- hero */

.hero { background: linear-gradient(180deg, var(--red-soft) 0%, var(--bg) 100%); padding: 56px 20px 40px; }
.hero--compact { padding: 40px 20px 28px; }
.hero__inner { max-width: 680px; margin: 0 auto; text-align: center; }
.hero__badge {
  display: inline-block; margin: 0 0 18px; padding: 5px 13px;
  font-size: .76rem; font-weight: 600; letter-spacing: .02em;
  background: var(--badge-bg); border: 1px solid var(--line);
  border-radius: 999px; color: var(--ink-2);
}
.hero__title {
  margin: 0 0 14px; font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; letter-spacing: -.02em;
}
.hero__sub { margin: 0 0 28px; font-size: 1.06rem; color: var(--ink-2); }
.hero__points {
  list-style: none; display: flex; gap: 10px 22px; flex-wrap: wrap; justify-content: center;
  margin: 26px 0 0; padding: 0; font-size: .88rem; color: var(--ink-2); font-weight: 500;
}
.hero__points li::before { content: "✓ "; color: var(--ok); font-weight: 700; }

/* ------------------------------------------------------------------- form */

.yt-form { margin: 0 auto; max-width: 560px; }
.yt-form__row { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 560px) { .yt-form__row { flex-direction: row; } }

.yt-form input[type="url"] {
  flex: 1; min-width: 0; padding: 13px 16px; font: inherit; font-size: .98rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.yt-form input[type="url"]::placeholder { color: var(--ink-3); }
.yt-form input[type="url"]:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgb(239 68 68 / .18); }
.yt-form input[type="url"]:user-invalid { border-color: var(--err); }

.yt-form__error { margin: 10px 0 0; font-size: .86rem; color: var(--err); font-weight: 500; }
.cf-turnstile { margin-top: 14px; display: flex; justify-content: center; }
.cf-turnstile:empty { display: none; }
.field--inline .cf-turnstile { flex-basis: 100%; margin-top: 0; }

/* --------------------------------------------------------------- features */

.features {
  max-width: var(--wrap); margin: 0 auto; padding: 8px 20px 32px;
  display: grid; gap: 16px; grid-template-columns: 1fr;
}
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); } }

.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow);
}
.feature__title { margin: 0 0 8px; font-size: 1.04rem; }
.feature__body { margin: 0; font-size: .92rem; color: var(--ink-2); }

/* ------------------------------------------------------------------- prose */

.prose { max-width: 760px; margin: 0 auto; padding: 24px 20px 8px; }
.prose--narrow { max-width: 640px; }
.prose--tight { padding-top: 8px; }
.prose h2 { margin: 34px 0 12px; font-size: 1.42rem; letter-spacing: -.01em; }
.prose h3 { margin: 24px 0 8px; font-size: 1.1rem; }
.prose p { margin: 0 0 14px; color: var(--ink-2); }
.prose__note {
  padding: 12px 16px; background: var(--bg-2); border-left: 3px solid var(--line);
  border-radius: 0 8px 8px 0; font-size: .9rem;
}
.prose__cta { margin-top: 32px; text-align: center; }

.bullets, .steps { margin: 0 0 18px; padding-left: 22px; color: var(--ink-2); }
.bullets li, .steps li { margin-bottom: 8px; }

.faq { border-top: 1px solid var(--line); margin-bottom: 24px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  padding: 16px 4px; font-weight: 600; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; color: var(--ink-3); font-size: 1.2rem; line-height: 1.3; }
.faq__item[open] summary::after { content: "−"; }
.faq__item p { margin: 0 0 16px; font-size: .93rem; color: var(--ink-2); }

/* -------------------------------------------------------------- workbench */

.workbench { max-width: var(--wrap); margin: 0 auto; padding: 28px 20px; }
.workbench__head { margin-bottom: 20px; }
.workbench__title { margin: 0 0 8px; font-size: clamp(1.3rem, 3.5vw, 1.8rem); line-height: 1.25; }
.workbench__meta {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin: 0; font-size: .87rem; color: var(--ink-3);
}
.workbench__meta a { color: var(--ink-2); font-weight: 500; }
.tag {
  padding: 2px 8px; background: var(--line-2); border: 1px solid var(--line);
  border-radius: 999px; font-size: .74rem; color: var(--ink-2);
}

.workbench__grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .workbench__grid { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); } }

.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player iframe, .player__placeholder { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__placeholder img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }

.description { margin-top: 12px; font-size: .88rem; }
.description summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.description p { margin: 10px 0 0; color: var(--ink-3); white-space: pre-wrap; max-height: 220px; overflow: auto; }

.workbench__panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar--row { align-items: end; }
.toolbar--foot { justify-content: space-between; align-items: center; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--ink-2); }
.field--inline { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.field__label { font-weight: 600; }
.field select, .filters input {
  padding: 9px 12px; font: inherit; font-size: .9rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
}
.field select:focus, .filters input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgb(239 68 68 / .16); }
.filters input { min-width: 190px; }
.downloads { display: flex; gap: 8px; }

.status { margin: 0; font-size: .87rem; color: var(--ink-3); min-height: 1.2em; }
.status.is-err { color: var(--err); }
.status.is-ok { color: var(--ok); }

/* ------------------------------------------------------------------- cues */

.cues {
  list-style: none; margin: 0; padding: 0;
  max-height: 62vh; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
@media (max-width: 999px) { .cues { max-height: none; } }

.cue {
  display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start;
  padding: 7px 12px; border-bottom: 1px solid var(--line-2); font-size: .93rem;
}
.cue:last-child { border-bottom: 0; }
.cue:hover { background: var(--bg-2); }
.cue.is-active { background: var(--red-soft); }
.cue.is-active .cue__time { color: var(--red-dark); border-color: var(--red); }

.cue__time {
  font-family: var(--mono); font-size: .78rem; color: var(--ink-3);
  background: transparent; border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 0; cursor: pointer; text-align: center;
}
.cue__time:hover { color: var(--red-dark); border-color: var(--red); }
.cue__text { color: var(--ink-2); }
.cue__text[contenteditable="true"] { outline: none; border-radius: 4px; }
.cue__text[contenteditable="true"]:focus { background: var(--surface); box-shadow: 0 0 0 2px rgb(239 68 68 / .35); }

.cues.is-removing .cue { cursor: pointer; }
.cues.is-removing .cue::before { content: "×"; color: var(--err); font-weight: 700; grid-column: 1; }
.cues.is-removing .cue__time { visibility: hidden; }
.cue.is-removed { opacity: .4; }
.cue.is-removed .cue__text { text-decoration: line-through; }
.cue[hidden] { display: none; }

/* Timestamps are opt-in: without them the cue collapses to a single readable
   column. Exports still work because they read data-start, not the button. */
.cues:not(.has-times) .cue { grid-template-columns: 1fr; }
.cues:not(.has-times) .cue__time { display: none; }

.cues__empty { margin: 0; padding: 20px; text-align: center; color: var(--ink-3); font-size: .9rem; }

/* ----------------------------------------------------------------- notice */

.notice { max-width: 620px; margin: 0 auto; padding: 64px 20px; text-align: center; }
.notice__title { margin: 0 0 12px; font-size: clamp(1.5rem, 5vw, 2rem); }
.notice__body { margin: 0 0 22px; color: var(--ink-2); }
.notice__ref { font-size: .85rem; color: var(--ink-3); }
.notice__actions { margin: 24px 0; }
.notice__detail { margin: 20px 0; font-size: .84rem; color: var(--ink-3); text-align: left; }
.notice__detail summary { cursor: pointer; }
.notice__detail p { margin: 8px 0 0; word-break: break-word; }
.notice__back { margin-top: 24px; font-size: .9rem; }
.page-404 .notice { padding-top: 96px; }

/* ---------------------------------------------------------------- summary */

.summary { max-width: 860px; margin: 0 auto; padding: 28px 20px; }
.summary__card {
  display: grid; grid-template-columns: 1fr; gap: 22px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
}
@media (min-width: 720px) { .summary__card { grid-template-columns: 300px 1fr; } }
.summary__thumb { width: 100%; border-radius: var(--radius); }
.summary__title { margin: 0 0 8px; font-size: 1.4rem; line-height: 1.25; }
.summary__meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-3); margin: 0 0 20px; }
.summary__heading { margin: 22px 0 10px; font-size: 1.02rem; }
.summary__excerpt { position: relative; font-size: .93rem; color: var(--ink-2); max-height: 260px; overflow: hidden; }
.summary__fade { position: absolute; inset: auto 0 0 0; height: 60px; background: linear-gradient(transparent, var(--surface)); }
.summary__none { font-size: .9rem; color: var(--ink-3); }
.summary__actions { margin: 24px 0 0; }

.keywords { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; }
.keywords li {
  padding: 4px 11px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; font-size: .84rem; color: var(--ink-2);
}
.leads { margin: 0; padding-left: 20px; font-size: .93rem; color: var(--ink-2); }
.leads li { margin-bottom: 8px; }

/* ---------------------------------------------------------------- prompts */

.prompt-cat { margin-bottom: 34px; }
.prompt-cat h2 { margin: 0 0 6px; font-size: 1.24rem; }
.prompt-cat__blurb { margin: 0 0 14px; font-size: .9rem; color: var(--ink-3); }
.prompt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prompt {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
}
.prompt code { background: transparent; padding: 0; font-size: .87rem; line-height: 1.5; color: var(--ink-2); }

/* ------------------------------------------------------------------ toast */

.toast { position: fixed; top: 72px; right: 16px; z-index: 60; max-width: min(380px, calc(100vw - 32px)); }
.toast__box {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--ink-3);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: toast-in .18s ease-out;
}
.toast.is-ok .toast__box { border-left-color: var(--ok); }
.toast.is-err .toast__box { border-left-color: var(--err); }
.toast.is-info .toast__box { border-left-color: var(--red); }
.toast__icon { width: 20px; height: 20px; flex: none; border-radius: 50%; margin-top: 1px; }
.toast.is-ok .toast__icon { background: var(--ok); }
.toast.is-err .toast__icon { background: var(--err); }
.toast.is-info .toast__icon { background: var(--red); }
.toast__body { display: flex; flex-direction: column; gap: 2px; font-size: .88rem; }
.toast__msg { color: var(--ink-3); }
.toast__close { background: none; border: 0; font-size: 1.3rem; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 0 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* ------------------------------------------------------------- responsive */

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

@media print {
  .nav, .footer, .toolbar, .filters, .downloads, .toast, .workbench__player { display: none !important; }
  .cues { max-height: none; overflow: visible; border: 0; }
  .cue { grid-template-columns: 56px 1fr; }
}

/* ---------------------------------------------------------- landing pages */

.tool-links { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.tool-links a {
  display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .9rem; color: var(--ink-2); text-decoration: none; background: var(--surface);
}
.tool-links a:hover { border-color: var(--red); color: var(--red-dark); }

.related { margin: 28px 0 8px; border-top: 1px solid var(--line); padding-top: 14px; font-size: .86rem; color: var(--ink-3); }
.related summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.related__count { font-weight: 400; color: var(--ink-3); }
.related__list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.related__list li { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; }
.related__heading { font-size: .92rem; margin: 16px 0 6px; color: var(--ink-2); }
.related__questions { margin: 0; padding-left: 20px; columns: 2 280px; }
.related__questions li { margin-bottom: 4px; break-inside: avoid; }

.hub { max-width: var(--wrap); margin: 0 auto; padding: 8px 20px 12px; }
.hub__title { font-size: 1.2rem; margin: 26px 0 12px; }
.hub__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .hub__list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .hub__list { grid-template-columns: repeat(3, 1fr); } }
.hub__card {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px 18px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink);
}
.hub__card:hover { border-color: var(--red); box-shadow: var(--shadow); }
.hub__card span { font-size: .86rem; color: var(--ink-3); }

.mini-tool {
  max-width: 600px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
  text-align: start; background: var(--surface); padding: 18px; border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.mini-tool__field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 160px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.mini-tool__field--wide { flex-basis: 100%; }
.mini-tool input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-weight: 400;
  background: var(--bg);
}
.mini-tool input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgb(239 68 68 / .16); }
.mini-tool__out { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; }
.mini-tool__out input { flex: 1 1 240px; font-family: var(--mono); }
.mini-tool .yt-form__error { flex-basis: 100%; margin: 0; }

.cite-out { flex-basis: 100%; display: grid; gap: 14px; }
.cite-out__item { border-top: 1px solid var(--line); padding-top: 12px; }
.cite-out__item h3 { margin: 0 0 6px; font-size: .95rem; }
.cite-out__ref { margin: 0 0 8px; font-size: .92rem; line-height: 1.55; padding-inline-start: 2em; text-indent: -2em; }
.cite-out__intext { margin: 8px 0 0; font-size: .86rem; color: var(--ink-3); }

.music-out { flex-basis: 100%; display: grid; gap: 12px; min-width: 0; }
.music-out p { margin: 0; }
.music-out__label { font-size: .84rem; font-weight: 600; color: var(--ink-3); }
.music-out__none { font-weight: 600; color: var(--ink); }
.music-out__tips, .music-out__foot { font-size: .9rem; color: var(--ink-2); }
.music-video { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.music-video img { flex: none; width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--bg-2); }
.music-video > div { min-width: 0; }
.music-video__title { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.music-video__author { font-size: .86rem; color: var(--ink-3); }
.music-song { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.music-song__art { flex: none; width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }
.music-song__text { min-width: 0; flex: 1; display: grid; gap: 2px; }
.music-song__title { font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.music-song__artist { color: var(--ink-2); overflow-wrap: anywhere; }
.music-song__album { font-size: .86rem; color: var(--ink-3); }
.music-song__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mini-tool .music-out[hidden] { display: none !important; }

.summary__hint { margin: -4px 0 8px; font-size: .86rem; color: var(--ink-3); }
.summary__copyable {
  white-space: pre-wrap; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font: .88rem/1.55 var(--mono); max-height: 320px; overflow: auto; margin: 0 0 10px;
}

.downloads { flex-wrap: wrap; align-items: center; }
.downloads__label { font-size: .82rem; font-weight: 600; color: var(--ink-3); margin-inline-end: 2px; }

.footer__langs { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin: 0 0 14px; font-size: .86rem; }
.footer__langs a { color: var(--ink-2); }
.footer__langs a[aria-current="page"] { font-weight: 700; color: var(--ink); }

/* Right-to-left (Arabic) */
[dir="rtl"] .bullets, [dir="rtl"] .steps { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .related__questions { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .yt-form input[type="url"] { direction: ltr; text-align: right; }

.mini-tool [hidden], .cite-out[hidden] { display: none !important; }


/* ---------------------------------------------------------------- dark mode
   Follows the system setting until the visitor picks one with the toggle,
   which sets data-theme on <html> (remembered in localStorage). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --red: #f87171;
  --red-dark: #fca5a5;
  --red-soft: #2a1416;
  --red-ink: #fecaca;
  --ink: #e8eaee;
  --ink-2: #c3c8d0;
  --ink-3: #9aa1ab;
  --line: #2b2f36;
  --line-2: #22262c;
  --bg: #111317;
  --bg-2: #171a1f;
  --surface: #1a1d22;
  --nav-bg: rgb(17 19 23 / 88%);
  --badge-bg: rgb(26 29 34 / 80%);
  --on-ink: #111317;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px -12px rgb(0 0 0 / 60%);
  --shadow-lg: 0 4px 8px rgb(0 0 0 / 30%), 0 24px 48px -16px rgb(0 0 0 / 70%);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --red: #f87171;
  --red-dark: #fca5a5;
  --red-soft: #2a1416;
  --red-ink: #fecaca;
  --ink: #e8eaee;
  --ink-2: #c3c8d0;
  --ink-3: #9aa1ab;
  --line: #2b2f36;
  --line-2: #22262c;
  --bg: #111317;
  --bg-2: #171a1f;
  --surface: #1a1d22;
  --nav-bg: rgb(17 19 23 / 88%);
  --badge-bg: rgb(26 29 34 / 80%);
  --on-ink: #111317;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px -12px rgb(0 0 0 / 60%);
  --shadow-lg: 0 4px 8px rgb(0 0 0 / 30%), 0 24px 48px -16px rgb(0 0 0 / 70%);
  color-scheme: dark;
}
body { background: var(--bg); color: var(--ink); }

.nav__theme {
  margin-inline-start: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.nav__theme:hover { color: var(--ink); border-color: var(--ink-3); }
.nav__theme svg { width: 18px; height: 18px; }
.nav__theme .icon-sun { display: none; }
:root[data-theme="dark"] .nav__theme .icon-sun { display: block; }
:root[data-theme="dark"] .nav__theme .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav__theme .icon-sun { display: block; }
  :root:not([data-theme="light"]) .nav__theme .icon-moon { display: none; }
}

/* ------------------------------------------------------- long-form content */
.prose--intro { padding-top: 28px; }
.byline { font-size: .86rem; color: var(--ink-3); margin: 4px 0 0; }
.byline a { color: var(--ink-2); }
.howto { list-style: none; counter-reset: step; padding: 0; margin: 0 0 18px; }
.howto__step { counter-increment: step; position: relative; padding-inline-start: 44px; margin-bottom: 6px; }
.howto__step::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: 2px; width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: var(--ink-2); background: var(--surface);
}
.howto__step h3 { margin: 4px 0 6px; }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table caption { text-align: start; padding: 10px 12px; font-size: .84rem; color: var(--ink-3); caption-side: bottom; }
.data-table th, .data-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.data-table thead th { background: var(--bg-2); font-weight: 600; color: var(--ink); }
.data-table tbody th { font-weight: 600; color: var(--ink); }
.data-table td { color: var(--ink-2); }
.data-table tr:last-child th, .data-table tr:last-child td { border-bottom: 0; }
.sources { margin: 0 0 18px; padding-inline-start: 22px; color: var(--ink-2); font-size: .92rem; }
.sources li { margin-bottom: 6px; overflow-wrap: anywhere; }

/* ======================================================= transcript screen (site red accent)
   One centred column: title, author line, then a card with the player,
   tabs, the Copy / Timestamp pair, Translate and the transcript itself. */
:root {
  --accent: #ef4444;
  --accent-hover: #dc2626;
  --accent-soft: #fef2f2;
  --accent-line: #fecaca;
  --accent-ink: #991b1b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #ef4444; --accent-hover: #f87171; --accent-soft: #2a1416; --accent-line: #5b2124; --accent-ink: #fca5a5;
  }
}
:root[data-theme="dark"] {
  --accent: #ef4444; --accent-hover: #f87171; --accent-soft: #2a1416; --accent-line: #5b2124; --accent-ink: #fca5a5;
}

.workbench { max-width: 880px; margin: 0 auto; padding: 32px 16px 12px; }
.wb__head { text-align: center; margin-bottom: 22px; }
.wb__title {
  margin: 0 0 10px; font-size: clamp(1.35rem, 3.6vw, 2.05rem); line-height: 1.3;
  overflow-wrap: anywhere; letter-spacing: -.01em;
}
.wb__meta, .wb__stats {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px;
  margin: 0; color: var(--ink-3); font-size: .95rem;
}
.wb__meta { color: var(--ink-2); font-weight: 500; }
.wb__meta a { color: var(--ink-2); }
.wb__stats { margin-top: 6px; font-size: .84rem; }
.wb__metalink {
  display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none;
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
}
.wb__metalink:hover { color: var(--accent); }
.wb__metalink svg { width: 16px; height: 16px; }

.wb__card {
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface);
  padding: 22px; display: flex; flex-direction: column; gap: 14px;
}
@media (max-width: 560px) { .wb__card { padding: 14px; border-radius: 16px; } }
.wb__cardhead { display: flex; align-items: center; justify-content: space-between; }
.wb__cardtitle { margin: 0; font-size: 1.2rem; font-weight: 600; }
.wb__pin {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.wb__pin[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

.wb__player { width: 100%; max-width: 700px; margin: 0 auto; }
.wb__player.is-pinned { position: sticky; top: 64px; z-index: 5; }
.wb__player .player { border-radius: 14px; }
.player__placeholder { cursor: pointer; }
.player__placeholder img { opacity: 1; }
.player__play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.player:hover .player__play { transform: scale(1.06); }

.wb__tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2);
}
.wb__tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 10px; border: 0; border-radius: 10px; background: transparent;
  font: inherit; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.wb__tab svg { width: 16px; height: 16px; }
.wb__tab[aria-selected="true"] { background: var(--ink); color: var(--on-ink); }
.wb__panel { display: flex; flex-direction: column; gap: 12px; }
.wb__panel[hidden] { display: none; }

.wb__actions {
  display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
  border-radius: 12px; overflow: hidden; border: 1px solid var(--accent);
}
.wb__copy, .wb__times, .wb__translate {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 12px; border: 0; font: inherit; font-size: 1.05rem; font-weight: 600; cursor: pointer;
}
.wb__copy { background: var(--accent); color: #fff; }
.wb__copy:hover { background: var(--accent-hover); }
.wb__times { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; font-size: .98rem; }
.wb__times[aria-pressed="true"] { background: var(--accent-line); color: var(--accent-ink); }
.wb__translate {
  width: 100%; background: var(--surface); color: var(--accent-ink); border: 1px solid var(--accent-line);
  border-radius: 12px; font-weight: 500; font-size: 1rem;
}
.wb__translate:hover, .wb__translate[aria-expanded="true"] { background: var(--accent-soft); }
.wb__translateform { display: flex; gap: 8px; flex-wrap: wrap; }
.wb__translateform[hidden] { display: none; }
.wb__translateform select {
  flex: 1 1 220px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit;
}

.wb__more { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface); }
.wb__more > summary { cursor: pointer; padding: 11px 0; font-size: .9rem; color: var(--ink-2); font-weight: 500; }
.wb__more[open] { padding-bottom: 14px; }
.wb__moregrid { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 10px; }
@media (min-width: 640px) { .wb__moregrid { grid-template-columns: 1fr 1fr; } }
.wb__more .field select, .wb__more .field input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit;
}
.wb__more .toolbar { margin-bottom: 10px; }
.wb__note { margin: 0; font-size: .86rem; color: var(--ink-3); }

/* The transcript: flowing paragraph text unless timestamps are on. */
.wb__card .cues {
  border: 0; border-radius: 0; background: transparent; max-height: 70vh;
  font-size: 1.08rem; line-height: 1.8; color: var(--ink);
}
@media (max-width: 999px) { .wb__card .cues { max-height: none; } }
.wb__card .cues:not(.has-times) { display: block; }
.wb__card .cues:not(.has-times) .cue {
  display: inline; padding: 0; border: 0; font-size: inherit; cursor: pointer;
}
.wb__card .cues:not(.has-times) .cue[hidden] { display: none; }
.wb__card .cues:not(.has-times) .cue__text { color: var(--ink); border-radius: 4px; }
.wb__card .cues:not(.has-times) .cue:hover { background: none; }
.wb__card .cues:not(.has-times) .cue:hover .cue__text { background: var(--accent-soft); }
.wb__card .cues:not(.has-times) .cue.is-active { background: none; }
.wb__card .cues:not(.has-times) .cue.is-active .cue__text { background: var(--accent-line); }
.wb__card .cues.has-times { border: 1px solid var(--line); border-radius: 12px; font-size: .98rem; line-height: 1.6; }
.wb__card .cues.has-times .cue__text { color: var(--ink-2); }

/* Summary tab */
.wb__sum { border-top: 1px solid var(--line); padding-top: 12px; }
.wb__sum:first-child { border-top: 0; padding-top: 0; }
.wb__sumhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.wb__sumhead h3 { margin: 0; font-size: 1rem; }
.wb__chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wb__chapters li { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.wb__chapters .cue__time { min-width: 56px; padding: 2px 6px; }

/* Loading card */
.wb__loading { align-items: center; text-align: center; padding: 40px 22px; gap: 16px; }
.wb__spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid var(--accent-line); border-top-color: var(--accent);
  animation: wb-spin .9s linear infinite;
}
@keyframes wb-spin { to { transform: rotate(360deg); } }
.wb__loadingtitle { margin: 0; font-size: 1.15rem; font-weight: 600; }
.wb__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .95rem; color: var(--ink-3); }
.wb__steps li::before { content: "\25CB"; margin-inline-end: 8px; }
.wb__steps li.is-current { color: var(--ink); font-weight: 500; }
.wb__steps li.is-current::before { content: "\25CF"; color: var(--accent); }
.wb__steps li.is-done { color: var(--ok); }
.wb__steps li.is-done::before { content: "\2713"; }
.wb__skeleton { width: 100%; max-width: 620px; display: grid; gap: 10px; }
.wb__skeleton span {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--line-2) 0%, var(--line) 50%, var(--line-2) 100%);
  background-size: 200% 100%; animation: wb-shimmer 1.3s ease-in-out infinite;
}
.wb__skeleton span:nth-child(2) { width: 92%; }
.wb__skeleton span:nth-child(3) { width: 96%; }
.wb__skeleton span:nth-child(4) { width: 70%; }
@keyframes wb-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .wb__spinner, .wb__skeleton span { animation: none; }
}

/* Bookmark prompt */
.bm { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.bm__backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 45%); }
.bm__box {
  position: relative; width: 100%; max-width: 560px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 20px; padding: 30px 28px 26px; box-shadow: var(--shadow-lg);
  animation: bm-in .18s ease-out;
}
@keyframes bm-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.bm__close {
  position: absolute; top: 12px; inset-inline-end: 12px; width: 36px; height: 36px;
  border: 0; background: transparent; font-size: 1.6rem; line-height: 1; color: var(--ink-2); cursor: pointer; border-radius: 8px;
}
.bm__close:hover { background: var(--bg-2); }
.bm__title { margin: 0 0 12px; font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.2; padding-inline-end: 30px; }
.bm__body { margin: 0 0 16px; color: var(--ink-2); line-height: 1.6; }
.bm__keyslabel { margin: 0 0 10px; font-weight: 600; }
.bm__keys { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0; font-size: 1.4rem; font-weight: 700; }
.bm__keys kbd {
  min-width: 82px; padding: 14px 18px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 12px;
  background: var(--bg-2); font-family: var(--mono); font-size: 1.3rem; text-align: center; color: var(--ink);
}
.bm__mobile { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 560px) {
  .wb__actions { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .wb__times { font-size: .86rem; padding-inline: 8px; white-space: nowrap; }
  .wb__times svg { width: 15px; height: 15px; }
}
