/* =============================================================================
   scamsam — one layout, one skin, drawn entirely from the tokens in
   scamsam-themes.css (loaded first). No rule in this file names a colour of
   its own — no hex, no rgb(), no hsl() — a test holds that line.

   The layout is the split: the argument on the left, the working form on the
   right, one hairline between them. The narrow-screen work is at the foot and
   everything above it has to survive 390 px and 360 px.

   Class vocabulary shared with the other build lanes (the spec's contract):
   .split .split-say .split-form  .site-head .site-nav .nav-toggle  .wrap
   .site-foot .chooser  .steps .wordmark .tagline .lead
   .verdict-card .verdict-scam|-suspicious|-legitimate|-unclear
   .meter (+ .meter-fill.p0…p100 in steps of five)  .budget-line
   plus the usual .card/.panel, .field, .btn family, .notice family,
   table.rows|.jobs|.stack with data-label cards under 720 px.
   ============================================================================= */

/* =============================================================================
   1. BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

/* One fixed sheet behind everything: a soft glow of --bg-2 behind the head of
   the page, which gives the slate its depth. Fixed, so it stays the size of
   the window instead of stretching down a long page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(120% 55% at 50% -12%, var(--bg-2), transparent 60%);
}
body > * { position: relative; z-index: 1; }

h1, h2, h3, h4 {
  margin: 0 0 0.6rem;
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  letter-spacing: var(--head-tracking);
  line-height: var(--lh-head);
  text-wrap: balance;
}
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
h4 { font-size: var(--fs-sm); }

p { margin: 0 0 0.9rem; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 0.9rem; padding-left: 1.2rem; }

/* without this a fieldset refuses to shrink below its content and carries
   the form past the edge of a 360-pixel screen */
fieldset { min-width: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--section) 0; }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.92em; }

:focus-visible {
  outline: var(--focus-w) solid var(--accent);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-sm);
}

::selection { background: var(--accent); color: var(--accent-ink); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Air under the header, on every page. One place, so no page can forget it. */
main.wrap { flex: 1 0 auto; padding-top: 2rem; padding-bottom: 3.5rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 30;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.6rem 1rem; text-decoration: none;
}
.skip:focus { left: 0; }

/* figures and machine names: tabular digits in the mono stack */
.mono, .num, td.num, th.num, .cost, .key-tail, .secret, .error-code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.num, td.num, th.num { text-align: right; }

/* the uppercase micro-label that marks a section or a fact */
.mark {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-mark);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.rule { height: 1px; background: var(--line); border: 0; margin: var(--block) 0; }

/* one reading column: prose pages, and the verdict page reads the same way */
.prose, .result { max-width: 46rem; }


/* =============================================================================
   2. HEADER AND NAVIGATION
   ========================================================================== */

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.head-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 3.5rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  font-weight: var(--head-weight);
  letter-spacing: var(--head-tracking);
}
.brand:hover { color: var(--accent); }

/* The favicon is the logo: one drawing, one file, one request. It carries its
   own colours and does not follow the mode — a logo that changes colour with
   the theme is not a logo. */
.brand-logo {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  display: block;
  border-radius: 6px;
}

