*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; position: relative; isolation: isolate;
  background-color: var(--paper); color: var(--body);
  font: 400 1.0625rem/1.65 var(--font-body);
}
/* Layered backdrop: three light pools, then two faded fingerprint whorls masked out of an ink layer. */
body::before, body::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: -1; }
body::before {
  background:
    radial-gradient(60vw 50vh at 8% 0%, var(--pool-a), transparent 70%),
    radial-gradient(45vw 45vh at 100% 35%, var(--pool-b), transparent 70%),
    radial-gradient(55vw 45vh at 40% 105%, var(--pool-c), transparent 70%);
}
body::after {
  background: var(--ridge); opacity: var(--ridge-o);
  -webkit-mask: url('/images/ridges.svg') no-repeat right -12vw top -18vh / min(78vw, 1050px) auto, url('/images/ridges.svg') no-repeat left -16vw bottom -30vh / min(58vw, 760px) auto;
  mask: url('/images/ridges.svg') no-repeat right -12vw top -18vh / min(78vw, 1050px) auto, url('/images/ridges.svg') no-repeat left -16vw bottom -30vh / min(58vw, 760px) auto;
}
body.lock { overflow: hidden; }
main { flex: 1; }
main:focus { outline: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.08; margin: 0; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 900; }
h1:focus { outline: none; }
h1:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
.h2, h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.mono { font-family: var(--font-mono); font-size: .84rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* verdict colour contexts */
.v-solid { --vc: var(--solid); --vt: var(--solid-t); --vx: var(--solid-x); }
.v-mixed { --vc: var(--mixed); --vt: var(--mixed-t); --vx: var(--mixed-x); }
.v-weak { --vc: var(--weak); --vt: var(--weak-t); --vx: var(--weak-x); }
.v-unproven { --vc: var(--unproven); --vt: var(--unproven-t); --vx: var(--unproven-x); }

/* buttons + fields: squared label keys, soft paper shadow, lift on hover */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 12px 22px; border: 2px solid var(--edge); border-radius: 8px; background: var(--card); color: var(--ink);
  font: 700 .95rem var(--font-display); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .14s, box-shadow .14s, background .14s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-red { background: var(--red); border-color: var(--red-deep); color: var(--red-ink); }
.btn-red:hover { background: var(--red-deep); }
.btn-line { background: transparent; color: inherit; border-color: currentColor; box-shadow: none; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--card); box-shadow: var(--shadow-sm); }
.btn-danger { color: var(--red); }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.field {
  width: 100%; padding: 12px 14px; border: 2px solid var(--rule); border-radius: 8px;
  background: var(--card); color: var(--ink); font: inherit; transition: border-color .14s;
}
.field:hover { border-color: color-mix(in srgb, var(--edge) 55%, transparent); }
.field:focus-visible { border-color: var(--ink); outline-offset: 1px; }
.field[aria-invalid='true'] { border-color: var(--red); }
textarea.field { resize: vertical; line-height: 1.5; }
.lbl { display: block; font: 700 .85rem var(--font-display); color: var(--ink); margin: 18px 0 6px; }
.inline-row { display: flex; gap: 10px; align-items: stretch; }
.inline-row .field { flex: 1; min-width: 0; }
.inline-row .btn { flex: none; }
.alert { background: var(--weak-t); border: 2px solid var(--weak); border-radius: 8px; padding: 10px 14px; margin: 12px 0; color: var(--ink); }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border: 2px solid var(--edge); border-radius: 10px;
  background: var(--card); color: var(--ink); transition: background .14s, color .14s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--ink); color: var(--paper); }
.burger { display: none; }

