/* Science Slop Index — palette and type follow the paper (Table 1): mauve / rose / slate planes,
   tinted plane bands, outlined plane tags, red for what is flagged. Type is Avenir throughout. */
:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f4f3f0;
  --line: #e6e3de;
  --line-2: #d3cfc8;
  --ink: #1f2937;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --ink-4: #9ca3af;
  /* planes (paper colors) */
  --structure: #95627a;  --structure-deep: #7e4e66;  --structure-band: #f5f1f3;  --structure-light: #e7d6de;
  --argument: #e4959e;   --argument-deep: #b8606e;   --argument-band: #fbf1f2;   --argument-light: #f4e1e4;
  --artifacts: #6d8a96;  --artifacts-deep: #56717b;  --artifacts-band: #eff2f3;  --artifacts-light: #d5dfe0;
  /* flagged / slop red (the paper's link red), and a sequential red ramp for the index */
  --red: #a8323e;
  --idx-1: #efc9cd; --idx-2: #e4959e; --idx-3: #c0505a; --idx-4: #a8323e;
  --good: #3f7d4f;
  --mark: rgba(228, 149, 158, .35);
  --shadow: 0 1px 2px rgba(31, 41, 55, .04), 0 10px 30px rgba(31, 41, 55, .06);
  --radius: 14px;
  --sans: "Avenir Next", "Avenir", "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141416; --surface: #1c1c1f; --surface-2: #26262a; --line: #303035; --line-2: #414147;
    --ink: #f2f1ee; --ink-2: #c9c7c1; --ink-3: #9d9b95; --ink-4: #75736e;
    --structure: #b98aa3; --structure-deep: #c99bb3; --structure-band: #2a2328; --structure-light: #4a3843;
    --argument: #e8a1a9; --argument-deep: #eba8b0; --argument-band: #2d2426; --argument-light: #553a3e;
    --artifacts: #90aebb; --artifacts-deep: #a2bdc8; --artifacts-band: #222a2d; --artifacts-light: #354248;
    --red: #e0707b; --idx-1: #5a3a3e; --idx-2: #b8606e; --idx-3: #d86f79; --idx-4: #ef8a93;
    --good: #7fbf8f; --mark: rgba(232, 161, 169, .28);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141416; --surface: #1c1c1f; --surface-2: #26262a; --line: #303035; --line-2: #414147;
  --ink: #f2f1ee; --ink-2: #c9c7c1; --ink-3: #9d9b95; --ink-4: #75736e;
  --structure: #b98aa3; --structure-deep: #c99bb3; --structure-band: #2a2328; --structure-light: #4a3843;
  --argument: #e8a1a9; --argument-deep: #eba8b0; --argument-band: #2d2426; --argument-light: #553a3e;
  --artifacts: #90aebb; --artifacts-deep: #a2bdc8; --artifacts-band: #222a2d; --artifacts-light: #354248;
  --red: #e0707b; --idx-1: #5a3a3e; --idx-2: #b8606e; --idx-3: #d86f79; --idx-4: #ef8a93;
  --good: #7fbf8f; --mark: rgba(232, 161, 169, .28);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------------ top bar */
