/* =================================================================
   Energietracker v1.2.0 — App Shell
   Sidebar + thin topbar layout, restored from v0.9.0.
   ================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
strong, b { font-weight: 600; }
/* Mono nur für Code und YAML */
code, pre, kbd, samp { font-family: var(--font-code); font-size: var(--fs-sm); }
small, .small { font-size: var(--fs-sm); }
/* v3.6.0 — Safari vergrößert Text beim Drehen ins Querformat nicht von sich aus */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; }

/* ── Accessibility (N1009) ──────────────────────────────────────── */
/* Sichtbarer Fokus-Ring als Baseline für die Tastatur-Navigation.
   Komponenten mit eigenem :focus-visible (z.B. .topbar__btn) überschreiben das. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Programmatisch fokussierte Container (z.B. <main> bei View-Wechsel) sollen
   keinen Ring zeigen — nur echte Tastatur-Navigation. */
#view:focus { outline: none; }

/* Nur für Screenreader sichtbar: visuell entfernt, aber im Accessibility-Tree. */
.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;
}

/* Skip-Link: aus dem Viewport geschoben, bis er Tastatur-Fokus bekommt. */
.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 1000;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-1);
  color: var(--text-1);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  transform: translateY(-150%);
  transition: transform .15s ease;
}
.skip-link:focus {
  transform: translateY(0);
  text-decoration: none;
}

/* Nutzer mit „prefers-reduced-motion" bekommen keine Bewegungs-Animationen. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Top-level layout grid ──────────────────────────────────────── */
/* v2.5.3 (UI-01) — minmax(0, 1fr) statt 1fr: `1fr` heißt minmax(auto, 1fr),
   und die Mindestbreite breiter Tabellen dehnte die ganze Spalte — obwohl die
   Tabellen in .table-wrap selbst scrollen. Folge waren seitliches Scrollen auf
   dem iPhone in 13 von 21 Ansichten und abgeschnittene Knöpfe bei 1280 px. */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-total) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar view";
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  grid-area: topbar;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-5);
  /* v2.11.0 (Review UI-25) — unter Uhr und Dynamic Island freilassen */
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(var(--sp-5), env(safe-area-inset-left, 0px));
  padding-right: max(var(--sp-5), env(safe-area-inset-right, 0px));
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-1);
  position: sticky; top: 0; z-index: 10;
}
.topbar__brand {
  display: flex; align-items: center; gap: var(--sp-3);
}
/* v3.12.0 (M6) — Logo und Name sind der Weg zur Übersicht */
.topbar__home { display: inline-flex; align-items: center; gap: var(--sp-3); color: inherit; text-decoration: none; border-radius: var(--r-sm); }
.topbar__home:hover .topbar__title { color: var(--accent); }
.topbar__logo {
  width: 22px; height: 22px;
  background-image: url("../img/icon-light.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
[data-theme="dark"] .topbar__logo {
  background-image: url("../img/icon-dark.png");
}
.topbar__title {
  font-size: var(--fs-body); font-weight: 600;
  color: var(--text-1);
}
.topbar__status { font-size: var(--fs-xs);
  color: var(--text-2);
  display: flex; align-items: center; gap: var(--sp-2);
}
.topbar__status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.topbar__actions {
  display: flex; align-items: center; gap: var(--sp-3);
}
/* v2.6.0 — Offline-Hinweis (Daten aus dem Cache des Service Workers) */
.topbar__status--offline {
  color: var(--warning); font-weight: 600;
}
/* v2.6.0 — Abmelden: Textknopf statt Symbol */
.topbar__btn.topbar__btn--text {
  width: auto; padding: 0 var(--sp-3); font-size: var(--fs-sm);
}

/* v2.6.0 — Anmeldebildschirm (opt-in) */
.login-screen {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: var(--sp-4);
  background: var(--bg-0);
}
.login-card {
  width: min(360px, 100%);
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-6); border-radius: var(--r-md);
  background: var(--bg-1); border: 1px solid var(--border-1);
}
.login-card__brand {
  display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-2);
}
.login-card h1 { font-size: var(--fs-xl); margin: 0; }
.login-card__label { font-size: var(--fs-sm); color: var(--text-2); }
.login-card .input { font-size: 16px; }   /* iOS zoomt unter 16 px */
.login-card .ico { flex: none; }
.login-card .btn { justify-content: center; }
.login-card__hint { font-size: var(--fs-xs); margin: 0; }
.topbar__btn {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-1);
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-base); line-height: 1;
  transition: var(--transition);
}
.topbar__btn:hover {
  background: var(--bg-2);
  border-color: var(--border-strong);
}
.topbar__btn:active { transform: translateY(1px); }
.topbar__btn:focus-visible {
  outline: none;
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.topbar__btn-icon { display: inline-block; }
/* v3.4.0 (N1021) — Darstellung: Das Symbol zeigt, was gilt (☀️/🌙); folgt die
   App dem System, sagt es ein kleines „A" (Automatik) unten rechts. */
#theme-toggle { position: relative; }
.topbar__badge {
  position: absolute; right: -5px; bottom: -5px;
  min-width: 16px; height: 16px; padding: 0 var(--sp-1); border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-fg);
  font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: 600; line-height: 16px; text-align: center; pointer-events: none;
}

