:root {
  --bg: #f5f1e8;
  --bg-glow: rgba(120, 96, 200, .10);
  --surface: #fffdf8;
  --surface-2: #f0eadc;
  --line: #e2d9c6;
  --line-strong: #cfc3aa;
  --text: #231e2c;
  --text-2: #4a4357;
  --muted: #7a7088;
  --accent: #96701f;
  --accent-soft: rgba(150, 112, 31, .12);
  --violet: #5a48c0;
  --violet-soft: rgba(90, 72, 192, .09);
  --quote-bg: rgba(90, 72, 192, .045);
  --mark: rgba(214, 170, 60, .38);
  --shadow: 0 1px 2px rgba(40, 30, 60, .05), 0 6px 24px rgba(40, 30, 60, .06);
  --radius: 14px;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0a12; --bg-glow: rgba(124, 98, 240, .16); --surface: #14111d; --surface-2: #1b1727;
    --line: #262036; --line-strong: #3a3150; --text: #ebe6f5; --text-2: #c9c1db; --muted: #8e85a6;
    --accent: #d4b06a; --accent-soft: rgba(212, 176, 106, .12); --violet: #a597ff;
    --violet-soft: rgba(165, 151, 255, .10); --quote-bg: rgba(165, 151, 255, .05); --mark: rgba(212, 176, 106, .32);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 30px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0a12; --bg-glow: rgba(124, 98, 240, .16); --surface: #14111d; --surface-2: #1b1727;
  --line: #262036; --line-strong: #3a3150; --text: #ebe6f5; --text-2: #c9c1db; --muted: #8e85a6;
  --accent: #d4b06a; --accent-soft: rgba(212, 176, 106, .12); --violet: #a597ff;
  --violet-soft: rgba(165, 151, 255, .10); --quote-bg: rgba(165, 151, 255, .05); --mark: rgba(212, 176, 106, .32);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 30px rgba(0, 0, 0, .25); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font: 15.5px/1.6 var(--sans);
  background-image: radial-gradient(1200px 500px at 50% -180px, var(--bg-glow), transparent 70%);
  background-repeat: no-repeat;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--mark); }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px) saturate(1.2);
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.brand:hover { color: inherit; }
.sigil { width: 26px; height: 26px; align-self: center; fill: none; stroke: var(--accent); stroke-width: 1.5;
  transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.brand:hover .sigil { transform: rotate(60deg); }
.brand-name { font: 600 23px/1 var(--serif); letter-spacing: .01em; }
.brand-tag { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.qbox { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.qbox input { width: 100%; height: 38px; padding: 0 36px 0 38px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.qbox input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-soft); }
.qbox input::-webkit-search-cancel-button { display: none; }
.qicon { position: absolute; left: 13px; top: 11px; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; }
.qkey { position: absolute; right: 12px; top: 9px; font: 11px/18px var(--sans); color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; }
.qbox input:focus ~ .qkey { display: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 999px; color: var(--text-2); font-size: 14px; }
.nav a.on { color: var(--text); background: var(--surface-2); }
.theme { width: 34px; height: 34px; border: 0; background: none; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.theme:hover { background: var(--surface-2); }
.theme svg { width: 17px; height: 17px; fill: none; stroke: var(--text-2); stroke-width: 1.8; stroke-linecap: round; }
/* Light theme shows a moon (switch to dark); dark theme shows a sun (switch to light). */
.theme .i-sun { display: none; }
:root[data-theme="dark"] .theme .i-sun { display: block; }
:root[data-theme="dark"] .theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme .i-moon { display: none; }
}

.suggest { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; max-height: 70vh; overflow: auto; }
.suggest .sg-h { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.suggest a { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 8px; color: var(--text); }
.suggest a .meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.suggest a.sel, .suggest a:hover { background: var(--violet-soft); color: var(--text); }
.suggest .all { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 9px; color: var(--violet); }

/* ---------- layout ---------- */
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; outline: none; }
.narrow { max-width: 860px; margin: 0 auto; }
.foot { max-width: 1120px; width: 100%; margin: 0 auto; padding: 22px 20px 34px; color: var(--muted); font-size: 12.5px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .005em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(30px, 4.6vw, 42px); }
h2 { font-size: 26px; }
.eyebrow { font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.lede { color: var(--muted); margin: 10px 0 0; }
.muted { color: var(--muted); }
.hero { padding: 18px 0 26px; text-align: center; }
.hero h1 { font-size: clamp(34px, 5.5vw, 52px); font-weight: 500; }
.hero h1 em { color: var(--accent); font-style: italic; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--accent); margin: 14px auto 0; width: 220px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong)); }
.divider::after { transform: scaleX(-1); }

