
  /* Zusammengeführt aus den ehemals drei :root-Blöcken (v1 Zeile 16, v4 Zeile 992, v9 Zeile 1991
     der alten index.html). Es galt stets der zuletzt definierte Wert; der Gewinner steht je Token
     dahinter. Light Mode überschreibt weiterhin über html[data-theme="light"] (höhere Spezifität). */
  :root {
    /* Ink-Stufen aus dem Entwurf: Violett statt Blaugrau, opak statt halbtransparent.
       Opak, weil sich sonst der Seitenhintergrund durch jede Karte mischt und die
       Fläche je nach Scrollposition anders aussieht. */
    --bg: #08050C;                                   /* Entwurf ink-950 */
    --bg-2: #0E0913;                                 /* Entwurf ink-900 */
    --surface: #16101E;                              /* Entwurf ink-800 */
    --surface-2: #1F1729;                            /* Entwurf ink-700 */
    --surface-3: #2B2038;                            /* Entwurf ink-600 */
    /* Text: 3 Rollen, alle >= 4.5:1 auf --bg-2 */
    --text: #FBF7FA;                                 /* 17.4:1 */
    --muted: #BDB2C6;                                /*  8.1:1 */
    --muted-2: #8C7F97;                              /*  4.6:1 — Untergrenze */
    --line: rgba(255,255,255,.10);
    --line-strong: rgba(255,255,255,.20);
    --accent: #FF2E63;
    --accent-2: #ff5c7d;
    --hot: #FF2E63;
    --rose: #ff7aa5;
    --ok: #41F5A8;                                   /* = Bühnenfarbe Garden, eine Live-Farbe für alles */
    --danger: #ff4778;
    --black: #08050C;
    --shadow: 0 12px 32px rgba(8,5,12,.55);          /* = --e-2 */
    --radius: 20px;                                  /* = --r-card */
    --safe-bottom: env(safe-area-inset-bottom, 0px); /* v1, nie überschrieben */
    /* --neon-glow entfernt: Glow ist Ausnahmefall (nur Jetzt-Linie und Live-Punkt), kein Token mehr */

    /* --- Stage-Spectrum-Tokens (Entwurf: lir-design-entwuerfe.html) ---
       Ziel: 5 Schriftgrößen, 4pt-Raster, 3 Radien, 2 Schattenstufen.
       Neue Arbeit nutzt diese Tokens; Altwerte werden schichtweise ersetzt. */
    --warn: #ff9f45;
    --t-display: 28px; --lh-display: 32px;
    --t-title: 20px;   --lh-title: 26px;
    --t-body: 15px;    --lh-body: 21px;
    --t-label: 13px;   --lh-label: 18px;
    --t-micro: 11px;   --lh-micro: 14px;
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
    --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
    --r-ctrl: 12px; --r-card: 20px; --r-pill: 999px;
    --e-1: 0 1px 2px rgba(8,5,12,.5);
    --e-2: 0 12px 32px rgba(8,5,12,.55);
    /* Bühnen-Spektrum als Tokens — bisher nur als Inline-Werte aus den Daten */
    --s-generator: #FF365D; --s-factory: #56DFFF; --s-garden: #41F5A8;
    --s-archive: #FF9F45;   --s-bass: #8E4DFF;     --s-port: #FFF15A;
    --s-saurus: #FF47C2;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  }

  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

  html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  html.chat-open,
  body.chat-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background:
      radial-gradient(120% 70% at 50% -8%, rgba(255,46,99,.13), transparent 60%),
      var(--bg);
  }

  /* Das Raster-/Sternchen-Overlay ist entfallen: es lag über der gesamten App und
     nahm Flächen und Text Kontrast, ohne Information zu tragen. */

  button, input { font: inherit; }
  button { color: inherit; }

  .app {
    width: min(980px, 100%);
    margin: 0 auto;
    padding-bottom: calc(28px + var(--safe-bottom));
  }



  /* App-Kopf (ersetzt den bildschirmfüllenden Neon-Hero):
     eine Zeile — Logo und Festivaldaten links, Map und Chat als 44px-Ziele rechts.
     Das Coverbild, der Innenrahmen und die 76px-Überschrift sind entfallen; sie
     kosteten 132px Höhe und trugen keine Information, die nicht im Titel steht. */
  .hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
  }

  .brand-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-width: 0;
  }

  .hero-logo {
    width: 92px;
    flex: 0 0 auto;
    display: block;
  }

  .brand-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    color: var(--muted-2);
    font-size: var(--t-micro);
    line-height: var(--lh-micro);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .brand-meta b,
  .brand-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand-meta b {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
  }

  .head-tools {
    display: flex;
    gap: var(--sp-2);
    flex: 0 0 auto;
  }

  .brand-kicker {
    color: var(--muted-2);
    font-size: var(--t-micro);
    line-height: var(--lh-micro);
    letter-spacing: .16em;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: var(--sp-2);
  }

  .sticky {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    backdrop-filter: blur(18px) saturate(1.1);
    border-top: 1px solid rgba(255,255,255,.04);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 34px rgba(0,0,0,.34);
  }

  .day-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-1);
    padding: var(--sp-2) var(--sp-4) 0;
  }

  .pill,
  .stage-chip {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: transform .12s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
  }
  .day-tab { cursor: pointer; }

  /* Tagesnavigation als Unterstrich-Tabs: die Auswahl markiert eine Kante,
     keine gefüllte Pille. Drei rote Gradient-Pillen nebeneinander konkurrierten
     mit dem Akzent, der sonst nur Favoriten und die aktive Ansicht meint. */
  .day-tab {
    position: relative;
    min-height: 48px;
    padding: var(--sp-1) 0;
    border: 0;
    border-bottom: 2px solid var(--line);
    border-radius: 0;
    background: none;
    color: var(--muted-2);
    text-transform: none;
    letter-spacing: 0;
    transition: color .16s ease, border-color .16s ease;
  }
  .day-tab:active, .pill:active, .stage-chip:active, .fav-btn:active { transform: scale(.97); }
  .day-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
  }
  .day-tab strong {
    display: block;
    font-size: var(--t-label);
    line-height: var(--lh-label);
    font-weight: 700;
  }
  .day-tab span {
    display: block;
    font-size: var(--t-micro);
    line-height: var(--lh-micro);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  .control-panel { padding: 0 var(--sp-4) var(--sp-3); }

  .pill-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 0 8px;
  }
  .pill-row::-webkit-scrollbar, .stage-chips::-webkit-scrollbar { display: none; }

  .pill {
    flex: 1;
    min-width: max-content;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-pill);
    padding: 0 var(--sp-3);
    color: var(--muted);
    font-size: var(--t-label);
    line-height: var(--lh-label);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .pill.now.active {
    background: linear-gradient(120deg, #ff295d, #ff6b93);
  }
  .pill .count { margin-left: 4px; opacity: .72; }

  .search-wrap { position: relative; margin: 2px 0 9px; }
  .search-wrap input {
    width: 100%;
    min-height: 48px;
    border-radius: var(--r-ctrl);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    padding: 13px 46px 13px 15px;
    outline: none;
    font-size: 16px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
  }
  .search-wrap input:focus {
    border-color: rgba(255,91,138,.72);
    box-shadow: 0 0 0 3px rgba(255,41,93,.10), inset 0 0 0 1px rgba(255,255,255,.03);
  }
  .search-wrap input::placeholder { color: var(--muted-2); }
  .clear-search {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 25px;
    cursor: pointer;
    display: none;
  }

  .stage-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .stage-chip {
    flex: 0 0 auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--r-pill);
    padding: 0 var(--sp-3);
    font-size: var(--t-label);
    line-height: var(--lh-label);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
  }
  .stage-chip.active {
    background: var(--stage-color, var(--accent));
    color: #060207;
    border-color: transparent;
  }
  .stage-chip .count {
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: var(--r-pill);
    background: rgba(255,255,255,.10);
    font-size: 10px;
  }
  .stage-chip.active .count { background: rgba(0,0,0,.16); }

  main { padding: 16px 12px 120px; }

  .status-strip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    padding: var(--sp-3);
    border-radius: var(--r-card);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
  }
  .status-strip strong { display: block; color: var(--text); margin-bottom: 2px; }

  .conflicts {
    border: 1px solid rgba(255,71,120,.50);
    background: rgba(255,71,120,.10);
    border-radius: var(--r-card);
    padding: 9px;
    margin-bottom: 12px;
  }
  .conflict-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
  }
  .conflict-panel-toggle {
    display: flex;
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 4px 6px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: rgba(255,255,255,.055);
    color: var(--text);
    cursor: pointer;
  }
  .conflict-panel-toggle:active { transform: scale(.96); }
  .conflict-panel-toggle:focus-visible { outline: 2px solid #8cecff; outline-offset: 2px; }
  .conflict-panel-chevron { color: var(--muted); font-size: 17px; font-weight: 950; line-height: 1; transition: transform .16s ease; }
  .conflict-panel-toggle[aria-expanded="true"] .conflict-panel-chevron { transform: rotate(180deg); }
  .conflicts h3 {
    margin: 0;
    color: #ffd8e3;
    font-size: 12px;
    letter-spacing: .8px;
    text-transform: uppercase;
  }
  .conflict-heading p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.2;
  }
  .conflict-count {
    display: grid;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: var(--r-pill);
    background: rgba(255,71,120,.20);
    color: #ffd6e0;
    font-size: 11px;
    font-weight: 950;
  }
  /* Konflikte sind eine Aufgabenliste, kein Karussell: sie lagen nebeneinander
     mit ausgeblendetem Scrollbalken — bei drei Konflikten sah man einen und
     hatte keinen Hinweis auf die übrigen. */
  .conflict-list {
    display: grid;
    gap: var(--sp-3);
  }
  .conflict-list[hidden] { display: none; }
  .conflict-item { min-width: 0; }
  .conflict-overlap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 2px 4px;
    color: var(--muted);
    font-size: var(--t-micro);
    line-height: 1;
  }
  .conflict-overlap span {
    color: #ffd6e0;
    font-weight: 850;
  }
  .conflict-choices {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: var(--sp-2);
    align-items: stretch;
  }
  .conflict-choice {
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: center;
    gap: 1px;
    min-width: 0;
    min-height: 48px;
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: var(--surface-2);
    color: var(--text);
    text-align: left;
    touch-action: manipulation;
  }
  .conflict-choice:active {
    transform: scale(.98);
    border-color: var(--accent);
  }
  .conflict-time {
    color: var(--muted-2);
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--t-micro);
    line-height: var(--lh-micro);
    font-weight: 700;
  }
  .conflict-choice strong {
    overflow: hidden;
    color: var(--text);
    font-size: var(--t-label);
    line-height: var(--lh-label);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .conflict-choice small {
    overflow: hidden;
    color: var(--muted);
    font-size: var(--t-micro);
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .conflict-or {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: var(--t-micro);
    font-weight: 800;
    text-transform: uppercase;
  }
  .conflict-quote {
    margin: 7px 2px 9px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: color-mix(in srgb, var(--surface-2) 76%, transparent);
  }
  .conflict-quote-head,
  .conflict-quote-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .conflict-quote-head strong {
    color: var(--text);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
  }
  .conflict-quote-head span {
    color: var(--muted);
    font-size: 10px;
  }
  .conflict-quote-labels { margin-top: 7px; }
  .conflict-quote-labels > span {
    display: grid;
    min-width: 0;
    max-width: 48%;
    gap: 1px;
  }
  .conflict-quote-labels > span:last-child { text-align: right; }
  .conflict-quote-labels b {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .conflict-quote-labels strong {
    color: var(--text);
    font-family: var(--mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
  }
  .conflict-quote-bar {
    display: flex;
    width: 100%;
    height: 7px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: var(--r-pill);
    background: var(--line);
  }
  .conflict-quote-bar i {
    display: block;
    height: 100%;
    transition: width .22s ease;
  }
  .conflict-quote.is-empty .conflict-quote-bar i {
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
    opacity: .45;
  }

  .section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
  }
  .section-title:first-child { margin-top: 4px; }
  .section-title::after {
    content: "";
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, rgba(255,41,93,.82), transparent);
  }
  .section-title .label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ff9cb8;
    font-size: 13px;
    font-weight: 1000;
  }
  .section-title .meta {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
  }

  .stage-section { margin-bottom: 18px; }

  /* Bühnenkopf: Fläche neutral, Bühnenfarbe als 3px-Kante links —
     dieselbe Kodierung wie Act-Karte, Timeline-Block und Kartenmarker. */
  .stage-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
    border-radius: var(--r-card) var(--r-card) 0 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: var(--t-body);
    line-height: var(--lh-body);
    font-weight: 700;
  }
  .stage-head::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--stage-color, var(--accent));
  }
  .stage-head small {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .8px;
  }

  .stage-body {
    border: 1px solid var(--line);
    border-top: 0;
    padding: 8px;
    background: rgba(0,0,0,.18);
    border-radius: 0 0 var(--r-card) var(--r-card);
  }

  /* Tages-Trenner: erscheint nur beim Tageswechsel (tagesübergreifende Suche,
     mehrtägiger Plan). Die frühere Zeitüberschrift ist entfallen — sie wiederholte
     die Startzeit, die jede Karte in der Mono-Spalte trägt. */
  .day-title {
    display: flex;
    align-items: baseline;
    gap: var(--sp-2);
    margin: var(--sp-5) 0 var(--sp-2);
    color: var(--text);
    font-size: var(--t-label);
    line-height: var(--lh-label);
    font-weight: 700;
  }
  .day-title span {
    color: var(--muted-2);
    font-size: var(--t-micro);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  .day-title:first-child { margin-top: var(--sp-1); }

  /* Act-Karte (Stage Spectrum): Bühnenfarbe nur als 3px-Kante und im Bühnen-Tag.
     Fläche, Rahmen und Text bleiben ruhig; eine Metazeile, Zeiten in Tabular-Mono. */
  .act-card {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 44px;
    gap: 0 var(--sp-3);
    align-items: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    margin-bottom: var(--sp-2);
    padding: var(--sp-3);
    box-shadow: var(--e-1);
    overflow: hidden;
  }
  .act-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--stage-color, var(--accent));
  }
  .act-card.fav {
    border-color: color-mix(in srgb, var(--stage-color, var(--accent)) 42%, var(--line));
  }
  .act-card.live {
    border-color: color-mix(in srgb, var(--ok) 40%, transparent);
  }
  /* Nur innerhalb einer Bühnenkarte bündig abschließen. In der Zeitansicht
     stehen die Karten in Sektionen; dort trägt die letzte Karte den Abstand
     zur nächsten Sektion, seit die Zeitüberschrift entfallen ist. */
  .stage-body .act-card:last-child { margin-bottom: 0; }

  .time-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0 0 var(--sp-1);
    color: var(--text);
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    text-align: left;
    line-height: var(--lh-label);
  }
  .time-box b { font-size: var(--t-label); font-weight: 700; }
  .time-box span {
    font-size: var(--t-micro);
    line-height: var(--lh-micro);
    color: var(--muted-2);
    font-weight: 500;
  }

  .act-main { min-width: 0; }
  .act-name {
    margin: 0 0 2px;
    color: var(--text);
    font-size: var(--t-body);
    line-height: var(--lh-body);
    font-weight: 700;
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
  }
  .act-meta {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    font-size: var(--t-micro);
    line-height: var(--lh-micro);
    color: var(--muted);
  }
  .act-meta::-webkit-scrollbar { display: none; }
  .badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    border-radius: var(--r-pill);
    padding: 3px 8px;
    font-size: var(--t-micro);
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    background: rgba(255,255,255,.06);
    color: var(--muted);
    border: 1px solid rgba(255,255,255,.03);
  }
  .badge.stage { color: var(--stage-color, var(--accent)); background: rgba(255,255,255,.04); }
  .badge.live { color: #04110b; background: var(--ok); }
  .badge.note { color: #ffe2ef; background: rgba(255,41,93,.18); }

  /* In der Metazeile werden Badges zu ruhigem Text: kein Pill-Rahmen, eine Ebene */
  .act-meta .badge {
    flex: 0 0 auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
  }
  .act-meta .badge + .badge::before {
    content: "·";
    margin-right: var(--sp-2);
    color: var(--muted-2);
  }
  .act-meta .badge.stage {
    background: none;
    color: var(--stage-color, var(--accent));
    font-weight: 700;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .act-meta .badge.live {
    background: none;
    color: var(--ok);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
  }
  .act-meta .badge.note {
    background: none;
    color: var(--warn);
    font-weight: 700;
  }

  .fav-btn {
    align-self: start;
    justify-self: end;
    width: 44px;
    height: 44px;
    border-radius: var(--r-ctrl);
    border: 1px solid var(--line);
    background: none;
    color: var(--muted-2);
    cursor: pointer;
    font-size: 19px;
    line-height: 1;
    display: grid;
    place-items: center;
    transition: background .16s ease, color .16s ease, transform .12s ease, border-color .16s ease;
  }
  .fav-btn.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
  }

  .empty-card {
    border: 1px dashed rgba(255, 74, 128, .28);
    background: rgba(255,255,255,.02);
    color: var(--muted);
    border-radius: var(--r-card);
    margin-top: 8px;
    padding: 44px 18px;
    text-align: center;
    font-weight: 600;
  }
  .empty-card strong {
    display: block;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .8px;
    font-size: 16px;
    margin-bottom: 7px;
  }

  .bottom-actions {
    position: fixed;
    right: 12px;
    bottom: calc(12px + var(--safe-bottom));
    z-index: 25;
  }
  .top-btn {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 74, 128, .24);
    border-radius: 50%;
    background: rgba(10,4,8,.78);
    color: var(--text);
    font-size: 20px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    cursor: pointer;
  }

  @media (min-width: 720px) {
    main, .control-panel, .day-tabs { padding-left: 18px; padding-right: 18px; }
  }

  @media (max-width: 360px) {
  }


  .utility-row .tool-pill {
    flex: 0 0 auto;
    background: rgba(255,255,255,.025);
  }

  .tag-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px 0 2px;
  }
  .tag-chips::-webkit-scrollbar { display: none; }

  .tag-chip {
    flex: 0 0 auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    border-radius: var(--r-pill);
    padding: 0 var(--sp-3);
    font-size: var(--t-label);
    line-height: var(--lh-label);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
  }

  .next-banner,
  .share-panel,
  .update-panel {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--r-card);
    padding: 13px;
    margin: 0 0 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.20);
  }

  .next-banner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
  }
  .next-label,
  .panel-kicker {
    color: #ffb8c9;
    font-size: 11px;
    font-weight: 1000;
    letter-spacing: 1.7px;
    text-transform: uppercase;
  }
  .next-title {
    margin-top: 3px;
    font-size: 17px;
    font-weight: 1000;
    line-height: 1.15;
  }
  .next-meta {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
  }
  .countdown-pill {
    min-width: 92px;
    text-align: center;
    border-radius: var(--r-ctrl);
    padding: 11px 10px;
    color: #080207;
    background: var(--stage-color, var(--accent));
    font-weight: 1000;
  }
  .countdown-pill small {
    display: block;
    margin-top: 2px;
    opacity: .7;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .6px;
  }

  /* Lücke als Trennzeile zwischen zwei Plan-Karten — ~28px statt eines
     209px-Panels über der Liste, und an der Stelle, an der die Pause liegt. */
  .gap-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin: var(--sp-2) 0;
    color: var(--muted-2);
    font-size: var(--t-micro);
    line-height: var(--lh-micro);
    font-weight: 500;
  }
  .gap-row::before,
  .gap-row::after {
    content: "";
    flex: 1 1 auto;
    min-width: var(--sp-2);
    height: 1px;
    background: var(--line);
  }
  .gap-row b {
    flex: 0 0 auto;
    color: var(--muted);
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
  }
  .gap-row .gap-label,
  .gap-row .gap-route {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Trennpunkt in CSS, damit Label und Bühnenroute eigene Textknoten bleiben
     und die Übersetzung den Labeltext exakt trifft */
  .gap-route::before { content: "·"; margin-right: var(--sp-2); color: var(--line-strong); }
  .plan-hint .gap-route::before { content: "·"; margin: 0 var(--sp-1); }
  .gap-row.is-tight,
  .gap-row.is-tight b { color: var(--warn); }
  .gap-row.is-tight::before,
  .gap-row.is-tight::after { background: color-mix(in srgb, var(--warn) 34%, transparent); }

  /* Ersatz für das Panel in Layouts ohne chronologische Reihenfolge */
  .plan-hint {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-height: 44px;
    margin: 0 0 var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid color-mix(in srgb, var(--warn) 34%, transparent);
    border-radius: var(--r-ctrl);
    background: color-mix(in srgb, var(--warn) 10%, var(--surface));
    color: var(--muted);
    font-size: var(--t-micro);
    line-height: var(--lh-micro);
  }
  .plan-hint b {
    flex: 0 0 auto;
    color: var(--warn);
    font-size: var(--t-label);
    font-weight: 700;
  }
  .plan-hint span { min-width: 0; }

  .conflict-badge {
    display: inline-flex;
    margin-left: 5px;
    padding: 2px 7px;
    border-radius: var(--r-pill);
    background: rgba(255,71,120,.18);
    color: #ffc7d5;
    font-size: 11px;
    font-weight: 900;
  }

  .timeline-scroll {
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
  }
  .timeline-axis,
  .timeline-row {
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 10px;
  }
  .timeline-axis {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .7px;
    text-transform: uppercase;
    margin-bottom: 7px;
  }
  .timeline-axis-track,
  .timeline-track {
    position: relative;
  }
  .timeline-axis-track {
    height: 22px;
    border-bottom: 1px solid rgba(255,255,255,.10);
  }
  .timeline-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
  }
  .timeline-tick::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 16px;
    height: 9px;
    border-left: 1px solid rgba(255,255,255,.12);
  }
  .timeline-row {
    align-items: stretch;
    margin-bottom: 9px;
  }
  .timeline-stage-label {
    position: relative;
    border: 1px solid var(--line);
    color: var(--stage-color, var(--accent));
    background: var(--surface);
    border-radius: var(--r-ctrl);
    padding: 10px 9px 10px 12px;
    font-size: var(--t-micro);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
  }
  .timeline-stage-label::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--stage-color, var(--accent));
  }
  .timeline-track {
    min-height: 64px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background:
      repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 1px, transparent 1px calc(100% / 12)),
      rgba(255,255,255,.018);
    overflow: hidden;
  }
  .timeline-block {
    position: absolute;
    top: 8px;
    height: calc(100% - 16px);
    border-radius: var(--r-ctrl);
    padding: 6px 8px;
    background: color-mix(in srgb, var(--stage-color, var(--accent)) 16%, var(--surface));
    color: var(--text);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--stage-color, var(--accent)) 42%, transparent);
  }
  .timeline-block::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: var(--stage-color, var(--accent));
  }
  .timeline-block.fav {
    background: color-mix(in srgb, var(--stage-color, var(--accent)) 30%, var(--surface));
  }
  .timeline-block.fav::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--stage-color, var(--accent)) 30%, var(--surface));
  }
  .timeline-block.live {
    box-shadow: 0 0 0 2px var(--ok);
  }
  .timeline-time {
    display: block;
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--t-micro);
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
  }
  .timeline-name {
    display: block;
    margin-top: 2px;
    font-size: var(--t-micro);
    font-weight: 700;
    line-height: var(--lh-micro);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .share-code {
    width: 100%;
    min-height: 72px;
    margin-top: 8px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--r-ctrl);
    background: rgba(0,0,0,.22);
    color: #ffe9ef;
    padding: 9px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
  }

  @media (max-width: 460px) {
    .next-banner { grid-template-columns: 1fr; }
    .countdown-pill { width: 100%; }
    .timeline-axis,
    .timeline-row { grid-template-columns: 104px 1fr; }
    .timeline-inner { min-width: 920px; }
  }


  /* v4: ruhigeres UI, Bühnefarben zurück, Filter einklappbar, Light/Dark
     (der :root-Block dieser Schicht ist in den zusammengeführten :root oben aufgegangen) */
  /* Light Mode spiegelt dieselbe Staffelung: Papier statt Ink, opake Flächen,
     dieselben drei Textrollen. Jedes Flächen-Token braucht hier ein Gegenstück —
     sonst bleibt die Komponente dunkel. */
  html[data-theme="light"] {
    --bg: #F7F4F8;
    --bg-2: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F2EDF4;
    --surface-3: #E9E2EC;
    --text: #17121A;
    --muted: #5C5361;
    --muted-2: #6E6470;                              /* 5.1:1 auf --bg-2 */
    --line: rgba(28,20,30,.12);
    --line-strong: rgba(28,20,30,.24);
    --ok: #0E9E64;                                   /* Garden-Grün auf Weiß nicht lesbar, abgedunkelt (3.9:1) */
    --black: #FFFFFF;
    --shadow: 0 12px 32px rgba(40,25,34,.13);
    --e-1: 0 1px 2px rgba(40,25,34,.10);
    --e-2: 0 12px 32px rgba(40,25,34,.13);
  }
  html[data-theme="light"] body::before {
    background:
      radial-gradient(120% 70% at 50% -8%, rgba(255,46,99,.09), transparent 60%),
      var(--bg);
  }

  .hero-inner { max-width: 820px; margin: 0 auto; }
  html[data-theme="light"] .brand-kicker,


  .control-panel { padding-bottom: 8px; }
  .primary-row {
    display: grid;
    grid-template-columns: 1fr 1.18fr 1fr .88fr;
    gap: 8px;
  }
  .primary-row .pill {
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }
  .theme-pill {
    border-color: rgba(255,255,255,.12);
  }

  .advanced-panel {
    margin-top: 2px;
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--surface);
    overflow: hidden;
  }

  .advanced-panel summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    min-height: 48px;
    padding: 0 var(--sp-4);
    color: var(--text);
    font-size: var(--t-label);
    line-height: var(--lh-label);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
  }
  .advanced-panel summary::-webkit-details-marker { display: none; }
  .advanced-panel summary::after {
    content: "▾";
    color: var(--muted);
    transition: transform .16s ease;
  }
  .advanced-panel[open] summary::after { transform: rotate(180deg); }
  .advanced-panel summary small {
    margin-left: auto;
    color: var(--muted-2);
    font-size: var(--t-micro);
    line-height: var(--lh-micro);
    font-weight: 500;
  }
  .advanced-content {
    padding: 0 10px 10px;
  }

  .pill,
  .stage-chip,
  .tag-chip {
    background: rgba(255,255,255,.035);
    border-color: var(--line);
  }
  html[data-theme="light"] .pill,
  html[data-theme="light"] .stage-chip,
  html[data-theme="light"] .tag-chip {
    background: rgba(255,255,255,.76);
    color: #221a25;
  }

  .pill.active {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
  }
  .stage-chip.active {
    background: var(--stage-color, var(--accent));
    color: #07080d;
  }
  .tag-chip.active {
    background: #e8ebf4;
    color: #131722;
    border-color: rgba(255,255,255,.2);
    box-shadow: none;
  }

  /* (v5-Override des Bühnenkopfs ist in die Basis aufgegangen.) */

  /* (v5-Overrides für .act-card, .act-card.fav und .time-box sind in die
     Stage-Spectrum-Basisdefinition der Act-Karte aufgegangen) */
  .next-banner,
  .share-panel,
  .update-panel,
  .status-strip,
  .conflicts {
    background: var(--surface);
    border-color: var(--line);
  }
  html[data-theme="light"] .next-banner,
  html[data-theme="light"] .share-panel,
  html[data-theme="light"] .update-panel,
  html[data-theme="light"] .status-strip,
  html[data-theme="light"] .conflicts {
    background: rgba(255,255,255,.64);
  }

  .section-title::after {
    background: linear-gradient(90deg, var(--line-strong), transparent);
  }
  .section-title .label {
    color: var(--text);
    text-shadow: none;
  }

  /* (v5-Timeline-Overrides sind in die Stage-Spectrum-Basis aufgegangen) */

  @media (max-width: 430px) {
    .primary-row {
      grid-template-columns: 1fr 1.15fr 1fr;
    }
    .theme-pill {
      grid-column: 1 / -1;
    }
    .advanced-panel summary small { display: none; }
  }


  /* v5: bottom navigation, nested filters, readable light mode, tutorial */
  .app {
    padding-bottom: calc(112px + var(--safe-bottom));
  }

  .control-panel {
    padding-top: 0;
  }

  .advanced-panel {
    margin-top: 10px;
  }

  .advanced-content {
    display: grid;
    gap: 10px;
  }

  .compact-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0;
  }

  .compact-row .pill {
    min-width: 0;
  }

  .filter-group {
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: rgba(255,255,255,.022);
    overflow: hidden;
  }


  .filter-group summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    min-height: 48px;
    padding: 0 var(--sp-3);
    color: var(--text);
    font-size: var(--t-label);
    line-height: var(--lh-label);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
  }

  .filter-group summary::-webkit-details-marker { display: none; }
  .filter-group summary::after {
    content: "▾";
    color: var(--muted);
    transition: transform .16s ease;
  }
  .filter-group[open] summary::after { transform: rotate(180deg); }
  .filter-group summary small {
    margin-left: auto;
    color: var(--muted-2);
    font-size: var(--t-micro);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
  }

  .filter-group .stage-chips,
  .filter-group .tag-chips,
  .filter-group .utility-row {
    padding: 0 10px 10px;
  }




  /* Tab-Leiste: Icon über Label, aktive Ansicht als 2px-Indikator an der Oberkante.
     Vier gefüllte Pillen nebeneinander lasen sich wie vier gleichrangige Aktionen —
     eine Navigationsleiste soll aber zeigen, wo man ist, nicht was man tun kann. */
  .bottom-nav-btn {
    position: relative;
    min-height: 48px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: var(--sp-1);
    padding: var(--sp-1) 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--muted-2);
    font-size: var(--t-micro);
    line-height: var(--lh-micro);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transition: color .16s ease;
  }
  .bottom-nav-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .bottom-nav-btn.active { color: var(--text); }
  .bottom-nav-btn.active::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    border-radius: var(--r-pill);
    background: var(--accent);
  }

  /* Freundeszähler als Badge am Icon statt als Zusatz hinter dem Wort */
  .bottom-nav-btn small {
    position: absolute;
    top: 2px;
    right: 22%;
    display: grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
  }
  .bottom-nav-btn small:empty { display: none; }

  .bottom-actions {
    right: 16px;
    bottom: calc(94px + var(--safe-bottom));
  }

  .tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,.56);
    backdrop-filter: blur(10px);
  }

  body[data-account-ready="checking"] > .app,
  body[data-account-ready="checking"] > .bottom-actions,
  body[data-account-ready="checking"] > .bottom-fade,
  body[data-account-ready="checking"] > .bottom-nav,
  body[data-account-ready="false"] > .app,
  body[data-account-ready="false"] > .bottom-actions,
  body[data-account-ready="false"] > .bottom-fade,
  body[data-account-ready="false"] > .bottom-nav { visibility: hidden; }
  body[data-account-ready="checking"],
  body[data-account-ready="false"] { overflow: hidden; }
  .account-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top, 0px)) 18px max(18px, env(safe-area-inset-bottom, 0px));
    background:
      linear-gradient(180deg, rgba(8,2,6,.80), rgba(8,2,6,.96)),
      url('assets/lir-neon-cover.png') center/cover no-repeat;
    overflow-y: auto;
  }
  .account-gate-overlay[hidden] { display: none; }
  .account-gate-card {
    width: min(460px, 100%);
    padding: 24px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-card);
    background: rgba(23,8,16,.96);
    box-shadow: var(--e-2);
    text-align: center;
  }
  .account-gate-card img {
    display: block;
    width: min(300px, 88%);
    margin: 0 auto 18px;
    filter: drop-shadow(0 0 18px rgba(255,41,93,.26));
  }
  .account-gate-card h1 { margin: 7px 0 10px; font-size: clamp(34px, 10vw, 50px); }
  .account-gate-card p { margin: 0; color: var(--muted); line-height: 1.55; }
  .account-gate-card > small { display: block; color: var(--muted); line-height: 1.5; }
  .account-gate-actions { display: grid; gap: 10px; margin: 22px 0 16px; }
  .account-gate-actions .friend-primary,
  .account-gate-actions .friend-secondary { width: 100%; min-height: 52px; }
  .tutorial-overlay[hidden] { display: none; }
  .tutorial-card {
    width: min(520px, 100%);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-card);
    background: var(--surface-2);
    color: var(--text);
    padding: 22px;
    box-shadow: 0 28px 80px rgba(0,0,0,.48);
  }
  html[data-theme="light"] .tutorial-card {
    background: rgba(255,255,255,.94);
  }
  .tutorial-kicker {
    color: var(--accent);
    font-size: 11px;
    font-weight: 1000;
    letter-spacing: 2px;
    text-transform: uppercase;
  }
  .tutorial-card h2 {
    margin: 7px 0 12px;
    font-size: 24px;
    line-height: 1.05;
  }
  .tutorial-card ol {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.45;
  }
  .tutorial-card li { margin: 8px 0; }
  .tutorial-card b { color: var(--text); }
  .tutorial-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
  }
  .ios-install-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: grid;
    place-items: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
    background: rgba(0,0,0,.68);
    backdrop-filter: blur(12px);
  }
  .ios-install-overlay[hidden] { display: none; }
  .ios-install-card {
    width: min(500px, 100%);
    max-height: min(760px, calc(100dvh - 32px));
    overflow-y: auto;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-card);
    background: var(--surface-2);
    color: var(--text);
    padding: 20px;
    box-shadow: 0 28px 90px rgba(0,0,0,.56);
  }
  html[data-theme="light"] .ios-install-card { background: rgba(255,255,255,.97); }
  .ios-install-card h2 { margin: 7px 0 7px; font-size: 24px; line-height: 1.08; }
  .ios-install-card > p { margin: 0 0 14px; color: var(--muted); line-height: 1.45; }
  .ios-install-version-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin: 0 0 13px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: rgba(255,255,255,.035);
  }
  .ios-install-version {
    min-height: 38px;
    border: 0;
    border-radius: var(--r-ctrl);
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 950;
  }
  .ios-install-version.active {
    color: #fff;
    background: linear-gradient(120deg,rgba(255,54,93,.88),rgba(142,77,255,.84));
    box-shadow: 0 5px 16px rgba(255,54,93,.22);
  }
  .ios-install-step { display: grid; gap: 12px; }
  .ios-install-step[hidden] { display: none; }
  .ios-install-image {
    display: block;
    width: 100%;
    max-height: 310px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: #08090e;
  }
  .ios-install-visual {
    min-height: 205px;
    display: grid;
    place-items: center;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: radial-gradient(circle at 50% 10%,rgba(142,77,255,.20),transparent 44%),#08090e;
  }
  .ios-classic-browser,
  .ios-classic-sheet,
  .ios-classic-confirm {
    width: min(360px,100%);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: var(--r-card);
    background: #20212a;
    box-shadow: 0 14px 35px rgba(0,0,0,.38);
  }
  .ios-classic-page {
    min-height: 78px;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.58);
    font-size: 11px;
    font-weight: 850;
  }
  .ios-classic-url { padding: 10px; border-top: 1px solid rgba(255,255,255,.09); color: #fff; text-align: center; font-size: 12px; }
  .ios-classic-toolbar { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; padding: 10px 12px 12px; border-top: 1px solid rgba(255,255,255,.08); }
  .ios-classic-tool { min-height: 42px; display: grid; place-items: center; border-radius: var(--r-ctrl); color: rgba(255,255,255,.70); font-size: 23px; }
  .ios-classic-tool.highlight { color: #fff; background: var(--accent); box-shadow: 0 0 0 4px rgba(255,54,93,.18); }
  .ios-classic-tool svg,
  .ios-menu-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
  .ios-sheet-handle { width: 38px; height: 4px; margin: 8px auto 10px; border-radius: var(--r-pill); background: rgba(255,255,255,.28); }
  .ios-menu-row { min-height: 55px; display: grid; grid-template-columns: 32px 1fr; gap: 9px; align-items: center; padding: 0 15px; border-top: 1px solid rgba(255,255,255,.09); color: #fff; font-size: 13px; font-weight: 800; }
  .ios-menu-row.highlight { color: #fff; background: linear-gradient(90deg,rgba(255,54,93,.32),rgba(142,77,255,.18)); }
  .ios-menu-icon { display: grid; place-items: center; color: rgba(255,255,255,.86); }
  .ios-confirm-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 13px; border-bottom: 1px solid rgba(255,255,255,.10); font-size: 11px; }
  .ios-confirm-head b { color: #fff; text-align: center; }
  .ios-confirm-head span { color: #69a9ff; }
  .ios-confirm-head .highlight { padding: 6px 8px; border-radius: var(--r-ctrl); color: #fff; background: var(--accent); font-weight: 950; }
  .ios-confirm-app { display: grid; grid-template-columns: 45px 1fr; gap: 11px; align-items: center; padding: 18px; }
  .ios-confirm-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: var(--r-ctrl); color: #fff; background: linear-gradient(135deg,var(--accent),var(--accent-2)); font-size: 12px; font-weight: 1000; }
  .ios-confirm-app b { display: block; color: #fff; font-size: 13px; }
  .ios-confirm-app small { display: block; margin-top: 3px; color: rgba(255,255,255,.55); font-size: 10px; }
  .ios-install-copy { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; }
  .ios-install-number {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    background: linear-gradient(120deg,var(--accent),var(--accent-2));
    font-weight: 1000;
  }
  .ios-install-copy strong { display: block; margin-top: 1px; }
  .ios-install-copy small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.4; }
  .ios-install-progress { display: flex; justify-content: center; gap: 7px; margin-top: 16px; }
  .ios-install-dot { width: 7px; height: 7px; border: 0; border-radius: 50%; background: var(--line-strong); padding: 0; }
  .ios-install-dot.active { width: 22px; border-radius: var(--r-pill); background: var(--accent); }
  .ios-install-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 14px; }

  /* Light mode readability fixes */
  /* Das Logo ist weiß gezeichnet und braucht im Light Mode einen dunklen Träger */
  html[data-theme="light"] .hero-logo {
    filter: invert(1) brightness(.28);
  }
  html[data-theme="light"] .stage-head {
    color: var(--text);
    background: var(--surface);
  }
  html[data-theme="light"] .stage-head small,
  html[data-theme="light"] .timeline-axis,
  html[data-theme="light"] .next-meta,
  html[data-theme="light"] .conflict-choice,
  html[data-theme="light"] .status-strip,
  html[data-theme="light"] .empty-card,
  html[data-theme="light"] .badge {
    color: #554b57;
  }
  html[data-theme="light"] .act-name,
  html[data-theme="light"] .next-title,
  html[data-theme="light"] .conflicts h3,
  html[data-theme="light"] .section-title .label,
  html[data-theme="light"] .tutorial-card b {
    color: #17121a;
  }
  .act-popup-stage { color: var(--stage-color, var(--accent)); }
  html[data-theme="light"] .timeline-stage-label,
  html[data-theme="light"] .badge.stage,
  html[data-theme="light"] .act-meta .badge.stage,
  html[data-theme="light"] .act-popup-stage {
    color: color-mix(in srgb, var(--stage-color, var(--accent)) 58%, #17121a);
  }
  html[data-theme="light"] .timeline-track {
    background:
      repeating-linear-gradient(90deg, rgba(28,20,30,.08) 0 1px, transparent 1px calc(100% / 12)),
      rgba(255,255,255,.52);
  }
  html[data-theme="light"] .search-wrap input {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
  }
  html[data-theme="light"] .search-wrap input::placeholder {
    color: #706778;
  }
  html[data-theme="light"] .countdown-pill,
  html[data-theme="light"] .stage-chip.active {
    color: #07080d;
  }

  @media (max-width: 430px) {
    .compact-row { grid-template-columns: 1fr; }
    .bottom-actions { display: none; }
  }


  .layout-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4) var(--sp-1);
  }
  .layout-strip .pill {
    min-width: 0;
    min-height: 44px;
    padding: 0 var(--sp-3);
    font-size: var(--t-label);
    background: rgba(255,255,255,.028);
    box-shadow: none;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    touch-action: manipulation;
  }
  .layout-strip .pill.active {
  }
  .advanced-content {
    padding-top: 2px;
  }
  html[data-theme="light"] .sticky {
    background: var(--bg);
    box-shadow: 0 14px 28px rgba(48,31,41,.10);
  }
  html[data-theme="light"] .pill,
  html[data-theme="light"] .stage-chip,
  html[data-theme="light"] .filter-group,
  html[data-theme="light"] .advanced-panel {
    border-color: var(--line);
  }
  html[data-theme="light"] .pill,
  html[data-theme="light"] .stage-chip,
  html[data-theme="light"] .layout-strip .pill,
  html[data-theme="light"] .filter-group {
    background: var(--surface);
    color: var(--text);
  }
  html[data-theme="light"] .advanced-panel {
    background: var(--surface);
  }
  html[data-theme="light"] .advanced-panel summary small,
  html[data-theme="light"] .filter-group summary small,
  html[data-theme="light"] .search-wrap input::placeholder {
    color: #6d6673;
  }
  html[data-theme="light"] .next-banner,
  html[data-theme="light"] .card,
  html[data-theme="light"] .empty-card,
  html[data-theme="light"] .timeline-track {
    box-shadow: 0 10px 26px rgba(41,27,36,.08);
  }
  html[data-theme="light"] .section-title .label,
  html[data-theme="light"] .section-title .meta {
    color: #191822;
  }
  html[data-theme="light"] .conflicts {
    border-color: rgba(255,71,120,.22);
    background: var(--surface);
  }
  @media (max-width: 430px) {
    .bottom-nav {
      left: 10px;
      right: 10px;
      border-radius: var(--r-card);
      max-width: none;
    }
    .bottom-nav-btn {
      min-height: 46px;
      border-radius: var(--r-ctrl);
      font-size: 12px;
    }
    .layout-strip .pill {
      min-height: 44px;
      font-size: 11px;
    }
  }


  /* v7: farbcodierte Konflikt-Badges, Timeline-Popup, kompaktere Buttons, Bottom-Nav-Kontrast, Scroll-Fade */

  .pill,
  .stage-chip,
  .tag-chip {
    background: var(--surface);
    border-color: var(--line);
  }
  .layout-strip .pill { min-height: 44px; background: var(--surface); }
  .advanced-panel summary { min-height: 50px; }
  .filter-group summary { min-height: 48px; }

  html[data-theme="light"] .pill,
  html[data-theme="light"] .stage-chip,
  html[data-theme="light"] .tag-chip {
    background: var(--surface);
    border-color: var(--line-strong);
  }
  html[data-theme="light"] .pill.active,
  .pill.active {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
  }
  html[data-theme="light"] .stage-chip.active,
  .stage-chip.active {
    background: var(--stage-color, var(--accent));
    border-color: transparent;
    color: #07080d;
  }
  html[data-theme="light"] .tag-chip.active {
    background: #181923;
    border-color: #181923;
    color: #fff;
  }


  /* (v7-Overrides der Tab-Leiste sind in die Basis aufgegangen.) */

  .bottom-fade {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(96px + var(--safe-bottom));
    z-index: 24;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(7,8,13,.55) 34%, rgba(7,8,13,.94) 62%, rgb(7,8,13) 82%);
  }

  .conflict-badge.hard { background: rgba(255,71,120,.34); color: #ffd6e0; }
  .conflict-badge.soft { background: rgba(255,241,90,.18); color: #fff3b8; }
  html[data-theme="light"] .conflict-badge.hard { background: rgba(255,71,120,.16); color: #a1153c; }
  html[data-theme="light"] .conflict-badge.soft { background: rgba(214,178,0,.14); color: #7a6300; }
  html[data-theme="light"] .conflict-choice strong,
  html[data-theme="light"] .conflict-choice {
    border-color: rgba(61,46,56,.14);
    background: rgba(255,255,255,.66);
  }
  html[data-theme="light"] .conflict-overlap span,
  html[data-theme="light"] .conflict-time {
    color: #ad1743;
  }

  .timeline-block { cursor: pointer; }
  .timeline-nowline {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--ok);
    box-shadow: 0 0 12px color-mix(in srgb, var(--ok) 55%, transparent);
    z-index: 2;
    pointer-events: none;
  }

  .act-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,.58);
    backdrop-filter: blur(8px);
  }
  .act-popup-overlay[hidden] { display: none; }
  .act-popup {
    position: relative;
    width: min(420px, 100%);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--surface);
    padding: var(--sp-5) var(--sp-4) var(--sp-4) var(--sp-5);
    box-shadow: var(--e-2);
    overflow: hidden;
  }
  .act-popup::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--stage-color, var(--accent));
  }
  html[data-theme="light"] .act-popup { background: rgba(255,255,255,.97); }
  .act-popup h2 {
    margin: 6px 0 10px;
    font-size: 22px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }
  .act-popup .act-meta { margin-bottom: 14px; }
  .act-popup-times {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 12px;
  }
  .act-popup-times b { color: var(--text); }
  .act-popup-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .act-popup-actions .pill { min-height: 44px; }


  /* v8: kompakter Hero, Tools als eigener Button, Konflikt-Markierung in der Timeline */

  .hero {
    position: relative;
    padding: calc(var(--sp-2) + env(safe-area-inset-top, 0px)) var(--sp-4) var(--sp-2);
  }

  .tools-panel summary { min-height: 50px; }

  .timeline-block.conflict {
    outline: 2px dashed var(--warn);
    outline-offset: -2px;
  }
  .timeline-block.conflict::after {
    content: "!";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--warn);
    color: var(--black);
    font-size: 10px;
    font-weight: 1000;
    display: grid;
    place-items: center;
    line-height: 1;
  }


  /* v9: Dark Mode wieder heller und wärmer (Light Mode unverändert)
     (der :root-Block dieser Schicht ist in den zusammengeführten :root oben aufgegangen) */
  /* (Der v9-Hintergrund und die v9-Sticky-Fläche sind in die Token-Basis aufgegangen.) */

  .pill,
  .stage-chip,
  .tag-chip {
    background: var(--surface);
  }
  .layout-strip .pill.active,
  .pill.active {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
  }
  .stage-body { background: var(--surface); }
  .timeline-track {
    background:
      repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / 12)),
      var(--bg-2);
  }


  .bottom-fade {
    background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--bg) 55%, transparent) 42%, var(--bg) 88%);
  }

  /* Freunde, Profil & Cloud-Synchronisierung */
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 26;
    display: grid;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    gap: 0;
    padding: var(--sp-2) var(--sp-2) calc(var(--sp-2) + var(--safe-bottom));
    background: var(--bg);
    box-shadow: 0 14px 36px rgba(0,0,0,.45);
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body[data-view="friends"] .sticky,
  body[data-view="profile"] .sticky { display: none; }
  .friend-shell { display: grid; gap: 14px; }
  .friend-hero,
  .friend-gate,
  .friend-card,
  .friend-notice {
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--surface);
    box-shadow: 0 14px 34px rgba(0,0,0,.15);
  }
  .friend-hero,
  .friend-gate { padding: 18px; }
  .friend-gate-clean { max-width: 560px; margin: 0 auto; padding: 22px; }
  .group-join-form { display: grid; gap: 10px; margin-top: 18px; }
  .group-join-form .friend-field { margin: 0; }
  .group-join-form .friend-primary,
  .group-join-form .friend-secondary { width: 100%; }
  .group-choice-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  .group-choice-divider::before,
  .group-choice-divider::after { content: ''; height: 1px; background: var(--line); }
  .group-choice-note { color: var(--muted); font-size: 11px; line-height: 1.45; text-align: center; }
  .friend-kicker {
    color: var(--accent);
    font-size: 11px;
    font-weight: 1000;
    letter-spacing: 1.5px;
    text-transform: uppercase;
  }
  .friend-hero h2,
  .friend-gate h2 { margin: 5px 0 7px; font-size: 23px; }
  .friend-hero p,
  .friend-gate p,
  .friend-card p { margin: 0; color: var(--muted); line-height: 1.45; }
  .friend-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0;
  }
  .friend-stat {
    padding: 11px 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: rgba(255,255,255,.045);
    text-align: center;
  }
  .friend-stat b { display: block; color: var(--text); font-size: 20px; }
  .friend-stat span { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
  .friend-actions,
  .friend-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .friend-primary,
  .friend-secondary {
    min-height: 44px;
    border-radius: var(--r-ctrl);
    padding: 10px 14px;
    font: inherit;
    font-weight: 950;
    cursor: pointer;
  }
  .friend-primary {
    border: 0;
    color: #fff;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 22px rgba(255,54,93,.22);
  }
  .friend-secondary {
    border: 1px solid var(--line);
    color: var(--text);
    background: rgba(255,255,255,.06);
  }
  .friend-primary:disabled,
  .friend-secondary:disabled { opacity: .52; cursor: wait; }
  .friend-field { display: grid; gap: 7px; margin: 15px 0; }
  .friend-field[hidden] { display: none; }
  .friend-field label { font-size: 12px; font-weight: 950; color: var(--muted); }
  .optional-label { color: var(--muted); font-size: 10px; font-weight: 750; }
  .friend-field small { color: var(--muted); font-size: 12px; line-height: 1.45; }
  .friend-field input,
  .friend-field textarea {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    padding: 10px 13px;
    color: var(--text);
    background: rgba(255,255,255,.06);
    font: inherit;
    outline: none;
  }
  .friend-field textarea { min-height: 112px; resize: vertical; }
  .friend-field input:focus,
  .friend-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,54,93,.12); }
  html[data-theme="light"] .friend-field input,
  html[data-theme="light"] .friend-field textarea { background: rgba(255,255,255,.8); }
  .friend-error { margin-top: 10px; color: #ff7695; font-size: 13px; font-weight: 850; }
  html[data-theme="light"] .friend-error { color: #aa1640; }
  .friend-notice { padding: 12px 14px; color: var(--muted); font-size: 13px; }
  .friend-grid { display: grid; gap: 10px; }
  .friend-card { padding: 15px; }
  .friend-group-plan {
    position: relative;
    margin-bottom: 12px;
    overflow: hidden;
    background:

      var(--surface);
  }
  .friend-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }
  .friend-group-actions { display: flex; align-items: center; gap: 6px; }
  .friend-group-head h3 { margin: 0 0 3px; font-size: 18px; letter-spacing: -.28px; }
  .friend-group-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
  .friend-group-count {
    flex: 0 0 auto;
    padding: 7px 9px;
    border-radius: var(--r-ctrl);
    color: #fff;
    background: rgba(86,223,255,.18);
    font-size: 12px;
    font-weight: 950;
  }
  .group-plan-collapse {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    color: var(--text);
    background: rgba(255,255,255,.06);
    font: inherit;
    font-size: 17px;
    font-weight: 950;
    cursor: pointer;
  }
  .group-plan-insights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
  }
  .group-plan-insight {
    min-width: 0;
    padding: 9px 7px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: var(--r-ctrl);
    background: rgba(4,7,15,.28);
    text-align: center;
  }
  .group-plan-insight b { display: block; color: var(--text); font-size: 17px; line-height: 1; }
  .group-plan-insight span { display: block; margin-top: 4px; color: var(--muted-2); font-size: var(--t-micro); font-weight: 900; letter-spacing: .45px; text-transform: uppercase; }
  .group-plan-spotlight {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
    padding: 10px 11px;
    border: 1px solid color-mix(in srgb, var(--group-stage-color) 36%, transparent);
    border-radius: var(--r-ctrl);
    background: color-mix(in srgb, var(--group-stage-color) 9%, rgba(3,6,14,.48));
    box-shadow: inset 3px 0 var(--group-stage-color);
  }
  .group-plan-spotlight-copy { min-width: 0; }
  .group-plan-spotlight-copy small { display: block; color: var(--muted-2); font-size: var(--t-micro); font-weight: 950; letter-spacing: .75px; text-transform: uppercase; }
  .group-plan-spotlight-copy strong { display: block; margin-top: 3px; overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .group-plan-spotlight-copy span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .group-plan-spotlight button {
    min-height: 44px;
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: var(--r-ctrl);
    color: var(--text);
    background: rgba(255,255,255,.07);
    font: inherit;
    font-size: 10px;
    font-weight: 950;
    cursor: pointer;
  }
  .group-plan-controls { display: flex; align-items: center; gap: 7px; margin-top: 10px; }
  .group-plan-days {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .group-plan-days::-webkit-scrollbar { display: none; }
  .group-plan-day-filter,
  .group-plan-shared-filter {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--muted);
    background: rgba(255,255,255,.045);
    font: inherit;
    font-size: var(--t-micro);
    font-weight: 950;
    cursor: pointer;
  }
  .group-plan-day-filter.active,
  .group-plan-shared-filter[aria-pressed="true"] {
    border-color: rgba(86,223,255,.36);
    color: #d9f8ff;
    background: rgba(86,223,255,.14);
  }
  .group-plan-options { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 7px; }
  .group-plan-sort { display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-pill); }
  .group-plan-sort button {
    min-height: 34px;
    padding: 5px 9px;
    border: 0;
    border-left: 1px solid var(--line);
    background: rgba(255,255,255,.045);
    color: var(--muted);
    font: inherit;
    font-size: var(--t-micro);
    font-weight: 900;
    cursor: pointer;
  }
  .group-plan-sort button:first-child { border-left: 0; }
  .group-plan-sort button[aria-pressed="true"] { background: rgba(86,223,255,.14); color: #d9f8ff; }
  .group-plan-list { display: grid; gap: 13px; margin-top: 12px; }
  .group-plan-day-section { display: grid; gap: 7px; }
  .group-plan-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px; }
  .group-plan-day-head strong { color: var(--text); font-size: 13px; }
  .group-plan-day-head span { color: var(--muted-2); font-size: var(--t-micro); font-weight: 850; }
  .group-plan-act {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 44px;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3);
    border: 1px solid rgba(255,255,255,.075);
    border-left: 3px solid var(--group-stage-color);
    border-radius: var(--r-ctrl);
    background: rgba(4,7,15,.34);
    box-shadow: 0 7px 18px rgba(0,0,0,.10);
  }
  .group-plan-act.you-too { border-color: rgba(125,255,186,.28); border-left-color: var(--group-stage-color); }
  .group-plan-time {
    display: grid;
    place-items: center;
    align-self: stretch;
    padding: 5px 3px;
    border-radius: var(--r-ctrl);
    color: var(--text);
    background: rgba(255,255,255,.055);
    font-size: 12px;
    font-weight: 950;
    line-height: 1.05;
    text-align: center;
  }
  .group-plan-time small { margin-top: 3px; color: var(--muted-2); font-size: var(--t-micro); font-weight: 850; }
  .group-plan-main {
    min-width: 0;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .group-plan-stage { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: var(--t-micro); font-weight: 900; letter-spacing: .35px; text-transform: uppercase; }
  .group-plan-stage::before { width: 6px; height: 6px; border-radius: 50%; background: var(--group-stage-color); content: ''; }
  .group-plan-main strong { display: block; margin-top: 3px; overflow: hidden; color: var(--text); font-size: 13px; line-height: 1.18; text-overflow: ellipsis; white-space: nowrap; }
  /* Volle Kartenbreite und außerhalb des Buttons: in der Mittelspalte blieben
     199px für sieben Chips, und eine scrollbare Zone innerhalb eines Buttons
     lässt sich weder ziehen noch sauber vorlesen. */
  .group-attendees {
    grid-column: 1 / -1;
    display: flex;
    gap: var(--sp-1);
    margin-top: var(--sp-2);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 12px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 12px), transparent 100%);
  }
  .group-attendees:empty { display: none; }
  .group-attendees::-webkit-scrollbar { display: none; }
  .group-plan-attendee,
  .you-too-chip {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 4px;
    padding: 2px 6px 2px 2px;
    border-radius: var(--r-pill);
    color: #d9f8ff;
    background: rgba(86,223,255,.12);
    font-size: var(--t-micro);
    font-weight: 900;
  }
  .group-plan-avatar { width: 22px; height: 22px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; object-fit: cover; color: var(--bg); background: linear-gradient(135deg, var(--s-factory), var(--s-bass)); font-size: var(--t-micro); font-weight: 700; }
  .you-too-chip { padding-left: 6px; color: #dfffea; background: rgba(125,255,186,.14); }
  .group-plan-added { display: grid; width: 30px; height: 30px; place-items: center; color: var(--ok); font-size: 15px; font-weight: 950; }
  .group-plan-empty { padding: 18px 10px; color: var(--muted); font-size: 11px; text-align: center; }
  html[data-theme="light"] .friend-group-plan { background: var(--surface); }
  html[data-theme="light"] .group-plan-insight,
  html[data-theme="light"] .group-plan-act { border-color: rgba(20,24,38,.08); background: rgba(255,255,255,.56); }
  html[data-theme="light"] .group-plan-day-filter.active,
  html[data-theme="light"] .group-plan-shared-filter[aria-pressed="true"] { color: #06627b; }
  .friend-card-head { display: flex; gap: 12px; align-items: flex-start; }
  .friend-avatar {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #8e4dff);
    font-weight: 1000;
    font-size: 18px;
  }
  .friend-card-title { min-width: 0; flex: 1; }
  .friend-card-title h3 { margin: 1px 0 4px; font-size: 18px; overflow-wrap: anywhere; }
  .friend-card-title small { color: var(--muted); font-size: 11px; font-weight: 800; }
  .friend-match {
    flex: 0 0 auto;
    min-width: 56px;
    padding: 7px 8px;
    border-radius: var(--r-ctrl);
    color: #fff;
    background: rgba(255,54,93,.76);
    text-align: center;
    font-size: 10px;
    font-weight: 950;
  }
  .friend-match b { display: block; font-size: 18px; line-height: 1; }
  .friend-common { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
  .friend-common-toggle {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border: 0;
    color: var(--text);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 950;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
  }
  .friend-common-toggle::after { content: "▾"; color: var(--muted); }
  .friend-common-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
  .friend-common-list { display: grid; gap: 7px; margin-top: 10px; }
  .friend-common-act {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 9px;
    align-items: center;
    padding: 8px 9px;
    border-radius: var(--r-ctrl);
    background: rgba(255,255,255,.045);
    font-size: 12px;
  }
  .friend-common-act b { color: var(--text); }
  .friend-common-act span { color: var(--muted); }
  .friend-act-add {
    min-height: 44px;
    padding: 0 11px;
    border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
    border-radius: var(--r-pill);
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
  }
  .friend-act-add:active { transform: scale(.97); }

  .ios-pwa-hint {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 11px;
    border: 1px solid rgba(86,223,255,.28);
    border-radius: var(--r-ctrl);
    background: rgba(86,223,255,.08);
  }
  .ios-pwa-hint-icon { font-size: 20px; }
  .ios-pwa-hint-copy { min-width: 0; font-size: 12px; line-height: 1.35; }
  .ios-pwa-hint-copy b { display: block; color: var(--text); }
  .ios-pwa-hint-copy span { color: var(--muted); }
  .ios-pwa-hint-actions { display: flex; align-items: center; gap: 6px; }
  .ios-pwa-hint-actions button {
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--text);
    background: var(--panel-2);
    font-size: 11px;
    font-weight: 900;
  }
  .ios-pwa-hint-actions .ios-pwa-close {
    width: 44px;
    padding: 0;
    color: var(--muted);
    background: transparent;
  }
  @media (max-width: 520px) {
    .friend-common-act { grid-template-columns: 50px 1fr; }
    .friend-common-act .friend-act-add { grid-column: 2; justify-self: start; }
    .ios-pwa-hint { grid-template-columns: auto 1fr; }
    .ios-pwa-hint-actions { grid-column: 2; }
  }
  .friend-empty { padding: 22px 16px; text-align: center; color: var(--muted); }
  .sync-label { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; color: var(--muted); font-size: 12px; font-weight: 850; }
  .sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #ffb74d; }
  .sync-label.synced .sync-dot { background: var(--ok); }
  .badge.friends { color: #d9f8ff; background: rgba(86,223,255,.14); }
  html[data-theme="light"] .badge.friends { color: #06627b; background: rgba(36,186,220,.13); }
  .friend-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,.62);
    backdrop-filter: blur(9px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #friendModalOverlay,
  #recoveryModalOverlay,
  #avatarModalOverlay,
  #createGroupModalOverlay { z-index: 180; }
  .friend-modal-overlay[hidden] { display: none; }
  .friend-modal {
    width: min(430px, 100%);
    box-sizing: border-box;
    padding: 20px;
    border: 1px solid rgba(255,54,93,.45);
    border-radius: var(--r-card);
    background: var(--surface-2);
    box-shadow: 0 28px 80px rgba(0,0,0,.52);
  }
  html[data-theme="light"] .friend-modal { background: rgba(255,255,255,.98); }
  .friend-modal h2 { margin: 5px 0 7px; font-size: 22px; }
  .friend-modal p { margin: 0; color: var(--muted); line-height: 1.45; }
  #importModalOverlay,
  #exportModalOverlay { z-index: 140; }
  .code-field textarea {
    min-height: 132px;
    font-size: 16px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    touch-action: manipulation;
    user-select: text;
    -webkit-user-select: text;
  }
  .clipboard-paste-button { width: 100%; margin-bottom: 10px; }
  .friend-toast {
    position: fixed;
    left: 50%;
    bottom: calc(92px + var(--safe-bottom));
    z-index: 120;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    color: var(--text);
    background: var(--surface-2);
    box-shadow: 0 16px 40px rgba(0,0,0,.35);
    font-size: 13px;
    font-weight: 900;
  }
  .friend-toast[hidden] { display: none; }
  @media (max-width: 430px) {
    .friend-modal-overlay {
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding: max(10px, env(safe-area-inset-top, 0px)) 10px max(12px, env(safe-area-inset-bottom, 0px));
    }
    .friend-modal {
      margin: auto 0;
      max-height: calc(100vh - 24px);
      max-height: calc(100dvh - 24px);
      overflow-y: auto;
    }
    .friend-summary { gap: 6px; }
    .friend-stat { padding: 9px 4px; }
  }

  .push-options { display: grid; gap: 10px; margin: 16px 0; }
  .push-option {
    display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 14px;
    border: 1px solid var(--line); border-radius: var(--r-ctrl); background: rgba(255,255,255,.035);
    color: var(--text); font-weight: 900; cursor: pointer;
  }
  .push-option input { width: 21px; height: 21px; accent-color: var(--accent); }
  .push-help { margin: 12px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
  .push-state { padding: 12px 14px; border-radius: var(--r-ctrl); background: rgba(65,245,168,.10); color: var(--text); }
  .push-state.off { background: rgba(255,255,255,.05); color: var(--muted); }

  /* v22: klare Bereiche, kontextuelles Jetzt und eigener Profil-Reiter */
  .layout-strip .pill { min-width: 0; }
  .program-now-entry {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 0 0 13px;
    padding: 15px 16px;
    border: 1px solid rgba(86,223,255,.32);
    border-radius: var(--r-ctrl);
    color: var(--text);
    background: linear-gradient(120deg, rgba(86,223,255,.13), rgba(255,54,93,.09)), var(--surface);
    box-shadow: 0 12px 30px rgba(0,0,0,.16);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .program-now-entry strong { display: block; margin-top: 3px; font-size: 17px; line-height: 1.2; }
  .program-now-entry small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.35; }
  .program-now-entry .now-arrow {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--r-ctrl);
    color: #fff;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    font-size: 20px;
    font-weight: 1000;
  }
  .profile-shell { display: grid; gap: 13px; }
  .profile-hero,
  .profile-card {
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--surface);
    box-shadow: 0 14px 34px rgba(0,0,0,.15);
  }
  .profile-hero {
    padding: var(--sp-4);
    background: var(--surface);
  }
  .profile-identity { display: flex; align-items: center; gap: 13px; }
  .profile-avatar {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: var(--r-ctrl);
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #8e4dff);
    font-size: 22px;
    font-weight: 1000;
    box-shadow: 0 9px 24px rgba(255,54,93,.22);
  }
  .profile-identity h2 { margin: 2px 0 4px; font-size: 23px; overflow-wrap: anywhere; }
  .profile-identity p { margin: 0; color: var(--muted); font-size: 12px; }
  .profile-card { overflow: hidden; }
  .profile-card-title {
    padding: 13px 15px 9px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: 1.3px;
    text-transform: uppercase;
  }
  .profile-action {
    width: 100%;
    min-height: 61px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 10px 15px;
    border: 0;
    border-top: 1px solid var(--line);
    color: var(--text);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .profile-action:first-of-type { border-top: 0; }
  .profile-action-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: var(--r-ctrl);
    color: var(--text);
    background: rgba(255,255,255,.07);
    font-size: 17px;
  }
  .profile-action strong { display: block; line-height: 1.2; }
  .profile-action small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
  .profile-action-arrow { color: var(--muted); font-size: 18px; }
  .profile-action.danger { color: #ff809b; }
  .profile-action.danger .profile-action-icon { color: #ff809b; background: rgba(255,54,93,.10); }
  .profile-note { padding: 3px 4px 0; color: var(--muted); font-size: 11px; line-height: 1.45; text-align: center; }
  html[data-theme="light"] .profile-action-icon { background: rgba(20,24,38,.06); }
  html[data-theme="light"] .program-now-entry { background: linear-gradient(120deg, rgba(86,223,255,.12), rgba(255,54,93,.06)), rgba(255,255,255,.92); }

  @media (max-width: 430px) {
    .layout-strip .pill { padding-inline: 8px; font-size: 10px; }
  }

  /* v23: mobile Feinarbeit, Dynamic Island, fixe Timeline-Bühnen und Avatare */
  .layout-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
  .layout-strip .pill {
    width: 100%;
    height: 44px;
    min-height: 44px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .friend-common-act .friend-act-add { grid-column: 3; justify-self: center; }
  .timeline-scroll {
    position: relative;
    isolation: isolate;
  }
  .timeline-axis-spacer,
  .timeline-stage-label {
    position: sticky;
    left: 0;
  }
  .timeline-axis-spacer {
    z-index: 8;
    border-radius: var(--r-ctrl);
    background: var(--bg-2);
  }
  .timeline-stage-label {
    z-index: 7;
    background: var(--bg-2);
    box-shadow: 9px 0 14px rgba(7,8,13,.88);
  }
  html[data-theme="light"] .timeline-stage-label {
    box-shadow: 9px 0 14px rgba(246,242,247,.92);
  }
  .profile-avatar-button {
    position: relative;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: var(--r-ctrl);
    background: transparent;
    cursor: pointer;
  }
  .profile-avatar-button .profile-avatar { width: 100%; height: 100%; }
  .avatar-edit-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    border: 2px solid var(--surface-2);
    border-radius: 50%;
    color: #fff;
    background: var(--accent);
    font-size: 11px;
    line-height: 1;
  }
  .profile-avatar.has-image,
  .friend-avatar.has-image,
  .avatar-preview-image {
    display: block;
    object-fit: cover;
    overflow: hidden;
  }
  .profile-compact-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 11px;
  }
  .profile-compact-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 25px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--muted);
    background: rgba(255,255,255,.04);
    font-size: var(--t-micro);
    font-weight: 950;
    letter-spacing: .55px;
    text-transform: uppercase;
  }
  .profile-compact-stat b { color: var(--text); font-size: 10px; }
  .avatar-preview {
    width: 112px;
    height: 112px;
    margin: 16px auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #8e4dff);
    box-shadow: 0 12px 30px rgba(0,0,0,.26);
    font-size: 42px;
    font-weight: 1000;
    overflow: hidden;
  }
  .avatar-preview-image { width: 100%; height: 100%; }
  .avatar-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
  .avatar-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  @media (max-width: 600px) {
    .next-banner {
      width: 100%;
      box-sizing: border-box;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      padding: 8px 9px 8px 12px;
      border-radius: var(--r-pill);
      background: rgba(19,21,31,.94);
      box-shadow: 0 8px 22px rgba(0,0,0,.24);
    }
    .next-banner > div:first-child { min-width: 0; }
    .next-label { font-size: var(--t-micro); letter-spacing: 1.15px; }
    .next-title {
      margin-top: 1px;
      overflow: hidden;
      font-size: 12px;
      line-height: 1.15;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .next-meta {
      margin-top: 2px;
      overflow: hidden;
      font-size: var(--t-micro);
      line-height: 1.15;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .countdown-pill {
      width: auto;
      min-width: 58px;
      padding: 7px 8px;
      border-radius: var(--r-pill);
      font-size: 11px;
      box-shadow: none;
    }
    .countdown-pill small { margin-top: 1px; font-size: var(--t-micro); letter-spacing: .35px; }
    .profile-hero { padding: 14px; }
    .profile-identity { gap: 11px; }
    .profile-avatar-button { width: 46px; height: 46px; border-radius: var(--r-ctrl); }
    .profile-avatar { border-radius: var(--r-ctrl); font-size: 19px; }
    .profile-identity h2 { font-size: 19px; }
    .profile-identity p { font-size: 10px; }
  }

  /* Sitzt jetzt im Textfluss der Kopfzeile statt absolut über dem Coverbild */
  .chat-launcher {
    position: relative;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: var(--surface);
    color: var(--text);
    touch-action: manipulation;
  }
  .chat-launcher[hidden] { display: none; }
  .chat-launcher svg { width: 21px; height: 21px; fill: currentColor; }
  .chat-launcher:active { transform: scale(.96); }
  .chat-unread {
    position: absolute;
    top: -6px;
    right: -6px;
    display: grid;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    place-items: center;
    border: 2px solid var(--bg-2);
    border-radius: var(--r-pill);
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
  }
  .chat-overlay {
    position: fixed;
    top: var(--chat-viewport-top, 0px);
    right: 0;
    bottom: auto;
    left: 0;
    height: var(--chat-viewport-height, 100dvh);
    z-index: 145;
    display: grid;
    place-items: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
    background: rgba(0,0,0,.68);
    backdrop-filter: blur(12px);
  }
  .chat-sheet {
    display: grid;
    grid-template-rows: auto auto minmax(0,1fr) auto;
    width: min(520px, 100%);
    height: min(820px, calc(100% - 24px));
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-card);
    background: rgba(13,15,23,.985);
    box-shadow: 0 28px 90px rgba(0,0,0,.55);
  }
  .chat-head {
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px 13px;
    border-bottom: 1px solid var(--line);
  }
  .chat-head-title { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
  .chat-head h2 { margin: 0; font-size: 19px; }
  .chat-admin-badge,
  .chat-message-admin {
    display: inline-flex;
    align-items: center;
    min-height: 17px;
    padding: 0 6px;
    border: 1px solid rgba(86,223,255,.36);
    border-radius: var(--r-pill);
    background: rgba(86,223,255,.12);
    color: #8cecff;
    font-size: var(--t-micro);
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .chat-admin-badge[hidden] { display: none; }
  .chat-channel-tabs {
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.018);
  }
  .chat-channel-tabs[hidden] { display: none; }
  .chat-channel-tab {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: var(--surface-soft);
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    font-weight: 950;
  }
  .chat-channel-tab.active {
    border-color: var(--line-strong);
    background: rgba(255,255,255,.12);
    color: var(--text);
  }
  .chat-group-label { margin-left: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
  .chat-close {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: rgba(255,255,255,.05);
    color: var(--text);
    font-size: 22px;
  }
  .chat-messages {
    grid-row: 3;
    display: flex;
    flex-direction: column;
    gap: 9px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px;
  }
  .chat-empty {
    display: grid;
    flex: 1;
    min-height: 220px;
    place-items: center;
    padding: 28px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
  }
  .chat-message {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    max-width: 88%;
  }
  .chat-message.own { align-self: flex-end; flex-direction: row-reverse; }
  .chat-message .profile-avatar {
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    border-radius: var(--r-ctrl);
    font-size: 11px;
  }
  .chat-bubble {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl) var(--r-ctrl) var(--r-ctrl) 4px;
    background: var(--surface-3);
  }
  .chat-message.own .chat-bubble {
    border-color: var(--accent);
    border-radius: var(--r-ctrl) var(--r-ctrl) 4px var(--r-ctrl);
    background: var(--accent);
    color: #fff;
  }
  .chat-message.own .chat-copy { color: #fff; }
  .chat-message.own .chat-meta time { color: rgba(255,255,255,.75); }
  .chat-message.own .chat-meta-person b { color: #fff; }
  .chat-message.own .chat-likes { border-color: rgba(255,255,255,.4); color: #fff; }
  .chat-message.own .chat-likes.liked { border-color: #fff; color: #fff; }
  .chat-message.faqbot .profile-avatar {
    border-color: rgba(86,223,255,.52);
    background: linear-gradient(135deg, #56dfff, #8e4dff);
    color: #07131d;
  }
  .chat-message.faqbot .chat-bubble {
    border-color: rgba(86,223,255,.38);
    background: color-mix(in srgb, #56dfff 10%, var(--surface));
  }
  .chat-faq-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 8px;
    padding: 10px 11px;
    border: 1px solid rgba(86,223,255,.30);
    border-radius: var(--r-ctrl);
    background: rgba(86,223,255,.08);
    color: var(--muted);
    font-size: var(--t-micro);
    line-height: 1.4;
  }
  .chat-faq-hint[hidden] { display: none; }
  .chat-faq-hint strong { color: #8cecff; }
  .chat-likes {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 19px;
    margin-top: 5px;
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: rgba(255,255,255,.025);
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
  }
  .chat-likes.liked { border-color: rgba(255,84,119,.5); color: #ff9ab0; }
  .chat-likes:focus-visible { outline: 2px solid #8cecff; outline-offset: 2px; }
  .chat-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 3px;
  }
  .chat-meta-person,
  .chat-meta-actions { display: flex; min-width: 0; align-items: center; gap: 5px; }
  .chat-meta-person b { overflow: hidden; font-size: var(--t-micro); text-overflow: ellipsis; white-space: nowrap; }
  .chat-meta time { flex: 0 0 auto; color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 10px; }
  .chat-moderate-button {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: rgba(255,255,255,.055);
    color: var(--muted);
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
  }
  .chat-moderate-button:active { border-color: rgba(86,223,255,.5); color: var(--text); }
  .chat-muted-label { color: #ff9ab0; font-size: 10px; font-weight: 700; }
  .chat-copy { color: var(--text); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
  .chat-compose {
    grid-row: 4;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: rgba(9,10,16,.96);
  }
  .chat-compose-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 8px; align-items: end; }
  .chat-attach {
    display: grid;
    width: 44px;
    min-height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: rgba(255,255,255,.055);
    color: #8cecff;
    cursor: pointer;
    font-size: 21px;
    font-weight: 700;
  }
  .chat-attach:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(86,223,255,.12); }
  .chat-attach.disabled { opacity: .5; pointer-events: none; }
  .chat-attach input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
  .chat-image-preview {
    position: relative;
    width: fit-content;
    max-width: min(220px, 72%);
    margin: 0 0 8px 51px;
  }
  .chat-image-preview[hidden] { display: none; }
  .chat-image-preview img { display: block; max-width: 100%; max-height: 150px; border: 1px solid var(--line-strong); border-radius: var(--r-ctrl); object-fit: cover; }
  .chat-image-preview button { position: absolute; top: -7px; right: -7px; width: 25px; height: 25px; border: 2px solid #11131d; border-radius: 50%; background: var(--accent); color: #fff; font-size: 15px; }
  .chat-message-image { display: block; max-width: min(320px, 68vw); margin-top: 6px; overflow: hidden; border-radius: var(--r-ctrl); }
  .chat-message-image img { display: block; width: 100%; max-height: 360px; object-fit: cover; background: rgba(255,255,255,.04); }
  .chat-input {
    width: 100%;
    min-height: 44px;
    max-height: 112px;
    padding: 11px 12px;
    resize: none;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: rgba(255,255,255,.055);
    color: var(--text);
    font: inherit;
    /* Mindestens 16 px verhindert den automatischen Fokus-Zoom von iOS Safari. */
    font-size: 16px;
    line-height: 1.35;
    outline: none;
  }
  .chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,54,93,.13); }
  .chat-send {
    min-width: 70px;
    min-height: 44px;
    padding: 0 13px;
    border: 0;
    border-radius: var(--r-ctrl);
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 950;
  }
  .chat-send:disabled { opacity: .55; }
  .chat-error { margin: 7px 2px 0; color: #ff9ab0; font-size: 10px; }
  .chat-restriction { margin: 8px 2px 0; color: #ffbfca; font-size: 10px; line-height: 1.35; }
  .chat-restriction[hidden] { display: none; }
  .chat-moderation-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(0,0,0,.66);
  }
  .chat-moderation-sheet {
    width: min(440px, 100%);
    padding: 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-card);
    background: rgba(16,18,27,.99);
    box-shadow: 0 24px 70px rgba(0,0,0,.55);
  }
  .chat-moderation-sheet h3 { margin: 4px 0 6px; font-size: 18px; }
  .chat-moderation-sheet p { margin: 0 0 15px; color: var(--muted); font-size: 11px; line-height: 1.45; }
  .chat-moderation-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .chat-moderation-actions button {
    min-height: 42px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: var(--surface-soft);
    color: var(--text);
    font: inherit;
    font-size: 10px;
    font-weight: 900;
  }
  .chat-moderation-actions .danger { border-color: rgba(255,54,93,.35); color: #ff9ab0; }
  .chat-moderation-actions .wide { grid-column: 1 / -1; }
  .chat-moderation-actions button:disabled { opacity: .48; }
  .chat-moderation-actions button[hidden] { display: none; }
  .chat-launcher[hidden],
  .chat-unread[hidden],
  .chat-overlay[hidden],
  .chat-moderation-overlay[hidden],
  .chat-error[hidden] { display: none; }
  html[data-theme="light"] .chat-launcher { border-color: rgba(40,20,30,.14); background: rgba(255,255,255,.84); color: #211821; }
  html[data-theme="light"] .chat-sheet { background: rgba(248,245,247,.99); }
  html[data-theme="light"] .chat-compose { background: rgba(244,240,243,.97); }
  html[data-theme="light"] .chat-moderation-sheet { background: rgba(248,245,247,.995); }
  html[data-theme="light"] .chat-bubble,
  html[data-theme="light"] .chat-input { background: rgba(255,255,255,.78); }
  @media (max-width: 600px) {
    .chat-overlay { align-items: end; padding: max(8px, env(safe-area-inset-top, 0px)) 0 0; }
    .chat-sheet { width: 100%; height: min(90%, 820px); border-right: 0; border-bottom: 0; border-left: 0; border-radius: var(--r-card) var(--r-card) 0 0; }
    .chat-moderation-overlay { padding: 0; }
    .chat-moderation-sheet { width: 100%; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-bottom: 0; border-left: 0; border-radius: var(--r-card) var(--r-card) 0 0; }
  }

  /* v31: ruhigere Act-Hierarchie, kompakte Freunde-Aktionen, Chat-Status und Calendar-Zoom
     (die Act-Karten-Overrides dieser Schicht sind in die Stage-Spectrum-Basis aufgegangen) */
  /* Volle Kartenbreite: in der Mittelspalte blieben neben den Avataren nur ~70px
     für die Namen — sichtbar war dann nur "Alexandra," mit Komma abgeschnitten. */
  .act-friends-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
    margin-top: var(--sp-2);
    padding: 2px var(--sp-3) 3px var(--sp-1);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    color: var(--muted);
  }
  .act-friends-row::-webkit-scrollbar { display: none; }
  .act-friends-row.is-scrollable {
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 10px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 10px), transparent 100%);
  }
  .act-friends-row:focus-visible { outline: 2px solid #56dfff; outline-offset: 1px; border-radius: var(--r-ctrl); }
  .act-friend-avatars {
    display: flex;
    flex: 0 0 auto;
    padding-left: 3px;
  }
  .act-friend-avatar-item {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    scroll-snap-align: start;
  }
  .act-friend-avatar-item + .act-friend-avatar-item { margin-left: -4px; }
  .act-friend-avatar {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid var(--surface);
    border-radius: 50%;
    object-fit: cover;
    color: #fff;
    background: linear-gradient(135deg, #56dfff, #8e4dff);
    font-size: var(--t-micro);
    font-weight: 950;
  }
  .act-friends-names {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: var(--t-micro);
    font-weight: 700;
    line-height: var(--lh-micro);
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .friend-common-act {
    grid-template-columns: 48px minmax(0, 1fr) 44px;
    gap: 7px;
    min-height: 44px;
    padding: 6px 7px;
  }
  .friend-common-act > span { min-width: 0; line-height: 1.25; }
  .friend-common-act > span > b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .friend-common-act > span > small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: var(--t-micro); text-overflow: ellipsis; white-space: nowrap; }
  .friend-act-add {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--accent);
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
  }
  .group-plan-act { grid-template-columns: 52px minmax(0, 1fr) 30px; align-items: center; }
  .group-plan-act.you-too { grid-template-columns: 52px minmax(0, 1fr) 30px; }

  .reminder-status {
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: var(--r-pill);
    font-size: 11px;
  }
  .reminder-status strong { margin: 0; white-space: nowrap; }
  .reminder-status.off { opacity: .72; }
  .reminder-status-icon { display: grid; width: 20px; height: 20px; place-items: center; font-size: 14px; }

  .chat-head-main { min-width: 0; flex: 1; }
  .chat-presence {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-top: 7px;
  }
  .chat-presence-avatars { display: flex; flex: 0 0 auto; padding-left: 4px; }
  .chat-presence-avatar {
    position: relative;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    margin-left: -5px;
    overflow: hidden;
    border: 2px solid rgba(13,15,23,.985);
    border-radius: 50%;
    object-fit: cover;
    color: #fff;
    background: linear-gradient(135deg, #56dfff, #8e4dff);
    font-size: var(--t-micro);
    font-weight: 950;
  }
  .chat-presence-copy { min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--t-micro); text-overflow: ellipsis; white-space: nowrap; }
  .chat-presence-copy.active { color: var(--ok); }
  .chat-receipt {
    margin: 3px 5px 0;
    color: var(--muted-2);
    font-size: var(--t-micro);
    text-align: right;
  }
  .chat-message > div:last-child { min-width: 0; }
  .chat-receipt.read { color: #8eeec0; }
  html[data-theme="light"] .chat-presence-avatar { border-color: rgba(248,245,247,.99); }
  html[data-theme="light"] .chat-receipt.read { color: #168258; }

  .timeline-zoom-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 8px;
    padding: 7px 8px 7px 11px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: rgba(255,255,255,.025);
  }
  .timeline-zoom-copy { min-width: 0; color: var(--muted); font-size: var(--t-micro); line-height: 1.25; }
  .timeline-zoom-copy b { display: block; color: var(--text); font-size: var(--t-micro); }
  .timeline-zoom-controls { display: flex; align-items: center; gap: 5px; }
  .timeline-zoom-controls button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--r-ctrl);
    background: rgba(255,255,255,.055);
    color: var(--text);
    font-size: 18px;
    line-height: 1;
  }
  .timeline-zoom-value { min-width: 39px; color: var(--muted); font-size: var(--t-micro); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
  .timeline-scroll {
    --timeline-width: 1040px;
    --timeline-row-height: 64px;
    touch-action: pan-x pan-y;
  }
  .timeline-inner { min-width: var(--timeline-width); width: max(var(--timeline-width), 100%); }
  .timeline-track { min-height: var(--timeline-row-height); transition: min-height .16s ease; }
  .timeline-detail {
    display: none;
    margin-top: 4px;
    overflow: hidden;
    font-size: var(--t-micro);
    font-weight: 850;
    line-height: 1.15;
    opacity: .72;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .timeline-scroll.timeline-expanded .timeline-detail { display: block; }
  .timeline-nowline { width: 3px; box-shadow: 0 0 12px color-mix(in srgb, var(--ok) 55%, transparent); z-index: 4; }
  .timeline-nowline::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    width: 9px;
    height: 9px;
    transform: translateX(-50%);
    border: 2px solid rgba(255,255,255,.9);
    border-radius: 50%;
    background: var(--ok);
  }
  .timeline-axis-nowline { top: 14px; bottom: -9px; }
  .timeline-axis-nowline::after {
    content: attr(data-now-label);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 5px;
    border-radius: var(--r-pill);
    background: var(--ok);
    color: #04110b;
    font-size: var(--t-micro);
    font-weight: 1000;
    letter-spacing: .25px;
    white-space: nowrap;
  }
  @media (max-width: 460px) {
    .timeline-scroll { --timeline-width: 920px; }
    .timeline-zoom-copy span { display: none; }
  }

  /* v32: nur die Tageswahl bleibt beim Scrollen stehen; kompakter Freunde-Kopf */
  .day-tabs-anchor {
    height: 1px;
    margin-bottom: -1px;
    pointer-events: none;
  }
  .day-tabs-dock {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 32;
    background: var(--bg);
    border-top: 0;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
  }
  .day-tabs-dock.is-stuck {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--e-2);
    -webkit-backdrop-filter: blur(18px) saturate(1.18);
    backdrop-filter: blur(18px) saturate(1.18);
  }
  .day-tabs-dock .day-tab { transition: min-height .18s ease, padding .18s ease, transform .12s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
  .day-tabs-dock.is-stuck .day-tabs { padding-top: var(--sp-1); }
  .sticky.timetable-controls {
    position: relative;
    top: auto;
    z-index: 18;
    border-top: 0;
  }
  body[data-view="friends"] .day-tabs-anchor,
  body[data-view="friends"] .day-tabs-dock,
  body[data-view="profile"] .day-tabs-anchor,
  body[data-view="profile"] .day-tabs-dock { display: none; }

  /* (Light-Overrides des Docks entfallen: Fläche läuft über --bg.) */

  .friend-hero { padding: 14px 15px; }
  .friend-hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }
  .friend-hero-title { min-width: 0; }
  .friend-hero h2 { margin: 3px 0 0; font-size: 20px; line-height: 1.12; }
  .friend-hero-copy { margin-top: 5px !important; font-size: 11px; }
  .friend-hero-refresh {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    font-size: 19px;
    line-height: 1;
  }
  .friend-hero .sync-label { margin-top: 7px; font-size: 10px; }
  .friend-hero .friend-summary {
    display: flex;
    gap: 6px;
    margin: 10px 0 0;
  }
  .friend-hero .friend-stat {
    min-width: 0;
    flex: 1 1 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    padding: 7px 6px;
    border-radius: var(--r-ctrl);
  }
  .friend-hero .friend-stat b { display: inline; font-size: 15px; line-height: 1; }
  .friend-hero .friend-stat span { overflow: hidden; font-size: var(--t-micro); letter-spacing: .35px; text-overflow: ellipsis; white-space: nowrap; }

  @media (max-width: 600px) {
    .friend-shell { gap: 10px; }
    .friend-hero {
      padding: 11px 12px;
      border-radius: var(--r-ctrl);
      background: var(--surface);
      box-shadow: 0 8px 22px rgba(0,0,0,.12);
    }
    .friend-hero .friend-kicker { font-size: var(--t-micro); letter-spacing: 1.05px; }
    .friend-hero h2 { margin-top: 2px; font-size: 17px; }
    .friend-hero-copy { margin-top: 3px !important; font-size: var(--t-micro); line-height: 1.25 !important; }
    .friend-hero-refresh { flex-basis: 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; font-size: 17px; }
    .friend-hero .sync-label {
      max-width: 100%;
      margin-top: 5px;
      overflow: hidden;
      font-size: var(--t-micro);
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .friend-hero .friend-summary { margin-top: 7px; }
    .friend-hero .friend-stat { padding: 6px 4px; border-radius: var(--r-ctrl); }
    .friend-hero .friend-stat b { font-size: 13px; }
    .friend-hero .friend-stat span { font-size: var(--t-micro); letter-spacing: .2px; }
  }

  /* v33: der nächste Favorit sitzt als ruhige Dynamic Island direkt im Hero */
  /* Jetzt-Insel: steht jetzt im Fluss unter der Kopfzeile statt absolut über dem
     Coverbild. Ruhige Ink-Fläche, Bühnenfarbe nur als 3px-Kante — wie die Act-Karte. */
  .hero-next-slot { margin-top: var(--sp-3); }
  .hero-next-slot:empty { display: none; }
  .hero-next-island {
    position: relative;
    width: 100%;
    min-height: 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-4);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    color: var(--text);
    background: var(--surface);
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .12s ease;
  }
  .hero-next-island::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--stage-color, var(--accent));
  }
  .hero-next-island:active { transform: scale(.988); }
  .hero-next-copy { min-width: 0; }
  .hero-next-label {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    overflow: hidden;
    color: var(--muted-2);
    font-size: var(--t-micro);
    font-weight: 700;
    letter-spacing: .16em;
    line-height: var(--lh-micro);
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .hero-next-dot {
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--stage-color, var(--accent));
  }
  .hero-next-name {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: var(--text);
    font-size: var(--t-body);
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: var(--lh-body);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .hero-next-meta {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: var(--t-micro);
    font-weight: 500;
    line-height: var(--lh-micro);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .hero-next-time {
    min-width: 58px;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--ok);
    background: none;
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--t-label);
    font-weight: 700;
    line-height: var(--lh-label);
    text-align: right;
    white-space: nowrap;
  }
  .hero-next-time small {
    display: block;
    margin-top: 1px;
    color: var(--muted-2);
    font-family: var(--sans, inherit);
    font-size: var(--t-micro);
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .hero-next-island.is-actionable .hero-next-dot {
    background: var(--stage-color, var(--accent));
  }
  .hero-next-island.is-actionable {
    border-color: color-mix(in srgb, var(--stage-color, var(--accent)) 40%, var(--line));
  }
  .hero-next-island.is-live .hero-next-dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 16%, transparent); }
  /* (Light-Override der Insel entfällt: Fläche und Text laufen über Tokens.) */
  /* (Die Light-Overrides der Insel entfallen: Fläche und Text laufen jetzt über
     Tokens, die in beiden Themes definiert sind.) */

  /* (Der 600px-Block, der die Insel auf 5–8px-Schriften schrumpfte, ist entfallen:
     die Insel liegt jetzt im Fluss und hat die volle Breite zur Verfügung.) */

  @media (prefers-reduced-motion: reduce) {
    .hero-next-island { transition: none; }
  }
