:root {
  --blue: #23355b;
  --red: #b00c13;

  --bg: #ffffff;
  --chrome: #ffffff;
  --surface: #f6f7fa;
  --surface-2: #eceff5;
  --border: #dde1ea;
  --text: #000000;
  --muted: #444444;
  --accent: var(--blue);
  --danger: var(--red);

  /* Flat 50/50, for straight rules: footer top edge and the footer headings. */
  --split: linear-gradient(to right, var(--red) 0 50%, var(--blue) 50% 100%);
  --split-v: linear-gradient(to bottom, var(--red) 0 50%, var(--blue) 50% 100%);

  /* Diagonal split for boxes: red claims the left side plus 65% of the top
     edge and 35% of the bottom, blue takes the remainder. The boundary must
     hit those two exact points on any shaped box, which a linear-gradient
     angle cannot do - the needed angle changes with the box's aspect ratio.
     An SVG stretched with preserveAspectRatio='none' is exact at every size.
     Colours are inlined because a data URI cannot read a custom property;
     they must be kept in step with --red and --blue above. */
  --split-diag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 100 100'%3E%3Cpath d='M0 0H65L35 100H0Z' fill='%23b00c13'/%3E%3Cpath d='M65 0H100V100H35Z' fill='%2323355b'/%3E%3C/svg%3E");

  /* Severity scale. Critical and high sit on the brand red, low on the brand
     blue; medium needs a third hue or it cannot be told apart from either. */
  --sev-critical: #7f0a10;
  --sev-high: var(--red);
  --sev-medium: #a86400;
  --sev-low: var(--blue);
  --sev-info: var(--muted);

  /* Pass needs a hue of its own: blue already means "brand" and reads as
     neutral rather than good. Backgrounds are the same hue at low alpha so a
     badge tints rather than fills. */
  --ok: #1a7f4b;
  --ok-bg: rgba(26, 127, 75, .11);
  --bad-bg: rgba(176, 12, 19, .09);
  --warn-bg: rgba(168, 100, 0, .11);

  /* Read by nav.js to reset menu state when the layout crosses over. A media
     query cannot use var(), so the 1200px below is duplicated by necessity -
     change both together. */
  --nav-bp: 1200px;

  --radius: 10px;
  --shell: min(80%, 1200px);
}

* { box-sizing: border-box; }

/* Holds the shared SVG gradient definition. Zero-sized rather than
   display:none, which can void the reference in some engines. */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

body {
  margin: 0;
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;

  /* White ground with a fine two-tone dot grid: blue on the 26px lattice,
     red offset half a cell so the colours alternate diagonally. */
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, rgba(35, 53, 91, .22) 1.2px, transparent 1.3px),
    radial-gradient(circle, rgba(176, 12, 19, .17) 1.2px, transparent 1.3px);
  background-size: 26px 26px, 26px 26px;
  background-position: 0 0, 13px 13px;
}

/* ---------- header ---------- */

.site-header {
  padding: 18px 0;
}

/* The split border has to survive border-radius, which rules out
   border-image. Two backgrounds instead: the white fill is clipped to the
   padding box, the gradient to the border box, so the gradient shows only
   in the 2px border ring. */
.header-inner {
  width: var(--shell);
  margin: 0 auto;
  background-image: linear-gradient(var(--chrome), var(--chrome)), var(--split-diag);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  background-size: auto, 100% 100%;
  background-repeat: no-repeat, no-repeat;
  border: 2px solid transparent;
  border-radius: 14px;
  /* Vertical padding only sets the gap between the nav row and the box
     edges; the nav links keep their own 8px so the hover pills stay full. */
  padding: 6px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  /* Belt and braces: the breakpoint below should switch to the hamburger
     before the row runs out of room, but if an estimate is ever wrong the
     nav wraps to a second line inside the box rather than overflowing it. */
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  height: 28px;
  width: auto;
  flex: none;
  display: block;
}

/* Inline SVG icons. Stroked by default so they inherit link colour on hover;
   .icon-solid is for brand marks that are drawn as filled paths. */
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  /* Same red/blue diagonal as the boxes. userSpaceOnUse in the gradient def
     keeps it identical across icons, since every icon shares a 0 0 16 16
     viewBox - objectBoundingBox would remap it to each path's own bounds. */
  stroke: url(#splitStroke);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-solid {
  fill: currentColor;
  stroke: none;
}

