/* Ellerhurst Dashboard — Komponenten (spec/design.md §2–§6).
   Farben, Abstände, Schrift ausschließlich über var(--…) aus tokens.css. */

/* ---------- Grundlagen (§2) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--g0); color: var(--t1);
  font-family: var(--font); font-size: var(--fs-3); line-height: var(--lh-ui);
  letter-spacing: 0.005em;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
  caret-color: var(--akzent);
  scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--akzent-24); color: var(--t1); }
a { color: var(--akzent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-1); }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.icon-14 { width: 14px; height: 14px; }
.icon-16 { width: 16px; height: 16px; }
.icon-18 { width: 18px; height: 18px; }
.icon-24 { width: 24px; height: 24px; }
.t2 { color: var(--t2); } .t3 { color: var(--t3); }
.meta { font-size: var(--fs-1); color: var(--t3); }
.text { line-height: var(--lh-text); max-width: 68ch; }
.absatz { line-height: var(--lh-text); color: var(--t2); max-width: 68ch; font-size: var(--fs-2); }
.zeile { display: flex; align-items: center; gap: var(--sp-2); }
.zeile-zwischen { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.stapel { display: flex; flex-direction: column; gap: var(--sp-4); }
.rechts { text-align: right; }
.strich { border: 0; border-top: 1px solid var(--line); margin: var(--sp-4) 0; }
.spinner {
  width: 14px; height: 14px; border-radius: var(--r-full); flex: 0 0 auto;
  border: 2px solid transparent; border-top-color: currentColor; border-right-color: currentColor;
  animation: dreh 1s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }

/* ---------- Shell (§3) ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.app.nav-collapsed { grid-template-columns: var(--sidebar-w-rail) minmax(0, 1fr); }
.main { min-width: 0; display: flex; flex-direction: column; }
.inhalt { flex: 1; padding: var(--content-pad); max-width: calc(var(--content-max) + 2 * var(--content-pad)); width: 100%; margin: 0 auto; outline: none; }
.inhalt > * + * { margin-top: var(--sp-6); }
.inhalt-schmal { max-width: 760px; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  background: var(--g1); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.marke { height: var(--header-h); padding: 0 var(--sp-4); display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--line); }
.marke-name { font-size: var(--fs-3); font-weight: var(--fw-6); color: var(--t1); line-height: var(--lh-tight); white-space: nowrap; }
.marke-sub { font-size: var(--fs-0); color: var(--t3); margin-top: 2px; }
.nav-suche { position: relative; padding: var(--sp-3) var(--sp-3) 0; }
.nav-suche .icon { position: absolute; left: 22px; top: 20px; width: 16px; height: 16px; color: var(--t3); pointer-events: none; }
.nav-suche input { width: 100%; height: 32px; padding: 0 10px 0 32px; }
.nav { flex: 1; overflow-y: auto; padding: var(--sp-3) var(--sp-3); }
.nav-gruppe { font-size: var(--fs-0); color: var(--t3); letter-spacing: 0.06em; text-transform: uppercase; padding: var(--sp-6) var(--sp-3) var(--sp-2); font-weight: var(--fw-5); }
.nav-trenner { border-top: 1px solid var(--line); margin: var(--sp-3) 0; }
.nav-eintrag {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-2);
  color: var(--t2); font-size: var(--fs-3); font-weight: var(--fw-5); text-decoration: none;
  transition: background-color var(--dur-1), color var(--dur-1);
  white-space: nowrap;
}
.nav-eintrag .icon { width: 18px; height: 18px; }
.nav-eintrag:hover { background: var(--g3); color: var(--t1); }
.nav-eintrag:focus-visible { outline: none; box-shadow: var(--focus); }
.nav-eintrag.aktiv { background: var(--akzent-14); color: var(--t1); }
.nav-eintrag.aktiv::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  background: var(--akzent); border-radius: var(--r-1);
}
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-zaehler {
  height: 18px; min-width: 18px; padding: 0 6px; border-radius: var(--r-full);
  background: var(--g4); color: var(--t2); font-size: var(--fs-0); font-weight: var(--fw-6);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--dur-2), color var(--dur-2);
}
.nav-zaehler.warn { background: var(--warn-14); color: var(--warn); }
.nav-zaehler.blitz { background: var(--akzent-24); color: var(--t1); }
.nav-zaehler:empty { display: none; }
.sidebar-fuss { padding: var(--sp-3); border-top: 1px solid var(--line); }
.nav-toggle { width: 100%; justify-content: flex-start; gap: 10px; min-width: 0; }
.nav-toggle .icon { width: 18px; height: 18px; }
.nav-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 30; }
.btn.menu-toggle { display: none; margin-right: var(--sp-2); } /* .btn.… weil .btn (später im File) sonst display:inline-flex gewinnt */

/* Verbindungs-Badges (§4.17) */
.badges { display: flex; flex-direction: column; margin-bottom: var(--sp-2); }
.badge {
  display: flex; align-items: center; gap: var(--sp-2); height: 28px; padding: 0 var(--sp-2);
  border: 0; background: transparent; border-radius: var(--r-2); text-align: left; cursor: pointer;
  font-size: var(--fs-1); color: var(--t3); white-space: nowrap; overflow: hidden; width: 100%;
}
.badge:hover { background: var(--g3); }
.badge:focus-visible { outline: none; box-shadow: var(--focus); }
.badge-punkt { width: 8px; height: 8px; border-radius: var(--r-full); border: 1.5px solid currentColor; flex: 0 0 auto; }
.badge-text { overflow: hidden; text-overflow: ellipsis; }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.stop { color: var(--stop); }
.badge.ok .badge-punkt, .badge.warn .badge-punkt, .badge.stop .badge-punkt { background: currentColor; }
.badge.prueft .badge-punkt { border-color: var(--line-strong); border-top-color: currentColor; animation: dreh 1s linear infinite; }

