/* Ethica DMARC.
   Layout: a narrow left rail for navigation; the main column opens with a sentence that
   states the period's result, then the daily chart, then the domain ledger.
   Signature: the airmail edge along the top of every page, and domain names set in
   Archivo's widest cut. Everything else stays quiet. */
:root {
  --paper: #eef1f4;      /* cool airmail paper */
  --surface: #ffffff;
  --ink: #1d2b3a;
  --brand: #364f6b;      /* Ethica */
  --muted: #5d6b7b;
  --line: #d4dbe3;
  --pass: #2e7a58;
  --fail: #c8102e;       /* airmail red */
  --warn: #a8670f;
  --pass-soft: #e2f0e9;
  --fail-soft: #fbe5e8;
  --warn-soft: #f8ecd7;
  --empty: #c9d1da;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10171f; --surface: #17212b; --ink: #e2e9f0; --brand: #9cb7d6; --muted: #92a1b1;
    --line: #273443; --pass: #5bbf91; --fail: #ff6670; --warn: #e3a64f;
    --pass-soft: #163327; --fail-soft: #3b1a1f; --warn-soft: #3a2a12; --empty: #2c3947;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); font-variation-settings: "wdth" 100; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.wrap { overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2 { text-wrap: balance; margin: 0; }
h2 { font-size: 15px; font-weight: 650; }

/* The airmail edge: red and blue diagonals, the one decorative element in the app. */
.airmail {
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--fail) 0 14px, var(--surface) 14px 20px,
                                        var(--brand) 20px 34px, var(--surface) 34px 40px);
}

