/* def.ch – Prüfprotokoll-Layout: Eingabe wie eine Kommandozeile, Befunde als Protokollzeilen mit Statusmarke. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-var.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-var-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #edf0f4;
  --sheet: #ffffff;
  --ink: #0f1b2a;
  --muted: #536175;
  --rule: #d2d9e2;
  --accent: #1c3cc0;
  --accent-ink: #ffffff;
  --accent-soft: #e3e8fb;
  --ok: #1d7448;
  --ok-soft: #dff1e7;
  --warn: #9a5800;
  --warn-soft: #fbecd5;
  --fail: #b42318;
  --fail-soft: #fbe2df;
  --info: #4a5a70;
  --info-soft: #e6eaf0;

  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem;
  --t-sm: 0.875rem; --t-base: 1.0625rem; --t-md: 1.25rem; --t-lg: 1.75rem; --t-xl: clamp(2.25rem, 1.2rem + 4.6vw, 4.5rem);
  --radius: 6px;
  --maxw: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d131a; --sheet: #141c26; --ink: #e5ebf2; --muted: #95a3b5; --rule: #273241;
    --accent: #8aa2ff; --accent-ink: #0d131a; --accent-soft: #1d2747;
    --ok: #4cc38a; --ok-soft: #12291f; --warn: #e8a640; --warn-soft: #2e2210;
    --fail: #f2766a; --fail-soft: #331614; --info: #a3b0c2; --info-soft: #1c2430;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d131a; --sheet: #141c26; --ink: #e5ebf2; --muted: #95a3b5; --rule: #273241;
  --accent: #8aa2ff; --accent-ink: #0d131a; --accent-soft: #1d2747;
  --ok: #4cc38a; --ok-soft: #12291f; --warn: #e8a640; --warn-soft: #2e2210;
  --fail: #f2766a; --fail-soft: #331614; --info: #a3b0c2; --info-soft: #1c2430;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--sheet);
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
code, .mono { font-family: var(--f-mono); font-size: 0.9em; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 48rem) {
  .wrap { padding-left: max(2rem, env(safe-area-inset-left, 0px)); padding-right: max(2rem, env(safe-area-inset-right, 0px)); }
}

/* ------------------------------------------------------------ Kopf */
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
}
.head-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding-block: var(--s-3); flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: baseline; text-decoration: none; color: var(--ink); line-height: 1; }
.wm-def { font-family: var(--f-display); font-weight: 860; font-stretch: 125%; font-size: 1.6rem; letter-spacing: -0.02em; }
.wm-tld { font-family: var(--f-mono); font-weight: 500; font-size: 1.05rem; color: var(--accent); margin-left: 1px; }
.site-nav { display: flex; gap: var(--s-1) var(--s-4); flex-wrap: wrap; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: var(--t-sm); font-weight: 600; padding-block: var(--s-1); }
.site-nav a:hover { color: var(--ink); }
@media (max-width: 40rem) {
  .site-nav a:nth-child(n+2):nth-child(-n+5) { display: none; }
}

.preview-note { background: var(--warn-soft); color: var(--ink); border-bottom: 1px solid var(--rule); font-size: var(--t-sm); }
.preview-note .wrap { padding-block: var(--s-3); }

/* ------------------------------------------------------------ Hero / Eingabe */
.hero { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.hero .wrap { padding-block: var(--s-7) var(--s-6); display: grid; gap: var(--s-4); }
.eyebrow { font-family: var(--f-mono); font-size: var(--t-sm); color: var(--muted); letter-spacing: 0.02em; }
.hero h1 {
  font-family: var(--f-display);
  font-weight: 880;
  font-stretch: 118%;
  font-size: var(--t-xl);
  line-height: 0.98;
  letter-spacing: -0.025em;
  max-width: 16ch;
}
.lede { max-width: 62ch; color: var(--muted); font-size: var(--t-md); line-height: 1.5; }

.prompt { margin-top: var(--s-4); max-width: 46rem; display: grid; gap: var(--s-2); }
.prompt-label { font-size: var(--t-sm); font-weight: 600; }
.prompt-row {
  display: flex; align-items: stretch;
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}
.prompt-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.prompt-sign {
  display: flex; align-items: center;
  padding-inline: var(--s-4);
  font-family: var(--f-mono); font-weight: 500; font-size: var(--t-base);
  color: var(--accent); background: var(--accent-soft);
  white-space: nowrap;
  border-right: 1px solid var(--rule);
}
.prompt-row input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; color: var(--ink);
  font-family: var(--f-mono); font-size: 1.2rem;
  padding: var(--s-4);
}
.prompt-row input:focus { outline: none; }
.prompt-row .btn { border-radius: 0; }
@media (max-width: 30rem) {
  .prompt-sign { display: none; }
  .prompt-row input { font-size: 1.05rem; padding: var(--s-3); }
}

