/* ==========================================================================
   Stromnachbar — Design-System v3
   Phase 1 · Token-Layer
   Stand: 2026-05-22

   Quelle: DESIGN-V3.md §4
   Scope dieser Datei aktuell: NUR Tokens + minimaler Basis-Reset + Typo-Utilities.
   Atome (btn, pill, field, …) und Komponenten (nav, hero, card, …) kommen in
   eigenen Phase-1-Schritten nach Review.

   Prinzip: eine Sprache, zwei Dichten.
     - Default (Body ohne Modifier-Klasse) = public-spacious
     - <body class="density-app"> = app-compact (überschreibt --space-*)

   Disziplin:
     - Klein-Blue ist Brand, Lila ist Action — keine Vermischung.
     - Kein Gelb (Lesbarkeit, v1-Erfahrung).
     - Kein Kupfer, kein Mist-Blau, kein Sunflower — auch nicht als Übergang.
     - Keine Rollenfarbe (Host/Gast) — Rollen werden nur via Eyebrow markiert.
   ========================================================================== */


/* --------------------------------------------------------------------------
   0 · Font (Nunito Variable, self-hosted)
   Datei muss bei Deploy aus frontend/fonts/ nach frontend-v3/fonts/
   kopiert werden — lokal im Workspace nicht versioniert.
   Memory: [[selfhosted-fonts]], [[google-fonts-ua]].
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Nunito';
  src: url('./fonts/nunito-variable.woff2') format('woff2-variations'),
       url('./fonts/nunito-variable.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}


/* --------------------------------------------------------------------------
   1 · Tokens
   -------------------------------------------------------------------------- */
:root {

  /* 1.1 Brand (Pflaume) — Variante C aus Briefing 22.05.2026 -------------- */
  --blue:                 #5C2E48;   /* Pflaume · Logo, Primary-Button, Links */
  --blue-deep:            #3F1E30;   /* Pflaume dunkel · Hover, Active        */
  --blue-tint:            #ECDDE5;   /* Pflaume-Tint · Pill-BG, Highlight     */

  /* 1.2 Action (Pflaume · gleiche Familie, differenziert über Puls/Form) - */
  --violet:               #5C2E48;   /* Live-Indikator, Pro/Premium-Badge     */
  --violet-deep:          #3F1E30;   /* Hover, Caption auf Tint               */
  --violet-tint:          #ECDDE5;   /* Pill-BG Action                        */

  /* 1.3 Text (warm) ------------------------------------------------------ */
  --text-primary:         #1A1418;   /* Headlines, Body — sehr dunkles Schwarz */
  --text-secondary:       #5A4F49;   /* Body in Cards, Lead-Text              */
  --text-muted:           #7A716C;   /* Captions, Meta, Hints                 */
  --text-invert:          #F4EEEA;   /* Text auf Pflaume-CTAs                 */

  /* 1.4 Hintergrund (Sand) ----------------------------------------------- */
  --bg-base:              #E9E2DD;   /* Sand · Page-BG                        */
  --bg-surface:           #F4EEEA;   /* Helles Sand · Cards, Panels           */
  --bg-deep:              #D5C9C0;   /* Dunkler Sand · eingelassene Bereiche  */

  /* 1.5 Borders ---------------------------------------------------------- */
  --border-soft:          #CDC3BB;   /* Card-Outlines, Standard               */
  --border-strong:        #8E827D;   /* Emphasized, Form-Focus                */

  /* 1.6 Status (AA-getestet, warm-neutral) ------------------------------- */
  --ok:                   #1F8A4E;
  --ok-bg:                #E4F5EB;
  --warn:                 #B87400;
  --warn-bg:              #FFF3D6;
  --err:                  #B3261E;
  --err-bg:               #FCE4E2;

  /* 1.7 Typo-Skala ------------------------------------------------------- */
  /* Font-Stack: Nunito Variable Font (self-hosted, siehe memory: selfhosted-fonts).
     @font-face wird erst beim Living Style Guide eingebunden — Font-Datei
     liegt produktiv unter /fonts/nunito-variable.woff2 in frontend/. */
  --font-sans:            'Nunito', -apple-system, BlinkMacSystemFont,
                          'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Skala: Größe / Line-Height / Weight pro semantischer Stufe.
     Verwendung über Utility-Klassen .ds-* (siehe §3). */
  --ds-display-size:      40px;
  --ds-display-lh:        48px;
  --ds-display-weight:    800;
  --ds-display-tracking:  -0.01em;

  --ds-title-size:        28px;
  --ds-title-lh:          34px;
  --ds-title-weight:      700;
  --ds-title-tracking:    -0.005em;

  --ds-subtitle-size:     20px;
  --ds-subtitle-lh:       26px;
  --ds-subtitle-weight:   700;

  --ds-body-lg-size:      17px;
  --ds-body-lg-lh:        26px;
  --ds-body-lg-weight:    400;

  --ds-body-size:         15px;
  --ds-body-lh:           22px;
  --ds-body-weight:       400;

  --ds-caption-size:      13px;
  --ds-caption-lh:        18px;
  --ds-caption-weight:    500;

  --ds-eyebrow-size:      12px;
  --ds-eyebrow-lh:        14px;
  --ds-eyebrow-weight:    700;
  --ds-eyebrow-tracking:  0.08em;

  /* 1.8 Spacing — public-spacious (Default) ------------------------------ */
  --space-1:              6px;
  --space-2:              10px;
  --space-3:              16px;
  --space-4:              24px;
  --space-5:              40px;
  --space-6:              64px;
  --space-7:              96px;

  /* 1.9 Radien ----------------------------------------------------------- */
  --radius-xs:            8px;
  --radius-sm:            12px;
  --radius-md:            14px;
  --radius:               16px;
  --radius-lg:            24px;
  --radius-pill:          999px;

  /* 1.10 Shadows --------------------------------------------------------- */
  /* Ein definiertes Set — Komponenten dürfen kein freies box-shadow setzen. */
  --shadow-1:             0 1px 2px rgba(31, 24, 21, 0.04),
                          0 4px 12px rgba(31, 24, 21, 0.06);
  --shadow-2:             0 4px 12px rgba(31, 24, 21, 0.08),
                          0 16px 32px rgba(31, 24, 21, 0.10);

  /* 1.11 Motion (knapp gehalten — keine neuen Animationen über v2 hinaus) */
  --ease-out:             cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast:             120ms;
  --dur-base:             200ms;

  /* 1.12 App-Frame-Breite — variabel pro Viewport-Breakpoint.              */
  /* Default = Mobile-Frame. Auf Desktop greift Media-Query weiter unten.   */
  --app-frame-max:        460px;
}


/* --------------------------------------------------------------------------
   2 · Density-Mode
   Default = public-spacious (kommt aus :root in §1).
   `.density-public` ist nur Anchor — sie überschreibt nichts, dokumentiert
   aber die explizite Wahl und erlaubt Toggle-JS Klassen-Symmetrie.
   `.density-app` überschreibt ausschließlich die Spacing-Tokens.
   -------------------------------------------------------------------------- */

