:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #1f2328;
  --muted: #6b7280;
  --line: #e4e2dc;
  --soft: #efede7;
  --accent: #111827;
  --today: #fff8e1;
  --today-line: #f5b301;
  --A: #dc2626;
  --B: #f59e0b;
  --C: #10b981;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}

/* Dunkelmodus: automatisch nach Systemeinstellung (außer „Hell“ ist gewählt) … */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121416;
    --card: #1c1f23;
    --ink: #e8e8e6;
    --muted: #9aa0a6;
    --line: #2e3237;
    --soft: #25292e;
    --accent: #f3f4f6;
    --today: #2a2515;
    --today-line: #e0a800;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
/* … oder fest gewählt */
:root[data-theme="dark"] {
    --bg: #121416;
    --card: #1c1f23;
    --ink: #e8e8e6;
    --muted: #9aa0a6;
    --line: #2e3237;
    --soft: #25292e;
    --accent: #f3f4f6;
    --today: #2a2515;
    --today-line: #e0a800;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; font-size: 16px; color: inherit; }
h1, h2, h3 { margin: 0; }

/* ---------- Kopfzeile ---------- */

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  padding: 14px 20px;
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand h1 { font-size: 20px; letter-spacing: -.01em; }
.kw {
  background: var(--accent); color: var(--bg);
  font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: 999px;
}
.weeknav { display: flex; align-items: center; gap: 6px; }
.weeknav button {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; min-width: 36px; height: 34px; padding: 0 10px;
}
.weeknav button.on { font-weight: 600; }
.range { color: var(--muted); font-size: 14px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.who-label { color: var(--muted); font-size: 13px; }
.seg { display: flex; background: var(--soft); border-radius: 10px; padding: 3px; }
.seg button {
  border: 0; background: transparent; padding: 5px 11px; border-radius: 8px; font-size: 14px;
  display: flex; align-items: center; gap: 6px;
}
.seg button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.seg button.on { background: var(--card); box-shadow: var(--shadow); font-weight: 600; }
.icon { border: 0; background: none; font-size: 20px; padding: 4px 6px; color: var(--muted); line-height: 1; }
.icon:hover { color: var(--ink); }
#themeBtn { font-size: 22px; min-width: 32px; }

main { padding: 18px 20px 40px; display: grid; gap: 18px; }

/* ---------- Woche ---------- */

.panel-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 210px;
}
.day header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 12px 8px; border-bottom: 1px dashed var(--line);
}
.dname { font-weight: 650; }
.ddate { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.day.weekend { background: color-mix(in srgb, var(--card) 70%, var(--soft)); }
.day.today { border-color: var(--today-line); background: var(--today); }
.day.today .dname::after {
  content: "heute"; margin-left: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--today-line); letter-spacing: .04em;
}
.events { list-style: none; margin: 0; padding: 8px; display: grid; gap: 6px; flex: 1; align-content: start; }
.event {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 6px 6px 6px 8px; border-radius: 9px;
  background: color-mix(in srgb, var(--c) 13%, var(--card));
  border-left: 3px solid var(--c);
  font-size: 14px;
}

.add-inline { padding: 0 8px 8px; }
.add-inline input {
  width: 100%; border: 1px dashed var(--line); background: transparent;
  border-radius: 9px; padding: 7px 9px; font-size: 14px;
}
.add-inline input:focus, .add input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-style: solid; }

/* ---------- Gemeinsame Elemente ---------- */

.txt { flex: 1; min-width: 0; outline: none; word-break: break-word; border-radius: 4px; padding: 0 2px; }
.txt:focus { background: var(--soft); }
.dot {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--card);
  box-shadow: 0 0 0 1px var(--line); flex: none; padding: 0; margin-top: 2px;
}
.del {
  border: 0; background: none; color: var(--muted); opacity: .45;
  font-size: 18px; line-height: 1; padding: 0 3px; flex: none;
}
.del:hover { opacity: 1; color: var(--A); }
@media (hover: hover) {
  .event .del, .list li .del, .card .del { visibility: hidden; }
  .event:hover .del, .list li:hover .del, .card:hover .del { visibility: visible; }
}
.link { border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 6px 0; }
.empty { color: var(--muted); font-size: 13px; margin: 4px 2px 8px; }

