/* Midi – Design: hell, ruhig, eine Farbe. Weisse Karten auf hellgrauem Grund, 1px Linien statt Schatten,
   Inter mit tabellarischen Ziffern, Icons als dünne Strichzeichnungen. */
:root {
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --card-2: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --line: #E5E7EB;
  --primary: #0B7A54;        /* Midi-Grün */
  --primary-2: #075C3F;
  --primary-ink: #FFFFFF;
  --primary-soft: #E7F3EE;
  --green: #0B7A54;
  --green-soft: #E7F3EE;
  --red: #B91C1C;
  --red-soft: #FEE2E2;
  --amber: #B45309;
  --amber-soft: #FEF3C7;
  /* Alte Namen, auf die neue Palette gelegt */
  --ink-on-lime: #0B7A54;
  --lime: #E7F3EE; --lime-2: #D5EBE1;
  --orange: #B45309; --orange-2: #B45309; --orange-soft: #FEF3C7;
  --carb: #2563EB; --prot: #DB2777; --fat: #7C3AED;
  --radius: 20px;
  --radius-sm: 14px;
  --touch: 52px;
  --font: 17px;
  --shadow: none;
  --nav-h: 76px;
}
* { box-sizing: border-box; }
html { font-size: var(--font); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
body.no-nav { padding-bottom: 24px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
/* Kein Zoom bei schnellem Doppeltipp auf Bedienelemente (Zwei-Finger-Zoom bleibt möglich) */
html, body, button, a, input, select, textarea, label, .tile, .chip, .item, .nav, .pinpad, .segment, .stepper, .iconpick, .parsed-row, .hero, .card { touch-action: manipulation; }
button, .tile, .chip, .nav a, .pinpad button { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
a { color: var(--primary); }
[hidden] { display: none !important; }
.mono, .num b, .kcal, .stats b, .stepper .value, .diff, .pill, .chip b, .tile.fav .sub, .hero .side b, .ring .num small {
  font-family: inherit; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}

/* Icons (inline SVG) */
.svgi { width: 24px; height: 24px; display: inline-block; vertical-align: -6px; flex: none; }
.svgi.sm { width: 18px; height: 18px; vertical-align: -4px; }
.mark { display: block; }
.wordmark { font-weight: 700; letter-spacing: -.045em; line-height: 1; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 8px; background: var(--bg);
}
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: var(--text); }
.brand .mark { width: 28px; height: 28px; }
.brand .wordmark { font-size: 1.35rem; }
.claim { flex: 1; text-align: center; font-size: .78rem; font-weight: 500; color: var(--muted); padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--primary); font-weight: 700; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Layout */
.screen { max-width: 560px; margin: 0 auto; padding: 4px 16px 32px; }
.screen > * + * { margin-top: 14px; }
.screen > .date + .hero { margin-top: 8px; }
h1 { font-size: 1.45rem; margin: 4px 0 8px; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: .72rem; margin: 24px 0 10px; color: var(--muted); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.row > * { flex: 1; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: var(--touch); padding: 12px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card); font-weight: 600; font-size: 1rem; text-decoration: none; color: inherit; transition: transform .08s, background .12s;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:active { background: var(--primary-2); }
.btn.lime { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: .92rem; width: auto; }
.btn.big { flex-direction: column; min-height: 96px; border-radius: 16px; font-size: .9rem; gap: 8px; padding: 14px 8px; }
.btn.big .ico { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: var(--primary); font-size: 1.4rem; line-height: 1; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 10px; }

/* Kacheln & Chips */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile {
  min-height: var(--touch); padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card);
  text-align: left; display: flex; align-items: center; gap: 10px; font-weight: 600;
}
.tile.selected { border-color: var(--primary); background: var(--primary-soft); }
.tile .ico { font-size: 1.4rem; display: inline-flex; align-items: center; justify-content: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: .92rem; font-weight: 500; text-align: left; }
.chip b { font-weight: 600; color: var(--muted); }
.chips.time { margin-top: 8px; }
.chips.time .chip { min-height: 38px; padding: 4px 12px; font-size: .85rem; border-radius: 10px; }
.chips.time .chip.selected { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
input[type=time] { -webkit-appearance: none; appearance: none; }
.segment { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; gap: 4px; }
.segment button { flex: 1; min-height: 42px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; color: var(--muted); }
.segment button.selected { background: var(--primary); color: var(--primary-ink); }
.segment.meal-type { margin-top: 12px; }
.segment.meal-type button { font-size: .8rem; min-height: 40px; padding: 0 2px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: .78rem; color: var(--muted); }

/* Formulare */
label.field { display: block; }
label.field span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=email], input[type=number], input[type=password], input[type=date], input[type=tel], select, textarea {
  width: 100%; min-height: var(--touch); padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card); font-size: 1rem;
}
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent); border-color: var(--primary); }
input[type=range] { width: 100%; height: var(--touch); accent-color: var(--primary); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: var(--touch); height: var(--touch); border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 1.5rem; font-weight: 600; flex: none; }
.stepper .value { flex: 1; text-align: center; font-size: 2.4rem; font-weight: 700; }
.stepper .value small { font-size: .95rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stepper .value input[type=number] { width: 6ch; min-height: 0; padding: 0; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: transparent; font: inherit; font-size: 2.4rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -.02em; -moz-appearance: textfield; appearance: textfield; }
.stepper .value input[type=number]:focus { outline: none; border-bottom-color: var(--primary); }
.stepper .value input::-webkit-outer-spin-button, .stepper .value input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
label.check { display: flex; align-items: center; gap: 10px; min-height: var(--touch); font-weight: 500; }
label.check input { width: 24px; height: 24px; accent-color: var(--primary); }

/* Hero (Heute): weisse Karte, Ring mit verfügbaren kcal, drei Kennzahlen */
.date { font-size: .8rem; font-weight: 500; color: var(--muted); }
.hero { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.rings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.rings > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring { position: relative; width: 140px; height: 140px; }
.ring svg { width: 140px; height: 140px; transform: rotate(-90deg); display: block; }
.ringlabel { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ring .track { stroke: var(--primary-soft); }
.ring .bar { stroke: var(--primary); transition: stroke-dasharray .5s; }
.ring.over .bar { stroke: var(--red); }
.ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.ring .num b { font-size: 1.75rem; line-height: 1; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ring .num span { font-size: .68rem; font-weight: 500; color: var(--muted); }
@media (max-width: 360px) { .ring, .ring svg { width: 120px; height: 120px; } .ring .num b { font-size: 1.5rem; } }
.ring.over .num b { color: var(--red); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats b { display: block; font-size: 1.05rem; font-weight: 600; }
.stats span { font-size: .68rem; color: var(--muted); font-weight: 500; }
.hero-stats { width: 100%; padding-top: 14px; border-top: 1px solid var(--line); }
.stats b.neg { color: var(--red); }
.card.calib { border-color: color-mix(in srgb, var(--primary) 35%, transparent); background: var(--primary-soft); }

/* Abschnittskopf: Titel links, Aktion rechts */
.sechead { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.sechead h2 { margin: 0; }
.sechead a, .sechead button { font-size: .85rem; font-weight: 600; color: var(--primary); text-decoration: none; background: none; border: 0; padding: 6px 0; min-height: 32px; }

/* Listen */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px; background: var(--card); border-radius: var(--radius-sm); border: 1px solid var(--line); }
.item .ico { font-size: 1.25rem; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg); flex: none; color: var(--text); }
.item .ico .svgi { width: 20px; height: 20px; vertical-align: 0; }
.item .ico.act { background: var(--primary-soft); color: var(--primary); }
.listcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; }
.listcard .item { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; min-height: 60px; }
.listcard .item:last-child { border-bottom: 0; }
.listcard .item .del { width: 34px; height: 34px; font-size: 1rem; }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.item .kcal { font-weight: 600; white-space: nowrap; font-size: 1rem; }
.item .kcal.plus { color: var(--primary); }
.item .del { width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; border-radius: 50%; flex: none; }
.item .star { font-size: 1.15rem; }
.diff { font-weight: 600; }
.diff.down { color: var(--primary); }
.diff.up { color: var(--red); }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 10px; display: block; }
.thumb-lg { width: 96px; height: 96px; object-fit: cover; border-radius: 16px; flex: none; }
.item .ico .thumb { margin: 0 auto; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-weight: 600; font-size: .8rem; }
.badge.ok { background: var(--primary-soft); color: var(--primary); }
.badge.err { background: var(--red-soft); color: var(--red); }

.banner { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--amber-soft); line-height: 1.45; border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent); }
.banner.row { display: flex; align-items: center; gap: 12px; } /* Symbol + Text nebeneinander */
.banner.row > .svgi { flex: 0 0 auto; width: 22px; height: 22px; color: var(--primary); }
.banner.row > span { flex: 1; min-width: 0; }
.banner.row { padding: 10px 14px; font-size: .92rem; line-height: 1.35; }
.banner.ok { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.banner.err { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.error { color: var(--red); font-weight: 600; min-height: 1.4em; }

/* Login */
.login-hero { padding: 36px 20px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login-hero .mark { width: 72px; height: 72px; }
.login-hero .wordmark { font-size: 2.6rem; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto; }
.pinpad button { height: 60px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; }
.pindots { display: flex; justify-content: center; gap: 14px; margin: 8px 0 16px; }
.pindots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary); display: inline-block; }
.pindots i.on { background: var(--primary); }

/* Charts */
.chart { width: 100%; height: 200px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; }
.chart .dot { fill: var(--primary); }
.chart text { fill: var(--muted); font-size: 12px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line); }
.chart .line.forecast { stroke-dasharray: 6 6; opacity: .7; }
.chart .grid.target { stroke: var(--amber); stroke-dasharray: 4 4; }
.chart .bar.pos { fill: var(--primary); }
.chart .bar.neg { fill: var(--red); }
.chart .line.weight { stroke: var(--muted); stroke-width: 2; }
.chart .dot.weight { fill: var(--muted); }

