:root {
  --bg: #ffffff; --bg2: #f2f2f2; --bg3: #e5e5e5; --text: #0f0f0f; --muted: #606060;
  --line: #e5e5e5; --accent: #ff4500; --chip: #f2f2f2; --chip-on: #0f0f0f; --chip-on-text: #ffffff;
  --hover: rgba(0,0,0,.05); --good: #065fd4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f; --bg2: #272727; --bg3: #3f3f3f; --text: #f1f1f1; --muted: #aaaaaa;
    --line: #303030; --chip: #272727; --chip-on: #f1f1f1; --chip-on-text: #0f0f0f;
    --hover: rgba(255,255,255,.08); --good: #3ea6ff;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0f; --bg2: #272727; --bg3: #3f3f3f; --text: #f1f1f1; --muted: #aaaaaa;
  --line: #303030; --chip: #272727; --chip-on: #f1f1f1; --chip-on-text: #0f0f0f;
  --hover: rgba(255,255,255,.08); --good: #3ea6ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.4 Roboto, "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
h2, h3 { margin: 0; }

/* top bar */
.top { position: fixed; inset: 0 0 auto 0; height: 56px; z-index: 10; background: var(--bg);
       display: flex; align-items: center; justify-content: space-between; padding: 0 16px; gap: 16px; }
.left { display: flex; align-items: center; gap: 12px; flex: none; }
.icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.icon:hover { background: var(--hover); }
.brand { display: flex; align-items: center; font-weight: 700; font-size: 20px; letter-spacing: -.8px; white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 700; }
.search { flex: 0 1 640px; display: flex; min-width: 0; }
.search input { flex: 1; min-width: 0; height: 40px; padding: 0 16px; font: inherit; font-size: 16px;
                color: var(--text); background: var(--bg); border: 1px solid var(--bg3); border-right: 0;
                border-radius: 40px 0 0 40px; outline: none; }
.search input:focus { border-color: var(--good); }
.search button { width: 64px; height: 40px; border: 1px solid var(--bg3); background: var(--bg2);
                 border-radius: 0 40px 40px 0; display: grid; place-items: center; }
.right { display: flex; align-items: center; }

/* sidebar */
.side { position: fixed; top: 56px; bottom: 0; left: 0; width: 240px; overflow-y: auto; padding: 12px;
        background: var(--bg); z-index: 9; }
.side a { display: flex; align-items: center; gap: 24px; height: 40px; padding: 0 12px; border-radius: 10px; }
.side a:hover { background: var(--hover); }
.side a.on { background: var(--bg2); font-weight: 500; }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.side .new { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--accent); }
body.collapsed .side { width: 72px; padding: 4px; }
body.collapsed .side a { flex-direction: column; gap: 4px; height: 74px; justify-content: center; font-size: 10px; padding: 0; }
body.collapsed .side hr, body.collapsed .side .new { display: none; }
.scrim { display: none; }

main { margin-left: 240px; padding: 56px 24px 40px; }
body.collapsed main { margin-left: 72px; }

/* chips */
.chip { flex: none; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--chip);
        font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { background: var(--bg3); }
.chip.on { background: var(--chip-on); color: var(--chip-on-text); }
.chip svg { width: 20px; height: 20px; }
.chip .x { font-size: 16px; line-height: 1; opacity: .7; }

/* video grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px 16px; padding-top: 12px; }
.vcard { display: block; min-width: 0; }
.thumb { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: var(--bg2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.later-btn { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 4px;
             background: rgba(0,0,0,.8); color: #fff; display: none; place-items: center; cursor: pointer; }
.later-btn svg { width: 20px; height: 20px; }
a:hover .later-btn, .later-btn:focus, .later-btn.on { display: grid; }
.dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.8); color: #fff; font-size: 12px;
       font-weight: 500; padding: 1px 4px; border-radius: 4px; }
.info { padding-top: 12px; }
.vt { 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; }
.sub { color: var(--muted); font-size: 14px; line-height: 20px; }
.reason { color: var(--muted); font-size: 12px; line-height: 18px; margin-top: 2px; opacity: 0; transition: opacity .15s; }
.vcard:hover .reason, .vcard.kbd .reason { opacity: 1; }
.sentinel { height: 1px; }
.status { color: var(--muted); padding: 24px 0; text-align: center; }

/* search results and lists */
.results { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; max-width: 1100px; }
.srow { display: flex; gap: 16px; }
.srow .thumb { width: 360px; flex: none; }
.srow .vt { font-size: 18px; line-height: 26px; font-weight: 400; }
.srow .chan { margin: 8px 0; color: var(--muted); }
.snip { color: var(--muted); font-size: 12px; line-height: 18px;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.via { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--muted); background: var(--bg2);
       padding: 2px 6px; border-radius: 4px; }
