/* Email Security Analyzer, RequestScope visual language
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #0b0b16;
  --surface: #111122;
  --surface-2: #191831;
  --panel: rgba(10, 22, 19, .72);
  --line: rgba(205, 198, 255, .15);
  --line-bright: rgba(205, 198, 255, .3);
  --text: #f4f1ff;
  --muted: #aaa6bd;
  --accent: #ad9bff;
  --accent-2: #d5ccff;
  --warning: #ffc65c;
  --critical: #ff6f7d;
  --info: #7ebcff;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { transform: none; }
.hidden { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Grid background */
.grid-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  z-index: -1;
}

/* Layout containers */
.site-header, main, footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

/* Site header */
.site-header {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.site-header nav { display: flex; align-items: center; gap: 28px; }

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.04em;
  font-size: 20px;
}
.brand > span:last-child span { color: var(--accent); }
.brand-mark {
  width: 26px; height: 26px;
  display: grid;
  align-content: center;
  color: var(--accent);
}
.brand-mark svg { width: 100%; height: 100%; }

.text-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  padding: 6px;
  color: var(--muted);
  cursor: pointer;
}
.text-button:hover { color: var(--text); }
.status-link {
  display: flex; min-height: 44px; align-items: center; gap: 8px;
  color: var(--muted); text-decoration: none; font-size: 13px;
}
.status-link span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

/* Hero */
.hero { padding: 116px 0 48px; position: relative; }

h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(48px, 7vw, 92px);
  line-height: .91;
  letter-spacing: -.072em;
  font-weight: 700;
}
h1 em { color: var(--accent); font-style: normal; font-weight: 500; }

.hero-copy {
  max-width: 670px;
  margin: 38px 0 48px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

/* Capability strip */
.capability-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 0 32px;
  background: var(--line);
  border: 1px solid var(--line);
}
.capability { padding: 16px 20px; background: var(--surface); }
.capability strong { display: block; font-size: 13px; margin-bottom: 2px; }
.capability span { display: block; color: var(--muted); font-size: 12px; }

/* Tool navigation tabs */
.tool-nav {
  display: flex;
  gap: 4px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin: 0 0 24px;
  overflow-x: auto;
}
.tool-tab {
  flex: 1;
  min-width: max-content;
  min-height: 44px;
  padding: 11px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tool-tab:hover { color: var(--text); background: var(--surface-2); }
.tool-tab.active {
  background: var(--accent);
  color: #06110d;
}

/* Tool panels */
.tool-panel { display: none; }
.tool-panel.active { display: block; }

/* Trace form (main input) */
.trace-form { max-width: 900px; }
.trace-form > label {
  display: block;
  margin-bottom: 10px;
  font: 500 12px/1 var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.input-shell {
  height: 70px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  border: 1px solid var(--line-bright);
  background: rgba(10, 25, 21, .88);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .22);
}
.input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(173, 155, 255, .09);
}
.protocol {
  margin-left: 20px;
  padding: 7px 9px;
  background: rgba(173, 155, 255, .1);
  color: var(--accent);
  font: 500 11px/1 var(--mono);
}
.input-shell input {
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0 18px;
  font: 400 17px/1 var(--mono);
}
.input-shell input::placeholder { color: #7d9489; }
.input-shell button {
  align-self: stretch;
  min-width: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  border: 0;
  background: var(--accent);
  color: #06110d;
  font-weight: 800;
  cursor: pointer;
}
.input-shell button:hover { background: var(--accent-2); }
.input-shell button:disabled { opacity: .55; cursor: wait; }
.input-shell svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.form-meta {
  display: flex; flex-wrap: wrap; gap: 18px;
  margin-top: 13px;
  color: #8aa398;
  font: 400 12px/1.5 var(--mono);
}
.form-meta span::before { content: "·"; color: var(--accent); margin-right: 8px; }
.form-meta .over-limit { color: var(--warning); }

/* Loading */
.loading-panel {
  margin: 40px 0;
  padding: 40px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--surface);
}
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-panel p { display: inline; color: var(--muted); font-size: 14px; }

