/* Cut Tracker – styles */
:root {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --card-2: #F2F2F7;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --sep: rgba(60, 60, 67, 0.16);
  --text: #000000;
  --text-2: rgba(60, 60, 67, 0.64);
  --text-3: rgba(60, 60, 67, 0.36);
  --bar-bg: rgba(249, 249, 249, 0.82);
  --accent: #FF5A1F;
  --kcal: #FF5A1F;
  --protein: #5856D6;
  --carbs: #0FA3B8;
  --fat: #F2A007;
  --good: #23A94A;
  --bad: #FF3B30;
  --weight: #007AFF;
  --ok: #8DC21F;
  --ring-kcal: #FA114F;
  --ring-protein: #7B61FF;
  --ring-move: #00B8E6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.16);
  --radius: 18px;
  --tabbar-h: 54px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --dock-h: 96px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1C1C1E;
    --card-2: #2C2C2E;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.36);
    --sep: rgba(84, 84, 88, 0.6);
    --text: #FFFFFF;
    --text-2: rgba(235, 235, 245, 0.62);
    --text-3: rgba(235, 235, 245, 0.32);
    --bar-bg: rgba(22, 22, 24, 0.82);
    --accent: #FF6A2E;
    --kcal: #FF6A2E;
    --protein: #7D7AFF;
    --carbs: #2CC4D8;
    --fat: #FFB83D;
    --good: #32D74B;
    --bad: #FF453A;
    --weight: #0A84FF;
    --ok: #A6E22E;
    --ring-kcal: #FF2D6F;
    --ring-protein: #9D87FF;
    --ring-move: #2CE0FF;
    --shadow: none;
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
input, select, textarea { font: inherit; font-size: 17px; color: var(--text); }
.muted { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }

/* splash */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; transition: opacity .3s; }
.splash img { border-radius: 16px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .8; } }

/* ---------- AUTH ---------- */
.auth { position: fixed; inset: 0; display: flex; justify-content: center; align-items: center; background: var(--bg);
  padding: calc(var(--safe-t) + 20px) 24px calc(var(--safe-b) + 20px); z-index: 50; }
.auth-inner { width: 100%; max-width: 340px; text-align: center; }
.auth-logo { border-radius: 15px; box-shadow: var(--shadow); }
.auth h1 { font-size: 24px; font-weight: 700; margin: 16px 0 4px; letter-spacing: -0.3px; }
.auth p { margin: 0; font-size: 15px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; height: 18px; margin: 28px 0 6px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--text-2); transition: background .15s, transform .15s; }
.pin-dots span.on { background: var(--text); border-color: var(--text); transform: scale(1.05); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.auth-error { color: var(--bad); min-height: 22px; font-size: 15px !important; margin: 4px 0 14px !important; }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); justify-content: center; gap: 16px 26px; }
.keypad button { width: 76px; height: 76px; border-radius: 50%; background: var(--fill); font-size: 30px; font-weight: 400;
  display: grid; place-items: center; transition: background .12s, transform .12s; }
.keypad button:active { background: var(--fill-2); transform: scale(.95); }
.keypad .key-fn { background: transparent; }
.keypad .key-ok { background: var(--accent); color: #fff; }
.keypad .key-ok:disabled { opacity: .35; }

/* ---------- APP SHELL ---------- */
.app { min-height: 100dvh; }
.view { padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 16px) calc(var(--tabbar-h) + var(--safe-b) + 32px) calc(var(--safe-l) + 16px);
  max-width: 640px; margin: 0 auto; animation: viewIn .28s var(--ease); }
.view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--dock-h) + 24px); }
#view-heute { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--dock-h) + 24px); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.nav-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin: 6px 2px 14px; min-height: 44px; }
.nav-title h1 { font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -0.6px; margin: 0; }
.nav-title .sub { font-size: 15px; color: var(--text-2); margin-top: 2px; font-weight: 500; }

.date-switch { display: flex; align-items: center; gap: 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--accent); transition: transform .12s, opacity .2s; }
.icon-btn:active { transform: scale(.9); }
.icon-btn:disabled { opacity: .3; }
.today-link { font-size: 15px; font-weight: 600; color: var(--accent); padding: 8px 10px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--text-2); margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; }
.section-h { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin: 22px 4px 10px; display: flex; justify-content: space-between; align-items: center; }
.section-h .link { font-size: 15px; font-weight: 600; color: var(--accent); }