.density-public {
  /* intentionally empty — public ist Default, siehe :root */
}

.density-app {
  --space-1:              4px;
  --space-2:              8px;
  --space-3:              12px;
  --space-4:              16px;
  --space-5:              24px;
  --space-6:              32px;
  --space-7:              48px;
}


/* --------------------------------------------------------------------------
   3 · Basis-Reset + Body + Typo-Utilities
   Minimal — kein Normalize, kein Component-Code.
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* HTML-hidden-Attribut wieder durchsetzen — manche Component-Klassen
   (.stack, .row, .grid) haben display:flex/grid und gewinnen sonst
   gegen den Browser-Default. !important ist hier gerechtfertigt:
   wir stellen das User-Agent-Verhalten wieder her, nichts Eigenes.        */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--ds-body-size);
  line-height: var(--ds-body-lh);
  font-weight: var(--ds-body-weight);
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Selection ------------------------------------------------------------- */
::selection {
  background: var(--blue-tint);
  color: var(--text-primary);
}

/* Fokus — globaler Default; einzelne Atome (btn, field) überschreiben.    */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Links — Basis (Atom-Definitionen folgen in Phase 1.3) ------------------ */
a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--blue-deep); }

/* Footer-Links ohne Underline                                              */
footer a { text-decoration: none; }
footer a:hover { text-decoration: none; color: var(--blue-deep); }
/* Auf dunklem Pflaume-Footer (.footer-dark) wäre --blue-deep der BG selbst
   → Hover-Text wäre unsichtbar. Override auf helles Sand-Token.            */
.footer-dark a:hover { color: var(--text-invert); }


/* 3.1 Typo-Utilities — eine Klasse pro semantischer Stufe --------------- */
/* Diese sind die Anker für hero/card/section etc., dürfen aber auch
   freistehend genutzt werden (z. B. <span class="ds-eyebrow">). */

.ds-display {
  font-size:        var(--ds-display-size);
  line-height:      var(--ds-display-lh);
  font-weight:      var(--ds-display-weight);
  letter-spacing:   var(--ds-display-tracking);
  color:            var(--text-primary);
  margin:           0;
}

.ds-title {
  font-size:        var(--ds-title-size);
  line-height:      var(--ds-title-lh);
  font-weight:      var(--ds-title-weight);
  letter-spacing:   var(--ds-title-tracking);
  color:            var(--text-primary);
  margin:           0;
}

.ds-subtitle {
  font-size:        var(--ds-subtitle-size);
  line-height:      var(--ds-subtitle-lh);
  font-weight:      var(--ds-subtitle-weight);
  color:            var(--text-primary);
  margin:           0;
}

.ds-body-lg {
  font-size:        var(--ds-body-lg-size);
  line-height:      var(--ds-body-lg-lh);
  font-weight:      var(--ds-body-lg-weight);
  color:            var(--text-secondary);
  margin:           0;
}

.ds-body {
  font-size:        var(--ds-body-size);
  line-height:      var(--ds-body-lh);
  font-weight:      var(--ds-body-weight);
  color:            var(--text-primary);
  margin:           0;
}

.ds-caption {
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  font-weight:      var(--ds-caption-weight);
  color:            var(--text-muted);
  margin:           0;
}

.ds-eyebrow {
  font-size:        var(--ds-eyebrow-size);
  line-height:      var(--ds-eyebrow-lh);
  font-weight:      var(--ds-eyebrow-weight);
  letter-spacing:   var(--ds-eyebrow-tracking);
  text-transform:   uppercase;
  color:            var(--blue);
  margin:           0;
}


/* ==========================================================================
   4 · Atome
   --------------------------------------------------------------------------
   Quelle: DESIGN-V3.md §5 — `btn`, `pill`, `field`, `divider`, `icon-btn`.
   Regeln:
     - Modifier folgen BEM-Notation (`--variant`, `__element`).
     - Spacing nutzt Tokens — Werte sind im app-compact-Mode automatisch enger.
     - Buttons + Pills haben dieselbe Höhen-Familie (sm/base/lg), damit sie in
       Toolbars / Hero-Aktionsleisten zusammenpassen.
     - Lila ist Action: `pill--violet` (Live, Pro, Neu), `btn--primary` bleibt
       Klein-Blue (siehe Memory `design-v3-farben`).
   ========================================================================== */


/* 4.1 btn ---------------------------------------------------------------- */

.btn {
  /* Box                                                                    */
  display:          inline-flex;
  align-items:      center;
  justify-content:  center;
  gap:              var(--space-2);
  min-height:       44px;
  padding:          0 var(--space-4);
  border-radius:    var(--radius-sm);
  border:           1px solid transparent;
  background:       transparent;

  /* Typo                                                                   */
  font-family:      inherit;
  font-size:        var(--ds-body-size);
  line-height:      var(--ds-body-lh);
  font-weight:      700;
  letter-spacing:   0.005em;
  color:            var(--text-primary);
  text-decoration:  none;
  white-space:      nowrap;

  /* Behavior                                                               */
  cursor:           pointer;
  user-select:      none;
  transition:       background var(--dur-fast) var(--ease-out),
                    color var(--dur-fast) var(--ease-out),
                    border-color var(--dur-fast) var(--ease-out),
                    transform var(--dur-fast) var(--ease-out);
}

.btn:focus-visible {
  outline:          2px solid var(--blue);
  outline-offset:   2px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity:          0.5;
  cursor:           not-allowed;
  pointer-events:   none;
}

/* Sizes                                                                    */
.btn--sm {
  min-height:       36px;
  padding:          0 var(--space-3);
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  border-radius:    var(--radius-xs);
}

.btn--lg {
  min-height:       52px;
  padding:          0 var(--space-5);
  font-size:        var(--ds-body-lg-size);
  line-height:      var(--ds-body-lg-lh);
  border-radius:    var(--radius-md);
}

/* Variants                                                                 */
.btn--primary {
  background:       var(--blue);
  color:            var(--text-invert);
  border-color:     var(--blue);
}
.btn--primary:hover {
  background:       var(--blue-deep);
  border-color:     var(--blue-deep);
  color:            var(--text-invert);
}
.btn--primary:active {
  transform:        translateY(1px);
}

.btn--outline {
  background:       transparent;
  color:            var(--blue);
  border-color:     var(--blue);
}
.btn--outline:hover {
  background:       var(--blue-tint);
  color:            var(--blue-deep);
  border-color:     var(--blue-deep);
}

.btn--ghost {
  background:       transparent;
  color:            var(--blue);
  border-color:     transparent;
}
.btn--ghost:hover {
  background:       var(--blue-tint);
  color:            var(--blue-deep);
}

