/*
 * Steuerfy | stil/steuerfy.css — die Seiten in der App
 * ─────────────────────────────────────────────────────
 * Für das Telefon gebaut (eine Spalte, Daumen unten), hell und dunkel nach
 * der Einstellung des Telefons. Keine Schriften von aussen, keine Bilder:
 * Die Seiten kommen vom Server und sollen auch im Zug schnell da sein.
 */
:root {
  --grund: #F2F4F3;
  --karte: #FFFFFF;
  --text: #17201C;
  --leise: #5B6661;
  --linie: #DDE3E0;
  --gruen: #16805C;
  --gruen-dunkel: #0F6247;
  --gruen-hell: #E3F3EC;
  --rot: #B42318;
  --rot-hell: #FDECEA;
  --gelb: #8A5A00;
  --gelb-hell: #FFF4D6;
  --blau-hell: #E8F0FB;
  --schatten: 0 1px 2px rgba(16, 24, 20, .06), 0 2px 8px rgba(16, 24, 20, .05);
  --rund: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0E1412;
    --karte: #18201D;
    --text: #E8EEEB;
    --leise: #9AA7A1;
    --linie: #2A3531;
    --gruen: #3CC08F;
    --gruen-dunkel: #2EA578;
    --gruen-hell: #143227;
    --rot: #FF8A80;
    --rot-hell: #3A1A18;
    --gelb: #F5C451;
    --gelb-hell: #33290F;
    --blau-hell: #16243A;
    --schatten: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 400 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
body.mit-nav { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
a { color: var(--gruen); }
h1 { font-size: 1.35rem; line-height: 1.25; margin: 0 0 .6rem; }
h2 { font-size: 1.05rem; line-height: 1.3; margin: 1rem 0 .5rem; }
.karte > h2:first-child { margin-top: 0; }
p { margin: .5rem 0; }
.klein, small { font-size: .875rem; color: var(--leise); }
small { display: block; margin-top: .15rem; }
mark { background: var(--gelb-hell); color: var(--gelb); padding: 0 .2em; border-radius: 4px; }

/* ── Kopf ─────────────────────────────────────────────────────────────── */
.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: baseline; gap: .75rem;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--karte); border-bottom: 1px solid var(--linie);
}
.marke { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.marke b { color: var(--gruen); }
.kopf .titel { color: var(--leise); font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 680px; margin: 0 auto; padding: 12px 12px 0; overflow-wrap: break-word; } /* lange Adressen in den Schritten (TI) umbrechen */

/* ── Karten ───────────────────────────────────────────────────────────── */
.karte {
  background: var(--karte); border-radius: var(--rund); box-shadow: var(--schatten);
  padding: 16px; margin: 0 0 12px; border: 1px solid transparent;
}
.karte.leise { background: transparent; box-shadow: none; border-color: var(--linie); }
.karte.mitte { text-align: center; padding: 32px 20px; }
details > summary { cursor: pointer; font-weight: 600; padding: 2px 0; }
details[open] > summary { margin-bottom: .5rem; }

/* ── Meldungen und Bänder ─────────────────────────────────────────────── */
.meldung { border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; background: var(--blau-hell); }
.meldung p { margin: .2rem 0; }
.meldung.gut { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.meldung.fehler { background: var(--rot-hell); color: var(--rot); }
.meldung.hinweis { background: var(--gelb-hell); color: var(--gelb); }
.band { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
.band.muster { background: var(--gelb-hell); color: var(--gelb); border: 1px dashed currentColor; }
.band a { color: inherit; font-weight: 600; }

/* ── Knöpfe ───────────────────────────────────────────────────────────── */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 46px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--linie); background: var(--karte); color: var(--text);
  font: 600 1rem/1.2 inherit; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.knopf.haupt { background: var(--gruen); border-color: var(--gruen); color: #fff; width: 100%; }
.knopf.haupt:active { background: var(--gruen-dunkel); }
.knopf.leise { background: transparent; }
.knopf.gefahr { border-color: var(--rot); color: var(--rot); background: transparent; }
.knopf[disabled], .knopf[aria-busy="true"] { opacity: .6; pointer-events: none; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.knoepfe .knopf.haupt { width: auto; flex: 1 1 auto; }
.unten-knopf { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); margin: 0 0 12px; }

/* ── Formulare ────────────────────────────────────────────────────────── */
.formular label:not(.kreuz):not(.knopf) { display: block; margin: 0 0 12px; font-size: .9rem; color: var(--leise); }
.formular input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]), .formular select {
  display: block; width: 100%; margin-top: 4px; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--linie); border-radius: 10px; background: var(--karte); color: var(--text);
  font: 400 1rem/1.3 inherit;
}
.formular input:focus, .formular select:focus { outline: 2px solid var(--gruen); outline-offset: 1px; }
.formular input:disabled, .formular select:disabled { background: transparent; color: var(--leise); }
.formular.inline label { margin-bottom: 0; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 360px) { .zwei { grid-template-columns: 1fr; } }
.kreuz { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; cursor: pointer; }
.kreuz input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--gruen); }
fieldset.kind { border: 1px solid var(--linie); border-radius: 10px; margin: 0 0 10px; padding: 10px 12px 0; }
.angaben .karte h2 { margin-top: 0; }

