/* NOMADWIRE — dark, dense, Alltop-style aggregator grid */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg:        #0f1113;
  --bg-2:      #15181b;
  --box:       #1a1d21;
  --box-head:  #20242a;
  --line:      #2a2f36;
  --line-2:    #343a42;
  --text:      #d6dae0;
  --text-dim:  #8b939e;
  --text-mute: #5f6772;
  --link:      #c9ced6;
  --link-hov:  #ffffff;
  --brand:     #0d9488;
  --good:      #22c55e;
  --bad:       #f87171;
  --accent:    #3b82f6;
  --radius:    6px;
  --font:      Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display:   "Barlow Condensed", "Arial Narrow", Inter, sans-serif;

  /* surfaces & effects */
  --heading:   #ffffff;
  --masthead:  rgba(15, 17, 19, .94);
  --popover:   #1e2227;
  --preview:   #23272d;
  --hover:     rgba(255, 255, 255, .03);
  --hover-2:   rgba(255, 255, 255, .06);
  --hairline:  rgba(255, 255, 255, .035);
  --shadow:    0 18px 40px rgba(0, 0, 0, .55);
  --fav-bg:    #2b3036;
  --img-bg:    #111111;
  --banner:    #fcd34d;
  --ad-bg:     #181b1f;
  --banner-bg: #2a2414;
  --ok-bg: #16251c; --ok-line: #1f4d32; --ok-text: #bbf7d0;
  --err-bg: #2a1717; --err-line: #5b2323; --err-text: #fecaca;
  /* accent-coloured text: pure accent on dark, darkened on light */
  --ink-base:  #ffffff;
  --ink-mix:   100%;
  color-scheme: dark;
}
/* Each element derives readable accent text from its own --accent */
* { --accent-text: color-mix(in srgb, var(--accent) var(--ink-mix), var(--ink-base)); }

/* ---------- light theme ---------- */
:root[data-theme="light"] {
  --bg:        #eef0f3;
  --bg-2:      #ffffff;
  --box:       #ffffff;
  --box-head:  #f6f7f9;
  --line:      #dde1e6;
  --line-2:    #c9cfd6;
  --text:      #1d232b;
  --text-dim:  #525c68;
  --text-mute: #6b7480;
  --link:      #1f2933;
  --link-hov:  #000000;
  --brand:     #0f766e;
  --good:      #15803d;
  --bad:       #b91c1c;
  --heading:   #0b0f14;
  --masthead:  rgba(255, 255, 255, .94);
  --popover:   #ffffff;
  --preview:   #ffffff;
  --hover:     rgba(15, 23, 42, .035);
  --hover-2:   rgba(15, 23, 42, .06);
  --hairline:  rgba(15, 23, 42, .06);
  --shadow:    0 18px 40px rgba(15, 23, 42, .16);
  --fav-bg:    #e5e7eb;
  --img-bg:    #e5e7eb;
  --banner:    #92400e;
  --ad-bg:     #f8f9fb;
  --banner-bg: #fef3c7;
  --ok-bg: #ecfdf3; --ok-line: #a7e3bf; --ok-text: #14532d;
  --err-bg: #fef2f2; --err-line: #f5b5b5; --err-text: #7f1d1d;
  --ink-base:  #000000;
  --ink-mix:   56%;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg:        #eef0f3;
    --bg-2:      #ffffff;
    --box:       #ffffff;
    --box-head:  #f6f7f9;
    --line:      #dde1e6;
    --line-2:    #c9cfd6;
    --text:      #1d232b;
    --text-dim:  #525c68;
    --text-mute: #6b7480;
    --link:      #1f2933;
    --link-hov:  #000000;
    --brand:     #0f766e;
    --good:      #15803d;
    --bad:       #b91c1c;
    --heading:   #0b0f14;
    --masthead:  rgba(255, 255, 255, .94);
    --popover:   #ffffff;
    --preview:   #ffffff;
    --hover:     rgba(15, 23, 42, .035);
    --hover-2:   rgba(15, 23, 42, .06);
    --hairline:  rgba(15, 23, 42, .06);
    --shadow:    0 18px 40px rgba(15, 23, 42, .16);
    --fav-bg:    #e5e7eb;
    --img-bg:    #e5e7eb;
    --banner:    #92400e;
    --ad-bg:     #f8f9fb;
    --banner-bg: #fef3c7;
    --ok-bg: #ecfdf3; --ok-line: #a7e3bf; --ok-text: #14532d;
    --err-bg: #fef2f2; --err-line: #f5b5b5; --err-text: #7f1d1d;
    --ink-base:  #000000;
    --ink-mix:   56%;
    color-scheme: light;
  }
}

html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease !important;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hov); }
code, .mono, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.wrap { max-width: 1480px; margin: 0 auto; padding: 0 20px; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: var(--masthead);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.masthead-inner {
  max-width: 1480px; margin: 0 auto; padding: 12px 20px 10px;
  display: flex; align-items: center; gap: 18px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  color: var(--heading); font: 700 28px/1 var(--display); letter-spacing: .06em;
}
.logo svg { color: var(--brand); }
.logo:hover { color: var(--heading); }
.tagline { margin: 0; color: var(--text-dim); font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search input {
  width: 260px; padding: 8px 12px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--text); font: inherit;
}
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13, 148, 136, .18); }

.topics { border-top: 1px solid var(--line); background: var(--bg-2); position: relative; }
.topics-inner {
  max-width: 1480px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 2px;
}
.nav-toggle { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; }
.nav-item { position: relative; display: flex; align-items: center; --accent: var(--brand); }
.nav-link {
  position: relative; display: block; padding: 11px 14px;
  color: var(--text-dim); font: 600 13px/1 var(--font); text-transform: uppercase; letter-spacing: .06em;
  white-space: nowrap;
}
.has-menu .nav-link { padding-right: 4px; }
.nav-link:hover, .nav-link.on, .nav-item.open .nav-link, .has-menu:hover .nav-link { color: var(--heading); }
.nav-link.on::after {
  content: ""; position: absolute; left: 14px; right: 4px; bottom: 0; height: 3px;
  background: var(--accent); border-radius: 3px 3px 0 0;
}
.nav-item:not(.has-menu) .nav-link.on::after { right: 14px; }
.caret {
  display: grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; padding: 0;
  background: none; border: 0; border-radius: 4px; color: var(--text-mute); cursor: pointer;
}
.caret svg { transition: transform .15s ease; }
.caret:hover, .caret:focus-visible { color: var(--heading); background: var(--hover-2); }
.nav-item.open .caret svg, .has-menu:hover .caret svg { transform: rotate(180deg); }

/* dropdown panel */
.menu {
  position: absolute; top: 100%; left: 0; z-index: 30;
  width: 340px; padding: 6px 0 0;
  background: var(--popover);
  border: 1px solid var(--line-2); border-top: 3px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  visibility: hidden; opacity: 0; transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s;
}
.nav-item.open > .menu,
.has-menu:hover > .menu {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity .14s ease .06s, transform .14s ease .06s, visibility 0s;
}
.menu-head { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px 12px; border-bottom: 1px solid var(--line); }
.menu-head .dot { margin: 6px 0 0; flex: none; }
.menu-head strong { color: var(--heading); font: 700 17px/1.1 var(--display); text-transform: uppercase; letter-spacing: .04em; }
.menu-head p { margin: 3px 0 0; color: var(--text-dim); font-size: 12px; line-height: 1.4; }
.menu-sources { list-style: none; margin: 0; padding: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px 4px; }
.menu-sources a {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 4px;
  color: var(--link); font-size: 13px;
}
.menu-sources a span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-sources a:hover, .menu-sources a:focus-visible { background: var(--hover-2); color: var(--link-hov); outline: none; }
.menu-sources em {
  flex: none; font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 1px 6px; border-radius: 999px;
}
.menu-empty { margin: 0; padding: 14px 16px; color: var(--text-mute); font-size: 13px; }
.menu-all {
  display: block; padding: 10px 16px; border-top: 1px solid var(--line);
  color: var(--accent-text); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
}
.menu-all:hover { background: var(--hover); color: var(--link-hov); }

