/* typosquatting-finder: CIRCL visual identity (tokens shared with CIRCL URL Abuse). */

:root {
  --paper: #e9edf0;
  --surface: #ffffff;
  --tint: #f2f5f7;
  --card-shadow: 0 1px 2px rgba(27, 47, 59, 0.06), 0 6px 24px rgba(27, 47, 59, 0.06);
  --foot: #1b2f3b;
  --foot-ink: #c9d5de;
  --foot-line: rgba(255, 255, 255, 0.12);
  --ink: #1b2f3b;
  --muted: #5b6b7a;
  --faint: #8a98a6;
  --line: #cfd7de;
  --action: #3a6378;
  --action-ink: #ffffff;
  --ok: #1f7a55;
  --warn: #b7791f;
  --bad: #c8283a;
  --info: #6d8fa3;
  --idle: #c3ccd4;
  --alarm: #b3202f;
  --alarm-ring: rgba(179, 32, 47, 0.18);
  --brand-grey: #57636e;
  --brand-red: #e3302a;
  --typo-bg: rgba(200, 40, 58, 0.12);

  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --measure: 56rem;
  --wide: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}

:root[data-theme="dark"] {
    --paper: #0f1720;
    --surface: #16212c;
    --tint: #1c2935;
    --card-shadow: none;
    --foot: #0a1016;
    --foot-ink: #93a3b3;
    --foot-line: #26343f;
    --ink: #e4eaf0;
    --muted: #93a3b3;
    --faint: #6b7b8b;
    --line: #26343f;
    --action: #8fbbd2;
    --action-ink: #0f1720;
    --ok: #4cc18e;
    --warn: #e0a84a;
    --bad: #f06470;
    --info: #8fb0d0;
    --idle: #2e3d4a;
    --alarm: #b3202f;
    --alarm-ring: rgba(240, 100, 112, 0.22);
    --brand-grey: #c9d3dc;
    --brand-red: #f0554c;
    --typo-bg: rgba(240, 100, 112, 0.16);
    color-scheme: dark;
}

/* Theme toggle and logo per theme */
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
.theme-toggle {
  appearance: none; border: 1px solid var(--line); background: transparent;
  color: var(--ink); width: 2.25rem; height: 2.25rem; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer; font-size: 0.9375rem;
}
.theme-toggle:hover { border-color: var(--action); color: var(--action); }
.theme-toggle i { margin: 0; }
.theme-toggle .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: inline; }
[data-theme="dark"] .theme-toggle .fa-moon { display: none; }
[data-theme="dark"] .topbar { box-shadow: none; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}

[hidden] { display: none !important; }

a { color: var(--action); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--mono); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Layout frame */

.frame {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.frame-wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }

main { flex: 1; padding-bottom: 4rem; }

/* Header */

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--brand-grey);
}
.brand img { width: auto; height: 2.5rem; }
.wordmark {
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark b { color: var(--brand-red); font-weight: 800; }

.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-link { color: var(--muted); font-size: 0.9375rem; text-decoration: none; }
.site-link:hover, .site-link[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.org-logo { display: block; line-height: 0; }
.org-logo img { height: 2.5rem; width: auto; }

/* Footer */

footer.site {
  margin-top: 2rem;
  background: var(--foot);
  color: var(--foot-ink);
  font-size: 0.875rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-top: 2.5rem;
  padding-bottom: 1.5rem;
}
.footer-grid h2 {
  margin: 0 0 0.625rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
}
.footer-grid ul { margin: 0; padding: 0; list-style: none; }
.footer-grid li + li { margin-top: 0.375rem; }
.footer-grid a { color: inherit; }
.footer-grid a:hover { color: #fff; }
.footer-org img { height: 2.75rem; width: auto; display: block; margin-bottom: 0.875rem; }
.footer-org p { margin: 0; max-width: 24rem; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--foot-line);
  color: var(--foot-ink);
  opacity: 0.8;
  font-size: 0.8125rem;
}
.footer-base a { color: inherit; }

/* Headings and copy */

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 15ch;
}
h2.section {
  margin: 0;
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.lede { margin: 1.25rem 0 0; max-width: 36rem; color: var(--muted); font-size: 1.125rem; }
.prose { max-width: 40rem; }
.prose p { margin: 0.75rem 0 0; }

/* Buttons */

.btn-primary {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--action);
  color: var(--action-ink);
  font: 600 1rem/1 var(--sans);
  padding: 0.875rem 1.375rem;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.55; cursor: default; filter: none; }
.btn-primary[data-mode="stop"] { background: var(--ink); color: var(--paper); }

.btn-quiet {
  appearance: none;
  background: none;
  border: 0;
  padding: 0.5rem 0;
  font: 500 0.9375rem/1.2 var(--sans);
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.25em;
  cursor: pointer;
}
.btn-quiet:hover { text-decoration-color: currentColor; }

/* Intake */

.intake { padding-top: clamp(2.5rem, 9vh, 5.5rem); }

.lookup {
  margin-top: 2.25rem;
  display: flex;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 0.375rem;
  gap: 0.375rem;
}
.lookup:focus-within { border-color: var(--action); }
.lookup input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  padding: 0.75rem 0.875rem;
}
.lookup input::placeholder { color: var(--faint); }
.lookup input:focus { outline: none; }