/* Error panel */
.error-panel {
  display: flex;
  gap: 20px;
  align-items: start;
  margin: 20px 0;
  padding: 30px;
  border: 1px solid rgba(255, 111, 125, .35);
  background: var(--surface);
}
.error-code { color: var(--critical); font: 500 11px/1 var(--mono); }
.error-panel h2 { margin: 0 0 8px; font-size: 20px; }
.error-panel p { color: var(--muted); margin: 0; }

/* Report */
.report { padding: 48px 0 60px; }
.report-header {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 34px;
}
.report-header h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: -.05em;
  /* Stored domains can exceed any width budget; without a break rule a long
     domain clips silently at mobile widths under the page overflow clip. */
  overflow-wrap: anywhere;
}
.report-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Metrics row */
.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
  border-width: 0 0 1px 1px;
  margin-bottom: 48px;
}
.metric { padding: 24px; border-right: 1px solid var(--line); }
.metric small {
  display: block;
  color: var(--muted);
  font: 500 10px/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.metric strong {
  display: block;
  margin-top: 10px;
  font: 500 26px/1 var(--mono);
}
.metric strong.good { color: var(--accent); }
.metric strong.warn { color: var(--warning); }
.metric strong.poor { color: var(--critical); }
.metric strong.info { color: var(--info); }

/* Section heading */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-heading > div { display: flex; align-items: center; gap: 14px; }
.section-number {
  color: var(--accent);
  font: 500 10px/1 var(--mono);
  padding: 4px 7px;
  border: 1px solid var(--line-bright);
  border-radius: 3px;
}
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

/* Evidence badge */
.evidence-badge {
  padding: 6px 8px;
  border: 1px solid var(--line);
  color: #8fa99d;
  font: 500 10px/1 var(--mono);
  letter-spacing: .1em;
}

/* Buttons */
.secondary-button, .icon-button {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--line-bright);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.secondary-button:hover, .icon-button:hover {
  border-color: var(--accent);
  color: var(--text);
}
.secondary-button:focus-visible, .icon-button:focus-visible, .primary-button:focus-visible,
.text-button:focus-visible, .tool-tab:focus-visible, .builder-tab:focus-visible,
.copy-btn:focus-visible, .sort-button:focus-visible, .batch-domain-button:focus-visible,
summary:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.icon-button { width: 44px; padding: 0; color: var(--accent); font-size: 22px; }

.primary-button {
  min-height: 46px;
  padding: 0 24px;
  border: 0;
  background: var(--accent);
  color: #06110d;
  font-weight: 800;
  cursor: pointer;
  font-size: 14px;
}
.primary-button:hover { background: var(--accent-2); }
.primary-button:disabled { opacity: .55; cursor: wait; }

/* Panels */
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 20px;
}
.panel-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.panel-header > div { display: flex; align-items: center; gap: 14px; }
.panel-header h3 { margin: 0; font-size: 16px; }

/* Collapsible sections (results accordion) */
.results-accordion { display: flex; flex-direction: column; gap: 12px; }
.collapsible-section {
  border: 1px solid var(--line);
  background: var(--panel);
}
.collapsible-section > summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  font: 500 14px/1 var(--sans);
  color: var(--text);
  list-style: none;
}
.collapsible-section > summary::-webkit-details-marker { display: none; }
.collapsible-section > summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 11px;
  transition: transform .2s;
}
.collapsible-section[open] > summary::before { transform: rotate(90deg); }
.collapsible-section > summary:hover { background: rgba(173, 155, 255, .03); }