/* ------------------------------------------------------------ Buttons & Formulare */
.btn {
  font: inherit; font-weight: 700; font-size: var(--t-base);
  border: 0; border-radius: var(--radius); cursor: pointer;
  padding: var(--s-3) var(--s-5);
  min-height: 2.75rem;
  transition: background-color 120ms, color 120ms;
}
.btn-primary { background: var(--ink); color: var(--sheet); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-primary[disabled] { opacity: 0.6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn-ghost:hover { border-color: var(--ink); }

.form-error { color: var(--fail); font-weight: 600; font-size: var(--t-sm); }

.tool-form { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; }
.field { display: grid; gap: var(--s-1); min-width: 0; }
.field.grow { flex: 1 1 16rem; }
.field label { font-size: var(--t-sm); font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); }
.field input[type="text"], .field select {
  font-family: var(--f-mono); font-size: var(--t-base); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s-2) var(--s-3); min-height: 2.75rem; width: 100%;
}
.field input[type="text"]:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[type="color"] { width: 4rem; height: 2.75rem; padding: 2px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); cursor: pointer; }
.hint { font-size: var(--t-sm); color: var(--muted); max-width: 70ch; }

/* ------------------------------------------------------------ Bericht */
.report .wrap { padding-block: var(--s-6) var(--s-7); display: grid; gap: var(--s-5); }
.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s-4); }
.report-title { display: grid; gap: var(--s-1); min-width: 0; }
.report-title h2 { font-family: var(--f-display); font-stretch: 110%; font-weight: 780; font-size: var(--t-lg); line-height: 1.1; overflow-wrap: anywhere; }
.report-meta { color: var(--muted); font-size: var(--t-sm); }
.tally { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.tally-item { font-size: var(--t-sm); padding: var(--s-1) var(--s-3); border-radius: 999px; font-variant-numeric: tabular-nums; }
.tally-item b { font-weight: 800; }
.tally-item[data-s="ok"] { background: var(--ok-soft); color: var(--ok); }
.tally-item[data-s="warn"] { background: var(--warn-soft); color: var(--warn); }
.tally-item[data-s="fail"] { background: var(--fail-soft); color: var(--fail); }

.findings { list-style: none; margin: 0; padding: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.findings:empty { display: none; }
.finding {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr) auto;
  gap: var(--s-2) var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--rule);
  align-items: start;
}
.finding:first-child { border-top: 0; }
.f-body { display: grid; gap: var(--s-1); min-width: 0; }
.f-body h3 { font-size: var(--t-base); font-weight: 700; line-height: 1.35; }
.f-sum { color: var(--ink); }
.finding[data-s="pending"] .f-sum { color: var(--muted); }
.f-rec { font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); text-align: right; overflow-wrap: anywhere; max-width: 18rem; padding-top: 3px; }

.pill {
  display: inline-flex; align-items: center; gap: 0.4em;
  justify-self: start;
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 0.2em 0.65em; border-radius: 999px;
  background: var(--info-soft); color: var(--info);
  white-space: nowrap;
}
.pill::before {
  content: ""; width: 0.55em; height: 0.55em; border-radius: 50%; background: currentColor; flex: none;
}
[data-s="ok"] > .pill { background: var(--ok-soft); color: var(--ok); }
[data-s="warn"] > .pill { background: var(--warn-soft); color: var(--warn); }
[data-s="fail"] > .pill { background: var(--fail-soft); color: var(--fail); }
[data-s="warn"] > .pill::before { border-radius: 1px; transform: rotate(45deg); }
[data-s="fail"] > .pill::before { border-radius: 1px; }
[data-s="pending"] > .pill { background: transparent; color: var(--muted); border: 1px dashed var(--rule); }
[data-s="pending"] > .pill::before { background: transparent; border: 1px solid currentColor; }
[data-s="running"] > .pill { background: var(--accent-soft); color: var(--accent); }
[data-s="running"] > .pill::before { animation: pulse 900ms ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.2; } }

