/* Modul-Dashboards (E207) — nur Tokens aus tokens.css, Schriften selbst gehostet (fonts.css). */
html { scrollbar-gutter: stable; }
.md {
  margin: 0;
  background: var(--t-bg);
  color: var(--t-ink);
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
.md *, .md *::before, .md *::after { box-sizing: border-box; }
.md main, .md-kopfzeile, .md-fuss { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.md a { color: var(--t-accent); }
.md :focus-visible { outline: 2px solid var(--t-accent); outline-offset: 2px; border-radius: 4px; }

/* Kopfzeile */
.md-kopfzeile { display: flex; align-items: center; gap: 16px; min-height: 72px; border-bottom: 1px solid var(--t-elev); flex-wrap: wrap; }
.md-logo { font-weight: 600; font-size: 20px; color: var(--t-ink) !important; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.md-pfad { display: flex; gap: 8px; align-items: center; color: var(--t-ink-3); font-size: 14px; margin-right: auto; }
.md-pfad a { color: var(--t-ink-2); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }

/* Buttons: 48 px hoch, Radius 10, eine Primäraktion je Screen */
.md-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 10px;
  font: inherit; font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; border: 1px solid transparent;
  transition: background-color .16s ease, border-color .16s ease, transform .1s ease; }
.md-btn--primaer { background: var(--t-accent-interactive); color: var(--t-fg-on-accent); }
.md-btn--umriss { background: transparent; color: var(--t-ink) !important; border-color: var(--t-border-strong); }
.md-btn:active { transform: scale(.98); }
.md-btn[disabled] { background: var(--t-accent-disabled); cursor: progress; }
@media (hover: hover) {
  .md-btn--primaer:hover:not([disabled]) { background: var(--t-accent-hover); }
  .md-btn--umriss:hover { border-color: var(--t-ink-2); }
  .md-pfad a:hover { color: var(--t-ink); }
}

/* Hero */
.md-hero { padding: 48px 0 32px; }
.md-eyebrow { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--t-ink-3); margin: 0 0 8px; }
.md h1 { font-family: 'Newsreader', Georgia, serif; font-weight: 400; font-size: clamp(36px, 6vw, 64px); line-height: 1.05; margin: 0 0 16px; letter-spacing: -.01em; hyphens: auto; overflow-wrap: anywhere; }
.md-pitch { font-size: 18px; color: var(--t-ink-2); max-width: 68ch; margin: 0 0 16px; overflow-wrap: anywhere; hyphens: auto; }
.md main { overflow-wrap: break-word; hyphens: auto; }
.md-stand { font-size: 14px; color: var(--t-ink-2); margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.md-stufe { font-family: 'Geist Mono', ui-monospace, monospace; padding: 4px 8px; border-radius: 6px; background: var(--t-raised); color: var(--t-ink); }
.md-stufe[data-stufe="LIVE"] { color: var(--t-emerald); }

/* Herkunfts-Etikett */
.md-badge { display: inline-block; vertical-align: middle; font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--t-elev); color: var(--t-ink-3); max-width: 100%; overflow-wrap: anywhere; }
.md-badge[data-herkunft-badge="testlauf"] { color: var(--t-signal); border-color: var(--t-signal); }
.md-badge[data-herkunft-badge="beispiel"] { color: var(--t-accent-secondary); border-color: var(--t-accent-secondary); }

/* Fehler am Auslöser */
.md-fehler { margin: 16px 0 0; padding: 12px 16px; border-left: 3px solid var(--t-danger); background: var(--t-raised); color: var(--t-ink); max-width: 68ch; }

/* Bänder statt Boxen */
.md-band { border-top: 1px solid var(--t-elev); padding: 32px 0; }
.md-band__kopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.md h2 { font-family: 'Newsreader', Georgia, serif; font-weight: 400; font-size: 28px; margin: 0; }
.md-klein { font-size: 13px; color: var(--t-ink-3); margin: 0 0 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Bühne */
.md-buehne { background: var(--t-raised); border-radius: 16px; padding: 24px 16px; min-height: 280px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.md-buehne > *, .md-check li > *, .md-kennzahlen > * { min-width: 0; }
@media (min-width: 768px) { .md-buehne { padding: 32px; } .md-buehne[data-visual="dispatch-route"], .md-buehne[data-visual="gauge-audit"],
  .md-buehne[data-visual="doc-typing"], .md-buehne[data-visual="invoice-finance"] { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; } }
.md-seq { transition: opacity .32s ease, transform .32s ease; }
.md-buehne.laeuft .md-seq:not(.ist-an) { opacity: 0; transform: translateY(8px); }
.md-ergebnis { margin: 0; font-family: 'Geist Mono', ui-monospace, monospace; font-size: 14px; color: var(--t-emerald); }
.md-eingabe { margin-top: 16px; }
.md-eingabe dl, .md-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 8px 24px; margin: 0; }
.md-eingabe dt, .md-felder dt { font-size: 12px; color: var(--t-ink-3); text-transform: uppercase; letter-spacing: .06em; }
.md-eingabe dd, .md-felder dd { margin: 0; font-family: 'Geist Mono', ui-monospace, monospace; font-size: 14px; overflow-wrap: anywhere; }

/* A Telefon */
.md-telefon { width: 100%; max-width: 360px; margin: 0 auto; background: var(--t-bg); border: 1px solid var(--t-elev); border-radius: 28px; padding: 16px; display: grid; gap: 12px; }
.md-telefon__kopf { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--t-ink-2); }
.md-punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--t-emerald); }
.md-welle { margin-left: auto; display: inline-flex; gap: 2px; align-items: center; height: 16px; }
.md-welle i { width: 3px; height: 30%; background: var(--t-accent); border-radius: 2px; }
.md-buehne.laeuft .md-welle i { animation: md-welle 0.8s ease-in-out infinite alternate; }
.md-welle i:nth-child(2n) { animation-delay: .2s; } .md-welle i:nth-child(3n) { animation-delay: .4s; }
@keyframes md-welle { to { height: 100%; } }
.md-chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.md-chat li { padding: 8px 12px; border-radius: 12px; font-size: 15px; max-width: 88%; background: var(--t-elev); }
.md-chat li[data-rolle="assistenz"] { justify-self: end; background: var(--t-accent-surface); }
.md-rolle { display: block; font-size: 11px; color: var(--t-ink-3); text-transform: uppercase; letter-spacing: .06em; }