/* rings */
.rings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ring { position: relative; display: grid; place-items: center; }
.ring svg { width: 100%; max-width: 150px; height: auto; display: block; transform: rotate(-90deg); }
.ring .track { stroke: var(--fill); }
.ring .prog { transition: stroke-dashoffset .8s var(--ease); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-val { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.ring-of { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.ring-name { text-align: center; font-size: 13px; font-weight: 600; margin-top: 8px; }
.ring-left { text-align: center; font-size: 13px; color: var(--text-2); }
.ring-left.over { color: var(--bad); }

.bars { margin-top: 14px; display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.bar-row .lbl { font-weight: 600; color: var(--text-2); }
.bar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; transition: width .7s var(--ease); }
.bar-row .val { color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 82px; text-align: right; }

/* missing chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; align-items: center; }
.chips .chips-lbl { font-size: 14px; color: var(--text-2); font-weight: 600; margin-right: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow);
  font-size: 15px; font-weight: 600; border: 1px dashed var(--sep); }
.chip:active { transform: scale(.96); }
.all-done { font-size: 15px; color: var(--good); font-weight: 600; margin: 0 4px 14px; }

/* stats grid */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); min-height: 96px; display: flex; flex-direction: column; }
.stat .k { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 15px; font-weight: 600; color: var(--text-2); margin-left: 2px; letter-spacing: 0; }
.stat .s { font-size: 13px; color: var(--text-2); margin-top: auto; padding-top: 4px; }
.stat .v.good { color: var(--good); }
.stat .v.bad { color: var(--bad); }
.stat .v.none { color: var(--text-3); }

/* timeline */
.timeline { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tl-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; width: 100%; text-align: left; position: relative; min-height: 64px; transition: background .15s; }
.tl-item + .tl-item::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; height: 1px; background: var(--sep); transform: scaleY(.5); transform-origin: top; }
.tl-item:active { background: var(--fill); }
.tl-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; background: var(--fill); }
.tl-main { min-width: 0; }
.tl-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-meta { font-size: 13px; color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-right { text-align: right; font-variant-numeric: tabular-nums; }
.tl-kcal { font-size: 16px; font-weight: 700; }
.tl-p { font-size: 13px; color: var(--protein); font-weight: 600; }
.tl-kcal.burn { color: var(--good); }
.empty { text-align: center; padding: 32px 20px; color: var(--text-2); font-size: 15px; }
.empty .big { font-size: 36px; display: block; margin-bottom: 8px; }
.lowconf { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--fat); margin-left: 6px; vertical-align: middle; }

/* ---------- DOCK ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 20; padding: 8px calc(var(--safe-r) + 16px) 10px calc(var(--safe-l) + 16px);
  pointer-events: none; display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(to bottom, transparent, var(--bg) 70%); }
.dock > * { pointer-events: auto; }
.dock-row { display: flex; align-items: center; justify-content: center; gap: 30px; }
.dock-side { width: 50px; height: 50px; border-radius: 50%; background: var(--card); border: .5px solid var(--sep); box-shadow: var(--shadow-lg); display: grid; place-items: center; color: var(--text); transition: transform .15s, opacity .2s; }
.dock-side:active { transform: scale(.9); }
.mic { position: relative; width: 76px; height: 76px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(255, 90, 31, .42), 0 2px 6px rgba(0, 0, 0, .12); transition: transform .18s var(--ease), background .2s;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.mic:active { transform: scale(.94); }
.mic > * { grid-area: 1 / 1; }
.mic-ring { position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--bad); opacity: 0; transform: scale(1); transition: transform .08s linear, opacity .2s; pointer-events: none; }
.mic .ico-stop { width: 24px; height: 24px; border-radius: 6px; background: #fff; display: none; }
.mic .spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.dock.recording .mic { background: var(--bad); box-shadow: 0 8px 28px rgba(255, 59, 48, .45); }
.dock.recording .mic .ico-mic { display: none; }
.dock.recording .mic .ico-stop { display: block; }
.dock.recording .mic-ring { opacity: .55; }
.dock.processing .mic .ico-mic { display: none; }
.dock.processing .mic .spinner { display: block; }
.dock.processing .mic { pointer-events: none; opacity: .9; }
.dock.recording .dock-side, .dock.processing .dock-side { opacity: 0; pointer-events: none; transform: scale(.6); }

.rec-pill { display: inline-flex; align-items: center; gap: 10px; background: var(--card); box-shadow: var(--shadow-lg); border-radius: 20px; padding: 8px 14px; margin-bottom: 12px;
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 16px; animation: popIn .25s var(--ease); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.meter { display: inline-flex; align-items: center; gap: 3px; height: 22px; }
.meter i { width: 3px; height: 4px; border-radius: 2px; background: var(--bad); transition: height .08s linear; }
.rec-hint { font-size: 12px; color: var(--text-2); font-weight: 500; }

.compose { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 608px; background: var(--card); border-radius: 26px; padding: 5px; box-shadow: var(--shadow-lg); animation: popIn .22s var(--ease); }
.compose input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 42px; padding: 0 4px; font-size: 17px; }
.compose-close { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.compose-send { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; transition: opacity .2s, transform .12s; }
.compose-send:disabled { opacity: .35; }
.compose-send:active { transform: scale(.9); }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* result card */
.result { position: fixed; left: calc(var(--safe-l) + 12px); right: calc(var(--safe-r) + 12px); bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--dock-h) + 4px);
  z-index: 25; max-width: 616px; margin: 0 auto; background: var(--card); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 16px;
  max-height: calc(100dvh - var(--safe-t) - var(--tabbar-h) - var(--safe-b) - var(--dock-h) - 40px); overflow-y: auto; animation: popIn .3s var(--ease);
  border: 1px solid var(--sep); }
