/* Label Mobile – Gestaltung nach Mockup (Doku/mockup/label-mobile-mockup.dc.html).
   Farben auf WCAG AA geprüft (Text ≥ 4,5:1, Grafik ≥ 3:1), 30.10.2026.
   Farben nur als Variablen; Schriftgrößen in rem, damit die Systemschriftgröße greift. */
:root {
  --bg:#F2F2F7; --card:#FFFFFF; --fg:#000000; --fg2:#5E5E63; --sep:#D8D8DD; --chip:#E6E6EB; --bar:rgba(249,249,251,0.94);
  --accent:#0A84FF; --accent-fill:#0068D9; --accent-text:#0062CC; --accent-tint:#E3EFFF;
  --red:#FF3B30; --red-fill:#D70015; --red-text:#C4001A; --red-tint:#FFE5E3; --orange:#FF9500; --orange-text:#B34700; --orange-tint:#FFF1DD;
  --green:#34C759; --green-fill:#1E7B34; --green-text:#1E7A35; --green-tint:#E3F5E8;
  --gray-dot:#8E8E93; --toast:#1C1C1E; --toast-fg:#FFFFFF; --shadow:0 0 40px rgba(0,0,0,0.18);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg:#000000; --card:#1C1C1E; --fg:#FFFFFF; --fg2:#A1A1A8; --sep:#38383A; --chip:#2C2C2E; --bar:rgba(22,22,24,0.94);
  --accent:#0A84FF; --accent-fill:#0068D9; --accent-text:#4DA3FF; --accent-tint:#0B2A4A;
  --red:#FF453A; --red-fill:#D70015; --red-text:#FF6961; --red-tint:#4A1714; --orange:#FF9F0A; --orange-text:#FFB340; --orange-tint:#3D2A0F;
  --green:#30D158; --green-fill:#1E7B34; --green-text:#4CD964; --green-tint:#16301E;
  --gray-dot:#8E8E93; --toast:#3A3A3C; --toast-fg:#FFFFFF; --shadow:0 0 40px rgba(0,0,0,0.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#000000; --card:#1C1C1E; --fg:#FFFFFF; --fg2:#A1A1A8; --sep:#38383A; --chip:#2C2C2E; --bar:rgba(22,22,24,0.94);
    --accent:#0A84FF; --accent-fill:#0068D9; --accent-text:#4DA3FF; --accent-tint:#0B2A4A;
    --red:#FF453A; --red-fill:#D70015; --red-text:#FF6961; --red-tint:#4A1714; --orange:#FF9F0A; --orange-text:#FFB340; --orange-tint:#3D2A0F;
    --green:#30D158; --green-fill:#1E7B34; --green-text:#4CD964; --green-tint:#16301E;
    --gray-dot:#8E8E93; --toast:#3A3A3C; --toast-fg:#FFFFFF; --shadow:0 0 40px rgba(0,0,0,0.6);
    color-scheme: dark;
  }
}

/* iOS: Systemschriftgröße übernehmen; 1rem ≈ 16px Basis */
html { font: -apple-system-body; font-size: 100%; -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--fg); overscroll-behavior-y: none;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro', Inter, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.0625rem; line-height: 1.3;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tap { transition: transform 150ms ease, opacity 150ms ease; }
.tap:active { transform: scale(0.96); }
.knopf { border: 0; background: transparent; cursor: pointer; }
.ikon { flex: none; }

/* ---------- Grundgerüst ---------- */
#app { position: relative; height: 100vh; height: 100dvh; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.seite { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding-bottom: 24px; }
.seite::-webkit-scrollbar { display: none; }
.fade { animation: fade 200ms ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.oben { padding: calc(env(safe-area-inset-top) + 46px) 8px 0; display: flex; justify-content: flex-end; gap: 4px; min-height: 48px; }
.kopf { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.kopf .cap { font-size: .8125rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--fg2); }
.kopf h1 { margin: 0; font-size: 2rem; line-height: 1.19; font-weight: 700; letter-spacing: -.02em; }
.cap { font-size: .8125rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--fg2); }