/* jump-to-source target on topic pages */
.box { scroll-margin-top: 120px; }
.box:target { box-shadow: 0 0 0 2px var(--accent); animation: pulse 1.6s ease 1; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 2px var(--accent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent); } }

.theme-switch {
  position: relative; flex: none; margin-left: 14px;
  width: 54px; height: 28px; padding: 0;
  background: var(--box); border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--text-mute); cursor: pointer;
}
.theme-switch:hover { border-color: var(--text-mute); }
.theme-switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.theme-switch .ico { position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; }
.theme-switch .ico-sun  { left: 7px; }
.theme-switch .ico-moon { right: 7px; }
.theme-switch .knob {
  position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: transform .2s ease;
}
.theme-switch .knob svg { width: 13px; height: 13px; }
.theme-switch .knob .ico-moon, .theme-switch .knob .ico-sun { position: static; margin: 0; }
/* dark = knob on the moon (right); light = knob on the sun (left) */
.theme-switch[aria-checked="true"] .knob { transform: translateX(26px); }
.theme-switch[aria-checked="true"] .knob .ico-sun,
.theme-switch[aria-checked="false"] .knob .ico-moon { display: none; }
.updated { margin-left: auto; padding-left: 16px; color: var(--text-mute); font-size: 12px; white-space: nowrap; }

.demo-banner {
  max-width: 1480px; margin: 14px auto 0; padding: 10px 20px;
  color: var(--banner); font-size: 13px;
}
.demo-banner code { background: var(--banner-bg); padding: 1px 6px; border-radius: 4px; }