.top { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.mark { display: inline-flex; gap: 3px; }
.mark i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.mark i:nth-child(1) { background: var(--structure); }
.mark i:nth-child(2) { background: var(--argument); }
.mark i:nth-child(3) { background: var(--artifacts); }
.top nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a, .icon-btn { text-decoration: none; color: var(--ink-2); padding: 7px 12px; border-radius: 999px; border: 0; background: none; cursor: pointer; font-size: 14.5px; font-weight: 500; }
.top nav a:hover, .icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.top nav a.active { color: var(--ink); background: var(--surface-2); }

/* ------------------------------------------------------------------ shared bits */
.eyebrow { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 14px; font-weight: 600; }
.tag { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 5px; border: 1.2px solid currentColor; line-height: 1.6; white-space: nowrap; }
.tag.structure { color: var(--structure-deep); } .tag.argument { color: var(--argument-deep); } .tag.artifacts { color: var(--artifacts-deep); }
.band-structure { background: var(--structure-band); } .band-argument { background: var(--argument-band); } .band-artifacts { background: var(--artifacts-band); }
.swatch { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.sw-structure { background: var(--structure); } .sw-argument { background: var(--argument); } .sw-artifacts { background: var(--artifacts); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn { border: 0; border-radius: 999px; padding: 10px 22px; background: var(--ink); color: var(--bg); font-weight: 700; cursor: pointer; transition: transform .1s, opacity .15s; white-space: nowrap; }
.btn:hover { opacity: .88; } .btn:active { transform: scale(.98); } .btn[disabled] { opacity: .5; cursor: progress; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); font-weight: 600; }
.btn.small { padding: 6px 14px; font-size: 13.5px; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.link-btn:hover { text-decoration-color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.mono, code { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--ink-3); }
.page-title { font-weight: 700; font-size: clamp(34px, 5vw, 48px); letter-spacing: -.02em; line-height: 1.08; margin: 0 0 12px; }
.page-lede { color: var(--ink-2); max-width: 680px; font-size: 16.5px; margin: 0 0 32px; }
.page { padding-top: 40px; padding-bottom: 56px; }

/* ------------------------------------------------------------------ home */
.landing { text-align: center; padding: 84px 0 64px; }
h1.hero { font-weight: 700; font-size: clamp(50px, 8.4vw, 92px); line-height: 1; letter-spacing: -.035em; margin: 0 0 22px; }
h1.hero em { font-style: italic; color: var(--red); font-weight: 600; }
.lede { max-width: 580px; margin: 0 auto 36px; color: var(--ink-2); font-size: 17.5px; }
.ask { display: flex; gap: 6px; max-width: 660px; margin: 0 auto; background: var(--surface); padding: 6px; border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.ask:focus-within { border-color: var(--line-2); }
.ask input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 10px 18px; font-size: 16px; }
.ask input::placeholder { color: var(--ink-4); }
.alt { margin-top: 18px; display: flex; justify-content: center; align-items: center; gap: 10px 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 14.5px; }
.file-btn { position: relative; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-3); cursor: pointer; }
.check input { accent-color: var(--structure); width: 15px; height: 15px; }
.form-error { color: var(--red); font-size: 14px; margin: 14px 0 0; min-height: 1em; }
.notice { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.planes-intro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 70px auto 0; max-width: 900px; text-align: left; }
.pi { padding: 18px 18px 14px; border-radius: var(--radius); border: 1px solid var(--line); }
.pi .tag { margin-bottom: 10px; }
.pi p { margin: 0; color: var(--ink); font-size: 15px; font-weight: 500; }
.pi ul { margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.pi li { padding: 5px 0; border-top: 1px solid rgba(0, 0, 0, .07); }
:root[data-theme="dark"] .pi li { border-top-color: rgba(255, 255, 255, .08); }
.pi li:first-child { border-top: 0; }

/* ------------------------------------------------------------------ report */
.paper-head { margin-bottom: 18px; }
.paper-head h2 { font-weight: 700; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.015em; }
.meta { color: var(--ink-2); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 0; }
.keybar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); margin: 0 0 16px; font-size: 13.5px; color: var(--ink-2); }
.keybar .key { font-family: var(--mono); font-size: 14.5px; color: var(--ink); font-weight: 600; letter-spacing: .04em; background: var(--surface); padding: 2px 10px; border-radius: 7px; border: 1px solid var(--line); }
.progress { margin: 0 0 16px; }
.progress .p-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 7px; }
.progress .p-top b { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress .p-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; position: relative; }
.progress .p-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; transition: width .6s ease;
  background: linear-gradient(90deg, var(--structure), var(--argument), var(--artifacts)); }
.progress .p-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); background-size: 200% 100%; animation: sh 1.4s linear infinite; }
@keyframes sh { to { background-position: -200% 0; } }