/* Rail (§3.4): nur Icons; Label als Tooltip rechts */
.app.nav-collapsed .marke-name { font-size: var(--fs-0); overflow: hidden; text-overflow: ellipsis; }
.app.nav-collapsed .marke-sub, .app.nav-collapsed .nav-suche, .app.nav-collapsed .nav-label,
.app.nav-collapsed .nav-toggle-text, .app.nav-collapsed .badge-text { display: none; }
.app.nav-collapsed .nav-gruppe { font-size: 0; padding: 0; height: 0; border-top: 1px solid var(--line); margin: var(--sp-3) var(--sp-1); }
.app.nav-collapsed .nav { padding: var(--sp-3) var(--sp-2); overflow: visible; }
.app.nav-collapsed .sidebar { overflow: visible; }
.app.nav-collapsed .nav-eintrag { justify-content: center; padding: 0; width: 40px; margin: 0 auto; }
.app.nav-collapsed .nav-zaehler { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; min-width: 0; padding: 0; font-size: 0; border-radius: var(--r-full); background: var(--t3); }
.app.nav-collapsed .nav-zaehler.warn { background: var(--warn); }
.app.nav-collapsed .nav-eintrag::after, .app.nav-collapsed .badge::after, .app.nav-collapsed .nav-toggle::after {
  content: attr(data-label); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--g4); color: var(--t1); font-size: var(--fs-1); font-weight: var(--fw-4); padding: 4px 8px;
  border-radius: var(--r-2); box-shadow: var(--shadow-1); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-2); z-index: 40;
}
.app.nav-collapsed .nav-eintrag:hover::after, .app.nav-collapsed .nav-eintrag:focus-visible::after,
.app.nav-collapsed .badge:hover::after, .app.nav-collapsed .nav-toggle:hover::after { opacity: 1; }
.app.nav-collapsed .badge, .app.nav-collapsed .nav-toggle { position: relative; justify-content: center; padding: 0; width: 40px; margin: 0 auto; }
.app.nav-collapsed .sidebar-fuss { padding: var(--sp-3) var(--sp-2); }

/* Kopfzeile (§3.2) */
.kopf {
  position: sticky; top: 0; z-index: 20; height: var(--header-h);
  background: var(--g1); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--content-pad);
}
.kopf-titel { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: var(--sp-3); }
.kopf h1 { font-size: var(--fs-5); font-weight: var(--fw-6); color: var(--t1); line-height: var(--lh-tight); white-space: nowrap; }
.kopf-untertitel { font-size: var(--fs-3); color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kopf-untertitel:empty { display: none; }
.kopf-aktionen { display: flex; align-items: center; gap: var(--sp-2); flex: 0 0 auto; }
.kopf-aktionen:empty { display: none; }

@media (max-width: 1299px) {
  .kopf-titel { flex-direction: column; align-items: stretch; gap: 0; }
  .kopf-untertitel { font-size: var(--fs-1); color: var(--t3); max-width: 100%; }
}
@media (max-width: 1099px) {
  .app { grid-template-columns: var(--sidebar-w-rail) minmax(0, 1fr); }
  .app .marke-name { font-size: var(--fs-0); overflow: hidden; text-overflow: ellipsis; }
  .app .marke-sub, .app .nav-suche, .app .nav-label, .app .nav-toggle-text, .app .badge-text, .app .nav-toggle { display: none; }
  .app .nav-gruppe { font-size: 0; padding: 0; height: 0; border-top: 1px solid var(--line); margin: var(--sp-3) var(--sp-1); }
  .app .nav { padding: var(--sp-3) var(--sp-2); overflow: visible; }
  .app .sidebar { overflow: visible; }
  .app .nav-eintrag { justify-content: center; padding: 0; width: 40px; margin: 0 auto; }
  .app .nav-zaehler { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; min-width: 0; padding: 0; font-size: 0; border-radius: var(--r-full); background: var(--t3); }
  .app .nav-zaehler.warn { background: var(--warn); }
  .app .nav-eintrag::after, .app .badge::after {
    content: attr(data-label); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    background: var(--g4); color: var(--t1); font-size: var(--fs-1); font-weight: var(--fw-4); padding: 4px 8px;
    border-radius: var(--r-2); box-shadow: var(--shadow-1); white-space: nowrap; pointer-events: none;
    opacity: 0; transition: opacity var(--dur-2); z-index: 40;
  }
  .app .nav-eintrag:hover::after, .app .nav-eintrag:focus-visible::after, .app .badge:hover::after { opacity: 1; }
  .app .badge { position: relative; justify-content: center; padding: 0; width: 40px; margin: 0 auto; }
  .kpi { grid-template-columns: repeat(3, 1fr); }
  .kpi-feld:nth-child(3n) { border-right: 0; }
  .kpi-feld:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .zwei-spalten { grid-template-columns: 1fr; }
}
@media (max-width: 799px) {
  .app, .app.nav-collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; width: var(--sidebar-w); z-index: 31; transform: translateX(-100%);
    box-shadow: none; transition: transform var(--dur-2) var(--ease-out); overflow: hidden;
  }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-2); }
  .app .marke-name { font-size: var(--fs-3); }
  .app .marke-sub, .app .nav-suche, .app .nav-label, .app .badge-text { display: revert; }
  .app .nav-suche { display: block; }
  .app .nav-gruppe { font-size: var(--fs-0); padding: var(--sp-6) var(--sp-3) var(--sp-2); height: auto; border: 0; margin: 0; }
  .app .nav { padding: var(--sp-3); }
  .app .nav-eintrag { justify-content: flex-start; padding: 0 var(--sp-3); width: auto; margin: 0; }
  .app .nav-zaehler { position: static; width: auto; height: 18px; min-width: 18px; padding: 0 6px; font-size: var(--fs-0); background: var(--g4); }
  .app .nav-eintrag::after, .app .badge::after { display: none; }
  .app .badge { justify-content: flex-start; padding: 0 var(--sp-2); width: 100%; }
  .btn.menu-toggle { display: inline-flex; }
  .kpi { grid-template-columns: repeat(2, 1fr); }
  .kpi-feld:nth-child(3n) { border-right: 1px solid var(--line); }
  .kpi-feld:nth-child(2n) { border-right: 0; }
  .kpi-feld:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .inhalt { padding: var(--sp-4); }
}