/* v3.2.0 (F1019) — Umschalter der Nutzungsstufe neben Tag/Nacht */
.topbar__select {
  height: 32px; max-width: 150px;
  padding: 0 var(--sp-2);
  background: transparent; color: var(--text-1);
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  font-size: var(--fs-sm); cursor: pointer;
}
.topbar__select:hover { background: var(--bg-2); border-color: var(--border-strong); }
/* Am Telefon reicht der Platz nur für das Zeichen der Stufe; die Liste liegt darüber */
.topbar__level { position: relative; display: inline-flex; align-items: center; }
.topbar__level-ico { display: none; }
.topbar__select:focus-visible { outline: none; outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 640px) {
  .topbar__level-ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--border-2); border-radius: var(--r-sm); }
  .topbar__select { position: absolute; inset: 0; width: 100%; max-width: none; opacity: 0; font-size: 16px; }   /* 16 px gegen den Zoom */
}

/* v3.2.0 (F1019) — was erst eine höhere Stufe zeigt. Ausgeblendet, nicht
   entfernt: Formularfelder bleiben im Formular (lib/levels.js). */
html[data-level="beginner"] [data-min-level="advanced"],
html[data-level="beginner"] [data-min-level="expert"],
html[data-level="advanced"] [data-min-level="expert"] { display: none !important; }

/* Hinweis über einer Seite der höheren Stufe, und Vorschläge zum Hochstufen */

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-1);
  border-right: 1px solid var(--border-1);
  display: flex; flex-direction: column;
  padding: var(--sp-3) 0 0;
  position: sticky; top: var(--topbar-total);
  height: calc(100vh - var(--topbar-total));
  height: calc(100dvh - var(--topbar-total));
  overflow-y: auto;
}
.sidebar__nav {
  display: flex; flex-direction: column; gap: var(--sp-0);
  padding: 0 var(--sp-3);
  flex: 1;
}
/* v2.11.0 — Bereiche als einzelne Einträge, die Verbrauchsarten als Gruppe */
.sidebar__group { display: flex; flex-direction: column; gap: var(--sp-0); margin: var(--sp-2) 0; }
/* v2.11.0 (Review UI-09) — 11 px in --text-2 statt 9 px unter 3:1 */
.sidebar__group-label {
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-2);
  padding: var(--sp-3) var(--sp-3) var(--sp-1);
}
.sidebar__item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 500;
  border-radius: var(--r-sm);
  position: relative;
  transition: var(--transition);
}
.sidebar__item:hover {
  background: var(--bg-2);
  color: var(--text-1);
  text-decoration: none;
}
.sidebar__icon {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar__item.active {
  background: var(--bg-2);
  color: var(--text-1);
  --ico: var(--accent);
}
.sidebar__footer {
  border-top: 1px solid var(--border-1);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-xs); color: var(--text-3);
  display: flex; gap: var(--sp-1h); align-items: center;
}
.sidebar__footer a { color: var(--text-2); }
/* v3.12.0 (M6) — Stern und Herz: Grafik in der Farbe des Textes, beim Überfahren der Akzent */
.sidebar__footer-ico { display: inline-flex; align-items: center; --ico: currentColor; --ico-f: transparent; }
.sidebar__footer-ico:hover, .sidebar__footer-ico:focus-visible { color: var(--accent); --ico-f: color-mix(in srgb, var(--accent) 14%, transparent); }

