:root {
  --ink: #16191d;
  --ink-2: #4a525c;
  --ink-3: #626b76;
  --ground: #ffffff;
  --panel: #f5f7f6;
  --line: #dfe3e1;
  --line-2: #c5ccc8;
  --accent: #14714a;
  --accent-hover: #0f5c3c;
  --accent-soft: #e6f2ec;
  --accent-ink: #0d5234;
  --unsure-bg: #fdf1d8;
  --unsure-ink: #7a4b00;
  --bad: #b3261e;
  --bad-soft: #fcebea;
  --focus: #1a5fd0;
  --r: 8px;
  --r-lg: 12px;
  --shadow: 0 1px 2px rgba(22, 25, 29, .06), 0 4px 14px rgba(22, 25, 29, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code { font: 13.5px/1.4 var(--mono); color: var(--ink); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(30px, 4.6vw, 44px); font-weight: 750; letter-spacing: -0.025em; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin: 48px 0 10px; }
h3 { font-size: 17px; font-weight: 650; margin: 24px 0 10px; }
p { margin: 0 0 12px; max-width: 72ch; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: 8px; background: var(--ground); padding: 8px 12px; z-index: 10; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 900px; }

/* header */
.top { border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.7; }
.brand svg .tick { stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.top nav { display: flex; gap: 4px; }
.top nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: var(--r); }
.top nav a:hover { background: var(--panel); color: var(--ink); }
.top nav a[aria-current="page"] { color: var(--ink); background: var(--panel); }

main { padding-bottom: 72px; }

/* buttons */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--ground); color: var(--ink); font: 600 15px/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink-3); background: var(--panel); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.primary .i { fill: currentColor; stroke: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { min-height: 52px; padding: 0 22px; font-size: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r); background: none; color: var(--ink-3); cursor: pointer; }
.icon-btn:hover { background: var(--panel); color: var(--bad); }

/* home */
.hero { padding: 64px 0 8px; max-width: 760px; }
.lead { font-size: 18px; color: var(--ink-2); margin-top: 14px; max-width: 64ch; }
.sub { color: var(--ink-2); margin-top: -2px; }
.types h2 { margin-top: 56px; }
.types p { color: var(--ink-2); margin-top: 12px; }

/* tables */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 13px; font-weight: 650; color: var(--ink-2); background: var(--panel); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cases td:first-child { width: 26%; font-weight: 600; }
.cases td:first-child a { text-decoration: none; }
.cases td:first-child a:hover { text-decoration: underline; }
.cases td:nth-child(2) { color: var(--ink-2); }
.cases .keys { width: 30%; }
.keys code { display: inline-block; margin: 0 4px 4px 0; padding: 1px 6px; background: var(--panel); border-radius: 5px; font-size: 12.5px; }
.qs td:first-child { width: 22%; }
.qs td:nth-child(2) { width: 34%; }
.qtype { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.opts { margin: 0; padding: 0; list-style: none; }
ol.opts { counter-reset: lv; }
.opts li { margin: 0 0 6px; color: var(--ink-2); }
.opts li:last-child { margin-bottom: 0; }
.val { color: var(--accent-ink); font-weight: 600; }
.hint { color: var(--ink-3); font-size: 14px; margin: 6px 0 0; }
.unsure { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--unsure-bg); color: var(--unsure-ink); font-size: 13px; font-weight: 600; }

/* use case page */
.crumbs { margin: 32px 0 14px; font-size: 14px; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); }
.note { background: var(--panel); border-radius: var(--r); padding: 12px 16px; margin-top: 18px; color: var(--ink-2); }
.note-h { color: var(--ink); font-weight: 600; }

/* runner */
.run-h { margin-top: 44px; }
.step { margin-top: 40px; padding-top: 4px; }
.step h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; font-weight: 700; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
[role="tab"] { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--ink-2); font: 600 15px/1 var(--font); cursor: pointer; white-space: nowrap; }
[role="tab"]:hover { color: var(--ink); }
[role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.panel { padding: 18px 0 4px; }
.drop { display: flex; align-items: center; gap: 14px; padding: 22px 20px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .i { width: 24px; height: 24px; color: var(--accent); }
.drop-h { color: var(--accent-ink); font-weight: 650; }
label { font-size: 14px; font-weight: 600; color: var(--ink); }
input[type="url"], input[type="text"], input:not([type]), select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--ground); color: var(--ink); font: 16px/1.4 var(--font); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
.inline .row { display: flex; gap: 8px; margin-top: 6px; }
.inline .row input { flex: 1; min-width: 0; }
.status { margin: 14px 0 0; font-size: 15px; color: var(--ink-2); }
.status.ok { color: var(--ink); }
.status.bad, .error { color: var(--bad); }
.warn { margin-top: 10px; padding: 10px 14px; border-radius: var(--r); background: var(--unsure-bg); color: var(--unsure-ink); font-size: 15px; }
.load { display: grid; gap: 6px; max-width: 460px; }
#case-note { max-width: 72ch; margin-top: 10px; }
#questions { display: grid; gap: 12px; margin: 18px 0 12px; }
.q { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--ground); box-shadow: var(--shadow); display: grid; gap: 12px; }
.q-head { display: flex; gap: 10px; align-items: end; }
.q label > span { display: block; margin-bottom: 5px; }
.f-key { flex: 1 1 220px; }
.f-key input { font-family: var(--mono); font-size: 15px; }
.f-type { flex: 0 1 180px; }
.f { display: block; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.q .options { font-family: var(--mono); font-size: 14px; }
.q:not([data-type="choice"]) .f-choice, .q:not([data-type="score"]) .f-score, .q:not([data-type="noul"]) .f-noul { display: none; }
.go { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.go .error { margin: 0; }
#results { margin-top: 22px; }
.res-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.res-bar p { margin: 0; }
.res td { white-space: nowrap; }
.res td.src { white-space: normal; min-width: 200px; max-width: 320px; color: var(--ink-2); }
.res td.wait { color: var(--ink-3); }
.res td.err { color: var(--bad); }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-3); font-size: 14px; }
.foot p { margin: 0 0 6px; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding-top: 40px; }
  h2 { margin-top: 40px; }
  .actions .btn { flex: 1 1 100%; }
  .inline .row { flex-direction: column; }
  .two { grid-template-columns: 1fr; }
  .q-head { flex-wrap: wrap; }
  .f-type { flex: 1 1 auto; }
  th, td { padding: 10px 12px; }
  .cases thead { display: none; }
  .cases tr { display: grid; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .cases tbody tr:last-child { border-bottom: 0; }
  .cases td { width: auto !important; padding: 0; border: 0; }
  .qs thead { display: none; }
  .qs tr { display: grid; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
  .qs tbody tr:last-child { border-bottom: 0; }
  .qs td { width: auto !important; padding: 0; border: 0; }
  .qs td:first-child { display: flex; align-items: baseline; gap: 10px; }
  .qs .qtype { margin: 0; }
  .qs td:nth-child(2) { font-weight: 600; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