.brand:hover { color: var(--blue); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover { color: var(--blue); background: var(--surface-2); }
.has-sub > .nav-link::after { content: "▾"; font-size: 10px; color: var(--muted); margin-left: -2px; }
.has-sub.open > .nav-link { color: var(--blue); background: var(--surface-2); }

.sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  list-style: none;
  margin: 0;
  padding: 6px;
  background-image: linear-gradient(var(--chrome), var(--chrome)), var(--split-diag);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  background-size: auto, 100% 100%;
  background-repeat: no-repeat, no-repeat;
  border: 2px solid transparent;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(22, 32, 58, .12);
  z-index: 20;
}

.has-sub.open .sub-menu { display: block; }

.sub-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
}

.sub-menu a:hover { color: var(--blue); background: var(--surface-2); }

/* The nav row needs roughly 880px. --shell is 80% of the viewport, so it runs
   out of room around 1100px - well before the layout breakpoint - and used to
   spill outside the header box. Collapse to the hamburger at 1200px, which
   leaves headroom for the widest label set. */
@media (max-width: 1200px) {
  .nav-toggle { display: flex; }
  .brand-mark { height: 26px; }

  .site-nav {
    display: none;
    width: 100%;
    order: 3;
    margin-top: 10px;
    padding-top: 14px;
    /* brand-coloured divider rather than the plain grey rule */
    background-image: var(--split);
    background-repeat: no-repeat;
    background-size: 100% 2px;
    background-position: left top;
  }

  .site-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link { width: 100%; text-align: left; }

  .sub-menu {
    position: static;
    display: none;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 0 4px 12px;
    min-width: 0;
  }

  .has-sub.open .sub-menu { display: block; }
}

@media (max-width: 860px) {
  :root { --shell: 92%; }
}

/* ---------- layout ---------- */

main {
  width: var(--shell);
  margin: 0 auto;
  padding: 40px 0 64px;
}

h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 6px; }
.lede { color: var(--muted); margin: 0 0 32px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  background: var(--chrome);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}

.card:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 20px rgba(22, 32, 58, .09);
}

.card p { color: var(--muted); margin: 0; font-size: 14px; }

/* ---------- forms ---------- */

.tool-form { display: flex; gap: 8px; margin: 24px 0; flex-wrap: wrap; }

input[type="text"], textarea {
  flex: 1;
  min-width: 240px;
  background: var(--chrome);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

textarea { min-height: 180px; font-family: ui-monospace, monospace; font-size: 13px; }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 53, 91, .12);
}

/* Only unclassed buttons. The old selector was
   button:not(.nav-toggle):not(.nav-link), whose (0,2,1) specificity beat every
   single-class button rule below it - .scan-pick-btn and .linklike were being
   painted solid blue with no border regardless of what they asked for.
   :not([class]) cannot match a classed button at all, so the conflict is gone
   rather than merely outranked. */
button:not([class]) {
  background: var(--blue);
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 12px 22px;
  cursor: pointer;
}

button:not([class]):hover { background: #1a2846; }
button:disabled { opacity: .5; cursor: not-allowed; }

.result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 20px;
  white-space: pre-wrap;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  overflow-x: auto;
}

.error { border-color: var(--red); color: var(--red); }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 16px; }
.back:hover { color: var(--blue); }

/* ---------- prose (about / privacy / terms) ---------- */

.prose { max-width: 70ch; }
.prose h2 { font-size: 18px; margin: 32px 0 8px; }
.prose h2:first-of-type { margin-top: 24px; }
.prose p, .prose li { color: var(--muted); }
.prose ul { padding-left: 20px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--blue); }
.prose strong { color: var(--text); font-weight: 600; }

