/* Shell: Rahmen, Ansichten, Leisten, Tab-Leiste, Modal, Sheet, Abfrage, Toast, Ziehen zum Aktualisieren. */

#app { position: fixed; inset: 0; height: 100dvh; overflow: hidden; background: var(--grund); isolation: isolate; }
#app.im-uebergang { pointer-events: none; }

.ebene-app, .ebene-anmeldung { position: absolute; inset: 0; overflow: hidden; }
.ebene-app { z-index: 1; transform-origin: 50% 40%; }
.ebene-anmeldung { z-index: 30; background: var(--creme); transform-origin: 50% 45%; }

.stapelbereich { position: absolute; inset: 0; }
.stapel { position: absolute; inset: 0; visibility: hidden; }
.stapel.aktiv { visibility: visible; }

/* Ansicht = ein Screen mit eigener Leiste und eigenem Rollbereich */
.ansicht { position: absolute; inset: 0; background: var(--grund); overflow: hidden; contain: layout paint style; will-change: transform; }
.ansicht.verdeckt { visibility: hidden; }
.ansicht.mit-schatten { box-shadow: -10px 0 28px rgba(20,26,56,.10), -1px 0 0 rgba(20,26,56,.04); }
.ansicht > .abdunkler { position: absolute; inset: 0; z-index: 40; background: rgba(17,22,48,.10); opacity: 0; pointer-events: none; }

.rollbereich { position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; scrollbar-width: none; }
.rollbereich::-webkit-scrollbar { display: none; }
.rollinhalt { position: relative; min-height: 100%; padding-bottom: calc(var(--tab-h) + var(--sab) + 28px); will-change: transform; }
.ansicht[data-kopf="leiste"] > .rollbereich > .rollinhalt { padding-top: calc(var(--sat) + var(--leiste-h)); }
.ansicht.ohne-tabbar > .rollbereich > .rollinhalt { padding-bottom: calc(var(--sab) + 28px); }
.ansicht[data-kopf="ohne"] > .rollbereich > .rollinhalt { padding-bottom: 0; height: 100%; }
/* Tastatur (native.js setzt --tastatur): Rollbereiche bekommen unten Platz, damit fokussierte Felder ins Bild rücken können */
:root { --tastatur: 0px; }
.tastatur-offen .rollbereich { bottom: var(--tastatur); }
.ansicht[data-kopf="ohne"] > .rollbereich { overflow: hidden; }
/* Gestapelter Großtitel-Screen: Zurück-Knopf steht über dem Titel wie bei iOS */
.ansicht.gestapelt[data-kopf="gross"] > .rollbereich > .rollinhalt > * > .kopf:first-child { padding-top: calc(var(--sat) + var(--leiste-h)); }

/* Leiste (Navigationsleiste) */
.leiste { position: absolute; top: 0; left: 0; right: 0; z-index: 30; height: calc(var(--sat) + var(--leiste-h)); padding-top: var(--sat);
  display: flex; align-items: center; pointer-events: none; }
/* Nur echte Knöpfe fangen Tipps. Die leeren Hälften liegen sonst unsichtbar über
   Knöpfen im Großtitel-Kopf (Suche, Profilbild). Sichtbare Leiste schluckt Tipps wie bei iOS. */
.leiste > * { pointer-events: none; }
.leiste-links > *, .leiste-rechts > * { pointer-events: auto; }
.leiste.voll { pointer-events: auto; }
.leiste-hg, .leiste-status-hg { position: absolute; left: 0; right: 0; top: 0; pointer-events: none !important; opacity: 0; transition: opacity .22s linear;
  background: rgba(246,243,238,.82); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.leiste-hg { bottom: 0; box-shadow: 0 .5px 0 rgba(28,36,75,.13); }
.leiste-status-hg { height: var(--sat); }
.leiste.voll .leiste-hg { opacity: 1; }
.leiste.status:not(.voll) .leiste-status-hg { opacity: 1; }
.leiste-links, .leiste-rechts { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; display: flex; align-items: center; height: var(--leiste-h); }
.leiste-links { padding-left: 8px; }
.leiste-rechts { justify-content: flex-end; gap: 2px; padding-right: 10px; }
.leiste-rechts > div { display: flex; align-items: center; gap: inherit; }
.leiste-titel { position: absolute; z-index: 1; left: 50%; bottom: 0; height: var(--leiste-h); max-width: 58%; transform: translateX(-50%);
  display: flex; align-items: center; font: 600 16px/1 var(--schrift); letter-spacing: -.01em; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity .2s linear; pointer-events: none; }
.leiste-titel > span { overflow: hidden; text-overflow: ellipsis; }
.leiste.gross .leiste-titel, .leiste.foto .leiste-titel { opacity: 0; }
.leiste.gross.voll .leiste-titel, .leiste.foto.voll .leiste-titel { opacity: 1; }

.leiste-zurueck { display: flex; align-items: center; height: 44px; min-width: 44px; max-width: 100%; font: 500 16px/1 var(--schrift); color: var(--navy); letter-spacing: -.01em;
  transition: opacity .2s, background-color .25s, box-shadow .25s; }
.leiste-zurueck > span { white-space: nowrap; overflow: hidden; transition: opacity .2s; }
.leiste-zurueck.gedrueckt, .leiste-knopf.gedrueckt, .leiste-fertig.gedrueckt { opacity: .4; }
.leiste-knopf { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--navy); flex: none;
  transition: opacity .2s, background-color .25s, box-shadow .25s, transform .25s var(--ios); }
