:root {
  --bg: #f6f7f9; --surface: #ffffff; --ink: #14202e; --muted: #5a6776; --line: #dfe3e8;
  --brand: #0f3d5e; --accent: #0e7c86; --accent-ink: #ffffff;
  --crit: #9b1c1c; --high: #c2410c; --med: #a16207; --low: #2563eb; --info: #5a6776; --pass: #15803d;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1218; --surface: #151c25; --ink: #e6ebf1; --muted: #9aa7b6; --line: #273242;
    --brand: #7cc4ff; --accent: #2fb3bd; --accent-ink: #061015;
    --crit: #f87171; --high: #fb923c; --med: #facc15; --low: #60a5fa; --info: #9aa7b6; --pass: #4ade80;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
img, svg { max-width: 100%; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.logo { font-weight: 700; color: var(--brand); text-decoration: none; letter-spacing: .2px; }
.logo small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
nav.site a { color: var(--ink); text-decoration: none; margin-left: 16px; font-size: 15px; }
nav.site a:hover { color: var(--accent); }

.hero { padding: 36px 0 12px; }
.hero h1 { font-size: clamp(26px, 4.5vw, 38px); line-height: 1.15; margin: 0 0 10px; color: var(--brand); }
.hero p { font-size: 18px; color: var(--muted); max-width: 70ch; margin: 0 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 16px 0; }
.card h2 { margin: 0 0 10px; font-size: 21px; }
.card h3 { margin: 16px 0 6px; font-size: 17px; }
.lede { font-size: 17px; }
.muted { color: var(--muted); font-size: 14px; }
.privacy { border-left: 4px solid var(--accent); }
.privacy strong { color: var(--accent); }

.steps { padding-left: 20px; }
.steps li { margin: 6px 0; }

.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 28px 16px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; background: var(--bg); }
.dropzone.over, .dropzone:hover { border-color: var(--accent); }
.dropzone small { color: var(--muted); }
.file-status { font-size: 14px; color: var(--muted); margin: 8px 0 0; }

.q-section { border: 0; padding: 0; margin: 18px 0 6px; }
.q-section legend { font-weight: 700; font-size: 17px; color: var(--brand); padding: 0; margin-bottom: 4px; }
.q { padding: 12px 0; border-bottom: 1px solid var(--line); }
.q:last-child { border-bottom: 0; }
.q-text { display: block; font-weight: 600; margin-bottom: 4px; }
.q-help { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.q.missing .q-text { color: var(--high); }
.q.missing select, .q.missing input { border-color: var(--high); }
select, input[type=text], input[type=email], input[type=number], textarea {
  width: 100%; max-width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
select:focus, input:focus, textarea:focus, .btn:focus-visible, .dropzone:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
.q-multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 6px 0; }
.chk input { margin-top: 4px; width: 18px; height: 18px; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .6; cursor: wait; }
.actions { margin: 16px 0; display: flex; gap: 10px; flex-wrap: wrap; }

.score { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: center; }
@media (max-width: 620px) { .score { grid-template-columns: 1fr; } }
.dial { display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 50%; border: 10px solid var(--line); text-align: center; max-width: 170px; }
.dial .big { font-size: 34px; font-weight: 800; line-height: 1; }
.dial .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; padding: 0 10px; }
.dial .gr { font-size: 13px; font-weight: 700; margin-top: 4px; }
.grade-A { border-color: var(--pass); } .grade-B { border-color: color-mix(in srgb, var(--pass) 60%, var(--med)); }
.grade-C { border-color: var(--med); } .grade-D { border-color: var(--high); } .grade-F { border-color: var(--crit); }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 0; }
.metrics div { background: var(--bg); border-radius: 8px; padding: 10px; }
.metrics dt { font-size: 13px; color: var(--muted); }
.metrics dd { margin: 2px 0 0; font-size: 20px; font-weight: 700; }
.metrics small { color: var(--muted); }

.findings { padding-left: 0; list-style: none; margin: 0; }
.finding { border-left: 4px solid var(--info); padding: 10px 12px; margin: 10px 0; background: var(--bg); border-radius: 0 8px 8px 0; }
.finding p { margin: 6px 0; }
.f-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.sev { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.sev-critical { border-color: var(--crit); } .sev-critical .sev { color: var(--crit); }
.sev-high { border-color: var(--high); } .sev-high .sev { color: var(--high); }
.sev-medium { border-color: var(--med); } .sev-medium .sev { color: var(--med); }
.sev-low { border-color: var(--low); } .sev-low .sev { color: var(--low); }
.sev-pass { border-color: var(--pass); } .sev-pass .sev { color: var(--pass); }
.fix { font-size: 15px; } .ref { font-size: 13px; color: var(--muted); }
/* Long URLs, SPF/DMARC records and UPNs must wrap instead of widening the page at 360px. */
.finding, .lede, .metrics dd, .phases td, .card p, .file-status { overflow-wrap: anywhere; }
.items { font-family: var(--mono); font-size: 13px; max-height: 260px; overflow: auto; }

.phases { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 15px; }
.phases th, .phases td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; text-align: left; }
.phases td ul { margin: 0; padding-left: 18px; }
.phases .num { text-align: right; white-space: nowrap; }
.phases tfoot td { font-weight: 700; }
@media (max-width: 620px) {
  .phases thead { display: none; }
  .phases tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .phases td { display: block; border: 0; padding: 4px 0; }
  .phases .num { text-align: left; }
}

.lead .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .lead .grid2 { grid-template-columns: 1fr; } }
.fld span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.hp { position: absolute; left: -9999px; }
.form-error { color: var(--crit); min-height: 1em; }
.cta { border-color: var(--accent); }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.error { border-color: var(--crit); }

.code-bar { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
pre.code { background: #0b1220; color: #dbe7f3; padding: 14px; border-radius: 8px; overflow: auto; font: 13px/1.5 var(--mono); max-height: 420px; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 14px 0 28px; }
.tool-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.tool-card:hover { border-color: var(--accent); }
.tool-card h3 { margin: 0; font-size: 17px; color: var(--brand); }
.tool-card p { margin: 0; color: var(--muted); font-size: 15px; }
.tag { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 99px; padding: 2px 10px; }

footer.site { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 0 32px; color: var(--muted); font-size: 14px; }

@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  header.site nav, .no-print, .lead, #input-section, .hero p.intro-extra, footer.site, .privacy, .actions { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  a.btn { display: none; }
}