/* ---------- Karte (§4.5) ---------- */
.karte { background: var(--g2); border: 1px solid var(--line); border-radius: var(--r-3); min-width: 0; }
.karte-kopf { height: 48px; display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4); border-bottom: 1px solid var(--line); }
.karte-kopf h2 { font-size: var(--fs-4); font-weight: var(--fw-6); color: var(--t1); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.karte-kopf-aktionen { display: flex; align-items: center; gap: var(--sp-2); }
.karte-koerper { padding: var(--sp-4); }
.karte-koerper > * + * { margin-top: var(--sp-4); }
.karte-tabelle .karte-koerper { padding: 0; }
.karte-fuss { min-height: 40px; display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4); border-top: 1px solid var(--line); font-size: var(--fs-1); color: var(--t2); }
.karte-fuss .fuss-rechts { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; }
.untergruppe { padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.untergruppe > h3 { font-size: var(--fs-3); font-weight: var(--fw-6); color: var(--t1); margin-bottom: var(--sp-3); }
.zwei-spalten { display: grid; grid-template-columns: repeat(2, minmax(320px, 1fr)); gap: var(--sp-6); }
.raster { display: grid; gap: var(--sp-4); }
.raster-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.raster-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- KPI-Karte (§4.1) ---------- */
.kpi { display: grid; grid-template-columns: repeat(6, 1fr); }
.kpi-feld { padding: var(--sp-4) var(--sp-5); border-right: 1px solid var(--line); min-width: 0; }
.kpi-feld:last-child { border-right: 0; }
.kpi-label { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-2); color: var(--t2); }
.kpi-wert { font-size: var(--fs-6); font-weight: var(--fw-6); color: var(--t1); line-height: var(--lh-tight); margin-top: var(--sp-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-wert.fehlt { color: var(--t3); }
.kpi-unter { font-size: var(--fs-1); color: var(--t3); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skeleton { display: block; background: var(--g3); border-radius: var(--r-1); position: relative; overflow: hidden; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--g4), transparent);
  animation: wandern 1.2s linear infinite;
}
@keyframes wandern { to { transform: translateX(100%); } }
.kpi-wert .skeleton { height: 28px; width: 60%; margin-top: 2px; }
.kpi-unter .skeleton { height: 12px; width: 80%; }

/* ---------- Zeitraumleiste (§4.2) ---------- */
.zeitraum { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; min-height: 36px; }
.segmente { display: inline-flex; background: var(--g2); border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.segment {
  height: 34px; padding: 0 var(--sp-3); border: 0; background: transparent; color: var(--t2);
  font-size: var(--fs-2); font-weight: var(--fw-5); cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-1), color var(--dur-1);
}
.segment + .segment { border-left: 1px solid var(--line); }
.segment:hover { background: var(--g3); color: var(--t1); }
.segment.aktiv, .segment[aria-pressed="true"], .segment[aria-selected="true"] { background: var(--g4); color: var(--t1); }
.segment:focus-visible { outline: none; box-shadow: inset var(--focus); }
.segment:disabled { opacity: .45; cursor: not-allowed; }
.zeitraum .feld { flex-direction: row; align-items: center; gap: var(--sp-2); }
.zeitraum .feld label { margin: 0; }
.zeitraum input[type="date"] { width: 132px; }
.zeitraum .zeitraum-meta { margin-left: auto; font-size: var(--fs-1); color: var(--t3); }

/* ---------- Buttons (§4.6) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; min-width: 64px; padding: 0 var(--sp-3); border-radius: var(--r-2);
  border: 1px solid transparent; font-size: var(--fs-3); font-weight: var(--fw-5); line-height: 1;
  cursor: pointer; white-space: nowrap; text-decoration: none; user-select: none;
  transition: background-color var(--dur-1), color var(--dur-1), border-color var(--dur-1), box-shadow var(--dur-1), opacity var(--dur-1);
}
.btn .icon { width: 16px; height: 16px; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-klein { height: 28px; padding: 0 var(--sp-2); font-size: var(--fs-2); min-width: 0; }
.btn-gross { height: 36px; }
.btn-icon { min-width: 0; width: 32px; padding: 0; }
.btn-icon.btn-klein { width: 28px; }
.btn-icon .icon { width: 18px; height: 18px; }
.btn-primaer { background: var(--akzent-stark); color: var(--ink); }
.btn-primaer:hover:not(:disabled) { background: var(--akzent-hover); box-shadow: var(--glow-akzent); }
.btn-primaer:active:not(:disabled) { background: var(--akzent-stark); transform: translateY(1px); }
.btn-primaer:focus-visible { box-shadow: var(--focus); }
.btn-sekundaer { background: var(--g3); color: var(--t1); border-color: var(--line-strong); }
.btn-sekundaer:hover:not(:disabled) { background: var(--g4); }
.btn-sekundaer:active:not(:disabled) { background: var(--g3); }
.btn-gefaehrlich { background: transparent; color: var(--stop); border-color: var(--stop-40); }
.btn-gefaehrlich:hover:not(:disabled) { background: var(--stop-14); }
.btn-gefaehrlich-bestaetigt { background: var(--stop); color: var(--ink); }
.btn-gefaehrlich-bestaetigt:hover:not(:disabled) { background: var(--stop-hell); }
.btn-leise { background: transparent; color: var(--t2); }
.btn-leise:hover:not(:disabled) { background: var(--g3); color: var(--t1); }
.btn-link { background: transparent; color: var(--akzent); padding: 0; height: auto; min-width: 0; border: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.btn-link:hover:not(:disabled) { color: var(--akzent-hover); }
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"] .spinner { color: inherit; }
.btn-primaer .spinner { border-top-color: var(--ink); border-right-color: var(--ink); }
.btn-sekundaer .spinner, .btn-leise .spinner { border-top-color: var(--t2); border-right-color: var(--t2); }
.aktionen { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.aktionen-rechts { justify-content: flex-end; }

/* ---------- Eingaben (§4.7) ---------- */
input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="date"], input[type="url"], input[type="email"], select, textarea, .eingabe {
  height: 32px; width: 100%; background: var(--g3); border: 1px solid var(--line-strong); border-radius: var(--r-2);
  color: var(--t1); font-size: var(--fs-3); padding: 0 10px; outline: none; min-width: 0;
  transition: border-color var(--dur-1), box-shadow var(--dur-1), background-color var(--dur-1);
}
input::placeholder, textarea::placeholder { color: var(--t3); }
input:hover:not(:disabled):not(:focus), select:hover:not(:disabled):not(:focus), textarea:hover:not(:disabled):not(:focus) { border-color: var(--t3); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--akzent); box-shadow: var(--focus); }
input:disabled, select:disabled, textarea:disabled { opacity: .45; cursor: not-allowed; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--stop); }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; text-align: right; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { appearance: none; margin: 0; }
input[type="search"]::-webkit-search-cancel-button { appearance: none; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
textarea { height: auto; min-height: calc(3 * var(--fs-3) * var(--lh-text) + 16px); padding: 8px 10px; line-height: var(--lh-text); resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; }
.feld { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.feld > label, .feld-label { font-size: var(--fs-1); font-weight: var(--fw-5); color: var(--t2); }
.feld-hilfe { font-size: var(--fs-1); color: var(--t3); line-height: var(--lh-ui); }
.feld-hilfe:empty { display: none; }
.feld-fehler { font-size: var(--fs-1); color: var(--stop); line-height: var(--lh-ui); }
.feld-fehler:empty { display: none; }
.feld-zaehler { font-size: var(--fs-1); color: var(--t3); text-align: right; }
.feld-zaehler.warn { color: var(--warn); } .feld-zaehler.stop { color: var(--stop); }
.feld-huelle { position: relative; display: flex; align-items: center; }
.feld-huelle > input, .feld-huelle > select { flex: 1; }
.feld-suffix { position: absolute; right: 10px; top: 0; height: 32px; display: flex; align-items: center; font-size: var(--fs-2); color: var(--t3); pointer-events: none; }
.feld-huelle.mit-suffix > input { padding-right: 40px; }
.feld-huelle.mit-icon-links > input { padding-left: 32px; }
.feld-icon-links { position: absolute; left: 9px; top: 0; height: 32px; display: flex; align-items: center; color: var(--t3); pointer-events: none; }
.feld-icon-links .icon { width: 16px; height: 16px; }
.feld-chevron { position: absolute; right: 8px; top: 0; height: 32px; display: flex; align-items: center; color: var(--t3); pointer-events: none; }
.feld-chevron .icon { width: 16px; height: 16px; }
.feld-huelle.passwort > input { padding-right: 36px; }
.feld-auge { position: absolute; right: 2px; top: 2px; width: 28px; height: 28px; }
.feld-inline { display: flex; align-items: center; gap: var(--sp-2); }
.feld-inline > input { width: 96px; }
.formular-zeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-4); }
.formular-aktionen { display: flex; justify-content: flex-end; gap: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.formular-aktionen .links { margin-right: auto; display: flex; gap: var(--sp-2); align-items: center; }

/* Datei-Drop */
.drop {
  min-height: 120px; border: 1px dashed var(--line-strong); border-radius: var(--r-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-4); text-align: center; color: var(--t2); font-size: var(--fs-3);
  transition: border-color var(--dur-1), background-color var(--dur-1);
}
.drop .icon { width: 24px; height: 24px; color: var(--t3); }
.drop.dragover { border-color: var(--akzent); background: var(--akzent-14); }
.drop .feld-hilfe { max-width: 40ch; }
.drop input[type="file"] { display: none; }
.drop-datei { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-2); color: var(--t1); }
.drop-datei .meta { color: var(--t3); }