.result .transcript { font-size: 13px; color: var(--text-2); font-style: italic; margin: 0 0 8px; }
.result .reply { font-size: 16px; line-height: 1.4; margin: 0; }
.result .questions { margin: 10px 0 0; padding: 10px 12px; background: var(--fill); border-radius: 12px; font-size: 15px; }
.result .questions p { margin: 0; }
.result .questions p + p { margin-top: 6px; }
.applied { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.applied li { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 8px 10px; background: var(--card-2); border-radius: 12px; }
.applied li .a-ico { font-size: 18px; }
.applied li .a-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.applied li .a-val { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 14px; }
.applied li.del .a-name { text-decoration: line-through; color: var(--text-2); }
.result-actions { display: flex; gap: 10px; margin-top: 14px; }
.btn { min-height: 46px; border-radius: 14px; padding: 0 18px; font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-gray { background: var(--fill); color: var(--text); }
.btn-danger { background: rgba(255, 59, 48, .12); color: var(--bad); }
.btn-block { width: 100%; }
.btn-flex { flex: 1; }
.skeleton { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--fill) 25%, var(--fill-2) 50%, var(--fill) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin: 8px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.processing-h { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mini-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--fill-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* ---------- TABBAR ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l); background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-3); font-size: 11px; font-weight: 600; transition: color .15s; }
.tabbar button.active { color: var(--accent); }
.tabbar button:active svg { transform: scale(.9); }
.tabbar svg { transition: transform .12s; }