.meta {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 24px 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- blog ---------- */

.post-list { list-style: none; margin: 0; padding: 0; }

.post-list li {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.post-list li:first-child { border-top: 1px solid var(--border); }
.post-list h2 { margin: 0 0 4px; }
.post-list a { color: var(--text); text-decoration: none; }
.post-list a:hover { color: var(--blue); }
.post-list p { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.post-date { color: var(--muted); font-size: 13px; font-family: ui-monospace, monospace; }

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 { color: var(--text); }
.empty-state p { margin: 6px 0 0; font-size: 14px; }

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

/* Full-bleed band. The 50/50 rule is painted as a background layer sized to
   3px rather than a border-image, which keeps it exact at every width. */
.site-footer {
  margin-top: 48px;
  padding: 40px 0 28px;
  background-color: transparent;
  background-image: var(--split);
  background-repeat: no-repeat;
  background-size: 100% 3px;
  background-position: left top;
  border-top: 0;
}

.footer-inner {
  width: var(--shell);
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2.2fr 1.3fr 1fr 1.3fr;
  gap: 32px;
  align-items: start;
}

.footer-col h3 {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text);
  margin: 0 0 14px;
  padding-bottom: 7px;
  background-image: var(--split);
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: left bottom;
}

.footer-brand { text-align: center; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand .brand-mark { height: 26px; }

.footer-brand p {
  margin: 0 auto;
  font-size: 13px;
  line-height: 1.7;
  max-width: 42ch;
}

.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 9px; }

.footer-links a {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.footer-links a:hover { color: var(--blue); }

.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--blue); }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { justify-content: center; text-align: center; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .brand-mark { height: 24px; }
  .footer-brand .brand-mark { height: 24px; }
  .hero-logo { max-width: 140px; }
}


/* ---------- home ---------- */

.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 16px 0 8px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  margin: 0 0 10px;
}

.hero-copy h1 {
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 14px;
}

.hero-copy .lede {
  font-size: 17px;
  max-width: 48ch;
  margin-bottom: 26px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1a2846; }

.btn-ghost {
  background: var(--chrome);
  color: var(--blue);
  border-color: var(--border);
}

.btn-ghost:hover { border-color: var(--blue); }

/* A split-gradient stroke would be invisible on the solid button and fight
   the label on the outline one, so button icons take the text colour. */
.btn .icon { stroke: currentColor; }

.hero-art { display: flex; justify-content: center; }

.hero-logo {
  width: 100%;
  max-width: 240px;
  height: auto;
  display: block;
}

/* ---------- module tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 26px 14px;
  color: var(--text);
  text-decoration: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  /* Same diagonal split border as the header and submenu. */
  background-image: linear-gradient(var(--chrome), var(--chrome)), var(--split-diag);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  background-size: auto, 100% 100%;
  background-repeat: no-repeat, no-repeat;
  border: 2px solid transparent;
  border-radius: var(--radius);
  transition: box-shadow .15s, transform .15s;
}

/* The border is a gradient, not a colour, so hover lifts the tile instead
   of recolouring its edge. */
.tile:hover {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .10);
  transform: translateY(-2px);
}

.tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
}

.tile .icon { width: 26px; height: 26px; }

/* ---------- sections ---------- */

.section { margin-top: 60px; }

.section-head {
  font-size: 22px;
  margin: 0 0 10px;
  padding-bottom: 10px;
  background-image: var(--split);
  background-repeat: no-repeat;
  background-size: 44px 3px;
  background-position: left bottom;
}

/* the Browse Tools button jumps here; keep the heading clear of the edge */
#modules { scroll-margin-top: 24px; }

.section-sub {
  color: var(--muted);
  max-width: 72ch;
  margin: 0 0 24px;
}

.section-sub a { color: var(--blue); }

h3 { font-size: 16px; margin: 0 0 6px; }

/* Horizontal timeline. The rail spans marker centre to marker centre - with
   four equal columns those sit at 12.5% and 87.5% - so it never overshoots
   into empty space. Markers carry the same diagonal split border as the
   header, and their white fill hides the rail passing behind them. */
.timeline {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 12.5%;
  right: 12.5%;
  height: 3px;
  border-radius: 2px;
  background-image: var(--split);
  background-repeat: no-repeat;
  background-size: 100% 3px;
}

.timeline li {
  counter-increment: step;
  position: relative;
  text-align: center;
  padding-top: 56px;
}

