/* Hausbau-Cockpit Port Grimaud */
:root {
  color-scheme: light;
  --page: #f5f3ee;
  --surface: #fcfcfb;
  --surface-2: #f0eee8;
  --surface-3: #e6e3db;
  --ink: #141413;
  --ink-2: #52514e;
  --ink-3: #898781;
  --line: #e4e1d8;
  --line-strong: #c9c6bb;
  --akzent: #b0532c;
  --akzent-tint: #f6e6dd;
  --blau: #2a78d6;
  --d1: #184f95; --d2: #3987e5; --d3: #86b6ef;
  --gut: #0ca30c; --warn: #fab219; --krit: #d03b3b;
  --warn-ic: #a8740a;
  --schatten: 0 1px 2px rgba(20, 20, 19, .04), 0 6px 20px rgba(20, 20, 19, .05);
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --leiste-oben: calc(56px + var(--safe-t));
  --leiste-unten: calc(58px + var(--safe-b));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f0f0e; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2e2e2b;
    --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #8f8d86;
    --line: #2c2c2a; --line-strong: #3d3d3a;
    --akzent: #e3895f; --akzent-tint: #3a2419;
    --blau: #3987e5; --d1: #86b6ef; --d2: #3987e5; --d3: #1c5cab;
    --warn-ic: #fab219;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f0e; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2e2e2b;
  --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #8f8d86;
  --line: #2c2c2a; --line-strong: #3d3d3a;
  --akzent: #e3895f; --akzent-tint: #3a2419;
  --blau: #3987e5; --d1: #86b6ef; --d2: #3987e5; --d3: #1c5cab;
  --warn-ic: #fab219;
  --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--akzent); }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.leise { color: var(--ink-3); }
.leer { color: var(--ink-3); font-style: italic; margin: 6px 0; }
.nowrap { white-space: nowrap; }
.label { display: block; font-size: 12px; color: var(--ink-3); letter-spacing: .01em; }

/* ---------- Grundgerüst ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.seitenleiste { display: none; }
.kopfleiste {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--safe-t) + 8px) calc(16px + var(--safe-r)) 8px calc(16px + var(--safe-l)); min-height: 56px;
  background: color-mix(in oklab, var(--page) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.kl-marke { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 650; }
.kl-aktionen { display: flex; align-items: center; gap: 8px; }
.main { padding: 16px calc(16px + var(--safe-r)) calc(92px + var(--safe-b)) calc(16px + var(--safe-l)); max-width: 1320px; margin: 0 auto; outline: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l); background: color-mix(in oklab, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px;
  background: none; border: 0; color: var(--ink-3); font-size: 10.5px; font-weight: 550; text-decoration: none; min-width: 0;
}
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .ic { width: 22px; height: 22px; }
.tab.an { color: var(--akzent); }
.tab .nb { position: absolute; top: 4px; left: calc(50% + 6px); }

@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
  .seitenleiste {
    display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
    padding: 20px 14px 18px; background: var(--surface); border-right: 1px solid var(--line);
  }
  .kopfleiste, .tabbar, .querleiste, .rand-farbe { display: none !important; }
  .main { padding: 30px 40px 72px; width: 100%; }
}
.sl-marke { display: flex; align-items: center; gap: 11px; padding: 2px 6px 6px; }
.sl-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--akzent); color: #fff; display: grid; place-items: center; flex: none; }
.sl-logo .ic { width: 19px; height: 19px; stroke-width: 2; }
.sl-titel { display: block; font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.sl-sub { display: block; font-size: 12px; color: var(--ink-3); }
.sl-suche {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3); text-align: left;
}
.sl-suche span { flex: 1; }
.sl-suche kbd { font: 11px system-ui; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--ink-3); }
.sl-nav { display: flex; flex-direction: column; gap: 2px; }
.sl-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2);
  text-decoration: none; font-weight: 520;
}
.sl-link:hover { background: var(--surface-2); color: var(--ink); }
.sl-link.an { background: var(--akzent-tint); color: var(--ink); font-weight: 650; }
.sl-link.an .ic { color: var(--akzent); }
.sl-link .nb { margin-left: auto; }
.nb { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); }
.nb-krit { background: var(--krit); color: #fff; }
.nb-leise { background: transparent; color: var(--ink-3); border: 1px solid var(--line-strong); }
.sl-fuss { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.sl-stand { font-size: 12px; color: var(--ink-2); }
.sl-pflege { font-size: 11.5px; color: var(--ink-3); margin: 0; line-height: 1.45; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 2px; gap: 2px; align-self: flex-start; }
.seg button { border: 0; background: none; padding: 4px 9px; border-radius: 7px; font-size: 12px; font-weight: 650; color: var(--ink-3); display: inline-flex; align-items: center; }
.seg button.an { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg-klein button { padding: 3px 7px; font-size: 11.5px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); flex: none; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn.klein { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.ok { color: var(--gut); border-color: var(--gut); }

/* ---------- Seiten ---------- */
.seiten-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.seiten-kopf h1 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; font-weight: 720; }
.seiten-kopf .sub { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
@media (max-width: 600px) { .seiten-kopf h1 { font-size: 24px; } }
.neu-hinweis { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink); }
.punkt-neu { width: 8px; height: 8px; border-radius: 50%; background: var(--akzent); }
.hinweis { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; }
.hinweis-warn { background: color-mix(in oklab, var(--warn) 20%, var(--surface)); }
.hinweis-warn .ic { color: var(--warn-ic); margin-top: 2px; }
.knopf { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.knopf:hover { border-color: var(--line-strong); }
.link { border: 0; background: none; padding: 8px 0 0; color: var(--akzent); font-weight: 600; font-size: 13.5px; }
.link:hover { text-decoration: underline; }

.karte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.karte h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 15px; font-weight: 680; letter-spacing: -.005em; }
.karte h2 .ic { color: var(--ink-3); }
.karte-sub { margin: -4px 0 12px; color: var(--ink-3); font-size: 13px; }
.zahl { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 650; }
h2 .zahl { margin-left: 2px; }
.karte.leise { background: transparent; border-style: dashed; }
.karte.leise h2 .av { width: 22px; height: 22px; font-size: 9px; }

