/* The Email Header Analyzer's frame. emailtooltester.com's own look: DM Sans where the
   reader has it, ink #1A1C22, sand #FAF7F1, orange #EA663B, pill buttons. Inside the
   WordPress page it stays light like the page (html.framed); opened on its own it follows
   the reader's light or dark setting. */
:root {
  --paper: #ffffff;
  --sand: #faf7f1;
  --ink: #1a1c22;
  --muted: #5c6373;
  --line: #e2e0da;
  --accent: #ea663b;
  --sky: #2f8fd0;
  --sky-soft: #e3f2fc;
  --pass: #17734a;
  --pass-soft: #e2f4ea;
  --warn: #8a5a00;
  --warn-soft: #fdf1cc;
  --fail: #b42318;
  --fail-soft: #fde7e4;
  --code-bg: #f3f1ec;
  --mark: #ffe08a;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --r-card: 14px;
  --r-pill: 999px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  html:not(.framed) {
    --paper: #131418; --sand: #1c1d22; --ink: #ecedef; --muted: #a3a8b4; --line: #2e3038;
    --accent: #f2845e; --sky: #6cbcf0; --sky-soft: #172a38;
    --pass: #5fd39a; --pass-soft: #15291f; --warn: #f2c14e; --warn-soft: #2e2512;
    --fail: #f2877c; --fail-soft: #33191a; --code-bg: #202127; --mark: #6b5212;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* Author display rules (.btn, .result) would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-sans); font-size: 17px; line-height: 1.55; }
.wrap { max-width: 760px; margin: 0 auto; padding-inline: 16px; padding-block: 16px 32px; display: grid; gap: 24px; }
html.framed .wrap { padding-block: 4px 16px; }
h2 { font-size: 1.3rem; line-height: 1.25; margin: 0; font-weight: 700; text-wrap: balance; }
h3 { font-size: 1rem; margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* Input */
.input { display: grid; gap: 10px; }
.input label { font-weight: 500; }
textarea { width: 100%; min-height: 9.5em; resize: vertical; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.5; color: var(--ink); background: var(--code-bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { font: inherit; font-weight: 500; font-size: 0.95rem; border-radius: var(--r-pill); padding: 9px 20px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.privacy { display: flex; gap: 8px; align-items: center; font-size: 0.9rem; color: var(--muted); }
.privacy svg { flex: none; }
.status { font-size: 0.95rem; color: var(--muted); min-height: 1px; }
.status.error { color: var(--fail); }

/* Result */
.result { display: grid; gap: 28px; }
.section { display: grid; gap: 14px; }
.section-head { display: grid; gap: 4px; }

.verdict { background: var(--sand); border-radius: var(--r-card); padding: 22px; display: grid; gap: 16px; }
.who { display: flex; gap: 16px; align-items: center; }
.logo { flex: none; width: 56px; height: 56px; border-radius: 14px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 700; font-size: 1.5rem; }
.who-text { display: grid; gap: 2px; min-width: 0; }
.platform { font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.via { font-size: 1rem; color: var(--muted); }
.meta { font-size: 0.92rem; color: var(--muted); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; font-weight: 500; padding: 5px 12px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.pass { background: var(--pass); } .dot.warn { background: var(--warn); } .dot.fail { background: var(--fail); } .dot.info { background: var(--sky); }
.evidence { display: grid; gap: 8px; }
.hline { font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.5; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; overflow-x: auto; white-space: pre; }
.hline .hn { color: var(--muted); }
/* The evidence excerpt wraps: it is cut to fit around its match, so nothing needs scrolling. */
.hline.excerpt { white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: visible; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }

.answer { font-size: 1.05rem; }
.checks { display: grid; border-top: 1px solid var(--line); }
.check { display: grid; grid-template-columns: 7.5rem 1fr; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.check-name { display: grid; gap: 6px; align-content: start; }
.check > div:last-child { min-width: 0; display: grid; gap: 4px; }
.pill { justify-self: start; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; padding: 2px 10px; border-radius: var(--r-pill); }
.pill.pass { color: var(--pass); background: var(--pass-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.fail { color: var(--fail); background: var(--fail-soft); }
.pill.none { color: var(--muted); background: var(--code-bg); }
.tech { font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }
.note { background: var(--sky-soft); border-radius: var(--r-card); padding: 16px 18px; display: grid; gap: 6px; }

.bar { display: flex; height: 18px; border-radius: var(--r-pill); overflow: hidden; background: var(--code-bg); }
.seg { height: 100%; min-width: 6px; }
.seg + .seg { border-left: 2px solid var(--paper); }
.seg.s0 { background: var(--sky); }
.seg.s1 { background: var(--accent); }
.seg.s2 { background: var(--pass); }
.seg.s3 { background: var(--warn); }
.seg.s4 { background: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.hops { list-style: none; margin: 0; padding: 0; display: grid; }
.hop { display: grid; grid-template-columns: 4.8rem 1fr auto; gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.hop time { font-variant-numeric: tabular-nums; font-weight: 500; }
.hop .what { min-width: 0; overflow-wrap: anywhere; }
.hop .what small { display: block; color: var(--muted); font-size: 0.84rem; }
.hop .wait { font-variant-numeric: tabular-nums; font-size: 0.9rem; color: var(--muted); text-align: right; white-space: nowrap; }
.hop .wait.long { color: var(--accent); font-weight: 700; }
.total { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 500; }

.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rule { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.rule > div { min-width: 0; }
.ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; }
.ic.pass { color: var(--pass); background: var(--pass-soft); }
.ic.fail { color: var(--fail); background: var(--fail-soft); }
.ic.unk { color: var(--muted); background: var(--code-bg); }
.rule small { display: block; color: var(--muted); font-size: 0.86rem; }
.today { font-size: 0.72rem; font-weight: 500; color: var(--sky); background: var(--sky-soft); border-radius: var(--r-pill); padding: 1px 8px; margin-left: 6px; white-space: nowrap; }

.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; display: grid; gap: 10px; align-content: start; }
.panel.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.panel.dark .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); justify-self: start; }
.panel .btn { justify-self: start; }

details { border: 1px solid var(--line); border-radius: 12px; }
summary { cursor: pointer; padding: 12px 16px; font-weight: 500; }
details > div { padding: 0 16px 16px; display: grid; gap: 10px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 0.8rem; overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .check { grid-template-columns: 1fr; }
  .hop { grid-template-columns: 4.4rem 1fr; }
  .hop .wait { grid-column: 2; text-align: left; }
  .verdict { padding: 18px; }
}