/* ---------- section heads ---------- */
.top, .cat { margin: 26px 0 8px; }
.top h2, .cat-head h2, .page-head h1 {
  margin: 0; color: var(--heading);
  font: 700 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: .05em;
}
.top h2 { font-size: 15px; color: var(--text-dim); margin-bottom: 10px; }
.cat-head, .page-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.page-head { margin-top: 26px; }
.cat-head p, .page-head p { margin: 0; color: var(--text-dim); font-size: 13px; }
.cat-head h2 a { color: var(--heading); }
.cat-head .more { margin-left: auto; font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.cat-head .more:hover { color: var(--accent-text); }
.dot {
  display: inline-block; width: 10px; height: 10px; margin-right: 9px; vertical-align: 2px;
  background: var(--accent); border-radius: 2px; transform: rotate(45deg);
}

/* ---------- the grid of source boxes ---------- */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-items: start;
}
.box {
  background: var(--box);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.box > header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: var(--box-head);
  border-bottom: 1px solid var(--line);
}
.box .src {
  color: var(--heading); font: 700 17px/1.1 var(--display); letter-spacing: .03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.box .src:hover { color: var(--accent-text); }
.box .age { margin-left: auto; color: var(--text-mute); font-size: 11px; }
.fav { width: 16px; height: 16px; border-radius: 3px; flex: none; background: var(--fav-bg); vertical-align: -3px; }

.box ol { list-style: none; margin: 0; padding: 4px 0; }
.box li {
  position: relative;
  display: flex; gap: 10px; align-items: baseline;
  padding: 6px 12px 6px 22px;
}
.box li + li { border-top: 1px solid var(--hairline); }
.box li::before {
  content: ""; position: absolute; left: 10px; top: 13px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--text-mute);
}
.box li.is-new::before { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.box li a {
  flex: 1; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.box li:hover { background: var(--hover); }
.box li time, .river time { flex: none; color: var(--text-mute); font-size: 11px; font-variant-numeric: tabular-nums; }
.box-more {
  display: block; padding: 8px 12px 9px; border-top: 1px solid var(--line);
  color: var(--text-dim); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.box-more:hover { color: var(--accent-text); background: var(--hover); }
.box .empty { margin: 0; padding: 14px 12px; color: var(--text-mute); font-size: 13px; }

/* ---------- river (latest / search / top) ---------- */
.river { list-style: none; margin: 0; padding: 0; background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); }
.river li {
  display: grid; grid-template-columns: 40px 118px 170px 1fr; gap: 12px; align-items: baseline;
  padding: 8px 14px; border-top: 1px solid var(--line);
}
.river li:first-child { border-top: 0; }
.river li:hover { background: var(--hover); }
.river.compact { columns: 2 520px; column-gap: 0; }
.river.compact li { break-inside: avoid; grid-template-columns: 36px 160px 1fr; border-top: 1px solid var(--line); }
.river.compact .tag { display: none; }
.row-src { color: var(--text-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-src .fav { margin-right: 6px; }
.row-title { color: var(--link); }

.tag {
  justify-self: start;
  display: inline-block; padding: 2px 7px;
  color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 3px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
.box .tag { margin-left: 4px; }

.pager { display: flex; justify-content: space-between; margin: 16px 0; }
.pager a { padding: 8px 14px; background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); }
.none { color: var(--text-dim); padding: 30px 0; }

/* ---------- hover preview (Alltop-style) ---------- */
.preview {
  position: fixed; z-index: 50;
  width: 380px; max-width: calc(100vw - 24px);
  background: var(--preview); color: var(--text);
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  pointer-events: none;
  opacity: 0; transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.preview.show { opacity: 1; transform: none; }
.preview img { display: block; width: 100%; max-height: 190px; object-fit: cover; border-radius: 4px; margin-bottom: 10px; background: var(--img-bg); }
.preview h3 { margin: 0 0 6px; color: var(--heading); font: 600 15px/1.35 var(--font); }
.preview p { margin: 0 0 8px; color: var(--text); font-size: 13px; line-height: 1.5; }
.preview .meta { color: var(--text-mute); font-size: 11.5px; margin: 0; }

/* ---------- footer ---------- */
.foot { margin-top: 40px; border-top: 1px solid var(--line); background: var(--bg-2); }
.foot .wrap { display: flex; gap: 20px; justify-content: space-between; padding-top: 18px; padding-bottom: 24px; color: var(--text-mute); font-size: 12px; }

/* ---------- admin ---------- */
.admin { margin-top: 24px; }
.admin-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-bar h1 { margin: 0 8px 0 0; font: 700 26px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--heading); }
.admin-bar form { margin: 0; }
.spacer { flex: 1; }
.muted { color: var(--text-mute); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.card { background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
.card h2 { margin: 0 0 12px; font: 700 18px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--heading); }
.btn, button.btn {
  display: inline-block; padding: 7px 14px; cursor: pointer;
  background: var(--box-head); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius);
  font: 500 13px/1.2 var(--font);
}
.btn:hover { border-color: var(--text-mute); color: var(--link-hov); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; }
button.link { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; }
button.link:hover, a.link:hover { color: var(--link-hov); text-decoration: underline; }
.danger { color: var(--bad) !important; }
.flash { padding: 10px 14px; background: var(--ok-bg); border: 1px solid var(--ok-line); border-radius: var(--radius); color: var(--ok-text); }
.flash.err { background: var(--err-bg); border-color: var(--err-line); color: var(--err-text); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-mute); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px; border-bottom: 1px solid var(--line-2); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td .mono { color: var(--text-mute); }
tr.off td { opacity: .5; }
.ops { white-space: nowrap; }
.ops form, .ops > a { display: inline-block; margin: 0 10px 0 0; }

.form label, .admin-login label { display: block; margin-bottom: 12px; color: var(--text-dim); font-size: 12px; }
input, select {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 8px 10px; font: 14px var(--font);
}
.form input, .form select, .admin-login input { display: block; width: 100%; margin-top: 4px; }
.form .row { display: flex; gap: 14px; }
.form .row label { flex: 1; }
.hint { display: block; margin-top: 4px; color: var(--text-mute); font-size: 11.5px; }
.display-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.display-form label { color: var(--text-dim); font-size: 12px; }
.display-form input { display: block; width: 110px; margin-top: 4px; }
.display-form select { display: block; margin-top: 4px; }
.display-form p { flex-basis: 100%; margin: 0; }
.custom-n { color: var(--brand); font-weight: 600; }
.form { max-width: 720px; }
.cat-form { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.cat-form .grow { flex: 1; min-width: 200px; }
.cat-form .num { width: 70px; }
.cat-form input[type=color] { width: 40px; height: 36px; padding: 2px; }
.cat-del { margin: 0 0 14px 48px; font-size: 12px; }
.admin-login { max-width: 380px; margin: 60px auto; }
.admin-login h1 { font: 700 28px/1 var(--display); text-transform: uppercase; color: var(--heading); }
.admin-login pre { background: var(--bg-2); padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); }
.admin-login button { padding: 9px 18px; background: var(--brand); color: #fff; border: 0; border-radius: var(--radius); cursor: pointer; font: 600 14px var(--font); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .tagline { display: none; }
  .search { flex: 1; display: flex; justify-content: flex-end; }
  .search input { width: 100%; max-width: 260px; }
  .river li { grid-template-columns: 36px 1fr; }
  .river li .tag, .river li .row-src { display: none; }
  .river.compact li { grid-template-columns: 36px 1fr; }
}
@media (max-width: 560px) {
  .wrap, .masthead-inner, .topics-inner { padding-left: 12px; padding-right: 12px; }
  .grid { grid-template-columns: 1fr; }
  .logo { font-size: 22px; }
  .updated { display: none; }
  .foot .wrap { flex-direction: column; }
  .cat-head .more { margin-left: 0; }
}
/* mobile navigation: hamburger + accordion dropdowns */
@media (max-width: 920px) {
  .topics-inner { padding-top: 4px; padding-bottom: 4px; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px;
    background: none; border: 1px solid var(--line-2); border-radius: var(--radius);
    color: var(--text); font: 600 13px/1 var(--font); text-transform: uppercase; letter-spacing: .06em; cursor: pointer;
  }
  .nav-toggle[aria-expanded="true"] { border-color: var(--brand); color: var(--heading); }
  .nav-list {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
    flex-direction: column; max-height: calc(100vh - 120px); overflow-y: auto;
    background: var(--bg-2); border-bottom: 1px solid var(--line-2); box-shadow: var(--shadow);
  }
  .topics.nav-open .nav-list { display: flex; }
  .nav-item { flex-wrap: wrap; border-top: 1px solid var(--line); }
  .nav-link { flex: 1; padding: 14px 16px; }
  .nav-link.on::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .caret { width: 44px; height: 44px; margin: 0; }
  .has-menu:hover .caret svg { transform: none; }
  .nav-item.open .caret svg { transform: rotate(180deg); }
  .menu, .has-menu:hover > .menu {
    position: static; width: 100%; display: none;
    visibility: visible; opacity: 1; transform: none; transition: none;
    border: 0; border-left: 3px solid var(--accent); border-radius: 0; box-shadow: none; background: var(--box);
  }
  .nav-item.open > .menu { display: block; }
  .menu-head { display: none; }
  .updated { display: block !important; }
}
@media (hover: none) {
  .preview { display: none; }
  .has-menu:hover > .menu:not(.nav-item.open > .menu) { visibility: hidden; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .preview, .theme-switch .knob { transition: none; } }

/* ---------- advertising zones ---------- */
.ad-row { margin: 22px 0; }
.ad-row:empty { display: none; }
.ad-row-top { margin-top: 20px; }
.ad-row-footer { margin-top: 34px; }
.ad {
  position: relative; min-width: 0;
  background: var(--ad-bg); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text);
}
.ad-label {
  display: block; padding: 6px 12px 0;
  color: var(--text-mute); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.ad a { color: inherit; }

/* banners (leaderboard / between / footer) */
.ad-banner { max-width: 1000px; margin: 0 auto; }
.ad-banner.ad-image, .ad-banner.ad-html { padding-bottom: 10px; text-align: center; }
.ad-banner .ad-img { display: inline-block; margin-top: 6px; max-width: 100%; }
.ad-banner .ad-img img { display: block; max-width: 100%; height: auto; max-height: 250px; border-radius: 4px; }
.ad-banner .ad-native { display: flex; align-items: center; gap: 16px; padding: 8px 14px 12px; }
.ad-banner .ad-native img { flex: none; width: 120px; height: 68px; object-fit: cover; border-radius: 4px; background: var(--img-bg); }
.ad-banner .ad-copy { flex: 1; min-width: 0; }
.ad-copy strong { display: block; color: var(--heading); font-size: 15px; line-height: 1.3; }
.ad-body { display: block; margin-top: 3px; color: var(--text-dim); font-size: 13px; line-height: 1.45; }
.ad-cta {
  flex: none; display: inline-block; padding: 8px 14px;
  background: var(--brand); color: #fff; border-radius: var(--radius);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.ad-native:hover .ad-cta { filter: brightness(1.08); }
.ad-native:hover strong { text-decoration: underline; text-underline-offset: 2px; }

/* in-grid cards (sit among the source boxes) */
.ad-card { border-top: 3px solid var(--line-2); overflow: hidden; }
.ad-card .ad-label { padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--box-head); }
.ad-card .ad-native { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.ad-card .ad-native img { width: 100%; aspect-ratio: 300 / 160; object-fit: cover; border-radius: 4px; background: var(--img-bg); }
.ad-card .ad-cta { align-self: flex-start; }
.ad-card .ad-img { display: block; padding: 10px; }
.ad-card .ad-img img { display: block; width: 100%; height: auto; border-radius: 4px; }
.ad-card .ad-html { padding: 10px; }
.ad-html { overflow: hidden; max-width: 100%; }
.ad-html iframe, .ad-html img { max-width: 100%; }

/* empty-zone markers, shown only to logged-in admins */
.ad-placeholder {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  min-height: 90px; padding: 10px 14px 12px;
  background: repeating-linear-gradient(135deg, transparent 0 10px, var(--hover-2) 10px 20px);
  border: 1px dashed var(--line-2); color: var(--text-dim); font-size: 12.5px;
}
.ad-placeholder .ad-label { padding: 0; }
.ad-placeholder strong { color: var(--heading); font-size: 14px; }
.ad-placeholder a { color: var(--brand); }
.ad-card.ad-placeholder { min-height: 250px; border-top-width: 1px; }
.ad-card.ad-placeholder .ad-label { border: 0; background: none; }

@media (max-width: 560px) {
  .ad-banner .ad-native { flex-wrap: wrap; }
  .ad-banner .ad-native img { width: 72px; height: 48px; }
  .ad-banner .ad-cta { width: 100%; text-align: center; }
}

/* advertising admin */
.ad-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ad-form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px; resize: vertical;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius);
}
label.check { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 14px 10px 0; color: var(--text); font-size: 13px; }
label.check input { width: auto !important; margin: 0 !important; }
.topic-picks { margin: 4px 0 14px; }
.topic-picks > span:first-child { display: block; margin-bottom: 6px; color: var(--text-dim); font-size: 12px; }
.zone-form { display: flex; align-items: center; gap: 10px; margin: 0; flex-wrap: wrap; }
.zone-form label.check { margin: 0; }
.zone-form .pos { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.zone-form .pos input { width: 64px; margin-left: 4px; padding: 5px 8px; }
.card > .hint { margin: 12px 0 0; }

/* ---------- blog ---------- */
.blog-strip { margin: 28px 0 8px; }
.strip-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 12px; }
.strip-head h2 { margin: 0; color: var(--text-dim); font: 700 15px/1.1 var(--display); text-transform: uppercase; letter-spacing: .05em; }
.strip-head .more { margin-left: auto; color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.strip-head .more:hover { color: var(--link-hov); }
.search-posts + .strip-head { margin-top: 26px; }

.post-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 16px; }
.post-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.post-card {
  min-width: 0; background: var(--box); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: var(--radius); overflow: hidden;
}
.post-link { display: flex; flex-direction: column; height: 100%; color: var(--text); }
.post-link:hover { color: var(--text); }
.post-link:hover h3 { color: var(--accent-text); }
.post-cover { aspect-ratio: 16 / 9; background: var(--img-bg); overflow: hidden; }
.post-cover.no-img { display: none; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.post-link:hover .post-cover img { transform: scale(1.03); }
.post-text { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.post-text .tag { align-self: flex-start; }
.post-text h3 { margin: 0; color: var(--heading); font: 600 18px/1.3 var(--font); }
.post-text p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { margin-top: auto; color: var(--text-mute); font-size: 12px; }
.compact .post-text h3 { font-size: 16px; }

/* featured (first post on the blog index) */
.post-card.featured .post-link { flex-direction: row; }
.post-card.featured .post-cover { flex: 0 0 55%; aspect-ratio: auto; min-height: 300px; }
.post-card.featured .post-text { padding: 26px 30px; justify-content: center; }
.post-card.featured h3 { font: 700 34px/1.08 var(--display); letter-spacing: .01em; }
.post-card.featured p { font-size: 16px; -webkit-line-clamp: 4; }
.post-card.featured .post-meta { margin-top: 6px; }

/* topic filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chips a {
  --accent: var(--brand);
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--text-dim); font-size: 12.5px; font-weight: 600;
}
.chips a:hover { color: var(--link-hov); border-color: var(--text-mute); }
.chips a.on { color: var(--accent-text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* single article */
.article { max-width: 760px; margin: 30px auto 0; }
.article .flash { margin-bottom: 20px; }
.article-head .crumb { display: inline-block; margin-right: 10px; color: var(--text-dim); font-size: 13px; }
.article-head h1 { margin: 14px 0 12px; color: var(--heading); font: 700 clamp(32px, 5vw, 50px)/1.04 var(--display); letter-spacing: .005em; }
.article-head .lede { margin: 0 0 14px; color: var(--text-dim); font-size: 19px; line-height: 1.5; }
.article-head .post-meta { display: block; padding-bottom: 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.article-head .post-meta strong { color: var(--text); font-weight: 600; }
.article-cover { margin: 24px 0 0; }
.article-cover img { display: block; width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--radius); background: var(--img-bg); }
.article-cover figcaption, .prose figcaption { margin-top: 6px; color: var(--text-mute); font-size: 12px; }

.prose { margin-top: 26px; color: var(--text); font-size: 17.5px; line-height: 1.7; }
.prose > * { margin: 0 0 1.1em; }
.prose h2, .prose h3, .prose h4 { color: var(--heading); line-height: 1.25; margin: 1.6em 0 .55em; }
.prose h2 { font: 700 28px/1.15 var(--display); letter-spacing: .01em; }
.prose h3 { font-size: 20px; }
.prose h4 { font-size: 17px; }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--link-hov); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--accent-text); }
.prose blockquote { margin-left: 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--accent); color: var(--text-dim); font-style: italic; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { padding: 1px 5px; background: var(--hover-2); border-radius: 4px; font-size: .88em; }
.prose pre { padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; font-size: 14px; line-height: 1.5; }
.prose pre code { padding: 0; background: none; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose figure { margin: 1.6em 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.blog-strip.related { max-width: 1100px; margin: 50px auto 0; padding-top: 24px; border-top: 1px solid var(--line); }

/* blog admin */
.post-form { max-width: 920px; }
.post-form-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.post-form-head h2 { margin: 0; }
.status-pill { padding: 2px 9px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--text-dim); font-size: 11.5px; font-weight: 600; }
.post-form-head .link { margin-left: auto; }
.post-form input.big { font-size: 18px; font-weight: 600; }
.post-form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; resize: vertical;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius); font: 14px/1.5 var(--font);
}
.post-form textarea.body { font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 360px; }
.hint-inline { margin-left: 6px; color: var(--text-mute); font-size: 11.5px; }
.md-help { margin-top: 6px; color: var(--text-dim); font-size: 12px; }
.md-help summary { cursor: pointer; color: var(--text-dim); }
.md-help div { margin-top: 6px; line-height: 2; }
.md-help code { padding: 1px 5px; background: var(--hover-2); border-radius: 4px; }
.post-form .actions { display: flex; gap: 8px; margin-top: 6px; }
.post-secondary { margin: -6px 0 18px; font-size: 13px; }

@media (max-width: 900px) {
  .post-grid.three { grid-template-columns: 1fr; }
  .post-card.featured .post-link { flex-direction: column; }
  .post-card.featured .post-cover { min-height: 0; aspect-ratio: 16 / 9; }
  .post-card.featured .post-text { padding: 16px 18px 18px; }
  .post-card.featured h3 { font-size: 28px; }
  .prose { font-size: 16.5px; }
}

/* ---------- videos ---------- */
.video-strip { margin: 28px 0 8px; }
.video-grid { display: grid; gap: 18px 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 22px; }
.video-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
.video-card { min-width: 0; }
.video-link { display: block; color: var(--text); }
.video-link:hover { color: var(--text); }
.video-link:hover h3 { color: var(--accent-text); }
.video-thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--img-bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.video-link:hover .video-thumb img { transform: scale(1.04); }
.video-thumb .play {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(0, 0, 0, .62); color: #fff; opacity: .9; transition: background .15s ease, transform .15s ease;
}
.video-link:hover .play { background: var(--brand); transform: scale(1.08); }
.video-thumb .platform, .featured-badge {
  position: absolute; left: 8px; bottom: 8px; padding: 2px 6px; border-radius: 3px;
  background: rgba(0, 0, 0, .7); color: #fff; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.featured-badge { left: auto; right: 8px; bottom: auto; top: 8px; background: var(--brand); }
.featured-badge.static { position: static; display: inline-block; margin-right: 6px; }
.video-text { padding: 9px 2px 0; }
.video-text h3 { margin: 0 0 4px; color: var(--heading); font: 600 15px/1.35 var(--font);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { color: var(--text-mute); font-size: 12.5px; }
.video-meta a { color: var(--text-dim); }
.video-meta a:hover { color: var(--link-hov); }
.compact .video-text h3 { font-size: 14px; }

/* compact horizontal rows (watch page sidebar) */
.video-card.row .video-link { display: flex; gap: 10px; }
.video-card.row .video-thumb { flex: 0 0 168px; }
.video-card.row .video-thumb .play, .video-card.row .platform { display: none; }
.video-card.row .video-text { padding: 0; }
.video-card.row .video-text h3 { font-size: 13.5px; -webkit-line-clamp: 3; }
.video-card.row + .video-card.row { margin-top: 12px; }

/* click-to-play player */
.player {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; cursor: pointer;
  background: #000; border-radius: var(--radius);
}
.player img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; }
.player:hover img { opacity: 1; }
.player-btn {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  display: grid; place-items: center; padding: 0 0 0 4px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--brand); color: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); transition: transform .15s ease;
}
.player:hover .player-btn { transform: scale(1.07); }
.player-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.player-note {
  position: absolute; right: 10px; bottom: 10px; padding: 3px 8px; border-radius: 3px;
  background: rgba(0, 0, 0, .65); color: #ddd; font-size: 11.5px;
}
.player.playing { cursor: default; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* index hero */
.video-hero {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 26px; align-items: center;
  padding: 18px; background: var(--box); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius);
}
.video-hero-text .tag { margin-bottom: 10px; }
.video-hero-text h2 { margin: 6px 0 8px; font: 700 30px/1.1 var(--display); letter-spacing: .01em; }
.video-hero-text h2 a { color: var(--heading); }
.video-hero-text h2 a:hover { color: var(--accent-text); }
.hero-desc { color: var(--text-dim); font-size: 14.5px; line-height: 1.55; margin: 10px 0 14px; }
.more-link { color: var(--accent-text); font-size: 13px; font-weight: 600; }
.chip-sep { width: 1px; align-self: stretch; margin: 2px 4px; background: var(--line-2); }

/* watch page */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; margin-top: 24px; }
.watch-info { margin-top: 16px; }
.watch-tags { display: flex; align-items: center; gap: 10px; }
.watch-tags .crumb { color: var(--text-dim); font-size: 13px; }
.watch-info h1 { margin: 10px 0 8px; color: var(--heading); font: 700 clamp(26px, 3.2vw, 36px)/1.12 var(--display); }
.watch-info .video-meta { font-size: 13.5px; }
.video-desc {
  margin-top: 16px; padding: 14px 16px; background: var(--box); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere;
}
.video-desc.collapsed { max-height: 8.2em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.video-desc a { color: var(--accent-text); }
.desc-toggle { margin-top: 8px; font-size: 13px; font-weight: 600; }
.watch-side h2 { margin: 0 0 12px; color: var(--text-dim); font: 700 15px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; }

/* videos admin */
.add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.add-row .grow { flex: 1 1 340px; }
.add-row label.check { margin: 0 4px; }
.chips.small { margin: 14px 0 12px; }
.chips.small a { padding: 4px 10px; font-size: 12px; }
.video-table .thumb-cell { width: 108px; }
.video-table .thumb-cell img { display: block; width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: var(--img-bg); }
.video-edit-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; font-size: 13px; }
.video-edit-head img { width: 180px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--img-bg); }
.form textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; resize: vertical;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius); font: 14px/1.5 var(--font); }
.pf { display: inline-block; padding: 1px 6px; border-radius: 3px; color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.pf-youtube { background: #c4302b; }
.pf-vimeo { background: #1a7fb5; }

@media (max-width: 1100px) {
  .watch { grid-template-columns: 1fr; }
  .video-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .video-hero { grid-template-columns: 1fr; padding: 12px; gap: 14px; }
  .video-hero-text h2 { font-size: 24px; }
  .player-btn { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
}
@media (max-width: 480px) {
  .video-grid.four { grid-template-columns: 1fr; }
  .video-card.row .video-thumb { flex-basis: 132px; }
}

/* mid-width: keep every tab on one line */
@media (min-width: 921px) and (max-width: 1100px) {
  .updated { display: none; }
  .nav-link { padding-left: 11px; padding-right: 11px; }
  .has-menu .nav-link { padding-right: 3px; }
  .theme-switch { margin-left: auto; }
}

/* ---------- discussions ---------- */
.disc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 14px; }
.disc-bar .chips { margin: 0; }
.disc-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.seg a { padding: 6px 11px; color: var(--text-dim); font-size: 12.5px; font-weight: 600; }
.seg a + a { border-left: 1px solid var(--line-2); }
.seg a:hover { color: var(--link-hov); background: var(--hover); }
.seg a.on { color: var(--heading); background: var(--hover-2); }

.threads { list-style: none; margin: 0; padding: 0; background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); counter-reset: thread calc(var(--start, 1) - 1); }
.thread { display: flex; gap: 14px; padding: 11px 16px; border-top: 1px solid var(--line); border-left: 3px solid transparent; }
.thread:first-child { border-top: 0; }
.thread:hover { background: var(--hover); border-left-color: var(--accent); }
.thread.pinned { background: color-mix(in srgb, var(--accent) 7%, transparent); border-left-color: var(--accent); }
.thread-score {
  flex: 0 0 52px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding-top: 2px;
  color: var(--text-mute); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.thread-score span { color: var(--text); }
.thread:hover .thread-score svg { color: var(--accent-text); }
.thread-body { flex: 1; min-width: 0; }
.thread-title { color: var(--heading); font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.thread-title:visited { color: var(--text-dim); }
.thread-title:hover { color: var(--accent-text); }
.thread-domain { margin-left: 6px; color: var(--text-mute); font-size: 12.5px; white-space: nowrap; }
.thread-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 5px; color: var(--text-mute); font-size: 12.5px; }
.thread-meta .tag { padding: 1px 6px; font-size: 10px; }
.thread-comments { color: var(--text-dim); font-weight: 600; }
.thread-comments:hover { color: var(--accent-text); }
.also { padding: 0 6px; border: 1px dashed var(--line-2); border-radius: 3px; color: var(--text-dim); font-size: 11.5px; }
.also:hover { color: var(--link-hov); border-color: var(--text-mute); }
.pin-badge { padding: 1px 6px; border-radius: 3px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.plat { display: inline-block; padding: 1px 6px; border-radius: 3px; color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
.plat-hn { background: #e8590c; }
.plat-lobsters { background: #a3271f; }
.plat-lemmy { background: #2f855a; }
.threads.compact .thread { padding: 8px 14px; }
.threads.compact .thread-title { font-size: 14.5px; }
.disc-search { margin-bottom: 8px; }

.disc-sources { margin-top: 26px; color: var(--text-dim); font-size: 13px; }
.disc-sources summary { cursor: pointer; font-weight: 600; }
.disc-sources p { max-width: 760px; }
.disc-sources ul { list-style: none; padding: 0; columns: 3 260px; column-gap: 24px; }
.disc-sources li { margin: 0 0 6px; break-inside: avoid; }

@media (max-width: 760px) {
  .disc-controls { margin-left: 0; }
  .thread { gap: 10px; padding: 10px 12px; }
  .thread-score { flex-basis: 40px; font-size: 12px; }
  .thread-domain { display: block; margin: 2px 0 0; }
}

/* ---------- topic magazine ---------- */
.mag {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px;
  margin: 4px 0 26px; align-items: stretch;
}
.mag-main { min-width: 0; }
.kicker {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-text); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
}
.kicker .fav { width: 14px; height: 14px; }
.mag-time { color: var(--text-mute); font-size: 12px; }

/* image frames */
.mag-media {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 38%, var(--box)), var(--box-head));
}
.mag-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.mag-lead:hover .mag-media img, .mag-card:hover .mag-media img { transform: scale(1.03); }
.mag-ph { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: color-mix(in srgb, var(--heading) 80%, transparent); font: 700 18px/1.1 var(--display); letter-spacing: .05em; text-transform: uppercase; text-align: center; padding: 12px; }
.mag-ph .fav { width: 32px; height: 32px; border-radius: 6px; }
.mag-media.no-img .mag-ph { display: flex; }

/* lead */
.mag-lead {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 0;
  background: var(--box); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); overflow: hidden;
}
.mag-lead .mag-media { aspect-ratio: 16 / 10; border-radius: 0; }
.mag-lead-text { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px; justify-content: center; }
.mag-lead h2 { margin: 0; font: 700 clamp(26px, 2.5vw, 36px)/1.06 var(--display); letter-spacing: .005em; }
.mag-lead h2 a { color: var(--heading); }
.mag-lead h2 a:hover { color: var(--accent-text); }
.mag-lead p { margin: 0; color: var(--text-dim); font-size: 14.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

/* top stories */
.mag-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.mag-card { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mag-card .mag-media { aspect-ratio: 16 / 10; margin-bottom: 4px; }
.mag-card .mag-ph { font-size: 13px; gap: 6px; }
.mag-card .mag-ph .fav { width: 22px; height: 22px; }
.mag-card h3 { margin: 0; font: 600 15px/1.32 var(--font);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mag-card h3 a { color: var(--heading); }
.mag-card h3 a:hover { color: var(--accent-text); }

/* latest rail */
.mag-latest {
  /* As tall as the lead + top stories; the list scrolls inside. contain:size stops the
     rail's own length from stretching the row. */
  contain: size; display: flex; flex-direction: column; min-height: 420px;
  background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.mag-latest h2, .mag-more { flex: none; }
.mag-latest h2 {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 14px;
  border-bottom: 1px solid var(--line); background: var(--box-head);
  color: var(--heading); font: 700 17px/1 var(--display); text-transform: uppercase; letter-spacing: .06em;
}
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 60%, transparent); animation: live 2s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.mag-latest ol { list-style: none; margin: 0; padding: 0; flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.mag-latest li + li { border-top: 1px solid var(--line); }
.mag-latest li a { display: flex; gap: 11px; padding: 10px 14px; color: var(--text); }
.mag-latest li a:hover { background: var(--hover); }
.mag-latest li a:hover .mag-latest-title { color: var(--accent-text); }
.mag-thumb {
  position: relative; flex: 0 0 74px; height: 50px; overflow: hidden; border-radius: 4px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, var(--box)), var(--box-head));
  display: grid; place-items: center;
}
.mag-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mag-thumb .fav { width: 18px; height: 18px; }
.mag-latest-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mag-latest-title { color: var(--heading); font-size: 13.5px; font-weight: 600; line-height: 1.32;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mag-latest li.is-new .mag-time::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.mag-more { display: block; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--accent-text); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.mag-more:hover { background: var(--hover); }

.section-head { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; color: var(--heading); font: 700 20px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; }
.section-head h2::before { content: ""; display: inline-block; width: 4px; height: 16px; margin-right: 9px; background: var(--accent); vertical-align: -1px; border-radius: 2px; }
.section-head span { color: var(--text-mute); font-size: 12.5px; }

@media (max-width: 1240px) {
  .mag { grid-template-columns: minmax(0, 1fr) 300px; }
  .mag-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .mag { grid-template-columns: 1fr; }
  .mag-latest { contain: none; min-height: 0; }
  .mag-latest ol { flex: none; overflow: visible; columns: 2 300px; column-gap: 0; }
  .mag-latest li { break-inside: avoid; border-top: 1px solid var(--line); }
}
@media (max-width: 680px) {
  .mag-lead { grid-template-columns: 1fr; }
  .mag-lead-text { padding: 16px 16px 18px; }
  .mag-top { gap: 14px; }
  .mag-card h3 { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .live { animation: none; } }

/* ---------- home magazine ---------- */
.mag.front { --accent: var(--brand); margin-top: 22px; }
.kicker a.kicker-topic { color: var(--accent-text); }
.kicker a.kicker-topic:hover { color: var(--link-hov); }
.kicker:has(.kicker-topic) { flex-wrap: wrap; row-gap: 2px; column-gap: 9px; }
.kicker-topic, .kicker-src { white-space: nowrap; }
.kicker-src { display: inline-flex; align-items: center; gap: 6px; color: var(--text-mute); font-weight: 600; }
.mag.front .mag-lead h2 { font-size: clamp(28px, 2.8vw, 40px); }
.rail-topic { color: var(--accent-text); font-weight: 600; }
.mag-latest h2 small { color: var(--text-mute); font: inherit; font-size: 14px; }
.mag-latest.ranked ol { counter-reset: rank; }
.mag-latest.ranked li a::before {
  counter-increment: rank; content: counter(rank);
  flex: 0 0 18px; color: var(--text-mute); font: 700 22px/1.1 var(--display); text-align: right;
}
.mag-latest.ranked li:nth-child(-n+3) a::before { color: var(--accent-text); }

.fp-sec { margin-top: 34px; }
.fp-body {
  display: grid; gap: 22px; align-items: stretch;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.5fr) 300px;
}
.fp-body.no-cards { grid-template-columns: minmax(0, 1.6fr) 300px; }
.fp-feature { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
/* the image grows to fill the column, so the feature lines up with the cards beside it */
.fp-feature .mag-media { flex: 1 1 auto; min-height: 240px; max-height: 560px; margin-bottom: 4px; border-top: 3px solid var(--accent); }
.fp-cards, .fp-side { align-self: start; }
.mag-media img[src*="/samples/"] { object-position: left bottom; }   /* keep the sample label in view */
.fp-feature:hover .mag-media img { transform: scale(1.03); }
.fp-feature h3 { margin: 0; font: 700 clamp(22px, 1.9vw, 28px)/1.08 var(--display); letter-spacing: .005em; }
.fp-feature h3 a { color: var(--heading); }
.fp-feature h3 a:hover { color: var(--accent-text); }
.fp-feature p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fp-cards { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 18px; }
.fp-cards .mag-card:hover .mag-media img { transform: scale(1.03); }
.fp-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.fp-side > .ad { margin: 0; }
.fp-list { background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fp-list h4 {
  margin: 0; padding: 11px 14px; background: var(--box-head); border-bottom: 1px solid var(--line);
  color: var(--heading); font: 700 15px/1 var(--display); text-transform: uppercase; letter-spacing: .06em;
}
.fp-list ol { list-style: none; margin: 0; padding: 0; }
.fp-list li { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; }
.fp-list li + li { border-top: 1px solid var(--line); }
.fp-list li > a { color: var(--heading); font-size: 14px; font-weight: 600; line-height: 1.34;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fp-list li > a:hover { color: var(--accent-text); }
.fp-list .mag-time { display: flex; align-items: center; gap: 5px; }
.fp-list .mag-time .fav { width: 12px; height: 12px; border-radius: 2px; }
.fp-list li.is-new .mag-time::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.fp-sources { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.fp-sources summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; cursor: pointer; list-style: none;
  color: var(--text-dim); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
}
.fp-sources summary::-webkit-details-marker { display: none; }
.fp-sources summary::before {
  content: ""; width: 7px; height: 7px; border: solid var(--text-mute); border-width: 0 2px 2px 0;
  transform: rotate(-45deg); transition: transform .15s ease; margin-right: 2px;
}
.fp-sources[open] summary::before { transform: rotate(45deg) translate(-2px, -1px); }
.fp-sources summary em { font-style: normal; color: var(--text-mute); font-weight: 500; text-transform: none; letter-spacing: 0; }
.fp-sources summary:hover, .fp-sources summary:hover::before { color: var(--accent-text); border-color: var(--accent-text); }
.fp-sources summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.fp-src-icons { display: inline-flex; gap: 4px; margin-left: auto; }
.fp-src-icons .fav { width: 16px; height: 16px; border-radius: 3px; background: var(--fav-bg); }
.fp-sources[open] summary { border-bottom: 1px solid var(--line); }
.fp-sources > .grid { padding: 14px; }

@media (max-width: 1240px) {
  .fp-body, .fp-body.no-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fp-body.no-cards .fp-feature { grid-column: 1 / -1; }
  .fp-side { grid-column: 1 / -1; flex-direction: row; align-items: flex-start; }
  .fp-side .fp-list { flex: 1 1 0; min-width: 0; }
  .fp-side .fp-list ol { columns: 2 280px; column-gap: 0; }
  .fp-side .fp-list li { break-inside: avoid; border-top: 1px solid var(--line); }
  .fp-side > .ad { flex: 0 0 300px; }
}
@media (max-width: 760px) {
  .fp-body, .fp-body.no-cards { grid-template-columns: minmax(0, 1fr); }
  .fp-feature .mag-media { flex: none; min-height: 0; aspect-ratio: 16 / 10; }
  .fp-side { flex-direction: column; align-items: stretch; }
  .fp-side > .ad { flex: none; }
  .fp-cards { gap: 16px 14px; }
  .fp-src-icons { display: none; }
}

/* ---------- headline popup ---------- */
html.dialog-open { overflow: hidden; }
.item-dialog {
  --accent: var(--brand);
  width: min(640px, calc(100vw - 32px)); max-height: min(88vh, 860px); padding: 0;
  background: var(--box); color: var(--text);
  border: 1px solid var(--line-2); border-top: 4px solid var(--accent); border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55); overflow: auto; overscroll-behavior: contain;
}
.item-dialog::backdrop { background: rgba(5, 7, 10, .62); backdrop-filter: blur(3px); }
.item-dialog[open] { animation: idlg-in .18s ease-out; }
@keyframes idlg-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.idlg-close {
  position: sticky; top: 10px; float: right; z-index: 2; margin: 10px 10px -46px 0;
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--box) 85%, transparent); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 50%;
}
.idlg-close:hover { color: var(--link-hov); border-color: var(--text-mute); }
.idlg-close:focus-visible, .item-dialog a:focus-visible, .item-dialog button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.idlg-media { aspect-ratio: 16 / 9; background: var(--img-bg); overflow: hidden; }
.idlg-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.idlg-body { padding: 20px 24px 22px; }
.idlg-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-right: 40px; }
.idlg-fav { border-radius: 3px; background: var(--fav-bg); }
.idlg-source { color: var(--accent-text); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.idlg-source:hover { color: var(--link-hov); }
.idlg-media:not([hidden]) + .idlg-body .idlg-kicker { padding-right: 0; }
.item-dialog h2 { margin: 10px 0 8px; color: var(--heading); font: 700 clamp(24px, 3.4vw, 32px)/1.1 var(--display); letter-spacing: .005em; }
.idlg-meta { margin: 0 0 14px; color: var(--text-mute); font-size: 12.5px; }
.idlg-sample { margin: -6px 0 12px; color: var(--banner); font-size: 12.5px; }
.idlg-summary p { margin: 0 0 8px; font-size: 15.5px; line-height: 1.6; }
.idlg-summary .idlg-note { color: var(--text-mute); font-size: 12px; }
.skel { display: block; height: 13px; margin: 0 0 10px; border-radius: 4px;
  background: linear-gradient(90deg, var(--hover-2), var(--hover), var(--hover-2)); background-size: 200% 100%; animation: skel 1.1s linear infinite; }
.skel.short { width: 60%; }
@keyframes skel { to { background-position: -200% 0; } }
.idlg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.idlg-actions .idlg-go { padding: 10px 16px; font-size: 14px; font-weight: 600; background: var(--accent); border-color: var(--accent); }
.idlg-actions .idlg-go:hover { filter: brightness(1.08); color: #fff; }
.idlg-actions .btn { padding: 9px 14px; }
.idlg-domain { margin: 8px 0 0; color: var(--text-mute); font-size: 12px; }
.idlg-more { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.idlg-more h3 { margin: 0 0 8px; color: var(--text-dim); font: 700 14px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; }
.idlg-more ul { list-style: none; margin: 0; padding: 0; }
.idlg-more li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; }
.idlg-more li + li { border-top: 1px solid var(--hairline); }
.idlg-more a { flex: 1; color: var(--link); font-size: 14px; line-height: 1.4; }
.idlg-more a:hover { color: var(--accent-text); }
.idlg-ago { flex: none; color: var(--text-mute); font-size: 11.5px; }
.item-dialog.loading .idlg-go { opacity: .85; }

@media (max-width: 600px) {
  .item-dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 14px 14px 0 0; border-left: 0; border-right: 0; border-bottom: 0; }
  .item-dialog[open] { animation: idlg-up .2s ease-out; }
  .idlg-body { padding: 16px 16px 20px; }
  .idlg-actions .idlg-go { flex: 1 1 100%; text-align: center; }
}
@keyframes idlg-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .item-dialog[open], .skel { animation: none; } }

/* ---------- maintenance (admin) ---------- */
.maint-banner {
  padding: 9px 20px; text-align: center; font-size: 13.5px;
  background: #f59e0b; color: #111;
}
.maint-banner a { color: #111; text-decoration: underline; font-weight: 600; }
.maint-card.on { border-color: #f59e0b; box-shadow: 0 0 0 1px #f59e0b inset; }
.maint-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.maint-head h2 { margin: 0; }
.status-pill.is-on { border-color: #f59e0b; color: #f59e0b; }
.maint-card .row { display: flex; gap: 16px; flex-wrap: wrap; }
.maint-card .row .grow { flex: 1 1 360px; }
.maint-card label { color: var(--text-dim); font-size: 12px; }
.maint-card textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; resize: vertical;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius); font: 14px/1.45 var(--font); }
.maint-card input[type=datetime-local] { display: block; margin-top: 4px; }
.maint-card .actions { display: flex; gap: 8px; margin: 12px 0 4px; }

/* ---------- podcasts ---------- */
.pod-strip { margin: 28px 0 8px; }
.pod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pod-list { display: flex; flex-direction: column; gap: 10px; }

.pod-art {
  position: relative; display: block; flex: none; aspect-ratio: 1; overflow: hidden; border-radius: 6px;
  container-type: inline-size;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 35%, #05060a));
}
.pod-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pod-art b {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font: 700 34cqw/1 var(--display); letter-spacing: .03em; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.pod-art:not(.no-img) b { visibility: hidden; }
.pod-art.small { width: 44px; border-radius: 5px; }
.pod-art.big { width: 200px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }

.pod-ep {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 12px;
  background: var(--box); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pod-ep.compact { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 10px; }
.pod-ep.is-playing { box-shadow: 0 0 0 1px var(--accent); }
.pod-ep-art { display: block; }
.pod-ep-art .pod-art { width: 100%; }
.pod-ep-body { min-width: 0; }
.pod-ep-top { display: flex; gap: 12px; align-items: flex-start; }
.pod-ep-text { min-width: 0; flex: 1; }
.pod-meta { display: block; color: var(--text-mute); font-size: 12px; line-height: 1.4; }
.pod-meta a { color: var(--accent-text); font-weight: 600; }
.pod-meta > span { white-space: nowrap; }
.pod-meta .featured-badge { vertical-align: 1px; }
.pod-kind {
  display: inline-block; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px;
  color: var(--text-dim); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; vertical-align: 1px;
}
.pod-ep h3 { margin: 3px 0 0; font-size: 15px; line-height: 1.32; font-weight: 600; }
.pod-ep h3 a { color: var(--heading); }
.pod-ep h3 a:hover { color: var(--accent-text); }
.pod-ep.compact h3 { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pod-ep p { margin: 6px 0 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.pod-play {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; margin-top: 2px;
  border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: color-mix(in srgb, var(--accent) 82%, #000);
  transition: transform .12s ease, background .15s ease;
}
.pod-play:hover { background: var(--accent); transform: scale(1.06); }
.pod-play:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.pod-play .i-pause, .pod-play.playing .i-play { display: none; }
.pod-play.playing .i-pause { display: block; }
.pod-play .i-play { margin-left: 2px; }
.pod-ep.was-started .pod-play:not(.playing) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.pod-player { margin-top: 10px; }
.pod-player audio { display: block; width: 100%; height: 40px; }
.pod-error { margin: 6px 0 0; color: var(--bad); font-size: 12.5px; }

/* podcasts page */
.pod-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.pod-main { min-width: 0; }
.pod-shows { position: sticky; top: 76px; background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pod-shows h2 {
  margin: 0; padding: 12px 14px; background: var(--box-head); border-bottom: 1px solid var(--line);
  color: var(--heading); font: 700 15px/1 var(--display); text-transform: uppercase; letter-spacing: .06em;
}
.pod-shows ul { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 150px); overflow-y: auto; }
.pod-shows li + li { border-top: 1px solid var(--line); }
.pod-shows li a { display: flex; gap: 11px; align-items: center; padding: 9px 14px; color: var(--heading); }
.pod-shows li a:hover, .pod-shows li.on a { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pod-shows li.on a { box-shadow: inset 3px 0 0 var(--accent); }
.pod-shows li span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pod-shows strong { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.pod-shows em { font-style: normal; color: var(--text-mute); font-size: 11.5px; }
.pod-show-card {
  display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; padding: 18px;
  background: var(--box); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius);
}
.pod-show-card .pod-art.big { width: 150px; }
.pod-show-card h2 { margin: 8px 0 2px; color: var(--heading); font: 700 28px/1.05 var(--display); }
.pod-show-desc { margin: 8px 0 0; color: var(--text-dim); font-size: 14px; line-height: 1.55; }
.pod-links { margin: 12px 0 0; color: var(--text-mute); font-size: 13px; }

/* episode page */
.pod-hero { display: flex; gap: 24px; align-items: flex-end; margin-bottom: 18px; }
.pod-hero-text { min-width: 0; }
.pod-hero h1 { margin: 4px 0 8px; color: var(--heading); font: 700 clamp(26px, 3vw, 38px)/1.06 var(--display); }
.pod-show-link { color: var(--accent-text); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pod-ep.big { display: block; padding: 14px 16px; border-left-width: 1px; border-top: 3px solid var(--accent); }
.pod-ep.big .pod-ep-top { align-items: center; }
.pod-ep.big .pod-play { width: 54px; height: 54px; margin: 0; }
.pod-ep.big .pod-play svg { width: 24px; height: 24px; }
.pod-play-label { color: var(--heading); font-weight: 600; }
.pod-notes-head { margin: 26px 0 8px; color: var(--text-dim); font: 700 15px/1.1 var(--display); text-transform: uppercase; letter-spacing: .05em; }
.pod-watch .watch-side .pod-list { gap: 8px; }

/* admin */
.pod-table .thumb-cell { width: 52px; }
.pod-table .thumb-cell .pod-art.small { width: 40px; }
.video-edit-head .pod-art { width: 96px; }
input.tiny { width: 64px; }

@media (max-width: 980px) {
  .pod-layout { grid-template-columns: minmax(0, 1fr); }
  .pod-shows { position: static; }
  .pod-shows ul { max-height: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .pod-shows li + li { border-top: 0; }
}
@media (max-width: 760px) {
  .pod-grid { grid-template-columns: minmax(0, 1fr); }
  .pod-ep { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 10px; }
  .pod-ep.compact { grid-template-columns: 56px minmax(0, 1fr); }
  .pod-hero { flex-direction: column; align-items: flex-start; gap: 14px; }
  .pod-art.big { width: 140px; }
  .pod-show-card { flex-direction: column; }
  .pod-show-card .pod-art.big { width: 110px; }
}
@media (max-width: 480px) {
  .pod-ep, .pod-ep.compact { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .pod-ep-top { gap: 10px; }
  .pod-play { width: 36px; height: 36px; }
}

/* ---------- subtopics ---------- */
.menu-subs { width: 360px; }
.menu-subtopics { list-style: none; margin: 0; padding: 6px; }
.menu-subtopics a {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 5px;
  color: var(--link); border-left: 2px solid transparent;
}
.menu-subtopics a strong { color: var(--heading); font-size: 14px; font-weight: 600; }
.menu-subtopics a span { color: var(--text-mute); font-size: 12px; line-height: 1.35; }
.menu-subtopics a:hover, .menu-subtopics a:focus-visible { background: var(--hover-2); outline: none; border-left-color: var(--accent); }
.menu-subtopics a:hover strong, .menu-subtopics a:focus-visible strong { color: var(--accent-text); }
.menu-subtopics a.on { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.menu-subtopics a.on strong { color: var(--accent-text); }

.sub-chips { margin: -4px 0 20px; }
.sub-chips a { --accent: inherit; }   /* use the topic colour, not the brand colour */
.sub-head .crumb {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 4px;
  color: var(--accent-text); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.sub-head .crumb .dot { margin: 0; }
.sub-head .crumb:hover { color: var(--link-hov); }
.sub-head h1 { margin-top: 0; }
#all-headlines { scroll-margin-top: 90px; }

.fp-subs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -6px 0 16px; }
.fp-subs a { color: var(--text-dim); font-size: 13px; font-weight: 600; }
.fp-subs a::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 7px 2px 0; border-radius: 50%; background: var(--accent); }
.fp-subs a:hover { color: var(--accent-text); }

/* admin */
.card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head-row h2 { display: flex; align-items: center; gap: 9px; margin: 0; }
.card-head-row .dot { margin: 0; }
.sub-table .kw-cell { max-width: 380px; font-size: 12.5px; }
.sub-sources { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 12px; margin: 4px 0 12px; }
.sub-sources legend { padding: 0 6px; color: var(--text-dim); font-size: 13px; }
.sub-src-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 14px; }
.sub-src-group .check { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.sub-src-group .fav { width: 14px; height: 14px; }
.sub-preview { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sub-preview h3 { margin: 0 0 8px; font-size: 15px; color: var(--heading); }

@media (max-width: 980px) {
  .menu-subs { width: 100%; }
  .menu-subtopics a span { display: none; }
}

/* sources grouped by subtopic (topic pages) */
.src-group-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.section-head + .src-group-head { margin-top: 6px; }
.src-group-head h3 {
  margin: 0; display: flex; align-items: center; gap: 9px;
  color: var(--heading); font: 700 19px/1.1 var(--display); text-transform: uppercase; letter-spacing: .04em;
}
.src-group-head h3::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--accent); }
.src-group-head h3 a { color: inherit; }
.src-group-head h3 a:hover { color: var(--accent-text); }
.src-group-head span { color: var(--text-mute); font-size: 12.5px; }
.src-group-head .more { margin-left: auto; color: var(--accent-text); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.sub-label { font-size: 12px; }
.sub-src-group em { font-style: normal; font-size: 11.5px; }
