:root {
  --bg: #f5f6f3;
  --paper: #ffffff;
  --ink: #16211e;
  --ink-2: #4f5a57;
  --ink-3: #7c8683;
  --rule: #d3d9d4;
  --rule-soft: #e6eae6;
  --accent: #0e6b55;
  --accent-soft: #e2efe9;
  --hold: #8a5f0f;
  --hold-soft: #f6ecd4;
  --remove: #9c351b;
  --remove-soft: #f7e3dc;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 66ch;
  --max: 1080px;
  --gutter: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
h2 { font-size: 1.6rem; margin-bottom: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
.num, .mono, kbd, td.num, th.num { font-family: var(--mono); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.table-scroll { overflow-x: auto; }

.top { border-bottom: 1px solid var(--rule); background: var(--bg); }
.top-inner { display: flex; align-items: baseline; gap: 2rem; padding: 1rem 0; flex-wrap: wrap; }
.brand { font-weight: 600; text-decoration: none; font-size: 1.05rem; }
.top nav { display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--ink-2); }
.top nav a:hover { color: var(--ink); }
.foot { border-top: 1px solid var(--rule); margin-top: 5rem; font-size: 0.9rem; color: var(--ink-2); }
.foot-inner { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem 0; flex-wrap: wrap; }

.hero { padding: clamp(3rem, 8vw, 6rem) 0 2rem; }
.display { font-size: clamp(1.7rem, 4.2vw, 3rem); font-weight: 500; max-width: 24ch; letter-spacing: -0.02em; line-height: 1.12; }
.lede { margin-top: 1.6rem; font-size: 1.15rem; color: var(--ink-2); max-width: var(--measure); }
.lede p { max-width: none; }
.hero-links { margin-top: 1.8rem; }
.button {
  display: inline-block; padding: 0.7rem 1.1rem; border: 1px solid var(--ink); border-radius: 3px;
  text-decoration: none; font-weight: 500; background: var(--ink); color: var(--bg); cursor: pointer; font: inherit;
}
.button:hover { background: var(--accent); border-color: var(--accent); }
.button.quiet { background: transparent; color: var(--ink); }
.button.quiet:hover { background: var(--accent-soft); color: var(--ink); border-color: var(--ink); }
.button:disabled { opacity: 0.5; cursor: default; }

.section { padding: 3.5rem 0 0; }

.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.steps li { display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; padding: 1.2rem 0; border-bottom: 1px solid var(--rule); }
.steps .when { font-weight: 600; color: var(--accent); }
.steps p { margin: 0; }
@media (max-width: 640px) { .steps li { grid-template-columns: 1fr; gap: 0.3rem; } }

.caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); column-gap: 3rem; row-gap: 2.4rem; }
.cap h3 { margin-bottom: 0.5rem; }
.cap p { max-width: none; }
.for-you { border-left: 2px solid var(--accent); padding-left: 0.9rem; color: var(--ink-2); font-size: 0.97rem; }
.for-you b { color: var(--accent); font-weight: 600; }

.prices { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.prices th, .prices td { text-align: left; vertical-align: top; padding: 0.7rem 0.8rem 0.7rem 0; border-bottom: 1px solid var(--rule); }
.prices th { font-weight: 500; color: var(--ink-2); border-bottom-color: var(--ink); }
.prices td.num, .prices th.num { text-align: right; white-space: nowrap; padding-right: 1.6rem; }
.prices tr.own td { font-weight: 500; background: var(--accent-soft); }
.prices tr.own td:first-child { border-left: 3px solid var(--accent); padding-left: 0.6rem; }
.pricing { margin-top: 2.5rem; }
.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.3rem; margin: 2.2rem 0 0.8rem; }
.prose h3 { margin: 1.6rem 0 0.5rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; margin: 1rem 0; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.5rem 0.8rem 0.5rem 0; border-bottom: 1px solid var(--rule); }
.prose li { margin-bottom: 0.4rem; }
.page h1 { font-size: 2rem; margin-bottom: 1.5rem; }

/* forms */
label { display: block; font-weight: 500; margin-bottom: 0.3rem; }
input[type=text], input[type=email], input[type=number], input[type=date], textarea, select {
  font: inherit; width: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); color: var(--ink);
}
textarea { min-height: 8rem; resize: vertical; }
.field { margin-bottom: 1.2rem; max-width: var(--measure); }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; max-width: var(--measure); }
.check input { margin-top: 0.35rem; }
.notice { color: var(--ink-2); font-size: 0.92rem; max-width: var(--measure); }
.error { color: var(--remove); }