.note { color: var(--muted); padding: 16px 0 0; }
.filterbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 16px; max-width: 1100px; }
.filterbar .grow { flex: 1; }
.chipbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: none; }
.chipbar::-webkit-scrollbar { display: none; }
.pagehead .crumb { display: inline-block; margin-top: 16px; color: var(--muted); font-size: 14px; }
.pagehead .crumb:hover { color: var(--text); }
.pagehead h2 { font-size: 24px; margin: 16px 0 0; }
.pagehead .crumb + h2 { margin-top: 2px; }
.pagehead .sub { margin: 4px 0 0; }
.filters { display: flex; gap: 16px 40px; flex-wrap: wrap; padding: 16px 0 8px; max-width: 1100px;
           border-bottom: 1px solid var(--bg3); }
.filters[hidden] { display: none; }
.filters h4 { margin: 0 0 8px; padding-bottom: 10px; border-bottom: 1px solid var(--bg3); font-size: 12px;
              font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); min-width: 140px; }
.filters a { display: block; padding: 7px 0; color: var(--muted); }
.filters a:hover, .filters a.on { color: var(--text); }
.filters a.on { font-weight: 500; }

/* categories */
.explore { max-width: 1400px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.sechead { font-size: 20px; font-weight: 700; margin: 28px 0 2px; }
.sechead + .sub { margin: 0 0 14px; }
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.areacard { background: var(--bg2); border-radius: 12px; padding: 14px 16px; }
.areaname { display: flex; align-items: center; font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.count { margin-left: auto; padding-left: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.cats a { display: flex; align-items: center; padding: 4px 0; color: var(--muted); font-size: 14px; }
.cats a:hover, .areaname:hover { color: var(--text); text-decoration: underline; }
.peoplewrap { display: flex; flex-wrap: wrap; gap: 8px; }
.peoplewrap .chip .count { padding-left: 2px; }

/* playlists */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px 16px; padding-top: 16px; }
.mosaic { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; aspect-ratio: 16 / 9;
          border-radius: 12px; overflow: hidden; background: var(--bg2); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plcount { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.8); color: #fff; font-size: 12px;
           font-weight: 500; padding: 2px 6px; border-radius: 4px; }
.plcard .vt { margin: 10px 0 4px; }
.plpage { max-width: 1100px; }
.plhead { display: flex; gap: 24px; padding-top: 24px; align-items: flex-start; }
.plhead .mosaic { width: 360px; flex: none; }
.plinfo { min-width: 0; }
.plinfo .crumb { color: var(--muted); font-size: 14px; }
.plinfo h2 { font-size: 28px; line-height: 34px; margin: 4px 0 6px; }
.plinfo .intro { line-height: 22px; margin: 12px 0; }
.plinfo .filterbar { padding-top: 0; }
.plrows { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 16px; }
.plrows li { display: flex; gap: 12px; align-items: flex-start; }
.plrows .num { width: 24px; flex: none; text-align: right; color: var(--muted); padding-top: 4px; }
.plrows .srow { flex: 1; min-width: 0; }
.plrows .srow .thumb { width: 280px; }
.plnote { margin: 8px 0 0; font-size: 14px; line-height: 20px; }

/* watch page */
.watch { display: flex; gap: 24px; padding-top: 24px; max-width: 1754px; margin: 0 auto; }
.primary { flex: 1; min-width: 0; }
.secondary { width: 402px; flex: none; }
.player { aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.poster { position: relative; width: 100%; height: 100%; padding: 0; display: block; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 68px; height: 48px;
                border-radius: 14px; background: rgba(0,0,0,.7); display: grid; place-items: center; transition: background .15s; }
.poster:hover .play { background: var(--accent); }
.poster .play svg { width: 32px; height: 32px; color: #fff; }
.watch h1 { font-size: 20px; line-height: 28px; font-weight: 700; margin: 12px 0 8px; }
.owner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.owner .who b { font-size: 16px; font-weight: 500; display: block; }
.owner .who .sub { font-size: 12px; line-height: 18px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { height: 36px; padding: 0 16px; border-radius: 18px; background: var(--bg2); font-weight: 500;
        display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pill:hover { background: var(--bg3); }
.pill svg { width: 20px; height: 20px; }
.pill.on svg { color: var(--good); }
.seg { display: flex; border-radius: 18px; overflow: hidden; background: var(--bg2); }
.seg button { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.seg button:hover { background: var(--bg3); }
.seg button + button { border-left: 1px solid var(--bg3); }
.seg button svg { width: 20px; height: 20px; }
.seg button.on svg { color: var(--good); }
.desc { background: var(--bg2); border-radius: 12px; padding: 12px; margin-top: 12px; }
.desc .top-line { font-weight: 500; margin-bottom: 6px; }
.desc p { margin: 0 0 10px; }
.desc .why { color: var(--muted); }
.desc blockquote { margin: 0 0 10px; padding-left: 10px; border-left: 3px solid var(--accent); }
.desc blockquote span { color: var(--muted); font-size: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg3); }
.tag.cat, .tag.person { font-weight: 500; }
a.tag:hover { color: var(--good); }
.says h2 { font-size: 20px; margin: 24px 0 4px; }
.years { display: flex; gap: 3px; height: 96px; margin: 16px 0 8px; max-width: 640px; }
.bar { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bar b { flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid var(--bg3); }
.bar b span { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; }
.bar i { font-style: normal; font-size: 11px; color: var(--muted); text-align: center; height: 16px; line-height: 16px; }
.whys { margin: 12px 0 0; padding-left: 20px; max-width: 800px; }
.whys li { margin-bottom: 6px; }
.more { color: var(--good); font-weight: 500; padding: 8px 0; }
.next { display: flex; gap: 8px; margin-bottom: 8px; }
.next .thumb { width: 168px; flex: none; border-radius: 8px; }
.next .vt { font-size: 14px; line-height: 20px; }
.next .sub { font-size: 12px; line-height: 18px; }
.sidehead { font-weight: 500; margin: 0 0 12px; }

/* instructionals */
.cover { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; color: #fff; padding: 16px 18px;
         display: flex; flex-direction: column; justify-content: flex-end; }
.cover .by { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; opacity: .85; margin-bottom: 4px; }
.cover .ti { font-size: 22px; line-height: 1.15; font-weight: 800; letter-spacing: -.4px;
             display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cover .vol { position: absolute; top: 12px; left: 18px; font-size: 11px; font-weight: 500; opacity: .75; letter-spacing: .06em; }
.cover .shop { position: absolute; right: 8px; top: 8px; background: rgba(0,0,0,.45); font-size: 11px; font-weight: 500;
               padding: 2px 6px; border-radius: 4px; }
.cover .belt { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: #111; }
.cover .belt::after { content: ""; position: absolute; top: 0; bottom: 0; right: 28px; width: 48px; background: #c8102e; }
.cover.big .ti { font-size: 30px; }
.ihead { display: flex; gap: 24px; padding-top: 24px; align-items: flex-start; max-width: 1100px; }
.ihead .cover { width: 420px; flex: none; }
.ihead h2 { font-size: 28px; line-height: 34px; margin: 4px 0 6px; }
.banner { background: var(--bg2); border-radius: 12px; padding: 14px 16px; margin-top: 16px; max-width: 1100px; color: var(--muted); }
.banner b { color: var(--text); }

/* about and settings */
.about { max-width: 720px; margin: 0 auto; padding: 24px 0 48px; font-size: 15px; line-height: 1.6; }
.about h1 { font-size: 32px; line-height: 1.2; margin: 8px 0 8px; letter-spacing: -.5px; }
.about .lede { font-size: 18px; color: var(--muted); margin: 0 0 24px; }
.about h2 { font-size: 20px; margin: 32px 0 8px; }
.about p { margin: 0 0 12px; }
.about ul { margin: 0 0 12px; padding-left: 20px; }
.about li { margin-bottom: 6px; }
.about a { color: var(--good); }
.about a:hover { text-decoration: underline; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 8px 0 8px; }
.stat { background: var(--bg2); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.stat span { color: var(--muted); font-size: 13px; }
.steps { counter-reset: s; list-style: none; padding: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-left: 36px; margin-bottom: 12px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 24px; height: 24px;
                    border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
                    display: grid; place-items: center; }
.fine { color: var(--muted); font-size: 13px; }
.settings { max-width: 720px; }
.setting { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-top: 24px;
           padding: 16px; border-radius: 12px; background: var(--bg2); cursor: pointer; }
.setting b { font-weight: 500; font-size: 15px; }
.setting p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.switch { position: relative; flex: none; width: 36px; height: 20px; margin-top: 2px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .knob { position: absolute; inset: 0; border-radius: 10px; background: var(--bg3); transition: background .15s; pointer-events: none; }
.switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
                       background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .knob { background: var(--good); }
.switch input:checked + .knob::after { transform: translateX(16px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--good); outline-offset: 2px; }

/* keyboard selection, shortcuts overlay, toast */
.vcard, .srow, .next { scroll-margin: 128px 0 24px; border-radius: 12px; }
.kbd { outline: 2px solid var(--good); outline-offset: 4px; }
.help { display: none; position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.5); place-items: center; padding: 16px; }
.help.on { display: grid; }
.help-card { background: var(--bg); color: var(--text); border-radius: 12px; padding: 20px 24px; max-width: 420px; width: 100%;
             box-shadow: 0 8px 32px rgba(0,0,0,.3); }
.help-card h3 { margin: 0 0 12px; font-size: 18px; }
.help-card table { border-collapse: collapse; width: 100%; }
.help-card td { padding: 5px 0; vertical-align: top; }
.help-card td:first-child { width: 100px; white-space: nowrap; }
kbd { font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 6px; border-radius: 4px;
      background: var(--bg2); border: 1px solid var(--bg3); }
.toast { position: fixed; left: 24px; bottom: 24px; z-index: 21; background: #222; color: #fff; padding: 10px 16px;
         border-radius: 8px; font-size: 14px; opacity: 0; transform: translateY(8px); transition: opacity .15s, transform .15s;
         pointer-events: none; }
.toast.on { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .watch { flex-direction: column; }
  .secondary { width: 100%; }
}
@media (max-width: 800px) {
  main, body.collapsed main { margin-left: 0; padding: 56px 16px 32px; }
  .side { transform: translateX(-100%); transition: transform .2s; width: 240px; }
  body.drawer .side { transform: none; box-shadow: 0 0 24px rgba(0,0,0,.3); }
  body.collapsed .side { width: 240px; padding: 12px; }
  body.collapsed .side a { flex-direction: row; height: 40px; font-size: 14px; padding: 0 12px; justify-content: flex-start; gap: 24px; }
  body.collapsed .side hr, body.collapsed .side .new { display: revert; }
  body.drawer .scrim { display: block; position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,.4); z-index: 8; }
  .brand { font-size: 17px; letter-spacing: -.6px; }
  .search input { padding: 0 12px; }
  .search button { width: 44px; }
  .icon { width: 34px; }
  .srow { flex-direction: column; gap: 8px; }
  .srow .thumb { width: 100%; }
  .plhead, .ihead { flex-direction: column; gap: 16px; padding-top: 16px; }
  .plhead .mosaic, .ihead .cover { width: 100%; }
  .plrows .srow .thumb { width: 100%; }
  .plrows .num { display: none; }
  .grid { grid-template-columns: 1fr; gap: 24px; }
  .watch { padding-top: 0; margin: 0 -16px; }
  .player { border-radius: 0; }
  .primary > :not(.player):not(.desc), .secondary { padding-left: 16px; padding-right: 16px; }
  .desc { margin: 12px 16px 0; }
  .top { gap: 8px; padding: 0 8px 0 4px; }
  .left { gap: 4px; }
}