/* Checkbox (§4.8) */
.checkbox { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; padding: 5px; margin: -5px; border-radius: var(--r-1); font-size: var(--fs-3); color: var(--t1); }
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.checkbox-kasten {
  width: 18px; height: 18px; border-radius: var(--r-1); border: 1px solid var(--line-strong); background: var(--g3);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--ink);
  transition: background-color var(--dur-1), border-color var(--dur-1), box-shadow var(--dur-1);
}
.checkbox-kasten .icon { width: 14px; height: 14px; display: none; }
.checkbox-kasten .strich { display: none; width: 10px; height: 2px; background: var(--ink); border: 0; margin: 0; border-radius: 1px; }
.checkbox:hover .checkbox-kasten { border-color: var(--t3); }
.checkbox input:focus-visible + .checkbox-kasten { box-shadow: var(--focus); }
.checkbox input:checked + .checkbox-kasten { background: var(--akzent-stark); border-color: var(--akzent-stark); }
.checkbox input:checked + .checkbox-kasten .icon { display: block; }
.checkbox input:indeterminate + .checkbox-kasten { background: var(--akzent-stark); border-color: var(--akzent-stark); }
.checkbox input:indeterminate + .checkbox-kasten .strich { display: block; }
.checkbox input:disabled ~ * { opacity: .45; cursor: not-allowed; }
.checkbox.nur-kasten { margin: 0; padding: 5px; }