.timeline li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background-image: linear-gradient(var(--chrome), var(--chrome)), var(--split-diag);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  background-size: auto, 100% 100%;
  background-repeat: no-repeat, no-repeat;
  border: 3px solid transparent;
  border-radius: 50%;
}

.timeline h3 { margin: 0 0 6px; }
.timeline p { color: var(--muted); margin: 0; font-size: 14px; }

/* ---------- itemised receipt ---------- */

.invoice {
  max-width: 760px;
  padding: 26px 28px 22px;
  background-image: linear-gradient(var(--chrome), var(--chrome)), var(--split-diag);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  background-size: auto, 100% 100%;
  background-repeat: no-repeat, no-repeat;
  border: 2px solid transparent;
  border-radius: 14px;
}

.invoice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
}

.invoice-label {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.invoice-for { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.invoice-stamp {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

/* Four tracks shared by the column head, every line and the total, so the
   money columns stay aligned down the whole receipt. */
.invoice-cols,
.invoice-lines li,
.invoice-total {
  display: grid;
  grid-template-columns: 34px 1fr 92px 68px;
  align-items: center;
  gap: 14px;
}

.invoice-cols {
  grid-template-columns: 1fr 92px 68px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}

.invoice-lines { list-style: none; margin: 0; padding: 0; }

.invoice-lines li {
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
}

.line-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
}

.line-body { display: flex; flex-direction: column; gap: 2px; }
.line-name { font-weight: 600; font-size: 15px; }
.line-desc { color: var(--muted); font-size: 13px; line-height: 1.5; }

.col-was, .col-now {
  font-family: ui-monospace, monospace;
  font-size: 14px;
  text-align: right;
}

.col-was { color: var(--muted); }
.col-was s { text-decoration-color: var(--red); }
.col-now { font-weight: 700; color: var(--blue); }

.invoice-total {
  grid-template-columns: 1fr 92px 68px;
  padding-top: 16px;
  font-size: 15px;
}

.total-label { font-weight: 700; }
.total-was { font-family: ui-monospace, monospace; font-size: 14px; color: var(--muted); text-align: right; }
.total-was s { text-decoration-color: var(--red); }

.total-now {
  font-family: ui-monospace, monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--blue);
  text-align: right;
}

.invoice-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; gap: 32px; }
  .hero-logo { max-width: 180px; margin: 0 auto; }
  .tiles { grid-template-columns: repeat(2, 1fr); }

  .timeline { grid-template-columns: 1fr; gap: 0; }

  .timeline::before {
    top: 8px;
    bottom: 30px;
    left: 18px;
    right: auto;
    width: 3px;
    height: auto;
    background-image: var(--split-v);
    background-size: 3px 100%;
  }

  .timeline li { text-align: left; padding: 0 0 26px 58px; }
  .timeline li::before { top: 0; left: 0; transform: none; }
}

@media (max-width: 620px) {
  .invoice { padding: 20px 18px 18px; }

  /* Drop the comparison column and let each line stack: icon and name on one
     row, price beneath, so nothing is squeezed to an unreadable width. */
  .invoice-cols { display: none; }

  .invoice-lines li {
    grid-template-columns: 34px 1fr auto;
    gap: 12px;
  }

  .invoice-lines li .col-was { display: none; }
  .line-desc { font-size: 12px; }

  .invoice-total { grid-template-columns: 1fr auto; }
  .total-was { display: none; }
}

/* ---------- web scanner ---------- */

.scanbar {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 8px;
}

.scan-prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 14px;
  white-space: nowrap;
  user-select: none;
}

/* The prefix and the field read as one control, so the seam between them
   carries no border and no radius. */
.scan-input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--chrome);
  color: var(--text);
  font: inherit;
}

.scan-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 53, 91, .12);
}

.scan-picker { position: relative; }

.scan-pick-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 100%;
  padding: 12px 16px;
  /* dotted edge so the optional picker reads as secondary next to the solid
     run button */
  border: 2px dotted var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.scan-pick-btn .icon { stroke: currentColor; }
.scan-pick-btn:hover { border-color: var(--blue); background: var(--surface); }
.scan-pick-btn.has-selection { border-color: var(--blue); color: var(--blue); }
.scan-pick-btn .caret { font-size: 10px; color: var(--muted); }