.cs-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px; height: 28px;
  padding: 0 7px;
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  font: 500 10px/1 var(--mono);
  color: var(--accent);
}
.cs-title { flex: 1; }
.cs-count {
  margin-left: auto;
  padding: 4px 10px;
  font: 500 10px/1 var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cs-count.pass { color: var(--accent); border-color: rgba(173, 155, 255, .3); }
.cs-count.warn { color: var(--warning); border-color: rgba(255, 198, 92, .3); }
.cs-count.fail { color: var(--critical); border-color: rgba(255, 111, 125, .3); }
.cs-count.info { color: var(--info); border-color: rgba(126, 188, 255, .3); }

.cs-body { padding: 0 20px 20px; }

/* Record box (DNS records) */
.record-box {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 16px;
  margin: 16px 0;
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  color: var(--muted);
}
.record-box strong {
  color: var(--text);
  display: block;
  margin-bottom: 8px;
}

/* Check items (findings) */
.check-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.check-item:last-child { border-bottom: none; }
/* Status is encoded twice on purpose: the colored badge AND its glyph, so
   deutan/protan users and forced-colors mode can tell pass from fail
   (WCAG 1.4.1). Same pattern the batch table uses with Pass/Fail text. */
.check-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  margin-top: 0;
  flex-shrink: 0;
  background: var(--info);
  color: #06110d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 11px/1 var(--mono);
}
.check-item.pass .check-dot { background: var(--accent); }
.check-item.warn .check-dot { background: var(--warning); }
.check-item.fail .check-dot { background: var(--critical); }
.check-item.pass .check-dot::before { content: "✓"; }
.check-item.warn .check-dot::before { content: "!"; }
.check-item.fail .check-dot::before { content: "✕"; }
.check-item.info .check-dot::before { content: "i"; }
.check-content { flex: 1; }
.check-title { font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.check-detail { color: var(--muted); font-size: 13px; line-height: 1.55; margin-bottom: 8px; }
.check-recommendation {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.check-recommendation strong {
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* MX table */
.mx-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.mx-table th, .mx-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.mx-table th {
  color: var(--muted);
  font: 500 10px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.mx-table tr:last-child td { border-bottom: none; }
.mx-table td code { color: var(--text); font: 400 13px/1 var(--mono); }

/* Inspector summary */
.inspector-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--line);
}
.inspector-summary .metric { border-right: 1px solid var(--line); }
.inspector-summary .metric:last-child { border-right: 0; }

/* Output card */
.output-card {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 16px;
  margin-top: 16px;
}
.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.output-head strong { font-size: 14px; }
.copy-btn {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line-bright);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn:disabled { opacity: .5; cursor: not-allowed; }

.dns-value {
  font: 13px/1.6 var(--mono);
  color: var(--text);
  word-break: break-all;
  white-space: pre-wrap;
}

/* Notices */
.notice {
  padding: 13px 15px;
  border: 1px solid rgba(255, 198, 92, .35);
  background: rgba(255, 198, 92, .06);
  font-size: 13px;
  line-height: 1.6;
  color: #d7ca91;
  margin: 14px 0;
}
.notice.good {
  border-color: rgba(173, 155, 255, .35);
  background: rgba(173, 155, 255, .06);
  color: #a7d9b8;
}
/* A determinate-but-unjudged state (validation outage, record absence):
   informational, deliberately not the warning amber or error red. */
.notice.info {
  border-color: rgba(126, 188, 255, .35);
  background: rgba(126, 188, 255, .06);
  color: #b8d4f2;
}
.notice strong { display: block; margin-bottom: 3px; }

.noscript-note {
  margin: 20px 0 0;
  padding: 13px 15px;
  border: 1px solid rgba(255, 198, 92, .35);
  background: rgba(255, 198, 92, .06);
  color: #d7ca91;
  font-size: 13px;
  line-height: 1.6;
}

.share-note {
  margin: 14px 0 20px;
  padding: 12px 14px;
  border: 1px solid rgba(126, 188, 255, .3);
  background: rgba(126, 188, 255, .05);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.share-note:empty { display: none; }
.share-note.warning {
  border-color: rgba(255, 198, 92, .35);
  background: rgba(255, 198, 92, .06);
  color: #d7ca91;
}

.field-help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.output-host { margin-bottom: 6px; }
.cs-body-intro { padding-top: 20px; }
.muted { color: var(--muted); }

/* Source group (SPF expanded sources) */
.source-group {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.source-group:last-child { border-bottom: 0; }
.source-group code {
  display: block;
  color: var(--accent);
  font: 500 12px/1 var(--mono);
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}
.source-group span {
  font: 12px/1.5 var(--mono);
  color: var(--muted);
  word-break: break-all;
}

/* Builder tabs */
.builder-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.builder-tab {
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.builder-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(173, 155, 255, .08);
}
.builder-pane { display: none; }
.builder-pane.active { display: block; }

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  /* 16px is iOS Safari's focus-zoom threshold: anything smaller zooms the
     viewport on focus and stays zoomed until pinch-restored. */
  font-size: 16px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
}
.field input::placeholder { color: #7d9489; }

/* The provider picker is a fieldset so screen readers announce the six
   checkboxes as one named group; visually it must stay invisible. */
.provider-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.provider-fieldset legend {
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.provider-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 14px;
  cursor: pointer;
}
.provider-option input { width: auto; }
.provider-option:hover { border-color: var(--line-bright); }

/* SPF change / empty -all confirmation */
.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  cursor: pointer;
}
.auth-checkbox:hover { border-color: var(--line-bright); }
.auth-checkbox input { width: auto; flex-shrink: 0; margin-top: 3px; accent-color: var(--accent); }
.deps-toggle-text strong { display: block; font-size: 13px; }
.deps-toggle-text small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Validation result */
.validation-result { margin-top: 12px; }

/* Header input */
.header-input {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  padding: 16px 20px;
  /* iOS focus-zoom threshold; see .field input. */
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  outline: none;
  font-family: var(--mono);
}
.header-input:focus { border-color: var(--accent); }

.privacy-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin: 12px 0 0;
}
.privacy-note strong { color: var(--text); }

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Trust banner (header analysis) */
.trust-banner {
  padding: 16px 18px;
  border: 1px solid var(--line);
  margin: 20px 0;
  background: var(--bg);
}
.trust-banner.pass { border-color: rgba(173, 155, 255, .35); }
.trust-banner.warn { border-color: rgba(255, 198, 92, .35); }
.trust-banner.fail { border-color: rgba(255, 111, 125, .4); }
.trust-banner.info { border-color: rgba(126, 188, 255, .35); }
.trust-banner strong { display: block; margin-bottom: 3px; }
.trust-banner span { color: var(--muted); font-size: 13px; line-height: 1.55; }

/* Summary tiles */
.header-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 20px 0;
  border: 1px solid var(--line);
}
.header-summary .metric { border-right: 1px solid var(--line); }
.header-summary .metric:last-child { border-right: 0; }

/* Hop list */
.hop-list { display: grid; gap: 10px; margin-top: 12px; }
.hop-chain-note { padding-top: 16px; }
.hop-addresses { margin-top: 9px; }
.hop-raw { margin-top: 9px; }
.hop-raw-value { margin-top: 6px; word-break: break-word; }
.hop-item {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 14px;
}
.hop-item strong { font-size: 13px; }
.hop-route {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 7px 0;
}
.hop-route code { color: var(--text); }
.hop-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.hop-tls { font: 500 11px/1.4 var(--mono); color: var(--muted); }
.hop-tls.cleartext { color: var(--critical); }
/* Unbreakable mono tokens: with overflow-x clipped at the body, a long
   hostname or message-ID silently vanished off-screen on narrow phones. */
.hop-route code,
.hop-meta span,
.mx-table td code { overflow-wrap: anywhere; }

/* Principles section */
.principles { padding: 90px 0 110px; border-top: 1px solid var(--line); }
.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.principle-grid article { min-height: 200px; padding: 32px; background: var(--bg); }
.principle-grid article > span { color: var(--accent); font: 500 10px/1 var(--mono); }
.principle-grid h3 { margin: 34px 0 12px; font-size: 17px; }
.principle-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.developer-access { display: grid; grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr); gap: 54px; padding: 70px 0 90px; border-top: 1px solid var(--line); }
.developer-access h2 { margin: 14px 0 14px; font-size: clamp(26px, 3vw, 40px); letter-spacing: -.04em; }
.developer-access p { margin: 0; color: var(--muted); line-height: 1.7; }
.developer-access .developer-note { margin-top: 18px; font: 500 11px/1.6 var(--mono); color: var(--accent); }
.developer-links { display: grid; gap: 10px; }
.developer-links > a, .developer-endpoint { display: grid; gap: 7px; padding: 18px 20px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; }
.developer-links > a { transition: border-color .2s, transform .2s; }
.developer-links > a:hover { border-color: var(--accent); transform: translateX(3px); }
.developer-links span, .developer-endpoint code { color: var(--muted); font: 500 11px/1.5 var(--mono); overflow-wrap: anywhere; }
@media (max-width: 760px) { .developer-access { grid-template-columns: 1fr; gap: 30px; padding: 56px 0 70px; } }