/* ---------- controls ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button, .seg a { border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13.5px;
  color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg .on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.select, .field { height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0 10px; font-size: 13.5px; }
.field { padding: 0 12px; }
.field:focus, .select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.btn { height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--line-strong); }
.btn.primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.count { color: var(--muted); font-size: 13px; }

/* ---------- thread list ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px;
  transition: border-color .15s, transform .15s, box-shadow .15s; display: block; }
a.card:hover { border-color: var(--line-strong); color: inherit; box-shadow: var(--shadow); transform: translateY(-1px); }
.tc { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; }
.tc h3 { font-size: 21px; font-weight: 600; grid-column: 1; }
a.card:hover h3 { color: var(--accent); }
.tc .ex { grid-column: 1; color: var(--text-2); font-size: 14px; margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc .by { grid-column: 1; font-size: 13px; color: var(--muted); margin-top: 6px; }
.tc .by b { font-weight: 500; color: var(--text-2); }
.tc .num { grid-column: 2; grid-row: 1 / span 3; text-align: right; align-self: center; min-width: 64px; }
.tc .num strong { display: block; font: 600 24px/1 var(--serif); color: var(--text); }
.tc .num span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pill { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); vertical-align: 2px; }
.pill.gold { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }

/* ---------- pager ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 4px; flex-wrap: wrap; margin: 22px 0 6px; }
.pager a, .pager span { min-width: 34px; height: 34px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 10px; font-size: 13.5px; color: var(--text-2); }
.pager a:hover { background: var(--surface-2); color: var(--text); }
.pager .on { background: var(--text); color: var(--bg); font-weight: 600; }
.pager .gap { color: var(--muted); min-width: 20px; }
.pager .dis { opacity: .35; pointer-events: none; }
.pager form { margin-left: 8px; display: flex; gap: 4px; align-items: center; font-size: 13px; color: var(--muted); }
.pager input { width: 58px; height: 30px; text-align: center; }
.pager.top { justify-content: flex-end; margin: 0; }

/* ---------- thread page ---------- */
.thead { margin-bottom: 18px; }
.thead h1 { margin: 4px 0 10px; }
.thead .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13.5px; align-items: center; }
.thead .meta a { color: var(--text-2); }
.people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.chip:hover { border-color: var(--line-strong); }
.chip .av { width: 22px; height: 22px; font-size: 11px; }
.chip i { font-style: normal; color: var(--muted); }
#atabs { scroll-margin-top: 76px; }
.tbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.inthread { display: flex; gap: 6px; }
.inthread .field { width: 220px; }

.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; scroll-margin-top: 80px; transition: box-shadow .6s, border-color .6s; }
.post.target { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ph { display: flex; align-items: center; gap: 12px; padding: 14px 20px 0; }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 600 15px/1 var(--serif); color: #fff; text-transform: uppercase;
  background: linear-gradient(135deg, hsl(var(--h) 55% 52%), hsl(calc(var(--h) + 50) 50% 36%)); }
