/* Inter is self-hosted on purpose: loading fonts from fonts.googleapis.com transfers visitor IPs
   to Google without consent (LG München I, 3 O 17493/20). A tool that checks that must not do it. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  color-scheme: light;
  --page: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f9f9f7;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #7a7872;
  --line: #e4e3dc;
  --track: #ecebe5;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e8f1fc;
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --bad: #d03b3b;
  --good-ink: #006300;
  --bad-ink: #b02a2a;
  --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 4px 16px rgba(11, 11, 11, .05);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222221;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #8f8d86;
    --line: #2f2f2c;
    --track: #2c2c2a;
    --accent: #3987e5;
    --accent-soft: #16263a;
    --good-ink: #3cc43c;
    --bad-ink: #f07070;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #222221; --ink: #fff; --ink-2: #c3c2b7; --muted: #8f8d86;
  --line: #2f2f2c; --track: #2c2c2a; --accent: #3987e5; --accent-soft: #16263a; --good-ink: #3cc43c; --bad-ink: #f07070; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* --- Top bar --- */
.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent) url('favicon.svg') center/cover; }
.topbar-tag { color: var(--muted); font-size: 13px; }

/* --- Hero / form --- */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.12; letter-spacing: -.025em; margin: 0 0 14px; }
.lead { color: var(--ink-2); font-size: 17px; max-width: 620px; margin: 0 auto 28px; }
.hero.compact { padding: 28px 0 8px; }
.hero.compact h1, .hero.compact .lead { display: none; }
.search { display: flex; gap: 8px; max-width: 640px; margin: 0 auto; background: var(--surface); padding: 6px; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; padding: 10px 12px; outline: none; }
.search input#code { flex: 0 0 140px; border-left: 1px solid var(--line); }
.search:focus-within { border-color: var(--accent); }
.search button { border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; padding: 0 22px; border-radius: 10px; cursor: pointer; }
.search button:disabled { opacity: .6; cursor: progress; }
.error { color: var(--bad-ink); margin: 14px auto 0; max-width: 640px; }

