/* Fortlens — one stylesheet, no framework. Tokens first, then layout, then components. */

:root {
  color-scheme: light dark;

  --paper: #f4f2ec;
  --surface: #fbfaf7;
  --ink: #16191d;
  --ink-2: #4a5058;
  --line: #d6d1c4;
  --line-strong: #a9a493;
  --accent: #0b5d52;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe7;
  --danger: #a4161a;
  --danger-soft: #f7e1df;
  --ok: #17603a;
  --ok-soft: #dff0e5;

  --sev-high: #a4161a;
  --sev-medium: #8f5200;
  --sev-low: #1d5a96;
  --sev-info: #515a64;

  --qr-paper: #ffffff; /* a QR code needs dark on light in both themes, or scanners fail */

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;
  --radius: 4px;
  --measure: 70ch;
  --side: 15.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121416;
    --surface: #1a1d20;
    --ink: #e9e7e1;
    --ink-2: #aab0b7;
    --line: #2d3237;
    --line-strong: #4b5259;
    --accent: #5cc0ae;
    --accent-ink: #08201b;
    --accent-soft: #17302b;
    --danger: #ff9a95;
    --danger-soft: #3a1c1b;
    --ok: #7fd49f;
    --ok-soft: #14301f;

    --sev-high: #ff9a95;
    --sev-medium: #e8b05a;
    --sev-low: #8dbdf0;
    --sev-info: #a3acb5;
  }
}

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

html { -webkit-text-size-adjust: 100%; font-size: 106.25%; } /* 17px base: the old 16px with 14px controls read as small */

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--font-sans);
  min-height: 100dvh;
}
.stage { min-height: 100dvh; display: flex; flex-direction: column; }
body.site { display: flex; flex-direction: column; }
body.site .stage { min-height: 0; flex: 1; }

main { flex: 1; }
main:focus { outline: none; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--s3); text-wrap: balance; }
h1 { font-size: 2rem; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; font-weight: 650; margin-top: var(--s6); }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 var(--s3); max-width: var(--measure); }
.content p, .content ul, .content ol { max-width: 70ch; }
ul, ol { padding-left: 1.25rem; margin: 0 0 var(--s4); max-width: var(--measure); }
li + li { margin-top: var(--s2); }

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

code, .mono { font-family: var(--font-mono); font-size: 0.9em; }
code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.wrap { width: min(100% - 2rem, 70rem); margin-inline: auto; }

.skip {
  position: absolute; left: var(--s3); top: -3rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: var(--s2) var(--s3); border-radius: var(--radius);
}
.skip:focus { top: var(--s3); }

/* ---- Header / footer ---- */