.brand-name { font-size: var(--fs-lg); line-height: 1; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  flex-wrap: wrap;
  font-size: var(--fs-sm);
}
.site-nav a { text-decoration: none; }
/* `:not(.btn)`: a nav link that is a button keeps the button's own ink. */
.site-nav a:not(.btn) {
  color: var(--ink-2);
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:not(.btn):hover { color: var(--ink); border-bottom-color: var(--accent); }
.site-nav a:not(.btn)[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.nav-form { margin: 0; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle-bar {
  width: 1rem; height: 2px; background: currentColor; flex: none;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}
.nav-toggle-text { line-height: 1; }

/* The "?" is a link to /how-it-works and stands outside .site-nav so the
   narrow layout cannot fold help away behind the Menu button. */
.help-open {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 1.9rem; height: 1.9rem;
  border: 1px solid var(--edge); border-radius: 50%;
  color: var(--ink-2); text-decoration: none;
  font-size: var(--fs-sm); line-height: 1;
}
.help-open:hover { color: var(--accent); border-color: var(--accent); }

.help-dialog {
  width: min(40rem, calc(100vw - 2rem));
  max-height: min(80vh, 42rem);
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--panel-bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.help-dialog::backdrop { background: var(--backdrop); }
.help-dialog > :first-child { margin-top: 0; }
/* while the modal is up, the page behind it must not scroll under the finger */
html.has-dialog { overflow: hidden; }


/* =============================================================================
   3. FOOTER AND THE LANGUAGE / MODE CHOOSER
   ========================================================================== */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-3);
  font-size: var(--fs-sm);
  padding: 1.25rem 0 1.75rem;
  margin-top: auto;
}
.foot-inner {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem 1.5rem;
  align-items: center;
}
.foot-brand {
  flex: none;
  color: var(--ink-2);
  font-weight: var(--head-weight);
  font-size: var(--fs-md);
}
.foot-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-right: auto; }
.foot-nav a { color: var(--ink-3); text-decoration: none; }
.foot-nav a:hover { color: var(--ink); }

/* the "·" between two quiet links under a form */
.foot-sep { color: var(--ink-3); padding: 0 0.35rem; }

/* The choosers are plain links; the server re-renders with new attributes.
   No JavaScript is involved anywhere in switching language or mode. */
.chooser {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  flex: none;
}
.chooser-set {
  display: flex;
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex: none;
}
.chooser-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: 0 0.55rem;
  background: transparent;
  border: 0;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--fs-mark);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--motion), background-color var(--motion);
}
.chooser-opt + .chooser-opt { border-left: 1px solid var(--line); }
.chooser-opt:hover { color: var(--ink); }
.chooser-opt[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

@media (max-width: 820px) {
  .foot-inner { flex-wrap: wrap; }
  .foot-nav { margin-right: 0; }
  .site-foot .chooser { width: 100%; }
}


/* =============================================================================
   4. THE SPLIT LAYOUT — argument left, form right, one hairline between
   ========================================================================== */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: stretch;
}
.split-say {
  min-width: 0;
  padding: 2.25rem var(--gut) 2.75rem 0;
}
.split-form {
  min-width: 0;
  padding: 2.25rem 0 2.75rem var(--gut);
  border-left: 1px solid var(--line);
}

/* the head of the form column: title left, quota right */
.form-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
}
.form-head h1, .form-head h2, .form-head .panel-title { margin: 0; }

/* the argument column */
.wordmark {
  font-family: var(--font-head);
  font-size: var(--fs-display);
  font-weight: var(--head-weight);
  letter-spacing: var(--head-tracking);
  line-height: 1.08;
  margin: 0 0 0.5rem;
}
.tagline {
  font-size: var(--fs-lg);
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 0.75rem;
  max-width: 34ch;
}
.lead {
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 1rem;
  max-width: 46ch;
}

/* the three steps: hanging numbers on one optical edge */
.steps {
  list-style: none;
  margin: 1.35rem 0 0;
  padding: 0;
  max-width: 40em;
}
.steps li {
  display: grid;
  grid-template-columns: 1.35rem 1fr;
  gap: 0.75rem;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink-2);
}
.steps li + li { margin-top: 0.65rem; }
.steps-plain li { color: var(--ink-2); }
.step-no {
  font-family: var(--font-mono);
  font-size: var(--fs-mark);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.75;
  color: var(--accent);
  text-align: right;
}