/* Footer */
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 100px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.brand.small { font-size: 15px; color: var(--text); }
.brand.small .brand-mark { transform: scale(.72); transform-origin: left; width: 20px; }

/* Dialog */
dialog {
  width: min(680px, calc(100% - 32px));
  padding: 38px;
  border: 1px solid var(--line-bright);
  background: #0a1613;
  color: var(--text);
  box-shadow: 0 40px 140px #000;
}
dialog::backdrop { background: rgba(1, 8, 6, .82); backdrop-filter: blur(8px); }
/* Focus is moved to the title on open so screen readers announce the
   dialog's purpose first; the -1 target itself needs no visible ring. */
dialog h2:focus { outline: none; }
dialog h2 { margin: 0 0 30px; font-size: 32px; letter-spacing: -.04em; }
.dialog-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
  cursor: pointer;
}
.method-list article {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.method-list article > span { color: var(--accent); font: 500 10px/1.5 var(--mono); }
.method-list h3 { margin: 0 0 6px; font-size: 14px; }
.method-list p, .dialog-footnote { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.dialog-footnote { margin-top: 24px; padding: 16px; background: var(--surface-2); }

/* Batch check */
.batch-input-shell {
  border: 1px solid var(--line-bright);
  background: rgba(10, 25, 21, .88);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .22);
}
.batch-input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(173, 155, 255, .09);
}
#batch-input {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 16px 20px;
  /* iOS focus-zoom threshold; see .field input. */
  font-size: 16px;
  line-height: 1.6;
  background: transparent;
  border: 0;
  color: var(--text);
  outline: none;
  font-family: var(--mono);
}
#batch-input::placeholder { color: #7d9489; }