.bar { border-bottom: 1px solid var(--line); background: var(--surface); }
.bar-in { display: flex; align-items: center; gap: var(--s5); min-height: 3.5rem; flex-wrap: wrap; padding-block: var(--s2); }
.brand {
  display: inline-flex; align-items: center; gap: var(--s2);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em;
}
.brand svg { width: 1.5rem; height: 1.5rem; color: var(--accent); }
.nav { display: flex; gap: var(--s4); flex: 1; }
.nav a { color: var(--ink-2); text-decoration: none; padding-block: var(--s2); border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.bar-end { display: flex; align-items: center; gap: var(--s4); margin-left: auto; font-size: 0.95rem; }
.bar-end form { margin: 0; }
.who { color: var(--ink-2); overflow-wrap: anywhere; }

.foot { border-top: 1px solid var(--line); margin-top: var(--s8); padding-block: var(--s5); color: var(--ink-2); font-size: 0.9rem; }
.foot p { margin: 0 0 var(--s2); }

main.wrap { padding-block: var(--s6); }

/* ---- Buttons / links as buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 2.75rem; padding: 0.5rem 1.15rem;
  font: inherit; font-weight: 600; line-height: 1.2;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-small { min-height: 2.25rem; padding: 0.3rem 0.8rem; font-size: 0.95rem; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; font-weight: 500; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* ---- Flash + error summary ---- */

.flash { border: 1px solid; border-left-width: 4px; border-radius: var(--radius); padding: var(--s3) var(--s4); margin-bottom: var(--s5); max-width: var(--measure); }
.flash-ok { background: var(--ok-soft); border-color: var(--ok); }
.flash-err, .error-summary { background: var(--danger-soft); border-color: var(--danger); }
.error-summary { border: 1px solid var(--danger); border-left-width: 4px; border-radius: var(--radius); padding: var(--s3) var(--s4); margin-bottom: var(--s5); max-width: var(--measure); }
.error-summary h2 { font-size: 1rem; margin: 0 0 var(--s2); }
.error-summary ul { margin: 0; }

/* ---- Forms ---- */

.form { max-width: 32rem; }
.field { margin-bottom: var(--s4); }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: var(--s1); }
.hint { color: var(--ink-2); font-size: 0.95rem; margin: 0 0 var(--s2); }
.field-error { color: var(--danger); font-size: 0.92rem; margin: var(--s1) 0 0; }
.field-error:empty { display: none; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], select {
  width: 100%; min-height: 2.9rem; padding: 0.55rem 0.75rem;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
input[aria-invalid="true"], .input-validation-error { border-color: var(--danger); }
.pw { display: flex; gap: var(--s2); }
.pw input { flex: 1; }
.check { display: flex; gap: var(--s3); align-items: flex-start; }
.check input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.choice { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4); background: var(--surface); margin-bottom: var(--s3); max-width: var(--measure); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.choice .check { align-items: flex-start; }
.choice strong { display: block; }
.choice span { color: var(--ink-2); font-size: 0.95rem; }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s4); min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: var(--s2); }
.form-actions { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; margin-top: var(--s5); }
.inline-form { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; max-width: 44rem; }
.inline-form .field { flex: 1 1 18rem; margin: 0; }

/* ---- Tables ---- */

.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { text-align: left; padding: var(--s4) var(--s4); border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); font-weight: 650; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.url { font-family: var(--font-mono); font-size: 0.9rem; overflow-wrap: anywhere; }
.actions { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }

/* ---- Status, severity ---- */

.status { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 0.6rem; height: 0.6rem; border: 2px solid currentColor; border-radius: 50%; }
.status-verified, .status-completed { color: var(--ok); }
.status-verified::before, .status-completed::before { background: currentColor; }
.status-pending, .status-queued, .status-running { color: var(--ink-2); }
.status-running::before { border-style: dashed; }
.status-failed { color: var(--danger); }
.status-failed::before { border-radius: 0; }
.status-cancelled { color: var(--ink-2); }
.status-cancelled::before { border-radius: 0; transform: rotate(45deg); }

.sev { font-weight: 650; padding: 0.1rem 0.5rem; border: 1px solid currentColor; border-radius: var(--radius); font-size: 0.85rem; white-space: nowrap; }
.sev-high { color: var(--sev-high); }
.sev-medium { color: var(--sev-medium); }
.sev-low { color: var(--sev-low); }
.sev-informational { color: var(--sev-info); }

.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-width: 36rem; margin: 0 0 var(--s5); }
.counts div { padding: var(--s3) var(--s4); border-left: 1px solid var(--line); }
.counts div:first-child { border-left: 0; }
.counts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 650; }
.counts dd { margin: 0; font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---- Definition lists, panels, findings ---- */

.meta { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s5); margin: 0 0 var(--s5); }
.meta dt { color: var(--ink-2); }
.meta dd { margin: 0; overflow-wrap: anywhere; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--s4) var(--s5); margin-bottom: var(--s4); max-width: 46rem; }
.panel h2, .panel h3 { margin-top: 0; }
.copyline { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin: 0 0 var(--s3); }
.copyline code { flex: 0 1 auto; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s4); margin: 0 0 var(--s3); }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }

details.finding { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: var(--s3); }
details.finding > summary { padding: var(--s3) var(--s4); cursor: pointer; display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; list-style-position: inside; }
details.finding > summary .name { font-weight: 600; flex: 1 1 16rem; }
details.finding > summary .count { color: var(--ink-2); font-size: 0.9rem; }
.finding-body { padding: 0 var(--s4) var(--s4); border-top: 1px solid var(--line); }
.finding-body h4 { margin: var(--s4) 0 var(--s1); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.finding-body p { margin-bottom: var(--s2); }

.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: var(--s5); max-width: 46rem; background: var(--surface); }
.empty h2 { margin-top: 0; font-size: 1.1rem; }