.scan-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(460px, 86vw);
  padding: 12px;
  background: var(--chrome);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(22, 32, 58, .16);
}

.scan-menu.open { display: block; }

.scan-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.scan-menu-actions { display: flex; gap: 12px; }

.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
}

.scan-menu-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
  max-height: 320px;
  overflow-y: auto;
}

.scan-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 6px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.scan-opt:hover { background: var(--surface); }
.scan-opt input { accent-color: var(--blue); flex: none; }

.scan-run {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.scan-run:hover { background: #1a2846; }
.scan-run:disabled { opacity: .5; cursor: not-allowed; }

/* Both icons ship in the markup; the class decides which one is shown, so no
   SVG has to be rebuilt from a string at runtime. */
.scan-run .icon { stroke: currentColor; }
.scan-run .ico-sel { display: none; }
.scan-run.selecting .ico-deep { display: none; }
.scan-run.selecting .ico-sel { display: block; }

/* ---------- scan source row ---------- */

.scan-sources {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
}

.scan-sources-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: 11px;
  color: var(--muted);
}

.scan-source {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.scan-source-url {
  font-family: ui-monospace, monospace;
  color: var(--muted);
  word-break: break-all;
}

.scan-source.is-primary .scan-source-url { color: var(--text); font-weight: 600; }
.scan-source-meta { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--muted); }

.scan-source-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 999px;
  padding: 1px 7px;
}

.scan-elapsed { margin-left: auto; }

@media (max-width: 620px) {
  .scan-sources { flex-direction: column; align-items: flex-start; }
  .scan-elapsed { margin-left: 0; }
}