.leiste-knopf.text { width: auto; padding: 0 8px; border-radius: 10px; font: 600 16px/1 var(--schrift); }
.leiste-fertig { height: 44px; padding: 0 6px; font: 600 16px/1 var(--schrift); color: var(--navy); }

/* Fotokopf: runde Glasknöpfe, bis das Foto weggescrollt ist */
.leiste.foto .leiste-links { padding-left: 16px; }
.leiste.foto .leiste-rechts { padding-right: 16px; gap: 10px; }
.leiste.foto:not(.voll) .leiste-zurueck, .leiste.foto:not(.voll) .leiste-knopf {
  width: 40px; height: 40px; min-width: 40px; border-radius: 50%; justify-content: center; display: grid; place-items: center;
  background: rgba(255,255,255,.78); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 4px 14px rgba(20,26,56,.16); }
.leiste.foto:not(.voll) .leiste-zurueck > span { display: none; }
.leiste.foto:not(.voll) .leiste-zurueck.gedrueckt, .leiste.foto:not(.voll) .leiste-knopf.gedrueckt { opacity: 1; transform: scale(.92); }
.leiste.foto.voll .leiste-links { padding-left: 8px; }
.ansicht[data-kopf="foto"] .held-blatt { min-height: calc(100dvh - 266px); }

/* Ziehen zum Aktualisieren: iOS-Kreisel */
.ptr { position: absolute; left: 50%; z-index: 25; width: 28px; height: 28px; margin-left: -14px; top: calc(var(--sat) + 10px); opacity: 0; pointer-events: none; }
.ansicht[data-kopf="leiste"] > .ptr { top: calc(var(--sat) + var(--leiste-h) + 8px); }
.ptr i { position: absolute; left: 12.5px; top: 2px; width: 3px; height: 7.5px; border-radius: 2px; background: #8E8E93; transform-origin: 1.5px 12px; opacity: 0; transition: opacity .1s; }
.ptr i.sicht { opacity: var(--o, 1); }
.ptr.dreht .ptr-rad { animation: dm-kreisel .8s steps(8) infinite; }
.ptr-rad { position: absolute; inset: 0; }
@keyframes dm-kreisel { to { transform: rotate(360deg); } }

/* Tab-Leiste (wie Design .tabbar) */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tab-h) + var(--sab)); display: flex; padding: 7px 4px 0;
  background: rgba(252,250,245,.80); -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  border-top: 1px solid rgba(28,36,75,.08); transition: transform .45s var(--ios); }
.tabbar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 40px; pointer-events: none; transition: opacity .25s var(--ios);
  background: linear-gradient(rgba(246,243,238,0), rgba(246,243,238,.92) 70%, var(--grund)); margin-bottom: 1px; }
