/* Layout: YouTube's frame (top bar, left rail, card grid), HN's restraint, YouTLDR's green as the one accent. */
:root {
  --bg: #ffffff;
  --surface: #f1f4f2;
  --surface-2: #e6ebe8;
  --ink: #0f1512;
  --muted: #5b6660;
  --faint: #8a948e;
  --line: #e2e7e4;
  --brand: #00D85D;
  --brand-ink: #ffffff;
  --green-text: #0a6b35;
  --chip-on-bg: #0f1512;
  --chip-on-ink: #ffffff;
  --badge-bg: rgba(10, 14, 12, .82);
  --focus: #0a6b35;
  --sans: Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: Roboto, "Helvetica Neue", Arial, sans-serif;
  --rail: 232px;
  --bar: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1310; --surface: #1a211d; --surface-2: #232b26; --ink: #eef2ef; --muted: #a0aba4; --faint: #77827b;
    --line: #26302a; --green-text: #45e488; --chip-on-bg: #eef2ef; --chip-on-ink: #0e1310; --badge-bg: rgba(0,0,0,.82);
    --focus: #45e488; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1310; --surface: #1a211d; --surface-2: #232b26; --ink: #eef2ef; --muted: #a0aba4; --faint: #77827b;
  --line: #26302a; --green-text: #45e488; --chip-on-bg: #eef2ef; --chip-on-ink: #0e1310; --badge-bg: rgba(0,0,0,.82);
  --focus: #45e488; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* top bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; height: var(--bar); background: var(--bg);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sumtoggle { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding-inline: 10px 12px; border-radius: 18px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.sumtoggle:hover { background: var(--surface); color: var(--ink); }
.sumtoggle .sw { position: relative; width: 28px; height: 16px; border-radius: 8px; background: var(--surface-2); transition: background .15s; }
.sumtoggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--faint); transition: transform .15s, background .15s; }
.sumtoggle[aria-pressed="true"] .sw { background: var(--brand); }
.sumtoggle[aria-pressed="true"] .sw::after { transform: translateX(12px); background: #fff; }
body.no-sum .card .line { display: none; }
.tagline { display: flex; flex-direction: column; margin-left: 14px; padding-left: 16px; border-left: 1px solid var(--line); line-height: 1.3; min-width: 0; }
.tagline b, .subbar b { font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.fresh { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.fresh i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 var(--brand); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 216, 93, .5); } 70%, 100% { box-shadow: 0 0 0 6px rgba(0, 216, 93, 0); } }
.subbar { display: none; }
@media (max-width: 1240px) {
  .tagline { display: none; }
  .subbar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 2px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px)); }
  .subbar b { white-space: normal; }
}
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.logo svg { width: 28px; height: 28px; flex: none; }
.search { justify-self: center; width: 100%; max-width: 560px; display: flex; align-items: center; gap: 8px; height: 40px;
  border: 1px solid var(--line); border-radius: 20px; padding-inline: 14px; background: var(--bg); }
.search:focus-within { border-color: var(--green-text); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { all: unset; flex: 1; min-width: 0; font-size: 15px; color: var(--ink); }
.search input::placeholder { color: var(--faint); }
.bar-right { display: flex; gap: 4px; align-items: center; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--muted); }
.iconbtn:hover { background: var(--surface); color: var(--ink); }
.iconbtn svg { width: 20px; height: 20px; }

