/* Palette: cool fog paper, ink, one ultramarine for actions, crimson only for "flagged". */
:root {
  --paper: #eef1f5;
  --surface: #ffffff;
  --ink: #16202c;
  --muted: #566274;
  --line: #d3d9e2;
  --action: #2438d6;
  --action-ink: #ffffff;
  --flag: #c41e4a;
  --flag-wash: #fbe7ec;
  --ok: #17785a;
  --ok-wash: #e3f3ec;
  --warn: #946200;
  --track: #dfe5ee;
  --focus: #2438d6;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e131a;
    --surface: #161d27;
    --ink: #e7ecf3;
    --muted: #9aa6b8;
    --line: #2a3441;
    --action: #8b98ff;
    --action-ink: #0e131a;
    --flag: #ff7b98;
    --flag-wash: #3a1b27;
    --ok: #55c99b;
    --ok-wash: #15332a;
    --warn: #e3b341;
    --track: #263040;
    --focus: #8b98ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
}
.page { max-width: 1060px; margin: 0 auto; padding: 32px 16px 64px; }

h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.75rem, 4.2vw, 2.6rem); letter-spacing: -0.025em; max-width: 22ch; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; letter-spacing: -0.005em; }
p { margin: 0 0 12px; }
a { color: var(--action); }
code, pre { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--track); padding: 1px 5px; border-radius: 4px; }
pre { margin: 8px 0 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
      border-radius: 6px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; font-size: 1em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.intro { margin-bottom: 32px; }
.intro p { max-width: 62ch; color: var(--muted); font-size: 1.05rem; margin-top: 14px; }

/* ---- the checker ------------------------------------------------------------------------- */
.check { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); margin-bottom: 56px; }
@media (min-width: 900px) { .check { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 48px; } }
.check-in > h2 { margin-bottom: 14px; }

label { display: block; font-weight: 600; font-size: 0.92rem; margin: 14px 0 6px; }
input[type=text], input[type=email], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px;
}
textarea { font-family: var(--mono); font-size: 0.86rem; line-height: 1.5; resize: vertical; min-height: 9rem; }
input:disabled, select:disabled, textarea:disabled { opacity: .55; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 14px 0 4px; }
.check-row input { margin-top: 4px; flex: none; }
.check-row span { font-size: 0.9rem; color: var(--muted); }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; margin-top: 14px;
  padding: 10px 18px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.btn.primary { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.linklike { display: block; font: inherit; background: none; border: 0; padding: 0; margin: 2px 0 0; color: var(--action);
            text-decoration: underline; cursor: pointer; }
.small { padding: 4px 10px; margin: 0; font-size: 0.85rem; font-weight: 600; }

.msg { min-height: 1.4em; margin: 8px 0 0; font-size: 0.92rem; color: var(--flag); }
.msg.good { color: var(--ok); }
.hint { margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); }
.lead { color: var(--muted); margin-bottom: 4px; }
.session { margin-bottom: 4px; }
.session p { margin: 0 0 4px; }
.left { font-weight: 600; }
.gate[hidden] + .session { margin-top: 0; }
.checker.locked { opacity: .55; }

/* ---- the result --------------------------------------------------------------------------- */
.check-out { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; min-height: 300px; }
.empty { color: var(--muted); max-width: 46ch; }
.empty h3 { color: var(--ink); margin-bottom: 8px; }

.verdict { font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 6px; }
.verdict.flagged { color: var(--flag); }
.verdict.borderline { color: var(--warn); }
.verdict.typical { color: var(--ok); }
.where { color: var(--muted); margin-bottom: 4px; }

.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 22px 0 28px; max-width: 520px; }
.seg i { display: block; height: 12px; border-radius: 6px; background: var(--track); }
.seg.ok { --tone: var(--ok); } .seg.warn { --tone: var(--warn); } .seg.flag { --tone: var(--flag); }
.seg.on i { background: var(--tone); }
.seg span { display: block; margin-top: 7px; font-size: 0.82rem; line-height: 1.25; color: var(--muted); }
.seg.cur span { color: var(--ink); font-weight: 700; }

