/* Claw Labs Factory – Basis-Stylesheet. Systemschriften, hell/dunkel, ohne externe Ressourcen. */
:root {
  color-scheme: light dark;
  --bg: #f8f7f4;
  --surface: #ffffff;
  --text: #1c1c1f;
  --muted: #55565f;
  --border: #dedbd4;
  --accent: #0b6b66;
  --accent-text: #ffffff;
  --accent-soft: #e2f1ef;
  --focus: #b54708;
  --danger: #b42318;
  --radius: 0.75rem;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #1a1c1f;
    --text: #ececee;
    --muted: #a9abb3;
    --border: #2f3236;
    --accent: #5ccac1;
    --accent-text: #0b1513;
    --accent-soft: #15302d;
    --focus: #f7b267;
    --danger: #f97066;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  min-height: 100vh;
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.wrap { width: min(100% - 2rem, 60rem); margin-inline: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--focus);
  border-radius: 0.5rem;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 3.75rem; }
.brand { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand::before {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.5em;
  border-radius: 0.2em;
  background: var(--accent);
  vertical-align: 0.02em;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; -webkit-hyphens: auto; hyphens: auto; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.75rem); margin: 0 0 0.75rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
p, li { max-width: 68ch; }

.hero { padding: clamp(2.5rem, 7vw, 4.5rem) 0 1.5rem; }
.lead { font-size: 1.2rem; color: var(--muted); margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
  margin: 1.5rem 0;
}
.card > h2:first-child { margin-top: 0; }

label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
textarea, input, select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
}
textarea { resize: vertical; min-height: 8rem; }
.hint { color: var(--muted); font-size: 0.95rem; margin: 0.4rem 0 0; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  text-decoration: none;
}
.button.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }

.result {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.result li {
  background: var(--accent-soft);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
}
.result .value { display: block; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.result .label { color: var(--muted); font-size: 0.9rem; }

.steps { padding-left: 1.25rem; }
.steps li { margin: 0.35rem 0; }

code, pre { font-family: var(--mono); font-size: 0.92em; }
pre { overflow-x: auto; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; }

/* Breite Tabellen: <div class="table-wrap" tabindex="0" role="region" aria-label="…"><table>…</table></div> */
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: 0.5rem; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }

.notice {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.9rem 1.1rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

.legal { padding: 2.5rem 0 1rem; }
.legal h1 { font-size: clamp(1.6rem, 6.5vw, 2rem); }
.legal a { overflow-wrap: anywhere; }
.legal h2 { font-size: 1.15rem; margin-top: 1.75rem; }
.legal-meta { color: var(--muted); font-size: 0.9rem; margin-top: 2.5rem; }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.legal-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; padding: 0; margin: 0 0 0.75rem; }
.legal-links a { color: var(--muted); }
.legal-links a[aria-current="page"] { color: var(--text); font-weight: 600; }
.fine { margin: 0; font-size: 0.875rem; }

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

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}

/* ---------- Leitweg-ID-Prüfer ---------- */
.site-header .wrap { flex-wrap: wrap; gap: 0.25rem 1rem; padding-block: 0.5rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.25em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.9rem 0 0; align-items: center; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
label.button { margin: 0; }
input[type="file"].visually-hidden:focus-visible + label.button { outline: 3px solid var(--focus); outline-offset: 2px; }
.id-feld { font-family: var(--mono); font-size: 1.15rem; letter-spacing: 0.02em; }
.beispiele { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 0; padding: 0; list-style: none; font-size: 0.92rem; }
.beispiele button { font: inherit; font-family: var(--mono); font-size: 0.88rem; background: var(--bg); color: var(--accent); border: 1px solid var(--border); border-radius: 999px; padding: 0.2rem 0.7rem; cursor: pointer; }
.befund-box { margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 0.6rem; border-left: 5px solid var(--accent); background: var(--accent-soft); }
.befund-box.nok { border-left-color: var(--danger); background: var(--bg); }
.urteil { margin: 0; font-weight: 700; font-size: 1.15rem; }
.befund-box.ok .urteil { color: var(--accent); }
.befund-box.nok .urteil { color: var(--danger); }
.id-anzeige { margin: 0.35rem 0 0; overflow-wrap: anywhere; }
.id-anzeige code { font-size: 1.1rem; }
.fehler-liste, .hinweis-liste, .vorschlaege { margin: 0.6rem 0 0; padding-left: 1.2rem; }
.hinweis-liste { color: var(--muted); font-size: 0.95rem; }
.vorschlag-titel { margin: 0.8rem 0 0; font-weight: 600; }
.teile { display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 1rem; margin: 0.9rem 0 0; font-size: 0.95rem; }
.teile dt { color: var(--muted); }
.teile dd { margin: 0; font-family: var(--mono); overflow-wrap: anywhere; }
.check { display: flex; align-items: flex-start; gap: 0.6rem; margin-top: 0.6rem; }
.check label { margin: 0; font-weight: 500; }
input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); flex: none; margin: 0.15rem 0 0; padding: 0; }
.status { margin: 0.8rem 0 0; min-height: 1.2em; font-weight: 600; }
.stapel { font-size: 0.92rem; }
.stapel tr.nok td:nth-child(3) { color: var(--danger); font-weight: 600; }
.stapel code { overflow-wrap: anywhere; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0.75rem 1rem; }
@media (min-width: 40rem) { .grid-2 { grid-template-columns: 1fr 2fr; } }
.text dt { font-weight: 700; margin-top: 1rem; }
.text dd { margin-left: 0; }
.rechnung { font-family: var(--mono); }
.fehlerfall { border-top: 1px solid var(--border); padding-top: 0.5rem; }
.fehlerfall h3 { margin-bottom: 0.35rem; }

/* factory:weitere-werkzeuge */
.factory-related { margin-top: 2.5rem; padding: 1.5rem 0 0.75rem; border-top: 1px solid var(--border, currentColor); }
.factory-related h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
.factory-related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.factory-related li { margin: 0; }
.factory-related li a { font-weight: 600; }
.factory-related .tagline { display: block; color: var(--muted, inherit); font-size: 0.95rem; }
.factory-related .alle { margin: 1rem 0 0; }
@media (min-width: 48rem) { .factory-related ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print { .factory-related { display: none; } }