/* header */
#top { position: sticky; top: 0; z-index: 40; }
.bar { display: flex; align-items: center; gap: 24px; padding: 12px 0; }
#top::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 100%; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 2px solid var(--edge); z-index: -1; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 900 1.55rem var(--font-display); letter-spacing: -.03em; color: var(--ink); }
.logo-mark { width: 34px; height: 34px; color: var(--ink); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { padding: 8px 13px; border-radius: 8px; text-decoration: none; font: 700 .92rem var(--font-display); color: var(--ink); }
.nav a:hover { background: var(--card); }
.nav a.on { background: var(--ink); color: var(--paper); }
.bar-tools { display: flex; gap: 8px; }
.strip { background: #0b1b2b; color: #eaf3fb; border-bottom: 2px solid var(--edge); position: relative; }
.strip-in { display: flex; align-items: center; gap: 10px; padding: 8px 0; overflow-x: auto; scrollbar-width: none; }
.strip-l { opacity: .7; margin-right: 4px; white-space: nowrap; color: #eaf3fb; }
.vpill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: 999px; border: 2px solid var(--vc); color: #eaf3fb; text-decoration: none; font: 700 .8rem var(--font-display); white-space: nowrap; }
.vpill i, .chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--vc); display: inline-block; }
.vpill:hover, .vpill.on { background: var(--vc); color: var(--vx); }
.vpill:hover i, .vpill.on i { background: var(--vx); }
.vpill.on { box-shadow: 0 0 0 2px #0b1b2b, 0 0 0 4px var(--vc); }
.strip :focus-visible { outline-color: #ff8a7f; }

/* stamp + meter */
.stamp {
  display: inline-block; padding: 4px 12px; border: 3px solid var(--vc); border-radius: 6px;
  background: var(--vc); color: var(--vx); font: 900 .78rem var(--font-display); letter-spacing: .12em; text-transform: uppercase;
  transform: rotate(-3deg); white-space: nowrap;
}
.stamp.sm { font-size: .64rem; padding: 2px 8px; border-width: 2px; }
.stamp.lg { font-size: 1rem; padding: 6px 16px; }
.stamp.xl { font-size: clamp(1.6rem, 4vw, 2.4rem); padding: 8px 24px; border-radius: 10px; outline: 3px dashed var(--vc); outline-offset: 5px; }
.meter { display: inline-flex; align-items: center; gap: 4px; }
.meter i { width: 18px; height: 8px; border-radius: 4px; border: 1.5px solid var(--edge); background: transparent; }
.meter i.on { background: var(--vc, var(--ink)); }
.meter b { margin-left: 6px; color: var(--ink); }

/* shared bits */
.kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); margin: 0 0 12px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); border: 2px solid var(--edge); }
.lede { font-size: 1.2rem; color: var(--body); max-width: 60ch; }
.lede.sm { font-size: 1.05rem; }
.link { font: 700 .95rem var(--font-display); color: var(--ink); }
.tag { display: inline-block; padding: 2px 10px; border: 2px solid var(--edge); border-radius: 999px; font: 700 .72rem var(--font-display); }
.tag.live { background: #0b1b2b; border-color: #0b1b2b; color: #fff; }
.note { border: 2px dashed var(--rule); border-radius: var(--r); padding: 14px 18px; background: var(--card); font-size: .95rem; margin-top: 28px; }
.small { font-size: .92rem; }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 2px dashed var(--rule); border-radius: var(--r); grid-column: 1 / -1; background: color-mix(in srgb, var(--card) 60%, transparent); }
.empty.err { color: var(--ink); border-color: var(--red); }
.state-box { padding: 80px 0; display: grid; gap: 16px; justify-items: start; }
.state-box .lede { margin: 0; }
.sub-msg { margin: 6px 0 0; font-size: .92rem; min-height: 1.4em; }
.sub-msg:empty { min-height: 0; margin: 0; }
.sub-msg[data-kind='err'] { color: var(--red-deep); font-weight: 600; }
:root[data-theme='dark'] .sub-msg[data-kind='err'] { color: #ff8a7f; }
.sub-msg a { font-weight: 700; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 8px; font: 700 .9rem var(--font-display); box-shadow: var(--shadow); animation: pop .25s ease; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }

/* footer */
#foot { margin-top: 90px; }
.foot-news { background: linear-gradient(120deg, #0b1b2b, #13314d); color: #eaf3fb; border-block: 2px solid var(--edge); position: relative; overflow: hidden; }
.foot-news::after { content: ''; position: absolute; right: -60px; top: -120px; width: 420px; height: 420px; background: #eaf3fb; opacity: .06; -webkit-mask: url('/images/ridges.svg') center / contain no-repeat; mask: url('/images/ridges.svg') center / contain no-repeat; pointer-events: none; }
.foot-news .kicker, .foot-news h2 { color: #fff; }
.foot-news .kicker { color: #ff8a7f; }
.foot-news-in { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 44px 0; position: relative; z-index: 1; }
.muted-on { opacity: .85; margin: 12px 0 0; }
.sub { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.sub .field { border-color: transparent; background: #f4f8fc; color: #0b1b2b; }
.sub .btn { background: var(--red); border-color: var(--red); color: #fff; box-shadow: none; }
.sub .btn:hover { background: var(--red-deep); }
.sub-msg { grid-column: 1 / -1; }
.foot-news .sub-msg { color: #eaf3fb; }
.foot-news .sub-msg[data-kind='err'] { color: #ffb4ab; }
.foot-news a { color: #fff; }
.foot-news :focus-visible { outline-color: #ff8a7f; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding: 52px 0 28px; color: var(--ink); }
.foot-grid a:not(.brand) { display: block; text-decoration: none; padding: 3px 0; color: var(--body); }
.foot-grid a:not(.brand):hover { color: var(--red); text-decoration: underline; }
.foot-grid h4 { margin-bottom: 8px; color: var(--ink); }
.foot-note { margin-top: 14px; max-width: 34ch; font-size: .95rem; }
.foot-legal { padding: 18px 0 36px; border-top: 2px solid var(--rule); color: var(--muted); }

/* search dialog */
.sr { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, #06101a 62%, transparent); display: grid; align-items: start; justify-items: center; padding: 10vh 16px; }
.sr-in { width: min(100%, 680px); background: var(--card); border: 2px solid var(--edge); border-radius: var(--r-lg); box-shadow: var(--shadow-lift); overflow: hidden; }
.sr-bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 2px solid var(--rule); }
.sr-bar > svg { width: 22px; height: 22px; color: var(--ink); flex: none; }
.sr-bar input { flex: 1; min-width: 0; border: 0; background: transparent; font: 600 1.15rem var(--font-body); color: var(--ink); padding: 6px 4px; border-radius: 6px; }
.sr-bar input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr-bar input::-webkit-search-cancel-button { display: none; }
.sr-res { padding: 10px; max-height: 60vh; overflow: auto; }
.sr-res > p { padding: 10px 12px; margin: 0; }
.sr-hit { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; text-decoration: none; border: 2px solid transparent; }
.sr-hit small { display: block; color: var(--muted); }
.sr-hit strong { color: var(--ink); }
.sr-hit.on, .sr-hit:hover { background: var(--paper-2); border-color: var(--rule); }

/* motion */
.js .rv { opacity: 0; transform: translateY(18px); transition: opacity .5s, transform .5s; }
.js .rv.in { opacity: 1; transform: none; }
#main.enter { animation: enter .35s ease; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; }
}

/* mobile chrome */
@media (max-width: 960px) {
  .burger { display: inline-grid; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; background: var(--paper); border-bottom: 2px solid var(--edge); padding: 10px 16px 16px; margin: 0; z-index: -1; box-shadow: var(--shadow); }
  .nav-open .nav { display: flex; }
  .nav a { padding: 12px 14px; font-size: 1.05rem; }
  .bar { gap: 12px; }
  .bar-tools { margin-left: auto; }
  .foot-news-in, .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-news-in { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 520px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
  .sub { grid-template-columns: 1fr; }
  .inline-row { flex-direction: column; }
}

/* dropdown (lib/select.js over a hidden native select): an index card with a stamp-red top edge; the picked row is ticked */
.dd { position: relative; }
.dd-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; font-weight: 600; cursor: pointer; }
.dd-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn::after { content: ''; flex: none; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .16s; }
.dd-btn[aria-expanded='true'] { border-color: var(--ink); }
.dd-btn[aria-expanded='true']::after { transform: translateY(2px) rotate(-135deg); }
.dd-list { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 100%; max-height: 300px; overflow-y: auto; margin: 0; padding: 6px 0; list-style: none; background: var(--sheet); border: 1.5px solid var(--rule); border-top: 4px solid var(--red); border-radius: 4px 4px var(--r) var(--r); box-shadow: var(--shadow-lift); }
.dd-list:focus { outline: none; }
.dd-list:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.dd-list li { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 9px 16px 9px 14px; border-left: 3px solid transparent; font-weight: 500; white-space: nowrap; cursor: pointer; color: var(--ink); }
.dd-list li.act { background: var(--paper-2); border-left-color: var(--red); }
.dd-list li[aria-selected='true'] { font-weight: 800; }
.dd-list li[aria-selected='true']::after { content: '\2713'; color: var(--red-deep); font-weight: 900; }
:root[data-theme='dark'] .dd-list li[aria-selected='true']::after { color: #ff8a7f; }

/* back to top (components/totop.js): a round stamp-red key, bottom right */
.to-top { position: fixed; right: 18px; bottom: 20px; z-index: 60; display: grid; place-items: center; width: 48px; height: 48px; border: 1.5px solid var(--red-deep); border-radius: 50%; background: var(--red); color: var(--red-ink); box-shadow: var(--shadow-lift); cursor: pointer; transition: transform .14s; }
.to-top[hidden] { display: none; }
.to-top:hover { transform: translateY(-3px); }
.to-top:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