/* Shell */
.shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: calc(100vh - 6px); }
.rail { display: flex; flex-direction: column; gap: 2px; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.rail .mark { font-size: 17px; text-decoration: none; color: var(--ink); margin: 0 8px 22px; font-variation-settings: "wdth" 112; }
.mark b { color: var(--brand); font-weight: 800; }
.rail > a:not(.mark) { padding: 7px 8px; border-radius: var(--r); text-decoration: none; color: var(--ink); }
.rail > a:not(.mark):hover { background: var(--paper); }
.rail > a[aria-current="page"] { background: var(--paper); font-weight: 650; box-shadow: inset 3px 0 0 var(--brand); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 0 8px; font-size: 13px; }
.who { color: var(--muted); overflow-wrap: anywhere; }
.langs { display: flex; gap: 10px; }
.langs a { color: var(--muted); text-decoration: none; }
.langs a[aria-current="true"] { color: var(--ink); font-weight: 650; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-align: left; }
main { padding: 22px clamp(16px, 3vw, 40px) 60px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* Scope bar */
.scope { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.scope select, .scope button, .periods label {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px;
}
.scope button { background: var(--brand); color: var(--surface); border-color: var(--brand); cursor: pointer; }
.periods { display: flex; border: 0; padding: 0; margin: 0; }
.periods input { position: absolute; opacity: 0; }
.periods label { border-radius: 0; margin-left: -1px; cursor: pointer; }
.periods label:first-of-type { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.periods label:last-of-type { border-radius: 0 var(--r) var(--r) 0; }
.periods input:checked + label { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.periods input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Hero sentence */
.hero h1 { font-size: clamp(24px, 2.8vw, 34px); line-height: 1.2; font-weight: 600; max-width: 32ch; font-variation-settings: "wdth" 88; letter-spacing: -0.01em; }
.hero-sub { margin: 8px 0 0; font-size: 17px; max-width: 60ch; }
.hero-sub.good { color: var(--pass); }
.hero-sub.bad { color: var(--fail); font-weight: 600; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 18px 0 0; }
.facts div { display: flex; flex-direction: column-reverse; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.facts dd a { text-decoration: none; color: inherit; }
.facts dd.mono { font-size: 14px; font-weight: 400; padding-top: 6px; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.legend { margin: 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.key-pass { background: var(--pass); } .key-fail { background: var(--fail); }
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 22px; }
.page-title { font-size: 26px; font-weight: 650; font-variation-settings: "wdth" 112; }
.page-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 12px; }
.lede { margin: -10px 0 0; color: var(--muted); max-width: 70ch; }
.calm { margin: 0; color: var(--pass); }
.alert { margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--warn-soft); color: var(--ink); }

/* Charts */
.chart { width: 100%; height: 220px; display: block; }
.c-pass { fill: var(--pass); } .c-fail { fill: var(--fail); } .c-empty { fill: var(--empty); }
.c-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.c-text { fill: var(--muted); font: 11px var(--sans); }
.strip { width: 180px; height: 28px; display: block; }
.meter { vertical-align: middle; display: inline-block; }
.c-track { fill: var(--fail-soft); } .c-warn { fill: var(--warn); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rate span { margin-left: 6px; }
.empty { color: var(--muted); text-align: center; padding: 22px; }
.compact td { padding: 6px 10px; }
.row-bad td { background: var(--fail-soft); }
.row-note td { color: var(--muted); }
.host { max-width: 280px; overflow-wrap: anywhere; font-size: 13px; }
.count-bad { color: var(--fail); font-weight: 650; }

/* Domain names: the widest cut of Archivo, so the thing you own is the thing you see. */
.domain { font-variation-settings: "wdth" 125; font-weight: 650; font-size: 15px; color: var(--ink); text-decoration: none; letter-spacing: 0.005em; }
a.domain:hover { color: var(--brand); text-decoration: underline; }
.domain.small { font-size: 14px; }
h1.domain { font-size: clamp(26px, 3.2vw, 40px); font-weight: 700; }
.tenant { display: block; font-size: 12px; color: var(--muted); }
.policy { font-family: var(--mono); font-size: 12.5px; padding: 1px 6px; border-radius: 4px; background: var(--paper); }
.policy-none { background: var(--warn-soft); color: var(--warn); }
.policy-reject { background: var(--pass-soft); color: var(--pass); }

/* Verdict stamp: a double-ruled frame, like a postmark. */
.stamp { display: inline-block; padding: 2px 8px; border: 3px double currentColor; border-radius: 4px; font-weight: 700; font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.stamp-verified { color: var(--pass); }
.stamp-issues { color: var(--fail); }
.stamp-big { font-size: 18px; padding: 6px 14px; border-width: 4px; }
.report-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.report-head p { margin: 4px 0 0; }
.back { font-size: 14px; }

.res { font-family: var(--mono); font-size: 12.5px; }
.res-pass { color: var(--pass); }
.res-fail, .res-softfail, .res-permerror, .res-temperror { color: var(--fail); font-weight: 500; }
.res-none, .res-neutral { color: var(--warn); }

.attention { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.attention li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.attention li:last-child { border-bottom: 0; }
.attention a { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; text-decoration: none; }
.attention p { margin: 4px 0 0; font-size: 14px; }
.findings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.findings li { padding: 8px 12px; border-radius: var(--r); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.finding-issue { background: var(--fail-soft); }
.finding-note { background: var(--paper); }
.findings .detail { flex-basis: 100%; font-size: 13px; }

.tabs { display: flex; gap: 4px; }
.tabs a { padding: 6px 12px; border-radius: var(--r); text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.tabs a[aria-current="page"] { background: var(--surface); border-color: var(--line); font-weight: 650; }

/* Login */
.login { min-height: calc(100vh - 6px); display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 30px 28px; display: flex; flex-direction: column; gap: 16px; }
.login-logo img { width: 170px; height: auto; display: block; }
.login h1 { font-size: 22px; font-variation-settings: "wdth" 118; font-weight: 750; }
.login h1 span { color: var(--muted); font-weight: 500; font-variation-settings: "wdth" 100; }
.btn { display: inline-block; text-align: center; font: inherit; font-weight: 600; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.btn-primary:hover { color: var(--surface); filter: brightness(1.08); }
.breakglass summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.breakglass[open] summary { color: var(--ink); font-weight: 600; }
.breakglass form { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.breakglass .hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.breakglass input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); color: var(--ink); }
.breakglass label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.breakglass .btn { margin-top: 10px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .rail .mark { margin: 0 12px 0 0; }
  .rail-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: 12px; }
  .split { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Who sent it: the answer to "was this my mail?" */
.about { margin: 0; color: var(--muted); max-width: 75ch; font-size: 14px; }
.hero .about { margin-bottom: 10px; }
.kind { display: inline-block; font-size: 12px; font-weight: 650; padding: 1px 7px; border-radius: 999px; white-space: nowrap; margin-right: 4px; }
.kind-own { background: var(--pass-soft); color: var(--pass); }
.kind-service { background: var(--paper); color: var(--brand); border: 1px solid var(--line); }
.kind-relay { background: var(--warn-soft); color: var(--warn); }
.kind-unknown { background: var(--fail-soft); color: var(--fail); }
.relay { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.plain { gap: 10px; border-left: 4px solid var(--warn); }
.plain p { margin: 0; max-width: 90ch; }
.attention p { line-height: 1.45; }

/* Admin forms */
.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.row-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.row-form input, .row-form select, form.inline input, form.inline select {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: 6px 9px; }
.row-form input.short { width: 80px; }
form.inline { display: inline-flex; gap: 8px; align-items: center; }
form.inline input { width: 16ch; }
.hint { margin: 0; font-size: 13px; color: var(--muted); max-width: 80ch; }
.danger { color: var(--fail); }
code.copy { user-select: all; font-size: 12px; overflow-wrap: anywhere; }
.flash { margin: 0; padding: 9px 12px; border-radius: var(--r); background: var(--pass-soft); color: var(--ink); }
.flash-error { background: var(--fail-soft); }

.sent-mails { list-style: none; margin: 6px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
