/* Dienos planuotojas – ruhiges, reduziertes Design.
   Ein Akzent (Grün), Rot nur für Warnungen und die "Jetzt"-Linie. Farben über CSS-Variablen. */

:root {
  --bg: #ffffff;
  --surface: #f4f4f5;
  --sheet: #ffffff;
  --text: #0b0b0c;
  --muted: #5b616b;
  --line: #e7e8eb;
  --green: #067a3c;
  --on-green: #ffffff;
  --green-soft: rgba(6, 122, 60, .10);
  --red: #c4262e;
  --scrim: rgba(0, 0, 0, .45);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #131315; --sheet: #151517; --text: #ffffff; --muted: #a2a7b0;
    --line: #27282c; --green: #1fd67f; --on-green: #00170b; --green-soft: rgba(31, 214, 127, .15);
    --red: #ff6b6b; --scrim: rgba(0, 0, 0, .7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #131315; --sheet: #151517; --text: #ffffff; --muted: #a2a7b0;
  --line: #27282c; --green: #1fd67f; --on-green: #00170b; --green-soft: rgba(31, 214, 127, .15);
  --red: #ff6b6b; --scrim: rgba(0, 0, 0, .7); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; padding: 12px 18px; background: var(--text); color: var(--bg); z-index: 200; }
.skip:focus { left: 12px; top: 12px; }
.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 20px; }