.btn--danger {
  background:       var(--err);
  color:            var(--text-invert);
  border-color:     var(--err);
}
.btn--danger:hover {
  background:       #8E1F18;       /* err dunkler (1 Stufe), kein neues Token */
  border-color:     #8E1F18;
  color:            var(--text-invert);
}
.btn--danger:active {
  transform:        translateY(1px);
}


/* 4.2 pill --------------------------------------------------------------- */

.pill {
  display:          inline-flex;
  align-self:       flex-start;   /* verhindert Stretch in column-Stacks */
  align-items:      center;
  gap:              var(--space-1);
  padding:          2px var(--space-2);
  min-height:       22px;
  border-radius:    var(--radius-pill);
  border:           1px solid transparent;
  background:       var(--bg-deep);
  color:            var(--text-secondary);

  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  font-weight:      600;
  letter-spacing:   0.005em;
  white-space:      nowrap;
}

/* Optional führender Statuspunkt: <span class="pill__dot"></span> */
.pill__dot {
  width:            6px;
  height:           6px;
  border-radius:    50%;
  background:       currentColor;
  flex:             none;
}

/* Brand & Action                                                           */
.pill--blue {
  background:       var(--blue-tint);
  color:            var(--blue-deep);
  border-color:     transparent;
}
.pill--violet {
  background:       var(--violet-tint);
  color:            var(--violet-deep);
  border-color:     transparent;
}

/* Status                                                                   */
.pill--ok {
  background:       var(--ok-bg);
  color:            var(--ok);
  border-color:     transparent;
}
.pill--warn {
  background:       var(--warn-bg);
  color:            var(--warn);
  border-color:     transparent;
}
.pill--err {
  background:       var(--err-bg);
  color:            var(--err);
  border-color:     transparent;
}

/* Live-Variante — sanfter Puls für aktive Sessions / Live-Indikator.
   Einzige neue Animation gegenüber v2 (vgl. DESIGN-V3.md §3).             */
.pill--live .pill__dot {
  background:       var(--violet);
  animation:        ds-pulse 1.6s var(--ease-out) infinite;
}
@keyframes ds-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%      { opacity: 0.55; transform: scale(0.85); }
}


/* 4.3 field -------------------------------------------------------------- */

.field {
  display:          flex;
  flex-direction:   column;
  gap:              var(--space-1);
}

.field__label {
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  font-weight:      700;
  color:            var(--text-primary);
  letter-spacing:   0.005em;
}

.field__input {
  appearance:       none;
  -webkit-appearance: none;
  width:            100%;
  min-height:       44px;
  padding:          var(--space-2) var(--space-3);
  border:           1px solid var(--border-soft);
  border-radius:    var(--radius-sm);
  background:       var(--bg-surface);
  color:            var(--text-primary);
  font-family:      inherit;
  font-size:        var(--ds-body-size);
  line-height:      var(--ds-body-lh);
  transition:       border-color var(--dur-fast) var(--ease-out),
                    box-shadow var(--dur-fast) var(--ease-out),
                    background var(--dur-fast) var(--ease-out);
}

/* Textarea-Variante (gleicher Selector — semantisch passend)               */
textarea.field__input {
  min-height:       96px;
  padding:          var(--space-3);
  resize:           vertical;
  line-height:      var(--ds-body-lh);
}

/* Select bekommt Pfeil zurück (appearance:none entfernt ihn)              */
select.field__input {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%231F1815' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right:    calc(var(--space-3) * 2 + 12px);
}

.field__input::placeholder {
  color:            var(--text-muted);
}

.field__input:hover:not(:disabled) {
  border-color:     var(--border-strong);
}

.field__input:focus-visible,
.field__input:focus {
  outline:          none;
  border-color:     var(--blue);
  box-shadow:       0 0 0 3px var(--blue-tint);
}

.field__input:disabled {
  background:       var(--bg-deep);
  color:            var(--text-muted);
  cursor:           not-allowed;
}

/* Error-Zustand am Field-Container (Field.is-error) ----------------------- */
.field.is-error .field__input {
  border-color:     var(--err);
  background:       var(--err-bg);
}
.field.is-error .field__input:focus-visible {
  box-shadow:       0 0 0 3px var(--err-bg);
}

.field__hint {
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  color:            var(--text-muted);
}

.field__error {
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  color:            var(--err);
  font-weight:      600;
}


/* 4.4 divider ------------------------------------------------------------ */

.divider {
  border:           0;
  height:           1px;
  background:       var(--border-soft);
  margin:           0;
}

/* Vertikal-Variante für Toolbars                                           */
.divider--vertical {
  width:            1px;
  height:           auto;
  align-self:       stretch;
}


/* 4.5 icon-btn ----------------------------------------------------------- */

.icon-btn {
  display:          inline-flex;
  align-items:      center;
  justify-content:  center;
  width:            40px;
  height:           40px;
  padding:          0;
  border:           1px solid transparent;
  border-radius:    var(--radius-sm);
  background:       transparent;
  color:            var(--text-primary);
  cursor:           pointer;
  transition:       background var(--dur-fast) var(--ease-out),
                    color var(--dur-fast) var(--ease-out),
                    border-color var(--dur-fast) var(--ease-out);
}

.icon-btn > svg {
  width:            20px;
  height:           20px;
  display:          block;
}

.icon-btn:hover {
  background:       var(--blue-tint);
  color:            var(--blue-deep);
}

.icon-btn:focus-visible {
  outline:          2px solid var(--blue);
  outline-offset:   2px;
}

.icon-btn:disabled,
.icon-btn[aria-disabled="true"] {
  opacity:          0.5;
  cursor:           not-allowed;
  pointer-events:   none;
}

.icon-btn--sm {
  width:            32px;
  height:           32px;
  border-radius:    var(--radius-xs);
}
.icon-btn--sm > svg { width: 16px; height: 16px; }

.icon-btn--lg {
  width:            48px;
  height:           48px;
  border-radius:    var(--radius-md);
}
.icon-btn--lg > svg { width: 24px; height: 24px; }


/* ==========================================================================
   5 · Basis-Komponenten
   --------------------------------------------------------------------------
   Quelle: DESIGN-V3.md §5.
   Reihenfolge: Layout-Skelett (page/section/container/stack/grid),
                Navigation, Hero, Card, Panel, List, Stat.
   Alle Spacings ziehen sich aus --space-*; im app-compact-Mode
   automatisch dichter. Keine freien box-shadow- oder Pixel-Padding-Werte.
   ========================================================================== */


/* 5.1 page + section ----------------------------------------------------- */

/* `.page` ist der äußere Wrapper unterhalb von <body>. Setzt Density-Mode,
   falls die Seite das auf Page-Ebene statt am Body-Tag möchte.            */
.page {
  display:          flex;
  flex-direction:   column;
  min-height:       100vh;
  background:       var(--bg-base);
  color:            var(--text-primary);
}

/* App-Pages sind Mobile-First. Frame-Breite kommt aus --app-frame-max,
   das per Viewport-Breakpoint größer wird (siehe unten).                   */
