/* 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; }
}

/* ---------- IBAN-Listenprüfer ---------- */
@media (min-width: 40rem) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
section > details { border-bottom: 1px solid var(--border); padding: 0.6rem 0; }
section > details p { margin: 0.5rem 0 0.25rem; }
[hidden] { display: none !important; }
.result.zahlen { list-style: none; padding: 0; }
.filter { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; border: 0; padding: 0; margin: 1rem 0 0; }
.filter legend { font-weight: 600; padding: 0; margin-bottom: 0.4rem; }
.filter .check { margin-top: 0.2rem; }
.ergebnis-tabelle td.iban { font-family: var(--mono); white-space: nowrap; }
.ergebnis-tabelle td.hinweis { min-width: 16rem; }
.marke { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; white-space: nowrap; border: 1px solid currentColor; }
.marke.ok { color: var(--accent); }
.marke.fehler { color: var(--danger); }
.marke.doppelt, .marke.leer { color: var(--muted); }
tr.fehler td.hinweis { color: var(--danger); }
.vorschlag { display: block; font-family: var(--mono); color: var(--text); }
.rechnung { font-family: var(--mono); overflow-wrap: anywhere; }
.feld-oben { margin-top: 1rem; }

/* 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; } }