.form-hint { margin: 0.75rem 0 0; color: var(--bad); font-size: 0.9375rem; }

.try {
  margin: 0.875rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}
.try button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin-left: 0.5rem;
  font: 400 0.9375rem var(--mono);
  color: var(--action);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.25em;
  cursor: pointer;
}
.try button:hover { text-decoration-color: currentColor; }

/* Options */

.options { margin-top: 1rem; }
.options > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
  padding: 0.25rem 0;
}
.options > summary::-webkit-details-marker { display: none; }
.options > summary::before {
  content: "";
  width: 0.5rem; height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.options[open] > summary::before { transform: rotate(45deg); }
.options-count { color: var(--muted); font-weight: 400; }

.options-body {
  margin-top: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.25rem 1.5rem;
  display: grid;
  gap: 1.5rem;
}
.opt-group > h3 {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
}
.opt-group > p { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.875rem; }
.opt-group + .opt-group { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.opt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.opt-head .btn-quiet { font-size: 0.875rem; padding: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--paper);
  cursor: pointer;
  user-select: none;
}
.chip input:checked + span { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--action); outline-offset: 2px; }

.checks { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; cursor: pointer; }
.check input { accent-color: var(--action); width: 1rem; height: 1rem; }
.check small { color: var(--muted); }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.field label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.25rem; }
.field input[type="text"],
.field input[type="file"] {
  width: 100%;
  font: 400 0.9375rem var(--mono);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.625rem;
}
.field input[type="file"] { font-family: var(--sans); font-size: 0.875rem; }
.field input:focus { outline: none; border-color: var(--action); }

/* Compact intake once a report is shown */

body.has-report .intake { display: none; }
body.has-report .intake h1,
body.has-report .intake .lede,
body.has-report .try { display: none; }
body.has-report .lookup { margin-top: 0; border-width: 1px; border-color: var(--line); }
body.has-report .lookup input { font-size: 1rem; padding: 0.5rem 0.75rem; }
body.has-report .lookup .btn-primary { padding: 0.625rem 1rem; }
body.has-report .showcase { display: none; }

/* Report */

.report { margin-top: clamp(2rem, 5vh, 3rem); }