/* ---------- SHEET ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 60; opacity: 0; transition: opacity .3s; }
.sheet-backdrop.open { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-width: 640px; margin: 0 auto; background: var(--bg); border-radius: 14px 14px 0 0;
  max-height: calc(100dvh - var(--safe-t) - 24px); display: flex; flex-direction: column; transform: translateY(100%); transition: transform .38s var(--ease); box-shadow: var(--shadow-lg); }
.sheet.open { transform: none; }
.sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 7px auto 0; flex: none; }
.sheet-body { overflow-y: auto; padding: 4px calc(var(--safe-r) + 16px) calc(var(--safe-b) + 20px) calc(var(--safe-l) + 16px); -webkit-overflow-scrolling: touch; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; position: sticky; top: 0; background: var(--bg); z-index: 2; margin: 0 -16px; padding: 0 16px; }
.sheet-head h2 { font-size: 17px; font-weight: 700; margin: 0; text-align: center; flex: 1; }
.sheet-head button { font-size: 17px; color: var(--accent); min-width: 80px; min-height: 44px; text-align: left; }
.sheet-head button.r { text-align: right; font-weight: 700; }

/* forms (iOS grouped list) */
.group { background: var(--card); border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
.group-h { font-size: 13px; text-transform: uppercase; color: var(--text-2); margin: 18px 16px 7px; letter-spacing: .3px; }
.group-f { font-size: 13px; color: var(--text-2); margin: -10px 16px 18px; line-height: 1.4; }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 16px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--sep); transform: scaleY(.5); transform-origin: top; }
.row label, .row .lbl { flex: 1; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row input[type=text], .row input[type=number], .row input[type=time], .row input:not([type]), .row select, .row input[inputmode] {
  border: 0; outline: 0; background: transparent; text-align: right; font-size: 17px; color: var(--text-2); min-width: 0; width: 32%; padding: 8px 0; -webkit-appearance: none; appearance: none; }
.row input:focus { color: var(--text); }
.row input[type=time] { width: auto; min-width: 90px; }
.row .unit { color: var(--text-3); font-size: 15px; margin-left: -6px; min-width: 46px; }
.row.full input { width: 100%; text-align: left; color: var(--text); }
.row textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: vertical; min-height: 80px; padding: 8px 0; font-size: 17px; }
.row-btn { width: 100%; text-align: left; color: var(--accent); font-size: 17px; }
.row-btn.danger { color: var(--bad); }
.row-nav { width: 100%; text-align: left; }
.row-nav .chev { color: var(--text-3); font-size: 20px; margin-left: 4px; }
.row .sub { display: block; font-size: 13px; color: var(--text-2); }
.row .right { color: var(--text-2); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; z-index: 1; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--fill-2); border-radius: 16px; transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .25s var(--ease); }
.switch input:checked + span { background: #34C759; }
.switch input:checked + span::after { transform: translateX(20px); }

/* segmented */
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; margin-bottom: 16px; overflow-x: auto; }
.seg button { flex: 1; min-height: 34px; border-radius: 7px; font-size: 14px; font-weight: 600; white-space: nowrap; padding: 0 8px; transition: background .2s; }
.seg button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* food items in edit sheet */
.item-card { background: var(--card); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.item-card .row.full input { font-weight: 600; }
.macro-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: .5px solid var(--sep); }
.macro-grid label { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.macro-grid label + label { border-left: .5px solid var(--sep); }
.macro-grid input { width: 100%; border: 0; outline: 0; background: transparent; text-align: center; font-size: 17px; font-weight: 600; padding: 4px 0; color: var(--text); }
.item-remove { color: var(--bad); width: 36px; height: 36px; display: grid; place-items: center; flex: none; }

/* ---------- VERLAUF ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.kpi .k { font-size: 12px; color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v small { font-size: 12px; color: var(--text-2); font-weight: 600; letter-spacing: 0; }
.kpi .v { font-size: 21px; font-weight: 800; margin-top: 4px; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .v.good { color: var(--good); }
.kpi .v.bad { color: var(--bad); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-size: 10px; fill: var(--text-2); font-family: inherit; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--sep); stroke-width: 1; }
.chart .tgt { stroke: var(--text-2); stroke-width: 1.2; stroke-dasharray: 4 3; }
.chart .avg { fill: none; stroke: var(--weight); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { fill: var(--card); stroke: var(--weight); stroke-width: 1.6; }
.chart .kbar { fill: var(--kcal); opacity: .5; }
.chart .kbar.over { fill: var(--bad); opacity: 1; }
.chart .kbar.sel, .chart .hit-col:active + .kbar { opacity: .7; }
.chart .hit { cursor: pointer; fill: transparent; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.dot { width: 8px; height: 8px; border-radius: 50%; border: 1.6px solid var(--weight); }
.p-hits { display: grid; grid-template-columns: repeat(15, 1fr); gap: 5px; margin-top: 4px; }
.p-hits button { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; min-width: 0; }
.p-hits .hit { background: var(--good); }
.p-hits .miss { background: var(--bad); opacity: .8; }
.p-hits .none { background: var(--fill); }
.weeks { display: grid; gap: 12px; }
.week { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.week-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.week-h b { font-size: 16px; }
.week-h span { font-size: 13px; color: var(--text-2); }
.week-g { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.week-g div { font-size: 12px; color: var(--text-2); font-weight: 600; }
.week-g b { display: block; font-size: 17px; color: var(--text); margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.week-g b.good { color: var(--good); }
.week-g b.bad { color: var(--bad); }
.daylist { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.day-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; width: 100%; padding: 12px 16px; min-height: 56px; text-align: left; position: relative; font-variant-numeric: tabular-nums; }
.day-row + .day-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--sep); transform: scaleY(.5); transform-origin: top; }
.day-row:active { background: var(--fill); }
.day-row .d { font-weight: 600; font-size: 15px; }
.day-row .d small { display: block; color: var(--text-2); font-weight: 500; font-size: 12px; }
.day-row .c { font-size: 14px; text-align: right; }
.day-row .c small { display: block; color: var(--text-2); font-size: 12px; }
.day-row .pm { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.day-row .pm.hit { background: var(--good); }
.day-row .pm.miss { background: var(--bad); }
.day-row .pm.none { background: var(--fill); }
.day-row .chev { color: var(--text-3); font-size: 18px; }

/* ---------- SETTINGS ---------- */
.code-box { font: 14px/1.3 ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; color: var(--text); flex: 1; padding: 6px 0; user-select: all; -webkit-user-select: all; }
.copy-btn { color: var(--accent); font-weight: 600; font-size: 15px; min-height: 40px; padding: 0 4px; flex: none; }
.steps { margin: 0; padding: 14px 16px 14px 36px; font-size: 15px; line-height: 1.45; }
.steps li + li { margin-top: 8px; }
.steps code { font: 13px ui-monospace, "SF Mono", Menlo, monospace; background: var(--fill); padding: 1px 5px; border-radius: 5px; }
.notice { display: flex; gap: 10px; padding: 12px 16px; font-size: 14px; line-height: 1.4; color: var(--text-2); }
.notice b { color: var(--text); }
.status-pill { font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 10px; background: var(--fill); color: var(--text-2); white-space: nowrap; }
.status-pill.on { background: rgba(52, 199, 89, .16); color: var(--good); }
.status-pill.off { background: rgba(255, 59, 48, .12); color: var(--bad); }
.foot { text-align: center; color: var(--text-3); font-size: 12px; margin: 24px 0 8px; }

/* toast */
.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); transform: translate(-50%, -160%); opacity: 0; z-index: 90; background: var(--card); color: var(--text); box-shadow: var(--shadow-lg);
  padding: 12px 18px; border-radius: 22px; font-size: 15px; font-weight: 600; max-width: calc(100vw - 32px); width: max-content; transition: transform .35s var(--ease), opacity .25s; text-align: center; border: 1px solid var(--sep); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.err { color: var(--bad); }