/* ── View / main content area ───────────────────────────────────── */
.view {
  grid-area: view;
  padding: var(--sp-5) var(--sp-6);
  max-width: var(--content-max);
  width: 100%;
  min-width: 0;
}
.loading {
  display: flex; align-items: center; justify-content: center;
  height: 240px; color: var(--text-3); font-style: italic;
}
/* v3.10.0 (GitHub #36) — Neuzeichnen am Ort (router.js holdInPlace): der neue Inhalt
   entsteht unter dem alten, ohne Höhe und unsichtbar, aber in voller Breite */
.view-host--pending { height: 0; overflow: hidden; visibility: hidden; }

/* ── View header (title + subtitle + actions) ───────────────────── */
.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--sp-4); gap: var(--sp-4); flex-wrap: wrap;
}
.view-header__title {
  font-size: var(--fs-xl); font-weight: 600; line-height: 1.25;
  color: var(--text-1);
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
}
.view-header__subtitle {
  font-size: var(--fs-body); color: var(--text-2);
  margin-top: var(--sp-1); max-width: 72ch;
}
.view-header__actions {
  display: flex; gap: var(--sp-2); flex-wrap: wrap;
}

/* ── KPI grid ───────────────────────────────────────────────────── */
.kpi-grid { margin-bottom: var(--sp-5); }
.kpi {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  min-width: 0;
}
.kpi__label {
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); line-height: 1.3;
  margin-bottom: var(--sp-1h);
  overflow-wrap: anywhere; hyphens: auto;
}
.kpi__value { font-size: var(--fs-xl); font-weight: 600;
  line-height: 1.15; color: var(--text-1);
}
.kpi__sub {
  font-size: var(--fs-sm); color: var(--text-2);
  margin-top: var(--sp-1);
}
.kpi__sub.positive { color: var(--success); }
.kpi__sub.negative { color: var(--danger); }
.kpi__trend {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  margin-left: var(--sp-1h); padding: var(--sp-0) var(--sp-1h);
  font-size: var(--fs-xs); font-weight: 600;
  border-radius: var(--r-sm);
}
.kpi__trend.up { background: var(--danger-soft); color: var(--danger); }
.kpi__trend.down { background: var(--success-soft); color: var(--success); }
.kpi__trend.flat { background: var(--bg-3); color: var(--text-2); }


/* ── Card ───────────────────────────────────────────────────────── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  min-width: 0;
}
.card__title {
  font-size: var(--fs-base); font-weight: 600;
  color: var(--text-1);
  margin-bottom: var(--sp-3);
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2);
}
.card h2:not(.card__title), .card h3:not(.card__title) { font-size: var(--fs-base); font-weight: 600; color: var(--text-1); }
.card h4 { font-size: var(--fs-body); font-weight: 600; color: var(--text-1); }
.card > p:not(.infobox), .view p:not(.infobox) { max-width: 72ch; }
.card__title-action { margin-left: auto; }

/* ── Raster: feste Spalten, gleiche Höhe je Reihe, keine Lücke ───────
   Regeln R3 und R4 der Designsprache: Die Spaltenzahl setzt lib/fit-grid.js als
   --spalten aus der Zahl sichtbarer Kacheln; ein Rest füllt die letzte Reihe
   über --rest. tests/box-raster.test.mjs misst das auf jeder Seite. */
.grid, .kpi-grid, .dash-answers, .guide-tiles, .export-grid, .raster, .art-raster {
  display: grid;
  grid-template-columns: repeat(var(--spalten, 4), minmax(0, 1fr));
  gap: var(--sp-4);
  align-items: stretch;
}
.grid > *, .kpi-grid > *, .dash-answers > *, .guide-tiles > *, .export-grid > *, .raster > *, .art-raster > * { min-width: 0; margin: 0; }
.grid > .raster-rest, .kpi-grid > .raster-rest, .dash-answers > .raster-rest, .guide-tiles > .raster-rest, .export-grid > .raster-rest, .raster > .raster-rest, .art-raster > .raster-rest { grid-column: span var(--rest, 1); }
.grid > a > .card, .grid > div > .card, .kpi-grid > a > .kpi, .kpi-grid > div > .kpi, .raster > a > .kpi, .raster > div > .card { height: 100%; margin: 0; }