.page--app {
  max-width:        var(--app-frame-max);
  margin-inline:    auto;
  position:         relative;
  background:       var(--bg-base);
}

.page--public { /* keine eigenen Styles */ }

/* Ab 768px Viewport: Frame wächst sanft, App fühlt sich weniger
   eingequetscht an, bleibt aber im selben vertikalen Mobile-First-Layout. */
@media (min-width: 768px) {
  :root { --app-frame-max: 600px; }
  body  { background: var(--bg-deep); }
  .page--app {
    border-inline:  1px solid var(--border-soft);
    min-height:     100vh;
  }
}

/* `.section` ist ein vertikaler Block mit Density-abhängigem Padding.     */
.section {
  padding-block:    var(--space-6);
}
.section--tight   { padding-block: var(--space-4); }
.section--roomy   { padding-block: var(--space-7); }
.section--flush   { padding-block: 0; }

/* Hintergrund-Varianten für rhythmische Sektionen                          */
.section--deep    { background: var(--bg-deep); }
.section--surface { background: var(--bg-surface); }


/* 5.2 container ---------------------------------------------------------- */

/* Default = Public-Breite. Im App-Bereich kommt --narrow (Detail-View) oder
   --full (Index/Listen-View) zum Einsatz.                                  */
.container {
  width:            100%;
  max-width:        1140px;
  margin-inline:    auto;
  padding-inline:   var(--space-4);
}

.container--narrow {
  max-width:        720px;
}

.container--full {
  max-width:        none;
}

/* Auf sehr schmalem Mobile etwas weniger Edge-Padding, damit Cards Atem haben */
@media (max-width: 480px) {
  .container { padding-inline: var(--space-3); }
}


/* 5.3 stack + grid ------------------------------------------------------- */

/* Vertikaler Flow mit Token-Gap. Default-Gap = --space-3.                  */
.stack {
  display:          flex;
  flex-direction:   column;
  gap:              var(--space-3);
}
.stack--xs  { gap: var(--space-1); }
.stack--sm  { gap: var(--space-2); }
.stack--md  { gap: var(--space-3); }
.stack--lg  { gap: var(--space-4); }
.stack--xl  { gap: var(--space-5); }
.stack--2xl { gap: var(--space-6); }

/* Horizontale Variante (z. B. Action-Reihen).                              */
.row {
  display:          flex;
  flex-direction:   row;
  align-items:      center;
  gap:              var(--space-2);
  flex-wrap:        wrap;
}
.row--between { justify-content: space-between; }
.row--end     { justify-content: flex-end; }
.row--baseline{ align-items: baseline; }

/* Grid — bricht unter 720 px auf 1 Spalte um.                              */
.grid {
  display:          grid;
  gap:              var(--space-4);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

@media (max-width: 720px) {
  .grid--2,
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
}


/* 5.4 nav ---------------------------------------------------------------- */

.nav {
  position:         sticky;
  top:              0;
  z-index:          100;
  background:       var(--bg-surface);
  border-bottom:    1px solid var(--border-soft);
}

.nav__inner {
  display:          flex;
  align-items:      center;
  justify-content:  space-between;
  gap:              var(--space-3);
  width:            100%;
  max-width:        1140px;
  margin-inline:    auto;
  padding:          var(--space-2) var(--space-4);
  min-height:       64px;
}

.nav__brand {
  display:          inline-flex;
  align-items:      center;
  gap:              var(--space-2);
  color:            var(--blue);
  text-decoration:  none;
  font-weight:      700;
  font-size:        var(--ds-subtitle-size);
  line-height:      var(--ds-subtitle-lh);
}
.nav__brand:hover { color: var(--blue-deep); }
.nav__brand-mark {
  width:            28px;
  height:           28px;
  display:          block;
}

.nav__links {
  display:          flex;
  align-items:      center;
  gap:              var(--space-4);
}
.nav__links a {
  color:            var(--text-primary);
  text-decoration:  none;
  font-size:        var(--ds-body-size);
  font-weight:      600;
}
.nav__links a:hover { color: var(--blue-deep); }

.nav__cta {
  display:          inline-flex;
  align-items:      center;
  gap:              var(--space-2);
}

/* Mobile: Links einklappen — App-Pages haben oft eh keine Links            */
@media (max-width: 720px) {
  .nav__links { display: none; }
}

/* Public-Variante = Default-Look                                           */
.nav--public .nav__inner { padding-block: var(--space-3); }

/* ─── Mobile Drawer ────────────────────────────────────────────────────── */
.nav__burger {
  display:          none;
  background:       none;
  border:           none;
  padding:          6px;
  margin-left:      var(--space-2);
  cursor:           pointer;
  color:            var(--text-primary);
  -webkit-tap-highlight-color: transparent;
}
.nav__burger svg { width: 24px; height: 24px; display: block; }

.nav__backdrop {
  position:         fixed;
  inset:            0;
  background:       rgba(31, 38, 40, 0.42);
  opacity:          0;
  pointer-events:   none;
  transition:       opacity 0.2s ease;
  z-index:          1000;
}
.nav__backdrop.is-open { opacity: 1; pointer-events: auto; }

.nav__drawer {
  position:         fixed;
  top:              0;
  right:            0;
  bottom:           0;
  width:            300px;
  max-width:        84vw;
  background:       var(--bg-surface);
  border-left:      1px solid var(--border-soft);
  transform:        translateX(100%);
  transition:       transform 0.25s ease;
  z-index:          1001;
  display:          flex;
  flex-direction:   column;
  padding:          0;
  overflow-y:       auto;
}
.nav__drawer.is-open { transform: translateX(0); }

.nav__drawer-head {
  display:          flex;
  justify-content:  flex-end;
  align-items:      center;
  padding:          var(--space-3);
}

.nav__drawer-hero {
  background:       var(--blue);
  padding:          var(--space-4) var(--space-3) var(--space-3);
  text-align:       center;
}
.nav__drawer-hero svg { display: block; margin: 0 auto; }
.nav__drawer-brand {
  font-weight:      900;
  font-size:        20px;
  letter-spacing:   -0.3px;
  color:            var(--text-invert);
  margin-top:       10px;
  line-height:      1;
}
.nav__drawer-eyebrow {
  font-size:        11px;
  letter-spacing:   0.12em;
  text-transform:   uppercase;
  color:            var(--text-invert);
  font-weight:      700;
  margin-top:       8px;
  opacity:          0.75;
}
.nav__drawer-close {
  background:       none;
  border:           none;
  padding:          6px;
  cursor:           pointer;
  color:            var(--text-primary);
  -webkit-tap-highlight-color: transparent;
}
.nav__drawer-close svg { width: 22px; height: 22px; display: block; }

.nav__drawer-links { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); }
.nav__drawer-links a {
  display:          flex;
  align-items:      center;
  gap:              14px;
  padding:          12px 10px;
  text-decoration:  none;
  color:            var(--text-primary);
  font-weight:      600;
  font-size:        var(--ds-body-size);
  border-radius:    8px;
}
.nav__drawer-icon {
  width:            22px;
  height:           22px;
  flex-shrink:      0;
  color:            var(--blue-deep);
}
.nav__drawer-icon svg { width: 100%; height: 100%; display: block; }
.nav__drawer-links a:hover,
.nav__drawer-links a:focus-visible {
  background:       var(--bg-deep);
  color:            var(--blue-deep);
  outline:          none;
}
.nav__drawer-divider {
  height:           1px;
  background:       var(--border-soft);
  margin:           8px 6px;
}