/* Toggle (§4.9) */
.toggle { display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; font-size: var(--fs-3); color: var(--t1); }
.toggle-bahn {
  width: 36px; height: 20px; border-radius: var(--r-full); background: var(--g4); border: 0; padding: 2px; cursor: pointer;
  position: relative; flex: 0 0 auto; transition: background-color var(--dur-1);
}
.toggle-bahn:focus-visible { outline: none; box-shadow: var(--focus); }
.toggle-knopf { display: block; width: 16px; height: 16px; border-radius: var(--r-full); background: var(--t1); transition: transform var(--dur-1), background-color var(--dur-1); }
.toggle-bahn[aria-checked="true"] { background: var(--akzent-stark); }
.toggle-bahn[aria-checked="true"] .toggle-knopf { transform: translateX(16px); background: var(--ink); }
.toggle-bahn:disabled { opacity: .45; cursor: not-allowed; }
.toggle-zustand { font-size: var(--fs-1); color: var(--t3); }

/* ---------- Pille (§4.10) ---------- */
.pille {
  display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 var(--sp-2); border-radius: var(--r-full);
  font-size: var(--fs-0); font-weight: var(--fw-6); letter-spacing: 0.01em; white-space: nowrap; vertical-align: middle;
}
.pille::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-full); background: currentColor; display: none; }
.pille.mit-punkt::before { display: inline-block; }
.pille-ok { background: var(--ok-14); color: var(--ok); }
.pille-warn { background: var(--warn-14); color: var(--warn); }
.pille-stop { background: var(--stop-14); color: var(--stop); }
.pille-info { background: var(--info-14); color: var(--info); }
.pille-neutral { background: var(--g4); color: var(--t2); }
.pille-akzent { background: var(--akzent-14); color: var(--akzent); }
.pille-neu { background: var(--sekundaer-14); color: var(--sekundaer); }
.mini-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-1); font-size: var(--fs-0); font-weight: var(--fw-6); }

/* ---------- Tabelle (§4.3) ---------- */
.tabelle-wrapper { overflow: auto; max-height: var(--tabelle-max, none); position: relative; }
.tabelle { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--fs-2); }
.tabelle th, .tabelle td { padding: 0 var(--sp-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; text-align: left; vertical-align: middle; }
.tabelle thead th {
  position: sticky; top: 0; z-index: 2; height: var(--row-h-head); background: var(--g3);
  font-size: var(--fs-1); font-weight: var(--fw-5); color: var(--t2); border-bottom: 1px solid var(--line-strong);
}
.tabelle th.sortierbar { cursor: pointer; user-select: none; }
.tabelle th.sortierbar:hover { color: var(--t1); }
.tabelle th.sortierbar:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--akzent); }
.tabelle th[aria-sort="ascending"], .tabelle th[aria-sort="descending"] { color: var(--t1); }
.tabelle th .th-inhalt { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.tabelle th .th-inhalt .icon { width: 14px; height: 14px; }
.tabelle th.zahl, .tabelle td.zahl { text-align: right; }
.tabelle th.zahl .th-inhalt { flex-direction: row-reverse; }
.tabelle tbody td { height: var(--row-h); color: var(--t1); border-bottom: 1px solid var(--line); background: var(--g2); }
.tabelle tbody tr:hover td { background: var(--g3); }
.tabelle tbody tr.gewaehlt td { background: var(--akzent-14); }
.tabelle tbody tr.gewaehlt:hover td { background: var(--akzent-24); }
.tabelle tbody tr.aktiv td { background: var(--g4); }
.tabelle tbody td:focus-visible, .tabelle tbody tr:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--akzent); }
.tabelle tbody tr.spacer td { height: auto; padding: 0; border: 0; background: transparent; }
.tabelle tbody tr.spacer:hover td { background: transparent; }
.tabelle .sp-auswahl { width: 36px; padding: 0 9px; }
.tabelle .sp-auswahl .checkbox { margin: 0; padding: 5px; }
.tabelle .sticky-links { position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--line-strong); }
.tabelle thead .sticky-links { z-index: 3; }
.tabelle .sticky-links.nach-auswahl { left: 36px; }
.tabelle .sp-auswahl.sticky-links { left: 0; }
.tabelle tr.filterzeile th { top: var(--row-h-head); height: 36px; background: var(--g2); border-bottom: 1px solid var(--line); padding: 0 6px; z-index: 2; }
.tabelle tr.filterzeile th.sticky-links { z-index: 3; }
.tabelle tr.filterzeile input, .tabelle tr.filterzeile select { height: 28px; font-size: var(--fs-1); padding: 0 8px; }
.tabelle tr.filterzeile select { padding-right: 24px; }
.tabelle td.zelle-stop { color: var(--stop); } .tabelle td.zelle-ok { color: var(--ok); } .tabelle td.zelle-warn { color: var(--warn); }
.tabelle td.durchgestrichen { text-decoration: line-through; color: var(--t3); }
.tabelle tr.summe td { position: sticky; bottom: 0; background: var(--g3); font-weight: var(--fw-6); border-top: 1px solid var(--line-strong); z-index: 1; }
.tabelle-zustand td { height: auto !important; padding: 0 !important; }
.tabelle-fuss { min-height: 32px; display: flex; align-items: center; padding: 0 var(--sp-4); font-size: var(--fs-1); color: var(--t2); border-top: 1px solid var(--line); }
.aktionsleiste {
  min-height: 40px; display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4);
  background: var(--g4); border-top: 1px solid var(--line-strong); font-size: var(--fs-2); color: var(--t1);
  position: sticky; bottom: 0; z-index: 3;
}
.aktionsleiste .aktionen { margin-left: var(--sp-1); }
.tabelle-skeleton td { height: var(--row-h); }
.tabelle-skeleton .skeleton { height: 12px; }

/* Heatmap-Zelle (§4.4) */
.tabelle td.heat { width: 56px; padding: 0 4px; text-align: center; }
.heat-block {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 24px; border-radius: var(--r-1);
  font-size: var(--fs-0); font-weight: var(--fw-5); border: 1px solid transparent;
}
.heat-0 { background: var(--heat-0); color: var(--heat-ink-0); border-color: var(--line); }
.heat-1 { background: var(--heat-1); color: var(--heat-ink-1); }
.heat-2 { background: var(--heat-2); color: var(--heat-ink-2); }
.heat-3 { background: var(--heat-3); color: var(--heat-ink-3); }
.heat-4 { background: var(--heat-4); color: var(--heat-ink-4); }
.heat-fehlt { color: var(--t3); }
.heat-band { color: var(--t2); }
.tabelle th.zielmonat { color: var(--sekundaer); box-shadow: inset 0 -2px 0 var(--sekundaer); }
.tabelle td.zielmonat .heat-block { border-color: var(--sekundaer); }

/* ---------- Stepper (§4.11) ---------- */
.stepper { display: flex; align-items: center; height: 48px; gap: 0; }
.stepper-schritt { display: flex; align-items: center; gap: var(--sp-2); background: transparent; border: 0; padding: 0 var(--sp-2); height: 100%; color: var(--t3); font-size: var(--fs-3); cursor: default; border-radius: var(--r-2); }
.stepper-schritt:focus-visible { outline: none; box-shadow: var(--focus); }
.stepper-kreis {
  width: 24px; height: 24px; border-radius: var(--r-full); border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-1); font-weight: var(--fw-6); color: var(--t3); flex: 0 0 auto;
}
.stepper-kreis .icon { width: 14px; height: 14px; }
.stepper-schritt.erledigt { color: var(--t2); cursor: pointer; }
.stepper-schritt.erledigt .stepper-kreis { background: var(--akzent-stark); border-color: var(--akzent-stark); color: var(--ink); }
.stepper-schritt.aktuell { color: var(--t1); font-weight: var(--fw-6); }
.stepper-schritt.aktuell .stepper-kreis { border: 2px solid var(--akzent); color: var(--akzent); }
.stepper-linie { flex: 1; height: 1px; background: var(--line); min-width: 24px; }
.stepper-linie.erledigt { background: var(--akzent); }

/* ---------- Fortschrittsleiste (§4.12) ---------- */
.fortschritt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fortschritt-zeile { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-1); color: var(--t2); }
.fortschritt-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t1); }
.fortschritt-zaehler { color: var(--t2); }
.fortschritt-bahn { height: 6px; border-radius: var(--r-full); background: var(--g4); overflow: hidden; position: relative; }
.fortschritt-fuellung { height: 100%; width: 100%; background: var(--akzent); border-radius: var(--r-full); transform-origin: left; transform: scaleX(0); transition: transform var(--dur-2) var(--ease-out); }
.fortschritt.unbestimmt .fortschritt-fuellung { width: 30%; transform: none; animation: laeufer 1.4s linear infinite alternate; }
@keyframes laeufer { from { transform: translateX(0); } to { transform: translateX(233%); } }
.fortschritt.abgebrochen .fortschritt-fuellung { background: var(--warn); }
.fortschritt.fehler .fortschritt-fuellung { background: var(--stop); }
.fortschritt.fertig .fortschritt-fuellung { background: var(--ok); }
.fortschritt-fehler { font-size: var(--fs-1); color: var(--stop); }
.fortschritt-fehler:empty { display: none; }

/* ---------- Toast (§4.13) ---------- */
.toast-root { position: fixed; right: var(--sp-6); bottom: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-2); z-index: 60; width: 360px; max-width: calc(100vw - 2 * var(--sp-6)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  background: var(--g4); border: 1px solid var(--line-strong); border-radius: var(--r-3); box-shadow: var(--shadow-2);
  font-size: var(--fs-2); color: var(--t1);
  animation: toast-ein var(--dur-2) var(--ease-out);
}
.toast.raus { animation: toast-aus var(--dur-1) forwards; }
@keyframes toast-ein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-aus { to { opacity: 0; transform: translateY(4px); } }
.toast > .icon { width: 18px; height: 18px; margin-top: 1px; }
.toast.ok > .icon { color: var(--ok); } .toast.info > .icon { color: var(--info); } .toast.fehler > .icon { color: var(--stop); } .toast.warn > .icon { color: var(--warn); }
.toast-text { flex: 1; min-width: 0; line-height: var(--lh-ui); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toast.fehler .toast-text { -webkit-line-clamp: 4; }
.toast-text b { font-weight: var(--fw-6); }
.toast-aktion { color: var(--akzent); background: transparent; border: 0; padding: 0; cursor: pointer; font-size: var(--fs-2); font-weight: var(--fw-5); white-space: nowrap; }
.toast-aktion:hover { color: var(--akzent-hover); }
.toast-aktion:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-1); }
.toast .btn-icon { width: 24px; height: 24px; margin: -3px -6px -3px 0; }
.toast .btn-icon .icon { width: 16px; height: 16px; }

/* ---------- Leer / Ladend / Fehler (§4.14) ---------- */
.zustand { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-6); text-align: center; }
.zustand .icon { width: 24px; height: 24px; color: var(--t3); }
.zustand.fehler .icon { color: var(--stop); }
.zustand-titel { font-size: var(--fs-3); font-weight: var(--fw-6); color: var(--t1); }
.zustand-text { font-size: var(--fs-2); color: var(--t2); max-width: 40ch; line-height: var(--lh-text); }
.zustand .btn { margin-top: var(--sp-2); }
.zustand-zeilen { display: flex; flex-direction: column; }
.zustand-zeile { height: var(--row-h); display: flex; align-items: center; padding: 0 var(--sp-3); border-bottom: 1px solid var(--line); gap: var(--sp-4); }
.zustand-zeile .skeleton { height: 12px; }

/* ---------- Drawer + Modal (§4.15) ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; }
.overlay-scrim { position: absolute; inset: 0; background: var(--scrim); }
.drawer {
  position: relative; margin-left: auto; height: 100%; width: var(--drawer-w, 640px); max-width: 100vw;
  background: var(--g2); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; animation: drawer-ein var(--dur-2) var(--ease-out);
}
.drawer.raus { animation: drawer-aus var(--dur-1) forwards; }
@keyframes drawer-ein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawer-aus { to { transform: translateX(24px); opacity: 0; } }
.drawer-kopf { height: 56px; flex: 0 0 auto; display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4) 0 var(--sp-6); border-bottom: 1px solid var(--line); }
.drawer-kopf h2 { font-size: var(--fs-4); font-weight: var(--fw-6); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-koerper { flex: 1; overflow: auto; padding: var(--sp-6); }
.drawer-koerper > * + * { margin-top: var(--sp-4); }
.drawer-fuss { height: 56px; flex: 0 0 auto; display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-6); border-top: 1px solid var(--line); background: var(--g2); }
.drawer-fuss .rechts { margin-left: auto; display: flex; gap: var(--sp-2); }
.modal-mitte { position: relative; margin: auto; width: 440px; max-width: calc(100vw - 32px); background: var(--g4); border-radius: var(--r-3); box-shadow: var(--shadow-2); padding: var(--sp-6); animation: toast-ein var(--dur-2) var(--ease-out); }
.modal-mitte.raus { animation: toast-aus var(--dur-1) forwards; }
.modal-mitte h2 { font-size: var(--fs-4); font-weight: var(--fw-6); margin-bottom: var(--sp-3); }
.modal-text { font-size: var(--fs-3); color: var(--t2); line-height: var(--lh-text); }
.modal-aktionen { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-6); }
body.overlay-offen { overflow: hidden; }

/* ---------- Sperr-Kasten (§4.16) ---------- */
.sperre { position: relative; display: flex; gap: 10px; padding: 12px 14px; background: var(--g3); border: 1px solid var(--line-strong); border-radius: var(--r-2); }
.sperre > .icon { width: 16px; height: 16px; color: var(--t2); margin-top: 2px; }
.sperre-inhalt { flex: 1; min-width: 0; padding-right: 72px; }
.sperre-regel { font-size: var(--fs-2); font-weight: var(--fw-6); color: var(--t1); }
.sperre-grund { font-size: var(--fs-1); color: var(--t2); margin-top: 2px; line-height: var(--lh-ui); }
.sperre .pille { position: absolute; top: 10px; right: 12px; }
.sperre-liste { display: flex; flex-direction: column; gap: var(--sp-2); }

/* Hinweis-Kasten (info/warn/stop-Tint) */
.hinweis { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-2); font-size: var(--fs-2); line-height: var(--lh-text); border: 1px solid transparent; }
.hinweis > .icon { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.hinweis-info { background: var(--info-14); color: var(--t1); } .hinweis-info > .icon { color: var(--info); }
.hinweis-warn { background: var(--warn-14); color: var(--t1); } .hinweis-warn > .icon { color: var(--warn); }
.hinweis-stop { background: var(--stop-14); color: var(--t1); } .hinweis-stop > .icon { color: var(--stop); }
.hinweis-ok { background: var(--ok-14); color: var(--t1); } .hinweis-ok > .icon { color: var(--ok); }
.hinweis b { font-weight: var(--fw-6); }
.hinweis-liste { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.hinweis-liste li { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-2); }
.hinweis-liste .punkt { width: 6px; height: 6px; border-radius: var(--r-full); flex: 0 0 auto; }
.punkt-ok { background: var(--ok); } .punkt-warn { background: var(--warn); } .punkt-stop { background: var(--stop); } .punkt-info { background: var(--info); } .punkt-neutral { background: var(--t3); }

/* ---------- Score-Ring (§5.4) ---------- */
.score-ring { position: relative; width: 28px; height: 28px; display: inline-block; }
.score-ring svg { width: 28px; height: 28px; transform: rotate(-90deg); }
.score-ring .bahn { stroke: var(--g4); fill: none; stroke-width: 3; }
.score-ring .bogen { stroke: var(--sekundaer); fill: none; stroke-width: 3; stroke-linecap: round; }
.score-ring .zahl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-0); font-weight: var(--fw-6); color: var(--t1); }

/* ---------- Diagramm (§5.1.1) ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 160px; }
.chart .balken { fill: var(--akzent-24); }
.chart .balken-kante { fill: var(--akzent); }
.chart .linie { fill: none; stroke: var(--sekundaer); stroke-width: 1.5; }
.chart .punkt { fill: var(--sekundaer); }
.chart .nulllinie { stroke: var(--line-strong); stroke-width: 1; }
.chart .achse { fill: var(--t3); font-size: var(--fs-0); font-family: var(--font); }
.chart .fang { fill: transparent; }
.chart .fang:hover { fill: var(--akzent-14); }
.chart-legende { position: absolute; top: 4px; right: 8px; display: flex; gap: var(--sp-3); font-size: var(--fs-1); color: var(--t2); }
.chart-legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende-balken { width: 10px; height: 10px; background: var(--akzent-24); border-top: 2px solid var(--akzent); }
.legende-linie { width: 14px; height: 0; border-top: 2px solid var(--sekundaer); }
.tooltip {
  position: fixed; z-index: 70; background: var(--g4); color: var(--t1); font-size: var(--fs-1); padding: 6px 8px;
  border-radius: var(--r-2); box-shadow: var(--shadow-1); pointer-events: none; white-space: nowrap; border: 1px solid var(--line-strong);
}

/* ---------- Kleine Tabelle in Karten (Verbrauch, Verlauf) ---------- */
.mini-tabelle { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
.mini-tabelle th { text-align: left; font-size: var(--fs-1); font-weight: var(--fw-5); color: var(--t2); padding: 6px 8px; border-bottom: 1px solid var(--line-strong); }
.mini-tabelle td { padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--t1); }
.mini-tabelle th.zahl, .mini-tabelle td.zahl { text-align: right; }
.mini-tabelle tr:last-child td { border-bottom: 0; }

/* Aufklappbarer Abschnitt */
.aufklapp > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; font-size: var(--fs-3); font-weight: var(--fw-5); color: var(--t2); padding: var(--sp-1) 0; border-radius: var(--r-1); }
.aufklapp > summary::-webkit-details-marker { display: none; }
.aufklapp > summary:hover { color: var(--t1); }
.aufklapp > summary:focus-visible { outline: none; box-shadow: var(--focus); }
.aufklapp > summary .icon { width: 16px; height: 16px; transition: transform var(--dur-1); }
.aufklapp[open] > summary .icon { transform: rotate(90deg); }
.aufklapp-inhalt { padding-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-4); }

/* Karten-Grid (Product Research) */
.karten-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.karten-grid-klein { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---------- Bewegung (§6) ---------- */
.flug-klon { position: fixed; width: 12px; height: 12px; border-radius: var(--r-1); background: var(--akzent); box-shadow: var(--glow-akzent); will-change: transform; pointer-events: none; z-index: 80; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .skeleton::after { display: none; }
  .fortschritt.unbestimmt .fortschritt-fuellung { width: 100%; background: var(--g4); animation: none; }
  .badge.prueft .badge-punkt { animation: none; }
}

/* ---------- Übersicht (§5.1) ---------- */
.seite-uebersicht { display: flex; flex-direction: column; gap: var(--sp-6); }
/* Zweitreihe: dieselben sechs Spalten wie die KPI-Karte, aber eine Zeile hoch */
.kpi-schmal { grid-template-columns: repeat(6, 1fr); }
.kpi-schmal .kpi-feld.kpi2 { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5); }
.kpi2-label { font-size: var(--fs-1); color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi2-wert { font-size: var(--fs-2); font-weight: var(--fw-5); color: var(--t1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ub-spalten { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-6); align-items: start; }
.diagramm { padding: var(--sp-3) var(--sp-4) 0; }
.diagramm:empty { display: none; }
.hinweis-liste li .hinweis-text { flex: 1; min-width: 0; color: var(--t1); }
.hinweis-liste li .btn { margin-left: auto; flex: 0 0 auto; }
.zeitraum .zeitraum-meta { display: flex; align-items: center; gap: var(--sp-3); }
@media (max-width: 1099px) {
  .ub-spalten { grid-template-columns: minmax(0, 1fr); }
  .kpi-schmal, .kpi { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 799px) {
  .kpi-schmal, .kpi { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Keyword Planner (§5.2) ---------- */
.seite-keywords { display: flex; flex-direction: column; gap: var(--sp-4); }
.kw-leiste { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; justify-content: space-between; }
.kw-leiste-links, .kw-leiste-rechts { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.kw-suche { width: 200px; }
.kw-spalten { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--sp-4); align-items: start; }
/* Begriff und Chips bleiben in EINER Zeile — sonst werden die Tabellenzeilen unterschiedlich hoch
   und das Windowing (feste Zeilenhöhe) rechnet falsch. */
.tabelle td .kw-begriff { display: inline; }
.kw-chips { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.kw-chips .pille { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Aussortiert: Begriff bekommt die volle Breite, Status und Aktion stehen darunter. */
.aus-zeile { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--sp-2); align-items: center; }
.aus-begriff { grid-column: 1 / -1; font-weight: var(--fw-5); }
.aus-zeile .pille { justify-self: start; }
.tabelle th.zielmonat { color: var(--sekundaer); box-shadow: inset 0 -2px 0 var(--sekundaer); }
.aus-liste { display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 320px); overflow: auto; }
.aus-zeile { padding: 6px 0; font-size: var(--fs-2); border-bottom: 1px solid var(--line); }
.aus-begriff { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pruef-liste { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--sp-2); }
.pruef-zeile { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-2); padding: 2px 0; }
.liste-schlicht { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-2); color: var(--t2); }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv-zeile { display: flex; gap: var(--sp-3); font-size: var(--fs-2); padding: 3px 0; border-bottom: 1px solid var(--line); }
.kv-k { width: 130px; flex: 0 0 auto; color: var(--t2); }
.kv-v { flex: 1; min-width: 0; color: var(--t1); }
@media (max-width: 1099px) { .kw-spalten { grid-template-columns: minmax(0, 1fr); } }
.hinweis .btn { margin-left: auto; flex: 0 0 auto; align-self: center; }

/* Einrichtungs-Assistent Google Ads (§5.6, L-6) */
.assistent { display: flex; flex-direction: column; gap: var(--sp-2); }
.assistent-kopf { padding-bottom: var(--sp-2); border-bottom: 1px solid var(--line); }
.assistent-schritt { display: flex; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); }
.assistent-schritt:last-child { border-bottom: 0; }
.assistent-schritt.erledigt .assistent-titel { color: var(--t3); text-decoration: line-through; }
.assistent-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.assistent-titel { display: flex; gap: var(--sp-2); align-items: baseline; font-size: var(--fs-2); color: var(--t1); }
.assistent-nr { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 999px; background: var(--g3);
  color: var(--t2); font-size: var(--fs-1); display: inline-flex; align-items: center; justify-content: center; }
.assistent .kopierbar { display: inline-block; margin-top: 2px; padding: 1px 5px; border-radius: 4px;
  background: var(--g3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-1); user-select: all; }

/* Band, wenn das Dashboard ohne Anmeldung erreichbar ist. Nicht wegklickbar. */
/* .offen-band entfaellt — der offene Betrieb steht jetzt als Badge in der Kopfzeile. */