@media (min-width: 700px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 360px) {
  .keypad { grid-template-columns: repeat(3, 68px); gap: 12px 20px; }
  .keypad button { width: 68px; height: 68px; }
  .kpi .v { font-size: 18px; }
  .ring-val { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.row .switch { flex: none; width: 51px; }
.row-nav .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================= GAMIFICATION ================= */
.ct-right { text-transform: none; letter-spacing: 0; font-weight: 600; }
.hint { font-size: 13px; color: var(--text-2); margin: 10px 2px 0; line-height: 1.4; }

/* status strip */
.strip { display: flex; align-items: center; gap: 10px; width: 100%; margin: 4px 0 2px; text-align: left; }
.flame { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px 6px 9px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); font-size: 17px; flex: none; filter: grayscale(1); opacity: .6; transition: transform .2s; }
.flame.on { filter: none; opacity: 1; background: linear-gradient(135deg, rgba(255,149,0,.18), rgba(255,59,48,.14)); }
.flame.on b { color: #FF7A00; }
.flame.on .flame-ico { animation: flicker 1.8s ease-in-out infinite; display: inline-block; transform-origin: 50% 90%; }
.flame.risk { animation: riskPulse 1.4s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.08) rotate(-3deg); } 60% { transform: scale(.96) rotate(2deg); } }
@keyframes riskPulse { 50% { box-shadow: 0 0 0 4px rgba(255, 59, 48, .25); } }
.lvl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.lvl-top { font-size: 13px; color: var(--text-2); display: flex; gap: 4px; align-items: baseline; white-space: nowrap; overflow: hidden; }
.lvl-top b { color: var(--text); }
.lvl-xp { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 12px; }
.lvl-bar { display: block; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.lvl-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #FFB800, var(--accent)); transition: width 1s var(--ease); }
.lvl-bar.big { height: 10px; border-radius: 5px; margin: 10px 0 6px; }

.banner { display: flex; gap: 12px; align-items: center; border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; line-height: 1.35; animation: popIn .35s var(--ease); }
.banner.risk { background: linear-gradient(135deg, rgba(255,149,0,.16), rgba(255,59,48,.16)); border: 1px solid rgba(255,59,48,.3); }
.banner .b-ico { font-size: 26px; animation: flicker 1.2s infinite; }

/* hero rings */
.hero { padding: 16px 16px 14px; }
.hero-row { display: flex; align-items: center; gap: 14px; }
.rings-wrap { width: 46%; max-width: 190px; flex: none; }
.rings3 { width: 100%; height: auto; display: block; overflow: visible; }
.rings3 .prog { transition: stroke-dashoffset 1.1s var(--ease); }
.rings3 g.closed .prog { filter: drop-shadow(0 0 5px var(--rc)); animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { filter: drop-shadow(0 0 9px var(--rc)); } }
.ring-legend { flex: 1; min-width: 0; display: grid; gap: 10px; }
.rl { display: flex; gap: 8px; align-items: flex-start; }
.rl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex: none; }
.rl-name { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .3px; }
.rl-check { color: var(--good); }
.rl-val { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rl-val b { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.rl-sub { font-size: 12px; color: var(--text-2); }

/* score */
.score-card { display: flex; gap: 16px; align-items: center; }
.score-left { text-align: center; flex: none; width: 92px; }
.score-num { font-size: 54px; font-weight: 800; letter-spacing: -2px; line-height: 1; margin-top: 4px; font-variant-numeric: tabular-nums; transition: color .4s; }
.score-band-lbl { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; margin-top: 2px; }
.score-right { flex: 1; min-width: 0; }
.verdict { font-size: 16px; font-weight: 700; line-height: 1.3; }
.band { position: relative; height: 6px; border-radius: 3px; margin: 12px 0 10px; background: linear-gradient(90deg, var(--bad) 0%, var(--fat) 40%, var(--ok) 70%, var(--good) 85%, var(--good) 100%); }
.band-mark { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--text); transform: translate(-50%, -50%); transition: left 1s var(--ease); }
.score-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 12px; color: var(--text-2); }
.score-parts b { color: var(--text); font-variant-numeric: tabular-nums; }