.subject-caption { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.subject-domain {
  margin: 0.25rem 0 0;
  font-family: var(--mono);
  font-size: clamp(1.75rem, 5.5vw, 3rem);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.subject-domain .tld { color: var(--muted); font-weight: 400; }

.progress { margin-top: 1.5rem; }
.progress-track {
  height: 10px;
  border-radius: 5px;
  background: var(--idle);
  overflow: hidden;
  display: flex;
}
.progress-fill { height: 100%; background: var(--info); transition: width 0.4s ease; }
.report[data-state="running"] .progress-fill { animation: fill-wait 1.4s ease-in-out infinite; }
.report[data-state="done"] .progress-fill { background: var(--ok); }
.report[data-state="stopped"] .progress-fill { background: var(--warn); }
@keyframes fill-wait { 50% { opacity: 0.7; } }

.progress-meta {
  margin-top: 0.625rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.progress-meta .muted { color: var(--muted); font-weight: 400; }

.tally {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.tally div { padding: 0.875rem 0; }
.tally div + div { padding-left: 1.25rem; border-left: 1px solid var(--line); }
.tally dt { color: var(--muted); font-size: 0.8125rem; }
.tally dd {
  margin: 0.125rem 0 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.tally .is-bad dd { color: var(--bad); }

/* Verdict */

.verdict {
  margin-top: 1.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-left: 4px solid var(--info);
  border-radius: 6px;
}
.verdict[data-tone="ok"] { border-color: var(--ok); }
.verdict strong { display: block; font-size: 1.25rem; letter-spacing: -0.01em; }
.verdict p { margin: 0.25rem 0 0; color: var(--muted); max-width: 44rem; }

.verdict[data-tone="bad"] {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--alarm);
  color: #fff;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 0 0 6px var(--alarm-ring);
}
.verdict[data-tone="bad"] strong { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
.verdict[data-tone="bad"] p { color: inherit; opacity: 0.92; }
.verdict[data-tone="bad"] .verdict-lead { opacity: 1; font-weight: 600; font-size: 1.0625rem; margin-top: 0.5rem; }
.verdict-icon { width: 3rem; height: 3rem; }
.verdict-icon .icon-body { fill: #fff; stroke-linejoin: round; }
.verdict-icon .icon-mark { stroke: var(--alarm); stroke-width: 4.5; stroke-linecap: round; }
.verdict-icon .icon-dot { fill: var(--alarm); }

/* Actions */

.actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.375rem);
  left: 0;
  min-width: 15rem;
  margin: 0;
  padding: 0.375rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 32, 0.14);
}
.menu-list a {
  display: block;
  padding: 0.5rem 0.625rem;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9375rem;
}
.menu-list a small { display: block; color: var(--muted); font-size: 0.8125rem; }
.menu-list a:hover { background: var(--paper); }
.copied { color: var(--ok); font-size: 0.9375rem; font-weight: 600; }

/* Results */

.results { margin-top: 2.5rem; }
.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}
.filters { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 1rem; }
.filters button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.3125rem 0.75rem;
  font: 500 0.875rem var(--sans);
  cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filters .n { font-variant-numeric: tabular-nums; opacity: 0.75; margin-left: 0.25rem; }

.search-box {
  font: 400 0.9375rem var(--mono);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  width: min(18rem, 100%);
}
.search-box:focus { outline: none; border-color: var(--action); }

.table-wrap { margin-top: 1rem; }
table.domains { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.domains th {
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
.domains th button {
  appearance: none; border: 0; background: none; padding: 0;
  font: inherit; color: inherit; cursor: pointer;
}
.domains th button:hover { color: var(--ink); }
.domains th[aria-sort] button { color: var(--ink); }
.domains th[aria-sort="ascending"] button::after { content: " \2191"; }
.domains th[aria-sort="descending"] button::after { content: " \2193"; }
.domains th.disabled { color: var(--faint); font-weight: 400; }
.domains td {
  padding: 0.75rem 0.75rem 0.75rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.domains tr.is-original td { background: var(--surface); }
.domains tr.is-original td:first-child { box-shadow: inset 3px 0 0 var(--action); padding-left: 0.75rem; }

.domains tr.is-fresh td { animation: fresh 2.5s ease-out; }
@keyframes fresh { from { background: rgba(58, 99, 120, 0.16); } to { background: transparent; } }

.dom { font-family: var(--mono); font-size: 0.9375rem; font-weight: 500; overflow-wrap: anywhere; }
.dom mark { background: var(--typo-bg); color: var(--bad); border-radius: 2px; padding: 0 1px; }
.dom-meta { margin-top: 0.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.625rem; color: var(--muted); font-size: 0.8125rem; }
.dom-meta a, .dom-meta button {
  appearance: none; border: 0; background: none; padding: 0;
  font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline;
  text-decoration-color: var(--line); text-underline-offset: 0.2em;
}
.dom-meta a:hover, .dom-meta button:hover { color: var(--ink); }

.tag {
  display: inline-block;
  padding: 0.0625rem 0.4375rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.tag-mine { border-color: var(--warn); color: var(--warn); }
.tag-known { border-color: var(--ok); color: var(--ok); }
.tag-orig { background: var(--action); border-color: var(--action); color: var(--action-ink); }

.data { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink); }
.data .more { font-family: var(--sans); color: var(--muted); font-size: 0.75rem; }
.data li { list-style: none; }
.data ul { margin: 0; padding: 0; }
.geo { display: block; font-family: var(--sans); color: var(--muted); font-size: 0.75rem; margin-top: 0.125rem; }
.title-cell { max-width: 16rem; overflow-wrap: anywhere; }
.empty { color: var(--faint); }

.score { display: flex; align-items: center; gap: 0.5rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score-bar { width: 3rem; height: 6px; background: var(--idle); border-radius: 3px; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--info); }
.score[data-level="high"] { color: var(--bad); font-weight: 700; }
.score[data-level="high"] .score-bar i { background: var(--bad); }
.score[data-level="mid"] .score-bar i { background: var(--warn); }

.no-results { margin: 1.5rem 0 0; color: var(--muted); }

/* Showcase (home) */

.showcase { margin-top: clamp(3.5rem, 10vh, 6rem); display: grid; gap: clamp(3rem, 8vh, 5rem); }

.specimen {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.specimen li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.specimen ul { margin: 0; padding: 0; list-style: none; }
.specimen .dom { font-size: clamp(1.0625rem, 2.5vw, 1.375rem); }
.specimen .how { color: var(--muted); font-size: 0.875rem; text-align: right; }

.steps {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 0.875rem; }
.steps li::before {
  content: counter(step);
  display: block;
  font-weight: 800;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.steps strong { display: block; font-size: 1.0625rem; }
.steps p { margin: 0.375rem 0 0; color: var(--muted); font-size: 0.9375rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1.5rem; }
.split h3 { margin: 0; font-size: 1.0625rem; }
.split p { margin: 0.375rem 0 0; color: var(--muted); font-size: 0.9375rem; }

pre.code {
  margin: 0.75rem 0 0;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 400 0.8125rem/1.6 var(--mono);
  overflow-x: auto;
  color: var(--ink);
}

/* Content pages (about, algorithms) */

.page { padding-top: clamp(2rem, 7vh, 4rem); }
.page-section { margin-top: 3rem; }
.page-section h2 { margin: 0; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.015em; }
.page-section p { margin: 0.625rem 0 0; max-width: 42rem; }
.page-section .muted { color: var(--muted); }

.toc { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.375rem 1.25rem; font-size: 0.9375rem; }

.algos { margin: 2rem 0 0; border-top: 1px solid var(--line); }
.algo {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 1rem;
}
.algo dt { font-weight: 700; }
.algo dt code { display: block; margin-top: 0.125rem; color: var(--muted); font-size: 0.8125rem; font-weight: 400; }
.algo dd { margin: 0; color: var(--ink); }
.algo:target { background: var(--surface); box-shadow: -0.75rem 0 0 var(--surface), 0.75rem 0 0 var(--surface); }

.legend-list { margin: 1rem 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.625rem 1rem; align-items: baseline; }
.legend-list dd { margin: 0; color: var(--muted); }

@media (max-width: 48rem) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-org { grid-column: 1 / -1; }
  .steps, .split { grid-template-columns: 1fr; }
  .tally { grid-template-columns: 1fr 1fr; }
  .tally div:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .tally div:nth-child(4) { border-top: 1px solid var(--line); }
  .algo { grid-template-columns: 1fr; gap: 0.25rem; }

  /* Results become stacked rows */
  table.domains thead { display: none; }
  table.domains, .domains tbody, .domains tr, .domains td { display: block; width: 100%; }
  .domains tr { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
  .domains td { border: 0; padding: 0.125rem 0; }
  .domains td[data-label]:not(:empty)::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.375rem;
  }
  .domains tr.is-original { background: var(--surface); padding-left: 0.75rem; box-shadow: inset 3px 0 0 var(--action); }
  .domains tr.is-original td { background: none; box-shadow: none; padding-left: 0; }
}

@media (max-width: 36rem) {
  .lookup { flex-direction: column; }
  .lookup .btn-primary { width: 100%; justify-content: center; }
  .fields { grid-template-columns: 1fr; }
  .site-link.secondary { display: none; }
  .org-logo img { height: 2rem; }
  .wordmark { font-size: 1rem; }
  .brand img { width: auto; height: 1.75rem; max-width: 100%; }
  .specimen li { grid-template-columns: 1fr; gap: 0.125rem; }
  .specimen .how { text-align: left; }
  .verdict[data-tone="bad"] { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* White cards on the grey page */

.card,
.report,
.page-section,
.algos {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.report { margin-top: clamp(1.5rem, 4vh, 2.5rem); }
.page-section { margin-top: 1.5rem; }
.page-section p, .page-section .prose { max-width: 46rem; }
.algos { margin-top: 2rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.algo:last-child { border-bottom: 0; }
.algo:target { background: var(--tint); box-shadow: -0.75rem 0 0 var(--tint), 0.75rem 0 0 var(--tint); }
.options-body { box-shadow: var(--card-shadow); }
.verdict { background: var(--tint); }
.domains tr.is-original td { background: var(--tint); }
pre.code { background: var(--tint); }
.chip span { background: var(--tint); }
.field input[type="text"], .field input[type="file"] { background: var(--tint); }
.search-box { background: var(--tint); }
.menu-list a:hover { background: var(--tint); }
.dom-meta .tag:not(.tag-orig) { background: var(--tint); }

@media (max-width: 48rem) {
  .domains tr.is-original { background: var(--tint); }
}
@media (max-width: 36rem) {
  .report, .page-section, .algos { border-radius: 10px; padding: 1rem; }
}

/* Home: the search sits in a white card until a report is shown */
body:not(.has-report) .intake {
  margin-top: clamp(1rem, 4vh, 2.5rem);
  padding: clamp(1.5rem, 5vw, 3.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
}
body:not(.has-report) .lookup { background: var(--tint); }

/* Top bar, after circl.lu: white bar, logos with a divider, red call to action */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(27, 47, 59, 0.06);
}
.topbar header.site, .topbar .site { padding-top: 0.875rem; padding-bottom: 0.875rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand-group { display: flex; align-items: center; gap: 1.125rem; min-width: 0; }
.topbar .org-logo {
  display: flex; align-items: center; gap: 0.625rem;
  padding-left: 1.125rem; border-left: 1px solid var(--line);
  text-decoration: none;
}
.topbar .org-logo img { height: 2.25rem; }
.org-name {
  font-size: 0.6875rem; line-height: 1.2; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.site-nav { gap: 1.5rem; }
.site-link { color: var(--ink); font-weight: 500; font-size: 0.9375rem; text-decoration: none; padding: 0.375rem 0; border-bottom: 2px solid transparent; }
.site-link:hover { text-decoration: none; border-bottom-color: var(--line); }
.site-link[aria-current="page"] { text-decoration: none; border-bottom-color: var(--brand-red); }
.btn-report {
  background: var(--alarm); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 0.9375rem;
  padding: 0.625rem 1rem; border-radius: 8px; white-space: nowrap;
}
.btn-report:hover { filter: brightness(1.1); text-decoration: none; }
main { padding-top: 1rem; }

/* Copy button on code blocks */
.code-wrap { position: relative; }
.code-wrap pre.code { padding-right: 5.5rem; }
.copy-code {
  position: absolute; top: 0.5rem; right: 0.5rem;
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: 600 0.8125rem var(--sans);
  padding: 0.3125rem 0.625rem; border-radius: 6px; cursor: pointer;
}
.copy-code:hover { border-color: var(--action); }
.copy-code[data-done] { color: var(--ok); border-color: var(--ok); }

@media (max-width: 60rem) {
  .org-name { display: none; }
  .site-link.secondary { display: none; }
}
@media (max-width: 44rem) {
  .topbar .org-logo, .btn-report { display: none; }
  .site-nav { gap: 1rem; }
}

/* Back to the top */
.to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 30;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: grid; place-items: center;
  appearance: none; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 4px 16px rgba(27, 47, 59, 0.16);
  cursor: pointer;
}
.to-top:hover { background: var(--action); border-color: var(--action); color: var(--action-ink); }

/* Font Awesome icons */
.fa-solid, .fa-regular, .fa-brands { margin-right: 0.125rem; }
.site-link i, .footer-grid h2 i, .tally dt i { color: var(--muted); font-size: 0.85em; }
.opt-group h3 i, .page-section h2 i, h2.section i { color: var(--brand-red); font-size: 0.85em; margin-right: 0.375rem; }
.menu-list a i { width: 1.25rem; color: var(--action); }
.menu-list a small { padding-left: 1.375rem; }
.btn-primary i { margin-right: 0.5rem; }
.dom-meta i { font-size: 0.85em; }
.footer-grid h2 i { color: var(--foot-ink); }

/* More visible progress */
.progress-track { height: 18px; border-radius: 9px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.progress-fill {
  background-color: var(--action);
  border-radius: 9px;
  min-width: 18px;
  transition: width 0.6s ease;
}
.report[data-state="running"] .progress-fill {
  animation: stripes 0.9s linear infinite;
  background-image: linear-gradient(45deg, rgba(255,255,255,0.22) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0.22) 75%, transparent 75%, transparent);
  background-size: 24px 24px;
}
@keyframes stripes { from { background-position: 24px 0; } to { background-position: 0 0; } }
.progress-pct {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--action); font-variant-numeric: tabular-nums; margin-right: 0.5rem;
}
.report[data-state="done"] .progress-pct { color: var(--ok); }
.report[data-state="stopped"] .progress-pct { color: var(--warn); }
.progress-meta { align-items: baseline; }

/* Country flags */
.geo { display: inline-flex; align-items: center; gap: 0.375rem; }
.flag { width: 1rem; height: 0.75rem; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); object-fit: cover; flex: none; }
.geo { display: flex; margin: 0.125rem 0 0.125rem; }

/* Results: the page scrolls normally, the table header sticks under the top bar */
.table-wrap { border: 1px solid var(--line); border-radius: 10px; }
.domains thead th {
  position: sticky; top: var(--topbar-h, 71px); z-index: 2;
  background: var(--surface);
  padding-top: 0.75rem;
  box-shadow: inset 0 -1px 0 var(--ink);
  border-bottom: 0;
}
.domains th:first-child, .domains td:first-child { padding-left: 0.875rem; }
.domains tr.is-original td:first-child { padding-left: 0.875rem; }
.domains tr:last-child td { border-bottom: 0; }
.domains tr.is-focus td { background: rgba(227, 48, 42, 0.08); }
.domains tr.is-focus td:first-child { box-shadow: inset 3px 0 0 var(--brand-red); }
.row-actions { margin-top: 0.375rem; display: flex; gap: 0.875rem; white-space: nowrap; }
.row-actions a, .row-actions button {
  appearance: none; border: 0; background: none; padding: 0;
  font: 500 0.8125rem var(--sans); color: var(--action); cursor: pointer;
  text-decoration: none;
}
.row-actions a:hover, .row-actions button:hover { text-decoration: underline; }
.row-actions i { font-size: 0.85em; }
@media (max-width: 48rem) {
  .table-wrap { overflow-x: auto; }
  .domains tr { padding-left: 0.75rem; padding-right: 0.75rem; }
  .domains tr.is-focus { background: rgba(227, 48, 42, 0.08); box-shadow: inset 3px 0 0 var(--brand-red); }
}

/* Home card: the red comes from the product itself, a typo marked in the title */
h1 .typo {
  color: var(--brand-red);
  background: var(--typo-bg);
  border-radius: 6px;
  padding: 0 0.06em;
  margin: 0 0.02em;
}
body:not(.has-report) .intake {
  border-top: 4px solid var(--brand-red);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* ---------- Phone layout ---------- */
.menu-toggle { display: none; }
@media (max-width: 40rem) {
  :root { --gutter: 0.875rem; }
  .topbar .site { padding-top: 0.625rem; padding-bottom: 0.625rem; gap: 0.5rem; flex-wrap: wrap; }
  .brand img { width: auto; height: 1.75rem; max-width: 100%; }
  .wordmark { font-size: 1rem; }

  /* Three-bar button */
  .menu-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 2.5rem; height: 2.5rem; padding: 0 0.5rem;
    appearance: none; background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  }
  .menu-toggle span { display: block; height: 2px; border-radius: 2px; background: var(--ink); transition: transform 0.2s, opacity 0.2s; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Collapsible panel */
  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    margin-top: 0.5rem; padding-top: 0.25rem;
    border-top: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .site-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.875rem 0.25rem; font-size: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .site-link i { width: 1.25rem; text-align: center; color: var(--muted); }
  .site-link[aria-current="page"] { border-bottom-color: var(--line); color: var(--brand-red); }
  .site-link[aria-current="page"] i { color: var(--brand-red); }
  .btn-report { display: flex; justify-content: center; margin: 0.875rem 0 0.375rem; padding: 0.75rem 1rem; }

  main { padding-top: 0.5rem; padding-bottom: 2rem; }
  body:not(.has-report) .intake { margin-top: 0.5rem; padding: 1.5rem 1.125rem; border-radius: 0 0 14px 14px; }
  h1 { font-size: 2.125rem; }
  .lede { font-size: 1rem; }
  .lookup { padding: 0.25rem; }
  .lookup input { padding: 0.625rem 0.75rem; font-size: 1rem; }
  .try { font-size: 0.875rem; }
  .options-body { padding: 1rem; }
  .chip span { font-size: 0.8125rem; padding: 0.3125rem 0.625rem; }

  .report { padding: 1rem; }
  .subject-domain { font-size: 1.75rem; }
  .tally dd { font-size: 1.375rem; }
  .tally dt { font-size: 0.75rem; }
  .verdict { padding: 0.875rem 1rem; }
  .verdict strong { font-size: 1.0625rem; }
  .verdict p { font-size: 0.9375rem; }
  .actions { gap: 0.5rem 1.25rem; }
  .actions .btn-primary { width: 100%; justify-content: center; }
  .menu { width: 100%; }
  .menu-list { left: 0; right: 0; min-width: 0; }
  .results-head { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .search-box { width: 100%; }

  /* Result rows: flat list, no nested frames */
  .table-wrap { border: 0; border-radius: 0; overflow: visible; }
  .domains tr { padding: 0.875rem 0; }
  .domains td, .domains td:first-child, .domains tr.is-original td:first-child { padding-left: 0; padding-right: 0; }
  .domains tr.is-original { padding: 0.875rem 0.75rem; border-radius: 8px; }
  .domains td[data-label]:not(:empty)::before { font-family: var(--sans); font-weight: 600; }
  .data { font-size: 0.8125rem; }
  .row-actions { gap: 1.25rem; margin-top: 0.5rem; }
  .row-actions a, .row-actions button { font-size: 0.875rem; padding: 0.25rem 0; }

  .page { padding-top: 1.25rem; }
  .page-section { padding: 1.125rem; }
  .footer-grid { padding-top: 1.75rem; gap: 1.5rem; }
  .to-top { right: 0.875rem; bottom: 0.875rem; }
}
@media (max-width: 40rem) {
  .domains tr.is-original td,
  .domains tr.is-original td:first-child { background: none; box-shadow: none; }
}

@media (max-width: 40rem) {
  .site-link.secondary, .topbar .btn-report { display: flex; }
  .site-nav:not(.open) .btn-report { display: none; }
}

.domains th.col-off { color: var(--muted, #888); font-weight: 400; }

/* Running search: stop and new search sit next to the domain */
.subject-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.subject-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.subject-actions a.btn-quiet { text-decoration: none; }
.btn-stop {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1.125rem; border: 0; border-radius: 8px;
  background: var(--ink); color: var(--paper);
  font: inherit; font-weight: 600; cursor: pointer;
}
.btn-stop:hover { opacity: 0.85; }
.btn-stop:disabled { opacity: 0.5; cursor: wait; }
.btn-stop[hidden] { display: none; }

/* Smaller footer */
footer.site { margin-top: 1rem; font-size: 0.8125rem; }
.footer-grid { padding-top: 1.5rem; padding-bottom: 1rem; gap: 1.5rem; }
.footer-org img { height: 2rem; margin-bottom: 0.5rem; }
.footer-grid li + li { margin-top: 0.25rem; }
.footer-base { padding-top: 0.75rem; padding-bottom: 1rem; font-size: 0.75rem; }

/* Home intake: full width, smaller title */
.intake h1 { max-width: none; font-size: clamp(1.75rem, 4.2vw, 3.25rem); line-height: 1.08; }
.intake .lede { max-width: none; font-size: 1.0625rem; margin-top: 0.75rem; }
.intake .lookup, .intake .options { max-width: none; width: 100%; }
body:not(.has-report) .intake { padding: clamp(1.25rem, 3vw, 2.25rem); }
.intake .lookup { margin-top: 1.5rem; }
.page h1 { max-width: none; font-size: clamp(1.75rem, 4.2vw, 3rem); line-height: 1.1; }
.page .lede, .page .page-section p, .page .page-section .prose { max-width: none; }