/* the tier list on the landing page: one row per tier, hairlines between */
.tiers { list-style: none; margin: 1.35rem 0 0; padding: 0; max-width: 40em; }
.tiers li {
  display: flex;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.tiers li:last-child { border-bottom: 1px solid var(--line-soft); }
.tier-name { flex: none; min-width: 7rem; color: var(--ink); font-weight: 600; }


/* =============================================================================
   5. PANELS AND CARDS — `.panel` and `.card` are the same thing
   ========================================================================== */

.card, .panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin: 0 0 var(--section);
  min-width: 0;
}
.card.narrow, .panel.narrow { max-width: 34rem; }
.card.plain, .panel.plain { background: transparent; box-shadow: none; }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}
.panel-title { margin: 0; font-family: var(--font-head); font-size: var(--fs-xl); }
.panel-note { margin: 0; color: var(--ink-3); font-size: var(--fs-sm); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap) 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap) 1.25rem; }


/* =============================================================================
   6. FORMS — every control is drawn here; no native select arrow anywhere
   ========================================================================== */

.field { margin: 0 0 var(--block); min-width: 0; }
.grid-2 > .field, .grid-3 > .field { margin-bottom: 0; }

/* a label that NAMES a control — the model options and choice rows carry
   their own styling */
.field > label:not(.model-option):not(.model-opt):not(.check):not(.choice),
.models legend,
.model-pick legend,
.lab {
  display: block;
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: var(--fs-mark);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.hint {
  margin: 0.35rem 0 0;
  font-size: var(--fs-fine);
  line-height: 1.5;
  color: var(--ink-3);
}
.hint a { color: var(--ink-2); }
.hint a:hover { color: var(--accent); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: var(--ctl-h);
  padding: 0 var(--ctl-pad-x);
  color: var(--ink);
  background-color: var(--well);
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  box-shadow: var(--well-shadow);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--motion), background-color var(--motion);
}

/* the check form's paste box is the working surface of the whole service:
   generous by default, and it grows, never scrolls sideways */
textarea {
  height: auto;
  min-height: 11rem;
  padding: 0.6rem var(--ctl-pad-x);
  line-height: var(--lh-body);
  resize: vertical;
}

input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) {
  border-color: var(--ink-3);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }

input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

select {
  padding-right: 2.1rem;
  cursor: pointer;
  text-overflow: ellipsis;
  background-image: var(--caret);
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 10px 7px;
}
select option { background: var(--panel-bg); color: var(--ink); }

/* --- checkbox and radio: drawn, never native ----------------------------- */
input[type="checkbox"], input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  flex: none;
  margin: 0.28rem 0 0;
  position: relative;
  background: var(--well);
  border: 1px solid var(--edge);
  cursor: pointer;
  transition: background-color var(--motion), border-color var(--motion);
}
input[type="checkbox"] { border-radius: var(--radius-sm); }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--accent); }
input[type="checkbox"]:checked, input[type="radio"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 4px; height: 9px;
  border: solid var(--accent-ink);
  border-width: 0 1.7px 1.7px 0;
  transform: rotate(42deg);
}
input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent-ink);
}
input[type="checkbox"]:disabled, input[type="radio"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- the model chooser (radio rows on the check form) --------------------
   `.model-option`/`.model-opt` and `.models`/`.model-pick` are the same
   thing under two lanes' names; both stay styled. */
.models, .model-pick { border: 0; padding: 0; margin: 0 0 var(--block); min-width: 0; }
.models legend, .model-pick legend { padding: 0; }

.model-option, .model-opt {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.model-option:hover, .model-opt:hover { border-color: var(--accent); }
.model-option:has(input:checked), .model-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.model-option:has(input:disabled), .model-opt:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}
.model-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.model-name { font-weight: 600; }
.model-note, .model-free { font-size: var(--fs-fine); color: var(--ink-3); }

/* a tick or radio row: the drawn box and its sentence side by side */
.check, .choice {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.3rem;
  cursor: pointer;
}

.quota { color: var(--ink-2); font-size: var(--fs-sm); margin: 0 0 0.9rem; }
.quota b {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
}
.quota-note { display: block; color: var(--ink-3); }

.row-actions, .actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.row-actions form, .actions form { margin: 0; }


/* =============================================================================
   7. BUTTONS
   ========================================================================== */

button,
input[type="submit"],
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--ctl-h);
  width: auto;
  padding: 0 1.25rem;
  background: var(--panel-bg-2);
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--motion), border-color var(--motion),
              background-color var(--motion);
}
button:hover,
input[type="submit"]:hover,
.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--accent-ink);
}