/* suggestions */
.sugs { display: grid; gap: 8px; }
.sug { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card-2); border-radius: 14px; padding: 10px 10px 10px 14px; min-height: 56px; transition: transform .12s, opacity .2s; }
.sug:active { transform: scale(.98); }
.sug:disabled { opacity: .5; }
.sug-name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-name small, .sug-val small { display: block; font-weight: 500; font-size: 12px; color: var(--text-2); }
.sug-val { text-align: right; font-weight: 700; color: var(--protein); font-size: 15px; white-space: nowrap; }
.sug-add { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 600; line-height: 1; flex: none; }

/* diary */
.diary { padding: 0; overflow: hidden; }
.macro-split { padding: 14px 16px 12px; border-bottom: .5px solid var(--sep); }
.ms-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--fill); gap: 2px; }
.ms-bar i { display: block; height: 100%; transition: width .9s var(--ease); }
.ms-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.ms-legend > span { white-space: nowrap; }
.ms-legend .ms-l { display: flex; align-items: center; gap: 5px; font-weight: 600; margin-bottom: 1px; }
.ms-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.ms-legend b { color: var(--text); }
.meal + .meal { border-top: 6px solid var(--bg); }
.meal-h { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px 4px; font-weight: 700; font-size: 16px; }
.meal-tot { font-size: 13px; color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.d-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 16px; min-height: 52px; position: relative; }
.d-item:active { background: var(--fill); }
.d-item + .d-item::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--sep); transform: scaleY(.5); }
.d-main { flex: 1; min-width: 0; }
.d-name { display: block; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-meta { display: block; font-size: 12px; color: var(--text-2); }
.d-kcal { text-align: right; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.d-kcal small { display: block; font-size: 12px; color: var(--protein); font-weight: 600; }
.d-add { display: block; width: 100%; text-align: left; padding: 10px 16px 12px; color: var(--accent); font-weight: 600; font-size: 15px; min-height: 44px; }

/* verlauf */
.eta { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--fill); font-size: 14px; }
.chart .avg.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .kbar.in { fill: var(--good); opacity: .85; }
.chart .kbar.grow { transform-box: fill-box; transform-origin: bottom; animation: grow .6s var(--ease) both; }
@keyframes grow { from { transform: scaleY(0); } }
.chart .band-zone { fill: var(--good); opacity: .08; }
.hm { display: grid; grid-template-columns: 18px 1fr; grid-template-rows: auto 1fr; gap: 4px 4px; }
.hm-months { grid-column: 1 / 3; display: grid; grid-template-columns: 18px repeat(var(--weeks), 1fr); font-size: 10px; color: var(--text-2); white-space: nowrap; height: 13px; }
.hm-days { display: grid; grid-template-rows: repeat(7, 1fr); font-size: 9px; color: var(--text-2); align-items: center; gap: 3px; }
.hm-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); grid-template-columns: repeat(var(--weeks), 1fr); gap: 3px; }
.hm-cell { aspect-ratio: 1; border-radius: 3px; background: var(--fill); position: relative; min-width: 0; padding: 0; }
.hm-cell.future { background: transparent; }
.hm-cell i { position: absolute; inset: -2px; border: 2px solid var(--text); border-radius: 4px; }
.heat-legend { align-items: center; gap: 4px !important; justify-content: flex-end; }
.heat-legend i { width: 11px !important; height: 11px !important; border-radius: 3px !important; opacity: .85; }
.week-h > div { display: flex; flex-direction: column; }
.grade { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; }
.week-best { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.week-best b { color: var(--text); }
.day-row .sc { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid; display: grid; place-items: center; font-weight: 800; font-size: 13px; }

/* erfolge */
.level-card { display: flex; gap: 16px; align-items: center; }
.lc-badge { width: 76px; height: 76px; flex: none; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(135deg, #FFB800, var(--accent)); box-shadow: 0 8px 20px rgba(255, 90, 31, .35); transform: rotate(-4deg); }
.lc-badge span { color: #fff; font-size: 36px; font-weight: 900; transform: rotate(4deg); }
.lc-main { flex: 1; min-width: 0; }
.lc-name { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.lc-sub { font-size: 14px; color: var(--text-2); }
.lc-next { font-size: 13px; color: var(--text-2); }
.lc-next b { color: var(--text); }
.sc-top { display: flex; align-items: center; gap: 14px; }
.sc-flame { font-size: 48px; filter: grayscale(1); opacity: .5; }
.sc-flame.on { filter: none; opacity: 1; animation: flicker 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.sc-num { font-size: 34px; font-weight: 900; color: #FF7A00; letter-spacing: -1px; line-height: 1; }
.sc-num small { font-size: 16px; font-weight: 700; }
.sc-sub { font-size: 14px; color: var(--text-2); margin-top: 3px; }
.week-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; text-align: center; }
.wdot span { width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: #fff; font-weight: 800; font-size: 15px; }
.wdot.done span { background: linear-gradient(135deg, #FFB800, #FF5A1F); box-shadow: 0 3px 10px rgba(255, 122, 0, .35); }
.wdot.today span { border: 2.5px dashed #FF7A00; background: transparent; }
.wdot.future span { opacity: .45; }
.wdot small { display: block; font-size: 11px; color: var(--text-2); margin-top: 4px; font-weight: 600; }
.xp-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 15px; color: var(--text-2); border-top: .5px solid var(--sep); }
.xp-row:first-of-type { border-top: 0; }
.xp-row.on { color: var(--text); }
.xp-row.on b { color: var(--good); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { background: var(--card); border-radius: 16px; padding: 14px 8px 12px; text-align: center; box-shadow: var(--shadow); }
.badge .b-ico { font-size: 34px; line-height: 1.1; filter: grayscale(1); opacity: .35; }
.badge.on .b-ico { filter: none; opacity: 1; animation: popIn .5s var(--ease) both; }
.badge.on { background: linear-gradient(160deg, rgba(255, 184, 0, .14), var(--card) 60%); border: 1px solid rgba(255, 184, 0, .35); }
.badge .b-name { font-size: 13px; font-weight: 700; margin-top: 6px; line-height: 1.2; }
.badge:not(.on) .b-name { color: var(--text-2); }
.badge .b-desc { font-size: 11px; color: var(--text-2); margin-top: 3px; line-height: 1.25; }
.lv-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-top: .5px solid var(--sep); font-weight: 600; color: var(--text-3); }
.lv-row:first-child { border-top: 0; }
.lv-row.on { color: var(--text); }
.lv-row small { font-size: 12px; color: var(--text-2); font-weight: 500; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 95; }
@media (max-width: 360px) {
  .rl-val b { font-size: 18px; }
  .score-num { font-size: 46px; }
  .badges { grid-template-columns: repeat(2, 1fr); }
}
.result { overflow-x: hidden; }
.applied li { min-width: 0; }
.applied li .a-val { flex: none; }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }
