/* Skopos – Gestaltung. Farben als Variablen, hell und dunkel. */
:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --raised: #ffffff;
  --ink: #22201c;
  --muted: #77716a;
  --line: #e4ded2;
  --accent: #2f6f5e;
  --accent-ink: #ffffff;
  --accent-soft: #e3efe9;
  --warn: #b3402e;
  --shadow: 0 1px 2px rgb(40 30 10 / 6%), 0 8px 24px rgb(40 30 10 / 6%);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171614; --surface: #201f1c; --raised: #292724; --ink: #ece8df; --muted: #9a948a;
    --line: #35322d; --accent: #74c2ab; --accent-ink: #10201b; --accent-soft: #24332e; --warn: #e2806f;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171614; --surface: #201f1c; --raised: #292724; --ink: #ece8df; --muted: #9a948a;
  --line: #35322d; --accent: #74c2ab; --accent-ink: #10201b; --accent-soft: #24332e; --warn: #e2806f;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

/* Dunkle Farbschemata zur Auswahl. .scheme zeigt dieselben Farben als Vorschau. */
:root[data-theme="nacht"], .scheme[data-theme="nacht"] {
  --bg: #0b0e14; --surface: #131824; --raised: #1c2333; --ink: #f3f5f9; --muted: #9aa5b8;
  --line: #2a3447; --accent: #ffb84d; --accent-ink: #1f1502; --accent-soft: #33270d; --warn: #ff7a6b;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 40%);
  color-scheme: dark;
}
:root[data-theme="tinte"], .scheme[data-theme="tinte"] {
  --bg: #000000; --surface: #0e0e12; --raised: #18181e; --ink: #ffffff; --muted: #a3a3af;
  --line: #2c2c36; --accent: #a995ff; --accent-ink: #120a33; --accent-soft: #231c42; --warn: #ff6b6b;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 40%);
  color-scheme: dark;
}
:root[data-theme="tanne"], .scheme[data-theme="tanne"] {
  --bg: #09110d; --surface: #101b15; --raised: #18271e; --ink: #eff6f0; --muted: #96ab9d;
  --line: #27392e; --accent: #b8ee45; --accent-ink: #152104; --accent-soft: #25340f; --warn: #ff8a70;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 40%);
  color-scheme: dark;
}
:root[data-theme="glut"], .scheme[data-theme="glut"] {
  --bg: #120f0f; --surface: #1c1717; --raised: #272020; --ink: #f8f2ef; --muted: #b0a19c;
  --line: #3b3030; --accent: #ff7a52; --accent-ink: #260b03; --accent-soft: #3b1c13; --warn: #ff5c8a;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 40%);
  color-scheme: dark;
}
:root[data-theme="ozean"], .scheme[data-theme="ozean"] {
  --bg: #06101b; --surface: #0c1a2a; --raised: #14263b; --ink: #eaf4ff; --muted: #90a8c1;
  --line: #20364e; --accent: #3dd6f5; --accent-ink: #03222b; --accent-soft: #0f3442; --warn: #ff8272;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 40%);
  color-scheme: dark;
}
.scheme[data-theme="dark"] {
  --bg: #171614; --surface: #201f1c; --ink: #ece8df; --muted: #9a948a; --line: #35322d; --accent: #74c2ab;
}
.schemees { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.scheme {
  display: grid; gap: 8px; padding: 10px; text-align: left; cursor: pointer; font: inherit;
  background: var(--bg); color: var(--ink); border: 2px solid var(--line); border-radius: 12px;
}
.scheme.on { border-color: var(--accent); }
.scheme:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scheme-card { display: flex; align-items: center; gap: 6px; padding: 7px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.scheme-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex: none; }
.scheme-bar { height: 5px; flex: 1; border-radius: 3px; background: var(--muted); }
.scheme-name { font-weight: 600; font-size: .9rem; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
h1, h2, h3, p { margin: 0; }
h1 { font: 600 28px/1.15 var(--serif); letter-spacing: -0.01em; }
h2 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
h3 { font-size: 15px; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; }
.sub { color: var(--muted); font-size: 13.5px; }
.num, .task-time, .clock, .big b, .when, dd { font-variant-numeric: tabular-nums; }
kbd {
  font: 11px var(--sans); padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px;
  color: var(--muted); background: var(--surface); margin-left: 6px;
}

/* ---- Rahmen */
#app { display: grid; grid-template-columns: 216px 1fr; height: 100dvh; }
.nav {
  display: flex; flex-direction: column; gap: 18px; padding: 18px 12px;
  border-right: 1px solid var(--line); background: var(--surface); min-height: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font: 600 19px var(--serif); }
.brand-mark { display: block; flex: none; border-radius: 27%; background: var(--raised); color: var(--ink); border: 1px solid var(--line); }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-dot { fill: var(--accent); }
.nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--muted); font-weight: 500;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.on { background: var(--accent-soft); color: var(--accent); }
.nav-item.live .icon { color: var(--warn); animation: pulse 1.6s ease-in-out infinite; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.mini-timer {
  display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
}
.mini-timer b { font-size: 19px; font-variant-numeric: tabular-nums; }
.mini-timer span { font-size: 12.5px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 2px 8px; }
.sync .dot { background: var(--muted); }
.sync.ok .dot { background: #5aa469; }
.sync.bad .dot { background: var(--warn); }
.sync.wait .dot { background: #d99a2b; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.main { overflow: auto; min-width: 0; -webkit-overflow-scrolling: touch; }
.page { max-width: 760px; margin: 0 auto; padding: 34px 28px 80px; display: flex; flex-direction: column; gap: 24px; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub { margin-top: 4px; }
section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }

/* ---- Schaltflächen und Felder */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--raised); font-weight: 500; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary kbd { background: transparent; border-color: currentColor; color: inherit; opacity: 0.75; }
.btn.danger { color: var(--warn); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.icon-btn { padding: 8px; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
[hidden] { display: none !important; }
input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
input:not([type="file"], [type="range"], [type="checkbox"]), select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--raised); min-width: 0;
}
textarea { resize: vertical; }
select { width: auto; max-width: 100%; }
label.inline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
label.inline input { width: 110px; }
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.week-nav { display: flex; gap: 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.error { color: var(--warn); font-size: 13.5px; min-height: 1.2em; }

/* ---- Aufgaben */
.add-row { display: flex; gap: 10px; }
.add-row .quick-add { flex: 1; }
.add-row select { max-width: 38%; }
.quick-add input { background: var(--surface); }
.list { display: flex; flex-direction: column; gap: 6px; min-height: 8px; }
.task {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line); position: relative;
}
.task.running { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.task.dragging { opacity: 0.4; }
.task.ghost {
  position: fixed; z-index: 50; margin: 0; pointer-events: none; opacity: 0.96;
  box-shadow: var(--shadow); border-color: var(--accent); transform: scale(1.03) rotate(-1deg);
}
@media (pointer: coarse) {
  .task { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}
.task.drop-before::before {
  content: ""; position: absolute; left: 4px; right: 4px; top: -5px; height: 3px; border-radius: 2px; background: var(--accent);
}
.list.drop-active { outline: 2px dashed var(--line); outline-offset: 3px; border-radius: 12px; }
.check {
  flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.8px solid var(--muted);
  display: grid; place-items: center; transition: background 0.15s, border-color 0.15s;
}
.check:hover { border-color: var(--accent); }
.check[aria-checked="true"] { background: var(--accent); border-color: var(--accent); animation: pop 0.25s ease-out; }
.check[aria-checked="true"]::after {
  content: ""; width: 9px; height: 5px; border: solid var(--accent-ink); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px);
}
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.task-title { overflow-wrap: break-word; hyphens: auto; min-width: 0; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); flex-wrap: wrap; }
.task-meta:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.chip.warn { color: var(--warn); }
.task-time { color: var(--muted); font-size: 13px; }
.play {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted);
  border: 1px solid var(--line); background: var(--raised);
}
.play:hover { color: var(--accent); border-color: var(--accent); }
.task.running .play { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.hint {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: 12px; background: var(--accent-soft);
}
.hint p { flex: 1; min-width: 220px; }

/* ---- Wochenfortschritt */
.week-badge { display: flex; flex-direction: column; gap: 5px; min-width: 190px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.big { color: var(--muted); }
.big b { font: 600 22px var(--serif); color: var(--ink); }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; flex: 1; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.3s; }

/* ---- Sonstiges */
.todos { gap: 8px; }
.page.wide > .todos { max-width: 640px; }
.task.todo { padding-top: 6px; padding-bottom: 6px; }
.task.todo .play { opacity: 0.55; }
.task.todo .play:hover { opacity: 1; }
.todos .quick-add input { border-style: dashed; background: transparent; }

/* ---- Filter, Rückfragen, Kalender-Häkchen */
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); max-width: 100%; }
.filter-chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.unsaved { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 13.5px; }
.unsaved span { flex: 1; }
.confirm { display: flex; flex-direction: column; gap: 10px; }
.cal-done {
  position: absolute; z-index: 3; width: 15px; height: 15px; margin-top: -7px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; font-size: 10px; line-height: 1; font-weight: 700; cursor: pointer;
  background: var(--c, var(--accent)); color: #fff; border: 1.5px solid var(--surface);
}
.cal-done:hover, .cal-done:focus-visible { transform: scale(1.25); z-index: 4; }

/* ---- Tour */
.tour { position: fixed; inset: 0; z-index: 100; }
.tour-hole {
  position: fixed; border-radius: 12px; box-shadow: 0 0 0 200vmax rgb(0 0 0 / 58%); outline: 2px solid var(--accent);
  transition: left .25s, top .25s, width .25s, height .25s; pointer-events: none;
}
.tour-card {
  position: fixed; width: min(380px, calc(100vw - 16px)); padding: 18px 18px 14px; border-radius: 14px;
  background: var(--raised); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 9px; transition: left .25s, top .25s;
}
.tour-card h2 { font: 600 19px var(--serif); text-transform: none; letter-spacing: 0; color: var(--ink); }
.tour-card p { font-size: 14.5px; line-height: 1.45; }
.tour-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.tour-foot .link { color: var(--muted); font-size: 13px; }
.tour-count { display: flex; gap: 4px; }
.tour-count i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.tour-count i.on { background: var(--accent); }
@media (max-width: 420px) { .tour-count { display: none; } }

/* ---- Ideen */
.idea { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.idea .task-main { flex: 1; min-width: 0; }
.idea-notes { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.idea-add > input:first-child { flex: 1; background: var(--surface); }
.idea-add > input[list] { width: 30%; min-width: 110px; background: var(--surface); }
.idea-group > summary { display: flex; align-items: center; gap: 10px; min-height: 32px; cursor: pointer; list-style: none; margin-bottom: 6px; }
.idea-group > summary::-webkit-details-marker { display: none; }
.idea-group > summary::before { content: '▸'; color: var(--muted); font-size: 12px; width: 10px; }
.idea-group[open] > summary::before { content: '▾'; }
.idea-group .count { color: var(--muted); font-size: 12.5px; }
.idea-group summary .link { font-size: 12.5px; color: var(--muted); }
.suggest {
  position: fixed; z-index: 60; display: flex; flex-direction: column; padding: 5px; border-radius: 11px;
  background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow); max-width: calc(100vw - 16px);
}
.suggest-head { display: flex; align-items: center; gap: 6px; padding: 4px 8px 5px; font-size: 11.5px; color: var(--muted); }
.suggest button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 9px; border-radius: 7px; text-align: left; font-size: 14px; }
.suggest button > span:first-child { overflow-wrap: anywhere; }
.suggest button:hover, .suggest button.on { background: var(--accent-soft); }

/* ---- Woche */
.week-grid { display: grid; grid-template-columns: repeat(8, minmax(170px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.day { gap: 8px; padding: 10px; border-radius: 13px; background: color-mix(in srgb, var(--surface) 60%, transparent); border: 1px solid var(--line); min-height: 220px; }
.day.is-today { border-color: var(--accent); background: var(--surface); }
.day.is-past { opacity: 0.75; }
.day > header { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 13.5px; padding: 0 2px; }
.day.is-today .day-name { color: var(--accent); }
.day-time { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.day .list { flex: 1; min-height: 40px; }
.day .task { padding: 7px 8px; gap: 8px; align-items: flex-start; font-size: 14px; }
.day .task .check { margin-top: 1px; width: 17px; height: 17px; }
.day .task .play { width: 24px; height: 24px; }
.day .task .task-time { display: none; }
.day .quick-add input { border-style: dashed; background: transparent; padding: 6px 9px; font-size: 13.5px; }

/* ---- Fokus */
.page.focus { align-items: center; text-align: center; padding-top: 9vh; gap: 16px; }
.focus-title { font-size: 34px; max-width: 18em; }
.clock { font: 300 clamp(64px, 16vw, 132px)/1 var(--sans); letter-spacing: -0.03em; margin: 10px 0; }
.focus-actions { display: flex; gap: 12px; margin: 8px 0 18px; }
.focus-actions .btn { padding: 11px 20px; }
.notes { max-width: 520px; text-align: left; background: var(--surface); }

/* ---- Rückblick */
.stats { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); }
.stat.main .big b { font-size: 30px; }
.goal-bars { display: flex; flex-direction: column; gap: 9px; }
.goal-bar { display: grid; grid-template-columns: minmax(90px, 30%) 1fr 52px; align-items: center; gap: 12px; }
.goal-bar .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-bar .bar { height: 10px; border-radius: 5px; }
.goal-bar .bar-fill { border-radius: 5px; }
.goal-bar .num, .entry .num { text-align: right; }
.day-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 170px; }
.day-bar { display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 0; min-width: 0; }
.day-bar .num { font-size: 12px; color: var(--muted); height: 16px; }
.day-bar .name { font-size: 12.5px; color: var(--muted); }
.bar-area { flex: 1; min-height: 0; width: 100%; position: relative; display: flex; align-items: flex-end; justify-content: center; }
.stack { width: min(100%, 44px); min-height: 2px; display: flex; flex-direction: column-reverse; border-radius: 6px; overflow: hidden; background: var(--line); }
.target-line { position: absolute; left: -5px; right: -5px; border-top: 2px dashed var(--muted); opacity: 0.7; pointer-events: none; }
.legend { display: inline-flex; align-items: center; gap: 8px; }
.legend .target-line { position: static; width: 22px; display: inline-block; }
.day-bars.weeks { grid-template-columns: repeat(12, 1fr); height: 210px; }
.day-bars.weeks .day-bar { border-radius: 8px; padding: 2px 0; }
.day-bars.weeks .day-bar:hover { background: var(--surface); }
.day-bars.weeks .day-bar.current .name { color: var(--accent); font-weight: 600; }
.day-bars.weeks .num { font-size: 11px; }
.day-bars.weeks .name { white-space: nowrap; }
.notes.full { max-width: none; width: 100%; }
.reached { display: flex; align-items: center; gap: 10px; }
.reached .segmented button { padding: 3px 12px; font-size: 13px; }
.page > .segmented { align-self: flex-start; }
.day-notes { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.day-notes h3 { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.day-notes p { white-space: pre-wrap; }

/* ---- Kalender */
.cal { display: flex; flex-direction: column; gap: 10px; }
.cal-scroll { overflow: auto; height: calc(100dvh - 250px); min-height: 320px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.cal-head, .cal-body { display: grid; grid-template-columns: 46px repeat(7, minmax(108px, 1fr)); min-width: 802px; }
.cal-head { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-head > div { padding: 8px 8px; display: flex; flex-direction: column; border-left: 1px solid var(--line); font-size: 13px; }
.cal-head > span { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.cal-head small { color: var(--muted); min-height: 1.3em; font-variant-numeric: tabular-nums; }
.cal-head .is-today b { color: var(--accent); }
.cal-body { position: relative; user-select: none; -webkit-user-select: none; }
.cal-hours { position: sticky; left: 0; z-index: 3; background: var(--surface); }
.cal-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-col {
  position: relative; border-left: 1px solid var(--line); cursor: cell;
  background: repeating-linear-gradient(to bottom, transparent 0 43px, var(--line) 43px 44px);
}
.cal-col.is-today { background-color: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.cal-block {
  position: absolute; z-index: 1; overflow: hidden; padding: 2px 6px; border-radius: 6px; cursor: pointer;
  display: flex; flex-direction: column; font-size: 12px; line-height: 1.25; text-align: left;
  background: color-mix(in srgb, var(--c, var(--accent)) 24%, var(--raised)); border-left: 3px solid var(--c, var(--accent));
}
.cal-block > * { flex: none; }
.cal-block.short { flex-direction: row; gap: 6px; align-items: center; padding-top: 0; padding-bottom: 0; }
.cal-block.short b { flex: 0 1 auto; min-width: 0; }
.cal-block b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-block small { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-block:hover, .cal-block.moving { box-shadow: var(--shadow); z-index: 2; }
.cal-block.moving { opacity: 0.85; cursor: grabbing; }
.cal-block.running { border-bottom: 2px dashed var(--c, var(--accent)); }
.cal-block.overlap { outline: 1px solid var(--warn); }
.cal-block.new { background: var(--accent-soft); border-left-color: var(--accent); pointer-events: none; color: var(--accent); font-variant-numeric: tabular-nums; }
.cal-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; }
.cal-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--warn); z-index: 2; pointer-events: none; }

/* ---- Meilensteine */
.ms-list { display: flex; flex-direction: column; gap: 8px; }
.ms { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); }
.ms:hover { border-color: var(--muted); }
.ms.planned { border-style: dashed; }
.ms-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ms-body h3 { font: 600 17px var(--serif); overflow-wrap: break-word; }
.ms p { color: var(--muted); font-size: 13.5px; white-space: pre-wrap; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.impact {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font: 600 16px var(--serif); font-variant-numeric: tabular-nums; color: var(--ink);
}
.impact.high { color: var(--accent-ink); }
.impact-input { display: flex; align-items: center; gap: 12px; }
.impact-input output { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ms-toggle { display: flex; align-items: center; gap: 16px; min-height: 36px; flex-wrap: wrap; }
.ms-toggle .impact-input { flex: 1; min-width: 180px; }
.check-label { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }

/* ---- Hinweis mit Rückgängig */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; gap: 16px; align-items: center;
  padding: 10px 16px; border-radius: 11px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); max-width: calc(100vw - 24px);
  animation: rise 0.18s ease-out;
}
.toast .link { color: inherit; font-weight: 600; white-space: nowrap; }
@keyframes rise { from { transform: translate(-50%, 10px); } }
.stack i { display: block; flex-basis: 0; }
.entry-day { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.entry-day h3 { font-size: 13.5px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.entry { display: grid; grid-template-columns: 104px 1fr 52px; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); }
.entry:hover { border-color: var(--muted); }
.entry .when { color: var(--muted); font-size: 13.5px; }
.entry .what { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }

/* ---- Ziele */
.goal-list { display: flex; flex-direction: column; gap: 10px; }
.goal-card { display: flex; align-items: stretch; gap: 14px; padding: 14px 16px 14px 0; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.goal-card:hover { border-color: var(--muted); }
.stripe { width: 6px; flex: none; border-radius: 0 3px 3px 0; }
.goal-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.goal-body h3 { font: 600 18px var(--serif); }
.goal-body p { color: var(--muted); font-size: 13.5px; }
.goal-card dl { display: flex; gap: 18px; margin: 0; align-items: center; }
.goal-card dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.goal-card dd { margin: 0; font-weight: 600; }
.archive summary { cursor: pointer; color: var(--muted); padding: 6px 0 12px; }

/* ---- Einstellungen */
.card { padding: 16px 18px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); gap: 12px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; align-self: flex-start; background: var(--bg); }
.segmented button { padding: 6px 14px; border-radius: 7px; color: var(--muted); }
.segmented button.on { background: var(--raised); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 12%); }
.keys { margin: 0; display: grid; gap: 8px; }
.keys > div { display: flex; gap: 14px; align-items: center; }
.keys dt { width: 120px; }
.keys kbd { margin: 0; font-size: 12px; }
.keys dd { margin: 0; }

/* ---- Dialoge */
.dlg {
  border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(520px, calc(100vw - 24px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.dlg::backdrop { background: rgb(20 18 14 / 45%); }
.dlg > h2 { font: 600 20px var(--serif); text-transform: none; letter-spacing: 0; color: var(--ink); margin-bottom: 16px; }
.dlg form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--muted); }
.field select { width: 100%; }
.cols { display: flex; gap: 12px; }
.dlg-actions { display: flex; gap: 10px; margin-top: 6px; align-items: center; }
.spacer { flex: 1; }
.swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; }
.swatches button.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.palette { padding: 0; margin-top: 12vh; overflow: hidden; }
.palette > h2 { display: none; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { border: 0; background: transparent; padding: 4px 0; outline: none; color: var(--ink); font-size: 16px; }
.palette-list { max-height: 46vh; overflow: auto; padding: 6px; display: flex; flex-direction: column; }
.palette-list button { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 8px; }
.palette-list button.on { background: var(--accent-soft); }
.palette-list small { color: var(--muted); white-space: nowrap; }

/* ---- Anmeldung */
.login { grid-column: 1 / -1; display: grid; place-items: center; padding: 24px; }
.login form { width: min(340px, 100%); display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.login img { margin: 0 auto 4px; border-radius: 14px; }
.login .sub { margin-bottom: 10px; }

@keyframes pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- Schmale Bildschirme: Navigation unten */
@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .nav { order: 2; flex-direction: row; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); gap: 0; }
  .brand, .nav-foot .palette-btn, .nav-foot .sync span, .mini-timer span { display: none; }
  .nav-items { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav-item { flex-direction: column; gap: 2px; font-size: 0; padding: 6px 4px; flex: 1; min-width: 0; }
  .nav-item span::after { content: attr(data-short); font-size: 10.5px; }
  .nav-foot { position: fixed; top: calc(8px + env(safe-area-inset-top)); right: 10px; margin: 0; flex-direction: row; align-items: center; z-index: 5; }
  .mini-timer { padding: 4px 10px; border-radius: 999px; }
  .mini-timer b { font-size: 13px; }
  .page { padding: 22px 16px 40px; gap: 20px; }
  .page-head { padding-right: 20px; }
  h1 { font-size: 25px; }
  .week-badge { width: 100%; }
  .add-row { flex-direction: column; }
  .add-row select { max-width: none; width: 100%; }
  .week-grid { grid-template-columns: 1fr; overflow: visible; }
  .day { min-height: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat.main { grid-column: 1 / -1; }
  .goal-card { flex-direction: column; padding: 14px 16px; gap: 10px; }
  .stripe { width: 44px; height: 5px; border-radius: 3px; }
  .cols { flex-direction: column; }
  .entry { grid-template-columns: 92px 1fr 44px; padding: 8px 10px; }
  input:not([type="file"], [type="range"], [type="checkbox"]), select, textarea { font-size: 16px; }
  .cal-scroll { height: calc(100dvh - 300px); }
  .day-bars.weeks { gap: 4px; }
  .day-bars.weeks .num { display: none; }
  .day-bars.weeks .name { font-size: 9.5px; }
  .ms p { -webkit-line-clamp: 3; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toolbar { width: 100%; justify-content: space-between; }
}