svg[viewBox] { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.fill { fill: currentColor; stroke: none; }

/* ---------- Kopfzeile ---------- */
.top-in { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 20px; }
h1 { font-size: 30px; line-height: 1.12; font-weight: 750; letter-spacing: -.025em; }
.datesub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 10px; }
.datesub p { order: -1; flex-basis: 100%; margin: 0 0 6px; }
.tbtns { display: flex; gap: 8px; flex: none; }
.round {
  width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: var(--surface); color: var(--text);
}
.round.big { width: 48px; height: 48px; }
.round svg { width: 22px; height: 22px; }
.link { background: none; border: 0; padding: 8px 4px; color: var(--green); font-weight: 650; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- Hauptbereich ---------- */
.main { padding-bottom: 230px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 14px 0; margin-bottom: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.banner span { flex: 1 1 220px; }

.pool { margin-bottom: 20px; }
.pool-head { width: 100%; display: flex; align-items: center; justify-content: space-between; background: none; border: 0; padding: 12px 0; font-size: 18px; font-weight: 650; text-align: left; }
.count { color: var(--muted); font-weight: 500; }
.chev { display: inline-grid; transition: transform .2s; }
.pool-head[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.pool-chips { display: flex; gap: 10px; overflow-x: auto; padding: 4px 20px 14px; margin: 0 -20px; scrollbar-width: none; scroll-snap-type: x proximity; }
.pool-chips::-webkit-scrollbar { display: none; }
.pool-head[aria-expanded="false"] + .pool-chips { display: none; }
.pchip {
  flex: none; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; max-width: 260px;
  padding: 10px 18px; border-radius: 18px; background: var(--surface); cursor: pointer; scroll-snap-align: start; user-select: none; -webkit-user-select: none;
}
.pchip b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip small { color: var(--muted); font-size: 16px; }
.pchip.over small { color: var(--red); }
.pchip.dragging { opacity: .35; }

.empty { text-align: center; padding: 56px 8px 24px; display: grid; justify-items: center; gap: 12px; }
.empty-mark { width: 88px; height: 88px; border-radius: 50%; background: var(--green-soft); display: grid; place-items: center; margin-bottom: 8px; }
.empty-mark::after { content: ""; width: 30px; height: 30px; border-radius: 50%; border: 4px solid var(--green); }
.empty h2 { font-size: 26px; letter-spacing: -.02em; }
.empty p { max-width: 30ch; margin-bottom: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 28px;
  border: 0; border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 650; font-size: 17px;
}
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--green); color: var(--on-green); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.big { min-height: 58px; font-size: 18px; }
.btn.grow { flex: 1; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Zeitachse ---------- */
.timeline { position: relative; margin: 8px 0 0; --gutter: 56px; }
.grid, .lanes { position: absolute; inset: 0; }
.lanes { left: var(--gutter); }
.gl { position: absolute; left: var(--gutter); right: 0; border-top: 1px solid var(--line); }
.hl { position: absolute; left: 0; width: calc(var(--gutter) - 12px); text-align: right; transform: translateY(-50%); color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; background: var(--bg); }

.block {
  position: absolute; left: 0; right: 0; display: flex; align-items: flex-start; gap: 12px; padding: 7px 8px 7px 14px;
  border-radius: 16px; background: var(--green-soft); overflow: hidden; cursor: pointer; z-index: 2;
  user-select: none; -webkit-user-select: none;
}
.block::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--green); opacity: var(--bar, 1); }
.block.p-high { --bar: 1; } .block.p-medium { --bar: .5; } .block.p-low { --bar: .22; }
.block .ck {
  flex: none; width: 34px; height: 34px; margin-top: 1px; display: inline-grid; place-items: center; padding: 0;
  border-radius: 50%; border: 2px solid var(--muted); background: transparent; color: transparent;
}
.block .ck svg { width: 18px; height: 18px; stroke-width: 3; }
.block .ck[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--on-green); }
.block .bt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; align-self: stretch; }
.block .ttl { font-weight: 650; font-size: 18px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block .meta { color: var(--muted); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block.tall .ttl { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.block.compact { align-items: center; padding-block: 0; }
.block.compact .bt { justify-content: center; }
.block.compact .ck { margin-top: 0; width: 26px; height: 26px; }
.block.compact .ck svg { width: 14px; height: 14px; }
.block.compact .meta { display: none; }
.block.is-done { background: var(--surface); }
.block.is-done .ttl { text-decoration: line-through; color: var(--muted); }
.block .fixed { align-self: center; color: var(--muted); display: inline-grid; }
.block .fixed svg { width: 18px; height: 18px; fill: currentColor; }
.block .grip { flex: none; align-self: center; width: 36px; height: 44px; display: inline-grid; place-items: center; color: var(--muted); touch-action: none; cursor: grab; }
.block .grip svg { width: 18px; height: 18px; }
.block.dragging { opacity: .35; }
.lunch {
  position: absolute; left: 0; right: 0; z-index: 1; border-radius: 16px; background: var(--surface); color: var(--muted);
  padding: 0 16px; display: flex; align-items: center; gap: 10px; font-weight: 600; overflow: hidden; cursor: pointer;
}
.drop { position: absolute; left: 0; right: 0; z-index: 3; pointer-events: none; border-radius: 16px; border: 2px dashed var(--green); background: var(--green-soft); }
.nowline { position: absolute; left: calc(var(--gutter) - 8px); right: 0; border-top: 2px solid var(--red); z-index: 5; pointer-events: none; }
.nowline::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* ---------- Drag ---------- */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; will-change: transform; box-shadow: 0 12px 32px rgba(0, 0, 0, .3); }
.drag-ghost.pchip { max-width: 260px; background: var(--sheet); }
.drag-ghost.invalid { outline: 3px solid var(--red); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
#pool.drop-target { outline: 2px dashed var(--green); outline-offset: 6px; border-radius: 12px; }

/* ---------- Untere Leiste ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; pointer-events: none;
  padding: 36px 0 calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 60%, transparent);
}
.dock button, .dock .hint { pointer-events: auto; }
.dock-in { display: grid; gap: 4px; justify-items: stretch; }
.dock-row { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.behind { justify-self: center; }
.fab {
  flex: none; width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--green); color: var(--on-green); box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.fab svg { width: 30px; height: 30px; stroke-width: 2.6; }
.hint {
  display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 8px;
  padding: 12px 8px 12px 18px; border-radius: 18px; background: var(--text); color: var(--bg);
}
.hint button { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: inherit; display: grid; place-items: center; }

/* ---------- Bottom Sheet ---------- */
dialog.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 640px; max-height: 92dvh; padding: 0; border: 0;
  border-radius: 28px 28px 0 0; background: var(--sheet); color: var(--text); overflow: hidden;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
}
dialog.sheet[open] { animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1); }
dialog.sheet.closing { animation: sheet-down .18s ease-in forwards; }
dialog.sheet::backdrop, dialog.tour::backdrop { background: var(--scrim); }
dialog.sheet[open]::backdrop { animation: fade .2s ease-out; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-scroll { max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; }
.grab-zone { padding: 12px 0 6px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-in { padding: 8px 24px calc(28px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 26px; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 6px; }
.sheet .sub { color: var(--muted); margin-bottom: 18px; }
.sheet-actions { display: grid; gap: 10px; margin-top: 24px; }

.row {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 64px; padding: 10px 0; background: none; border: 0;
  border-bottom: 1px solid var(--line); text-align: left; font-size: 18px; color: var(--text);
}
.row:last-child { border-bottom: 0; }
.row .rt { flex: 1; display: grid; }
.row .rt small { color: var(--muted); font-size: 16px; }
.row.danger { color: var(--red); }
.row svg { color: var(--muted); }
.row.danger svg { color: var(--red); }
.row.inline { cursor: default; flex-wrap: wrap; }
.row.inline > span:first-child { flex: 1 1 100px; }

.big-input { width: 100%; padding: 12px 0; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: transparent; font-size: 24px; font-weight: 600; outline: none; letter-spacing: -.01em; }
.big-input:focus { border-bottom-color: var(--green); }
.big-input::placeholder { color: var(--muted); font-weight: 500; }
.input { width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font-size: 17px; }
textarea.input { padding: 12px 16px; min-height: 88px; resize: vertical; }
.lbl { display: block; margin: 20px 0 8px; font-size: 16px; font-weight: 650; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { min-height: 52px; min-width: 70px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--surface); font-weight: 650; font-size: 17px; }
.chip[aria-checked="true"] { background: var(--green); color: var(--on-green); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); }
.seg button { flex: 1; min-height: 48px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-weight: 650; font-size: 16px; white-space: nowrap; }
.seg button[aria-checked="true"] { background: var(--text); color: var(--bg); }
.more { margin-top: 18px; }
.more summary { min-height: 48px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--green); font-weight: 650; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { margin-bottom: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-check { display: flex; align-items: center; gap: 14px; min-height: 52px; }
.field-check input { width: 24px; height: 24px; accent-color: var(--green); }

.bignum { font-size: 46px; line-height: 1.05; font-weight: 750; letter-spacing: -.03em; }
.stat { padding: 18px 0; border-bottom: 1px solid var(--line); }
.stat:last-of-type { border-bottom: 0; }
.stat .muted { display: block; margin-top: 4px; }

.step { display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.step .num { font-size: 46px; line-height: 1; font-weight: 750; color: var(--green); letter-spacing: -.03em; }
.step h3 { font-size: 20px; margin-bottom: 2px; }
.step p { color: var(--muted); }
.tips-title { margin: 28px 0 4px; font-size: 20px; font-weight: 700; }
details.tip { border-bottom: 1px solid var(--line); }
details.tip summary { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 18px; list-style: none; }
details.tip summary::-webkit-details-marker { display: none; }
details.tip summary svg { transition: transform .2s; color: var(--muted); }
details.tip[open] summary svg { transform: rotate(180deg); }
details.tip p { color: var(--muted); padding-bottom: 16px; }

/* ---------- Tour ---------- */
dialog.tour { position: fixed; inset: 0; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; padding: 0; border: 0; background: var(--bg); color: var(--text); overflow: hidden; }
dialog.tour[open] { display: flex; flex-direction: column; animation: fade .25s ease-out; }
.tour-top { display: flex; justify-content: flex-end; padding: calc(16px + env(safe-area-inset-top)) 20px 0; }
.tour-slides { flex: 1; overflow: hidden; touch-action: pan-y; }
.tour-track { display: flex; height: 100%; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.tour-slide { flex: 0 0 100%; display: grid; align-content: center; justify-items: center; gap: 16px; padding: 24px 36px; text-align: center; }
.tour-slide .big { font-size: 120px; line-height: 1; font-weight: 800; color: var(--green); letter-spacing: -.04em; }
.tour-slide h2 { font-size: 32px; letter-spacing: -.025em; line-height: 1.15; }
.tour-slide p { color: var(--muted); font-size: 19px; max-width: 28ch; }
.tour-bottom { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px calc(28px + env(safe-area-inset-bottom)); max-width: 640px; width: 100%; margin: 0 auto; }
.dots { display: flex; gap: 8px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); transition: background .2s, width .2s; }
.dots i.on { background: var(--green); width: 26px; border-radius: 5px; }
.tour-next { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--green); color: var(--on-green); display: grid; place-items: center; }
.tour-next svg { width: 28px; height: 28px; stroke-width: 2.6; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 2000; display: grid; gap: 8px; width: min(600px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 18px; background: var(--text); color: var(--bg); box-shadow: 0 8px 28px rgba(0, 0, 0, .3); animation: fade .2s ease-out; }
.toast button { background: none; border: 0; padding: 6px 0; font-weight: 700; color: inherit; text-decoration: underline; }

@media (min-width: 700px) {
  dialog.sheet { bottom: 24px; border-radius: 28px; }
  .top-in { padding-top: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Anmeldung und Konto ---------- */
body:not([data-auth="in"]) :is(.top, .main, .dock) { display: none; }
body:not([data-auth="out"]) .auth { display: none; }
.auth { min-height: 100dvh; display: flex; flex-direction: column; padding: 20px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; max-width: 440px; width: 100%; margin: 0 auto; }
.auth-card { width: 100%; max-width: 440px; margin: auto; display: grid; gap: 0; padding-bottom: 8vh; }
.auth-card .logo { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); display: grid; place-items: center; margin-bottom: 20px; }
.auth-card .logo::after { content: ""; width: 24px; height: 24px; border-radius: 50%; border: 4px solid var(--green); }
.auth-card h1 { font-size: 34px; margin-bottom: 6px; }
.auth-card .btn { margin-top: 24px; }
.input.tall { min-height: 58px; font-size: 18px; border-radius: 16px; }
.pw { position: relative; }
.pw .input { padding-right: 64px; }
.pw .round { position: absolute; right: 8px; top: 9px; background: transparent; }
.error { color: var(--red); margin-top: 14px; font-weight: 600; }
.acct { display: flex; align-items: center; gap: 14px; padding: 14px 0 18px; border-bottom: 1px solid var(--line); }
.acct small { display: block; color: var(--muted); font-size: 16px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); flex: none; }
.dot[data-s="saving"] { background: var(--muted); animation: pulse 1s ease-in-out infinite; }
.dot[data-s="offline"] { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }
.round { position: relative; }
.round.off::after { content: ""; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