.btn-quiet { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-quiet:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger { background: transparent; border-color: var(--line); color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); color: var(--bad); }

.btn-small {
  min-height: var(--ctl-h-sm);
  padding: 0 0.85rem;
  font-size: var(--fs-fine);
}

.btn-wide { width: 100%; margin-top: 0.35rem; }

button:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; }


/* =============================================================================
   8. NOTICES, PILLS, FACTS
   ========================================================================== */

.flashes { list-style: none; margin: 1.25rem 0 0; padding: 0; }

.notice {
  margin: 0 0 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--panel-bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}
.notice-ok, .notice-success { border-left-color: var(--ok); }
.notice-warn, .notice-warning { border-left-color: var(--warn); }
.notice-error, .notice-bad { border-left-color: var(--bad); }

.pill {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  background: var(--panel-bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  letter-spacing: 0.04em;
}
.pill-ok { color: var(--ok); border-color: var(--ok); }
.pill-warn { color: var(--warn); border-color: var(--warn); }

/* sender aliases on the settings page: one address per line, the pill and
   the two small forms flowing behind it, wrapping cleanly at 360px */
.alias-list { list-style: none; margin: 0 0 var(--block); padding: 0; }
.alias-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.alias-row form { margin: 0; }
.alias-address {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
  min-width: 0;
}
/* the verdict as a word in a table row */
.pill-scam { color: var(--scam); border-color: var(--scam); }
.pill-suspicious { color: var(--suspicious); border-color: var(--suspicious); }
.pill-legitimate { color: var(--legitimate); border-color: var(--legitimate); }
.pill-unclear { color: var(--unclear); border-color: var(--unclear); }

/* label/value pairs (settings, admin, the result page's metadata) */
.factgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: var(--gap) 1.25rem;
  margin: 0;
}
.fact { min-width: 0; margin: 0; }
.fact dt {
  margin: 0 0 0.15rem;
  font-family: var(--font-mono);
  font-size: var(--fs-mark);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.fact dd {
  margin: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}


/* =============================================================================
   9. THE VERDICT — card, word, confidence meter, budget line
   ========================================================================== */

/* Each variant hands its signal colour to the card through two local tokens;
   everything below reads only those, so a fifth verdict would be two lines. */
.verdict-scam { --v: var(--scam); --v-soft: var(--scam-soft); }
.verdict-suspicious { --v: var(--suspicious); --v-soft: var(--suspicious-soft); }
.verdict-legitimate { --v: var(--legitimate); --v-soft: var(--legitimate-soft); }
.verdict-unclear { --v: var(--unclear); --v-soft: var(--unclear-soft); }

.verdict-card {
  background:
    linear-gradient(90deg, var(--v-soft, var(--unclear-soft)), transparent 55%),
    var(--panel-bg);
  border: 1px solid var(--line);
  border-left: 5px solid var(--v, var(--unclear));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
  margin: 0 0 var(--section);
  min-width: 0;
}

/* the small uppercase line above the word: "verdict" */
.verdict-eyebrow {
  margin: 0 0 0.3rem;
  font-family: var(--font-mono);
  font-size: var(--fs-mark);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.verdict-word {
  margin: 0 0 0.35rem;
  font-size: var(--fs-display);
  font-weight: var(--head-weight);
  letter-spacing: var(--head-tracking);
  line-height: 1.05;
  color: var(--v, var(--unclear));
}

.verdict-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}

.verdict-hint { margin: 0 0 0.75rem; color: var(--ink-2); font-size: var(--fs-sm); }

.verdict-reasons { margin: 0 0 1rem; padding-left: 1.2rem; }
.verdict-reasons li { margin-bottom: 0.35rem; overflow-wrap: anywhere; }

/* the reasons and the advice as their own sections under the card */
.reasons, .advice { margin: 0 0 var(--block); }
.reasons li { margin-bottom: 0.35rem; overflow-wrap: anywhere; }

/* the fine print under a result: model, time, truncation */
.result-meta { margin: 0.75rem 0 0; color: var(--ink-3); font-size: var(--fs-fine); }

/* the "content is not stored" promise, wherever it stands */
.promise, .promise-line { color: var(--ink-3); font-size: var(--fs-fine); }

.verdict-advice {
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--panel-bg-2);
  border-left: 3px solid var(--v, var(--unclear));
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}

