/* Layout: eine Spalte, Reiter oben, Karten-Listen darunter */
:root {
  --bg: #eef0ec; --surface: #fbfcfa; --fg: #1d2420; --muted: #5d6862; --line: #d6dbd5;
  --accent: #6b2d5c; --accent-soft: #f1e4ee; --on-accent: #fff;
  --ok: #2f7a4f; --ok-bg: #e2f1e7; --warn: #9a6b0d; --warn-bg: #f8eed3; --bad: #b03a2e; --bad-bg: #f7e1de;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #151a17; --surface: #1e2420; --fg: #e8ece8; --muted: #9aa59f; --line: #2f3833;
  --accent: #d79ac6; --accent-soft: #3a2535; --on-accent: #1d1219;
  --ok: #7fcf9c; --ok-bg: #1f3427; --warn: #e5c06a; --warn-bg: #3a3019; --bad: #f08e82; --bad-bg: #42231f;
  color-scheme: dark } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 16px; line-height: 1.5;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
.wrap { max-width: 680px; margin: 0 auto; padding-block: 16px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 18px; }
h1, h2 { font-family: var(--display); margin: 0; text-wrap: balance; }
h1 { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
h2 { font-size: 1.1rem; font-weight: 700; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.whoami { color: var(--muted); font-size: .9rem; }
.hint { color: var(--muted); font-size: .9rem; margin: 2px 0 0; }
.panel, section { display: grid; gap: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 10px; color: var(--muted); white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--bad); color: var(--surface); font-size: .72rem; line-height: 18px; text-align: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; }
.login { margin-top: 10vh; }
.big { font-family: var(--display); font-weight: 700; font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.big small { font-size: .4em; font-weight: 500; color: var(--muted); margin-left: 6px; }
.small-big { font-size: 2rem; }
.goal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.track { height: 14px; border-radius: 7px; background: var(--line); overflow: hidden; }
.fill { height: 100%; border-radius: 7px; background: var(--accent); width: 0; transition: width .6s ease; }
.fill.done { background: var(--ok); }
.weeks { display: flex; gap: 5px; }
.wk { flex: 1; display: grid; gap: 3px; text-align: center; font-size: .7rem; color: var(--muted); }
.wk span { height: 9px; border-radius: 3px; background: var(--line); }
.wk.hit span { background: var(--ok); }
.wk.part span { background: var(--warn); }
.pill { justify-self: start; border-radius: 999px; padding: 2px 10px; font-weight: 600; font-size: .8rem; white-space: nowrap; background: var(--accent-soft); color: var(--accent); }
.ok { background: var(--ok-bg); color: var(--ok); } .warn { background: var(--warn-bg); color: var(--warn); } .bad { background: var(--bad-bg); color: var(--bad); }
label { font-weight: 600; font-size: .85rem; display: grid; gap: 4px; flex: 1 1 120px; min-width: 0; }
input, select { font: inherit; font-size: 16px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.grow { flex: 1 1 200px; }
button, .button { font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; border: 1px solid transparent; padding: 9px 14px; text-decoration: none; display: inline-block; text-align: center; }
.primary { background: var(--accent); color: var(--on-accent); }
.ghost { background: transparent; color: var(--accent); border-color: var(--line); }
button.done { background: var(--ok-bg); color: var(--ok); padding: 7px 12px; }
button.link { background: none; padding: 4px 6px; color: var(--muted); font-weight: 500; }
button.danger { color: var(--bad); }
button:focus-visible, input:focus-visible, select:focus-visible, .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
ul.list { list-style: none; margin: 0; padding: 0; display: grid; }
ul.list li { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
ul.list li:first-child { border-top: 0; }
.who { flex: 1 1 160px; min-width: 0; }
.who b { font-weight: 600; overflow-wrap: anywhere; }
.who div { color: var(--muted); font-size: .85rem; }
li.isdone .who b { text-decoration: line-through; color: var(--muted); }
.pts { font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--accent); font-weight: 600; white-space: nowrap; }
.empty { color: var(--muted); font-size: .9rem; padding: 4px 0; margin: 0; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: .9rem; margin: 0; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; max-width: calc(100% - 32px); z-index: 10; }
.edit { display: grid; gap: 8px; width: 100%; }
@media (prefers-reduced-motion: reduce) { .fill { transition: none; } }

textarea { font: inherit; font-size: 16px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; resize: vertical; }
.meal-today { font-family: var(--display); font-size: 1.5rem; font-weight: 700; overflow-wrap: anywhere; }
.meal-today.none { font-family: var(--body); font-size: 1rem; font-weight: 500; color: var(--muted); }
.weeknav { justify-content: space-between; align-items: center; }
.weeknav strong { font-family: var(--display); }
.day { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: center; width: 100%; }
.day .dl { font-weight: 600; font-size: .9rem; }
.day .dl small { display: block; color: var(--muted); font-weight: 500; }
.day.today .dl { color: var(--accent); }
.chat { gap: 10px; max-height: 60vh; overflow-y: auto; }
.msg { padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 92%; }
.msg.user { background: var(--accent-soft); justify-self: end; }
.msg.assistant { background: var(--bg); justify-self: start; }
.msg .acts { margin-top: 6px; font-size: .8rem; color: var(--ok); }
.wrap > *, #app > * { min-width: 0; }
#app { display: grid; gap: 14px; min-width: 0; }
.tabs { margin-bottom: 0; }