/* B Kette */
.md-kette { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); }
.md-kette li { display: flex; gap: 8px; align-items: center; padding: 12px; border: 1px solid var(--t-elev); border-radius: 10px; font-size: 14px; background: var(--t-bg); overflow-wrap: anywhere; }
.md-kette li.puls { border-color: var(--t-accent); box-shadow: 0 0 0 1px var(--t-accent); }
.md-knoten__nr { font-family: 'Geist Mono', ui-monospace, monospace; color: var(--t-accent); }

/* C Postfach */
.md-postfach__kopf { margin: 0 0 8px; font-size: 13px; color: var(--t-ink-3); }
.md-mails { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.md-mails li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px; background: var(--t-bg); border-radius: 10px; font-size: 15px; }
.md-mail { overflow-wrap: anywhere; } .md-fach { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 13px; color: var(--t-accent); }

/* D Dokument, H/F Checklisten */
.md-dokument { background: var(--t-bg); border-radius: 10px; padding: 16px; min-height: 160px; }
.md-dokument__titel { margin: 0 0 8px; font-size: 13px; color: var(--t-ink-3); }
.md-tippen { margin: 0; font-family: 'Newsreader', Georgia, serif; font-size: 20px; line-height: 1.4; }
.md-tippen.tippt::after { content: '▌'; color: var(--t-accent); }
.md-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.md-check li { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
.md-haken { color: var(--t-emerald); font-weight: 600; flex: none; } .md-haken--offen { color: var(--t-signal); }

/* E Karte */
.md-karte { width: 100%; max-width: 420px; height: auto; }
.md-linien line { stroke: var(--t-accent); stroke-width: 2.5; stroke-linecap: round; }
.md-buehne.laeuft .md-linien line:not(.ist-an) { opacity: 0; }
.md-punkte circle { fill: var(--t-ink); }
.md-touren { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-family: 'Geist Mono', ui-monospace, monospace; font-size: 14px; }

/* F Ring */
.md-ring { --wert: 0; width: 180px; aspect-ratio: 1; border-radius: 50%; margin: 0 auto; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--t-raised) 78%, transparent 79%), conic-gradient(var(--t-emerald) calc(var(--wert) * 360deg), var(--t-elev) 0); }
.md-ring__zahl { font-family: 'Newsreader', Georgia, serif; font-size: 40px; line-height: 1; } .md-ring__txt { font-size: 13px; color: var(--t-ink-3); }

/* G Tabelle */
.md-tabelle-wrap { overflow-x: auto; }
.md-tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.md-tabelle th, .md-tabelle td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--t-elev); }
.md-tabelle th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--t-ink-3); font-weight: 500; }
.md-tabelle td:last-child { font-family: 'Geist Mono', ui-monospace, monospace; }
.md-tabelle td:first-child { overflow-wrap: anywhere; hyphens: auto; }

/* H Fortschritt */
.md-fortschritt-txt { margin: 0; font-family: 'Geist Mono', ui-monospace, monospace; font-size: 14px; }
.md-fortschritt { height: 8px; border-radius: 4px; background: var(--t-elev); overflow: hidden; }
.md-fortschritt span { display: block; height: 100%; width: calc(var(--anteil) * 100%); background: var(--t-emerald); transition: width .32s ease; }

/* I Beleg */
.md-beleg { position: relative; background: var(--t-ink); color: var(--t-bg); border-radius: 8px; padding: 24px 16px; overflow: hidden; font-family: 'Geist Mono', ui-monospace, monospace; font-size: 14px; }
.md-beleg p { margin: 0; }
.md-scan { position: absolute; left: 0; right: 0; height: 2px; top: 0; background: var(--t-accent); opacity: 0; }
.md-buehne.laeuft .md-scan { animation: md-scan 1.2s ease-in-out 2; }
@keyframes md-scan { 0% { top: 0; opacity: 1; } 100% { top: 100%; opacity: 1; } }

/* J Leads */
.md-leads { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.md-leads li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px; background: var(--t-bg); border-radius: 10px; font-size: 15px; }
.md-leads li > span:first-child { flex: 1 1 10em; min-width: 0; overflow-wrap: anywhere; }
.md-punkte-wert { font-family: 'Geist Mono', ui-monospace, monospace; }
.md-hitze { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--t-elev); color: var(--t-ink-3); }
.md-leads li[data-hitze="heiß"] .md-hitze { color: var(--t-signal); border-color: var(--t-signal); }

/* Ablauf */
.md-ablauf { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 16px; }
@media (min-width: 768px) { .md-ablauf { grid-template-columns: repeat(2, 1fr); } }
.md-ablauf li { counter-increment: s; display: grid; gap: 4px; padding-left: 40px; position: relative; overflow-wrap: anywhere; }
.md-ablauf li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 0; font-family: 'Geist Mono', ui-monospace, monospace; color: var(--t-accent); }
.md-ablauf strong { font-weight: 600; } .md-ablauf span { color: var(--t-ink-2); font-size: 15px; }

/* Testlauf: Laden / Erfolg / Fehler / Leer */
.md-testlauf { min-height: 120px; }
.md-kennzahlen { display: flex; flex-wrap: wrap; gap: 16px 48px; margin: 0 0 24px; }
.md-kennzahl dt { font-size: 12px; color: var(--t-ink-3); text-transform: uppercase; letter-spacing: .06em; }
.md-kennzahl dd { margin: 0; font-family: 'Newsreader', Georgia, serif; font-size: 40px; line-height: 1.1; }
.md-balken { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 560px; }
.md-balken li { display: grid; grid-template-columns: minmax(0, 12em) 1fr auto; gap: 12px; align-items: center; font-size: 14px; }
.md-balken__name { overflow-wrap: anywhere; } .md-balken__zahl { font-family: 'Geist Mono', ui-monospace, monospace; }
.md-balken__bar { height: 8px; border-radius: 4px; background: var(--t-accent); width: calc(var(--anteil) * 100%); min-width: 4px; }
.md-hinweis { font-size: 13px; color: var(--t-ink-3); margin: 16px 0 0; max-width: 68ch; }
.md-skeleton { display: grid; gap: 12px; }
.md-skeleton span { display: block; height: 16px; border-radius: 4px; max-width: 560px;
  background: linear-gradient(90deg, var(--t-raised) 0%, var(--t-elev) 50%, var(--t-raised) 100%); background-size: 200% 100%; animation: md-schimmer 1.6s linear infinite; }
.md-skeleton span:first-child { height: 40px; max-width: 240px; }
@keyframes md-schimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.md-zustand { padding: 16px; border-radius: 10px; background: var(--t-raised); max-width: 68ch; }
.md-zustand p { margin: 0 0 12px; }
.md-zustand--fehler { border-left: 3px solid var(--t-danger); }

/* Abschluss + Fuß */
.md-abschluss p { color: var(--t-ink-2); max-width: 60ch; margin: 8px 0 16px; }
.md-fuss { display: flex; gap: 8px 24px; flex-wrap: wrap; border-top: 1px solid var(--t-elev); padding-top: 16px; padding-bottom: 32px; margin-top: 32px; }
.md-fuss a { color: var(--t-ink-3); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 480px) {
  .md-kopfzeile { gap: 8px; } .md-kopfzeile .md-btn { width: 100%; }
  .md-hero { padding-top: 32px; }
  .md-balken li { grid-template-columns: minmax(0, 1fr) auto; } .md-balken__bar { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .md *, .md *::before, .md *::after { animation: none !important; transition: none !important; }
  .md-buehne.laeuft .md-seq, .md-buehne.laeuft .md-linien line { opacity: 1 !important; transform: none !important; }
}