body.is-drawer-open { overflow: hidden; }

@media (max-width: 720px) {
  .nav__burger { display: inline-flex; align-items: center; }
  /* Login-CTA auf Mobile ausblenden — gehört in den Drawer                 */
  .nav__inner > .btn,
  .nav__inner > .nav__cta { display: none; }
}
@media (min-width: 721px) {
  .nav__drawer,
  .nav__backdrop { display: none; }
}

/* App-Variante: kompakter, Profil-Slot rechts                              */
.nav--app .nav__inner {
  min-height:       56px;
  padding-block:    var(--space-2);
}
.nav--app .nav__brand {
  font-size:        var(--ds-body-lg-size);
  line-height:      var(--ds-body-lg-lh);
}

/* Back-Link für Detail-Pages                                               */
.nav__back {
  display:          inline-flex;
  align-items:      center;
  gap:              var(--space-1);
  color:            var(--blue);
  font-size:        var(--ds-caption-size);
  font-weight:      700;
  letter-spacing:   0.005em;
  text-decoration:  none;
}
.nav__back:hover { color: var(--blue-deep); }
.nav__back svg   { width: 14px; height: 14px; }


/* 5.5 hero --------------------------------------------------------------- */

.hero {
  padding-block:    var(--space-6);
}

.hero__inner {
  display:          flex;
  flex-direction:   column;
  gap:              var(--space-3);
  max-width:        720px;
}

/* Eyebrow innerhalb des Heros — nutzt die globale .ds-eyebrow-Stilistik;
   diese Wrapper-Klasse erlaubt zusätzlichen Bottom-Spacing.                */
.hero__eyebrow {
  margin-bottom:    var(--space-1);
}

.hero__title  { margin: 0; /* Typo überlässt es den Modifiern; Browser-Default-Margins addieren sich sonst zu Stack-Gaps */ }
.hero__lead {
  color:            var(--text-secondary);
  font-size:        var(--ds-body-lg-size);
  line-height:      var(--ds-body-lg-lh);
  max-width:        60ch;
  margin:           0;
}

.hero__actions {
  display:          flex;
  flex-wrap:        wrap;
  align-items:      center;
  gap:              var(--space-2);
  margin-top:       var(--space-2);
}

/* Modifier --------------------------------------------------------------- */

.hero--display .hero__title {
  font-size:        var(--ds-display-size);
  line-height:      var(--ds-display-lh);
  font-weight:      var(--ds-display-weight);
  letter-spacing:   var(--ds-display-tracking);
}

.hero--page .hero__title {
  font-size:        var(--ds-title-size);
  line-height:      var(--ds-title-lh);
  font-weight:      var(--ds-title-weight);
  letter-spacing:   var(--ds-title-tracking);
}

.hero--app {
  padding-block:    var(--space-4);
}
.hero--app .hero__title {
  font-size:        var(--ds-title-size);
  line-height:      var(--ds-title-lh);
  font-weight:      var(--ds-title-weight);
  letter-spacing:   var(--ds-title-tracking);
}
.hero--app .hero__lead {
  font-size:        var(--ds-body-size);
  line-height:      var(--ds-body-lh);
}

/* Session-Hero (Lademonitor): rollenagnostisch, betont laufenden Vorgang.
   Visuelles Anker-Element ist nicht der Titel, sondern die Live-Pill +
   ein großer KWh-Wert (üblicherweise als .stat__value im Hero-Slot).      */
.hero--session {
  padding-block:    var(--space-4);
  background:       var(--bg-surface);
  border-bottom:    1px solid var(--border-soft);
}
.hero--session .hero__title {
  font-size:        var(--ds-subtitle-size);
  line-height:      var(--ds-subtitle-lh);
  font-weight:      700;
}


/* 5.6 card --------------------------------------------------------------- */

.card {
  background:       var(--bg-surface);
  border:           1px solid var(--border-soft);
  border-radius:    var(--radius);
  box-shadow:       var(--shadow-1);
  padding:          var(--space-4);

  display:          flex;
  flex-direction:   column;
  gap:              var(--space-3);
}

.card__title {
  font-size:        var(--ds-subtitle-size);
  line-height:      var(--ds-subtitle-lh);
  font-weight:      var(--ds-subtitle-weight);
  color:            var(--text-primary);
  margin:           0;
}

.card__body {
  font-size:        var(--ds-body-size);
  line-height:      var(--ds-body-lh);
  color:            var(--text-secondary);
}

.card__meta {
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  color:            var(--text-muted);
}

.card__actions {
  display:          flex;
  flex-wrap:        wrap;
  gap:              var(--space-2);
  margin-top:       auto;
}

/* Modifier --------------------------------------------------------------- */

/* Public-Feature-Block — etwas mehr Padding, größere Headline-Typo        */
.card--feature {
  padding:          var(--space-5);
  gap:              var(--space-4);
}
.card--feature .card__title {
  font-size:        var(--ds-title-size);
  line-height:      var(--ds-title-lh);
}

/* List-Card — enthält eine .list, deshalb intern kein Inner-Gap nötig    */
.card--list {
  padding:          0;
  gap:              0;
}
.card--list > .card__title,
.card--list > .card__meta,
.card--list > .card__actions {
  padding:          var(--space-3) var(--space-4);
}
.card--list > .card__title { padding-bottom: 0; }
.card--list > .card__actions { padding-top: 0; }

/* Stat-Card — zentrierter Wert, klare Hierarchie                           */
.card--stat {
  text-align:       center;
  gap:              var(--space-1);
  padding:          var(--space-4) var(--space-3);
}

/* Empty-State — gestrichelte Border, gedämpfte Farben                     */
.card--empty {
  background:       var(--bg-base);
  border:           1.5px dashed var(--border-soft);
  box-shadow:       none;
  text-align:       center;
  align-items:      center;
  padding:          var(--space-5) var(--space-4);
  gap:              var(--space-2);
  color:            var(--text-muted);
}
.card--empty .card__title { color: var(--text-secondary); }

/* Warn-Card — warmer Status-Tint, kein Rot-auf-Rot (siehe Memory)         */
.card--warn {
  background:       var(--warn-bg);
  border-color:     var(--warn);
  box-shadow:       none;
}
.card--warn .card__title { color: var(--warn); }
.card--warn .card__body  { color: var(--text-primary); }


/* 5.7 panel -------------------------------------------------------------- */