/* --- the confidence meter -------------------------------------------------
   Two shapes, both CSP-safe (no inline style can carry the width):
   the native element `<meter class="meter" min="0" max="100" value="…">`,
   whose fill the browser sizes itself, or a track div with a `.meter-fill`
   whose width is a class, .p0 … .p100 in steps of five. Inside a verdict
   card the fill takes the verdict's colour; on its own, the accent. */
.meter {
  position: relative;
  height: 0.5rem;
  min-width: 6rem;
  flex: 1 1 8rem;
  max-width: 14rem;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.meter-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--v, var(--accent));
  border-radius: inherit;
  transition: width var(--motion);
}
/* the same look for the native element */
meter.meter {
  appearance: none;
  -webkit-appearance: none;
  height: 0.5rem;
}
meter.meter::-webkit-meter-bar {
  background: var(--well);
  border: 0;
  border-radius: 999px;
  height: 0.5rem;
}
meter.meter::-webkit-meter-optimum-value,
meter.meter::-webkit-meter-suboptimum-value,
meter.meter::-webkit-meter-even-less-good-value {
  background: var(--v, var(--accent));
  border-radius: 999px;
}
meter.meter::-moz-meter-bar {
  background: var(--v, var(--accent));
  border-radius: 999px;
}

/* label — meter — figure, on one line */
.meter-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}
.meter-label, .meter-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-fine);
  color: var(--ink-2);
}

.p0 { width: 0%; }    .p5 { width: 5%; }    .p10 { width: 10%; }
.p15 { width: 15%; }  .p20 { width: 20%; }  .p25 { width: 25%; }
.p30 { width: 30%; }  .p35 { width: 35%; }  .p40 { width: 40%; }
.p45 { width: 45%; }  .p50 { width: 50%; }  .p55 { width: 55%; }
.p60 { width: 60%; }  .p65 { width: 65%; }  .p70 { width: 70%; }
.p75 { width: 75%; }  .p80 { width: 80%; }  .p85 { width: 85%; }
.p90 { width: 90%; }  .p95 { width: 95%; }  .p100 { width: 100%; }

/* --- the budget line ------------------------------------------------------
   "This month: $0.0413 of your $0.50 budget · 2 of 10 checks today."
   One quiet line of figures, on the form and on top of the history. */
