/* SenderAuthCheck: shared styles. Mobile first, light and dark. */
:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #eeefeb;
  --text: #1a1d21;
  --muted: #59626d;
  --border: #d9dcdf;
  --accent: #1d5bb8;
  --accent-hover: #164a96;
  --accent-ink: #ffffff;
  --focus: #1d5bb8;
  --pass: #1b7342;
  --pass-bg: #e4f3ea;
  --warn: #855600;
  --warn-bg: #fcf0d6;
  --fail: #b0261d;
  --fail-bg: #fbe6e4;
  --info: #39577d;
  --info-bg: #e7edf5;
  --code-bg: #f0f1ed;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101316;
    --surface: #171b1f;
    --surface-2: #1f2429;
    --text: #e6e8eb;
    --muted: #9ba4ae;
    --border: #2c3238;
    --accent: #7eaefc;
    --accent-hover: #a3c5ff;
    --accent-ink: #0b1220;
    --focus: #a3c5ff;
    --pass: #73d29e;
    --pass-bg: #12271b;
    --warn: #f1c46b;
    --warn-bg: #2c2410;
    --fail: #ff8f86;
    --fail-bg: #33171a;
    --info: #a4c4ec;
    --info-bg: #172231;
    --code-bg: #0c0f12;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

img, svg { max-width: 100%; }

.skip-link {
  position: absolute; left: 16px; top: -100px;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 12px; border-radius: 6px; z-index: 10; text-decoration: none;
}
.skip-link:focus { top: 8px; }

.wrap { width: 100%; max-width: 60rem; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 44rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand svg { width: 28px; height: 28px; flex: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 4px 0; display: inline-block; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

main { display: block; padding: 28px 0 56px; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: 1.85rem; margin: 0 0 12px; }
h2 { font-size: 1.35rem; margin: 40px 0 10px; }
h3 { font-size: 1.1rem; margin: 24px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
li { margin-bottom: 6px; }
.lede { font-size: 1.125rem; color: var(--muted); }

code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--code-bg); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; margin: 0 0 16px; white-space: pre-wrap; word-break: break-all; line-height: 1.5;
}

.note {
  background: var(--info-bg); border-left: 4px solid var(--info); border-radius: 6px;
  padding: 12px 14px; margin: 0 0 18px;
}
.note p:last-child { margin-bottom: 0; }

/* Tables: narrow, two or three columns, no horizontal page scroll */
.table-wrap { overflow-x: auto; margin: 0 0 18px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { font-weight: 600; background: var(--surface-2); }

/* Guide layout */
.article-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin: 20px 0 8px; }
.toc h2 { font-size: 1rem; margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 4px; }
.faq h3 { margin-top: 22px; }
.sources ol { padding-left: 20px; font-size: 0.95rem; }
.cta {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin: 28px 0;
}
.cta p { margin: 0; }

/* Buttons and forms */
.btn {
  appearance: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; cursor: pointer; min-height: 44px;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-small {
  appearance: none; font: inherit; font-size: 0.85rem; padding: 4px 10px; min-height: 32px;
  border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.btn-small:hover { border-color: var(--muted); }

.checker-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin: 20px 0 24px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.field input {
  width: 100%; font: inherit; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text);
}
.field input:focus { border-color: var(--accent); }
.form-row { display: grid; gap: 0 16px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.form-error { color: var(--fail); font-weight: 600; margin: 0; }

/* Results */
.results:empty { display: none; }
.summary {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px;
  margin: 0 0 14px;
}
.summary h2 { margin: 0; font-size: 1.25rem; }
.summary .meta { color: var(--muted); font-size: 0.9rem; }
.overview { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.overview li { margin: 0; }
.overview a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600;
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin: 0 0 16px; scroll-margin-top: 16px;
}
.card[data-status="pass"] { border-left: 5px solid var(--pass); }
.card[data-status="warn"] { border-left: 5px solid var(--warn); }
.card[data-status="fail"] { border-left: 5px solid var(--fail); }
.card[data-status="info"] { border-left: 5px solid var(--info); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h3 { margin: 0; font-size: 1.15rem; }
.card .where { color: var(--muted); font-size: 0.9rem; margin: 0 0 10px; overflow-wrap: anywhere; }
.card .where code { font-size: 0.85rem; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.badge::before { font-size: 0.9rem; line-height: 1; }
.badge-pass { color: var(--pass); background: var(--pass-bg); }
.badge-pass::before { content: "\2713"; }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-warn::before { content: "!"; }
.badge-fail { color: var(--fail); background: var(--fail-bg); }
.badge-fail::before { content: "\2715"; }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-info::before { content: "i"; font-style: italic; font-family: Georgia, serif; }

.record { position: relative; margin: 0 0 12px; }
.record pre { margin: 0; padding-right: 12px; }
.record-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 4px; }

.findings { list-style: none; padding: 0; margin: 0; }
.finding { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--border); margin: 0; }
.finding:first-child { border-top: 0; }
.finding .badge { align-self: start; margin-top: 2px; }
.finding p { margin: 0 0 6px; overflow-wrap: anywhere; }
.finding .fix { color: var(--text); }
.finding .fix strong { font-weight: 700; }
.finding pre { margin: 6px 0 4px; }
.finding .copy-row { display: flex; gap: 8px; align-items: center; }

.lookup-list { margin: 6px 0 0; padding-left: 18px; font-size: 0.92rem; color: var(--muted); }
.lookup-list li { margin-bottom: 2px; overflow-wrap: anywhere; }
details { margin-top: 8px; }
summary { cursor: pointer; color: var(--accent); font-size: 0.95rem; }

.status-line { color: var(--muted); margin: 0 0 12px; min-height: 1.6em; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.feature-list { display: grid; gap: 12px; padding: 0; list-style: none; margin: 0 0 20px; }
.feature-list li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin: 0;
}
.feature-list a { font-weight: 600; }
.feature-list p { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 0.92rem; padding: 24px 0 32px; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0; }

@media (min-width: 640px) {
  h1 { font-size: 2.3rem; }
  .form-row { grid-template-columns: 3fr 2fr; }
  .checker-form { padding: 20px 22px; }
  .card { padding: 18px 20px; }
  .overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .feature-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media print {
  .site-header nav, .checker-form, .btn-small { display: none; }
  body { background: #fff; color: #000; }
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.optional { font-weight: 400; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 559px) {
  .finding { grid-template-columns: minmax(0, 1fr); }
  .finding .badge { justify-self: start; }
}
@media (min-width: 640px) {
  .feature-list.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .feature-list.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