.pagehead { display: flex; justify-content: space-between; gap: var(--s4); align-items: flex-start; flex-wrap: wrap; margin-bottom: var(--s5); }
.pagehead h1 { margin: 0; }
.pagehead p { margin: var(--s1) 0 0; color: var(--ink-2); }
.subtle { color: var(--ink-2); }

/* ---- Landing ---- */

.hero { display: grid; gap: var(--s6); padding-block: var(--s5) var(--s7); align-items: start; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); max-width: 18ch; letter-spacing: -0.02em; }
.eyebrow { margin: 0 0 var(--s3); font: 650 0.8rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 36rem; }
.hero .actions { margin-top: var(--s5); gap: var(--s5); }
.hero-note { margin: var(--s4) 0 0; color: var(--ink-2); font-size: 0.95rem; }
@media (min-width: 62rem) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 29rem); gap: var(--s7); } }

.sample { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.sample-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2) var(--s4); flex-wrap: wrap; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); background: var(--paper); border-radius: var(--radius) var(--radius) 0 0; }
.sample-label { margin: 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.sample-note { margin: 0; color: var(--ink-2); font-size: 0.85rem; }
.sample-body { padding: var(--s4); }
.sample-site { margin: 0; font-size: 1.05rem; font-weight: 600; }
.sample-meta { margin: 0 0 var(--s4); }
.sample .verdict { max-width: none; padding: var(--s3) var(--s4); }
.sample .counts { max-width: none; margin-bottom: var(--s4); }
.sample-findings { list-style: none; margin: 0; padding: 0; max-width: none; }
.sample-findings li { margin: 0; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.sample-findings .name { font-weight: 600; margin-left: var(--s2); }
.sample-findings p { margin: var(--s2) 0 0; font-size: 0.95rem; color: var(--ink-2); max-width: none; }
.sample-more { margin: var(--s3) 0 0; border-top: 1px solid var(--line); padding-top: var(--s3); max-width: none; }

.band { padding-block: var(--s6); border-top: 1px solid var(--line); }
.band > h2 { margin-top: 0; font-size: 1.5rem; letter-spacing: -0.01em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: var(--s5) var(--s6); margin: var(--s5) 0 0; }
.facts > div { border-top: 2px solid var(--line-strong); padding-top: var(--s3); }
.facts dt { font-weight: 650; margin-bottom: var(--s1); }
.facts dd { margin: 0; color: var(--ink-2); max-width: 38rem; }
.invite { max-width: 46rem; }
.invite .actions { margin: var(--s4) 0; gap: var(--s5); }
.steps { list-style: none; padding: 0; counter-reset: step; max-width: 46rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.25rem 1fr; gap: var(--s3); padding-block: var(--s3); border-top: 1px solid var(--line); margin: 0; }
.steps li::before { content: counter(step); font-family: var(--font-mono); font-weight: 700; color: var(--accent); }
.steps strong { display: block; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: var(--s6); max-width: 60rem; }

.narrow { max-width: 30rem; }

@media (max-width: 40rem) {
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counts div:nth-child(3) { border-left: 0; }
  .counts div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .meta, .kv { grid-template-columns: 1fr; gap: 0; }
  .meta dd, .kv dd { margin-bottom: var(--s3); }
  th, td { padding: var(--s2) var(--s3); }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a { transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out; }
}

@media print {
  .bar, .foot, .btn, .actions form { display: none; }
  body { background: #fff; color: #000; }
}

/* ---- Small utilities (kept as classes because the CSP forbids inline styles) ---- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
.small { font-size: 0.85rem; }
.tight { margin: 0 0 var(--s1); }
.spaced { margin-top: var(--s5); }
h2.first { margin-top: 0; }
.title-url { font-size: 1.4rem; overflow-wrap: anywhere; }
.confirm { margin-top: var(--s2); max-width: 22rem; }
.form.wide { max-width: 46rem; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }
h1 .url { font-size: 0.8em; }
[hidden] { display: none !important; }

/* Table cells: keep URLs readable and let the wrapper scroll sideways instead of breaking mid-word. */
td.url { overflow-wrap: break-word; word-break: normal; min-width: 14rem; }
td.summary { min-width: 11rem; }
.field label.check { display: flex; font-weight: 400; }
.status-failed-text { color: var(--danger); }

/* ---- Legal text and admin tables ---- */
.terms { max-width: var(--measure); }
.terms h1 { font-size: 1.5rem; }
.terms h2 { font-size: 1.05rem; margin-top: var(--s5); }
.small-title { font-size: 1.5rem; }
.spaced-after { margin-bottom: var(--s6); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--s3) var(--s4); align-items: end; margin-bottom: var(--s5); }
.filters .field { margin: 0; }
td.details { min-width: 18rem; max-width: 28rem; overflow-wrap: break-word; word-break: break-all; font-family: var(--font-mono); }
.pager { display: flex; gap: var(--s3); margin-top: var(--s4); }

/* Two-factor setup and recovery codes */
.steps li h2 { margin-top: 0; font-size: 1.05rem; }
.qr { background: var(--qr-paper); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: var(--s3); width: 14rem; max-width: 100%; margin: 0 0 var(--s4); }
.qr svg { display: block; width: 100%; height: auto; }
.secret { display: inline-block; font-family: var(--font-mono); font-size: 1.05rem; letter-spacing: 0.04em; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2) var(--s3); overflow-wrap: anywhere; }
.recovery-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: var(--s2); max-width: 36rem; }
.recovery-codes li { margin: 0; }
.recovery-code { display: block; font-family: var(--font-mono); font-size: 1.05rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2) var(--s3); }


