/* Alle Farbwerte und Paletten stehen ausschließlich in diesem Abschnitt. */
:root {
  --bg:#f3f4f9; --surface:#ffffff; --text:#1c2333; --muted:#616b7c;
  --line:#dfe3ec; --accent:#514cc4; --accent-text:#ffffff;
  --danger:#a72537; --danger-bg:#fff0f1; --overlay:#11182799;
  --shadow:#1720391a; --today:#e9e8ff; --focus:#3933a3;
  --c1:#e5534b; --c2:#f0703c; --c3:#f59e0b; --c4:#e8b931;
  --c5:#9bc53d; --c6:#34a853; --c7:#10a37f; --c8:#0e9aa7;
  --c9:#22b8cf; --c10:#3b9ee6; --c11:#2f6fde; --c12:#5856d6;
  --c13:#8e5cd9; --c14:#b55fc9; --c15:#d9508a; --c16:#64748b;
}
:root[data-palette="pastell"] {
  --c1:#edaaa5; --c2:#f2b89e; --c3:#f2c68c; --c4:#e8d48c;
  --c5:#c4d994; --c6:#9ed6a8; --c7:#91d4bf; --c8:#94cfd1;
  --c9:#98d9e1; --c10:#a5cdea; --c11:#a6bdec; --c12:#b6b2e6;
  --c13:#cab3e8; --c14:#dcb7e2; --c15:#e9afc8; --c16:#b9c4d0;
}
:root[data-palette="gedeckt"] {
  --c1:#a85c58; --c2:#b97859; --c3:#b58b4e; --c4:#a69a52;
  --c5:#829b5d; --c6:#5b916d; --c7:#528e7d; --c8:#52878c;
  --c9:#5f929c; --c10:#638da8; --c11:#587ba5; --c12:#6d6f9d;
  --c13:#826d9c; --c14:#9a709a; --c15:#a46f81; --c16:#71808b;
}
:root[data-palette="kontrast"] {
  --c1:#d02c36; --c2:#bf4e16; --c3:#b57100; --c4:#8a7900;
  --c5:#668800; --c6:#008144; --c7:#007b68; --c8:#00737d;
  --c9:#0087a1; --c10:#0075bd; --c11:#164fc2; --c12:#4535bc;
  --c13:#713ab6; --c14:#9a319d; --c15:#bd246c; --c16:#4f6074;
}
:root[data-theme="dark"] {
  --bg:#11141c; --surface:#202530; --text:#f4f6fa; --muted:#b4bdcc;
  --line:#3b4352; --accent:#a9a5ff; --accent-text:#17152e;
  --danger:#ff9da8; --danger-bg:#47242b; --overlay:#000000b3;
  --shadow:#00000055; --today:#38345b; --focus:#c8c5ff;
}
@media (prefers-color-scheme:dark) {
  :root[data-theme="system"] {
    --bg:#11141c; --surface:#202530; --text:#f4f6fa; --muted:#b4bdcc;
    --line:#3b4352; --accent:#a9a5ff; --accent-text:#17152e;
    --danger:#ff9da8; --danger-bg:#47242b; --overlay:#000000b3;
    --shadow:#00000055; --today:#38345b; --focus:#c8c5ff;
  }
}
/* Ab hier werden ausschließlich die oben definierten Farbvariablen verwendet. */
* { box-sizing:border-box; }
html { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; background:var(--bg); color:var(--text); }
body { margin:0; }
[hidden] { display:none !important; }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:3px solid var(--focus); outline-offset:2px; }
h1,h2,h3,p { margin:0 0 .65rem; }
h1 { font-size:1.75rem; letter-spacing:-.04em; }
h2 { font-size:1.2rem; }
h3 { font-size:1rem; }
p { line-height:1.45; }
.muted { color:var(--muted); }
.small { font-size:.82rem; }
.eyebrow { font-size:.7rem; font-weight:700; color:var(--muted); letter-spacing:.1em; margin:0 0 .2rem; }
.auth { min-height:100vh; display:grid; place-items:center; padding:calc(1.5rem + env(safe-area-inset-top)) 1rem calc(1.5rem + env(safe-area-inset-bottom)); }
.auth-card { width:min(100%,28rem); background:var(--surface); padding:1.5rem; border-radius:1.4rem; box-shadow:0 .4rem 2rem var(--shadow); }
.app-icon { display:grid; place-items:center; width:3.5rem; height:3.5rem; border-radius:1rem; background:var(--accent); color:var(--accent-text); font-size:2rem; margin-bottom:1rem; }
.shell { max-width:52rem; margin:auto; min-height:100vh; padding:env(safe-area-inset-top) 1rem calc(6.3rem + env(safe-area-inset-bottom)); }
.header { display:flex; align-items:center; justify-content:space-between; padding:1.15rem 0 .65rem; }
.header h1 { margin:0; }
.icon-button { display:grid; place-items:center; width:2.9rem; height:2.9rem; border:0; border-radius:50%; background:var(--accent); color:var(--accent-text); font-size:1.8rem; }
.tabbar { position:fixed; z-index:4; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,52rem); display:flex; background:var(--surface); border-top:1px solid var(--line); padding:.35rem .4rem calc(.35rem + env(safe-area-inset-bottom)); }
.tabbar button { flex:1; border:0; background:transparent; color:var(--muted); font-size:.72rem; padding:.2rem; min-height:3rem; }
.tabbar button span { display:block; font-size:1.35rem; line-height:1.2; }
.tabbar button.active { color:var(--accent); font-weight:700; }
.card { background:var(--surface); border-radius:1.1rem; padding:1rem; margin-bottom:1rem; box-shadow:0 .2rem .8rem var(--shadow); }
.segment { display:flex; background:var(--bg); border:1px solid var(--line); border-radius:.75rem; padding:.2rem; }
.segment button { flex:1; border:0; border-radius:.55rem; background:transparent; color:var(--muted); padding:.5rem; }
.segment button.active { background:var(--surface); color:var(--text); box-shadow:0 .1rem .3rem var(--shadow); font-weight:700; }
.calendar-head { display:flex; align-items:center; justify-content:space-between; gap:.4rem; margin:.9rem 0; }
.calendar-head strong { text-align:center; }
.plain-button { border:0; background:transparent; color:var(--accent); padding:.55rem; min-height:2.6rem; }
.month-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:.15rem; }
.weekday { text-align:center; font-size:.75rem; color:var(--muted); padding:.35rem 0; }
.day { min-height:3.2rem; padding:.35rem .1rem; border:1px solid transparent; background:transparent; color:var(--text); border-radius:.65rem; }
.day.outside { color:var(--muted); opacity:.6; }
.day.today { background:var(--today); }
.day.selected { border-color:var(--accent); }
.dots { display:flex; gap:.14rem; justify-content:center; min-height:.5rem; margin-top:.25rem; overflow:hidden; }
.dot { width:.38rem; height:.38rem; border-radius:50%; background:var(--event-color); flex:none; }
.dot.prep { background:transparent; border:2px solid var(--event-color); }
.day-heading { display:flex; justify-content:space-between; align-items:center; gap:.5rem; margin:1rem 0 .4rem; }
.day-heading h3 { margin:0; }
.entry { display:flex; align-items:center; gap:.65rem; width:100%; text-align:left; border:1px solid var(--line); border-left:5px solid var(--event-color); border-radius:.75rem; background:var(--surface); color:var(--text); padding:.7rem; margin:.45rem 0; }
.entry.prep { border-left-style:dashed; }
.entry.done .entry-title { text-decoration:line-through; }
.entry.done { opacity:.65; }
.entry-title { display:block; font-weight:700; overflow-wrap:anywhere; }
.entry-sub { display:block; margin-top:.2rem; color:var(--muted); font-size:.8rem; overflow-wrap:anywhere; }
.empty { color:var(--muted); font-size:.9rem; padding:.5rem 0; }
label { display:block; font-weight:600; margin:.8rem 0; }
input:not([type="checkbox"]),select,textarea { display:block; width:100%; min-height:2.8rem; margin-top:.35rem; border:1px solid var(--line); border-radius:.7rem; padding:.65rem; background:var(--bg); color:var(--text); }
textarea { min-height:5rem; resize:vertical; }
.check { display:flex; align-items:center; gap:.6rem; font-weight:500; }
input[type="checkbox"] { width:1.3rem; height:1.3rem; accent-color:var(--accent); flex:none; }
button.primary,button.secondary,button.danger { border:0; border-radius:.7rem; padding:.7rem .9rem; min-height:2.8rem; font-weight:700; }
.primary { background:var(--accent); color:var(--accent-text); }
.secondary { background:var(--bg); color:var(--text); border:1px solid var(--line) !important; }
.danger { background:var(--danger-bg); color:var(--danger); }
.full { width:100%; }
.actions { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:1rem; }
.actions > button { flex:1; }
.settings-row { padding:.65rem 0; border-bottom:1px solid var(--line); }
.settings-row:last-child { border:0; }
.settings-row label { margin:.1rem 0; }
.palette-preview { display:flex; gap:.2rem; flex-wrap:wrap; margin:.5rem 0; }
.swatch { width:1.35rem; height:1.35rem; border-radius:50%; background:var(--event-color); border:1px solid var(--line); }
.color-picker { display:grid; grid-template-columns:repeat(8,1fr); gap:.4rem; margin-top:.5rem; }
.color-picker label { position:relative; margin:0; display:flex; align-items:center; justify-content:center; min-height:2.5rem; border:2px solid transparent; border-radius:.7rem; }
.color-picker label:has(input:checked) { border-color:var(--accent); }
.color-picker label:focus-within { outline:3px solid var(--focus); outline-offset:2px; }
.color-picker input { position:absolute; inset:0; width:100%; height:100%; min-height:0; margin:0; opacity:0; cursor:pointer; }
.color-picker .swatch { width:1.6rem; height:1.6rem; }
.notice { position:fixed; z-index:20; top:calc(.5rem + env(safe-area-inset-top)); left:1rem; right:1rem; max-width:45rem; margin:auto; background:var(--surface); color:var(--text); border:1px solid var(--line); border-radius:.8rem; padding:.8rem; box-shadow:0 .4rem 1rem var(--shadow); }
dialog { border:0; padding:0; color:var(--text); background:var(--surface); width:min(100%,34rem); max-width:100%; max-height:90dvh; border-radius:1.2rem; box-shadow:0 .5rem 2rem var(--shadow); }
dialog::backdrop { background:var(--overlay); }
.dialog-inner { padding:1.2rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); }
.dialog-head { display:flex; justify-content:space-between; align-items:start; gap:1rem; }
.dialog-head button { border:0; background:transparent; color:var(--accent); font-size:1.6rem; line-height:1; }
@media (max-width:600px) { dialog { position:fixed; bottom:0; margin:auto 0 0; width:100%; border-radius:1.2rem 1.2rem 0 0; } }