.f-details { margin-top: var(--s-2); }
.f-details summary { cursor: pointer; font-size: var(--t-sm); font-weight: 600; color: var(--accent); width: fit-content; }
.f-details ul { margin: var(--s-2) 0 0; padding-left: 1.1rem; display: grid; gap: var(--s-1); font-size: 0.95rem; }
.f-details li::marker { color: var(--muted); }
.raw {
  margin: var(--s-2) 0 0; padding: var(--s-3);
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  font-family: var(--f-mono); font-size: 0.8rem; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 16rem; overflow: auto;
}
.fix { font-size: 0.95rem; }
.fix b { font-weight: 700; }

/* Hinweis auf igs.ch: bewusst vom Prüfbefund abgesetzt */
.igs { margin: var(--s-3) 0 0; font-size: 0.95rem; line-height: 1.45; }
.igs[data-k="offer"] { display: grid; gap: var(--s-2); padding: var(--s-3) var(--s-4); background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.igs[data-k="client"] { color: var(--muted); }
.igs[data-k="client"] b { color: var(--ink); font-weight: 700; }
.igs[data-k="client"] a { white-space: nowrap; }
.igs-mark { display: inline-block; font-family: var(--f-mono); font-weight: 500; font-size: 0.78rem; line-height: 1.5; color: var(--accent); background: var(--accent-soft); padding: 0 6px; border-radius: 3px; margin-right: 2px; vertical-align: 1px; }
.igs-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-4); }
.igs-link { font-weight: 700; }
.igs-note { font-size: 0.8rem; color: var(--muted); }
@media print { .igs { display: none; } }

@media (max-width: 44rem) {
  .finding { grid-template-columns: minmax(0, 1fr); padding: var(--s-4); }
  .f-rec { text-align: left; max-width: none; order: 2; padding-top: 0; }
  .f-body { order: 3; }
}

.findings.compact .finding { padding-inline: var(--s-4); }

.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); }
.copy-status { font-size: var(--t-sm); color: var(--ok); }
.help-cta { flex: 1 1 22rem; color: var(--muted); font-size: var(--t-sm); max-width: 62ch; }
.copy-fallback { width: 100%; min-height: 12rem; font-family: var(--f-mono); font-size: 0.8rem; padding: var(--s-3); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); color: var(--ink); }

/* ------------------------------------------------------------ Werkzeuge */
.tools { background: var(--sheet); border-block: 1px solid var(--rule); }
.tools > .wrap { padding-block: var(--s-7); display: grid; gap: var(--s-5); }
.section-head { display: grid; gap: var(--s-2); }
.section-head h2 { font-family: var(--f-display); font-stretch: 110%; font-weight: 780; font-size: var(--t-lg); line-height: 1.1; }
.section-head p { color: var(--muted); max-width: 62ch; }

.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: thin; }
.tabs [role="tab"] {
  font: inherit; font-weight: 600; font-size: var(--t-sm);
  background: transparent; color: var(--muted);
  border: 0; border-bottom: 3px solid transparent;
  padding: var(--s-3) var(--s-3); cursor: pointer; white-space: nowrap;
  margin-bottom: -1px;
}
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.panel { display: grid; gap: var(--s-4); }
.tool-out { display: grid; gap: var(--s-4); min-width: 0; }
.empty { color: var(--muted); font-size: var(--t-sm); }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
.rec-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.rec-table th, .rec-table td { text-align: left; padding: var(--s-2) var(--s-3); border-top: 1px solid var(--rule); vertical-align: top; }
.rec-table thead th { border-top: 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--paper); font-weight: 700; }
.rec-table td.mono { overflow-wrap: anywhere; }
.rec-table td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rec-table .val { min-width: 14rem; }
.dns-flags { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; font-size: var(--t-sm); color: var(--muted); }
.dns-flags .pill { font-size: 0.75rem; }