/* --- Loading --- */
.loading { padding: 24px 16px 64px; }
.steps { list-style: none; padding: 0; margin: 0 auto; max-width: 360px; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--muted); transition: color .2s; }
.steps li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.steps li.active { color: var(--ink); }
.steps li.active::before { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.steps li.done { color: var(--ink-2); }
.steps li.done::before { background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--good); }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Results layout --- */
.results { padding: 16px 16px 48px; display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 15px; margin: 0 0 14px; letter-spacing: -.005em; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 .sub { font-weight: 400; color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.muted { color: var(--muted); }

/* Summary */
.summary { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.ring { position: relative; width: 148px; height: 148px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--track); }
.ring .value { transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-num { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.ring-of { color: var(--muted); font-size: 13px; margin-top: 4px; }
.summary-url { font-size: 13px; color: var(--muted); word-break: break-all; }
.summary-grade { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 10px; display: flex; align-items: center; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.chip strong { color: var(--ink); font-weight: 600; }
.chip.accent { background: var(--accent-soft); border-color: transparent; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn { font: inherit; font-size: 13.5px; font-weight: 500; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 14px; border-radius: 9px; cursor: pointer; }
.btn:hover { background: var(--surface-2); }

/* Category tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile { padding: 16px 18px; }
.tile-label { font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 6px; }
.tile-ai { font-size: 11px; color: var(--accent); font-weight: 600; letter-spacing: .02em; }
.tile-num { font-size: 32px; font-weight: 700; letter-spacing: -.03em; margin: 4px 0 10px; line-height: 1.1; }
.tile-num small { font-size: 14px; color: var(--muted); font-weight: 500; }
.tile-empty { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

.bar { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 4px; width: 0; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.s-pass { --s: var(--good); }
.s-warn { --s: var(--warn); }
.s-fail { --s: var(--bad); }
.bar > span { background: var(--s, var(--accent)); }

/* Status icon */
.ico { width: 20px; height: 20px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; background: var(--s); line-height: 1; }
.ico.s-warn { color: #3a2900; }

/* Priorities */
.prio { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: p; }
.prio li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.prio li:first-child { border-top: 0; padding-top: 0; }
.prio-num { counter-increment: p; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.prio-num::before { content: counter(p); }
.prio-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 2px; }
.prio-fix { color: var(--ink-2); font-size: 14px; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.tag.jev { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Snippet preview */
.serp { font-family: arial, sans-serif; max-width: 600px; }
.serp-url { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.serp-fav { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.serp-title { font-size: 19px; color: #1a0dab; line-height: 1.3; margin-bottom: 3px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .serp-title { color: #99c3ff; } }
:root[data-theme="dark"] .serp-title { color: #99c3ff; }
.serp-desc { font-size: 14px; color: var(--ink-2); }
.serp-missing { color: var(--bad-ink); font-style: italic; }
.serp-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* Check rows */
.rows { display: grid; }
.row { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.row:first-child { border-top: 0; }
.row-val { color: var(--muted); font-size: 13px; text-align: right; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Jev judgements */
.judge { display: grid; gap: 14px; }
.judge-item { display: grid; gap: 6px; }
.judge-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.judge-top span:first-child { font-weight: 500; }
.judge-conf { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.judge-text { font-size: 13px; color: var(--ink-2); }
.judge-group { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 -4px; }

.s-info { --s: var(--muted); }
.tag.unsure { background: color-mix(in srgb, var(--warn) 22%, var(--surface)); border-color: transparent; color: var(--ink); }
.prio-seen, .judge-seen { font-size: 13px; color: var(--muted); font-style: italic; }
.judge-seen { margin-top: 2px; }
.cap-note { margin: -4px 0 10px; font-size: 13.5px; color: var(--bad-ink); }
.legal-row { border-top: 1px solid var(--line); }
.legal-row:first-child { border-top: 0; }
.legal-hint { font-size: 13.5px; color: var(--ink-2); margin: -4px 0 10px 32px; }
.legal-basis { color: var(--muted); font-size: 12.5px; }

.legal-page { padding-top: 40px; padding-bottom: 56px; max-width: 760px; }
.legal-page h1 { font-size: 30px; letter-spacing: -.02em; margin: 0 0 16px; }
.legal-page h2 { font-size: 17px; margin: 28px 0 8px; }
.legal-page p { color: var(--ink-2); margin: 0 0 12px; }

.site-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.site-total b { font-size: 34px; letter-spacing: -.03em; margin-right: 8px; }
.site-total span { color: var(--muted); font-size: 14px; }
.sections { display: grid; gap: 8px; margin-top: 10px; }
.section-row { display: grid; grid-template-columns: minmax(0, 150px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.section-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.section-bar { height: 10px; }
.section-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.section-count { font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 3ch; text-align: right; }
.table-wrap { overflow-x: auto; margin-top: 10px; }
.site-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.site-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.site-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.site-path { display: inline-block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

.site-head { align-items: flex-end; }
.site-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.score-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--s); margin-right: 6px; }
.link-btn { border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; padding: 0; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
tr.findings td { background: var(--surface-2); }
.findings-list { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.findings-list li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.url-list { margin-top: 6px; font-size: 13px; }
.url-list summary { cursor: pointer; color: var(--muted); }
.url-list a { color: var(--ink-2); }

.scope-note { margin: -4px 0 10px; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.kpis { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: flex-end; }
.kpi b { display: block; font-size: 30px; letter-spacing: -.03em; line-height: 1.1; }
.kpi span { font-size: 13px; color: var(--muted); }
.accordion { display: grid; margin-top: 8px; border-top: 1px solid var(--line); }
.acc { border-bottom: 1px solid var(--line); }
.acc > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 9px 2px; cursor: pointer; font-size: 14px; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 18px; line-height: 1; transition: transform .15s; }
.acc[open] > summary::after { transform: rotate(90deg); }
.acc-title { min-width: 0; }
.acc-body { padding: 0 2px 12px 32px; font-size: 13.5px; color: var(--ink-2); }
.acc-body p { margin: 4px 0 8px; }
.grid-2 > * { min-width: 0; }
.outline li, .acc-body { overflow-wrap: anywhere; }
.acc.more { border-bottom: 0; }
.acc.more > .accordion { border-top: 0; padding-left: 0; }
details.acc[style] > summary { border-top: 1px solid var(--line); font-weight: 500; }

/* Tabs: a horizontally swipeable bar on phones, sticky while scrolling a panel. */
.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; background: var(--page); padding: 6px 0; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: none; font: inherit; font-size: 14.5px; font-weight: 500; color: var(--ink-2); padding: 9px 14px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { background: var(--surface-2); }
.tab[aria-selected="true"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 -2px 0 var(--accent); }
.tab-badge { font-size: 11.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; color: var(--ink-2); }
.tab-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--s); }
.tabpanel { display: grid; gap: 16px; }
.print-only { display: none; }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.legal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.legal-head { display: grid; grid-template-columns: 20px 1fr; gap: 4px 12px; align-items: start; margin-bottom: 10px; }
.legal-head h3 { margin: 0; font-size: 15px; }
.legal-head .muted { font-size: 13px; }
.legal-head .legal-basis { grid-column: 2; }
.legal-note { font-size: 13.5px; color: var(--ink-2); margin: 0 0 8px; }
.legal-box .legal-hint { margin-left: 32px; }
@media (max-width: 980px) { .legal-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  .tab { padding: 8px 8px; font-size: 13.5px; gap: 5px; }
  .tab-badge { display: none; }
}
@media (max-width: 860px) { .stats-4 { grid-template-columns: 1fr 1fr; } }

.fetched-sum { cursor: pointer; font-weight: 600; font-size: 15px; }
.fetched-sum .sub { font-weight: 400; color: var(--muted); font-size: 13px; }
.raw { margin: 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font: 12.5px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow: auto; color: var(--ink-2); }

.notice { border-radius: 10px; padding: 12px 14px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.notice.warn { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); }

/* Stats + outline */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-size: 20px; letter-spacing: -.02em; }
.stat span { font-size: 12.5px; color: var(--muted); }
.outline { list-style: none; padding: 0; margin: 14px 0 0; font-size: 13.5px; max-height: 260px; overflow: auto; }
.outline li { padding: 3px 0; color: var(--ink-2); }
.outline li b { display: inline-block; width: 28px; font-size: 11px; color: var(--muted); font-weight: 600; }

.footer { border-top: 1px solid var(--line); padding: 20px 0; font-size: 12.5px; color: var(--muted); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

@media (max-width: 860px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { padding: 36px 0 24px; }
  .topbar-tag { display: none; }
  .search { flex-wrap: wrap; }
  .search input { flex-basis: 100%; }
  .search input#code { border-left: 0; border-top: 1px solid var(--line); flex-basis: 100%; }
  .search button { flex: 1; padding: 12px; }
  .summary { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 16px; }
  .summary .chips, .summary .actions { justify-content: center; }
  .summary-grade { justify-content: center; }
  .tiles { gap: 10px; }
  .tile { padding: 14px; }
  .tile-num { font-size: 26px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .row-val { max-width: 110px; }
}

@media print {
  /* Icons, bars and score dots are background colours – browsers drop those in print unless told otherwise. */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4; margin: 14mm 12mm; }
  :root { color-scheme: light; --page: #fff; --surface: #fff; --surface-2: #f6f6f3; --ink: #0b0b0b; --ink-2: #3d3c39; --muted: #6b6963; --line: #deddd6; --track: #ecebe5; }
  .topbar, .hero, .actions, .footer, .link-btn, .url-list, .acc > summary::after, .acc-body ul.outline, .tabs { display: none !important; }
  /* On paper every tab is printed, one after another, each starting on a new page. */
  .tabpanel[hidden] { display: grid !important; }
  .tabpanel + .tabpanel { break-before: page; }
  .print-only { display: block; margin: 0 0 4px; font-size: 18px; }
  .legal-grid { grid-template-columns: 1fr; }
  .stats-4 { grid-template-columns: repeat(4, 1fr); }
  body { background: #fff; font-size: 12.5px; }
  .results { padding: 0; gap: 10px; }
  /* One column on paper; long cards may break across pages, but never right after their heading. */
  .card { box-shadow: none; border-color: var(--line); padding: 14px 16px; break-inside: auto; }
  .summary, .tile, .acc, .prio li, .judge-item, .row, .legal-row { break-inside: avoid; }
  .card h2, .judge-group { break-after: avoid; }
  .tiles, .grid-2 { gap: 10px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .summary { grid-template-columns: auto 1fr; }
  .ring { width: 120px; height: 120px; }
  .ring .value { transition: none; }
  .bar > span { transition: none; }
  .outline { max-height: none; }
  .acc > summary { padding: 6px 2px; }
  .acc-body { padding-bottom: 6px; }
  .site-table { font-size: 11.5px; }
  .site-table tr { break-inside: avoid; }
  .site-table th:last-child, .site-table td:last-child { display: none; }
  tr.findings { display: none !important; }
  .raw { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
