/* Tarifcheck — dieselbe Formensprache wie der MCP-Hub, damit die Seiten
   nebeneinander nach einem Haus aussehen. Ruhige Flächen, harte Kanten in der
   Typografie, Farbe ausschließlich dort, wo sie etwas bedeutet. */

:root {
  --ink: #131316;
  --ink-2: #6e6e78;
  --ink-3: #9b9ba4;
  --bg: #ffffff;
  --surface: #ffffff;
  --line: #e7e7ea;
  --line-strong: #d2d2d8;
  --wash: #f7f7f8;
  --focus: #131316;
  --radius: 18px;
  --ease: cubic-bezier(.22,.61,.25,1);

  --gruen: #12833f;
  --gelb: #a86a00;
  --rot: #c8382f;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4f4f6;
    --ink-2: #a0a0aa;
    --ink-3: #70707a;
    --bg: #0b0b0d;
    --surface: #131316;
    --line: #26262c;
    --line-strong: #3a3a42;
    --wash: #17171b;
    --focus: #f4f4f6;

    --gruen: #3fbd6d;
    --gelb: #e0a53c;
    --rot: #f0736a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 640; letter-spacing: -.028em; line-height: 1.12; }
p { margin: 0; }
button { font: inherit; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 28px; }
.meta { font-size: .9rem; color: var(--ink-2); }
.mono, code { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .55s var(--ease) both; }
.d1 { animation-delay: .04s } .d2 { animation-delay: .08s } .d3 { animation-delay: .12s }
.d4 { animation-delay: .16s } .d5 { animation-delay: .2s }  .d6 { animation-delay: .24s }

/* ── Kopf ──────────────────────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
header.stuck { border-bottom-color: var(--line); }
.kopfzeile { display: flex; align-items: center; gap: 14px; height: 64px; }
.wortmarke { font-weight: 620; font-size: 15.5px; letter-spacing: -.022em;
  display: flex; align-items: center; gap: 10px; }
.wortmarke svg { display: block; }
.kopfzeile .fuellung { flex: 1; }

nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; }
nav::-webkit-scrollbar { display: none; }
nav button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 12px 11px; font-size: 14.5px; font-weight: 500;
  color: var(--ink-3); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
nav button:hover { color: var(--ink); }
nav button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

.plakette {
  min-width: 20px; padding: 1px 6px; border-radius: 10px;
  background: var(--rot); color: #fff;
  font-size: 11.5px; font-weight: 700; line-height: 1.5; text-align: center;
}

main { padding: 34px 0 90px; }

/* ── Kacheln mit Gewerkezeichen ────────────────────────────────────────── */
.marke {
  border-radius: 13px; flex: 0 0 auto;
  display: grid; place-items: center;
  width: 44px; height: 44px;
}
.marke svg { width: 58%; height: 58%; display: block; }

/* ── Karten ────────────────────────────────────────────────────────────── */
.karte {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
}

.gitter { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.gewerk {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 22px 20px;
  cursor: pointer; text-align: left; width: 100%;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.gewerk:hover { transform: translateY(-3px); border-color: var(--line-strong);
  box-shadow: 0 14px 34px -14px rgba(0,0,0,.18); }
.gewerk .kopf { display: flex; align-items: center; gap: 13px; }
.gewerk h3 { font-size: 1.1rem; letter-spacing: -.024em; }
.gewerk .zahl { font-size: .84rem; color: var(--ink-3); margin-top: 2px; }
.gewerk .fuss { display: flex; align-items: center; gap: 8px; font-size: .87rem; margin-top: auto; }
/* Der Status darf nie umbrechen - "Abruf fehlgeschlagen" sprengte sonst die
   Zeile und schob das Datum in die Mitte. Das Datum steht deshalb darunter. */
.gewerk .zustand { white-space: nowrap; }
.gewerk .gepruef { font-size: .82rem; color: var(--ink-3); margin-top: 4px; }

.ampel { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.ampel.aktuell { background: var(--gruen); }
.ampel.handlungsbedarf { background: var(--gelb); }
.ampel.fehler { background: var(--rot); }
.zustand.aktuell { color: var(--gruen); font-weight: 600; }
.zustand.handlungsbedarf { color: var(--gelb); font-weight: 600; }
.zustand.fehler { color: var(--rot); font-weight: 600; }

/* ── Abschnittsköpfe ───────────────────────────────────────────────────── */
.abschnitt { display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px; }
.abschnitt h2 { font-size: 1.32rem; letter-spacing: -.03em; }
.abschnitt .fuellung { flex: 1; }

/* ── Meldungen ─────────────────────────────────────────────────────────── */
.meldung {
  border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: 14px; padding: 17px 20px; margin-bottom: 10px;
  background: var(--surface);
  transition: opacity .2s var(--ease);
}
.meldung.gelesen { opacity: .5; }
.meldung h3 { font-size: 1rem; letter-spacing: -.018em; }
.meldung .zeile { font-size: .84rem; color: var(--ink-3); margin-top: 4px;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.meldung .rumpf { margin-top: 10px; font-size: .93rem; color: var(--ink-2);
  line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.meldung .rumpf a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.meldung.art-fehler { border-left-color: var(--rot); }
.meldung.art-seite_geaendert { border-left-color: var(--gelb); }
.meldung.art-geaendert { border-left-color: var(--gelb); }
.meldung.art-neu, .meldung.art-upload { border-left-color: var(--gruen); }

/* ── Listen ────────────────────────────────────────────────────────────── */
.zeilen { border-top: 1px solid var(--line); }
.dok {
  display: flex; align-items: flex-start; gap: 15px;
  padding: 17px 0; border-bottom: 1px solid var(--line);
}
.dok .marke { width: 34px; height: 34px; border-radius: 10px; margin-top: 1px; }
.dok .haupt { flex: 1; min-width: 0; }
.dok .titel { font-weight: 560; font-size: .99rem; letter-spacing: -.012em; }
.dok .unter { font-size: .85rem; color: var(--ink-3); margin-top: 3px;
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.dok .rechts { text-align: right; font-size: .84rem; color: var(--ink-3);
  white-space: nowrap; flex: 0 0 auto; }
.trenner { opacity: .4; }

.fahne {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 7px;
  background: var(--wash); color: var(--ink-2);
}
.fahne.warn { background: color-mix(in srgb, var(--gelb) 15%, transparent); color: var(--gelb); }
.fahne.rot { background: color-mix(in srgb, var(--rot) 13%, transparent); color: var(--rot); }
.fahne.gruen { background: color-mix(in srgb, var(--gruen) 14%, transparent); color: var(--gruen); }

/* ── Formulare und Knöpfe ──────────────────────────────────────────────── */
.knopf {
  border: 0; border-radius: 11px; padding: 11px 20px; cursor: pointer;
  background: var(--ink); color: var(--bg); font-weight: 620; font-size: 15px;
  letter-spacing: -.011em; transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.knopf:hover { opacity: .85; }
.knopf:active { transform: scale(.98); }
.knopf:disabled { opacity: .45; cursor: default; transform: none; }

.knopf-rand {
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 7px 14px;
  background: transparent; color: var(--ink); cursor: pointer;
  font-size: 13.5px; font-weight: 550;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.knopf-rand:hover { border-color: var(--ink); background: var(--wash); }
.knopf-rand:disabled { opacity: .45; cursor: default; }

.knopf-klein {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: .82rem; color: var(--ink-3); text-decoration: underline;
  text-underline-offset: 2px;
}
.knopf-klein:hover { color: var(--ink); }

form { display: grid; gap: 15px; max-width: 480px; }
label { display: grid; gap: 6px; font-size: .89rem; font-weight: 600; letter-spacing: -.008em; }
.feld {
  width: 100%; padding: 12px 14px; font: 400 15.5px/1.5 inherit;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.feld::placeholder { color: var(--ink-3); }
.feld:focus { outline: none; border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 13%, transparent); }
.freiwillig { color: var(--ink-3); font-weight: 400; }

/* ── Hinweise ──────────────────────────────────────────────────────────── */
.notiz { background: var(--wash); border-radius: 14px; padding: 16px 19px;
  font-size: .92rem; color: var(--ink-2); line-height: 1.6; }
.notiz b, .notiz strong { color: var(--ink); font-weight: 600; }

#leiste {
  border-radius: 13px; padding: 13px 18px; margin-bottom: 18px;
  font-size: .93rem; border: 1px solid var(--line); background: var(--surface);
}
#leiste.gut { border-color: var(--gruen);
  background: color-mix(in srgb, var(--gruen) 8%, transparent); }
#leiste.schlecht { border-color: var(--rot);
  background: color-mix(in srgb, var(--rot) 7%, transparent); }

.leer { color: var(--ink-3); font-size: .95rem; padding: 30px 0; }
.tabelle-huelle { overflow-x: auto; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .dok .rechts { display: none; }
}
