:root {
  --paper: #f7f6f2;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #5f6470;
  --line: #e3e1da;
  --accent: #0b6b6f;
  --accent-ink: #ffffff;
  --cyan: #00a3c4;
  --magenta: #d6267a;
  --yellow: #e6b800;
  --black: #23252b;
  --ok: #1e7a46;
  --warn-bg: #fff6e0;
  --warn-line: #e8c46a;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 8px 24px rgba(20, 20, 30, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121317; --card: #1b1d23; --ink: #ecebe6; --muted: #a2a5ad; --line: #2c2f37;
    --accent: #4cc3c7; --accent-ink: #0d1114; --black: #c9cbd1; --ok: #59c38a;
    --warn-bg: #2a2416; --warn-line: #6b5524; --danger: #ff7a6e;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 750; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted, .fine { color: var(--muted); }
.fine { font-size: .85rem; margin: .8em 0 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--muted); font-weight: 600; margin: 0 0 .7em; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; gap: .6em; align-items: center; font-weight: 750; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.dots { display: grid; grid-template-columns: repeat(2, 9px); gap: 3px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.dots i:nth-child(1) { background: var(--cyan); }
.dots i:nth-child(2) { background: var(--magenta); }
.dots i:nth-child(3) { background: var(--yellow); }
.dots i:nth-child(4) { background: var(--black); }
nav { display: flex; gap: 1.4em; }
nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
nav a:hover { color: var(--ink); }
@media (max-width: 640px) { nav { display: none; } }

/* hero */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; padding-top: 64px; padding-bottom: 56px; align-items: start; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; } }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 36em; }
.steps { padding: 0; margin: 28px 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 44px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--card); border: 1px solid var(--line);
}

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.pair label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.pair input {
  width: 100%; font: 700 1.8rem/1 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .28em; text-transform: uppercase;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); margin-bottom: 12px;
}
.pair input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.msg { min-height: 1.4em; margin: .7em 0 0; font-size: .92rem; }
.msg.err { color: var(--danger); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em; font: inherit; font-weight: 650;
  border-radius: 10px; padding: 11px 18px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background-color .15s ease, opacity .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); width: 100%; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.link { background: none; color: var(--muted); padding: 11px 6px; }
.btn.danger { background: var(--danger); color: #fff; }

/* dashboard */
.dash { padding-top: 40px; padding-bottom: 24px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 0; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { font-size: .78rem; font-weight: 700; letter-spacing: .04em; padding: 5px 10px; border-radius: 999px; background: var(--line); color: var(--muted); }
.pill.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.verdict { border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; font-weight: 600; border: 1px solid var(--line); background: var(--card); }
.verdict.bad { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 7%, var(--card)); }
.verdict.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.verdict small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 780px) { .grid { grid-template-columns: 1fr; } }

.pad { margin-bottom: 18px; }
.pad-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pad-top b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.pad-top span { color: var(--muted); font-size: .9rem; }
.meter { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--accent); width: 0; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.meter.hot span { background: var(--danger); }
.pad-note { font-size: .82rem; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

.inks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: end; }
.ink { text-align: center; font-size: .82rem; color: var(--muted); }
.tank { height: 110px; border: 1px solid var(--line); border-radius: 10px; position: relative; overflow: hidden; background: var(--paper); margin-bottom: 6px; }
.tank span { position: absolute; left: 0; right: 0; bottom: 0; height: 0; transition: height .6s cubic-bezier(.2,.8,.2,1); }
.ink b { display: block; color: var(--ink); font-variant-numeric: tabular-nums; }

/* reset */
.reset h2 { margin-bottom: 14px; }
.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.warn p { margin: .3em 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.reset .btn.danger { margin-top: 10px; }
.progress { margin-top: 18px; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.progress p { color: var(--muted); font-size: .9rem; margin: .5em 0 0; }
.done { margin-top: 18px; border-radius: 10px; padding: 16px 18px; border: 1px solid var(--line); }
.done.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 7%, var(--card)); }
.done.bad { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.done ol { margin: .5em 0 0; padding-left: 1.2em; }

.log { margin: 20px 0 0; color: var(--muted); font-size: .85rem; }
.log summary { cursor: pointer; }
.log ol { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; max-height: 220px; overflow: auto; padding-left: 2em; }

/* checker + safety */
.checker, .safety { padding-top: 48px; padding-bottom: 8px; }
#model-q { width: 100%; max-width: 520px; font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.results { list-style: none; padding: 0; max-width: 520px; }
.results li { padding: 10px 2px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.results small { color: var(--muted); }
.yes { color: var(--ok); font-weight: 650; white-space: nowrap; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.three p { color: var(--muted); margin: 0; }
@media (max-width: 720px) { .three { grid-template-columns: 1fr; } }
.foot { padding-top: 40px; padding-bottom: 40px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); margin-top: 48px; }
.foot p { margin: .3em 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.btn.primary.dl { width: auto; }
.help { margin-top: 14px; color: var(--muted); font-size: .9rem; max-width: 34em; }
.help summary { cursor: pointer; }
.help p { margin: .5em 0 0; }
.inks > p { grid-column: 1 / -1; margin: 0; }
