/* =============================================================================
   PROJEKTCOCKPIT · BASIS                                             design/base.css
   -----------------------------------------------------------------------------
   Reset, Grundtypografie, Typo-Klassen (.t-*), Farb- und Layout-Utilities.
   Keine Komponenten – die stehen in den Familien-Dateien von design/ (README „Aufbau der Stile“).

   Typografie-System (Skala aus tokens.css – nur diese Stufen):
     .t-display  34/1.1 semi    Modultitel (h1 im Seitenkopf, #193)
     .t-h1       24/1.1 semi    Detailseitentitel (Kontakt, Grundstück)
     .t-h2       20/1.2 semi    Phase, Karte mit Gewicht
     .t-h3       18/1.25 semi   Abschnittstitel (.sh h2)
     .t-h4       15/1.3 semi    Kartentitel, Gruppen
     .t-body     14/1.5         Fließtext, Eingaben (Standard auf body)
     .t-lg       15/1.5         Listenzeilen mit Gewicht
     .t-ui       13/1.4         Bedienelemente, Tabellen, dichte Listen
     .t-small    12/1.4         Nebenzeilen, Hilfstexte
     .t-caption  11/1.35 muted  Untertitel in Kacheln
     .t-overline 11 semi caps   Tabellenkopf, Kartenkopf, Labels
     .t-num      tabular        Zahlen (Tabellenziffern in der Grundschrift, rechtsbündig in Tabellen)
     .t-mono     Mono           nur Codes und Kennungen (Kontaktnummer, UR-Nr., Konto) – #193
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scrollbar-gutter: stable; }   /* #3205 */
html { overflow-x: clip; }   /* kein waagrechtes Scrollen: Vollbreiten-Hintergründe (navigation.css) bleiben innen (#1405) */
/* Kein Zoom in der App (Julius 17.11.2026, wie Teams; index.html: user-scalable=no, das iOS teils übergeht) – die Ursachen hier zentral:
   kein Doppeltipp-Zoom (manipulation lässt Wischen und Kartengesten), kein seitliches Verschieben auch im Körper (iOS hält sich nicht immer an html),
   lange Wörter brechen statt die Seite zu verbreitern; Felder am groben Zeiger ≥ 16 px, sonst vergrößert iOS beim Fokus (Wert: --feld-fs in tokens.css)
   Nur in der App (html.app in index.html) – Kundenseiten (app/kunde/) bleiben zoombar und behalten ihre Feldgrößen (kunde.css). */
html.app, .app body { touch-action: manipulation; }
.app body { overflow-x: clip; overflow-wrap: break-word; }
@media (pointer: coarse) {
  .app :is(input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file]), select, textarea, [contenteditable]:not([contenteditable=false])) {
    font-size: var(--feld-fs) !important;   /* !important: Felder mit eigener Schriftgröße in Modul-Stilen (13/14 px) – nur am Touch-Gerät; --feld-fs = 16 px (tokens.css) */
  }
}
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--fb); font-size: var(--fs-md); line-height: var(--lh-normal); font-feature-settings: var(--ff-zahlen);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
/* Viewer-Thema (#2332) */
[data-vt="hell"], [data-vt="dunkel"] { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; font-weight: var(--fw-head); letter-spacing: var(--ls-head); text-wrap: balance; }
small { font-size: var(--fs-xs); }   /* statt „smaller“ (10,8 px) */
b, strong { font-weight: var(--fw-semibold); }   /* nie 700: Gewichte nur aus Tokens (#3209) */
p { margin: 0 0 var(--sp-3); }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); text-decoration: none; }   /* Links nie unterstrichen (Styleguide): rot, mit Pfeil über ui.link; gepunktet nur [data-erkl] */
img { display: block; max-width: 100%; }
svg { flex: none; vertical-align: middle; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Feine Scrollbalken (Chromium/Firefox) */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---- Typo-Klassen ----------------------------------------------------------- */
.t-display { font: var(--fw-head) var(--fs-5xl)/var(--lh-tight) var(--fb); letter-spacing: var(--ls-tight); }
.t-h1      { font: var(--fw-head) var(--fs-4xl)/var(--lh-tight) var(--fb); letter-spacing: var(--ls-head); }
.t-h2      { font: var(--fw-semibold) var(--fs-3xl)/1.2 var(--fb); letter-spacing: var(--ls-tight); }
.t-h3      { font: var(--fw-semibold) var(--fs-3xl)/1.25 var(--fb); letter-spacing: var(--ls-snug); }
.t-h4      { font: var(--fw-semibold) var(--fs-lg)/var(--lh-snug) var(--fb); }
.t-body    { font: var(--fw-regular) var(--fs-md)/var(--lh-normal) var(--fb); }
.t-ui      { font: var(--fw-regular) var(--fs-ui)/1.4 var(--fb); }
.t-small   { font: var(--fw-regular) var(--fs-sm)/1.4 var(--fb); }
.t-caption { font: var(--fw-regular) var(--fs-xs)/1.35 var(--fb); color: var(--muted); }
.t-overline{ font: var(--fw-semibold) var(--fs-xs)/1.2 var(--fb); letter-spacing: var(--ls-wide); text-transform: uppercase; color: var(--muted); }
.t-num, .n, td.n, th.n, .num { font-variant-numeric: tabular-nums; }
.t-mono    { font-family: var(--fm); font-variant-numeric: tabular-nums; }

/* ---- Farb-Utilities ----------------------------------------------------------- */
.c-muted, .muted { color: var(--muted); } .c-good { color: var(--good-ink); } .c-warn { color: var(--warn-ink); } .neg { color: var(--crit-ink); } .pos { color: var(--good-ink); }

/* ---- Layout-Utilities --------------------------------------------------------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); padding-block: 0 var(--sp-9); display: flow-root; }
.wrap > main { display: flow-root; }
/* #2280 (CLS): flow-root – der Außenabstand des Seitenkopfs fällt nicht durch #main/.wrap, sonst springen sie bei jedem Wechsel über „Lade …“
   (y 76 ↔ 100); bis die Hülle steht (app.js › init: Testbanner, Leisten) bleibt der Inhalt unsichtbar – nichts rutscht nach dem ersten Bild */
body[data-huelle]:not(.huelle-bereit) #wrap { visibility: hidden; animation: huelle-notfreigabe 0s 3s forwards; }   /* nur die App (index.html) */
@keyframes huelle-notfreigabe { to { visibility: visible; } }   /* lädt app.js nicht, erscheint „Lade …“ trotzdem */
@media (max-width: 520px) { .wrap { padding-inline: 16px; } }
main > *, .two > *, .two-eq > *, .stack > *, .two > * > *, .kpis > * { min-width: 0; }

.stack { display: grid; gap: var(--sp-4); align-content: start; }
.stack.tight { gap: var(--sp-2); }
.row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--sp-4); }
.two-eq { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-4); }
@media (max-width: 920px) { .two { grid-template-columns: 1fr; } }
.voll { grid-column: 1 / -1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprung:focus { position: fixed; z-index: var(--z-toast); left: 8px; top: calc(var(--banner-h) + 8px); width: auto; height: auto; padding: 8px 12px; clip: auto;
  background: var(--surface); color: var(--accent-ink); border-radius: var(--r-sm); box-shadow: var(--focus); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }


/* Einblend-Animation für neu gerenderte Hauptinhalte */
@media (prefers-reduced-motion: no-preference) { .fade { animation: fd var(--dur-2) var(--ease); } @keyframes fd { from { opacity: .5; transform: translateY(3px); } to { opacity: 1; transform: none; } } }