/* ---------- result panels ---------- */

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.panel {
  min-width: 0;
  background: var(--chrome);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

/* The left edge carries the panel's verdict, so the state is readable while
   scanning down the column without reading any of the rows. */
.panel-ok { border-left-color: var(--blue); }
.panel-warn { border-left-color: var(--sev-medium); }
.panel-bad { border-left-color: var(--sev-high); }
.panel-unknown { border-left-color: var(--border); }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.panel-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.panel-icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The icon takes the panel's state colour; the title stays readable ink. */
.panel-ok .panel-icon { color: var(--ok); }
.panel-warn .panel-icon { color: var(--sev-medium); }
.panel-bad .panel-icon { color: var(--sev-high); }
.panel-unknown .panel-icon { color: var(--muted); }

.panel-state {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.panel-ok .panel-state { color: var(--blue); }
.panel-warn .panel-state { color: var(--sev-medium); }
.panel-bad .panel-state { color: var(--sev-high); }
.panel-unknown .panel-state { color: var(--muted); }

/* Label and value on one row, with the value free to wrap. A fixed label
   column keeps the values aligned down the panel. */
.panel-rows {
  display: grid;
  grid-template-columns: minmax(96px, 34%) 1fr;
  gap: 6px 12px;
  margin: 0;
  font-size: 13px;
}

.panel-rows dt { color: var(--muted); }

.panel-rows dd {
  margin: 0;
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
  word-break: break-word;
  min-width: 0;
}

.panel-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 860px) {
  .panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .panel-rows { grid-template-columns: 1fr; gap: 2px; }
  .panel-rows dd { margin-bottom: 6px; }
}

/* ---------- panel row states ---------- */

/* One place decides what ok, warn and bad look like, so a dot, a tick, a pill
   and a banner cannot drift apart. */
.state-ok { color: var(--ok); }
.state-warn { color: var(--sev-medium); }
.state-bad { color: var(--sev-high); }
.state-unknown { color: var(--muted); }

.state-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.state-mark { font-weight: 700; }

.value-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.value-badge strong { font-weight: 700; }
.value-badge.state-ok { background: var(--ok-bg); }
.value-badge.state-bad { background: var(--bad-bg); }
.value-badge.state-warn { background: var(--warn-bg); }
.value-badge.state-unknown { background: transparent; }

.panel-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 16px;
  margin: 2px 0 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.panel-banner.state-ok { background: var(--ok-bg); }
.panel-banner.state-bad { background: var(--bad-bg); }
.panel-banner.state-warn { background: var(--warn-bg); }

.panel-banner strong { font-weight: 700; letter-spacing: .01em; }

/* Pills wrap in pairs: the chip, then its proof on the line beneath, so a
   long explanation never stretches the chip itself. */
.panel-pills {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  margin-bottom: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: start;
  max-width: 100%;
  padding: 4px 11px;
  margin-top: 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.pill.state-ok { background: var(--ok-bg); }
.pill.state-bad { background: var(--bad-bg); }
.pill.state-warn { background: var(--warn-bg); }
.pill.state-unknown { background: transparent; }
.pill-value { text-transform: none; }

.pill-mark { font-weight: 700; }
.pill-name { font-weight: 600; }
.pill-value { color: var(--muted); font-family: ui-monospace, monospace; font-size: 11px; }

.pill-proof {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  padding-left: 2px;
  word-break: break-word;
}

.pill-proof:empty { display: none; }

/* ---------- findings ---------- */

.findings { margin-top: 26px; }

.findings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 6px;
}

.findings-head h2 { margin: 0; }
.sev-tally { display: flex; flex-wrap: wrap; gap: 6px; }

.sev-chip {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.sev-critical { color: var(--sev-critical); }
.sev-high { color: var(--sev-high); }
.sev-medium { color: var(--sev-medium); }
.sev-low { color: var(--sev-low); }
.sev-info { color: var(--sev-info); }

.finding {
  padding: 16px 18px;
  margin-top: 12px;
  background: var(--chrome);
  border: 1px solid var(--border);
  border-left: 4px solid currentColor;
  border-radius: var(--radius);
}

.finding-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.finding-top h3 { margin: 0; color: var(--text); }

.finding-check {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border-radius: 4px;
  padding: 2px 7px;
}

.finding p { margin: 0; color: var(--muted); font-size: 14px; }

.finding-evidence {
  margin: 10px 0 0;
  padding: 12px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 12.5px;
  overflow-x: auto;
  white-space: pre-wrap;
  color: var(--muted);
}

.findings-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 620px) {
  .scan-menu-list { grid-template-columns: 1fr; }
  .scan-picker, .scan-run { width: 100%; }
  .scan-pick-btn { width: 100%; justify-content: space-between; }
  .scan-menu { width: min(460px, 92vw); }
}

/* ---------- module page header ---------- */

.page-head {
  max-width: 62ch;
  margin: 4px auto 0;
  text-align: center;
}

.page-head h1 {
  font-size: clamp(25px, 3.1vw, 35px);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 12px;
}

/* .lede sets a bottom margin for left-aligned pages; centring needs the
   horizontal ones too, or the block sits centred while its text does not. */
.page-head .lede { margin: 0 auto; }

/* ---------- summary card ---------- */

/* Headline card above a report. Used by SSL grading, IP geolocation and the
   phishing check, so the badge is sized for either a letter grade or a short
   word ("Clean", "Risky") rather than assuming one shape. */
.summary-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  margin-bottom: 20px;
  background-image: linear-gradient(var(--chrome), var(--chrome)), var(--split-diag);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  background-size: auto, 100% 100%;
  background-repeat: no-repeat, no-repeat;
  border: 2px solid transparent;
  border-radius: 14px;
}

.summary-badge {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 3px solid currentColor;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

/* A word needs a wider, shorter badge than a single letter. */
.summary-badge.is-word {
  width: auto;
  min-width: 96px;
  height: auto;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Verdict colours reuse the severity hues rather than introducing a green:
   blue is the brand's "good", amber the middle, red the failing end. */
.badge-good { color: var(--blue); }
.badge-warn { color: var(--sev-medium); }
.badge-bad { color: var(--sev-high); }
.badge-critical { color: var(--sev-critical); }
.badge-neutral { color: var(--muted); }

.summary-body { min-width: 0; }
.summary-body h2 { margin: 0 0 4px; }
.summary-body p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }

.summary-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 14px;
  margin: 0;
  font-size: 13px;
}

.summary-facts dt { color: var(--muted); }
.summary-facts dd { margin: 0; font-family: ui-monospace, monospace; word-break: break-word; }

