:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #1b1d21;
  --muted: #5d636e;
  --line: #e2e3e0;
  --accent: #1f4fd1;
  --pass: #17784a;
  --pass-bg: #e7f4ec;
  --warn: #8a5a00;
  --warn-bg: #fbf1dc;
  --fail: #b3261e;
  --fail-bg: #fbe9e7;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131417; --surface: #1c1e22; --ink: #eceef1; --muted: #a2a8b3; --line: #2e3138;
    --accent: #8aa8ff; --pass: #6fd39f; --pass-bg: #16301f; --warn: #f0c060; --warn-bg: #3a2f14;
    --fail: #ff8a80; --fail-bg: #3d1b19;
  }
}
:root[data-theme="dark"] {
  --bg: #131417; --surface: #1c1e22; --ink: #eceef1; --muted: #a2a8b3; --line: #2e3138;
  --accent: #8aa8ff; --pass: #6fd39f; --pass-bg: #16301f; --warn: #f0c060; --warn-bg: #3a2f14;
  --fail: #ff8a80; --fail-bg: #3d1b19;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.5 "Barlow", system-ui, sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 40px 16px 64px; }
h1 { font-size: 2.1rem; line-height: 1.15; font-weight: 700; margin: 0 0 10px; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 28px 0 8px; }
a { color: var(--accent); }
.kicker { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.lead { font-size: 1.15rem; margin: 0 0 12px; }
.privacy { margin: 0; color: var(--muted); }
.privacy strong { color: var(--ink); }
.hint { color: var(--muted); font-size: 0.92rem; }

.panel {
  margin: 28px 0 16px; padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
fieldset { border: 0; margin: 0; padding: 0; }
legend, .limit > label { font-weight: 600; margin-bottom: 8px; display: block; padding: 0; }
.agency label { display: block; margin: 4px 0; cursor: pointer; }
.agency .hint { display: block; margin-left: 24px; }
.limit-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.limit input {
  width: 84px; font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink);
}
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button {
  font: inherit; font-size: 0.85rem; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.presets button:hover { border-color: var(--accent); }
.limit .hint { margin: 8px 0 0; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 34px 16px; border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; transition: border-color 0.15s;
}
.drop:hover, .drop.over { border-color: var(--accent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-title { font-weight: 600; font-size: 1.1rem; }

.result { margin-top: 24px; }
.verdict {
  padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  border-left-width: 6px;
}
.verdict h2 { margin: 0 0 4px; font-size: 1.3rem; }
.verdict p { margin: 0; color: var(--muted); }
.verdict.fail { border-left-color: var(--fail); }
.verdict.warn { border-left-color: var(--warn); }
.verdict.pass { border-left-color: var(--pass); }
.doc-findings { list-style: none; padding: 0; margin: 14px 0 0; }
.page {
  margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.page summary { padding: 12px 16px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-weight: 600; }
.page ul { list-style: none; margin: 0; padding: 0 16px 12px; }
.finding { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.doc-findings .finding:first-child { border-top: 0; }
.chip {
  flex: none; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; min-width: 48px; text-align: center;
}
.chip.pass { color: var(--pass); background: var(--pass-bg); }
.chip.warn { color: var(--warn); background: var(--warn-bg); }
.chip.fail { color: var(--fail); background: var(--fail-bg); }
.chip.skip { color: var(--muted); background: var(--bg); }
.rule { flex: none; width: 74px; color: var(--muted); font-size: 0.9rem; }
.msg { overflow-wrap: anywhere; }
.busy, .error { padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.error { border-color: var(--fail); }

.notes { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 8px; }
.notes ul { padding-left: 20px; }
.disclaimer { color: var(--muted); font-size: 0.92rem; }

@media (max-width: 640px) {
  .panel { grid-template-columns: 1fr; }
  h1 { font-size: 1.7rem; }
  .rule { width: 60px; }
}

/* Site chrome and text pages (build output) */
header.site {
  max-width: 760px; margin: 0 auto; padding: 18px 16px 0;
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; justify-content: space-between;
}
header.site .brand { font-weight: 700; color: var(--ink); text-decoration: none; }
header.site nav { display: flex; gap: 16px; flex-wrap: wrap; }
header.site nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
header.site nav a:hover, header.site .brand:hover { color: var(--accent); }
footer.site {
  max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.9rem;
}
footer.site p { margin: 0 0 8px; }
.doc .note {
  color: var(--muted); font-size: 0.95rem; padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.doc table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 0.95rem; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.doc td:first-child { font-weight: 500; }
.cta { margin: 20px 0; }
.button {
  display: inline-block; padding: 10px 18px; border-radius: 8px; background: var(--accent);
  color: var(--surface); font-weight: 600; text-decoration: none;
}
.button:hover { filter: brightness(1.08); }
