/* Die eine Seitenleiste (js/leiste.js), auf allen Seiten gleich. Ruhig und grau (Spezifikation 2026-11-30,
   Teilprojekt 1): Flaeche --surface-2, keine Kacheln, keine Verlaeufe; Bereichsfarbe nur als 8-px-Punkt der Gewerke.
   Alle Regeln, die Leisten-Klassen nennen, stehen hier - nicht in Seiten oder planer.css. */
html.hat-leiste body { min-height: 100vh }
.leiste-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh }
.leiste-shell > main { min-width: 0 }
.leiste { position: sticky; top: 0; height: 100vh; z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 14px 12px 12px; border-right: 1px solid var(--line); background: var(--surface-2); overflow-y: auto; overscroll-behavior: contain }
.leiste > * { flex: none }
.leiste .icon { width: 18px; height: 18px; flex: none; color: var(--text-3) }

/* Marke: Logo 28 px, Name 15/700, keine Unterzeile */
.leiste-marke { display: flex; gap: 10px; align-items: center; padding: 4px 8px; color: var(--text); text-decoration: none; border-radius: var(--radius-sm); font: 700 15px/1.2 var(--font); letter-spacing: -.01em }
.leiste-marke:hover { background: var(--hover) }
.leiste-marke img { width: 28px; height: 28px; border-radius: 50% }

/* Suche: ein Eintrag wie die anderen, mit Kuerzel rechts */
.leiste-suche { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; margin: 0; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: none; color: var(--text-2); font: 500 14px var(--font); text-align: left; cursor: pointer; transition: background var(--dur), color var(--dur) }
.leiste-suche:hover { background: var(--hover); color: var(--text) }
.leiste-suche kbd { margin-left: auto; color: var(--text-3); font: 600 11px/1 var(--font) }
@media (hover: none) { .leiste-suche kbd { display: none } }

/* Eintraege: 14/500, --text-2, 32 px hoch */
.leiste-block, .leiste-kinder { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px }
.leiste-block a, .leiste-block summary { position: relative; display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 8px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font: 500 14px/1.3 var(--font); cursor: pointer; transition: background var(--dur), color var(--dur) }
.leiste-block a > span:not(.leiste-punkt), .leiste-block summary > span:not(.leiste-punkt) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.leiste-block summary { list-style: none }
.leiste-block summary::-webkit-details-marker { display: none }
.leiste-block a:hover, .leiste-block summary:hover { background: var(--hover); color: var(--text) }
.leiste-block a:hover .icon, .leiste-block summary:hover .icon { color: var(--text-2) }
/* Aktiv: Text --text, Flaeche --press, links ein 2-px-Strich in --accent-hi */
.leiste-block a[aria-current="page"] { color: var(--text); background: var(--press) }
.leiste-block a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--accent-hi) }
.leiste-block a[aria-current="page"] .icon { color: var(--text-2) }
/* Name nimmt den Platz (flex: 1), Zaehler und Pfeil stehen rechts am Zeilenende, der Pfeil zuletzt */
.leiste-block .pf { width: 15px; height: 15px; transition: transform var(--dur) var(--ease) }
.leiste-grp[open] > summary { color: var(--text) }
.leiste-grp[open] > summary .pf { transform: rotate(90deg) }
/* Gewerk: Punkt in der Bereichsfarbe statt Icon (in der Breite eines Icons) */
.leiste-punkt { flex: none; width: 8px; height: 8px; margin: 0 5px; border-radius: 50%; background: var(--area) }
/* Gruppenueberschriften: 11/700, Grossbuchstaben, --text-3 */
.leiste-h { margin: 12px 8px 4px; color: var(--text-3); font: 700 11px/1.2 var(--font); text-transform: uppercase; letter-spacing: .07em }
/* Unterpunkte: 13.5 px, eingerueckt mit Linie */
.leiste-kinder { margin: 2px 0 6px 17px; padding-left: 8px; border-left: 1px solid var(--line) }
.leiste-kinder a { min-height: 30px; font-size: 13.5px }
/* Zaehler: .count aus base.css, grau; rot nur wenn dringend */
.leiste .count, .tabbar .count { margin-left: auto; background: var(--press); color: var(--text-2) }
.leiste .count[hidden], .tabbar .count[hidden] { display: none }
.leiste .count.dringend, .tabbar .count.dringend { background: var(--danger-fill); color: #fff }

/* Konto-Karte, unten angeheftet */
.leiste-konto { position: relative; margin-top: auto }
.leiste-ich { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-md); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background var(--dur) }
.leiste-ich:hover, .leiste-ich[aria-expanded="true"] { background: var(--hover) }
.leiste-ich > span:nth-child(2), .leiste-popich > span:nth-child(2) { min-width: 0 }
.leiste-ich b, .leiste-popich b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.leiste-ich small, .leiste-popich small { display: block; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.leiste-ich .chev { margin-left: auto; width: 16px; height: 16px; transform: rotate(180deg); transition: transform var(--dur) }
.leiste-ich[aria-expanded="true"] .chev { transform: none }
.leiste-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--press); color: var(--text); font: 700 13px var(--font) }
.leiste-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 30; max-height: min(70vh, 540px); overflow-y: auto; display: grid; gap: 1px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); box-shadow: var(--shadow-pop) }
.leiste-pop[hidden] { display: none }
.leiste-pop .btn { justify-content: flex-start; width: 100%; background: none; border-color: transparent; color: var(--text-2); padding: 7px 10px; font-size: 13.5px; font-weight: 500 }
.leiste-pop .btn:hover { background: var(--hover); color: var(--text); border-color: transparent }
.leiste-pop .btn:hover .icon { color: inherit }
.leiste-pop hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 2px; width: auto }
.leiste-popich { display: flex; gap: 10px; align-items: center; padding: 6px 8px 8px; min-width: 0 }
.leiste-poph { margin: 4px 10px; color: var(--text-3); font: 700 11px var(--font); text-transform: uppercase; letter-spacing: .07em }
.leiste-pop [data-aussehen] { margin: 0 6px 4px }