/* annotation */
.annotate { max-width: 800px; margin: 0 auto; padding: 2rem var(--gutter) 3rem; }
.annotate .status { display: flex; justify-content: space-between; gap: 1rem; color: var(--ink-3); font-size: 0.85rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.annotate .bar { height: 3px; background: var(--rule-soft); margin-bottom: 1.6rem; }
.annotate .bar i { display: block; height: 3px; background: var(--ink); width: 0; transition: width 0.15s; }
.annotate .ctx { font-size: 0.92rem; color: var(--ink-2); border-left: 2px solid var(--rule); padding: 0.2rem 0.9rem; margin: 0 0 0.9rem; white-space: pre-wrap; }
.annotate .flag { font-size: 0.85rem; font-weight: 600; color: var(--remove); background: var(--remove-soft); padding: 0.4rem 0.8rem; border-radius: 3px; margin-bottom: 0.7rem; }
.annotate .card { background: var(--paper); border: 1px solid var(--rule); padding: 1.6rem 1.8rem; font-size: 1.35rem; line-height: 1.5; min-height: 7rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.annotate .keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.6rem; margin-top: 1.1rem; }
.annotate .keys.aux { grid-template-columns: repeat(2, 1fr); margin-top: 0.6rem; }
.annotate .keys button { font: inherit; font-size: 0.85rem; text-align: left; padding: 0.7rem 0.8rem; border: 1px solid var(--rule); background: var(--paper); border-radius: 3px; cursor: pointer; color: var(--ink); }
.annotate .keys button b { display: block; font-family: var(--mono); font-size: 1.4rem; margin-bottom: 0.1rem; }
.annotate .keys button small { display: block; color: var(--ink-3); }
.annotate .keys .u b { color: var(--remove); } .annotate .keys .h b { color: var(--hold); } .annotate .keys .c b { color: var(--accent); }
.annotate .keys .q b, .annotate .keys .x b { color: var(--ink-3); }
.annotate .keys button.on, .annotate .keys button.hit { background: var(--accent-soft); border-color: var(--accent); }
.annotate .keys button.n.on { background: var(--remove-soft); border-color: var(--remove); }
.annotate .senses { margin-top: 1.1rem; background: var(--paper); border: 1px solid var(--rule); padding: 1rem 1.2rem; }
.annotate .senses h3 { margin-bottom: 0.6rem; }
.annotate .senses label { display: flex; gap: 0.6rem; align-items: center; font-weight: 400; padding: 0.3rem 0; cursor: pointer; }
.annotate .senses kbd { border: 1px solid var(--rule); border-radius: 3px; padding: 0 0.4rem; font-size: 0.8rem; }
.annotate .senses input[type=text] { margin-top: 0.4rem; }
.annotate .foot-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.2rem; font-size: 0.85rem; color: var(--ink-3); flex-wrap: wrap; }
.annotate .done { background: var(--paper); border: 1px solid var(--rule); padding: 1.6rem; font-size: 1.1rem; }
kbd { border: 1px solid var(--rule); border-radius: 3px; padding: 0 0.35rem; font-size: 0.8rem; background: var(--paper); }
@media (max-width: 640px) { .annotate .keys { grid-template-columns: repeat(2, 1fr); } .annotate .card { font-size: 1.15rem; } }

/* demo */
.demo { max-width: 800px; margin: 0 auto; padding: 2.5rem var(--gutter) 3rem; }
.demo h1 { font-size: 2rem; margin-bottom: 0.6rem; }
.verdict { font-size: 2.2rem; font-weight: 500; letter-spacing: -0.02em; margin: 2rem 0 0.4rem; }
.verdict.clean { color: var(--accent); } .verdict.incomplete { color: var(--hold); } .verdict.detected { color: var(--remove); }
.result table { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin-top: 1rem; }
.result th, .result td { text-align: left; vertical-align: top; padding: 0.5rem 0.8rem 0.5rem 0; border-bottom: 1px solid var(--rule); }
.result th { font-weight: 500; color: var(--ink-2); border-bottom-color: var(--ink); }
.result td.num { white-space: nowrap; }
.result tr.hit td:first-child { border-left: 3px solid var(--remove); padding-left: 0.6rem; }
.reasons { margin-top: 1.4rem; border-left: 2px solid var(--remove); padding-left: 1rem; }
.reasons p { margin-bottom: 0.6rem; }
.wrong { margin-top: 1.6rem; display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.wrong .thanks { color: var(--accent); }

/* admin */
.admin { max-width: var(--max); margin: 0 auto; padding: 2rem var(--gutter) 3rem; }
.admin h1 { font-size: 1.7rem; margin-bottom: 1.2rem; }
.admin nav { margin-bottom: 1.6rem; display: flex; gap: 1.2rem; font-size: 0.95rem; }
.admin table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
.admin th, .admin td { text-align: left; vertical-align: top; padding: 0.5rem 0.8rem 0.5rem 0; border-bottom: 1px solid var(--rule); }
.admin th { font-weight: 500; color: var(--ink-2); border-bottom-color: var(--ink); }
.admin form.inline { display: inline; }
.admin .inline button { font: inherit; font-size: 0.85rem; padding: 0.2rem 0.6rem; border: 1px solid var(--rule); background: var(--paper); border-radius: 3px; cursor: pointer; }
.admin .row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.admin .row .field { margin-bottom: 0; }
.admin .summary dt { font-weight: 500; margin-top: 0.8rem; } .admin .summary dd { margin: 0; }
.flash { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 0.6rem 0.9rem; margin-bottom: 1.2rem; }
.flash.err { background: var(--remove-soft); border-color: var(--remove); }