@media (max-width: 620px) {
  .summary-card { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ---------- DNS record groups ---------- */

.records { margin-top: 26px; }

.records.is-demo {
  padding: 16px 18px 18px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: rgba(246, 247, 250, .6);
}

.record-group {
  margin-top: 14px;
  background: var(--chrome);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.record-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.record-head h3 {
  margin: 0;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--blue);
}

.record-count { font-size: 12px; color: var(--muted); }

.record-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

.record-row:last-child { border-bottom: 0; }

/* MX preference. Fixed width so hosts line up regardless of the number. */
.record-prefix { flex: none; min-width: 34px; text-align: right; color: var(--muted); }
.record-value { flex: 1; min-width: 0; word-break: break-all; }

.record-tag {
  flex: none;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ---------- paste / upload blocks ---------- */

.paste-block { margin: 26px 0 8px; }

.paste-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 8px;
}

.paste-block textarea {
  width: 100%;
  min-height: 190px;
  padding: 14px 16px;
  background: var(--chrome);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.paste-block textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 53, 91, .12);
}

.paste-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.paste-hint { font-size: 13px; color: var(--muted); }

/* Dotted like the scanner's optional picker: both are "put something here"
   affordances rather than primary actions. */
.filepick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 20px;
  border: 2px dotted var(--border);
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
}

.filepick:hover { border-color: var(--blue); background: var(--surface); }
.filepick .icon { width: 26px; height: 26px; }
.filepick-text { font-weight: 600; font-size: 15px; }
.filepick-hint { font-size: 13px; color: var(--muted); }

/* ---------- delivery hops ---------- */

.hops-title { margin: 22px 0 10px; font-size: 15px; }

.hops { list-style: none; margin: 0 0 4px; padding: 0; counter-reset: hop; }

.hops li {
  counter-increment: hop;
  position: relative;
  padding: 12px 0 12px 34px;
  border-bottom: 1px dashed var(--border);
}

.hops li:last-child { border-bottom: 0; }

.hops li::before {
  content: counter(hop);
  position: absolute;
  left: 0;
  top: 12px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.hop-route {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

.hop-host { color: var(--text); word-break: break-all; }
.hop-arrow { color: var(--red); flex: none; }
.hop-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; font-size: 12px; color: var(--muted); }

/* ---------- protocol mix and conversations ---------- */

.proto-list { display: grid; gap: 8px; }

.proto-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.proto-name { font-weight: 600; }

.proto-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.proto-fill { display: block; height: 100%; background: var(--blue); }
.proto-val { font-family: ui-monospace, monospace; color: var(--muted); white-space: pre; }

.conv-table {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.conv-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 14px;
  padding: 10px 14px;
  background: var(--chrome);
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
}

.conv-pair { word-break: break-all; }
.conv-cell { color: var(--muted); white-space: nowrap; }

@media (max-width: 620px) {
  .proto-row { grid-template-columns: 60px 1fr; }
  .proto-val { grid-column: 2; text-align: right; }
  .conv-row { grid-template-columns: 1fr; gap: 4px; }
  .paste-actions { flex-direction: column; align-items: stretch; }
  .paste-actions .scan-run { width: 100%; }
}

/* ---------- demo report ---------- */

/* The placeholder must never be mistaken for a real result, so the whole
   block is outlined and banded rather than relying on the banner alone. */
.findings.is-demo {
  position: relative;
  padding: 16px 18px 18px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: rgba(246, 247, 250, .6);
}

.demo-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: var(--chrome);
  border: 1px solid var(--sev-medium);
}

.demo-tag {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--sev-medium);
  border: 1px solid var(--sev-medium);
  border-radius: 999px;
  padding: 3px 10px;
}

.demo-banner p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); }

/* ---------- suggested modules ---------- */

.suggest {
  margin-top: 56px;
  padding-top: 26px;
  background-image: var(--split);
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: left top;
}

.suggest h2 { margin: 0 0 4px; }
.suggest-sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

.tiles-sm { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.tiles-sm .tile { padding: 18px 12px; gap: 10px; font-size: 13px; }
.tiles-sm .tile-icon { width: 42px; height: 42px; }
.tiles-sm .tile .icon { width: 21px; height: 21px; }