/* frame */
.frame { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.rail { position: sticky; top: calc(var(--bar) + env(safe-area-inset-top, 0px)); align-self: start; height: calc(100vh - var(--bar));
  overflow-y: auto; padding: 8px 12px 24px max(12px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 2px; }
.rail a, .rail button { display: flex; align-items: center; gap: 14px; height: 40px; padding-inline: 12px; border-radius: 10px;
  font-size: 14px; text-align: left; width: 100%; color: var(--ink); }
.rail a:hover, .rail button:hover { background: var(--surface); }
.rail .on { background: var(--surface); font-weight: 600; }
.rail svg { width: 20px; height: 20px; flex: none; }
.rail > * { flex: none; }
.rail h4 { margin: 14px 12px 6px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.rail hr { border: 0; border-top: 1px solid var(--line); margin: 10px 12px; }
.rail .topic { height: 34px; font-size: 13.5px; color: var(--muted); }
.rail .topic.on { color: var(--ink); }
.rail small { padding: 12px; color: var(--faint); font-size: 12px; line-height: 1.5; }
main { min-width: 0; padding: 4px max(16px, env(safe-area-inset-right, 0px)) 48px 12px; }

/* mobile tabs */
.tabs { display: none; }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 14px; scrollbar-width: none; position: sticky;
  top: calc(var(--bar) + env(safe-area-inset-top, 0px)); background: var(--bg); z-index: 10; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding-inline: 12px; border-radius: 8px; background: var(--surface); font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--chip-on-bg); color: var(--chip-on-ink); }
.chip-sep { flex: none; width: 1px; background: var(--line); margin-block: 6px; }

/* section header */
.group { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 14px; }
.group h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.group span { color: var(--muted); font-size: 13px; }
.page-intro { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin: 6px 0 2px; }
.page-intro p { margin: 0; color: var(--muted); max-width: 70ch; }
.sort { display: inline-flex; gap: 4px; background: var(--surface); padding: 3px; border-radius: 9px; }
.sort button { height: 28px; padding-inline: 10px; border-radius: 7px; font-size: 13px; color: var(--muted); }
.sort button.on { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* grid + card */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px 16px; }
.card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
.card-row .avatar { width: 36px; height: 36px; font-size: 15px; }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 12px; overflow: hidden; background: var(--surface); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.card:hover .thumb img { transform: scale(1.02); }
.dur { position: absolute; right: 6px; bottom: 6px; background: var(--badge-bg); color: #fff; font: 500 12px/1 var(--mono);
  padding: 3px 5px; border-radius: 5px; }
.card.seen .thumb img { opacity: .55; }
.card.seen .title { color: var(--muted); }
.body { display: flex; flex-direction: column; min-width: 0; padding-right: 8px; }
/* YouTube's card type: 16/22 medium title, 14/20 regular channel + meta, both muted. */
.title { margin: 0 0 4px; font-size: 16px; font-weight: 500; line-height: 22px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chan { color: var(--muted); font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { color: var(--muted); font-size: 14px; line-height: 20px; display: flex; flex-wrap: wrap; column-gap: 4px; }
.meta .dot::before { content: "\2022"; font-size: 9px; vertical-align: 2px; }
.trust { color: var(--muted); font-size: 14px; line-height: 20px; }

/* The answer plate: staircase marker, the answer in green, "that's the whole video.", a folded tl;dr. */
.line { margin: 10px 0 0; padding: 9px 12px 10px; border-radius: 10px; background: var(--surface); font-size: 14px; line-height: 20px; }
.line.none { background: none; padding: 0; }
.line.ans { display: flex; flex-direction: column; }
.line.ans p { margin: 0; }
.line.ans .stair { background: var(--brand); }
.line.ans .lead { color: var(--muted); font-weight: 500; }
.line.ans .a { font-weight: 700; color: var(--green-text); font-size: 15px; }
.line.ans .whole { margin-top: 1px; padding-left: 18px; color: var(--faint); font-size: 12.5px; font-weight: 500; }
.tldr { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 7px; }
.tldr summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 500; border-radius: 6px; }
.tldr summary::-webkit-details-marker { display: none; }
.tldr summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -1px); margin-left: 4px; transition: transform .15s; }
.tldr[open] summary::after { transform: rotate(-135deg) translate(-1px, -2px); }
.tldr summary:hover { color: var(--ink); }
.tldr p { margin: 6px 0 2px; color: var(--ink); }
.tl { font-family: var(--mono); font-weight: 700; letter-spacing: .02em; }
.tldr-open { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tldr-open .tl { color: var(--green-text); font-size: 13px; }
.tldr-open p { margin: 4px 0 0; color: var(--ink); max-width: 75ch; }
.about .demo .line { background: var(--bg); }
.stair { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px;
  clip-path: polygon(0 0, 100% 0, 100% 33.333%, 66.666% 33.333%, 66.666% 66.666%, 33.333% 66.666%, 33.333% 100%, 0 100%); }
.line .lead { font-weight: 700; }
.line.whole { color: var(--ink); }
.line.whole .stair { background: var(--brand); }
.line.whole .tag { color: var(--green-text); font-weight: 700; white-space: nowrap; }
.line.about { color: var(--muted); }
.line.about .stair { background: var(--faint); }
.line.none { color: var(--faint); font-style: italic; }
.at { font: 500 12.5px var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.at:hover { text-decoration: underline; }

.empty { padding: 48px 0; color: var(--muted); text-align: center; }

/* watch page */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; padding-top: 8px; }
.player { position: relative; display: block; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 14px; overflow: hidden; background: #000; }
.player img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.player .play { position: absolute; inset: 0; display: grid; place-items: center; }
.player .play span { width: 68px; height: 48px; border-radius: 14px; background: var(--brand); display: grid; place-items: center; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.player .play svg { width: 22px; height: 22px; color: #fff; margin-left: 3px; }
.player:hover .play span { transform: scale(1.05); }
.w-title { margin: 14px 0 6px; font-size: 21px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.w-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.w-chan { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 500; font-size: 17px; color: #fff; flex: none; }
.chip .n, .rail .topic .n { margin-left: 6px; font-variant-numeric: tabular-nums; color: var(--faint); font-weight: 400; }
.chip.on .n { color: inherit; opacity: .7; }
.rail .topic { justify-content: space-between; }
.w-chan b { display: block; font-size: 15px; }
.yt { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding-inline: 14px; border-radius: 18px; background: var(--surface); font-weight: 500; }
.yt:hover { background: var(--surface-2); }
.yt svg { width: 16px; height: 16px; }
.w-line { margin-top: 16px; padding: 16px 18px; border-radius: 12px; background: var(--surface); }
.w-line .line { margin: 0; padding: 0; background: none; font-size: 16px; line-height: 24px; }
.w-line .line:not(.ans) { display: block; }
.w-line .line.ans .a { font-size: 22px; line-height: 28px; letter-spacing: -.01em; }
.w-line .line.ans .lead { font-size: 15px; }
.w-line .line.ans .whole { padding-left: 20px; font-size: 14px; margin-top: 2px; }
.w-line .stair { width: 14px; height: 14px; vertical-align: -1px; }
.w-line .fine { display: block; margin-top: 12px; color: var(--faint); font-size: 12.5px; }
.w-line .fine a { text-decoration: underline; text-underline-offset: 2px; }
.w-desc { margin-top: 12px; padding: 14px 18px; border-radius: 12px; background: var(--surface); }
.w-desc .stats { font-weight: 600; margin-bottom: 6px; }
.w-desc p { margin: 0 0 8px; max-width: 75ch; }
.quote { margin: 14px 0 0; padding: 0 0 0 14px; border-left: 3px solid var(--brand); font-size: 15px; }
.quote footer { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.quote footer a { color: var(--green-text); }
.quote footer a:hover { text-decoration: underline; }
.upnext { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.upnext h3 { margin: 0 0 4px; font-size: 16px; }
.mini { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 10px; }
.mini .thumb { border-radius: 8px; }
.mini .title { font-size: 14px; }
.mini .meta { font-size: 12px; }
.mini .line { -webkit-line-clamp: 2; font-size: 12.5px; margin-top: 2px; }

/* about */
.about { max-width: 720px; padding: 12px 0 0 4px; }
.about h1 { font-size: 28px; letter-spacing: -.02em; margin: 6px 0 12px; text-wrap: balance; }
.about h2 { font-size: 18px; margin: 30px 0 8px; }
.about p { font-size: 15.5px; line-height: 1.65; margin: 0 0 12px; color: var(--ink); }
.about a.u { color: var(--green-text); text-decoration: underline; text-underline-offset: 2px; }
.about .demo { display: grid; gap: 10px; margin: 14px 0; padding: 16px; border-radius: 12px; background: var(--surface); }
.about .demo .line { -webkit-line-clamp: unset; margin: 0; font-size: 14.5px; }
.chlist { columns: 2 220px; column-gap: 24px; padding: 0; margin: 10px 0 0; list-style: none; font-size: 13.5px; }
.chlist li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.chlist li span:last-child { color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.chfilter { width: 100%; max-width: 320px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding-inline: 12px; background: var(--bg); color: var(--ink); font: inherit; }

footer.site { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
footer.site a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 1100px) { .watch { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  :root { --bar: 56px; }
  .frame { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  main { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
  .bar { grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
  .bar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .bar-right .rss { display: none; }
  .sumtoggle { font-size: 0; gap: 0; padding-inline: 6px; }
  .search { height: 38px; }
  .tabs { display: flex; gap: 6px; padding-top: 4px; }
  .tabs a { flex: 1; text-align: center; height: 36px; display: grid; place-items: center; border-radius: 9px; font-weight: 600; color: var(--muted); background: var(--surface); }
  .tabs a.on { background: var(--chip-on-bg); color: var(--chip-on-ink); }
  .mini { grid-template-columns: 140px minmax(0, 1fr); }
  .logo span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* production additions */
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.img { background: var(--surface-2); }
.player { cursor: pointer; border: 0; padding: 0; width: 100%; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.more { display: flex; justify-content: center; padding: 28px 0 0; }
.more button { height: 36px; padding-inline: 18px; border-radius: 18px; background: var(--surface); font-weight: 500; }
.more button:hover { background: var(--surface-2); }
.loading { padding: 64px 0; color: var(--muted); text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.morefrom { align-self: flex-start; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--green-text); }
.morefrom:hover { text-decoration: underline; }