.batch-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.batch-table th {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line-bright);
  color: var(--muted);
  font: 500 10px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.batch-table th:hover { color: var(--text); }
.sort-button {
  /* Expand the hit area to the full header cell while keeping the visual
     layout unchanged so the target meets the 44px touch guidance. */
  padding: 14px 16px;
  margin: -14px -16px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.batch-table th.sort-asc::after { content: " \25B2"; color: var(--accent); font-size: 8px; }
.batch-table th.sort-desc::after { content: " \25BC"; color: var(--accent); font-size: 8px; }
.batch-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.batch-table tbody tr { transition: background .12s; }
.batch-table tbody tr:hover { background: rgba(173, 155, 255, .04); }
.batch-table tbody tr:last-child td { border-bottom: none; }
.batch-table td.domain-cell { font-family: var(--mono); color: var(--text); }
.batch-domain-button {
  /* Negative margins keep the row's visual layout while the padding gives
     the link-sized button a hit area that meets the 24px minimum. */
  padding: 10px 12px;
  margin: -10px -12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--line-bright);
  text-underline-offset: 3px;
}
.batch-table td.score-cell { font: 500 16px/1 var(--mono); }
/* Row-level explanations (why a row reads "error" or "unavailable") live in
   visible text; title-only explanations are unreachable by keyboard, touch,
   and most screen readers. */
