@font-face { font-family: "AHN"; src: url("/fonts/ahn-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "AHN"; src: url("/fonts/ahn-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "AHN"; src: url("/fonts/ahn-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #F2F4F7;
  --surface: #FFFFFF;
  --ink: #18202E;
  --muted: #5A6475;
  --line: #D5DAE2;
  --focus: #1F5FBF;
  --crit: #B42318; --crit-bg: #FDE7E5;
  --high: #A24206; --high-bg: #FEEEDC;
  --med:  #7A5C00; --med-bg:  #FFF3C9;
  --low:  #1F5FBF; --low-bg:  #E5EEFC;
  --field: #FBFCFD;
  --btn-bg: #18202E; --btn-fg: #FFFFFF; --btn-hover: #2A3446;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121821;
  --surface: #1A2230;
  --ink: #E6EAF0;
  --muted: #9CA7B7;
  --line: #2E3848;
  --focus: #8AB6FF;
  --crit: #FF9B91; --crit-bg: #3D2023;
  --high: #FFB772; --high-bg: #3B2B19;
  --med:  #EFD177; --med-bg:  #342E17;
  --low:  #93BCFF; --low-bg:  #1D2B45;
  --field: #141B26;
  --btn-bg: #E6EAF0; --btn-fg: #121821; --btn-hover: #FFFFFF;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 "AHN", system-ui, sans-serif;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
a { color: var(--focus); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--btn-bg); color: var(--btn-fg); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 20px; }
.top nav { display: flex; align-items: center; gap: 20px; }
.theme-btn { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font: inherit; font-size: 15px; padding: 6px 12px; cursor: pointer; min-height: 36px; }
.theme-btn:hover { color: var(--ink); border-color: var(--muted); }
.top nav a { color: var(--muted); text-decoration: none; font-size: 16px; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }

/* Intro */
.intro { padding-top: 28px; padding-bottom: 28px; }
h1 { font-weight: 800; font-size: clamp(32px, 5.2vw, 52px); line-height: 1.06; letter-spacing: -0.02em; margin: 0 0 14px; max-width: 18ch; }
.lead { font-size: 19px; color: var(--muted); margin: 0; max-width: 60ch; }

/* Workbench */
.bench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; padding-bottom: 56px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-head label, .panel-head h2 { font-weight: 700; font-size: 18px; margin: 0; }
.count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.over { color: var(--crit); font-weight: 700; }

textarea, input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink);
}
textarea { min-height: 340px; resize: vertical; padding: 12px; font: 14px/1.6 var(--mono); }
input { padding: 10px 12px; font: inherit; font-size: 16px; }
textarea:focus, input:focus { border-color: var(--focus); }

.game { margin-top: 12px; }
.game label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.opt { font-weight: 400; color: var(--muted); }

.byok { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.byok summary { cursor: pointer; font-weight: 700; font-size: 15px; min-height: 28px; }
.byok label { display: block; font-size: 15px; font-weight: 700; margin: 10px 0 4px; }
.byok .hint { margin-top: 6px; }
select { width: 100%; padding: 10px 12px; font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 14px; }
.btn {
  background: var(--btn-bg); color: var(--btn-fg); border: 0; border-radius: 8px; padding: 12px 20px;
  font: 700 16px "AHN", system-ui, sans-serif; cursor: pointer; min-height: 44px;
}
.btn:hover { background: var(--btn-hover); }
.btn[disabled] { opacity: .6; cursor: progress; }
.link { background: none; border: 0; padding: 8px 2px; color: var(--focus); font: inherit; font-size: 16px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; min-height: 44px; }
.link:hover { color: var(--ink); }
.link[disabled] { color: var(--muted); cursor: default; text-decoration: none; }

.hint { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
kbd { font: 12px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--paper); }
.msg { margin: 10px 0 0; font-size: 15px; min-height: 1px; }
.msg.error { color: var(--crit); font-weight: 700; }

/* Report */
.source { margin: -4px 0 14px; font-size: 14px; color: var(--muted); }
.summary { margin: 0 0 16px; }
.first { background: var(--paper); border-radius: 8px; padding: 12px 14px 12px 14px; margin-bottom: 20px; }
.first h3 { margin: 0 0 4px; font-size: 16px; }
.first ol { margin: 0; padding-left: 22px; }
.group { font-size: 17px; margin: 22px 0 8px; }
.group .n { color: var(--muted); font-weight: 400; }
.items { list-style: none; margin: 0; padding: 0; }
.item { border-top: 1px solid var(--line); padding: 12px 0; }
.item:first-child { border-top: 0; padding-top: 4px; }
.item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.item-title { font-weight: 700; overflow-wrap: anywhere; }
.who { font-size: 14px; color: var(--muted); }
.sev { display: inline-block; font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 6px; }
.sev.critical { color: var(--crit); background: var(--crit-bg); }
.sev.high { color: var(--high); background: var(--high-bg); }
.sev.medium { color: var(--med); background: var(--med-bg); }
.sev.low { color: var(--low); background: var(--low-bg); }
.item p { margin: 4px 0 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.item ol { margin: 6px 0 0; padding-left: 20px; font-size: 15px; }
.ask { color: var(--ink) !important; }
.quote { margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--line); font: 13px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.loved { margin: 0; padding-left: 20px; }
.empty { color: var(--muted); font-size: 15px; margin: 4px 0 0; }

/* Lower sections */
.how, .data { padding-top: 40px; padding-bottom: 8px; border-top: 1px solid var(--line); }
.how h2, .data h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 14px; }
.steps { margin: 0; padding-left: 24px; max-width: 70ch; }
.steps li { margin-bottom: 12px; padding-left: 4px; }
.data p { max-width: 70ch; margin: 0 0 40px; }

.foot { border-top: 1px solid var(--line); padding-top: 24px; padding-bottom: 40px; font-size: 15px; color: var(--muted); }
.foot p { margin: 0 0 10px; max-width: 70ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.foot-links a { display: inline-block; padding: 10px 0; }

/* Legal pages */
.legal { max-width: 70ch; padding-top: 12px; padding-bottom: 48px; }
.legal h1 { font-size: clamp(30px, 4.5vw, 42px); max-width: none; }
.legal h2 { font-size: 18px; margin: 22px 0 4px; }
.legal p, .legal ul { font-size: 15px; line-height: 1.5; margin: 0 0 8px; }
.legal li { margin-bottom: 2px; }
.legal p, .legal li { color: var(--ink); }
.legal .updated { color: var(--muted); font-size: 15px; }

@media (min-width: 861px) {
  .raw { position: sticky; top: 16px; }
}
@media (max-width: 860px) {
  .bench { grid-template-columns: minmax(0, 1fr); }
  textarea { min-height: 240px; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .top nav a:first-child { display: none; }
  .panel { padding: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  .report-in { animation: in .25s ease-out; }
  @keyframes in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