/* ── Misc helpers ───────────────────────────────────────────────── */
.muted { color: var(--text-2); }
/* v2.11.0 (Review UI-09) — „–" für fehlende Werte ist Information, kein
   gesperrtes Element: --text-3 (5:1) statt --text-disabled (unter 3:1) */
.dim   { color: var(--text-3); }
/* Gleich breite Ziffern, wo Zahlen untereinander stehen: in Tabellen. Im Fließtext und in einer
   einzelnen Kennzahl stünde die 1 in einer Lücke, dort bleibt die Textschrift. */
.table, .data-table, .input.num { font-family: var(--font-num); }
/* Geldrichtung und Zustand: nur als Aussage, immer mit einem Wort oder einer Grafik zusammen */
.ton-ok     { color: var(--ton-erfolg); }
.ton-warn   { color: var(--ton-achtung); }
.ton-fehler { color: var(--ton-fehler); }

/* Ein Leerzustand für alle Listen (lib/empty.js): Grafik 48 px, Titel in
   Textgröße statt einer zweiten Seitenüberschrift, ein Satz in Lesebreite. */
.empty {
  text-align: center; padding: var(--sp-8) var(--sp-6); color: var(--text-2);
}
.empty-icon { display: block; margin: 0 auto var(--sp-3); line-height: 0; }
.empty h2, .empty h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-base); font-weight: 600; color: var(--text-1); }
.empty p    { font-size: var(--fs-body); max-width: 56ch; margin: 0 auto var(--sp-3); }
.empty p:last-child { margin-bottom: 0; }

/* ── Untermenü: eine Form für Reiter, Sichten, Filter, Jahre, Zeitraum ────
   Klein, abgerundet viereckig, aktiv gefüllt. Die Klassen der Bausteine
   (.section-tabs__tab, .pill, .seg__btn, .ef-seg__btn) tragen sonst keine Form. */
.section-tabs, .pills, .year-pills, .seg, .ef-seg, .filter-pills { display: flex; flex-wrap: wrap; gap: var(--sp-1h); min-width: 0; }
.section-tabs { margin: 0 0 var(--sp-4); }
.section-tabs__tab, .pill, .seg__btn, .ef-seg__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1h);
  min-height: 30px; margin: 0; padding: var(--sp-1) var(--sp-3);
  font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 500; line-height: 1.2;
  color: var(--text-1); background: var(--bg-1);
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: var(--transition);
}
.section-tabs__tab:hover, .pill:hover, .seg__btn:hover, .ef-seg__btn:hover { background: var(--bg-2); color: var(--text-1); text-decoration: none; }
.section-tabs__tab.active, .pill.active, .seg__btn.active, .seg__btn[aria-pressed="true"], .ef-seg__btn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-fg);
  --ico: currentColor; --ico-f: transparent; --c: currentColor;
}
.section-tabs__tab .sidebar__badge { margin: 0; }
.section-tabs__tab.active .sidebar__badge, .pill.active .sidebar__badge { background: transparent; color: inherit; border: 1px solid currentColor; }
/* Die Verbrauchsarten stehen am Mac in der Seitenleiste */
.section-tabs--mobile { display: none; }