.ph .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ph .who a { font-weight: 600; font-size: 14.5px; }
.ph .who small { color: var(--muted); font-size: 12px; }
.ph .tools { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.ph .tools a, .ph .tools button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 12.5px; padding: 4px 8px; border-radius: 8px; }
.ph .tools a:hover, .ph .tools button:hover { background: var(--surface-2); color: var(--text); }
.pb { padding: 10px 20px 16px 68px; overflow-wrap: anywhere; }
.pb p { margin: 0 0 .8em; }
.pb p:last-child { margin-bottom: 0; }
.pb a.ext { color: var(--violet); text-decoration: underline; text-decoration-color: var(--violet-soft); text-underline-offset: 2px; }
.raw { margin: 0 20px 16px 68px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.raw-h { font: 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

blockquote.q { margin: 4px 0 14px; padding: 10px 14px 10px 16px; background: var(--quote-bg); border-left: 2px solid var(--violet); border-radius: 0 10px 10px 0; font-size: 14.5px; color: var(--text-2); }
blockquote.q blockquote.q { background: var(--quote-bg); }
blockquote.q.unsure { border-left-style: dashed; }
blockquote.q > .qh { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
blockquote.q > .qh b { font-weight: 600; color: var(--text); }
blockquote.q > .qh a.src { color: var(--violet); }
blockquote.q > .qh .pill { font-size: 10.5px; cursor: help; }
.sig { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; font-style: italic; }
.attach { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 10px; padding: 6px 12px; border-radius: 10px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 13px; }
.attach svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

.tnav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.tnav a { padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tnav a small { display: block; color: var(--muted); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
.tnav a span { font: 600 17px/1.3 var(--serif); }
.tnav .nx { text-align: right; grid-column: 2; }

/* ---------- search ---------- */
.shead { display: flex; gap: 10px; margin: 12px 0 10px; }
.shead .field { flex: 1; height: 46px; font-size: 16px; border-radius: 12px; padding: 0 16px; }
.shead .btn { height: 46px; padding: 0 20px; border-radius: 12px; }
.adv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; }
.adv label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.adv label.chk { flex-direction: row; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); letter-spacing: 0; }
.adv .chks { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.adv input[type=checkbox] { accent-color: var(--violet); width: 15px; height: 15px; }
.help { font-size: 13px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.help table { border-collapse: collapse; width: 100%; }
.help td { padding: 4px 10px 4px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.help tr:last-child td { border-bottom: 0; }
.help code, .ex-q code { font: 12.5px ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; color: var(--text); white-space: nowrap; }
.ex-q { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; justify-content: center; }
.ex-q a code { cursor: pointer; }
.ex-q a:hover code { background: var(--violet-soft); }
.sres { display: flex; flex-direction: column; gap: 10px; }
.sr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.sr:hover { border-color: var(--line-strong); }
.sr .st { font: 600 18px/1.3 var(--serif); }
.sr .st a:hover { color: var(--accent); }
.sr .sm { font-size: 12.5px; color: var(--muted); margin: 2px 0 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.sr .sm a { color: var(--text-2); font-weight: 500; }
.sr .sn { color: var(--text-2); font-size: 14.5px; overflow-wrap: anywhere; }
.sr .sx { margin-top: 8px; display: flex; gap: 4px; }
.sr .full { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.sr .full .pb { padding: 0; }
.sentinel { height: 60px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.note { padding: 14px 18px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text-2); font-size: 14px; margin-bottom: 14px; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty .sigil { width: 46px; height: 46px; opacity: .5; margin-bottom: 10px; }

/* ---------- authors ---------- */
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ac { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.ac .av { width: 40px; height: 40px; font-size: 17px; }
.ac .nm { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac .st2 { font-size: 12.5px; color: var(--muted); }
.ac > div { min-width: 0; }
.prof { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center; margin-bottom: 18px; }
.prof .av { width: 78px; height: 78px; font-size: 34px; grid-row: span 2; }
.prof h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 18px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat strong { display: block; font: 600 26px/1.1 var(--serif); }
.stat span { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-bottom: 22px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 13.5px; }
.fact h4 { margin: 0 0 6px; font: 500 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.fact ol, .fact ul { margin: 0; padding: 0; list-style: none; }
.fact li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.fact li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact li .muted { flex: none; }
.ap .ctx { font-size: 12.5px; color: var(--muted); padding: 12px 20px 0; }
.ap .ctx a { color: var(--text-2); font-weight: 500; }
.ap .pb { padding-left: 20px; max-height: 420px; overflow: hidden; position: relative; }
.ap .pb.clip::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(transparent, var(--surface)); }
.ap .more { margin: 0 20px 12px; }

.skel { height: 86px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sh 1.4s infinite; border: 1px solid var(--line); margin-bottom: 10px; }
@keyframes sh { to { background-position: -200% 0; } }
.fade { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (max-width: 760px) {
  .top-inner { flex-wrap: wrap; gap: 10px 14px; padding: 10px 16px; }
  .qbox { order: 3; max-width: none; flex-basis: 100%; }
  .nav { margin-left: auto; }
  .nav a { padding: 6px 8px; }
  .brand-tag { display: none; }
  main { padding: 20px 16px 50px; }
  .pb { padding-left: 20px; }
  .raw { margin-left: 20px; }
  .tc { grid-template-columns: 1fr; }
  .tc .num { grid-row: auto; grid-column: 1; text-align: left; display: flex; gap: 6px; align-items: baseline; }
  .tc .num strong { display: inline; font-size: 16px; }
  .inthread .field { width: 100%; }
  .inthread { flex: 1; }
  .tnav { grid-template-columns: 1fr; }
  .tnav .nx { grid-column: 1; }
  .qkey { display: none; }
}