/* Hochladen: das Dateifeld unsichtbar im Knopf */
.hochladen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hochladen .knopf { position: relative; overflow: hidden; }
.hochladen input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.hochladen.laeuft { opacity: .6; pointer-events: none; }

/* ── Fortschritt und Checkliste ───────────────────────────────────────── */
progress { width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--linie); accent-color: var(--gruen); }
progress::-webkit-progress-bar { background: var(--linie); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--gruen); border-radius: 4px; }
.fortschritt { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.fortschritt a {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--linie); color: var(--text); text-decoration: none; font-weight: 600;
}
.fortschritt b {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--linie); color: var(--text); font-size: .9rem; flex: none;
}
.fortschritt li.erledigt b { background: var(--gruen); color: #fff; }
.fortschritt .zahl { margin-left: auto; font-weight: 500; color: var(--leise); }
.fortschritt .zahl.rot { color: #fff; background: var(--rot); border-radius: 999px; padding: 0 8px; }
.punkt h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-top: 0; }
.marke-stand, .marke-leise { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--linie); color: var(--leise); }
.stand-fertig .marke-stand { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.stand-fehlt .marke-stand { background: var(--rot-hell); color: var(--rot); }
.stand-fehler .marke-stand { background: var(--rot-hell); color: var(--rot); }
.stand-pruefen .marke-stand { background: var(--gelb-hell); color: var(--gelb); }
.punkt.stand-fertig { border-color: var(--gruen-hell); }
.beleg-zeile { font-size: .95rem; }

/* ── Listen ───────────────────────────────────────────────────────────── */
.liste-punkte { margin: .4rem 0; padding-left: 1.2rem; }
.liste-punkte li { margin: .3rem 0; }
.liste-haken { list-style: none; padding: 0; margin: .6rem 0; }
.liste-haken li { position: relative; padding-left: 1.6rem; margin: .45rem 0; }
.liste-haken li::before { content: "✓"; position: absolute; left: 0; color: var(--gruen); font-weight: 800; }
.schritte { padding-left: 1.3rem; }
.schritte li { margin: .5rem 0; }

/* ── Befunde ──────────────────────────────────────────────────────────── */
.befunde h2 { display: flex; align-items: center; gap: 8px; margin-top: 0; }
.befunde h2 .zahl { font-size: .8rem; padding: 0 8px; border-radius: 999px; background: var(--linie); }
.stufe-fehler { border-color: var(--rot); }
.stufe-fehler h2 { color: var(--rot); }
.stufe-warnung h2 { color: var(--gelb); }

/* ── Tabellen ─────────────────────────────────────────────────────────── */
.tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabelle th, .tabelle td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle thead th { font-size: .8rem; color: var(--leise); font-weight: 600; }
.tabelle .zahl { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Die Posten: auf schmalen Telefonen bricht der Titel (Silbentrennung),
   die Beträge nie. */
.posten { font-size: .875rem; }
.posten th, .posten td { padding: 7px 2px; }
.posten td:first-child, .posten th:first-child { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.posten .zahl { padding-left: 6px; }
.summe .tabelle th { font-weight: 700; border-bottom: 0; }
.summe .tabelle td { font-weight: 700; border-bottom: 0; }

/* ── Abo ──────────────────────────────────────────────────────────────── */
.abo .preis { font-size: 1.6rem; font-weight: 800; margin: .2rem 0 .6rem; }
.abo .preis span { color: var(--gruen); }
.kauf-stand:empty { display: none; }
.kauf-stand { font-size: .9rem; color: var(--leise); }

/* ── Rechtliches ──────────────────────────────────────────────────────── */
.recht h2 { font-size: 1rem; }
.recht p { font-size: .95rem; }
.sprachen a { margin-right: .6rem; }
.sprachen a[aria-current] { font-weight: 700; color: var(--text); text-decoration: none; }

/* ── Navigation unten ─────────────────────────────────────────────────── */
nav.unten {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--karte); border-top: 1px solid var(--linie);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
nav.unten a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; color: var(--leise); text-decoration: none; font-size: .75rem; font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
nav.unten a span { font-size: 1.25rem; line-height: 1; }
nav.unten a[aria-current="page"] { color: var(--gruen); }

/* ── Tablet (iPad): grössere Schrift, breitere Spalte ─────────────────── */
@media (min-width: 768px) {
  html { font-size: 118.75%; }
  body { font-size: 19px; }
  main { max-width: 800px; padding: 20px 20px 0; }
  .karte { padding: 20px 22px; }
  nav.unten a { font-size: .8rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .knopf { transition: background-color .15s, opacity .15s; }
}