/* Flacher als Card: kein Schatten, leichter BG-Kontrast. Für Inline-Boxen
   innerhalb von Cards oder als ruhigere Sektions-Hülle.                    */
.panel {
  background:       var(--bg-surface);
  border:           1px solid var(--border-soft);
  border-radius:    var(--radius-sm);
  padding:          var(--space-3) var(--space-4);

  display:          flex;
  flex-direction:   column;
  gap:              var(--space-2);
}

.panel--deep   { background: var(--bg-deep); }
.panel--flush  { padding: 0; }
.panel--ghost  { background: transparent; border-color: var(--border-soft); }


/* 5.8 list --------------------------------------------------------------- */

/* Strukturierte Daten-Liste — Trennlinien zwischen Items.                  */
.list {
  display:          flex;
  flex-direction:   column;
  margin:           0;
  padding:          0;
  list-style:       none;
}

.list__item {
  display:          flex;
  align-items:      center;
  gap:              var(--space-3);
  padding:          var(--space-3) var(--space-4);
  border-top:       1px solid var(--border-soft);
}
.list__item:first-child { border-top: 0; }

/* Interaktive Items (klickbar / als Link)                                  */
.list__item--interactive {
  cursor:           pointer;
  transition:       background var(--dur-fast) var(--ease-out);
}
.list__item--interactive:hover {
  background:       var(--blue-tint);
}

/* Inhalt-Slots                                                             */
.list__main {
  display:          flex;
  flex-direction:   column;
  gap:              var(--space-1);
  flex:             1 1 auto;
  min-width:        0;
}

.list__title {
  font-size:        var(--ds-body-size);
  line-height:      var(--ds-body-lh);
  font-weight:      600;
  color:            var(--text-primary);
  margin:           0;
  overflow:         hidden;
  text-overflow:    ellipsis;
  white-space:      nowrap;
}

.list__meta {
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  color:            var(--text-muted);
}

.list__trail {
  display:          flex;
  align-items:      center;
  gap:              var(--space-2);
  flex:             none;
}


/* 5.9 stat --------------------------------------------------------------- */

/* Einzelne Kennzahl — kann freistehend oder in einer Card stehen.          */
.stat {
  display:          flex;
  flex-direction:   column;
  gap:              var(--space-1);
}

.stat__value {
  font-size:        var(--ds-display-size);
  line-height:      var(--ds-display-lh);
  font-weight:      var(--ds-display-weight);
  letter-spacing:   var(--ds-display-tracking);
  color:            var(--text-primary);
}

.stat__label {
  font-size:        var(--ds-eyebrow-size);
  line-height:      var(--ds-eyebrow-lh);
  font-weight:      var(--ds-eyebrow-weight);
  letter-spacing:   var(--ds-eyebrow-tracking);
  text-transform:   uppercase;
  color:            var(--text-muted);
}

.stat__sublabel {
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  color:            var(--text-secondary);
}

/* Kompakter im app-compact-Mode — Wert nicht so monumental                 */
.density-app .stat__value {
  font-size:        var(--ds-title-size);
  line-height:      var(--ds-title-lh);
  letter-spacing:   var(--ds-title-tracking);
}


/* ==========================================================================
   6 · Modal + Bottom-Nav (Phase 1.3-Nachschub)
   --------------------------------------------------------------------------
   Nachträglich ergänzt für den Dashboard-Rewrite (Phase 3).
   Beide Komponenten waren in DESIGN-V3.md §5 nicht explizit gelistet, sind
   aber für den App-Bereich essentiell: 6 Modals im Dashboard, Bottom-Nav
   als Mobile-Erstwert.
   ========================================================================== */


/* 6.1 modal -------------------------------------------------------------- */

/* Overlay deckt den Viewport ab; sichtbar über is-open am Element.
   Keine Animationen — Sichtbarkeit binär, Toggle über JS-Klasse.           */
.modal {
  position:         fixed;
  inset:            0;
  z-index:          1000;
  display:          none;
  align-items:      center;
  justify-content:  center;
  padding:          var(--space-3);
  background:       rgba(31, 24, 21, 0.45);
}

.modal.is-open {
  display:          flex;
}

.modal__body {
  position:         relative;
  width:            100%;
  max-width:        560px;
  max-height:       calc(100vh - var(--space-5));
  display:          flex;
  flex-direction:   column;
  background:       var(--bg-surface);
  border:           1px solid var(--border-soft);
  border-radius:    var(--radius);
  box-shadow:       var(--shadow-2);
  overflow:         hidden;
}

.modal__header {
  display:          flex;
  align-items:      flex-start;
  justify-content:  space-between;
  gap:              var(--space-3);
  padding:          var(--space-3) var(--space-4);
  border-bottom:    1px solid var(--border-soft);
}

.modal__title {
  font-size:        var(--ds-subtitle-size);
  line-height:      var(--ds-subtitle-lh);
  font-weight:      var(--ds-subtitle-weight);
  color:            var(--text-primary);
  margin:           0;
}

.modal__sub {
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  color:            var(--text-muted);
  margin:           2px 0 0;
}

.modal__close {
  /* nutzt .icon-btn-Geometrie, aber als eigene Klasse zur klaren Trennung   */
  flex:             none;
  width:            32px;
  height:           32px;
  display:          inline-flex;
  align-items:      center;
  justify-content:  center;
  border:           none;
  background:       transparent;
  color:            var(--text-secondary);
  border-radius:    var(--radius-xs);
  cursor:           pointer;
  transition:       background var(--dur-fast) var(--ease-out),
                    color var(--dur-fast) var(--ease-out);
}
.modal__close:hover {
  background:       var(--bg-deep);
  color:            var(--text-primary);
}
.modal__close > svg { width: 16px; height: 16px; }

.modal__content {
  padding:          var(--space-4);
  overflow-y:       auto;
  flex:             1 1 auto;
}

.modal__actions {
  display:          flex;
  flex-wrap:        wrap;
  gap:              var(--space-2);
  justify-content:  flex-end;
  padding:          var(--space-3) var(--space-4);
  border-top:       1px solid var(--border-soft);
  background:       var(--bg-surface);
}

/* Modifier: schmaler Modal (Bestätigungen)                                  */
.modal--sm .modal__body { max-width: 400px; }


/* 6.2 bottom-nav --------------------------------------------------------- */

/* Mobile-Erstwert. Bleibt unten am Viewport, vier Items, Icon + Label.
   Im app-compact-Mode kompakter (weniger Padding).                         */
.bottom-nav {
  position:         sticky;
  bottom:           0;
  z-index:          90;
  display:          flex;
  background:       var(--bg-surface);
  border-top:       1px solid var(--border-soft);
  padding:          var(--space-1) 0 calc(var(--space-1) + env(safe-area-inset-bottom, 0px));
}