.stood-out { margin: 0 0 20px; }
.stood-out h4 { margin: 0 0 6px; font-size: 0.95rem; }
.stood-out ul { list-style: none; margin: 0; padding: 0; }
.stood-out li { font-family: var(--mono); font-size: 0.84rem; padding: 3px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.facts { font-size: 0.9rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
.facts p { margin: 0 0 6px; }

/* ---- blocks below ------------------------------------------------------------------------- */
.block { margin-top: 56px; }
.block > h2 { margin-bottom: 8px; }
.sub { color: var(--muted); max-width: 64ch; }

.table-wrap { max-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { position: sticky; top: 0; background: var(--surface); font-weight: 600; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.pkg { font-family: var(--mono); font-size: 0.82rem; overflow-wrap: anywhere; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td.act { white-space: nowrap; text-align: right; }
td.act .btn + .btn { margin-left: 6px; }
tr.current td { background: var(--track); }
td.pkg .g { display: none; }
@media (max-width: 640px) {
  th:nth-child(2), td:nth-child(2) { display: none; }
  td.pkg .g { display: block; font-family: var(--sans); font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
}

.steps { list-style: none; counter-reset: step; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: minmax(0, 1fr);
         gap: 28px; max-width: 760px; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
                    border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; }
.steps h3 { margin-bottom: 6px; }

.lead-form { max-width: 640px; margin-top: 16px; }
fieldset { border: 0; padding: 0; margin: 0 0 4px; }
legend { font-weight: 600; font-size: 0.92rem; padding: 0; margin-bottom: 6px; }
.opt { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; margin: 0 18px 4px 0; }
.two { display: grid; gap: 0 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#privacy p { max-width: 70ch; color: var(--muted); font-size: 0.92rem; }

/* ---- sign-in and account ------------------------------------------------------------------ */
.code-input { font-family: var(--mono); font-size: 1.35rem; letter-spacing: 0.3em; max-width: 12ch; }
.links { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.links .linklike, .who .linklike { display: inline; margin: 0; }
.who { color: var(--muted); }
.plan-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
         padding: 2px 8px; border-radius: 999px; background: var(--track); color: var(--muted); }
.badge.paid { background: var(--ok-wash); color: var(--ok); }
.hint.warn { color: var(--flag); font-weight: 600; }
.session-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.session-actions .btn { margin-top: 0; }
a.btn { display: inline-block; text-decoration: none; }

/* ---- plans --------------------------------------------------------------------------------- */
.plans { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-top: 20px; }
@media (min-width: 760px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px;
        display: flex; flex-direction: column; }
.plan.best { border-color: var(--action); box-shadow: 0 0 0 1px var(--action) inset; }
.plan h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--action); color: var(--action-ink); }
.price { margin: 12px 0 2px; }
.price .amount { font-size: 1.7rem; font-weight: 750; letter-spacing: -0.02em; }
.price .per { color: var(--muted); }
.for { color: var(--muted); font-size: 0.92rem; }
.ticks { list-style: none; padding: 0; margin: 4px 0 8px; flex: 1; }
.ticks li { padding: 5px 0 5px 22px; position: relative; font-size: 0.95rem; border-top: 1px solid var(--line); }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 0.85em; width: 10px; height: 5px;
                    border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.plan .btn { align-self: flex-start; }
.fine { color: var(--muted); font-size: 0.88rem; max-width: 76ch; margin-top: 14px; }

/* ---- API ----------------------------------------------------------------------------------- */
.api-grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
@media (min-width: 900px) { .api-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; } }
.api-doc h3, .api-keys h3 { margin: 0 0 8px; }
.api-doc h3 + pre { margin-top: 0; }
.api-doc pre + h3 { margin-top: 18px; }
.api-doc p { font-size: 0.92rem; color: var(--muted); }
.table-wrap.short { max-height: 260px; }
table.keys td.none { color: var(--muted); }
.key-form { margin-top: 6px; }
.inline-row { display: flex; gap: 8px; align-items: stretch; }
.inline-row input { flex: 1; min-width: 0; }
.inline-row .btn { margin-top: 0; white-space: nowrap; }
.new-key { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--ok); background: var(--ok-wash); border-radius: 8px; }
.new-key p { margin-bottom: 8px; }
.new-key code { display: block; font-size: 0.85rem; padding: 8px; overflow-wrap: anywhere; background: var(--surface); margin-bottom: 8px; }

/* ---- terms and simple pages ---------------------------------------------------------------- */
.terms { padding-left: 1.1em; max-width: 76ch; margin: 12px 0 0; }
.terms li { margin-bottom: 8px; color: var(--muted); font-size: 0.94rem; }
.terms strong { color: var(--ink); }
.page.narrow { max-width: 640px; padding-top: 64px; }
.page.narrow .sub { margin: 16px 0 8px; font-size: 1.05rem; }