/* Favoriten */
.tile.fav { position: relative; min-height: 72px; }
.tile.fav .ico { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg); flex: none; }
.tile.fav .ico .thumb { width: 40px; height: 40px; }
.tile.fav .ico .svgi { width: 20px; height: 20px; vertical-align: 0; }
.tile.fav .body { display: flex; flex-direction: column; min-width: 0; }
.tile.fav .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.fav .sub { font-size: .78rem; color: var(--muted); font-weight: 500; }
.tile.fav.editing { border-color: var(--red); }
.tile.fav .favdel { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.tile.fav:disabled { opacity: .5; }

/* Toast, Sheet, Nav */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: .85rem; z-index: 20; max-width: 80vw;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 6px 20px -8px rgba(0,0,0,.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast.undo-only { background: transparent; padding: 0; box-shadow: none; max-width: none; }
.toast .undo { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 600; font-size: .9rem; white-space: nowrap; box-shadow: 0 6px 20px -8px rgba(11, 122, 84, .6); }
body.kbd .toast { bottom: 16px; }
.sheet { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 30; display: flex; align-items: flex-end; }
.sheet .panel { width: 100%; max-width: 560px; margin: 0 auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet .panel > * + * { margin-top: 10px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--muted); text-decoration: none; font-weight: 600; }
.back .svgi { width: 20px; height: 20px; vertical-align: 0; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); transition: transform .15s ease;
}
body.kbd .nav { transform: translateY(110%); }
.nav ul { list-style: none; margin: 0 auto; padding: 0; max-width: 560px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 56px; text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 500; border-radius: 12px; }
.nav a .ico { display: flex; align-items: center; justify-content: center; line-height: 1; }
.nav a .ico .svgi { vertical-align: 0; }
.nav a.active { color: var(--primary); font-weight: 600; }
.nav a.active .svgi { stroke-width: 2.1; }
.nav a.plus { color: #fff; }
.nav a.plus .ico { width: 54px; height: 54px; border-radius: 50%; background: var(--primary); color: #fff; margin-top: -16px; }
.nav a.plus .ico .svgi { width: 26px; height: 26px; }

/* Favoriten kompakt: drei Spalten, Icon oben */
.tiles.favs { grid-template-columns: repeat(3, 1fr); }
.tile.fav { flex-direction: column; align-items: center; text-align: center; padding: 10px 6px 8px; gap: 6px; min-height: 100px; }
.tile.fav .ico { width: 40px; height: 40px; font-size: 1.5rem; }
.tile.fav .body { align-items: center; }
.tile.fav .title { font-size: .78rem; font-weight: 600; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.tile.fav .sub { font-size: .72rem; }
/* Icon-Auswahl im Sheet */
.sheet .panel { max-height: 88vh; overflow-y: auto; }
.iconpick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.iconpick button { height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.iconpick button .svgi, .tile.fav .ico .svgi, .item .ico .svgi { width: 22px; height: 22px; vertical-align: 0; }
.tile.fav .ico, .item .ico { color: var(--primary); }
.iconpick button.selected { border-color: var(--primary); background: var(--primary-soft); }

/* Etappe 6: erkannte Einträge aus dem Textfeld */
.parsed-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.parsed-row:last-child { border-bottom: 0; }
.parsed-row.unsure { background: var(--amber-soft); margin: 0 -8px; padding: 10px 8px; border-radius: 12px; }
.parsed-row .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; color: var(--primary); }
.parsed-row .ico.act { background: var(--primary-soft); }
.parsed-row .ico .svgi { width: 20px; height: 20px; vertical-align: 0; }
.parsed-row input[type=range] { height: 40px; }
.question { padding: 12px; border-radius: 14px; background: var(--primary-soft); margin-bottom: 12px; }
.question .qopt { flex-direction: column; gap: 2px; min-height: 64px; background: var(--card); }

/* Etappe 7: Coach-Karte und Wochenbriefe */
.card.tips { transition: transform .2s ease, opacity .2s ease; touch-action: pan-y; }
.card.tips.gone { opacity: 0; transform: translateX(-120%); }
.tiplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tip { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; line-height: 1.4; }
.tip .ico { flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.tip .ico .svgi { width: 18px; height: 18px; vertical-align: 0; }
.sechead button#tipsClose { color: var(--muted); font-size: 1rem; }
.nlframe { width: 100%; height: 70vh; border: 0; border-radius: 14px; background: #fff; }

/* Vollbild-Hinweis während die KI arbeitet */
.busy-overlay { position: fixed; inset: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.busy-box { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 28px 28px 24px; width: min(320px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; box-shadow: 0 20px 50px -20px rgba(15, 23, 42, .25); }
.busy-box .mark { width: 72px; height: 72px; }
.busy-title { font-weight: 600; font-size: 1.05rem; }
.mark.spin .arc { transform-origin: 28px 28px; animation: midi-spin 1.1s linear infinite; }
.mark.spin .dot { transform-origin: 28px 28px; animation: midi-pulse 1.1s ease-in-out infinite; }
@keyframes midi-spin { to { transform: rotate(360deg); } }
@keyframes midi-pulse { 0%, 100% { transform: scale(.8); opacity: .7; } 50% { transform: scale(1.25); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mark.spin .arc, .mark.spin .dot { animation: none; } }

/* Einträge antippen zum Bearbeiten */
.item .body.edit { background: none; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 40px; }
.tile#favIco .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; color: var(--primary); }

/* Haupteingabefeld der Erfassung: deutlich sichtbar mit grünem Rand */
input.hero-input, input[type=text].hero-input { min-height: 60px; font-size: 1.1rem; font-weight: 500; border: 2px solid var(--primary); border-radius: 16px; background: var(--card); box-shadow: 0 0 0 4px var(--primary-soft); padding: 12px 18px; }
input.hero-input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 28%, transparent); }
input.hero-input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); font-weight: 400; }

/* Nährwerte */
.nutfields { margin-top: 12px; }
.nutfields summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--primary); min-height: 40px; display: flex; align-items: center; }
.nutgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 6px; }
.nutgrid .field span { font-size: .72rem; }
.nutgrid input { min-height: 44px; padding: 6px 12px; }
.nutmini { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: end; width: 100%; padding-top: 12px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.nm { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nm-head { display: flex; flex-direction: column; font-size: .66rem; color: var(--muted); line-height: 1.2; }
.nm-head b { color: var(--text); font-size: .74rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nm-bar, .nutbar { height: 6px; border-radius: 3px; background: var(--primary-soft); overflow: hidden; }
.nm-bar i, .nutbar i { display: block; height: 100%; border-radius: 3px; }
.nm-more { font-size: .78rem; font-weight: 600; color: var(--primary); white-space: nowrap; padding-bottom: 2px; }
.nutcard { padding: 6px 16px; }
.nutrow { padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.nutrow:last-child { border-bottom: 0; }
.nutrow.sub .nutname { padding-left: 14px; color: var(--muted); font-weight: 500; }
.nutline { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.nutname { font-weight: 600; font-size: .95rem; }
.nutnums { display: grid; grid-template-columns: repeat(3, 58px); text-align: right; font-size: .9rem; font-variant-numeric: tabular-nums; }
.nutnums .neg { color: var(--red); font-weight: 600; }
.nuthead { padding: 8px 0 2px; margin-bottom: 0; }
.nuthead .nutnums { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Honeypot: für Menschen unsichtbar, Bots füllen es */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Installationshinweis */
.install-hint.compact { padding: 14px 16px; }
.install-hint .install-close { color: var(--muted); font-size: 1rem; }

/* Tipp-Bewertung */
.tip { align-items: flex-start; }
.tip .tiptext { flex: 1; }
.tiprate { display: inline-flex; gap: 4px; flex: none; }
.tiprate button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.tiprate button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* Joker-Tag */
.jokerline { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .85rem; padding-top: 10px; border-top: 1px solid var(--line); }
.jokerline.on { color: var(--primary); }
.jokerline .svgi { width: 16px; height: 16px; vertical-align: -3px; color: var(--amber); }
.jokerline button { background: none; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: .8rem; font-weight: 600; color: var(--primary); min-height: 34px; white-space: nowrap; }
.chart .bar.joker { opacity: .35; stroke: var(--muted); stroke-dasharray: 3 2; }

/* Nachträglich erfassen */
.daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.daynav button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 1.1rem; }
.daynav button:disabled { opacity: .3; }
.daynav a { font-weight: 600; text-decoration: none; margin-left: 6px; }
.datebar { margin-top: -4px; }
.datebar input[type=date] { width: 100%; min-height: 48px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); font: inherit; }

/* Vorschläge unter den Knöpfen */
.chips.suggest { align-items: center; }
.chips-title { flex-basis: 100%; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chip.more { color: var(--primary); border-style: dashed; }
.chip .svgi { width: 16px; height: 16px; vertical-align: -3px; color: var(--primary); }

/* Wochenleiste Mo–So */
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: 100%; padding-top: 12px; border-top: 1px solid var(--line); }
.wd { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); }
.wd-bar { position: relative; width: 100%; max-width: 34px; height: 30px; border-radius: 8px; background: var(--primary-soft); overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.wd-bar i { display: block; width: 100%; background: var(--primary); border-radius: 8px 8px 0 0; transition: height .3s; }
.wd.over .wd-bar { background: var(--red-soft); }
.wd.over .wd-bar i { background: var(--red); height: 100% !important; }
.wd.missing .wd-bar { background: transparent; border: 1.5px dashed var(--line); }
.wd.future .wd-bar { background: var(--bg); }
.wd.joker .wd-bar { background: var(--amber-soft); }
.wd.joker .wd-bar i { background: var(--amber); }
.wd.joker .wd-bar b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .9rem; }
.wd-day { font-size: .66rem; font-weight: 600; letter-spacing: .04em; }
.wd.today .wd-day { color: var(--primary); }
.wd.today .wd-bar { box-shadow: 0 0 0 2px var(--primary); }

/* Journal: Plus zum Duplizieren, Stern im Bearbeiten-Blatt */
.item .del.dup { color: var(--primary); font-size: 1.3rem; font-weight: 600; }
.favbtn { background: var(--primary-soft); color: var(--primary); border: 0; border-radius: 10px; padding: 6px 12px; font-weight: 600; font-size: .85rem; min-height: 36px; }

.sheet-actions { display: inline-flex; gap: 6px; }
.favbtn.danger { background: var(--red-soft); color: var(--red); padding: 6px 10px; }
.favbtn .svgi { width: 18px; height: 18px; vertical-align: -4px; }

.langs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.langs a.on { color: var(--primary); }