.tabbar.ohne-verlauf::before { opacity: 0; }
.tabbar.versteckt { transform: translateY(calc(100% + 40px)); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #A2A5B3; position: relative; height: 41px; justify-content: flex-start; transition: color .15s; }
.tab .tab-l { font: 500 10.5px/12px var(--schrift); letter-spacing: .01em; }
.tab.aktiv { color: var(--taupe-tief); }
.tab.aktiv .tab-l { font-weight: 600; }
.tab.gedrueckt > .ic { transform: scale(.88); }
.tab > .ic { transition: transform .25s var(--ios); }
.tab.mitte { justify-content: flex-end; }
.mic-knopf { position: absolute; top: -31px; left: 50%; margin-left: -26px; width: 52px; height: 52px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center;
  box-shadow: 0 0 0 4px rgba(252,250,245,.95), 0 10px 22px -6px rgba(28,36,75,.55);
  transition: transform .3s var(--ios), width .35s var(--ios), height .35s var(--ios), top .35s var(--ios), margin-left .35s var(--ios), box-shadow .35s var(--ios); }
.tab.mitte.gedrueckt .mic-knopf { transform: scale(.92); }
.tab.mitte .tab-l { color: #A2A5B3; }
.tab.mitte.aktiv .tab-l { color: var(--taupe-tief); }
.tabbar.hoert .mic-knopf { width: 64px; height: 64px; top: -43px; margin-left: -32px;
  box-shadow: 0 0 0 5px #fff, 0 0 0 12px rgba(158,139,119,.18), 0 0 0 22px rgba(158,139,119,.08), 0 14px 28px -8px rgba(28,36,75,.6); }
.tabbar.hoert .mic-knopf svg { width: 30px; height: 30px; }

/* Modal (Vollbild von unten) */
.ebene-modal { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.ebene-modal > .modal-blatt { position: absolute; inset: 0; pointer-events: auto; background: var(--grund); will-change: transform; overflow: hidden; }
.ebene-modal > .modal-blatt > .stapel { visibility: visible; }

/* Sheet */
.ebene-sheet { position: absolute; inset: 0; z-index: 60; }
.sheet-hg { position: absolute; inset: 0; background: rgba(17,22,48,.34); opacity: 0; }
.sheet { position: absolute; left: 0; right: 0; bottom: var(--tastatur); max-height: calc(100dvh - var(--sat) - 12px - var(--tastatur)); display: flex; flex-direction: column;
  background: var(--creme); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px rgba(17,22,48,.14); will-change: transform; transform: translateY(100%); }
.sheet::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 400px; background: var(--creme); } /* Gummiband nach oben ohne Lücke */
.sheet.gross { height: calc(100dvh - var(--sat) - 12px - var(--tastatur)); }
.sheet-griff { flex: none; padding: 7px 0 3px; display: grid; place-items: center; touch-action: none; }
.sheet-griff i { width: 36px; height: 5px; border-radius: 3px; background: #D9D3CB; }
.sheet-kopf { flex: none; display: flex; align-items: center; min-height: 44px; padding: 2px 16px 8px 20px; gap: 12px; touch-action: none; }
.sheet-kopf .sheet-titel { flex: 1; min-width: 0; font: 700 20px/25px var(--schrift); letter-spacing: -.02em; color: var(--navy); }
.sheet-zu { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #EEE9E3; color: #7D8197; display: grid; place-items: center; transition: opacity .2s; }
.sheet-zu.gedrueckt { opacity: .5; }
.sheet-inhalt { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 16px 16px; scrollbar-width: none; }
.sheet-inhalt::-webkit-scrollbar { display: none; }
.sheet-aktionen { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 10px 16px calc(var(--sab) + 12px); background: var(--creme); }
.sheet-aktionen.leer { padding-top: 0; padding-bottom: calc(var(--sab) + 4px); }
.sheet-aktionen .knopf { width: 100%; }
.sheet-aktionen .knopf.text { height: 40px; }

/* Abfrage (iOS-Action-Sheet) */
.ebene-abfrage { position: absolute; inset: 0; z-index: 70; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 8px calc(var(--sab) + 8px); }
.abfrage-hg { position: absolute; inset: 0; background: rgba(17,22,48,.34); opacity: 0; }
.abfrage { position: relative; display: flex; flex-direction: column; gap: 8px; will-change: transform; transform: translateY(110%); }
.abfrage-gruppe { border-radius: 14px; overflow: hidden; background: rgba(252,250,245,.92); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); }
.abfrage-text { padding: 16px 20px 14px; text-align: center; }
.abfrage-text b { display: block; font: 600 13.5px/18px var(--schrift); color: var(--text2); }
.abfrage-text span { display: block; margin-top: 3px; font: 400 13px/18px var(--schrift); color: var(--text3); }
.abfrage-knopf { display: block; width: 100%; height: 57px; text-align: center; font: 600 18px/57px var(--schrift); color: var(--navy); letter-spacing: -.01em; border-top: .5px solid rgba(28,36,75,.14); transition: background-color .2s; }
.abfrage-gruppe > .abfrage-knopf:first-child { border-top: 0; }
.abfrage-knopf.gefahr { color: var(--rot); }
.abfrage-knopf.nein { font-weight: 700; background: #fff; border-top: 0; }
.abfrage-knopf.gedrueckt { background-color: rgba(28,36,75,.06); transition: none; }
.abfrage-gruppe.solo { background: #fff; }

/* Toast */
.ebene-toast { position: absolute; left: 0; right: 0; top: 0; z-index: 80; display: flex; justify-content: center; pointer-events: none; padding-top: calc(var(--sat) + 6px); }
.toast { display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 40px); min-height: 44px; padding: 10px 18px 10px 14px; border-radius: 22px;
  background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 0 0 .5px rgba(28,36,75,.08), 0 10px 30px -6px rgba(17,22,48,.22); font: 600 14.5px/19px var(--schrift); color: var(--navy); letter-spacing: -.01em;
  transform: translateY(calc(-100% - var(--sat) - 12px)); opacity: 0; will-change: transform; }
.toast.ohne-icon { padding-left: 18px; }
.toast-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-bg); color: var(--navy); }
.toast.erfolg .toast-icon { background: var(--gruen); color: #fff; }

/* Hinweisleiste (Betrieb ohne onOffice, shell/hinweisleiste.js): direkt unter der Statusleiste; html.mit-hinweisleiste
   setzt --hinweis-h, das über --sat alles darunter nach unten schiebt. Der Zusatz (wartende Änderungen) steht breit nach
   einem „ · “ in derselben Zeile, auf dem iPhone in einer zweiten (basis.css: höhere Leiste bei html.hinweis-zusatz) */
.hinweisleiste { display: none; position: fixed; left: 0; right: 0; top: var(--sat-roh); z-index: 300; height: var(--hinweis-h);
  align-items: center; justify-content: center; gap: 0; padding: 0 16px; background: var(--amber-bg); color: var(--amber);
  box-shadow: inset 0 -.5px 0 rgba(168,114,43,.28); font: 600 12.5px/16px var(--schrift); letter-spacing: -.005em; }
html.mit-hinweisleiste .hinweisleiste { display: flex; }
.hinweisleiste .ic { flex: none; }
.hl-zeile { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hinweisleiste span:not(.hl-zeile) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-zusatz { flex: none; }
.hl-zusatz:empty { display: none; }
.hl-zusatz::before { content: " · "; white-space: pre; }
@media (max-width: 600px) {
  html.hinweis-zusatz .hinweisleiste { flex-direction: column; gap: 3px; }
  .hl-zusatz::before { content: none; }
}

/* Blatt „Änderungen für onOffice“ (nachtragenBlatt() in shell/hinweisleiste.js) */
.na-zeile .t1 { white-space: normal; overflow: visible; }
.na-blatt { display: flex; flex-direction: column; gap: 12px; }
.na-text { margin: 0 2px; font: 500 14px/20px var(--schrift); color: var(--text2); }
.na-laedt { padding: 18px 4px; text-align: center; }
.na-liste { display: flex; flex-direction: column; gap: 10px; }
.na-zeile { align-items: flex-start; }
.na-zeile .ichip { margin-top: 1px; }
.na-fehler { margin-top: 4px; font: 500 12.5px/17px var(--schrift); color: var(--rot); }
.na-abhaken { flex: none; align-self: center; }
.na-tipp { margin: 0 4px; }

/* Browser-Vorschau: Statusleiste, Insel und Home-Balken wie im Design (nur html.web-sim) */
.sim-status, .sim-insel, .sim-home { display: none; }
html.web-sim .sim-status { display: flex; position: fixed; top: 0; left: 0; right: 0; height: 54px; padding: 8px 30px 0 46px; align-items: center; justify-content: space-between;
  font: 600 17px/1 -apple-system, "SF Pro Text", var(--schrift); letter-spacing: -.01em; color: #000; z-index: 1000; pointer-events: none; transition: color .25s; }
html.web-sim[data-statusleiste="hell"] .sim-status { color: #fff; }
.sim-status .symbole { display: flex; align-items: center; gap: 6px; }
html.web-sim .sim-insel { display: block; position: fixed; top: 11px; left: 50%; transform: translateX(-50%); width: 124px; height: 36px; border-radius: 20px; background: #000; z-index: 1001; pointer-events: none; }
html.web-sim .sim-home { display: block; position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%); width: 134px; height: 5px; border-radius: 3px; background: #000; z-index: 1001; pointer-events: none; }