.chain { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.chain li { display: flex; gap: var(--s-3); align-items: baseline; font-size: 0.9rem; min-width: 0; }
.chain .code { font-family: var(--f-mono); font-weight: 500; min-width: 2.5rem; font-variant-numeric: tabular-nums; }
.chain .u { font-family: var(--f-mono); overflow-wrap: anywhere; min-width: 0; }
.subhead { font-size: var(--t-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.kv { margin: 0; display: grid; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.kv > div { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3) var(--s-4); border-top: 1px solid var(--rule); }
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--muted); font-size: var(--t-sm); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
#ip-addr { font-size: 1.25rem; font-weight: 500; }
@media (max-width: 30rem) { .kv > div { grid-template-columns: minmax(0, 1fr); gap: 0; } }

.color-out { display: grid; grid-template-columns: 9rem minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--s-4); align-items: start; }
.swatch {
  aspect-ratio: 1; max-width: 100%; border-radius: var(--radius); border: 1px solid var(--rule);
  display: flex; align-items: flex-end; padding: var(--s-3);
  font-family: var(--f-display); font-weight: 800; font-size: 1.75rem; color: #ffffff;
}
.kv-tight > div { grid-template-columns: 3.5rem minmax(0, 1fr); padding: var(--s-2) var(--s-3); }
.contrast { width: 100%; border-collapse: collapse; font-size: 0.9rem; border: 1px solid var(--rule); }
.contrast caption { text-align: left; font-size: var(--t-sm); font-weight: 700; padding-bottom: var(--s-2); }
.contrast th, .contrast td { text-align: left; padding: var(--s-2) var(--s-3); border-top: 1px solid var(--rule); }
.contrast thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--paper); border-top: 0; }
.contrast td.mono { font-variant-numeric: tabular-nums; }
.pass { color: var(--ok); font-weight: 700; }
.nopass { color: var(--fail); font-weight: 700; }
@media (max-width: 52rem) { .color-out { grid-template-columns: 7rem minmax(0, 1fr); } .contrast { grid-column: 1 / -1; } }

/* ------------------------------------------------------------ Meldungen */
.news .wrap { padding-block: var(--s-7); display: grid; gap: var(--s-5); }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: var(--s-1) var(--s-6); }
.news-list li { border-top: 1px solid var(--rule); padding-block: var(--s-3); display: grid; gap: var(--s-1); }
.news-list li.empty { grid-column: 1 / -1; border-top: 0; }
.news-list a { color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.35; }
.news-list a:hover { color: var(--accent); text-decoration: underline; }
.news-meta { font-family: var(--f-mono); font-size: 0.75rem; color: var(--muted); }

/* ------------------------------------------------------------ Über / Fuss */
.about { border-top: 1px solid var(--rule); }
.about-grid { padding-block: var(--s-7); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--s-6); }
.about-grid > div { display: grid; gap: var(--s-2); align-content: start; }
.about h2 { font-size: var(--t-md); font-weight: 700; }
.about p { color: var(--muted); max-width: 62ch; }

.site-foot { border-top: 1px solid var(--rule); background: var(--sheet); font-size: var(--t-sm); color: var(--muted); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); padding-block: var(--s-5); }
.foot-row nav { display: flex; gap: var(--s-4); }
.foot-row a { color: var(--muted); }

/* ------------------------------------------------------------ Rechtstexte */
.legal .wrap { padding-block: var(--s-7); }
.legal article { max-width: 68ch; display: grid; gap: var(--s-4); }
.legal h1 { font-family: var(--f-display); font-stretch: 112%; font-weight: 820; font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); line-height: 1.05; }
.legal h2 { font-size: var(--t-md); font-weight: 700; margin-top: var(--s-4); }
.legal ul { margin: 0; padding-left: 1.2rem; display: grid; gap: var(--s-1); }
.legal address { font-style: normal; }
.legal .stand { color: var(--muted); font-size: var(--t-sm); }

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