.banner { margin: 0 16px 10px; padding: 10px 12px; border-radius: 10px; display: flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 600; line-height: 1.38; }
.banner.warn { background: var(--orange-tint); color: var(--orange-text); }
.banner.fehler { background: var(--red-tint); color: var(--red-text); }
.banner .knopf { margin-left: auto; min-height: 44px; padding: 0 8px; color: inherit; font-weight: 700; text-decoration: underline; }

/* ---------- Pull-to-refresh ---------- */
.pull { height: 0; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; color: var(--fg2); font-size: .8125rem; }
.pull.zurueck { transition: height 220ms ease; }
.pull > span { height: 44px; display: flex; align-items: center; gap: 8px; }
.dreh { animation: dreh .8s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* ---------- Liste ---------- */
.abschnitt { padding: 0 16px; margin-top: 18px; }
.abschnitt h2 { margin: 0 4px 8px; display: flex; align-items: baseline; gap: 8px; font-size: 1.25rem; line-height: 1.25; font-weight: 700; }
.abschnitt h2 .anz { font-size: .9375rem; font-weight: 500; color: var(--fg2); }
.abschnitt h2.rot { color: var(--red-text); } .abschnitt h2.orange { color: var(--orange-text); } .abschnitt h2.gruen { color: var(--green-text); }
.karte { background: var(--card); border-radius: 14px; overflow: hidden; }
.mehr-zeigen { width: 100%; min-height: 48px; border: 0; border-top: 1px solid var(--sep); background: var(--card); color: var(--accent-text); font-size: .9375rem; font-weight: 600; cursor: pointer; }

.zeile-box { position: relative; overflow: hidden; border-top: 1px solid var(--sep); transition: max-height 260ms ease, opacity 200ms ease; max-height: 40rem; }
.zeile-box:first-child { border-top: 0; }
.zeile-box.weg { max-height: 0; opacity: 0; }
.wisch-erledigt { position: absolute; inset: 0; background: var(--green-fill); color: #FFFFFF; display: none; align-items: center; gap: 8px; padding-left: 20px; font-size: .9375rem; font-weight: 600; }
.wisch-aktionen { position: absolute; top: 0; right: 0; bottom: 0; width: 152px; display: none; }
.zeile-box.rechts .wisch-erledigt { display: flex; }
.zeile-box.links .wisch-aktionen { display: flex; }
.wisch-aktionen > * { flex: 1; border: 0; color: #FFFFFF; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: .8125rem; font-weight: 600; text-decoration: none; }
.wisch-aktionen .nav { background: var(--accent-fill); }
.wisch-aktionen .tel { background: #48484A; }
.wisch-aktionen .aus { background: #8E8E93; opacity: .55; }

.zeile { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 12px 16px; border: 0; margin: 0;
  background: var(--card); color: var(--fg); text-align: left; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1); }
.zeile.zieht { transition: none; }
.punkt { flex: none; width: 10px; height: 10px; border-radius: 50%; background: transparent; }
.punkt.blau { background: var(--accent); } .punkt.rot { background: var(--red); } .punkt.grau { background: var(--gray-dot); } .punkt.gruen { background: var(--green); }
.zeile .mitte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zeile .thema { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.zeile .thema.durch { text-decoration: line-through; }
.zeile .ort { font-size: .9375rem; line-height: 1.33; color: var(--fg2); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.nr { font-variant-numeric: tabular-nums; }
.abzeichen { align-self: flex-start; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--fg2); font-size: .8125rem; font-weight: 500; line-height: 1.38; }
.zeile .rechts { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 6.5rem; text-align: right; }
/* Große Systemschrift: Zeit unter das Thema statt daneben, damit das Thema Platz hat */
html.gross .zeile { flex-wrap: wrap; }
html.gross .zeile .mitte { flex-basis: calc(100% - 22px); }
html.gross .zeile .rechts { max-width: none; flex-direction: row; gap: 8px; margin-left: 22px; }
html.gross .steuerung.zwei { flex-direction: column; }
html.gross .segment button { min-height: 2.75rem; }
html.gross .aktionen { grid-template-columns: 1fr; gap: 6px; }
html.gross .aktion { min-height: 3rem; flex-direction: row; gap: 10px; }
html.gross .schnell { flex-direction: column; }
.zeile .zeit { font-size: .9375rem; font-weight: 600; line-height: 1.33; }
.zeile .zeit.rot { color: var(--red-text); } .zeile .zeit.orange { color: var(--orange-text); } .zeile .zeit.grau { color: var(--fg2); }
.zeile .zeit2 { font-size: .8125rem; line-height: 1.38; color: var(--fg2); }

.leer { margin: 24px 16px; padding: 32px 20px; background: var(--card); border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.leer b { font-size: 1.0625rem; font-weight: 600; }
.leer span { font-size: .9375rem; color: var(--fg2); }
.mitte-knopf { padding: 20px 16px 0; display: flex; justify-content: center; }
.pille-knopf { min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--chip); color: var(--accent-text); font-size: .9375rem; font-weight: 600; cursor: pointer; }

.skel { margin: 18px 16px 0; }
.skel .z { min-height: 72px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--sep); }
.skel .z:first-child { border-top: 0; }
.skel i { display: block; background: var(--chip); border-radius: 7px; animation: puls 1.2s ease-in-out infinite; }
@keyframes puls { 50% { opacity: .45; } }

/* ---------- Detail ---------- */
.detail { position: absolute; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); visibility: hidden;
  transition: transform 220ms ease-in, visibility 0s linear 220ms; }
.detail.offen { transform: none; visibility: visible; box-shadow: var(--shadow); transition: transform 300ms cubic-bezier(.2,.8,.2,1), visibility 0s; }
.detail .leiste { flex: none; padding: calc(env(safe-area-inset-top) + 50px) 8px 4px; display: flex; align-items: center; justify-content: space-between; }
.zurueck { min-height: 44px; min-width: 48px; padding: 0 8px; color: var(--accent-text); display: flex; align-items: center; gap: 2px; font-size: 1.0625rem; }
.detail .inhalt { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.detail .inhalt::-webkit-scrollbar { display: none; }
.detail .inhalt > * { flex-shrink: 0; } /* Karten mit overflow:hidden sonst zusammengedrückt */
.dkopf { display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.dkopf .ticket { font-size: 1.0625rem; font-weight: 600; color: var(--fg2); }
.dkopf h1 { margin: -6px 0 0; font-size: 1.625rem; line-height: 1.19; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pillen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: .8125rem; font-weight: 700; }
.pill.over { background: var(--red-fill); color: #FFFFFF; } .pill.heute { background: var(--orange); color: #000000; }
.pill.offen { background: var(--chip); color: var(--accent-text); } .pill.done { background: var(--green-fill); color: #FFFFFF; }
.pill.wichtig { background: var(--accent-tint); color: var(--accent-text); } .pill.dringend { background: var(--red-tint); color: var(--red-text); }
.pill.grau { background: var(--chip); color: var(--fg2); }
.dkopf .taet { font-size: .9375rem; color: var(--fg2); }
.dkopf .termin { font-size: 1.0625rem; font-weight: 500; }
.dkopf .zust { font-size: .9375rem; color: var(--fg2); }

.adresse { background: var(--card); border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 14px; color: var(--fg); text-decoration: none; }
.kachel { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--chip); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.spalte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.spalte b { font-size: 1.0625rem; font-weight: 600; }
.spalte span { font-size: .9375rem; color: var(--fg2); }
.spalte small { font-size: .8125rem; color: var(--fg2); margin-top: 4px; }
.kopfzeile { padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.kopfzeile b { font-size: 1.0625rem; font-weight: 600; }
.kopfzeile span:not(.cap) { font-size: .9375rem; color: var(--fg2); }
.link-zeile { min-height: 52px; padding: 0 16px; border-top: 1px solid var(--sep); display: flex; align-items: center; gap: 12px; color: var(--accent-text); text-decoration: none; font-size: 1.0625rem; overflow: hidden; }
.link-zeile span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-zeile.aus { color: var(--fg2); font-size: .9375rem; }

.verlauf { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.eintrag { display: flex; gap: 12px; }
.eintrag .linie { flex: none; width: 12px; display: flex; flex-direction: column; align-items: center; }
.eintrag .linie i { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--gray-dot); }
.eintrag:first-child .linie i { background: var(--accent); }
.eintrag .linie s { flex: 1; width: 2px; background: var(--sep); }
.eintrag:last-child .linie s { display: none; }
.eintrag .text { flex: 1; min-width: 0; padding-bottom: 14px; display: flex; flex-direction: column; gap: 2px; }
.eintrag .meta { font-size: .8125rem; color: var(--fg2); }
.eintrag p { margin: 0; font-size: 1rem; line-height: 1.375; white-space: pre-line; overflow-wrap: anywhere; }

.zuordnung > div { min-height: 44px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--sep); font-size: .9375rem; }
.zuordnung > div:first-child { border-top: 0; }
.zuordnung > div span:first-child { color: var(--fg2); }
.zuordnung > div span:last-child { font-weight: 500; text-align: right; }

.aktionen { flex: none; padding: 12px 16px calc(env(safe-area-inset-bottom) + 16px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: var(--bar); border-top: 1px solid var(--sep); }
.aktion { min-height: 64px; border: 0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: .9375rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.aktion.primaer { background: var(--accent-fill); color: #FFFFFF; }
.aktion:disabled { opacity: .45; cursor: default; }
.blatt-inhalt .banner { margin: 0; }
.aktion.sekundaer { background: var(--chip); color: var(--accent-text); }
.aktion.erledigt { background: var(--green-tint); color: var(--green-text); }
.aktion.oeffnen { background: var(--chip); color: var(--fg); }
.aktion.aus { background: var(--chip); color: var(--fg2); opacity: .5; cursor: default; }
.aktion.gesperrt { background: var(--chip); color: var(--fg2); }

/* ---------- Mehr ---------- */
.mehr { padding: 0 16px 24px; display: flex; flex-direction: column; gap: 24px; }
.profil { background: var(--card); border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 14px; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-fill); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 1.1875rem; font-weight: 600; }
.gruppe { display: flex; flex-direction: column; gap: 8px; }
.gruppe h2 { margin: 0 4px; }
.segment { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; padding: 4px; background: var(--chip); border-radius: 12px; }
.segment button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--fg); font-size: .9375rem; font-weight: 500; cursor: pointer; transition: background 200ms ease; }
.segment button[aria-pressed="true"] { background: var(--card); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.auswahl { width: 100%; min-height: 48px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--card); color: var(--fg); font-size: 1.0625rem; }
.zeilen-knopf { min-height: 52px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--card); color: var(--red-text); font-size: 1.0625rem; font-weight: 500; text-align: left; cursor: pointer; }
.info { background: var(--card); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; font-size: .9375rem; line-height: 1.4; }
.info p { margin: 0; }
.info .grau { color: var(--fg2); }
.fuss { margin: 0; text-align: center; font-size: .8125rem; color: var(--fg2); }

/* ---------- Tab-Bar und Hinweis ---------- */
.tabbar { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px 8px calc(env(safe-area-inset-bottom) + 8px); background: var(--bar); border-top: 1px solid var(--sep); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.tabbar button { min-height: 50px; border: 0; background: transparent; color: var(--fg2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .6875rem; font-weight: 600; cursor: pointer; }
.tabbar button[aria-current="page"] { color: var(--accent-text); }
.tabbar button[aria-disabled="true"] { opacity: .45; cursor: default; }
.hinweis { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 84px); max-width: 480px; margin: 0 auto; z-index: 40; min-height: 52px; padding: 6px 6px 6px 16px;
  border-radius: 14px; background: var(--toast); color: var(--toast-fg); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .9375rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 200ms ease, transform 200ms ease; }
.hinweis.da { opacity: 1; transform: none; pointer-events: auto; }
.hinweis span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hinweis button { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: #64B5FF; font-size: .9375rem; font-weight: 700; cursor: pointer; }
.detail-offen .hinweis { bottom: calc(env(safe-area-inset-bottom) + 108px); }

/* ---------- Etappe 3: Steuerung, Suche, Auswahl-Leisten, Filter ---------- */
.knopf.rund { position: relative; width: 48px; height: 48px; border-radius: 24px; color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.marke { position: absolute; top: 6px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-fill); color: #FFFFFF; font-size: .6875rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.textknopf { min-height: 44px; padding: 0 8px; color: var(--accent-text); font-size: 1.0625rem; }
.textknopf.fett { font-weight: 600; }
.suchzeile { padding: 0 16px 12px; display: flex; align-items: center; gap: 8px; }
.suchfeld { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; background: var(--chip); color: var(--fg2); display: flex; align-items: center; gap: 8px; }
.suchfeld input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--fg); font-size: 1.0625rem; }
.suchfeld input::placeholder { color: var(--fg2); opacity: 1; }
.suchfeld input::-webkit-search-cancel-button { -webkit-appearance: none; }
.steuerung { padding: 0 16px; }
.steuerung.zwei { display: flex; gap: 8px; }
.steuerung.zwei > .segment { flex: 1; min-width: 0; gap: 2px; padding: 3px; }
.steuerung.zwei .segment button { font-size: .875rem; padding: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 16px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--chip); color: var(--fg); display: flex; align-items: center; gap: 8px; font-size: .9375rem; font-weight: 600; cursor: pointer; }
.chips .chip { min-height: 48px; }
.chip.mit-av { padding-left: 6px; padding-right: 12px; }
.chip.an { background: var(--accent-fill); color: #FFFFFF; }
.chip .av { width: 2.6em; height: 2.6em; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; font-size: .8125rem; font-weight: 700; }
.chip.an .av { background: rgba(255,255,255,.22); }
.chip .zahl { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--card); color: var(--fg2); font-size: .8125rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chip .zahl.hell { background: rgba(255,255,255,.22); color: #FFFFFF; }
.chip .zahl.rot { background: var(--red-fill); color: #FFFFFF; }
.filterzeile { padding: 6px 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filterzeile span { min-width: 0; font-size: .8125rem; color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filterzeile .textknopf { flex: none; font-size: .9375rem; font-weight: 600; }
.leer.klein { margin: 0; padding: 20px 16px; color: var(--fg2); font-size: .9375rem; }

.blatt { position: absolute; inset: 0; z-index: 30; visibility: hidden; transition: visibility 0s linear 300ms; }
.blatt.offen { visibility: visible; transition: visibility 0s; }
.blatt .dimmer { position: absolute; inset: 0; border: 0; padding: 0; background: rgba(0,0,0,.4); opacity: 0; transition: opacity 250ms ease; cursor: pointer; }
.blatt.offen .dimmer { opacity: 1; }
.blatt-karte { position: absolute; left: 0; right: 0; bottom: 0; max-height: 80%; background: var(--bg); border-radius: 16px 16px 0 0; display: flex; flex-direction: column; box-shadow: var(--shadow);
  transform: translateY(105%); transition: transform 300ms ease-in; }
.blatt.offen .blatt-karte { transform: none; transition: transform 340ms cubic-bezier(.2,.9,.25,1.06); }
.griff { flex: none; display: flex; justify-content: center; padding-top: 8px; }
.griff span { width: 36px; height: 5px; border-radius: 3px; background: var(--gray-dot); }
.blatt-kopf { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px; align-items: center; padding: 4px 8px; }
.blatt-kopf > :first-child { justify-self: start; } .blatt-kopf > b { justify-self: center; font-size: 1.0625rem; } .blatt-kopf > :last-child { justify-self: end; }
.blatt-inhalt { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 20px; }
.blatt-inhalt h3 { margin: 0 4px; }
.wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl .chip { background: var(--card); font-weight: 500; }
.wahl .chip.an { background: var(--accent-fill); font-weight: 600; }
.blatt-fuss { flex: none; padding: 12px 16px calc(env(safe-area-inset-bottom) + 16px); border-top: 1px solid var(--sep); }
.knopf-voll { width: 100%; min-height: 52px; font-size: 1.0625rem; }

/* ---------- Kalender ---------- */
.ohne-termin { margin: 10px 16px 0; min-height: 44px; padding: 0 4px; color: var(--accent-text); font-size: .9375rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.monat { padding: 10px 8px 0; }
.wochentage, .raster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wochentage span { text-align: center; font-size: .8125rem; font-weight: 600; color: var(--fg2); padding-bottom: 4px; }
.tag { min-height: 50px; padding: 4px 0; border: 0; background: transparent; color: var(--fg); display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; }
.tag.fremd { opacity: .35; }
.tag .num { width: 2.1em; height: 2.1em; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.0625rem; }
.tag.heute .num { color: var(--accent-text); font-weight: 700; }
.tag.sel .num { background: var(--accent-fill); color: #FFFFFF; font-weight: 700; }
.punkte { height: 6px; display: flex; gap: 3px; }
.punkte i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.punkte i.over, .punkt.over { background: var(--red); }
.punkte i.done, .punkt.done { background: var(--green); }
.punkt.open { background: var(--accent); }
.kal-zeile { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 16px; border: 0; border-top: 1px solid var(--sep); background: var(--card); color: var(--fg); text-align: left; cursor: pointer; }
.kal-zeile:first-child { border-top: 0; }
.kal-zeile .zeitspalte { flex: none; width: 64px; display: flex; flex-direction: column; gap: 2px; }
.kal-zeile .zeitspalte b { font-size: .9375rem; font-weight: 600; }
.kal-zeile .zeitspalte span { font-size: .8125rem; color: var(--fg2); }
.kal-zeile .mitte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kal-zeile .thema { font-size: 1.0625rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kal-zeile .thema.durch { text-decoration: line-through; }
.kal-zeile .ort { font-size: .9375rem; color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stunden { position: relative; }
.stunden span { position: absolute; right: 6px; font-size: .6875rem; line-height: 14px; color: var(--fg2); }
.stunden.lang span { right: 8px; font-size: .75rem; }
.jetzt { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.tagspalte { position: relative; border-left: 1px solid var(--sep); background-image: linear-gradient(to bottom, var(--sep) 1px, transparent 1px); background-size: 100% 48px; }
.tagspalte.heute { background-color: rgba(10,132,255,.06); }
.block { position: absolute; padding: 2px 3px; border: 0; border-radius: 5px; text-align: left; overflow: hidden; cursor: pointer; box-shadow: 0 0 0 1px var(--card);
  display: flex; flex-direction: column; gap: 1px; font-size: .625rem; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.block b { font-weight: 600; }
.block.open, .ganz-block.open, .ganz-zeile.open { background: var(--accent-tint); color: var(--accent-text); }
.block.over, .ganz-block.over, .ganz-zeile.over { background: var(--red-tint); color: var(--red-text); }
.block.done, .ganz-block.done, .ganz-zeile.done { background: var(--green-tint); color: var(--green-text); }
.woche { padding: 10px 0 0; }
.wkopf { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 0 8px 4px; }
.wraster { display: grid; grid-template-columns: 2.25rem repeat(7, minmax(0, 1fr)); }
.wraster.gitter { padding: 10px 8px 12px; }
.wtag { min-height: 52px; padding: 0; border: 0; background: transparent; color: var(--fg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.wtag span { font-size: .75rem; font-weight: 600; color: var(--fg2); }
.wtag b { width: 2em; height: 2em; border-radius: 50%; font-size: .9375rem; display: flex; align-items: center; justify-content: center; }
.wtag.heute b { background: var(--accent-fill); color: #FFFFFF; }
.wraster.ganz { border-top: 1px solid var(--sep); padding-top: 4px; }
.ganz-label { font-size: .625rem; color: var(--fg2); padding-top: 4px; }
.wraster.ganz > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 0 1px; }
.ganz-block { min-height: 24px; padding: 2px 3px; border: 0; border-radius: 5px; font-size: .625rem; font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.block .block-zeile { font-weight: 400; }
.tagraster { display: grid; grid-template-columns: 52px minmax(0, 1fr); padding: 10px 16px 12px 4px; }
.tagraster .block { padding: 4px 8px; border-radius: 8px; font-size: .8125rem; }
.tagraster .block b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tagraster .block span { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ganztags { padding: 10px 16px 0; display: flex; flex-direction: column; gap: 6px; }
.ganz-zeile { min-height: 48px; padding: 6px 12px; border: 0; border-radius: 10px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; text-align: left; cursor: pointer; }
.ganz-zeile b { font-size: .9375rem; } .ganz-zeile span { font-size: .8125rem; }

/* ---------- Etappe 4: Formulare, Notiz, Schnellaktionen, Dokumente ---------- */
.textknopf:disabled { color: var(--fg2); opacity: .5; cursor: default; }
.textknopf.links { align-self: flex-start; padding: 0 4px; font-size: .9375rem; }
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld .cap { margin: 0 4px; }
.eingabe { width: 100%; min-height: 48px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--card); color: var(--fg); font-size: 1.0625rem; outline: none; }
textarea.eingabe { padding: 12px; min-height: 88px; resize: vertical; line-height: 1.38; }
.eingabe:focus { box-shadow: 0 0 0 2px var(--accent); }
.zwei-felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fehler-text { margin: -8px 4px 0; min-height: 1em; color: var(--red-text); font-size: .875rem; font-weight: 600; }
.fehler-text:empty { display: none; }
.hinweis-text { margin: 0 4px; font-size: .8125rem; line-height: 1.4; color: var(--fg2); }
.adr-gewaehlt { background: var(--card); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.adr-gewaehlt .spalte b { font-size: 1rem; } .adr-gewaehlt .spalte span { font-size: .875rem; }
.treffer:empty { display: none; }
.treffer { margin-top: 6px; }
.treffer-zeile { width: 100%; min-height: 52px; padding: 8px 12px; border: 0; border-top: 1px solid var(--sep); background: var(--card); color: var(--fg); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer; }
.treffer-zeile:first-child { border-top: 0; }
.treffer-zeile b { font-size: 1rem; font-weight: 600; } .treffer-zeile span { font-size: .8125rem; color: var(--fg2); }
.treffer-leer { display: block; padding: 12px; font-size: .875rem; color: var(--fg2); }
.team-zeile { width: 100%; min-height: 56px; padding: 0 16px; border: 0; border-top: 1px solid var(--sep); background: var(--card); color: var(--fg); display: flex; align-items: center; justify-content: space-between; font-size: 1.0625rem; text-align: left; cursor: pointer; }
.team-zeile:first-child { border-top: 0; }
.team-zeile[aria-current="true"] { color: var(--accent-text); font-weight: 600; }

.schnell { display: flex; gap: 8px; }
.schnell button { flex: 1; min-height: 48px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--card); color: var(--accent-text); font-size: .9375rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.notiz { display: flex; flex-direction: column; gap: 8px; }
.notiz textarea { width: 100%; min-height: 52px; padding: 12px; border: 0; border-radius: 12px; background: var(--chip); color: var(--fg); font-size: 1.0625rem; line-height: 1.3; resize: none; outline: none; }
.notiz textarea:focus { box-shadow: 0 0 0 2px var(--accent); }
.notiz textarea::placeholder { color: var(--fg2); opacity: 1; }
.pille-knopf.primaer { align-self: flex-end; min-height: 44px; padding: 0 18px; background: var(--accent-fill); color: #FFFFFF; }
.pille-knopf[hidden] { display: none; }
.kopfzeile.reihe { flex-direction: row; align-items: baseline; gap: 8px; padding-bottom: 6px; }
.kopfzeile .anz { font-size: .8125rem; color: var(--fg2); }
.dok-zeile { width: 100%; min-height: 64px; padding: 8px 16px; border: 0; border-top: 1px solid var(--sep); background: transparent; color: var(--fg); display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; }
.kopfzeile + .dok-zeile { border-top: 0; }
.kachel-text { font-size: .6875rem; font-weight: 700; letter-spacing: .02em; border-radius: 8px; }
.dok-status { flex: none; font-size: .8125rem; color: var(--fg2); }

/* ---------- Etappe 5: Tablet (ab 768 px) ---------- */
.zeile.gewaehlt { background: var(--accent-tint); }
.platzhalter { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px; text-align: center; color: var(--gray-dot); }
.platzhalter b { font-size: 1.25rem; font-weight: 600; color: var(--fg); }
.platzhalter span { font-size: .9375rem; color: var(--fg2); }
@media (min-width: 768px) {
  #app.breit { max-width: 1200px; }
  /* Split: Liste links 400 px, Detail rechts dauerhaft sichtbar, Tab-Bar über die ganze Breite */
  #app.split .seite { width: 400px; flex: 1 1 auto; border-right: 1px solid var(--sep); }
  #app.split .detail { left: 400px; bottom: var(--tabbar-h, 72px); transform: none; visibility: visible; box-shadow: none; transition: none; z-index: 5; }
  #app.split .detail .aktionen { padding-bottom: 12px; }
  #app.split .detail .leiste { padding-top: calc(env(safe-area-inset-top) + 20px); }
  #app.split .hinweis { left: 416px; }
  /* Kalender und Mehr: Detail als Feld rechts */
  #app.breit:not(.split) .detail { left: auto; width: min(480px, 100%); border-left: 1px solid var(--sep); }
  #app.breit .seite { padding-left: max(0px, calc((100% - 860px) / 2)); padding-right: max(0px, calc((100% - 860px) / 2)); }
  #app.split .seite { padding-left: 0; padding-right: 0; }
  /* Felder von unten: zentriert, begrenzte Breite */
  #app.breit .blatt-karte { left: 50%; right: auto; width: min(640px, 100%); transform: translate(-50%, 105%); }
  #app.breit .blatt.offen .blatt-karte { transform: translate(-50%, 0); }
}

/* ---------- Etappe 6: Anmeldung ---------- */
.anmeldung { max-width: 420px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 15vh) 24px 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.anmeldung img { border-radius: 20px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.anmeldung h1 { margin: 0; font-size: 2rem; letter-spacing: -.02em; }
.anmeldung p { margin: 0; color: var(--fg2); }
.anmeldung .banner { margin: 0; width: 100%; text-align: left; }
.anmeldung .knopf-voll { margin-top: 8px; }
.testanmeldung { max-width: 480px; margin: 0 auto; padding: 32px 16px; display: flex; flex-direction: column; gap: 12px; }
.testanmeldung h1 { margin: 0; } .testanmeldung p { margin: 0; color: var(--fg2); }
.testanmeldung form { display: flex; flex-direction: column; gap: 8px; }
.testanmeldung button { min-height: 52px; padding: 8px 16px; border: 0; border-radius: 12px; background: var(--card); color: var(--fg); font-size: 1.0625rem; text-align: left; cursor: pointer; display: flex; flex-direction: column; }
.testanmeldung small { color: var(--fg2); font-size: .8125rem; }
.zeilen-knopf[data-aktion="abmelden"] { color: var(--red-text); }
.tabbar[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Rückweg zum Startcenter (Modulvertrag Abschnitt 7, ADR-005): kein Rot, 44 px Zielfläche, gleiches Fenster */
.sc-rueckweg { display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; padding: 0 12px 0 8px; margin-left: -8px; font: inherit; font-size: 15px; color: inherit; text-decoration: none; border-radius: 8px; }
.sc-rueckweg:hover { background: rgba(0,0,0,.06); }
.sc-rueckweg:focus-visible { outline: 2px solid #0A84FF; outline-offset: 2px; }
@media (prefers-color-scheme: dark) { .sc-rueckweg:hover { background: rgba(255,255,255,.1); } }
[data-theme="dark"] .sc-rueckweg:hover { background: rgba(255,255,255,.1); }
.anmeldung .aktion.zweit { background: var(--chip, #E9E9EE); color: inherit; margin-top: 8px; }
.anmeldung .sc-rueckweg { align-self: flex-start; }