/* Geruest beim allerersten Besuch: graue Balken statt der Punkte */
.leiste-warte { display: grid; gap: 10px; padding: 4px 8px }
.leiste-warte i { display: block; height: 18px; border-radius: 6px; background: var(--hover) }
@media (prefers-reduced-motion: no-preference) { .leiste-warte i { animation: leistePuls 1.2s ease-in-out infinite } }
@keyframes leistePuls { 0%, 100% { opacity: .45 } 50% { opacity: .9 } }

/* Handy-Teile: nur unter 900 px */
.mtop, .tabbar { display: none }
@media (max-width: 899px) {
  .leiste-shell { grid-template-columns: minmax(0, 1fr) }
  .leiste { display: none }
  /* "Mehr": die Leiste als Schublade von links */
  .leiste.offen { display: flex; position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100dvh; z-index: 900; box-shadow: 0 0 0 100vmax var(--overlay), var(--shadow-pop); padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)) }
  .leiste-shell > main { padding-bottom: calc(80px + env(safe-area-inset-bottom)) }
  /* Kopfzeile oben: Logo und Name, Glas, klebt */
  .mtop { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; color: inherit; text-decoration: none; font: 700 15px var(--font); letter-spacing: -.01em; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--line) }
  .mtop img { border-radius: 50% }
  /* Tab-Leiste unten: vier Ziele und "Mehr" */
  .tabbar { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 6px max(6px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right)); background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-top: 1px solid var(--line) }
  .tabbar > a, .tabbar > button { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 54px; padding: 4px 2px; border: 0; border-radius: var(--radius-md); background: none; color: var(--text-2); text-decoration: none; font: 600 11.5px var(--font); text-align: center; cursor: pointer; transition: background var(--dur), color var(--dur) }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
  .tabbar [aria-current="page"] { color: var(--accent-hi); background: color-mix(in oklab, var(--accent) 14%, transparent) }
  .tabbar .icon { width: 22px; height: 22px }
  /* Zahl am Reiter: klein oben rechts ueber dem Symbol */
  .tabbar .count { position: absolute; top: 3px; right: calc(50% - 22px); margin: 0; min-width: 17px; height: 17px; padding: 0 5px; font-size: 10.5px; box-shadow: 0 0 0 2px var(--ring-bg) }
}

/* Im Show-Modus und im eingebetteten FOH-Fenster ist der Bildschirm fuer die Show da */
html:has(#show:not([hidden])) .leiste, html:has(#show:not([hidden])) .tabbar, html:has(#show:not([hidden])) .mtop { display: none }
html.einbett .leiste, html.einbett .tabbar, html.einbett .mtop { display: none !important }
html.einbett .leiste-shell { display: block !important }
@media print { .leiste, .tabbar, .mtop, .nur-ansehen { display: none !important } .leiste-shell { display: block } }

/* "Nur ansehen": getoenter Hinweis wie .callout (setzt seitenleiste.js) */
.nur-ansehen { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid color-mix(in oklab, var(--warn) 30%, transparent); border-radius: var(--radius-md); background: color-mix(in oklab, var(--warn) 9%, transparent); color: var(--text); font-size: 13.5px }
.nur-ansehen svg.icon { width: 18px; height: 18px; color: var(--warn) }
/* Show-Auswahl, wenn eine Seite eine Show braucht und die Adresse keine hat */
.show-wahl { display: grid; gap: 8px; max-width: 520px; margin: 0 auto; text-align: left }
.show-wahl a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; transition: border-color var(--dur), background var(--dur) }
.show-wahl a:hover { border-color: color-mix(in oklab, var(--accent-hi) 50%, transparent); background: var(--hover) }
.show-wahl a small { font-weight: 400; color: var(--text-2) }
.show-wahl-weg { margin-top: 16px }