.batch-table .cell-note {
  display: block;
  max-width: 220px;
  margin-top: 4px;
  font: 400 11px/1.45 var(--sans);
  color: var(--muted);
  white-space: normal;
}
.score-cell strong.good { color: var(--accent); }
.score-cell strong.warn { color: var(--warning); }
.score-cell strong.poor { color: var(--critical); }
.batch-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 11px/1 var(--mono);
}
.batch-status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.batch-status.pass { color: var(--accent); }
.batch-status.pass::before { background: var(--accent); }
.batch-status.warn { color: var(--warning); }
.batch-status.warn::before { background: var(--warning); }
.batch-status.fail { color: var(--critical); }
.batch-status.fail::before { background: var(--critical); }
.batch-status.info { color: var(--info); }
.batch-status.info::before { background: var(--info); }

/* Responsive */
@media (max-width: 850px) {
  .hero { padding-top: 80px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:last-child { grid-column: span 2; }
  .header-summary { grid-template-columns: 1fr; }
  .inspector-summary { grid-template-columns: 1fr; }
  .report-header { align-items: start; flex-direction: column; }
  .principle-grid { grid-template-columns: 1fr; }
  .principle-grid article { min-height: 0; padding: 24px 22px; }
  .principle-grid h3 { margin-top: 18px; }
  .capability-strip { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .site-header nav .text-button { display: none; }
  .hero { padding: 62px 0 36px; }
  h1 { font-size: clamp(40px, 14vw, 64px); }
  .input-shell { height: auto; grid-template-columns: auto 1fr; }
  .input-shell { height: auto; grid-template-columns: auto 1fr; }
  /* 17px matches the desktop rule: below iOS Safari's 16px focus threshold
     the viewport zooms on tap and stays zoomed until pinch-restored. */
  .input-shell input { height: 60px; padding-right: 12px; font-size: 17px; }
  .input-shell button { grid-column: 1 / -1; min-height: 54px; }
  .tool-nav { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .tool-tab { min-width: 0; min-height: 48px; font-size: 12px; }
  .report-actions { width: 100%; flex-wrap: wrap; }
  .secondary-button { flex: 1; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 18px; }
  .section-heading { align-items: start; }
  .section-heading .evidence-badge { display: none; }
  .form-grid, .provider-grid { grid-template-columns: 1fr; }
  .header-actions .primary-button,
  .header-actions .secondary-button { flex: 1; padding: 14px 12px; }
  .panel { padding: 0; }
  .collapsible-section > summary { padding: 14px 16px; }
  .cs-body { padding: 0 16px 16px; }
  footer { padding: 24px 0; align-items: start; flex-direction: column; }
  .batch-table { font-size: 12px; }
  .batch-table th, .batch-table td { padding: 10px 10px; }
  /* The sort button's negative margins must track the cell padding: at the
     desktop -14/-16 values against 10px cells the hit areas of neighboring
     columns overlapped by ~12px and boundary taps sorted the wrong column. */
  .sort-button { padding: 10px 10px; margin: -10px -10px; }
  #batch-input { min-height: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
@media print {
  /* The product is dark-on-light inverted; browsers strip backgrounds when
     printing, which used to leave white text on white paper. Force a light
     scheme and remove screen-only chrome so reports survive Ctrl+P/PDF.
     Surface tokens remap too: recommendation blocks sit on --surface-2 and
     capability cards on --surface, which stayed near-black and printed
     #111 text at ~1:1 contrast with "Background graphics" enabled. */
  :root {
    --bg: #fff;
    --text: #111;
    --muted: #444;
    --line: #bbb;
    --surface: #fff;
    --surface-2: #fff;
  }
  body {
    background: #fff !important;
    color: #111 !important;
  }
  .site-header, .tool-nav, footer, form, .form-grid,
  .header-actions, .report-actions, .skip-link, .grid-field,
  .noscript-note, .developer-access, .error-panel, .loading-panel,
  .notice, .privacy-note { display: none !important; }
  .panel, .collapsible-section, .metric,
  .check-item, .hop-item {
    background: #fff !important;
    color: #111 !important;
    border-color: #bbb !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  h1, h2, h3, .cs-title, .check-title, strong, small, code, p, span, div {
    color: #111 !important;
  }
  .metric small, .muted, .cs-count, .check-detail { color: #444 !important; }
  details > summary { list-style: none; }
  .batch-table-wrap { overflow-x: visible !important; }
}

/* Keep the task and its result ahead of introductory material. */
@media screen {
  .hero { padding-top: 48px; padding-bottom: 28px; }
  .hero h1 { font-size: clamp(36px, 5vw, 64px); }
  .hero-copy { max-width: 64ch; margin-bottom: 24px; }
  body:has(.report:not(.hidden)) .hero h1 { font-size: 28px; }
  body:has(.report:not(.hidden)) .hero-copy,
  body:has(.report:not(.hidden)) .hero-route,
  body:has(.report:not(.hidden)) .principles,
  body:has(.report:not(.hidden)) .developer-access,
  body:has(.report:not(.hidden)) .capability-strip { display: none; }
  .site-header nav > a.text-button { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
  body:has(.report:not(.hidden)) .site-header .status-link { display: none; }
  body:has(.report:not(.hidden)) .tool-nav { margin-top: 20px; }
}
@media screen and (max-width: 620px) {
  .hero { padding-top: 28px; padding-bottom: 20px; }
  .hero h1 { font-size: 36px; }
  .hero-copy { font-size: 15px; line-height: 1.5; }
  .capability-strip, .site-header .status-link { display: none; }
  .site-header nav { gap: 12px; }
}

.report-actions { display:flex; flex-wrap:wrap; align-items:flex-start; gap:8px; margin:20px 0 8px; }
.report-actions button, .export-menu summary { min-height:44px; }
.export-menu { position:relative; }
.export-menu summary { display:list-item; cursor:pointer; padding:12px 16px; border:1px solid var(--line); border-radius:4px; font-size:14px; }
.export-options { display:flex; flex-direction:column; gap:6px; padding:8px 0; }
.report-observation { margin:12px 0; font-size:14px; }
.report-observation summary { cursor:pointer; padding:12px 0; min-height:44px; }
.report-share-note { color:var(--muted); font-size:14px; line-height:1.6; }
body:has(.report:not(.hidden)) .hero { padding-top:16px; padding-bottom:16px; }
body:has(.report:not(.hidden)) .hero h1 { font-size:24px; margin-bottom:0; }
@media(max-width:600px) {
  .report-actions .secondary-button { flex:0 1 auto; width:auto; min-width:0; font-size:13px; }
}

.tool-nav { display:flex; flex-wrap:nowrap; overflow-x:auto; gap:4px; scrollbar-width:thin; }
.tool-nav .tool-tab { flex:0 0 auto; min-height:44px; white-space:nowrap; padding:10px 12px; }
#tab-spf { margin-left:12px; border-left:1px solid var(--line); }
body[data-email-tool]:not([data-email-tool="domain"]) .hero-copy { display:none; }
body:has(#panel-domain.active #domain-report:not(.hidden)) #check-form,
body:has(#panel-domain.active #domain-report:not(.hidden)) #home h1 { display:none; }
#domain-freshness { padding:0; border:0; background:none; font-size:13px; }
#domain-metrics { margin-top:16px; }
#domain-next-steps { margin-bottom:20px; }

.principles, .developer-access { display:block; padding:16px 0; margin-top:20px; }
.supporting-details > summary { min-height:44px; padding:12px 0; cursor:pointer; font-weight:600; }
.supporting-details[open] > summary { margin-bottom:20px; }
.supporting-details .developer-links { margin-top:20px; }
@media print { .export-menu, .report-actions, .report-share-note { display:none; } }
