:root {
  --bg: #f7f7f4;
  --hero: #ffffff;
  --fg: #16181d;
  --muted: #5d6470;
  --line: #e4e4de;
  --accent: #3b4cca;
  --accent-fg: #ffffff;
  --field: #ffffff;
  --hit: #0b6b3a;
  --hit-bg: #dff3e6;
  --warn: #8a5300;
  --warn-bg: #fff1d6;
  --bad: #9b1c1c;
  --bad-bg: #fde4e4;
  --row: #f0f0ea;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --hero: #151821;
    --fg: #e8eaee;
    --muted: #9aa1ae;
    --line: #262a35;
    --accent: #8d9bff;
    --accent-fg: #0e1014;
    --field: #0e1014;
    --hit: #7be0a6;
    --hit-bg: #12301f;
    --warn: #f2c26b;
    --warn-bg: #33270e;
    --bad: #ff9b9b;
    --bad-bg: #3a1717;
    --row: #1a1e29;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font); }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }

.hero { background: var(--hero); border-bottom: 1px solid var(--line); padding: 3.5rem 0 2rem; }
h1 { margin: 0; font-size: clamp(3rem, 9vw, 5.5rem); line-height: 1; letter-spacing: -0.05em; font-weight: 750; }
.lede { max-width: 40rem; margin: 1rem 0 2rem; font-size: 1.15rem; color: var(--muted); }
code { font-family: var(--mono); font-size: 0.92em; }

.fields { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; font-weight: 600; }
.field small { font-weight: 400; color: var(--muted); }
.field.grow { flex: 1 1 18rem; }
input[type="text"], input[type="search"], input[type="number"] {
  font: inherit; color: var(--fg); background: var(--field);
  border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.7rem 0.9rem; min-width: 0;
}
.fields input { font-size: 1.05rem; }
input:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button {
  font: inherit; font-weight: 650; cursor: pointer; border: 0; border-radius: 0.6rem;
  background: var(--accent); color: var(--accent-fg); padding: 0.75rem 1.8rem;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary { background: transparent; color: var(--fg); border: 1px solid var(--line); padding: 0.4rem 0.9rem; font-weight: 500; font-size: 0.9rem; }
button.secondary:not(:disabled):hover { border-color: var(--accent); }

.advanced { margin-top: 1rem; color: var(--muted); font-size: 0.92rem; }
.advanced summary { cursor: pointer; width: fit-content; }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.6rem 1.5rem; margin-top: 0.8rem; color: var(--fg); }
.options input[type="number"] { width: 4.5rem; padding: 0.25rem 0.5rem; }

.progress { height: 4px; margin-top: 1.5rem; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar { height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease-out; }
@media (prefers-reduced-motion: reduce) { .bar { transition: none; } }

.warn { margin: 1rem 0 0; font-size: 0.85rem; color: var(--muted); }
.banner { margin: 1rem 0 0; padding: 0.7rem 1rem; border-radius: 0.6rem; background: var(--bad-bg); color: var(--bad); font-size: 0.95rem; }

.results { padding-top: 1.5rem; padding-bottom: 4rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; font-size: 0.9rem; }
.toolbar .spacer { flex: 1; }
.toolbar input[type="search"] { padding: 0.35rem 0.7rem; font-size: 0.9rem; width: 12rem; }
.count { margin: 0.6rem 0; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--hero); }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0.3rem 0.75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row); }
thead th { padding: 0; }
th button {
  all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; padding: 0.5rem 0.75rem;
  font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
th button:hover { color: var(--fg); }
th button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
th[aria-sort="ascending"] button::after { content: " \2191"; }
th[aria-sort="descending"] button::after { content: " \2193"; }
.num { text-align: right; }
td.dim, td.muted { color: var(--muted); }
td.domain { font-family: var(--mono); font-size: 0.82rem; }
td.url { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-family: var(--mono); font-size: 0.8rem; }
.pill { padding: 0.05rem 0.5rem; border-radius: 1rem; font-size: 0.75rem; font-weight: 600; }
.pill.insecure { background: var(--warn-bg); color: var(--warn); }
.pill.fail { background: var(--bad-bg); color: var(--bad); }
.hit { color: var(--hit); background: var(--hit-bg); padding: 0.05rem 0.4rem; border-radius: 0.3rem; font-weight: 650; margin-right: 0.35rem; }
.hit small { font-weight: 400; opacity: 0.8; }
.notes { margin: 1.25rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; color: var(--muted); }

@media (max-width: 40rem) {
  .hero { padding: 2rem 0 1.5rem; }
  .fields { flex-direction: column; align-items: stretch; }
  .field.grow { flex: none; }
  .toolbar .spacer { display: none; }
  .toolbar input[type="search"] { width: 100%; }
}