/* ---------- Untere Panels ---------- */

.lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px 12px;
}
.panel h2 { font-size: 16px; margin-bottom: 10px; }

.add { display: flex; gap: 8px; margin-bottom: 12px; }
.add input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg);
  border-radius: 10px; padding: 8px 11px;
}
.prio-pick { display: flex; gap: 4px; }
.prio-pick button {
  width: 34px; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; font-weight: 700; color: var(--muted);
}
.prio-pick button.on[data-p="A"] { background: var(--A); border-color: var(--A); color: #fff; }
.prio-pick button.on[data-p="B"] { background: var(--B); border-color: var(--B); color: #fff; }
.prio-pick button.on[data-p="C"] { background: var(--C); border-color: var(--C); color: #fff; }

.prio-group { margin-bottom: 8px; }
.prio-group h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  margin: 6px 0 4px; display: flex; align-items: center; gap: 6px;
}
.prio-group h3::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.prio-A h3::before { background: var(--A); }
.prio-B h3::before { background: var(--B); }
.prio-C h3::before { background: var(--C); }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: flex-start; gap: 8px; padding: 7px 2px;
  border-bottom: 1px solid var(--soft);
}
.list li:last-child { border-bottom: 0; }
.list li.done .txt { text-decoration: line-through; color: var(--muted); }
.list input[type="checkbox"] { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.badge {
  border: 0; border-radius: 6px; font-size: 11px; font-weight: 800; padding: 2px 6px; color: #fff; flex: none;
}
.prio-A .badge { background: var(--A); }
.prio-B .badge { background: var(--B); }
.prio-C .badge { background: var(--C); }

/* Kanban */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.col { background: var(--soft); border-radius: 11px; padding: 8px; min-height: 140px; display: flex; flex-direction: column; }
.col.over { outline: 2px dashed var(--muted); }
.col h3 {
  font-size: 13px; font-weight: 650; padding: 2px 4px 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.count { font-size: 12px; color: var(--muted); background: var(--card); border-radius: 999px; padding: 0 7px; }
.cards { display: grid; gap: 7px; align-content: start; flex: 1; }
.card {
  background: var(--card); border-radius: 9px; padding: 8px 9px 6px;
  box-shadow: var(--shadow); border-top: 3px solid var(--c); font-size: 14px; cursor: grab;
}
.col-done .card .txt { color: var(--muted); text-decoration: line-through; }
.card-foot { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.card-foot .dot { margin-top: 0; }
.spacer { flex: 1; }
.mv {
  border: 1px solid var(--line); background: var(--bg); border-radius: 7px;
  width: 26px; height: 24px; padding: 0; line-height: 1; font-size: 16px;
}
.col .add-inline { padding: 8px 0 0; }

/* ---------- Tabbar (nur Handy) ---------- */

.tabbar { display: none; }

/* ---------- Dialog & Hinweise ---------- */

dialog { border: 0; border-radius: 16px; padding: 0; background: var(--card); color: var(--ink); width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.settings { padding: 20px; display: grid; gap: 12px; }
.settings label { display: flex; align-items: center; gap: 8px; }
.settings input:not([type="color"]) { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: var(--bg); }
.settings input[type="color"] { width: 42px; height: 36px; border: 0; background: none; padding: 0; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.actions button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 14px; }
.actions .primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.offline {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(120px);
  background: #b91c1c; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px;
  transition: transform .25s, opacity .25s, visibility .25s; z-index: 20; opacity: 0; visibility: hidden;
}
.offline.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
  .panel-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lower { grid-template-columns: 1fr 1fr; }
  #kanban { grid-column: 1 / -1; grid-row: 1; }
}

@media (max-width: 720px) {
  .topbar { padding: 10px 16px; gap: 8px 12px; }
  .brand h1 { font-size: 18px; }
  .range { display: none; }
  .who { margin-left: 0; width: 100%; }
  .who .seg { flex: 1; }
  .seg button { flex: 1; justify-content: center; }
  main { padding: 14px 16px calc(84px + env(safe-area-inset-bottom)); }

  .panel-week { grid-template-columns: 1fr; gap: 8px; }
  .day { min-height: 0; }
  .lower { grid-template-columns: 1fr; }
  #kanban { grid-row: auto; }
  .board { grid-template-columns: 1fr; }

  /* Nur den aktiven Tab zeigen */
  body[data-tab] [data-tab]:not(.tabbar button) { display: none; }
  body[data-tab="week"] #week { display: grid; }
  body[data-tab="todos"] #todos,
  body[data-tab="kanban"] #kanban,
  body[data-tab="shopping"] #shopping { display: block; }
  .panel { border: 0; box-shadow: none; background: transparent; padding: 0; }
  .panel h2 { font-size: 20px; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar button {
    flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center;
    gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0;
  }
  .tabbar button span { font-size: 20px; filter: grayscale(1); opacity: .6; }
  .tabbar button.on { color: var(--ink); font-weight: 600; }
  .tabbar button.on span { filter: none; opacity: 1; }
  .del { opacity: .6; font-size: 20px; }
}

/* ---------- Müllabfuhr ---------- */

:root {
  --bin-gelb: #facc15;   --bin-gelb-ink: #422006;
  --bin-rest: #4b5563;   --bin-rest-ink: #fff;
  --bin-papier: #2563eb; --bin-papier-ink: #fff;
  --bin-gruen: #16a34a;  --bin-gruen-ink: #fff;
}
.day header { gap: 6px; }
.day header .ddate { margin-left: auto; }
.trash-btn {
  border: 0; background: none; color: var(--muted); opacity: .55;
  width: 26px; height: 26px; margin: -4px -6px -4px 0; padding: 4px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
}
.trash-btn svg, .pickup-hint svg { width: 16px; height: 16px; }
.trash-btn:hover, .trash-btn.on { opacity: 1; color: var(--ink); background: var(--soft); }

.bins { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 8px 0; }
.bin {
  font-size: 11px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 999px;
  border: 1.5px solid var(--c); color: var(--muted); background: transparent;
}
.bin.on { background: var(--c); color: var(--c-ink); }
.bins.editing { gap: 6px; }
.bins.editing .bin { font-size: 13px; padding: 7px 10px; cursor: pointer; }
.bins.editing .bin:not(.on) { color: var(--ink); }
.bin-gelb { --c: var(--bin-gelb); --c-ink: var(--bin-gelb-ink); }
.bin-rest { --c: var(--bin-rest); --c-ink: var(--bin-rest-ink); }
.bin-papier { --c: var(--bin-papier); --c-ink: var(--bin-papier-ink); }
.bin-gruen { --c: var(--bin-gruen); --c-ink: var(--bin-gruen-ink); }

.pickup-hint {
  display: flex; align-items: center; gap: 6px; margin: 8px 8px 0; padding: 6px 8px;
  border-radius: 8px; font-size: 12.5px; font-weight: 600;
  background: color-mix(in srgb, var(--today-line) 18%, var(--card)); color: var(--ink);
}
.pickup-hint svg { flex: none; }

@media (max-width: 720px) {
  .trash-btn { width: 34px; height: 34px; margin: -8px -8px -8px 0; }
  .trash-btn svg { width: 19px; height: 19px; }
  .bin { font-size: 12px; padding: 5px 9px; }
}

/* ---------- Monty Maulwurf (Easter Egg) ---------- */

.kw { cursor: default; user-select: none; -webkit-user-select: none; }
.monty {
  position: fixed; right: 24px; bottom: 0; z-index: 30; width: 150px; height: 170px;
  pointer-events: none; overflow: visible;
}
.monty .hole { position: absolute; left: 0; right: 0; bottom: 18px; height: 150px; overflow: hidden; }
.monty .mole {
  position: absolute; left: 13px; bottom: 0; width: 124px;
  transform: translateY(105%); transition: transform .45s cubic-bezier(.34, 1.56, .64, 1);
}
.monty .mound {
  position: absolute; left: 0; bottom: -4px; width: 150px;
  opacity: 0; transform: scaleY(0); transform-origin: bottom; transition: transform .25s ease, opacity .2s;
}
.monty .mole-say {
  position: absolute; right: 118px; bottom: 120px; width: max-content; max-width: 210px;
  background: var(--card); color: var(--ink); border: 2px solid var(--ink);
  border-radius: 14px 14px 2px 14px; padding: 8px 11px; font-size: 14px; font-weight: 600; line-height: 1.3;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  opacity: 0; transform: scale(.8); transform-origin: bottom right; transition: opacity .2s, transform .2s;
}
.monty.up { pointer-events: auto; cursor: pointer; }
.monty.up .mound { transform: scaleY(1); opacity: 1; }
.monty.up .mole { transform: translateY(0); transition-delay: .15s; }
.monty.up .mole-say { opacity: 1; transform: scale(1); transition-delay: .55s; }

@media (max-width: 720px) {
  .monty { right: 8px; bottom: calc(62px + env(safe-area-inset-bottom)); transform: scale(.8); transform-origin: bottom right; }
  .monty .mole-say { max-width: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  .monty .mole, .monty .mound, .monty .mole-say { transition: opacity .2s; }
}

/* ---------- Uhr & Wetter ---------- */

.now { display: flex; align-items: baseline; gap: 10px; margin-left: 6px; color: var(--muted); font-size: 14px; }
.clock { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 15px; }
.now-weather { white-space: nowrap; }
.wx {
  display: flex; align-items: center; gap: 5px; padding: 6px 12px 0; font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.wx-icon { font-size: 15px; line-height: 1; }

/* ---------- Notizen & Dashboard ---------- */

:root {
  --chart-cur: #0d9488; --chart-prev: #cfd4da;
  --delta-good: #006300; --delta-bad: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --chart-cur: #14a393; --chart-prev: #4b5563; --delta-good: #0ca30c; }
}
:root[data-theme="dark"] { --chart-cur: #14a393; --chart-prev: #4b5563; --delta-good: #0ca30c; }

.extra { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }

/* ---------- App-Menü am Laptop (auf dem Handy übernimmt das die Tab-Leiste) ---------- */

.appnav {
  order: 10; flex-basis: 100%; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  margin: 2px -6px -6px;
}
.appnav::-webkit-scrollbar { display: none; }
.appnav button {
  border: 0; background: none; border-radius: 9px; padding: 6px 12px; font-size: 14px; color: var(--muted);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.appnav button span { filter: grayscale(1); opacity: .7; }
.appnav button:hover { background: var(--soft); color: var(--ink); }
.appnav button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.appnav button.on span { filter: none; opacity: 1; }

@media (min-width: 721px) {
  /* Übersicht: alles außer dem Dashboard */
  body[data-view="all"] #dashboard { display: none; }

  /* Fokus auf eine App: nur diesen Bereich zeigen, über die volle Breite */
  body:not([data-view="all"]) main [data-tab] { display: none; }
  body:not([data-view="all"]) .lower,
  body:not([data-view="all"]) .extra { display: block; }
  body[data-view="week"] .lower, body[data-view="week"] .extra,
  body[data-view="todos"] .extra, body[data-view="kanban"] .extra, body[data-view="shopping"] .extra,
  body[data-view="notes"] .lower, body[data-view="dashboard"] .lower { display: none; }
  body[data-view="week"] #week { display: grid; }
  body[data-view="todos"] #todos, body[data-view="kanban"] #kanban, body[data-view="shopping"] #shopping,
  body[data-view="notes"] #notes, body[data-view="dashboard"] #dashboard { display: block; }

  /* Fokus-Layouts */
  body[data-view="week"] .panel-week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  body[data-view="week"] .day { min-height: calc(100vh - 190px); }
  body[data-view="todos"] #todoLists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
  body[data-view="todos"] #todoLists > .link { grid-column: 1 / -1; justify-self: start; }
  body[data-view="todos"] #todoForm { max-width: 640px; }
  body[data-view="kanban"] .col { min-height: calc(100vh - 260px); }
  body[data-view="shopping"] #shopping { max-width: 720px; margin: 0 auto; }
  .panel h2 { transition: font-size .15s; }
  body:not([data-view="all"]) .panel h2 { font-size: 20px; }
}

.add-note { align-items: stretch; }
.add-note textarea {
  flex: 1; min-width: 0; resize: vertical; border: 1px solid var(--line); background: var(--bg);
  border-radius: 10px; padding: 8px 11px; font: inherit; font-size: 16px; color: inherit; min-height: 44px;
}
.add-note textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.primary-btn {
  border: 0; border-radius: 10px; padding: 0 14px; background: var(--accent); color: var(--bg); font-weight: 600;
}
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.note {
  background: color-mix(in srgb, var(--c) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 25%, var(--line));
  border-top: 3px solid var(--c); border-radius: 10px; padding: 10px 10px 6px; display: flex; flex-direction: column;
}
.note-txt { white-space: pre-wrap; word-break: break-word; outline: none; flex: 1; font-size: 14px; border-radius: 4px; padding: 1px 2px; }
.note-txt:focus { background: var(--card); }
.note footer { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.note footer .dot { margin-top: 0; }
.note-time { font-size: 12px; color: var(--muted); }
@media (hover: hover) { .note .del { visibility: hidden; } .note:hover .del { visibility: visible; } }

.dash-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-head h2 { margin: 0; }
.dash-sub { color: var(--muted); font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.kpi { background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; min-width: 0; }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 650; line-height: 1.15; margin-top: 2px; }
.delta { font-size: 12px; font-weight: 600; margin-top: 2px; }
.delta span { font-size: 10px; }
.delta.good { color: var(--delta-good); }
.delta.bad { color: var(--delta-bad); }
.delta.neutral { color: var(--muted); }
.kpi-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.pd { display: inline-flex; align-items: center; gap: 4px; }
.pd i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.chart { margin: 16px 0 0; position: relative; }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chart-title { font-weight: 650; font-size: 14px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.cur, .bar.cur { background: var(--chart-cur); }
.sw.prev, .bar.prev { background: var(--chart-prev); }
.plot { position: relative; height: 150px; margin-left: 22px; }
.grid { position: absolute; inset: 0; }
.gl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--soft); }
.gl span { position: absolute; left: -22px; top: -8px; width: 16px; text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); }
.col-grp { position: relative; display: flex; justify-content: center; cursor: default; }
.col-grp:hover { background: color-mix(in srgb, var(--soft) 60%, transparent); border-radius: 6px; }
.pair { position: absolute; bottom: 0; top: 0; display: flex; align-items: flex-end; gap: 2px; }
.bar { width: min(18px, 2.2vw); min-width: 7px; border-radius: 4px 4px 0 0; }
.bar[style*="height:0%"] { height: 0 !important; }
.xl { position: absolute; bottom: -20px; font-size: 12px; color: var(--muted); }
.chart-tip {
  position: absolute; top: 28px; transform: translateX(-50%); z-index: 2; pointer-events: none;
  background: var(--ink); color: var(--bg); font-size: 12.5px; padding: 5px 9px; border-radius: 8px; white-space: nowrap;
}
.chart-table { margin-top: 30px; font-size: 13px; color: var(--muted); }
.chart-table summary { cursor: pointer; }
.chart-table table { border-collapse: collapse; margin-top: 8px; color: var(--ink); }
.chart-table th, .chart-table td { padding: 3px 14px 3px 0; text-align: left; font-variant-numeric: tabular-nums; }
.chart-table th { color: var(--muted); font-weight: 600; }

@media (max-width: 1200px) {
}
@media (max-width: 720px) {
  .now { margin-left: 0; font-size: 13px; }
  .brand { flex-wrap: wrap; row-gap: 2px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { background: var(--card); }
  body[data-tab="notes"] #notes,
  body[data-tab="dashboard"] #dashboard { display: block; }
  /* leere Bereiche ausblenden, damit oben keine Lücke entsteht */
  body[data-tab="notes"] .lower, body[data-tab="dashboard"] .lower,
  body[data-tab="week"] .lower, body[data-tab="week"] .extra,
  body[data-tab="todos"] .extra, body[data-tab="kanban"] .extra, body[data-tab="shopping"] .extra { display: none; }
  .extra { gap: 0; }
  .appnav { display: none; }
  .tabbar button { font-size: 10px; }
  .tabbar button span { font-size: 18px; }
}