.budget-line {
  display: flex;
  align-items: baseline;
  gap: 0.35rem 0.9rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.budget-line b, .budget-line .cost {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
}


/* =============================================================================
   10. TABLES — history and admin. A table on a desk, a stack of cards on a
       phone: any table carrying data-label cells collapses under 720 px.
   ========================================================================== */

/* Nothing scrolls sideways here: under 720 px the rows become cards, and a
   scroll frame would cut a word in half behind a scrollbar. The name stays
   because templates carry it. */
.table-wrap { overflow-x: visible; }

table.rows, table.jobs, table.stack, table.checks {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
table.rows th, table.rows td,
table.jobs th, table.jobs td,
table.stack th, table.stack td,
table.checks th, table.checks td { overflow-wrap: anywhere; }
table.rows th, table.jobs th, table.stack th, table.checks th {
  padding: 0 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--fs-mark);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--ink-3);
}
table.rows th.num, table.jobs th.num, table.stack th.num,
table.checks th.num { text-align: right; }
table.rows td, table.jobs td, table.stack td, table.checks td {
  padding: 0.75rem 0.7rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.cell-actions { text-align: right; white-space: nowrap; }


/* =============================================================================
   11. SETTINGS AND ADMIN ODDMENTS
   ========================================================================== */

.qr {
  width: fit-content;
  margin: 0 0 0.75rem;
  padding: 0.75rem;
  background: var(--qr-bg);
  border-radius: var(--radius-sm);
}
.qr svg { display: block; width: 11rem; height: 11rem; }

.secret {
  padding: 0.5rem 0.7rem;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.key-tail { font-size: var(--fs-fine); color: var(--ink-3); }

.admin { min-width: 0; }
.admin h1 { font-size: var(--fs-display); }
.admin input[type="number"] { width: 6rem; }
.row-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.linkrow { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
/* controls sitting inside a data row shrink to the row, not the form */
.admin table td input, .admin table td select {
  height: var(--ctl-h-sm);
  font-size: var(--fs-sm);
}
.admin button, .admin input[type="submit"], .admin .btn {
  min-height: var(--ctl-h-sm);
  padding: 0 0.85rem;
  font-size: var(--fs-fine);
}
.admin .actions button, .admin .actions input[type="submit"] {
  min-height: var(--ctl-h);
  padding: 0 1.25rem;
  font-size: var(--fs-md);
}

/* --- the admin page's five rooms (F2) ------------------------------------
   Each section of /admin/ is a titled card: a heading with a short accent
   bar, one muted line saying what the section is for, a hairline under
   that pair, then the content. The wide bottom margin keeps the rooms
   clearly apart on a long scroll. */
.admin-section { padding: 1.5rem 1.5rem 1.6rem; margin: 0 0 2.25rem; }
.admin-section > h2 { margin: 0 0 0.35rem; font-size: var(--fs-lg); }
.admin-section > h2::before {
  content: "";
  display: inline-block;
  width: 1.1rem;
  height: 3px;
  margin-right: 0.55rem;
  vertical-align: 0.3em;
  background: var(--accent);
  border-radius: 2px;
}
.section-note {
  margin: 0 0 1.1rem;
  color: var(--ink-3);
  font-size: var(--fs-sm);
}
.admin-section > .section-note {
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
}

/* the /admin/checks pager: newer — page x of y — older */
.pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.25rem 0 0;
}
.pager-note {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}

/* one model per block inside the models card, hairlines between (as .tiers) */
.admin-block { padding: 0.9rem 0; border-top: 1px solid var(--line-soft); }

/* the one open row-editor (?edit_user= / ?edit_type= / ?edit_model=); the
   narrow-screen table collapse treats its cell as a plain block */
.admin-edit { min-width: 0; }


/* =============================================================================
   12. LEGAL PAGES, ERROR PAGES
   ========================================================================== */

.legal { max-width: 46rem; }
.legal h2 { margin: 2rem 0 0.6rem; font-size: var(--fs-lg); }
.legal h3 { margin: 1.4rem 0 0.4rem; font-size: var(--fs-md); }
.legal dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1.25rem;
  margin: 0 0 1rem;
}
.legal dt { font-weight: 600; }
.legal dd { margin: 0; overflow-wrap: anywhere; }
.legal table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.legal th, .legal td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.important {
  margin: 1rem 0;
  padding: 0.9rem 1.1rem;
  background: var(--panel-bg-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

/* the unfilled Impressum fields must be impossible to miss */
.todo {
  margin: 1rem 0;
  padding: 0.7rem 0.9rem;
  border: 1px dashed var(--warn);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
}
.placeholder {
  border-bottom: 1px dashed var(--edge);
  color: var(--ink-3);
  font-style: italic;
}

.error-page { margin-top: 2.5rem; }
.error-code {
  margin: 0 0 0.5rem;
  font-size: 3rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.6;
}


/* =============================================================================
   13. NARROW SCREENS — everything must work at 390 px and at 360 px
   ========================================================================== */

@media (max-width: 1000px) {
  /* the hairline lies down; the FORM comes first on a phone (the spec's
     order:1) — a visitor arriving with a suspicious text in the clipboard
     should not scroll past the pitch to paste it */
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-form {
    order: 1;
    padding: 2rem 0 1.75rem;
    border-left: 0;
  }
  .split-say {
    order: 2;
    padding: 1.75rem 0 2.25rem;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 780px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  :root {
    --pad: 1rem;
    --gut: 0;
  }

  .head-inner { min-height: 3.25rem; gap: 0.75rem; padding: 0.5rem 0; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.5rem 0 0.9rem;
    border-top: 1px solid var(--line);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { padding: 0.55rem 0; }
  .site-nav a.btn, .nav-form .btn { align-self: flex-start; justify-content: center; }

  .verdict-card { padding: 1.1rem 1rem; }

  /* Tables become stacks of cards: five columns will not fit 360 px, and a
     sideways scroll cuts a word in half behind a scrollbar. Each cell names
     itself through its data-label attribute. */
  table.rows, table.rows tbody, table.rows tr, table.rows td,
  table.jobs, table.jobs tbody, table.jobs tr, table.jobs td,
  table.stack, table.stack tbody, table.stack tr, table.stack td,
  table.checks, table.checks tbody, table.checks tr, table.checks td {
    display: block;
    width: 100%;
  }
  table.rows thead, table.jobs thead, table.stack thead,
  table.checks thead { display: none; }
  table.rows tr, table.jobs tr, table.stack tr, table.checks tr {
    margin-bottom: 0.9rem;
    padding: 0.5rem 0.9rem;
    background: var(--panel-bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  table.rows td, table.jobs td, table.stack td, table.checks td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border-bottom: 0;
    text-align: left;
  }
  table.rows td::before, table.jobs td::before, table.stack td::before,
  table.checks td::before {
    content: attr(data-label);
    flex: none;
    font-family: var(--font-mono);
    font-size: var(--fs-mark);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
  table.rows td.cell-actions, table.jobs td.cell-actions,
  table.stack td.cell-actions,
  table.checks td.cell-actions { justify-content: flex-start; }
  table.rows td.cell-actions::before, table.jobs td.cell-actions::before,
  table.stack td.cell-actions::before,
  table.checks td.cell-actions::before { content: none; }

  /* the open row-editor's colspan cell has no data-label to show and must
     not become a label/value flex pair: it spans its card as one block */
  table.rows td:has(> .admin-edit) { display: block; }
  table.rows td:has(> .admin-edit)::before { content: none; }

  /* the admin cards keep their air on a phone, just less of it */
  .admin-section { padding: 1.15rem 1rem 1.25rem; margin-bottom: 1.5rem; }

  /* legal tables carry sentences, so the label stands ABOVE the value */
  .legal table.stack td { display: block; }
  .legal table.stack td::before { display: block; }
}

@media (max-width: 560px) {
  /* 16 px stops the phone zooming in the moment a control takes focus */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="url"], input[type="number"],
  select, textarea {
    font-size: 1rem;
  }
  .factgrid { grid-template-columns: minmax(0, 1fr); }
  .form-head { gap: 0.25rem; }
  .quota { width: 100%; }
  .legal dl { grid-template-columns: 1fr; }
  .legal dd { margin-bottom: 0.5rem; }
}

@media (max-width: 430px) {
  .foot-inner { flex-direction: column; align-items: flex-start; }
  .row-actions, .actions { gap: 0.5rem; }
  .btn-small { padding: 0 0.7rem; }
  .error-code { font-size: 2.4rem; }
  .tier-name { min-width: 100%; }
}


/* =============================================================================
   14. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