/* ---- App shell: sidebar when signed in, top bar on small screens ---- */
body.app { display: block; }
.content { width: min(100% - 2.5rem, 78rem); margin-inline: auto; }
main.content { padding-block: var(--s6) var(--s7); }
.side { background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; padding: var(--s2) var(--s4); }
.side .brand { margin-right: var(--s2); }
.side-nav { display: flex; gap: var(--s1); flex: 1; flex-wrap: wrap; }
.side-nav a, .side-end .who { color: var(--ink-2); text-decoration: none; padding: var(--s2) var(--s3); border-radius: var(--radius); font-weight: 500; }
.side-nav a:hover, .side-end .who:hover { color: var(--ink); background: var(--paper); }
.side-nav a[aria-current="page"], .side-end .who[aria-current="page"] { color: var(--ink); background: var(--accent-soft); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.side-end { display: flex; align-items: center; gap: var(--s3); }
.side-end form { margin: 0; }
.side-end .who { font-size: 0.95rem; overflow-wrap: anywhere; }

@media (min-width: 60rem) {
  body.app { padding-left: var(--side); }
  .side {
    position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 5;
    flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: var(--s5);
    border-bottom: 0; border-right: 1px solid var(--line); padding: var(--s5) var(--s4);
  }
  .side .brand { font-size: 1.25rem; margin: 0 0 var(--s2) var(--s2); }
  .side-nav { flex-direction: column; flex: 1; gap: var(--s1); }
  .side-nav a { padding: var(--s3) var(--s4); font-size: 1.05rem; }
  .side-end { flex-direction: column; align-items: stretch; border-top: 1px solid var(--line); padding-top: var(--s4); gap: var(--s3); }
  .side-end .who { padding-inline: var(--s3); }
  .side-end .btn { width: 100%; }
}


/* ---- Overview (dashboard) ---- */
.attention { list-style: none; padding: 0; margin: 0 0 var(--s6); max-width: none; display: grid; gap: var(--s2); }
.attention li { margin: 0; display: grid; grid-template-columns: 6.5rem 1fr auto; gap: var(--s4); align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--s3) var(--s4); }
.attention .sev { justify-self: start; }
.attn-msg { overflow-wrap: anywhere; }
.allclear { border: 1px solid var(--ok); border-left-width: 4px; background: var(--ok-soft); border-radius: var(--radius); padding: var(--s3) var(--s4); max-width: none; }
.cards { list-style: none; padding: 0; margin: 0; max-width: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: var(--s4); }
.card { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.card-title { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.status-line { margin: 0; display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.mini-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); margin: 0; }
.mini-counts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 650; }
.mini-counts dd { margin: 0; font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.card .actions { margin-top: auto; }
@media (max-width: 40rem) {
  .attention li { grid-template-columns: 1fr; gap: var(--s2); }
}


/* ---- Scan settings ---- */
textarea { width: 100%; min-height: 8rem; padding: 0.65rem 0.75rem; font: inherit; font-family: var(--font-mono); font-size: 0.95rem; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); resize: vertical; }
input[type="file"] { display: block; width: 100%; max-width: 32rem; padding: 0.5rem; font: inherit; color: var(--ink); background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; margin-right: var(--s3); padding: 0.35rem 0.8rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; }
.settings .panel { max-width: 52rem; }
.tag { font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0.1rem 0.45rem; vertical-align: middle; margin-left: var(--s2); }
ul.plain { padding-left: 1.25rem; }
.saved { display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.peek { margin: 0 0 var(--s4); }
.peek pre, pre { margin: var(--s2) 0 0; padding: var(--s3) var(--s4); overflow: auto; max-height: 18rem; font-family: var(--font-mono); font-size: 0.9rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; }
.danger-zone { margin-top: var(--s6); }


/* ---- Scan report page ---- */
.statusbar p { margin-bottom: var(--s2); }
.verdict { border: 1px solid var(--line); border-left-width: 5px; border-radius: var(--radius); background: var(--surface); padding: var(--s4) var(--s5); margin-bottom: var(--s4); max-width: 60rem; }
.verdict h2, .verdict h3 { margin: 0 0 var(--s2); font-size: 1.35rem; }
.verdict p { margin: 0; }
.verdict-attn { border-left-color: var(--sev-medium); }
.verdict-ok { border-left-color: var(--ok); }
.tiles { list-style: none; margin: 0 0 var(--s4); padding: 0; max-width: 60rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.tile { margin: 0; }
.tile a { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-top-width: 4px; border-radius: var(--radius); padding: var(--s3) var(--s4); }
.tile a:hover { border-color: var(--line-strong); }
.tile-high a { border-top-color: var(--sev-high); }
.tile-medium a { border-top-color: var(--sev-medium); }
.tile-low a { border-top-color: var(--sev-low); }
.tile-info a { border-top-color: var(--sev-info); }
.tile-n { display: block; font-size: 2rem; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-l { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 650; color: var(--ink-2); }
.reportbar { margin-bottom: var(--s6); }
.fgroup { margin-bottom: var(--s6); max-width: 60rem; }
.fgroup-title { display: flex; align-items: baseline; gap: var(--s3); margin: 0 0 var(--s3); scroll-margin-top: var(--s5); }
.scandetails { margin-top: var(--s6); max-width: 60rem; }
.scandetails > summary { cursor: pointer; color: var(--ink-2); }
details.finding > summary { padding: var(--s3) var(--s4); }
@media (max-width: 40rem) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* ---- Guided flow: steps, proof options, ready card, scan form ---- */
.stepper { list-style: none; margin: 0 0 var(--s5); padding: 0; max-width: 60rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); counter-reset: none; }
.step { margin: 0; display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step-n { flex: none; width: 2rem; height: 2rem; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--line-strong); border-radius: 50%; color: var(--ink-2); }
.step-text { display: flex; flex-direction: column; min-width: 0; }
.step-state { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 650; color: var(--ink-2); }
.step-title { font-weight: 600; }
.step-done .step-n { background: var(--ok); border-color: var(--ok); color: var(--paper); }
.step-current { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.step-current .step-n { border-color: var(--accent); color: var(--accent); }
.step-current .step-state { color: var(--accent); }
.proofs { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: var(--s4); max-width: 60rem; align-items: start; }
.proofs .panel { max-width: none; margin: 0; }
.ready { border-left: 5px solid var(--ok); }
.addbar { max-width: 60rem; }
.addbar .inline-form { max-width: none; }
.card .url { margin: 0; }
.ack { display: none; }
form:has(input[name="type"][value="2"]:checked) .ack { display: block; }
@supports not selector(:has(*)) { .ack { display: block; } }
@media (max-width: 40rem) { .stepper { grid-template-columns: 1fr; } }

.note { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--paper); padding: var(--s3) var(--s4); }