/* KPI-Kacheln (gerade Spaltenzahl – nichts mittig auf dem Falz) */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.kpi:hover { border-color: var(--line-strong); box-shadow: var(--schatten); }
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.kpi-wert { font-size: 30px; font-weight: 680; letter-spacing: -.02em; line-height: 1.15; }
.kpi-sub { font-size: 12px; color: var(--ink-3); }
.kpi-warn { border-color: color-mix(in oklab, var(--krit) 45%, var(--line)); }
.kpi-warn .kpi-label .ic { color: var(--krit); }

.raster-lage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 1100px) { .raster-lage { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.raster-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 1000px) { .raster-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .raster-2 > .breit { grid-column: 1 / -1; } }
.spalten-2 { columns: 1; column-gap: 16px; }
@media (min-width: 1000px) { .spalten-2 { columns: 2; } }
.spalten-2 > * { break-inside: avoid; }

/* Bauzeit */
.bz-kopf { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.bz-woche { font-size: 20px; font-weight: 680; letter-spacing: -.01em; }
.bz-rest { text-align: right; }
.bz-rest-zahl { font-size: 15px; font-weight: 650; }
.meter { position: relative; height: 10px; border-radius: 5px; background: color-mix(in oklab, var(--blau) 22%, var(--surface)); }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: var(--blau); }
.m-tick { position: absolute; top: -5px; width: 12px; height: 20px; margin-left: -6px; cursor: help; }
.m-tick::after { content: ""; position: absolute; left: 5px; top: 0; width: 2px; height: 20px; border-radius: 1px; background: var(--ink-3); }
.m-tick.vorbei::after { background: var(--surface); }
.bz-achse { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--ink-3); }

/* Fokus & Achtung */
.fokus-liste { list-style: none; margin: 0; padding: 0; counter-reset: f; }
.fokus-liste li { position: relative; padding: 4px 0 10px 34px; counter-increment: f; }
.fokus-liste li::before { content: counter(f); position: absolute; left: 0; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--akzent-tint); color: var(--akzent); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.fokus-liste p, .risiko-liste p { margin: 0 0 6px; }
.risiko-liste { list-style: none; margin: 0; padding: 0; }
.rz { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.rz:first-child { border-top: 0; padding-top: 2px; }
.rz > .ic { margin-top: 3px; }
.rz-kritisch > .ic { color: var(--krit); }
.rz-warnung > .ic { color: var(--warn-ic); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Chips, Badges, Status, Avatare */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; border: 1px solid transparent; background: var(--surface-2); font-size: 12px; color: var(--ink-2); max-width: 100%; }
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip-p { padding-left: 3px; border-radius: 999px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; font-weight: 560; white-space: nowrap; }
.badge .ic { width: 13px; height: 13px; }
.b-krit { background: color-mix(in oklab, var(--krit) 14%, var(--surface)); color: var(--ink); }
.b-krit .ic { color: var(--krit); }
.b-warn { background: color-mix(in oklab, var(--warn) 24%, var(--surface)); color: var(--ink); }
.b-alt { background: var(--surface-3); }
.b-leise { background: transparent; border: 1px solid var(--line); color: var(--ink-3); }
.b-neu { background: var(--akzent); color: #fff; }
.b-fest { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); }
.krit { color: var(--krit); }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 640; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.status .ic { width: 14px; height: 14px; stroke-width: 2.1; }
.st-kritisch { background: color-mix(in oklab, var(--krit) 14%, var(--surface)); } .st-kritisch .ic, .st-ic-kritisch { color: var(--krit); }
.st-handeln { background: color-mix(in oklab, var(--warn) 24%, var(--surface)); } .st-handeln .ic, .st-ic-handeln { color: var(--warn-ic); }
.st-wartet .ic, .st-ic-wartet { color: var(--ink-3); }
.st-laeuft { background: color-mix(in oklab, var(--gut) 13%, var(--surface)); } .st-laeuft .ic, .st-ic-laeuft { color: var(--gut); }
.st-ruht { color: var(--ink-2); } .st-ruht .ic, .st-ic-ruht { color: var(--ink-3); }
.st-erledigt .ic, .st-ic-erledigt { color: var(--gut); }
.av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); font-size: 10px; font-weight: 700; letter-spacing: -.02em; flex: none; }
.av-org { border-radius: 7px; }
.av-uns { background: var(--akzent-tint); color: var(--akzent); }
.av-claude { background: transparent; border: 1px dashed var(--line-strong); }
.av-l { width: 40px; height: 40px; font-size: 14px; }
.av-org.av-l { border-radius: 11px; }