.bottom-nav__item {
  flex:             1 1 0;
  display:          flex;
  flex-direction:   column;
  align-items:      center;
  justify-content:  center;
  gap:              2px;
  padding:          var(--space-2) var(--space-1);
  color:            var(--text-muted);
  text-decoration:  none;
  font-size:        11px;
  line-height:      14px;
  font-weight:      600;
  transition:       color var(--dur-fast) var(--ease-out);
}

.bottom-nav__item:hover {
  color:            var(--blue);
}

.bottom-nav__item.is-active {
  color:            var(--blue);
}

.bottom-nav__icon {
  display:          inline-flex;
  align-items:      center;
  justify-content:  center;
  width:            22px;
  height:           22px;
}
.bottom-nav__icon > svg { width: 20px; height: 20px; }


/* ==========================================================================
   7 · Mobile-First-Nachzug (Phase 4.1)
   --------------------------------------------------------------------------
   Atome und Modifier, die durch das Mobile-First-Dashboard nötig wurden:
   - fab           — Floating Action Button über der Bottom-Nav
   - hero--live    — Hero mit Display-kWh-Anker bei aktiver Session
   - carousel      — horizontaler Snap-Scroll-Container (Wallbox-Stack)
   - badge-dot     — kleiner Lila-Indikator (z. B. an Bottom-Nav-Item)
   - timeline      — Tages-Gruppen-Liste für Sessions
   ========================================================================== */


/* 7.1 fab ---------------------------------------------------------------- */

.fab {
  position:         fixed;
  /* Auf Mobile: --space-4 vom Viewport-Rand.
     Auf Desktop folgt der FAB dem zentrierten App-Frame-Rand (Breite aus
     --app-frame-max), statt am Viewport-Rand zu kleben.                    */
  right:            max(var(--space-4),
                        calc(50vw - var(--app-frame-max) / 2 + var(--space-4)));
  bottom:           calc(64px + var(--space-2) + env(safe-area-inset-bottom, 0px));
  z-index:          95;

  width:            56px;
  height:           56px;
  display:          inline-flex;
  align-items:      center;
  justify-content:  center;
  border-radius:    50%;
  border:           none;

  background:       var(--blue);
  color:            var(--text-invert);
  cursor:           pointer;
  box-shadow:       0 4px 14px rgba(63, 30, 48, 0.28),
                    0 1px 4px rgba(63, 30, 48, 0.18);
  transition:       background var(--dur-fast) var(--ease-out),
                    transform var(--dur-fast) var(--ease-out);
}
.fab:hover   { background: var(--blue-deep); }
.fab:active  { transform: scale(0.96); }
.fab > svg   { width: 24px; height: 24px; }

/* Optionaler Label-Slot rechts neben dem Icon (Extended FAB)               */
.fab--extended {
  width:            auto;
  padding:          0 var(--space-4);
  gap:              var(--space-2);
  border-radius:    var(--radius-pill);
  font-size:        var(--ds-body-size);
  font-weight:      700;
}


/* 7.2 hero--live --------------------------------------------------------- */

/* Hero-Variante für aktive Sessions: betont den kWh-Wert (Display-Größe),
   reduziert die Bedeutung des Titels. Live-Pill steht oben.                */
.hero--live {
  padding-block:    var(--space-4);
}
.hero--live .hero__title {
  font-size:        var(--ds-body-lg-size);
  line-height:      var(--ds-body-lg-lh);
  font-weight:      600;
  color:            var(--text-secondary);
  margin-bottom:    var(--space-1);
}
.hero--live .hero__kwh {
  display:          inline-flex;
  align-items:      baseline;
  gap:              var(--space-2);
  margin-block:     var(--space-2);
}
.hero--live .hero__kwh-value {
  font-size:        var(--ds-display-size);
  line-height:      var(--ds-display-lh);
  font-weight:      var(--ds-display-weight);
  letter-spacing:   var(--ds-display-tracking);
  color:            var(--text-primary);
}
.hero--live .hero__kwh-unit {
  font-size:        var(--ds-subtitle-size);
  line-height:      var(--ds-subtitle-lh);
  font-weight:      600;
  color:            var(--text-secondary);
}


/* 7.3 carousel ----------------------------------------------------------- */

/* Horizontaler Snap-Scroll. Kinder bekommen flex: 0 0 auto + snap-start.
   Default-Kind-Breite über container width / 1.15 — ein Element + Peek.    */
.carousel {
  display:          flex;
  gap:              var(--space-3);
  overflow-x:       auto;
  overflow-y:       visible;
  scroll-snap-type: x mandatory;
  scroll-padding:   var(--space-3);
  padding:          var(--space-1) var(--space-3) var(--space-3);
  margin-inline:    calc(var(--space-3) * -1);

  -webkit-overflow-scrolling: touch;
  scrollbar-width:  none;
}
.carousel::-webkit-scrollbar { display: none; }

.carousel > * {
  flex:             0 0 calc(100% - var(--space-5));
  scroll-snap-align: start;
  max-width:        420px;
}
.carousel > *:last-child {
  margin-right:     var(--space-3);
}


/* 7.4 badge-dot ---------------------------------------------------------- */

/* Kleiner Indikator-Punkt — wird auf jedes Element gepatcht, das ein
   Hinweis-Pünktchen oben rechts braucht. Lila = Action/Live.               */
.has-badge-dot {
  position:         relative;
}
.has-badge-dot::after {
  content:          '';
  position:         absolute;
  top:              2px;
  right:            calc(50% - 16px);
  width:            8px;
  height:           8px;
  border-radius:    50%;
  background:       var(--violet);
  box-shadow:       0 0 0 2px var(--bg-surface);
}


/* 7.5 timeline ----------------------------------------------------------- */

/* Sessions-Liste mit Datums-Gruppen-Headern. Reine Layout-Hilfe — keine
   eigene Bordüre, lebt innerhalb der Sektion.                              */
.timeline {
  display:          flex;
  flex-direction:   column;
  gap:              var(--space-3);
}

.timeline__group {
  display:          flex;
  flex-direction:   column;
  gap:              var(--space-1);
}

.timeline__heading {
  font-size:        var(--ds-eyebrow-size);
  line-height:      var(--ds-eyebrow-lh);
  font-weight:      var(--ds-eyebrow-weight);
  letter-spacing:   var(--ds-eyebrow-tracking);
  text-transform:   uppercase;
  color:            var(--blue);
  margin:           var(--space-2) 0 var(--space-1);
}

.timeline__item {
  display:          flex;
  align-items:      center;
  justify-content:  space-between;
  gap:              var(--space-3);
  padding:          var(--space-2) 0;
  border-bottom:    0.5px solid var(--border-soft);
}
.timeline__item:last-child {
  border-bottom:    0;
}

.timeline__main {
  display:          flex;
  flex-direction:   column;
  gap:              2px;
  min-width:        0;
  flex:             1 1 auto;
}
.timeline__title {
  font-size:        var(--ds-body-size);
  line-height:      var(--ds-body-lh);
  font-weight:      600;
  color:            var(--text-primary);
  white-space:      nowrap;
  overflow:         hidden;
  text-overflow:    ellipsis;
}
.timeline__meta {
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  color:            var(--text-muted);
}
.timeline__trail {
  flex:             none;
  display:          flex;
  align-items:      center;
  gap:              var(--space-2);
}


