/* Optik aus der Demo: eine helle Handy-App, am Rechner als Gerät in der Mitte. */
@font-face {
  font-family: 'Manrope';
  src: url('/static/vendor/manrope-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --page: #E6E9E3; --bg: #F4F5F2; --surface: #FFFFFF;
  --line: #E1E4DF; --line-2: #D5DAD3; --line-3: #EEF0EC;
  --ink: #1C2321; --muted: #5B6662;
  --accent: #1F5F5B; --accent-soft: #DCE8E6; --accent-ink: #163F3C; --on-accent: #FFFFFF;
  --ok: #245C36; --ok-soft: #E3F0E7;
  --warn: #934012; --warn-soft: #FCEBDD; --warn-ink: #6E300D;
  --bad: #8E2B2B; --bad-soft: #F6E3E3; --bad-ink: #6E2020;
  --dark: #1C2321; --mint: #9FD6B1; --bubble: #EEF3F1; --seg: #E6E9E4;
  --scrim: rgba(28, 35, 33, 0.45);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
html, body { height: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
#root { height: 100%; }
button, input, select, textarea { font-family: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.phone { position: relative; width: 100%; max-width: 440px; height: 100%; height: 100dvh; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 640px) and (min-height: 760px) {
  .phone { width: 390px; height: min(844px, calc(100% - 48px)); margin-top: 24px; border-radius: 30px; border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(28, 35, 33, 0.18); }
}
.top { padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 12px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand-name { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.15; text-wrap: balance; }
.sub { font-size: 14px; color: var(--muted); }
main { flex: 1; overflow-y: auto; padding: 16px 16px 24px 16px; }
.nav { display: grid; gap: 2px; padding: 8px 6px calc(10px + env(safe-area-inset-bottom, 0px)) 6px; background: var(--surface); border-top: 1px solid var(--line); }
.nav button { min-height: 56px; border: none; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 700; background: transparent; color: var(--muted); padding: 0 2px; }
.nav button.on { background: var(--accent-soft); color: var(--accent); }

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.g2 { gap: 2px; } .g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g14 { gap: 14px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; } .xs { font-size: 12px; } .lh { line-height: 1.45; }
.b7 { font-weight: 700; } .b8 { font-weight: 800; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.tight { padding: 14px; }
.card.accent { border: 2px solid var(--accent); }
.h2 { margin: 0; font-size: 16px; font-weight: 800; }
.lbl { font-size: 13px; font-weight: 700; color: var(--muted); }
.inp { height: 48px; border-radius: 12px; border: 1px solid var(--line-2); padding: 0 14px; font-size: 16px; color: var(--ink); background: var(--surface); width: 100%; box-sizing: border-box; }
.inp.sm { height: 44px; font-size: 15px; padding: 0 12px; }
textarea.inp { height: auto; min-height: 76px; padding: 10px 14px; line-height: 1.45; resize: vertical; }
.line { border-bottom: 1px solid var(--line-3); }
.soft { background: var(--bg); border-radius: 12px; padding: 12px; }

.btn { min-height: 44px; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.sm { min-height: 36px; font-size: 13px; padding: 0 12px; border-radius: 10px; }
.btn.xs { min-height: 36px; font-size: 12px; padding: 0 10px; border-radius: 10px; gap: 5px; }
.btn.big { min-height: 52px; border-radius: 14px; font-size: 15px; font-weight: 800; }
.btn-p { background: var(--accent); color: var(--on-accent); }
.btn-o { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-oa { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-ok { background: var(--ok); color: var(--on-accent); }
.btn-oko { background: var(--surface); color: var(--ok); border-color: var(--ok); }
.btn-bad { background: var(--bad); color: var(--on-accent); }
.btn-bads { background: var(--bad-soft); color: var(--bad); }
.btn-badso { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.ibtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex-shrink: 0; }
.ibtn.sm { width: 36px; height: 36px; border-radius: 10px; }
.ibtn.bad { background: var(--bad-soft); color: var(--bad); border: none; }
.step { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 18px; font-weight: 700; cursor: pointer; flex-shrink: 0; }

.pill { min-height: 40px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.pill.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.seg { display: grid; gap: 4px; background: var(--seg); padding: 4px; border-radius: 14px; }
.seg button { min-height: 40px; border: none; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 700; background: transparent; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; }
.c-ok { background: var(--ok-soft); color: var(--ok); }
.c-warn { background: var(--warn-soft); color: var(--warn); }
.c-bad { background: var(--bad-soft); color: var(--bad); }
.c-acc { background: var(--accent-soft); color: var(--accent); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.bubble { background: var(--bubble); border-radius: 14px 14px 14px 4px; padding: 12px; font-size: 14px; line-height: 1.5; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-n { font-size: 24px; font-weight: 800; }
.stat-l { font-size: 12px; font-weight: 600; color: var(--muted); }
.listbtn { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; color: var(--ink); min-height: 64px; width: 100%; }
.day { min-height: 72px; border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.day.today { border: 2px solid var(--accent); }
.day.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.mcell { height: 46px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line-3); }
.mcell.today { border: 2px solid var(--accent); }
.mcell.closed { background: var(--bg); color: var(--muted); border-color: var(--bg); }
.mcell.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.dot { font-size: 10px; font-weight: 800; min-width: 16px; height: 16px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 4px; box-sizing: border-box; background: var(--accent); color: var(--on-accent); }
.mcell.on .dot { background: var(--surface); color: var(--accent); }
.ytile { min-height: 84px; border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 10px 12px; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.ytile.now { border: 2px solid var(--accent); }
.bar { display: block; height: 6px; border-radius: 999px; }
.warnbox { background: var(--warn-soft); border-radius: 14px; padding: 14px; display: flex; gap: 10px; align-items: flex-start; color: var(--warn-ink); font-size: 14px; line-height: 1.45; }
.errbox { background: var(--bad-soft); color: var(--bad-ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.4; }

.scrim { position: absolute; inset: 0; background: var(--scrim); display: flex; flex-direction: column; justify-content: flex-end; z-index: 5; }
.sheet { background: var(--surface); border-radius: 22px 22px 0 0; padding: 0 18px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100% - 48px); overflow-y: auto; box-sizing: border-box; }
/* Inhalt nicht zusammendrücken, wenn das Fenster voll ist (sonst werden Eingabefelder flach) */
.sheet > * { flex-shrink: 0; }
.sheet > :last-child:not(.sheet-foot) { margin-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
/* Speichern/Abbrechen bleiben unten sichtbar, auch wenn die Browserleiste Platz wegnimmt */
.sheet-foot { position: sticky; bottom: 0; z-index: 2; background: var(--surface); margin: 4px -18px 0; padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-3); }
.sheet-foot .btn { min-height: 48px; }
/* Überschrift und Schließen-Knopf bleiben beim Scrollen sichtbar */
.sheet-head { position: sticky; top: 0; z-index: 2; background: var(--surface); margin: 0 -18px; padding: 10px 18px 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line-3); border-radius: 22px 22px 0 0; }
.grab { width: 44px; height: 5px; border-radius: 999px; background: var(--line-2); align-self: center; }
.section { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.toast { position: absolute; z-index: 10; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); background: var(--dark); color: var(--on-accent); border-radius: 14px; padding: 12px 12px 12px 16px; font-size: 14px; font-weight: 600; line-height: 1.4; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); display: flex; align-items: center; gap: 10px; }
.toast button { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--mint); background: transparent; color: var(--mint); font-size: 13px; font-weight: 800; cursor: pointer; flex-shrink: 0; }
.auth { flex: 1; overflow-y: auto; padding: calc(40px + env(safe-area-inset-top, 0px)) 22px 28px 22px; display: flex; flex-direction: column; gap: 14px; }
.wtitle { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.1; text-wrap: balance; }
.loading { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 15px; padding: 0 24px; text-align: center; }
.suggest { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.suggest button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px 12px; min-height: 44px; border: none; border-bottom: 1px solid var(--line-3); background: var(--surface); cursor: pointer; text-align: left; color: var(--ink); font-size: 14px; }
.suggest button:last-child { border-bottom: none; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: rise 0.18s ease-out; }
  .sheet { animation: slide 0.22s ease-out; }
  @keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes slide { from { transform: translateY(40px); } to { transform: none; } }
}
