/* Eine Handy-Spalte (höchstens 520px): oben Person und Tag, unten die Reiter, Erfassen als Blatt von unten. */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 500 700; font-display: swap; src: url(../fonts/bricolage-grotesque-latin.woff2) format("woff2") }
@font-face { font-family: "Figtree"; font-weight: 400 700; font-display: swap; src: url(../fonts/figtree-latin.woff2) format("woff2") }

:root {
  --bg: #F1F4F0; --surface: #FFFFFF; --sunk: #E7ECE6; --ink: #16221B; --muted: #5A6A60; --line: #D5DDD6;
  --accent: #9C1F5C; --on-accent: #FFFFFF; --accent-soft: #F6E3EC;
  --protein: #2C7A58; --carbs: #B97C0C; --fat: #4468AE; --warn: #A8441C; --warn-soft: #F8E6DC;
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #111713; --surface: #1A221D; --sunk: #232D27; --ink: #E7EEE8; --muted: #9AA99F; --line: #2D3932;
  --accent: #E56BA3; --on-accent: #2A0717; --accent-soft: #3A1B2A;
  --protein: #62C196; --carbs: #E2AE4A; --fat: #8AA8E2; --warn: #EA916A; --warn-soft: #3A251B; color-scheme: dark } }

* { box-sizing: border-box }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); padding-top: env(safe-area-inset-top, 0px) }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
button:disabled { opacity: .4; cursor: default }
button[aria-busy="true"] { opacity: .75; cursor: progress }
button[aria-busy="true"]::before { content: ""; display: inline-block; width: .85em; height: .85em; margin-right: .5em; vertical-align: -.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50% }
@media (prefers-reduced-motion: no-preference) { button[aria-busy="true"]::before { animation: spin .7s linear infinite } @keyframes spin { to { transform: rotate(360deg) } } }
.sent { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.app { max-width: 520px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 110px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 16px }
.boot { padding-top: 30vh; text-align: center }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance }
h1 { font-size: 26px; line-height: 1.15 }
h2 { font-size: 18px }
p { margin: 0 }
.num { font-variant-numeric: tabular-nums }
.muted { color: var(--muted) }
.small { font-size: 13px }

.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding: 10px 0; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line) }
.toprow { display: flex; align-items: center; gap: 8px; justify-content: space-between }
.who { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-weight: 600; max-width: 68% }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 6px 4px; text-decoration: none }
.daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.daynav strong { font-family: var(--display); font-size: 20px; background: none; border: 0 }
.round { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 18px; line-height: 1; flex: none }

.sum { display: flex; flex-direction: column; gap: 10px }
.kcal { display: flex; align-items: baseline; gap: 8px }
.kcal b { font-family: var(--display); font-size: 44px; line-height: 1; font-weight: 700 }
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--sunk) }
.split i { display: block }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px }
.macros div { display: flex; flex-direction: column }
.macros span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px }
.macros span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c) }
.macros b { font-size: 17px }
.minor { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted) }
.minor b { color: var(--ink); font-weight: 600 }

.meal { background: var(--surface); border-radius: 14px; border: 1px solid var(--line); overflow: hidden }
.mealhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px }
.mealhead .t { display: flex; flex-direction: column; min-width: 0 }
.add { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 999px; padding: 7px 14px; font-weight: 700; white-space: nowrap }
.add.ghost { background: var(--accent-soft); color: var(--accent) }
.entry { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 14px; border-top: 1px solid var(--line) }
.entry .n { flex: 1; min-width: 0; background: none; border: 0; text-align: left; padding: 6px 0 }
.entry .n div:first-child { font-weight: 600; overflow-wrap: anywhere }
.x { border: 0; background: none; color: var(--muted); font-size: 20px; padding: 6px 10px; border-radius: 6px }

.block { display: flex; flex-direction: column; gap: 10px }
.blockhead { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.sym { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); border-radius: 12px; padding: 10px 12px }
.sym time { font-weight: 700; color: var(--warn) }
.sym .n { flex: 1; min-width: 0; overflow-wrap: anywhere }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 6px }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line) }
.dots i.on { background: var(--warn) }
.water { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px }
.water .v { flex: 1 }
.water b { font-family: var(--display); font-size: 22px }
textarea, input[type=text], input[type=email], input[type=time], input[type=date], select.f {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px }
textarea { min-height: 72px; resize: vertical; display: block }
label.l, .l { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 4px; min-width: 0 }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600 }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); padding: 0 max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px)) }
.nav div { max-width: 520px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr }
.nav button { background: none; border: 0; padding: 14px 2px 12px; font-weight: 600; color: var(--muted); border-top: 3px solid transparent; font-size: 13px }
.nav button[aria-current="page"] { color: var(--accent); border-top-color: var(--accent) }

.veil { position: fixed; inset: 0; z-index: 20; background: rgba(10, 16, 12, .55); display: flex; align-items: flex-end; justify-content: center }
.sheet { background: var(--bg); width: 100%; max-width: 520px; max-height: 92%; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 12px }
.sheethead { display: flex; justify-content: space-between; align-items: center; gap: 8px }
.cap { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px }
.hit { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 12px }
.hit .pick { flex: 1; min-width: 0; background: none; border: 0; text-align: left; padding: 6px 0 }
.hit .pick div:first-child { font-weight: 600; overflow-wrap: anywhere }
.plus { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--accent-soft); color: var(--accent); font-size: 22px; font-weight: 700; line-height: 1; flex: none }
.tag { font-size: 11px; font-weight: 700; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; color: var(--muted); margin-left: 6px; white-space: nowrap; font-family: var(--body) }
.list { display: flex; flex-direction: column; gap: 6px }
.row2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px }
.rowx { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; gap: 8px; align-items: center }
.primary { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 12px; padding: 13px; font-weight: 700; width: 100% }
.secondary { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-weight: 600; text-align: center; text-decoration: none; color: inherit }
.danger { color: var(--warn) }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-weight: 600; text-decoration: none; color: inherit; font-size: 14px }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent) }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px }
button.card { text-align: left; width: 100% }

.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 150px }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 11px; color: var(--muted) }
.bar i { width: 100%; border-radius: 6px 6px 2px 2px; background: var(--line); min-height: 2px }
.bar.now i { background: var(--accent) }
.bar.now { color: var(--ink); font-weight: 700 }
.freq { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 8px; align-items: center }
.freq .track { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden }
.freq .track i { display: block; height: 100%; background: var(--warn) }
.scroll { overflow-x: auto }
table { border-collapse: collapse; width: 100%; font-size: 13px }
th, td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line) }
th:first-child, td:first-child { text-align: left; font-weight: 600 }
.user { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line) }
.user:first-of-type { border-top: 0; padding-top: 0 }
.pill { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: var(--sunk); margin-left: 6px }
.pill.off { background: var(--warn-soft); color: var(--warn) }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 30; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; max-width: calc(100% - 32px); text-align: center }
.login { padding-top: 12vh; gap: 14px }
.code { letter-spacing: .5em; font-size: 24px; text-align: center; font-variant-numeric: tabular-nums }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .16s ease-out } @keyframes up { from { transform: translateY(24px); opacity: .6 } } }