/* Kartenkopf mit Aktion daneben (die Aktion steht nicht in der Überschrift) */
.card__head {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.card__head > .card__title { margin-bottom: 0; }
.card__head > :last-child:not(.card__title) { margin-left: auto; }

.sidebar__error { padding: var(--sp-3); font-size: var(--fs-sm); color: var(--text-2); }
.sidebar__error .btn { margin-top: var(--sp-2); }
.sidebar__label { flex: 1; min-width: 0; }

/* Erfassen am Mac: Knopf in der Kopfleiste */
.topbar__capture { gap: var(--sp-1); }

/* Tab-Leiste und Menü-Hintergrund gibt es nur unter 900 px (iPhone, iPad hochkant) */
.tabbar, .nav-backdrop { display: none; }

/* ── Responsive ─────────────────────────────────────────────────────
   v2.11.0 (Review UI-05) — bis v2.10 stand hier die ganze Seitenleiste als
   Block über dem Inhalt (auf dem iPhone SE drei Viertel des Bildschirms).
   Jetzt: Tab-Leiste unten, Seitenleiste als Menü hinter „Mehr".
   v3.5.0 (N1023) — Schwelle 900 px statt 800 px: auch das iPad hochkant
   (744–834 px) bekommt die Tab-Leiste. Dieselbe Zahl in nav-model.js
   (NAV_SIDEBAR_QUERY / NAV_TABBAR_QUERY), geprüft in tests/nav-threshold.test.mjs. */
@media (max-width: 899.98px) {
  html, body { font-size: var(--fs-md); }   /* 16 px Grundschrift */
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--topbar-total) 1fr;
    grid-template-areas:
      "topbar"
      "view";
  }
  /* .btn aus components.css kommt später und setzt display — daher doppelt */
  .topbar .topbar__capture { display: none; }
  .topbar { padding-left: max(var(--sp-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--sp-4), env(safe-area-inset-right, 0px)); }

  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 70;
    width: min(320px, 86vw); height: 100vh; height: 100dvh;
    padding-top: calc(var(--sp-4) + env(safe-area-inset-top, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    transform: translateX(-105%);
    transition: transform 200ms ease-out, visibility 0s linear 200ms;
    visibility: hidden;
    box-shadow: var(--shadow-3);
  }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform 200ms ease-out; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 65;
    background: var(--bg-overlay);
  }
  .sidebar__item { padding: var(--sp-3) var(--sp-4); font-size: var(--fs-md); }
  .sidebar__footer { padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom, 0px)); font-size: var(--fs-sm); }
  /* v2.13.0 — „Hilfe" steht hier; auch ein Fußzeilen-Link braucht 44 px zum Tippen */
  .sidebar__footer a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 var(--sp-2); }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: var(--bg-1);
    border-top: 1px solid var(--border-2);
  }
  .tabbar__item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-0);
    min-height: 44px; padding: var(--sp-1) var(--sp-0);
    background: none; border: none; cursor: pointer;
    color: var(--text-2); font: inherit; font-size: var(--fs-xs); font-weight: 500;
    text-decoration: none;
  }
  .tabbar__item:hover { text-decoration: none; color: var(--text-1); }
  .tabbar__item.active { color: var(--accent); }
  .tabbar__icon { line-height: 0; }
  .tabbar__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar__item--capture .tabbar__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: var(--r-md);
    background: var(--accent); --ico: var(--accent-fg); --ico-f: transparent;
  }
  .tabbar__item.active { --ico: var(--accent); }
  .tabbar__badge { position: absolute; top: 2px; left: 50%; margin-left: var(--sp-1h); }
  .tabbar__badge .sidebar__badge { margin-left: 0; }

  .view {
    padding: var(--sp-4);
    padding-left: max(var(--sp-4), env(safe-area-inset-left, 0px));
    padding-right: max(var(--sp-4), env(safe-area-inset-right, 0px));
    /* Platz für die Tab-Leiste */
    padding-bottom: calc(var(--sp-6) + var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  }
  .section-tabs--mobile { display: flex; }
  /* Reiter ohne Umbruch querwischbar */
  .section-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .section-tabs::-webkit-scrollbar { display: none; }
  .section-tabs__tab { flex: none; }
}
/* Tippziel: dieselbe Form, nur höher */
@media (pointer: coarse), (max-width: 899.98px) {
  .section-tabs__tab, .pill, .seg__btn, .ef-seg__btn { min-height: 44px; }
}

/* Knöpfe im Kartentitel: normale Bedienschrift */
.card__title .btn { font-size: var(--fs-sm); }

/* v3.12.0 (M2) — Verbrauch ist eine Untergruppe von Alltag */
.sidebar__group .sidebar__group { margin: 0; }
.sidebar__group .sidebar__group .sidebar__group-label { padding-top: var(--sp-2); font-weight: 500; }