/* Punkte-Listen */
.pliste { list-style: none; margin: 0; padding: 0; }
.pz { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.pliste > .pz:first-child { border-top: 0; padding-top: 4px; }
.pz-main { flex: 1; min-width: 0; }
.pz-text { display: block; border: 0; background: none; padding: 0; text-align: left; font-weight: 560; color: var(--ink); line-height: 1.4; }
button.pz-text:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.pz-detail { margin-top: 4px; color: var(--ink-2); font-size: 13.5px; }
.pz-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.pz-hoch .pz-text::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--akzent); margin: 0 7px 2px 0; vertical-align: middle; }
.pz-fokus { background: color-mix(in oklab, var(--akzent) 9%, transparent); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; }
.ball { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 0; color: var(--ink-2); font-size: 12.5px; max-width: 42%; flex: none; }
.ball span:not(.av) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .ball span:not(.av) { display: none; } }
.wg { padding: 6px 0 10px; border-top: 1px solid var(--line); }
.wg:first-of-type { border-top: 0; }
.wg-kopf { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 6px 0; text-align: left; flex-wrap: wrap; }
.wg-name { font-weight: 680; }
.wg-zahl { font-size: 12px; color: var(--ink-3); font-weight: 650; }
.wg-alt { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.wg .pliste { padding-left: 32px; }
.wg .pz { padding: 7px 0; }
.mehr-punkte { padding-left: 32px; }
.mehr-punkte summary { cursor: pointer; color: var(--akzent); font-size: 13px; font-weight: 600; padding: 4px 0; list-style: none; }
.mehr-punkte summary::-webkit-details-marker { display: none; }
.mehr-punkte .pliste { padding-left: 0; }

/* Zusagen & Zitate */
.zusage { display: flex; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.zusage > .ic { color: var(--ink-3); margin-top: 2px; }
.z-kopf { font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
q { quotes: "“" "”"; }
q:lang(fr) { quotes: "« " " »"; }
q:lang(de) { quotes: "„" "“"; }
.z-wort { color: var(--ink); font-style: italic; }
.z-ueb { color: var(--ink-3); }
.z-zeile { margin-top: 3px; font-size: 13px; }
.zitat { margin: 8px 0 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-strong); }
.zitat p { margin: 0; }
.z-orig { font-style: italic; color: var(--ink); }
.zitat .z-ueb { font-size: 13px; margin-top: 2px; }
.zitat .z-ueb span { font-weight: 600; }

/* Ereignisse */
.evliste { list-style: none; margin: 0; padding: 0; }
.ev { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.evliste > .ev:first-child, .tag-titel + .ev { border-top: 0; }
.ev-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; }
.ev-wichtig .ev-ic { background: var(--akzent-tint); color: var(--akzent); }
.ev-neu .ev-ic { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--akzent); }
.ev-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px; color: var(--ink-2); }
.ev-wer { border: 0; background: none; padding: 0; font-weight: 650; color: var(--ink); }
.ev-wer:hover { text-decoration: underline; }
.ev-pfeil { color: var(--ink-3); }
.ev-zeit { margin-left: auto; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.ev-titel { font-weight: 620; margin-top: 2px; line-height: 1.4; }
.ev-text { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.ev-fuss { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.quelle { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-3); }
.evliste.kompakt .ev { padding: 8px 0; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
.evliste.kompakt .ev-ic { width: 26px; height: 26px; }
.evliste.kompakt .ev-ic .ic { width: 14px; height: 14px; }
.evliste.kompakt .ev-titel { font-weight: 560; font-size: 14px; }
.vmonat { margin-bottom: 10px; }
.monat-titel { font-size: 19px; margin: 22px 0 4px; letter-spacing: -.01em; }
.tag-titel { list-style: none; position: sticky; top: 56px; z-index: 2; padding: 10px 0 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); background: var(--page); }
@media (min-width: 1024px) { .tag-titel { top: 0; } }
.treffer { color: var(--ink-3); font-size: 13px; margin: 0 0 4px; }

/* Filter */
.filterzeile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filterzeile select, .filtersuche { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); max-width: 100%; }
.filtersuche { flex: 1; min-width: 200px; }
.schalter { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; cursor: pointer; }
.schalter input { accent-color: var(--akzent); margin: 0; }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 560; color: var(--ink-2); }
.fchip .ic { width: 14px; height: 14px; }
.fchip.an { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.fchip.an .ic { color: inherit; }
.fz { font-size: 12px; opacity: .7; }

/* Themen-Karten */
.tgruppe { margin-bottom: 22px; }
.gruppe-titel { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 0 10px; letter-spacing: .01em; }
.gruppe-titel span { color: var(--ink-3); font-weight: 600; }
.tkarten { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 700px) { .tkarten { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .tkarten { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tkarte {
  display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 14px 16px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); border-left: 4px solid var(--line-strong); background: var(--surface);
}
.tkarte:hover { box-shadow: var(--schatten); border-color: var(--line-strong); }
.st-rand-kritisch { border-left-color: var(--krit); }
.st-rand-handeln { border-left-color: var(--warn); }
.st-rand-laeuft { border-left-color: var(--gut); }
.tk-oben { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tk-zeit { font-size: 12px; color: var(--ink-3); }
.tk-titel { font-size: 16px; font-weight: 680; letter-spacing: -.01em; line-height: 1.3; }
.tk-stand { color: var(--ink-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tk-unten { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.tk-ball { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.tk-ball > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-zahlen { white-space: nowrap; color: var(--ink-3); }

/* Termine */
.tliste { list-style: none; margin: 0; padding: 0; }
.tz { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.tz:first-child { border-top: 0; }
.tz-datum { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 48px; border-radius: 10px; background: var(--surface-2); line-height: 1.05; }
.tz-tag { font-size: 18px; font-weight: 700; }
.tz-monat { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.tz-titel { font-weight: 580; line-height: 1.35; }
.tz-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.tz-vorbei .tz-datum { background: transparent; border: 1px solid var(--line); }
.tz-vorbei .tz-titel { color: var(--ink-2); font-weight: 520; }

/* Fahrplan */
.fp-karte { padding: 10px 6px 4px; }
.fp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fp-svg { display: block; width: 100%; min-width: 920px; height: auto; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.fp-grid { stroke: var(--line); stroke-width: 1; }
.fp-monat { font-size: 11.5px; fill: var(--ink-3); }
.fp-spur { font-size: 12.5px; font-weight: 650; fill: var(--ink-2); }
.fp-achse { stroke: var(--line-strong); stroke-width: 1; }
.fp-phase { fill: color-mix(in oklab, var(--blau) 18%, var(--surface)); }
.fp-phase-voll { fill: color-mix(in oklab, var(--blau) 45%, var(--surface)); }
.fp-m { cursor: pointer; outline: none; }
.fp-hit { fill: transparent; }
.fp-punkt { fill: var(--surface); stroke: var(--blau); stroke-width: 2; }
.fp-m.vorbei .fp-punkt { fill: var(--blau); }
.fp-m.ca .fp-punkt { fill: color-mix(in oklab, var(--blau) 22%, var(--surface)); }
.fp-m:hover .fp-punkt, .fp-m:focus .fp-punkt { stroke-width: 3; }
.fp-label { font-size: 11px; fill: var(--ink-2); }
.fp-heute { stroke: var(--akzent); stroke-width: 1.5; }
.fp-heute-t { font-size: 11px; font-weight: 700; fill: var(--akzent); }

/* Tabellen */
.tabelle-rahmen { overflow-x: auto; container: tabelle / inline-size; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th { text-align: left; font-size: 12px; font-weight: 650; color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabelle td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.tabelle tbody tr:first-child td { border-top: 0; }
.tabelle tfoot td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.zahl-r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-ueber td:first-child { box-shadow: inset 3px 0 0 var(--krit); }
.tabelle .pz-text { font-weight: 560; }
.mini-meter { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: color-mix(in oklab, var(--blau) 22%, var(--surface)); vertical-align: middle; position: relative; overflow: hidden; }
.mini-meter span { position: absolute; inset: 0 auto 0 0; background: var(--blau); border-radius: 3px; }
@container tabelle (max-width: 620px) {
  .tabelle thead { display: none; }
  .tabelle, .tabelle tbody, .tabelle tfoot, .tabelle tr, .tabelle td { display: block; width: 100%; }
  .tabelle tr { padding: 10px 0; border-top: 1px solid var(--line); }
  .tabelle tbody tr:first-child { border-top: 0; }
  .tabelle td { border: 0; padding: 3px 0; display: flex; gap: 10px; justify-content: space-between; align-items: baseline; text-align: right; }
  .tabelle td::before { content: attr(data-k); color: var(--ink-3); font-size: 12px; text-align: left; flex: none; }
  .tabelle td:not([data-k])::before { content: none; }
  .tabelle td > * { text-align: right; }
  .tabelle.zusagen td[data-k] { flex-wrap: wrap; }
  .tabelle tfoot tr { border-top: 1px solid var(--line-strong); }
  .tabelle tfoot td { justify-content: flex-end; }
  .tr-ueber td:first-child { box-shadow: none; }
}

/* Geld */
.stapel { display: flex; gap: 2px; height: 20px; margin: 4px 0 14px; }
.stapel-seg { min-width: 3px; }
.stapel-seg:first-child { border-radius: 4px 0 0 4px; }
.stapel-seg:last-child { border-radius: 0 4px 4px 0; }
.s1 { background: var(--d1); } .s2 { background: var(--d2); } .s3 { background: var(--d3); }
.legende { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.legende li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 48px; gap: 10px; align-items: center; font-size: 14px; }
.legende b { font-variant-numeric: tabular-nums; }
.legende .leise { text-align: right; font-variant-numeric: tabular-nums; }
.legende-summe { padding-top: 6px; border-top: 1px solid var(--line); }
.sw { width: 12px; height: 12px; border-radius: 3px; }
.gliste { list-style: none; margin: 0; padding: 0; }
.gz { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.gz:first-child { border-top: 0; }
.gz b { text-align: right; font-variant-numeric: tabular-nums; }
.gz > .badge, .gz > .leise { grid-column: 1 / -1; justify-self: start; font-size: 12px; }

/* Entscheidungen */
.egruppe { margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.na-karte .egruppe { background: transparent; border-style: dashed; }
.egruppe h3 { margin: 0 0 6px; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.link-titel { border: 0; background: none; padding: 0; font-weight: 680; text-align: left; color: var(--ink); }
.link-titel:hover { text-decoration: underline; }
.eliste { list-style: none; margin: 0; padding: 0; }
.ez { padding: 8px 0; border-top: 1px solid var(--line); }
.ez:first-child { border-top: 0; }
.ez p { margin: 3px 0 0; font-size: 14px; }
.ez-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; }
.ez-datum { font-weight: 650; color: var(--ink-2); }
.ez-fest p { font-weight: 520; }
.ez-ueberholt > p { color: var(--ink-3); }
.ez-durch { font-size: 13px; color: var(--ink-2) !important; }

/* Personen */
.org-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; align-items: start; }
@media (min-width: 1000px) { .org-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.org-kopf { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 0; text-align: left; }
.org-kopf > span:nth-child(2) { flex: 1; min-width: 0; }
.on { display: block; font-weight: 700; font-size: 16px; }
.oa { display: block; font-size: 12.5px; color: var(--ink-3); }
.org-text { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); }
.regeln { margin-top: 10px; font-size: 13.5px; }
.regeln summary { cursor: pointer; color: var(--akzent); font-weight: 600; font-size: 13px; }
.regeln ul, .regel-liste { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); }
.regel-liste li, .regeln li { margin: 3px 0; }
.pers-liste { list-style: none; margin: 10px 0 0; padding: 0; }
.pers { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.pers-name { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; min-width: 0; flex: 1; }
.pers-name > span:last-child { min-width: 0; }
.pn { display: block; font-weight: 620; }
.pr { display: block; font-size: 12.5px; color: var(--ink-2); }
.ps { display: block; font-size: 12px; color: var(--ink-3); }
.pers-rechts { display: flex; align-items: center; gap: 6px; flex: none; }

/* Schublade */
.drawer-hg { position: fixed; inset: 0; z-index: 40; background: rgba(15, 15, 14, .32); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(700px, 100vw); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); box-shadow: -12px 0 40px rgba(0, 0, 0, .18); animation: rein .18s ease-out;
}
@keyframes rein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
body.drawer-offen { overflow: hidden; }
.drawer:focus { outline: none; }
.dr-kopf {
  position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: calc(var(--safe-t) + 16px) calc(22px + var(--safe-r)) 14px calc(22px + var(--safe-l)); background: var(--surface); border-bottom: 1px solid var(--line);
}
.dr-kopf h2 { margin: 2px 0 0; font-size: 21px; letter-spacing: -.015em; line-height: 1.25; }
.dr-kopf p { margin: 2px 0 0; font-size: 13.5px; }
.dr-aktionen { display: flex; gap: 8px; }
.dr-person { display: flex; gap: 12px; align-items: center; }
.dr-body { padding: 16px calc(22px + var(--safe-r)) calc(40px + var(--safe-b)) calc(22px + var(--safe-l)); }
.dr-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.dr-ball { display: inline-flex; align-items: center; gap: 6px; }
.dr-sek { margin-top: 22px; }
.dr-sek > h3, .dr-sek > summary { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.dr-sek p { margin: 0 0 6px; }
.naechster { display: flex; gap: 6px; align-items: flex-start; padding: 8px 10px; border-radius: 9px; background: var(--akzent-tint); color: var(--ink); font-size: 14px; }
.naechster .ic { color: var(--akzent); margin-top: 3px; }
details.na { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px 14px; }
details.na > summary { cursor: pointer; margin: 0; list-style: none; }
details.na > summary::-webkit-details-marker { display: none; }
details.na[open] > summary { margin-bottom: 8px; }
.naliste { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.naliste li { margin: 4px 0; }
.ablage { list-style: none; margin: 0; padding: 0; }
.ablage li { margin: 4px 0; }
.ablage code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-2); word-break: break-word; }
.kontakt a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }

/* Suche & Mehr */
.suche-hg, .mehr-hg { position: fixed; inset: 0; z-index: 60; background: rgba(15, 15, 14, .36); }
.suche-hg { display: flex; justify-content: center; align-items: flex-start; padding: max(8vh, calc(var(--safe-t) + 12px)) calc(12px + var(--safe-r)) 12px calc(12px + var(--safe-l)); }
.suche-box { width: min(700px, 100%); background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden; }
.suche-feld { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.suche-feld > .ic { color: var(--ink-3); width: 18px; height: 18px; }
.suche-feld input { flex: 1; border: 0; background: none; font-size: 17px; outline: none; padding: 6px 0; min-width: 0; }
.suche-erg { max-height: min(62vh, 560px); overflow-y: auto; padding: 6px 0 10px; }
.suche-erg h3 { margin: 10px 16px 4px; font-size: 12px; color: var(--ink-3); font-weight: 700; }
.suche-erg ul { list-style: none; margin: 0; padding: 0; }
.suche-erg li button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 16px; text-align: left; }
.suche-erg li button:hover, .suche-erg li button:focus-visible { background: var(--surface-2); outline: none; }
.suche-erg li button > span:last-child { min-width: 0; }
.suche-erg small { display: block; color: var(--ink-3); font-size: 12px; }
.suche-erg .ic { color: var(--ink-3); }
.suche-tipp, .suche-erg > .leer { padding: 10px 16px; margin: 0; }
.mehr-blatt { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 18px 18px 0 0; padding: 8px calc(16px + var(--safe-r)) calc(18px + var(--safe-b)) calc(16px + var(--safe-l)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); max-height: calc(100dvh - var(--safe-t) - 12px); overflow-y: auto; overscroll-behavior: contain; }
.mehr-griff { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 10px; }
.mehr-link { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 560; }
.mehr-link.an { color: var(--akzent); }
.mehr-link .ic-r { margin-left: auto; color: var(--ink-3); }
.mehr-zeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.mehr-stand { font-size: 12px; color: var(--ink-3); margin: 12px 4px 0; }

.tooltip { position: fixed; z-index: 70; max-width: 300px; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 12.5px; pointer-events: none; box-shadow: var(--schatten); }

/* ---------- Konto (Seitenleiste, Mehr) ---------- */
.sl-konto, .mehr-konto { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.sl-konto { padding-top: 10px; border-top: 1px solid var(--line); }
.mehr-konto { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.konto-mail { display: flex; align-items: center; gap: 6px; color: var(--ink-2); overflow-wrap: anywhere; }
.konto-mail .ic { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.konto-akt { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-knopf { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.mini-knopf .ic { width: 15px; height: 15px; }
.mini-knopf:hover, .mini-knopf.an { color: var(--ink); border-color: var(--line-strong); }

/* ---------- Anmeldung, Einladung, neues Passwort ---------- */
body.zugang-modus .seitenleiste, body.zugang-modus .kopfleiste, body.zugang-modus .querleiste, body.zugang-modus .tabbar { display: none !important; }
body.zugang-modus .app { display: block; }
body.zugang-modus .main { max-width: none; padding: 0; }
.zugang { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + var(--safe-t)) calc(16px + var(--safe-r)) calc(24px + var(--safe-b)) calc(16px + var(--safe-l)); }
.zg-karte { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 22px 18px; box-shadow: var(--schatten); }
.zg-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.zg-titel { font-weight: 720; font-size: 16px; line-height: 1.2; }
.zg-sub { font-size: 12.5px; color: var(--ink-3); }
.zg-sprache { margin-left: auto; align-self: center; }
.zg-karte h1 { font-size: 22px; line-height: 1.2; margin: 0 0 14px; letter-spacing: -.01em; font-weight: 720; }
.zg-text { color: var(--ink-2); margin: 0 0 14px; font-size: 14px; }
.feld { display: block; margin-bottom: 12px; min-width: 0; }
.feld > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; font-weight: 580; }
.feld input, .feld select { width: 100%; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--page); font-size: 16px; }
.feld input:focus, .feld select:focus { outline: 2px solid color-mix(in oklab, var(--akzent) 50%, transparent); outline-offset: 1px; border-color: var(--akzent); }
.feld input[readonly] { color: var(--ink-2); background: var(--surface-2); }
.feld-hilfe { font-size: 12px; color: var(--ink-3); margin: -6px 0 12px; }
.feld-zeile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.knopf-voll { width: 100%; justify-content: center; min-height: 44px; background: var(--akzent); border-color: var(--akzent); color: var(--surface); }
.knopf-voll:hover { border-color: var(--akzent); filter: brightness(1.06); }
.knopf-voll .ic { width: 17px; height: 17px; }
.knopf:disabled { opacity: .6; cursor: progress; }
.link-knopf { display: inline-block; background: none; border: 0; color: var(--akzent); padding: 12px 0 2px; font-size: 14px; font-weight: 560; }
.zg-fehler, .zg-ok { border-radius: 10px; padding: 9px 12px; font-size: 13.5px; margin: 0 0 12px; color: var(--ink); }
.zg-fehler { background: color-mix(in oklab, var(--krit) 13%, var(--surface)); }
.zg-ok { background: color-mix(in oklab, var(--gut) 15%, var(--surface)); }
.zg-fehler[hidden], .zg-ok[hidden] { display: none; }

/* ---------- Nutzer ---------- */
.nliste { list-style: none; margin: 0; padding: 0; }
.nz { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.nz:first-child { border-top: 0; padding-top: 2px; }
.nz .av .ic { width: 18px; height: 18px; }
.nz-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nz-name { font-weight: 620; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.nz-mail { color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.nz-meta { color: var(--ink-3); font-size: 12px; }
.nz-akt { display: flex; gap: 6px; align-items: center; flex: none; }
.nz-rolle { height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); padding: 0 6px; font-size: 13px; max-width: 128px; }
.nz-meldung { margin-bottom: 10px; }
.b-rolle-super { background: var(--akzent-tint); color: var(--akzent); }
.nregeln li { margin-bottom: 6px; }
.nform .knopf-voll { margin-top: 2px; }
@media (pointer: coarse) {
  .nz-rolle { height: 40px; }
  .nz-akt .icon-btn.klein { width: 40px; height: 40px; }
  .mini-knopf { min-height: 40px; }
}
@media (max-width: 420px) {
  .feld-zeile { grid-template-columns: minmax(0, 1fr); }
  .nz { flex-wrap: wrap; row-gap: 8px; }
  .nz-text { flex: 1 1 calc(100% - 56px); }
  .nz-akt { margin-left: 52px; }
}

/* ---------- iPhone Duo & Faltgeräte (Safari 27.1: zu 382 px, auf hochkant 669 px, auf quer 951 px,
   zu quer 594–678 × 340–368, zwei Fenster je 385 px). Der Falz ist für Webseiten nur hinter Feature-Flags
   sichtbar – deshalb faltfest nach Breite: im Querformat 900–1023 px liegt die Spaltenrinne immer in der Mitte. ---------- */

/* Schmale Telefone (Duo zu 382 px, Split View 385 px) */
@media (max-width: 420px) {
  .main { padding-left: calc(12px + var(--safe-l)); padding-right: calc(12px + var(--safe-r)); }
  .karte { padding: 14px 14px; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px 12px; }
  .kpi-wert { font-size: 24px; }
  .seiten-kopf h1 { font-size: 23px; }
  .wg .pliste, .mehr-punkte { padding-left: 0; }
  .bz-kopf { flex-direction: column; align-items: flex-start; gap: 4px; }
  .bz-rest { text-align: left; }
  .bz-woche { font-size: 18px; }
}
/* Safari tönt seine Spalte rechts (Duo zu) nach festen Elementen am Seitenrand – ein Streifen in Seitenfarbe hält sie ruhig */
.rand-farbe { display: none; }
@media (max-width: 559px) {
  .rand-farbe { display: block; position: fixed; top: 0; right: 0; bottom: 0; width: 1px; background: var(--page); z-index: 45; pointer-events: none; }
}
/* Touch (alle Duo-Haltungen melden pointer: coarse): größere Ziele */
@media (pointer: coarse) {
  .chip { min-height: 28px; padding: 3px 10px; }
  .chip-p { padding-left: 4px; }
  .icon-btn { width: 40px; height: 40px; }
  .seg button { padding: 6px 10px; }
  .fchip { padding: 8px 13px; }
}

/* Querformat mit wenig Höhe: EINE Leiste oben statt Kopf + Tab-Leiste (spart ~60 px Höhe) */
.querleiste { display: none; }
@media (orientation: landscape) and (max-height: 700px) and (max-width: 1023px) {
  :root { --leiste-oben: calc(52px + var(--safe-t)); --leiste-unten: 0px; }
  .kopfleiste, .tabbar { display: none; }
  .querleiste {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px;
    position: sticky; top: 0; z-index: 30; height: calc(52px + var(--safe-t));
    padding: var(--safe-t) calc(10px + var(--safe-r)) 0 calc(10px + var(--safe-l));
    background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .ql-gruppe { display: flex; align-items: stretch; gap: 2px; min-width: 0; }
  .ql-rechts { justify-content: flex-end; }
  .ql-item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-width: 44px; padding: 3px 4px; border: 0; background: none; color: var(--ink-3); font-size: 10px; font-weight: 580;
    text-decoration: none; border-radius: 10px;
  }
  .ql-item .ic { width: 20px; height: 20px; }
  .ql-item > span:not(.nb) { white-space: nowrap; }
  .ql-item.an { color: var(--akzent); }
  .ql-item .nb { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; font-size: 10px; }
  .ql-item .nb-leise { display: none; }
  .ql-marke { display: grid; place-items: center; padding-right: 4px; }
  .mehr-nav { display: none; }
  .ql-marke .sl-logo { width: 30px; height: 30px; border-radius: 9px; }
  .main { padding-top: 12px; padding-bottom: calc(28px + var(--safe-b)); }
  .seiten-kopf { margin-top: 2px; }
  .tag-titel { top: calc(52px + var(--safe-t)); }
}

/* Duo innen quer / halb gefaltet (Buch-Haltung): zwei Hälften, Rinne genau auf dem Falz in der Mitte.
   Greift auch, wenn Safari die Segmente meldet (Feature-Flag „Viewport Segments API“). */
.falz-platzhalter { display: none; }
@media (min-width: 900px) and (max-width: 1023px), (horizontal-viewport-segments: 2) {
  .querleiste { column-gap: 40px; }
  .kpis, .raster-lage, .raster-2, .org-raster, .tkarten { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .raster-2 > .breit { grid-column: auto; }
  .spalten-2 { columns: 2; column-gap: 40px; }
  .seiten-kopf > div:first-child, .hinweis, .fchips { max-width: calc(50% - 20px); }
  /* Listen-Ansichten (Verlauf): Liste links, Details rechts – wie Liste | Detail in den Apps */
  .seite-liste > .seiten-kopf, .seite-liste > .filterzeile, .seite-liste > #vl-ergebnis { width: calc(50% - 20px); }
  .falz-platzhalter {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
    position: fixed; top: calc(var(--leiste-oben) + 24px); bottom: calc(var(--leiste-unten) + 24px);
    left: calc(50% + 20px); right: calc(16px + var(--safe-r));
    border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-3); padding: 24px;
  }
  .falz-platzhalter .ic { width: 28px; height: 28px; }
  .falz-platzhalter p { margin: 0; max-width: 260px; font-size: 14px; }
  /* Schublade (Thema/Person) rechts angedockt, linke Hälfte bleibt bedienbar */
  .drawer {
    top: var(--leiste-oben); bottom: var(--leiste-unten); left: calc(50% + 20px); right: 0; width: auto;
    border-left: 1px solid var(--line); box-shadow: none; animation: none;
  }
  .dr-kopf { padding-top: 14px; }
  .drawer-hg { display: none !important; }
  body.drawer-offen { overflow: visible; }
  /* Suche rechts neben dem Falz */
  .suche-hg { justify-content: flex-end; padding-right: calc(16px + var(--safe-r)); }
  .suche-box { width: calc(50% - 36px); }
}
/* Laptop-Haltung mit Feature-Flag: Dialoge in die obere Hälfte */
@media (vertical-viewport-segments: 2) {
  .suche-hg { padding-top: calc(var(--safe-t) + 12px); }
  .suche-erg { max-height: calc(env(viewport-segment-height 0 0, 50vh) - 120px); }
}

/* Druck */
@media print {
  .seitenleiste, .kopfleiste, .tabbar, .drawer-hg, .suche-hg, .mehr-hg, .dr-aktionen, .filterzeile, .fchips, .tooltip, .link, .neu-hinweis { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; }
  body.drawer-offen .main { display: none; }
  body.drawer-offen { overflow: visible; }
  .drawer { position: static; width: auto; box-shadow: none; overflow: visible; animation: none; }
  .dr-kopf { position: static; }
  .karte, .egruppe, .pz, .ev { break-inside: avoid; }
  details.na:not([open]) > *:not(summary) { display: block; }
}