.score-card { padding: 28px; display: grid; grid-template-columns: minmax(230px, 300px) 1fr; gap: 32px; align-items: center; }
.hero-num { display: flex; align-items: baseline; gap: 4px; }
.hero-num .n { font-size: 92px; line-height: .9; font-weight: 700; letter-spacing: -.045em; }
.hero-num .of { font-size: 20px; color: var(--ink-3); font-weight: 600; }
.hero-label { margin-top: 12px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.band { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 2px 10px 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.band .ico { width: 10px; height: 10px; display: inline-block; border-radius: 50%; }
.hero-sub { color: var(--ink-2); font-size: 13.5px; margin: 10px 0 0; max-width: 300px; }
.pending .n { color: var(--ink-4); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.meter { position: relative; height: 12px; border-radius: 999px; background: var(--surface-2); }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.meter .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--surface); }
.scale-labels { position: relative; height: 18px; margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
.scale-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.scale-labels span:first-child { transform: none; } .scale-labels span:last-child { transform: translateX(-100%); }
.plane-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.tile { padding: 12px 14px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: border-color .15s; text-align: left; }
.tile:hover { border-color: var(--line-2); }
.tile .t-val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.tile .t-bar { height: 4px; border-radius: 999px; background: rgba(0, 0, 0, .07); margin-top: 8px; overflow: hidden; }
.tile .t-bar i { display: block; height: 100%; border-radius: 999px; transition: width .9s cubic-bezier(.2, .8, .2, 1); }

.tabs { display: flex; gap: 4px; margin: 30px 0 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: flex-end; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .spacer { flex: 1; }
.export { position: relative; margin-bottom: 6px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 250px; }
.menu a, .menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 0; background: none; text-decoration: none; cursor: pointer; font-weight: 600; font-size: 14px; }
.menu a span, .menu button span { font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu .disabled { opacity: .45; pointer-events: none; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-title h3 { margin: 0; font-size: 16px; font-weight: 700; }
.section-title p { margin: 0; color: var(--ink-3); font-size: 13px; }

.map-card { padding: 18px 20px 14px; }
.map { width: 100%; display: block; overflow: visible; }
.map .lane-label { font-size: 11.5px; fill: var(--ink-2); font-weight: 600; }
.map .seg { fill: var(--surface-2); }
.map .seg-label { font-size: 11px; fill: var(--ink-3); }
.map .dot { stroke: var(--surface); stroke-width: 2px; cursor: pointer; transition: r .12s; }
.map .hit { fill: transparent; cursor: pointer; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-box { width: 18px; height: 10px; border-radius: 999px; display: inline-block; }

.plane-group { margin-bottom: 14px; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; }
.pg-head .q { color: var(--ink-2); font-size: 13.5px; margin-left: 10px; }
.pg-head .pv { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.row { display: grid; grid-template-columns: minmax(170px, 1.35fr) minmax(120px, 2fr) 52px minmax(120px, 1fr) 46px 16px;
  align-items: center; gap: 16px; padding: 13px 20px; border-top: 1px solid rgba(0, 0, 0, .06); cursor: pointer; width: 100%; background: var(--surface); border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.row:hover { background: color-mix(in oklab, var(--surface-2) 60%, var(--surface)); }
.row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.row .name { font-weight: 600; }
.bar { position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.row .val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.row .frac { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.method { font-size: 11px; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; text-align: center; }
.chev { color: var(--ink-3); transition: transform .2s; font-size: 13px; }
.row[aria-expanded="true"] .chev { transform: rotate(90deg); }
.row .state { color: var(--ink-3); font-size: 12.5px; }
.shimmer { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sh 1.2s linear infinite; }

.detail { padding: 4px 20px 22px; background: var(--surface); animation: open .25s ease; }
@keyframes open { from { opacity: 0; transform: translateY(-4px); } }
.d-lead { color: var(--ink-2); font-size: 14px; margin: 6px 0 14px; max-width: 780px; display: flex; gap: 14px; align-items: flex-start; }
.d-lead img { width: 150px; flex: none; border-radius: 8px; padding: 6px; }
.d-lead b { color: var(--ink); font-weight: 700; }
.d-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 18px 0 8px; font-weight: 700; }
.findings { list-style: none; margin: 0; padding: 0; }
.finding { padding: 11px 14px; border-radius: 10px; background: var(--surface-2); margin-bottom: 8px; font-size: 14px; transition: box-shadow .3s; }
.finding.flash { box-shadow: 0 0 0 2px var(--red); }
.finding .where { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.finding .where .x { color: var(--red); font-weight: 700; }
.finding mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.finding .src { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line-2); color: var(--ink-2); font-size: 13px; }
.finding .keys { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.finding .keys code { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; color: var(--ink-2); }
.onpaper { font-size: 12px; font-weight: 600; color: var(--red); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.more { margin-top: 4px; }
.notes { margin: 14px 0 0; padding: 0; list-style: none; color: var(--ink-3); font-size: 12.5px; }
.notes li::before { content: "— "; }
.ok-line { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: 14px; }
.ok-line .ico { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; margin-top: 1px; }
.refmap { display: grid; gap: 6px; }
.refrow { display: grid; grid-template-columns: minmax(120px, 230px) 1fr; gap: 12px; align-items: center; font-size: 13px; }
.refrow .sec { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.refrow .objs { display: flex; gap: 6px; flex-wrap: wrap; }
.obj { font-size: 11.5px; padding: 2px 9px; border-radius: 6px; border: 1.3px solid var(--structure); white-space: nowrap; font-weight: 600; }
.obj.hit { background: var(--structure); color: #fff; }
.obj.miss { color: var(--structure-deep); border-style: dashed; }
.arcs { width: 100%; display: block; overflow: visible; }
.arcs .tick { fill: var(--line-2); }
.arcs text { font-size: 10.5px; fill: var(--ink-3); }
.fig-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); gap: 18px; align-items: start; }
.fig-img { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.fig-img img { width: 100%; height: auto; display: block; border-radius: 6px; }
.kinds { display: grid; gap: 6px; }
.kind { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; font-size: 13.5px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.kind .k-ico { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; margin-top: 1px; border: 1.5px solid var(--line-2); color: var(--ink-3); }
.kind.on .k-ico { background: var(--red); border-color: var(--red); color: #fff; }
.kind .k-ex { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.fig-pick { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.fig-pick select { max-width: 100%; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }

/* paper view */
.pv-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.pv-side { position: sticky; top: 16px; display: grid; gap: 8px; }
.pv-side h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.pv-toggle { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 7px 10px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); }
.pv-toggle input { accent-color: var(--ink); }
.pv-toggle .cnt { margin-left: auto; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.pv-toggle .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.pv-pages { display: grid; gap: 16px; }
.pv-page { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; }
.pv-page img { display: block; width: 100%; height: auto; position: relative; }
.pv-page .pl { position: absolute; inset: 0; display: grid; place-items: center; color: #9ca3af; font-size: 13px; }
.pv-page .pno { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #6b7280; background: rgba(255,255,255,.85); padding: 0 6px; border-radius: 6px; }
.hl { position: absolute; border-radius: 2px; cursor: pointer; mix-blend-mode: multiply; transition: outline-color .2s; outline: 2px solid transparent; outline-offset: 1px; }
.hl.structure { background: rgba(149, 98, 122, .28); } .hl.argument { background: rgba(228, 149, 158, .45); } .hl.artifacts { background: rgba(109, 138, 150, .30); }
.hl.box { background: transparent !important; border: 2.5px solid; mix-blend-mode: normal; }
.hl.box.artifacts { border-color: var(--artifacts); } .hl.box.structure { border-color: var(--structure); } .hl.box.argument { border-color: var(--argument); }
.hl.flash { outline-color: var(--red); }
.hl:hover { filter: saturate(1.6); }
.pv-empty { padding: 28px; text-align: center; color: var(--ink-2); }

.foot-card { padding: 20px; margin-top: 18px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.formula { font-size: 14px; color: var(--ink-2); }
.formula .eq { font-size: 19px; color: var(--ink); margin: 6px 0 10px; font-weight: 600; }
.formula .calc { font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; }
.engine { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }
.error-card { padding: 28px; text-align: center; } .error-card p { color: var(--ink-2); }

/* ------------------------------------------------------------------ how it works */
.spec { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.spec th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 13px; padding: 10px 10px; background: var(--surface-2); }
.spec td { padding: 10px; vertical-align: middle; color: var(--ink-2); }
.spec tr.band-structure td, .spec tr.band-argument td, .spec tr.band-artifacts td { border-top: 1px solid var(--surface); }
.spec tr.plane-first td { border-top: 1px solid var(--ink-2); }
.spec .item { color: var(--ink); font-weight: 600; font-size: 15px; }
.spec img { width: 170px; display: block; }
.spec .frac { display: inline-flex; flex-direction: column; text-align: center; min-width: 190px; }
.spec .frac span:first-child { padding-bottom: 3px; border-bottom: 1.2px solid currentColor; }
.spec .frac span { color: var(--ink); }
.spec .frac.structure { color: var(--structure); } .spec .frac.argument { color: var(--argument); } .spec .frac.artifacts { color: var(--artifacts); }
.spec td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.how-card { padding: 22px; }
.how-card h3 { margin: 0 0 4px; font-size: 16px; }
.how-card p.cap { margin: 0 0 16px; color: var(--ink-3); font-size: 13px; }
.bench { width: 100%; display: block; }
.bench text { font-size: 12px; fill: var(--ink-2); font-family: var(--sans); }
.bench .v { font-weight: 700; fill: var(--ink); }
.bench .grid { stroke: var(--line); stroke-width: 1; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding: 10px 0 10px 36px; position: relative; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.steps li:first-child { border-top: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; color: var(--ink); font-weight: 700; }
.steps b { color: var(--ink); }
.formula-card { padding: 22px; margin-top: 18px; }
.deviations { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.deviations li { margin: 6px 0; }

/* ------------------------------------------------------------------ leaderboard */
.lb-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.lb-title { flex: 1 1 420px; min-width: 0; }
.lb-h { font-size: clamp(28px, 3.6vw, 38px); font-weight: 700; letter-spacing: -.02em; margin: 0 0 8px; display: flex; align-items: baseline; gap: 10px; }
.lb-arrow { font-size: 20px; color: var(--ink-3); text-decoration: none; }
.lb-arrow:hover { color: var(--ink); }
.lb-desc { color: var(--ink-3); margin: 0; max-width: 640px; font-size: 15px; }
.lb-tools { display: grid; justify-items: end; gap: 10px; }
.lb-icons, .lb-row { display: flex; gap: 8px; align-items: center; }
.ib { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.ib:hover { background: var(--surface-2); }
.ib[aria-pressed="true"], .ib.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lb-count { height: 44px; min-width: 250px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; cursor: pointer; font-size: 15.5px; }
.lb-count .updown { color: var(--ink-3); font-size: 16px; }
.lb-add { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 15px; }
.lb-add .plus { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; font-size: 18px; line-height: 1; }
.lb-add:hover .plus { background: var(--ink); color: var(--bg); }
.lb-pop { position: absolute; z-index: 30; width: 340px; max-height: 460px; overflow: auto; padding: 14px; }
.lb-pop h5 { margin: 4px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.lb-pop .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.lb-pop .chips button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 3px 12px; font-size: 13px; cursor: pointer; font-weight: 600; }
.lb-pop .chips button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lb-pop input[type=search] { width: 100%; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); margin-bottom: 8px; }
.lb-opt { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.lb-opt:hover { background: var(--surface-2); }
.lb-opt input { accent-color: var(--ink); flex: none; }
.lb-opt .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-opt .v { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.lb-opt .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lb-card { padding: 18px 20px 14px; position: relative; }
.lb-cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.lb-metricname { font-weight: 700; font-size: 14px; color: var(--ink-2); }
.lb-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--ink-2); letter-spacing: -.01em; }
.lb-scroll { overflow-x: auto; overflow-y: hidden; }
.lb-chart svg { display: block; }
.lb-chart .grid { stroke: var(--line); stroke-width: 1; }
.lb-chart .axis { font-size: 11px; fill: var(--ink-4); }
.lb-chart .cap { font-size: 14px; font-weight: 700; fill: var(--ink); }
.lb-chart .xl { font-size: 12.5px; fill: var(--ink-2); font-weight: 500; }
.lb-chart .badge-t { font-size: 9.5px; font-weight: 700; fill: var(--ink-2); letter-spacing: .02em; }
.lb-chart .badge { fill: var(--surface-2); stroke: var(--line-2); }
.lb-chart .col { cursor: pointer; }
.lb-chart .col:hover .seg, .lb-chart .col:focus .seg { filter: brightness(1.08) saturate(1.15); }
.lb-chart .col:focus { outline: none; }
.lb-chart .col:focus .hitr { stroke: var(--ink); stroke-width: 1.5; }
.lb-empty { padding: 50px 10px; text-align: center; color: var(--ink-2); }
.lb-tablecard { padding: 6px 0; overflow-x: auto; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lb-table th { text-align: right; font-weight: 600; color: var(--ink-3); font-size: 12px; padding: 10px 10px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
.lb-table th:nth-child(-n+2), .lb-table td:nth-child(-n+2) { text-align: left; }
.lb-table th.sorted { color: var(--ink); }
.lb-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.lb-table tr { cursor: pointer; }
.lb-table tbody tr:hover { background: var(--surface-2); }
.lb-table td.title { font-weight: 600; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-table td.idx { font-weight: 700; color: var(--red); }
@media (max-width: 860px) {
  .lb-tools { justify-items: start; }
  .lb-count { min-width: 0; flex: 1; }
  .lb-row { width: 100%; }
  .lb-pop { width: calc(100vw - 32px); left: 16px !important; }
}

/* ------------------------------------------------------------------ gallery */
.g-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 22px; }
.g-controls input, .g-controls select { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); min-width: 0; }
.g-controls input { flex: 1; max-width: 380px; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.g-card { display: flex; flex-direction: column; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.g-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 18px 40px rgba(31,41,55,.12); }
.g-thumb { aspect-ratio: 1 / 1.05; background: #fff; overflow: hidden; border-bottom: 4px solid var(--red); position: relative; }
.g-thumb img { width: 100%; display: block; }
.g-thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; text-align: center; color: #4b5563; font-weight: 700; font-size: 14px; background: #faf9f7; }
.g-body { padding: 12px 14px 16px; display: grid; gap: 6px; }
.g-rank { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; color: var(--red); font-weight: 700; font-size: 13.5px; }
.g-rank .score { margin-left: auto; font-size: 13px; color: var(--ink-2); font-weight: 700; }
.g-title { font-weight: 700; font-size: 16px; line-height: 1.25; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.g-planes { display: flex; gap: 4px; margin-top: 2px; }
.g-planes i { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-2); position: relative; overflow: hidden; }
.g-planes i b { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.g-empty { padding: 40px; text-align: center; color: var(--ink-2); }
.g-note { font-size: 12.5px; color: var(--ink-3); margin-top: 22px; }

/* ------------------------------------------------------------------ view report */
.view-card { padding: 24px; max-width: 640px; }
.view-form { display: flex; gap: 8px; }
.view-form input { flex: 1; min-width: 0; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-family: var(--mono); font-size: 16px; letter-spacing: .04em; }
.recent { list-style: none; margin: 12px 0 0; padding: 0; }
.recent li a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.recent li a:hover { background: var(--surface-2); }
.recent .r-score { font-weight: 700; width: 34px; text-align: right; font-variant-numeric: tabular-nums; color: var(--red); }
.recent .r-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .r-key { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

footer { color: var(--ink-3); font-size: 12.5px; padding: 28px 0 48px; border-top: 1px solid var(--line); margin-top: 20px; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.tip { position: fixed; z-index: 50; pointer-events: none; max-width: 360px; background: var(--ink); color: var(--bg); padding: 8px 11px; border-radius: 9px; font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow); }
.tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.drop-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: blur(3px); font-size: 34px; font-weight: 700; }
.drop-overlay div { border: 2px dashed var(--line-2); border-radius: 28px; padding: 48px 72px; background: var(--surface); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-size: 13.5px; z-index: 60; }

@media (max-width: 860px) {
  .score-card { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .tile { padding: 10px; } .tile .tag { font-size: 9.5px; padding: 1px 5px; }
  .row { grid-template-columns: 1fr 52px 16px; grid-template-areas: "name val chev" "bar bar bar" "frac frac method"; gap: 8px 12px; }
  .row .name { grid-area: name; } .row .bar, .row .shimmer, .row .state { grid-area: bar; } .row .val { grid-area: val; }
  .row .frac { grid-area: frac; } .row .method { grid-area: method; justify-self: end; } .row .chev { grid-area: chev; }
  .fig-wrap, .how-grid, .foot-card, .pv-layout { grid-template-columns: 1fr; }
  .pv-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pv-side h4 { grid-column: 1 / -1; }
  .actions { justify-content: flex-start; }
  .planes-intro { grid-template-columns: 1fr; }
  .tile .t-val { font-size: 21px; }
  .landing { padding-top: 56px; }
  .pg-head .q { display: none; }
  .section-title { flex-direction: column; align-items: flex-start; gap: 2px; }
  .d-lead { flex-direction: column; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .ask { border-radius: 18px; flex-direction: column; }
  .ask input { padding: 10px 12px; }
  .hero-num .n { font-size: 74px; }
  .score-card { padding: 20px; }
  .refrow { grid-template-columns: 1fr; gap: 4px; }
  .top { gap: 10px; }
  .top nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; min-width: 0; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { padding: 6px 7px; font-size: 13px; white-space: nowrap; }
  .lb-brand { display: none; }
  .brand span.name { display: none; }
  .view-form { flex-direction: column; }
  .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