/* ==========================================================================
   8 · Nahsicht-Nachzug (Phase 5)
   --------------------------------------------------------------------------
   - skeleton    — Lade-Platzhalter (für Wallbox-Karten + Stream)
   - card--accent — dezente Akzent-Card mit Klein-Blue-Streifen links
                    (Ersatz für warm-gelben Warn-Banner)
   - stream      — Aktivitäts-Stream mit vertikaler Marker-Leiste
   ========================================================================== */


/* 8.1 skeleton ----------------------------------------------------------- */

.skeleton {
  background:       var(--bg-deep);
  border-radius:    var(--radius-sm);
  position:         relative;
  overflow:         hidden;
}
.skeleton::after {
  content:          '';
  position:         absolute;
  inset:            0;
  background:       linear-gradient(90deg,
                      transparent 0%,
                      rgba(255,255,255,0.4) 50%,
                      transparent 100%);
  animation:        skeleton-shimmer 1.4s var(--ease-out) infinite;
}
@keyframes skeleton-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton--text {
  height:           12px;
  margin-block:     6px;
  border-radius:    4px;
}
.skeleton--text-lg { height: 20px; }
.skeleton--bar     { height: 32px; border-radius: var(--radius-xs); }
.skeleton--w-30    { width: 30%; }
.skeleton--w-50    { width: 50%; }
.skeleton--w-70    { width: 70%; }


/* 8.2 card--accent ------------------------------------------------------- */

/* Dezente Aufmerksamkeits-Karte ohne Status-Farbe. Klein-Blue-Streifen links
   markiert „relevant, aber nicht alarmierend". Ersatz für warm-gelb-warn.   */
.card--accent {
  border-left:      3px solid var(--blue);
  border-radius:    var(--radius-sm);
  padding:          var(--space-3) var(--space-4);
}


/* 8.3 stream (Aktivitäts-Feed) ------------------------------------------ */

.stream {
  display:          flex;
  flex-direction:   column;
  gap:              var(--space-3);
}

.stream__item {
  display:          flex;
  align-items:      flex-start;
  gap:              var(--space-3);
}

.stream__marker {
  width:            3px;
  flex:             none;
  align-self:       stretch;
  background:       var(--border-soft);
  border-radius:    2px;
  min-height:       40px;
}
.stream__marker--live {
  background:       var(--violet);
}

.stream__main {
  flex:             1 1 auto;
  min-width:        0;
}
.stream__title {
  font-size:        var(--ds-body-size);
  line-height:      var(--ds-body-lh);
  color:            var(--text-primary);
}
.stream__title strong { font-weight: 700; }

.stream__meta {
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  color:            var(--text-muted);
  margin-top:       2px;
}


/* 8.4 hero__greeting ----------------------------------------------------- */

/* Persönlicher Gruß-Block: Tageszeit als Caption, Name als Title,
   Brief-Lead darunter. Reduziert wirkende Hero-Variante.                   */
.hero--greeting {
  padding-block:    var(--space-4);
}
.hero--greeting .hero__daypart {
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  color:            var(--text-muted);
  margin-bottom:    var(--space-1);
}
.hero--greeting .hero__title {
  font-size:        var(--ds-title-size);
  line-height:      var(--ds-title-lh);
  font-weight:      var(--ds-title-weight);
  letter-spacing:   var(--ds-title-tracking);
}
.hero--greeting .hero__lead {
  margin-top:       var(--space-2);
  font-size:        var(--ds-body-size);
  line-height:      var(--ds-body-lh);
  color:            var(--text-secondary);
}
.hero--greeting .hero__lead a {
  color:            var(--blue);
  text-decoration:  none;
  font-weight:      600;
  border-bottom:    1px solid var(--blue-tint);
}


/* ==========================================================================
   9 · Reflexions-Nachzug (Phase 6)
   --------------------------------------------------------------------------
   - fab-group        — zwei FABs nebeneinander, gemeinsam positioniert
   - fab--secondary   — Outline-Variante neben dem primären FAB
   - pill--prep       — Status „bereit zum Starten" (Preparing-OCPP)
   - tag              — feinere Variante der Pill für Wallbox-Card-Status
   ========================================================================== */


/* 9.1 fab-group + fab--secondary ---------------------------------------- */

.fab-group {
  position:         fixed;
  right:            max(var(--space-4),
                        calc(50vw - var(--app-frame-max) / 2 + var(--space-4)));
  bottom:           calc(64px + var(--space-2) + env(safe-area-inset-bottom, 0px));
  z-index:          95;
  display:          flex;
  gap:              var(--space-3);
  align-items:      center;
}

.fab-group .fab {
  position:         static;
  right:            auto;
  bottom:           auto;
}

.fab--secondary {
  width:            48px;
  height:           48px;
  background:       var(--bg-surface);
  color:            var(--blue);
  border:           1px solid var(--blue);
  box-shadow:       var(--shadow-1);
}
.fab--secondary:hover {
  background:       var(--blue-tint);
  color:            var(--blue-deep);
  border-color:     var(--blue-deep);
}
.fab--secondary > svg { width: 22px; height: 22px; }


/* 9.2 pill--prep (Preparing-Status) ------------------------------------- */

/* Eigene Variante für OCPP „Preparing" — Kabel steckt, wartet auf Start.
   Lila wie Live, aber ohne Puls und mit dezenter Border-Markierung.        */
.pill--prep {
  background:       var(--violet-tint);
  color:            var(--violet-deep);
  border:           1px dashed var(--violet);
}


/* 9.3 tag (subtilere Pill für Wallbox-Card-Status) ---------------------- */

/* Verzichtet auf Pill-Form, wirkt klar als Label, nicht als Knopf.        */
.tag {
  display:          inline-flex;
  align-items:      center;
  gap:              4px;
  padding:          0;
  font-size:        var(--ds-caption-size);
  line-height:      var(--ds-caption-lh);
  font-weight:      500;
  color:            var(--text-muted);
}
.tag + .tag::before {
  content:          '·';
  margin:           0 var(--space-1) 0 0;
  color:            var(--text-muted);
}


/* 9.4 tier-hint (dezenter Limit-Hinweis) -------------------------------- */

.tier-hint {
  display:          flex;
  align-items:      center;
  justify-content:  space-between;
  gap:              var(--space-2);
  padding:          var(--space-2) var(--space-3);
  margin-top:       var(--space-2);
  font-size:        var(--ds-caption-size);
  color:            var(--text-muted);
}
.tier-hint a {
  color:            var(--blue);
  text-decoration:  none;
  font-weight:      600;
}


/* --------------------------------------------------------------------------
   ENDE Phase 6 · Reflexions-Nachzug
   -------------------------------------------------------------------------- */
