/* ==========================================================================
   Lebensretter — Design-System v14
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #08080b;
  --bg-grad: radial-gradient(120% 60% at 50% -10%, rgba(124, 108, 255, .16), transparent 60%);
  --surface: #131318;
  --surface-2: #1b1b22;
  --surface-3: #24242d;
  --surface-glass: rgba(19, 19, 24, .72);
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #f5f5f7;
  --text-2: #a3a3ad;
  --text-3: #6c6c78;
  --accent: #8b7cff;
  --accent-2: #b3a8ff;
  --accent-soft: rgba(139, 124, 255, .15);
  --on-accent: #ffffff;
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, .14);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .14);
  --red: #fb6a6a;
  --red-soft: rgba(251, 106, 106, .14);
  --blue: #4ea8ff;
  --blue-soft: rgba(78, 168, 255, .14);
  --cyan: #38d6e8;
  --pink: #ff7ab6;
  --orange: #ff9d4d;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 24px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.32, 1.25, .5, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f3f6;
    --bg-grad: radial-gradient(120% 60% at 50% -10%, rgba(124, 108, 255, .12), transparent 60%);
    --surface: #ffffff;
    --surface-2: #f1f1f5;
    --surface-3: #e7e7ee;
    --surface-glass: rgba(255, 255, 255, .78);
    --line: rgba(15, 15, 30, .07);
    --line-2: rgba(15, 15, 30, .12);
    --text: #101016;
    --text-2: #5d5d6a;
    --text-3: #9393a0;
    --accent: #6a58f5;
    --accent-2: #5544e0;
    --accent-soft: rgba(106, 88, 245, .1);
    --green: #12a874;
    --green-soft: rgba(18, 168, 116, .1);
    --amber: #d48a00;
    --amber-soft: rgba(212, 138, 0, .1);
    --red: #e04848;
    --red-soft: rgba(224, 72, 72, .09);
    --blue: #2f86e6;
    --blue-soft: rgba(47, 134, 230, .1);
    --cyan: #109bb0;
    --shadow: 0 8px 24px rgba(20, 20, 40, .08);
    --shadow-lg: 0 24px 60px rgba(20, 20, 40, .18);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f3f6;
  --bg-grad: radial-gradient(120% 60% at 50% -10%, rgba(124, 108, 255, .12), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f1f1f5;
  --surface-3: #e7e7ee;
  --surface-glass: rgba(255, 255, 255, .78);
  --line: rgba(15, 15, 30, .07);
  --line-2: rgba(15, 15, 30, .12);
  --text: #101016;
  --text-2: #5d5d6a;
  --text-3: #9393a0;
  --accent: #6a58f5;
  --accent-2: #5544e0;
  --accent-soft: rgba(106, 88, 245, .1);
  --green: #12a874;
  --green-soft: rgba(18, 168, 116, .1);
  --amber: #d48a00;
  --amber-soft: rgba(212, 138, 0, .1);
  --red: #e04848;
  --red-soft: rgba(224, 72, 72, .09);
  --blue: #2f86e6;
  --blue-soft: rgba(47, 134, 230, .1);
  --cyan: #109bb0;
  --shadow: 0 8px 24px rgba(20, 20, 40, .08);
  --shadow-lg: 0 24px 60px rgba(20, 20, 40, .18);
}

* { 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; }
body {
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
svg { display: block; }
.num, .tnum { font-variant-numeric: tabular-nums; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }

.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }
.i.xs { width: 13px; height: 13px; stroke-width: 2.4; }
.i.lg { width: 24px; height: 24px; }

/* ---------------------------------------------------------------- App-Gerüst */

#app { max-width: 600px; margin: 0 auto; position: relative; }

.view {
  padding: calc(var(--safe-t) + 8px) 16px calc(var(--tabbar-h) + var(--safe-b) + 32px);
  min-height: 100vh;
  animation: viewIn .35s var(--ease);
}
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Kompakte Kopfleiste, erscheint beim Scrollen */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  padding-top: var(--safe-t);
  background: var(--surface-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.topbar.show { transform: none; opacity: 1; }
.topbar-inner { max-width: 600px; margin: 0 auto; height: 48px; display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 16px; }

/* Großer Titel */
.hero-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 2px 14px; }
.hero-head .eyebrow { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.hero-head h1 { font-family: var(--font-display); font-size: 32px; line-height: 1.08; letter-spacing: -.025em; font-weight: 750; margin: 0; }
.hero-head .actions { display: flex; gap: 8px; padding-bottom: 2px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); transition: transform .15s var(--ease), background .2s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn.accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.icon-btn .badge-dot { position: absolute; }

/* Tab-Leiste */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding-bottom: var(--safe-b);
  background: var(--surface-glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid var(--line);
}
.tabbar-inner { max-width: 600px; margin: 0 auto; height: var(--tabbar-h); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--text-3); padding: 6px 0; position: relative; transition: color .2s; }
.tab .i { width: 23px; height: 23px; stroke-width: 1.9; }
.tab.active { color: var(--text); }
.tab.active .i { stroke: var(--accent); }
.tab .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; font-weight: 700; }
.tab-ai { display: grid; place-items: center; }
.tab-ai .orb {
  width: 52px; height: 52px; border-radius: 18px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #8b7cff 0%, #5b8cff 55%, #38d6e8 100%);
  box-shadow: 0 8px 22px rgba(110, 110, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
  transform: translateY(-6px);
  transition: transform .2s var(--spring);
}
.tab-ai .orb .i { width: 25px; height: 25px; stroke: #fff; }
.tab-ai:active .orb { transform: translateY(-6px) scale(.92); }

/* ---------------------------------------------------------------- Bausteine */

.section { margin-top: 26px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 4px 10px; }
.section-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.section-head .link { font-size: 14px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 2px; }
.section-head .sub { font-size: 13px; color: var(--text-3); font-weight: 500; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  position: relative;
  min-width: 0;
}
.card + .card { margin-top: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card.tap { transition: transform .18s var(--ease); cursor: pointer; }
.card.tap:active { transform: scale(.985); }
.card-title { font-size: 13px; font-weight: 650; color: var(--text-2); display: flex; align-items: center; gap: 7px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em; }
.card-title .i { width: 16px; height: 16px; }
.card-title .right { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-3); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid2 > *, .grid3 > * { min-width: 0; }
.grid2 > .card + .card, .grid3 > .card + .card { margin-top: 0; }

.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 650; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; }
.wrap { flex-wrap: wrap; }
.center { text-align: center; }
.pre { white-space: pre-wrap; }

/* Liste im iOS-Stil */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; min-height: 52px;
  position: relative; min-width: 0;
  transition: background .15s;
}
.list-item + .list-item::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; height: 1px; background: var(--line); }
.list-item.no-icon + .list-item.no-icon::before, .list.plain .list-item + .list-item::before { left: 16px; }
.list-item.tap { cursor: pointer; }
.list-item.tap:active { background: var(--surface-2); }
.list-item .lead {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: var(--surface-3);
}
.list-item .lead .i { width: 17px; height: 17px; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title { font-weight: 560; overflow: hidden; text-overflow: ellipsis; }
.list-item .meta { font-size: 13px; color: var(--text-2); margin-top: 1px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.list-item .trail { color: var(--text-3); display: flex; align-items: center; gap: 6px; flex: none; font-size: 14px; }
.list-item .chev { color: var(--text-3); width: 16px; height: 16px; }
.list-label { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 18px 16px 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 14px;
  font-weight: 650; font-size: 15.5px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line);
  transition: transform .15s var(--ease), opacity .2s, background .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 6px 18px rgba(124, 108, 255, .3); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn.success { background: var(--green); color: #04130c; border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; gap: 6px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 9px; gap: 4px; }
.btn .i { width: 18px; height: 18px; }
.btn.sm .i { width: 16px; height: 16px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; min-width: 0; }
.btn.loading { pointer-events: none; color: transparent !important; position: relative; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.2px solid currentColor; border-color: var(--text-2) transparent var(--text-2) transparent; animation: spin .8s linear infinite; }
.btn.primary.loading::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 34px; padding: 0 13px; border-radius: 17px;
  background: var(--surface); border: 1px solid var(--line-2);
  font-size: 14px; font-weight: 560; color: var(--text);
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .n { font-size: 12px; color: var(--text-3); font-weight: 600; }
.chip.on .n { color: inherit; opacity: .6; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.accent { background: var(--accent-soft); color: var(--accent-2); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* Segmented Control */
.seg { display: flex; padding: 3px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); position: relative; }
.seg button { flex: 1; height: 34px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); position: relative; z-index: 1; transition: color .2s; min-width: 0; padding: 0 6px; white-space: nowrap; }
.seg button.on { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .18), 0 0 0 1px var(--line); }
.seg.sticky { position: sticky; top: calc(var(--safe-t) + 56px); z-index: 30; }
.seg-wrap { position: sticky; top: calc(var(--safe-t) + 48px); z-index: 30; padding: 8px 0; margin: 0 -16px 6px; padding-left: 16px; padding-right: 16px; }
.seg-wrap.stuck { background: var(--surface-glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }

/* Formulare */
.field { display: block; margin-top: 14px; min-width: 0; }
.field:first-child { margin-top: 0; }
.field > .label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 2px 6px; }
.field > .hint { font-size: 12.5px; color: var(--text-3); margin: 6px 2px 0; }
.input, .select, .textarea {
  width: 100%; min-width: 0; max-width: 100%;
  height: 48px; padding: 0 14px;
  border-radius: 13px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text);
  font-size: 16px; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%238a8a96' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
input[type="date"].input, input[type="time"].input { display: block; line-height: 48px; text-align: left; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid > * { min-width: 0; }
.form-grid .field { margin-top: 0; }
.form-grid + .form-grid, .form-grid + .field, .field + .form-grid { margin-top: 14px; }
.input-group { display: flex; align-items: center; gap: 8px; }
.input-group .input { flex: 1; }
.suffix-wrap { position: relative; }
.suffix-wrap .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 15px; pointer-events: none; }
.suffix-wrap .input { padding-right: 48px; }

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--surface-3); 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 2px 6px rgba(0, 0, 0, .25); transition: transform .25s var(--spring); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: var(--surface-3); outline: none; margin: 14px 0; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); border: 0; }
.range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 0; }

.stepper { display: flex; align-items: center; gap: 0; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 13px; height: 48px; overflow: hidden; }
.stepper button { width: 46px; height: 100%; display: grid; place-items: center; color: var(--text); }
.stepper button:active { background: var(--surface-3); }
.stepper input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; text-align: center; font-size: 17px; font-weight: 650; outline: none; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rating button { height: 58px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 22px; transition: transform .15s, background .2s; }
.rating button small { font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.rating button.on { background: var(--accent-soft); border-color: var(--accent); }
.rating button:active { transform: scale(.94); }

/* Fortschritt */
.bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; position: relative; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); transition: width .6s var(--ease); }
.bar.thin { height: 5px; }
.bar.thick { height: 12px; border-radius: 6px; }

.ring { position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.ring .val { transition: stroke-dashoffset 1s var(--ease); }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring .center b { font-family: var(--font-display); font-size: 22px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.ring .center small { font-size: 10.5px; color: var(--text-3); font-weight: 650; margin-top: 3px; text-transform: uppercase; letter-spacing: .05em; }

.metric b { font-family: var(--font-display); font-size: 26px; font-weight: 750; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.metric b small { font-size: 14px; font-weight: 600; color: var(--text-3); letter-spacing: 0; margin-left: 2px; }
.metric .lbl { font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-top: 3px; }

/* ---------------------------------------------------------------- Heute */

.today-hero {
  border-radius: var(--r-lg);
  padding: 18px;
  background:
    radial-gradient(140% 120% at 100% 0%, rgba(56, 214, 232, .22), transparent 55%),
    radial-gradient(120% 120% at 0% 100%, rgba(139, 124, 255, .32), transparent 60%),
    var(--surface);
  border: 1px solid var(--line-2);
  overflow: hidden; position: relative;
}
.today-hero .kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-2); }
.today-hero h3 { font-family: var(--font-display); font-size: 23px; line-height: 1.15; letter-spacing: -.02em; margin: 8px 0 6px; font-weight: 750; }
.today-hero p { margin: 0; color: var(--text-2); font-size: 15px; }
.today-hero .btn { margin-top: 14px; }
.today-hero.warn { background: radial-gradient(140% 120% at 100% 0%, rgba(251, 191, 36, .2), transparent 55%), radial-gradient(120% 120% at 0% 100%, rgba(251, 106, 106, .22), transparent 60%), var(--surface); }
.today-hero.warn .kicker { color: var(--amber); }

.rings-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 16px 8px; }
.rings-card > div { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.rings-card .cap { font-size: 12.5px; font-weight: 600; color: var(--text-2); text-align: center; line-height: 1.25; }
.rings-card .cap b { display: block; color: var(--text); font-size: 13.5px; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  height: 84px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  transition: transform .15s var(--ease);
  min-width: 0; padding: 0 4px;
}
.quick button:active { transform: scale(.94); }
.quick .qi { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.quick .qi .i { width: 19px; height: 19px; }
.quick .val { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

.water-card { display: flex; align-items: center; gap: 14px; }
.water-card .glass { width: 46px; height: 62px; border-radius: 8px 8px 14px 14px; border: 2px solid var(--blue); position: relative; overflow: hidden; flex: none; }
.water-card .glass i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, rgba(78, 168, 255, .55), var(--blue)); transition: height .8s var(--ease); }
.counter-btns { display: flex; gap: 8px; }
.counter-btns .btn { height: 38px; padding: 0 12px; font-size: 14px; border-radius: 11px; }

.train-card { overflow: hidden; }
.train-card .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.train-card .sport-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.train-card .sport-ic .i { width: 24px; height: 24px; }
.train-card h3 { margin: 0; font-size: 19px; font-weight: 720; letter-spacing: -.015em; line-height: 1.2; }
.train-card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; margin-top: 14px; }
.train-card .stats > div { background: var(--surface-2); padding: 10px 8px; text-align: center; min-width: 0; }
.train-card .stats b { display: block; font-size: 16px; font-weight: 720; font-variant-numeric: tabular-nums; white-space: nowrap; }
.train-card .stats span { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.notice + .notice { margin-top: 10px; }
.notice .ni { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-2); }
.notice .ni .i { width: 17px; height: 17px; }
.notice.amber .ni { background: var(--amber-soft); color: var(--amber); }
.notice.red .ni { background: var(--red-soft); color: var(--red); }
.notice.green .ni { background: var(--green-soft); color: var(--green); }
.notice.blue .ni { background: var(--blue-soft); color: var(--blue); }
.notice .nb { flex: 1; min-width: 0; }
.notice .nt { font-weight: 650; }
.notice .nd { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.notice .x { color: var(--text-3); padding: 4px; margin: -4px -6px 0 0; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); border-radius: 1px; }
.tl-item { position: relative; padding: 4px 0 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -21px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--accent); }
.tl-item.start::before { background: var(--accent); }
.tl-item .when { font-size: 12.5px; font-weight: 700; color: var(--accent-2); text-transform: uppercase; letter-spacing: .04em; }
.tl-item .what { font-weight: 620; margin-top: 1px; }
.tl-item .det { font-size: 13.5px; color: var(--text-2); margin-top: 1px; }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-strip .d { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 9px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; cursor: pointer; transition: transform .15s; }
.week-strip .d:active { transform: scale(.94); }
.week-strip .d.today { border-color: var(--accent); background: var(--accent-soft); }
.week-strip .wd { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; }
.week-strip .dn { font-size: 16px; font-weight: 720; font-variant-numeric: tabular-nums; }
.week-strip .sp { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; }
.week-strip .sp .i { width: 14px; height: 14px; }
.week-strip .done-mark { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--green); color: #04130c; }

.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; position: relative; min-width: 0; }
.task-row + .task-row::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; height: 1px; background: var(--line); }
.task-row.sub { padding-left: 44px; }
.task-row.sub + .task-row::before, .task-row + .task-row.sub::before { left: 84px; }
.check {
  width: 24px; height: 24px; border-radius: 50%; flex: none; margin-top: 1px;
  border: 2px solid var(--line-2); display: grid; place-items: center;
  transition: background .2s, border-color .2s, transform .2s var(--spring);
}
.check .i { width: 14px; height: 14px; stroke-width: 3; opacity: 0; color: #fff; transition: opacity .15s; }
.check.on { background: var(--green); border-color: var(--green); }
.check.on .i { opacity: 1; }
.check:active { transform: scale(.85); }
.task-row .body { flex: 1; min-width: 0; cursor: pointer; }
.task-row .title { font-weight: 560; line-height: 1.35; word-break: break-word; }
.task-row.done .title { color: var(--text-3); text-decoration: line-through; }
.task-row .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 3px; font-size: 12.5px; color: var(--text-2); }
.task-row .meta .m { display: inline-flex; align-items: center; gap: 4px; }
.task-row .meta .m .i { width: 13px; height: 13px; }
.task-row .meta .over { color: var(--red); font-weight: 650; }
.task-row .meta .soon { color: var(--amber); font-weight: 650; }
.prio-flag { width: 4px; align-self: stretch; border-radius: 2px; position: absolute; left: 0; top: 10px; bottom: 10px; }
.task-row.leaving { animation: rowOut .45s var(--ease) forwards; }
@keyframes rowOut { 0% { opacity: 1; } 60% { opacity: .5; transform: translateX(8px); } 100% { opacity: 0; transform: translateX(30px); height: 0; padding-top: 0; padding-bottom: 0; } }

.quick-add { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 14px; }
.quick-add input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; height: 40px; }
.quick-add .icon-btn { width: 40px; height: 40px; border-radius: 12px; }

/* Wochenlast */
.load-week { padding: 16px; }
.load-week .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.load-week .head b { font-size: 16px; }

/* ---------------------------------------------------------------- Kalender */

.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-nav h3 { margin: 0; font-size: 19px; font-weight: 720; letter-spacing: -.015em; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-3); padding-bottom: 6px; text-transform: uppercase; }
.cal .c {
  aspect-ratio: 1 / 1.18; border-radius: 12px; padding: 5px 4px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--surface); border: 1px solid var(--line);
  position: relative; min-width: 0; overflow: hidden; cursor: pointer;
  transition: transform .15s;
}
.cal .c:active { transform: scale(.93); }
.cal .c.out { opacity: .32; }
.cal .c.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal .c .n { font-size: 13.5px; font-weight: 680; font-variant-numeric: tabular-nums; line-height: 1.2; }
.cal .c.today .n { color: var(--accent-2); }
.cal .c.hol .n { color: var(--red); }
.cal .c .sp { width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center; }
.cal .c .sp .i { width: 12px; height: 12px; stroke-width: 2.4; }
.cal .c .dots { display: flex; gap: 2px; margin-top: auto; flex-wrap: wrap; justify-content: center; }
.cal .c .dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal .c .trip { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--cyan); }
.cal .c .km { font-size: 9.5px; font-weight: 700; color: var(--green); line-height: 1; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12px; color: var(--text-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }

.day-card { display: flex; gap: 14px; padding: 14px 16px; cursor: pointer; transition: background .15s; position: relative; }
.day-card:active { background: var(--surface-2); }
.day-card + .day-card::before { content: ""; position: absolute; top: 0; left: 76px; right: 0; height: 1px; background: var(--line); }
.day-card .date { width: 46px; flex: none; text-align: center; }
.day-card .date .wd { font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; }
.day-card .date .dn { font-size: 22px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.day-card.today .date .wd, .day-card.today .date .dn { color: var(--accent-2); }
.day-card .main { flex: 1; min-width: 0; }
.day-card .ptitle { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.day-card .pdet { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.day-card .evs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

/* ---------------------------------------------------------------- Charts */

.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-size: 10px; fill: var(--text-3); font-family: var(--font); font-weight: 600; }
.chart .grid line { stroke: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }

.stack-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.stack-bar > i { display: block; height: 100%; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; font-size: 14px; }
.kv > :nth-child(odd) { color: var(--text-2); }
.kv > :nth-child(even) { font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 0 0 8px; }
.table td { padding: 9px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.table td:last-child, .table th:last-child { text-align: right; }

/* ---------------------------------------------------------------- Sheets */

.backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .3s var(--ease); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  max-width: 600px; margin: 0 auto;
  max-height: calc(100vh - var(--safe-t) - 24px);
  max-height: calc(100dvh - var(--safe-t) - 24px);
  background: var(--bg); border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateY(105%);
  transition: transform .42s var(--ease);
  border: 1px solid var(--line-2); border-bottom: 0;
}
.sheet.show { transform: translateY(0); }
.sheet.full { height: calc(100vh - var(--safe-t) - 12px); height: calc(100dvh - var(--safe-t) - 12px); max-height: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px 12px; flex: none; }
.sheet-head h3 { margin: 0; font-size: 19px; font-weight: 720; letter-spacing: -.015em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .icon-btn { width: 32px; height: 32px; background: var(--surface-2); }
.sheet-head .icon-btn .i { width: 17px; height: 17px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 20px; flex: 1; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); flex: none; background: var(--bg); }
.sheet-body > .card, .sheet-body > .list { margin-top: 12px; }
.sheet-body > :first-child { margin-top: 0; }

/* ---------------------------------------------------------------- Assistent */

.chat-sheet .sheet-body { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.chat-intro { text-align: center; padding: 28px 12px 12px; }
.chat-intro .orb-big { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px; display: grid; place-items: center; background: linear-gradient(135deg, #8b7cff, #5b8cff 55%, #38d6e8); box-shadow: 0 14px 40px rgba(110, 110, 255, .45); }
.chat-intro .orb-big .i { width: 30px; height: 30px; stroke: #fff; }
.chat-intro h4 { margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.chat-intro p { margin: 6px auto 0; color: var(--text-2); max-width: 330px; }
.suggests { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.suggests button { text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; color: var(--text); display: flex; align-items: center; gap: 10px; }
.suggests button .i { color: var(--accent); width: 17px; height: 17px; }
.msg { max-width: 86%; padding: 11px 14px; border-radius: 20px; font-size: 15.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; animation: msgIn .3s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.ai .q { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-weight: 600; color: var(--accent-2); }
.msg.ai .warn { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 14px; }
.msg.ai .why { margin-top: 6px; font-size: 13px; color: var(--text-3); }
.msg.typing { display: flex; gap: 4px; padding: 15px 16px; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .2s; }
.msg.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.preview-card { align-self: stretch; border-radius: 18px; background: var(--surface); border: 1px solid var(--accent); padding: 14px; animation: msgIn .3s var(--ease); box-shadow: 0 0 0 4px var(--accent-soft); }
.preview-card .ph { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-2); display: flex; align-items: center; gap: 6px; }
.preview-card ul { list-style: none; padding: 0; margin: 10px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.preview-card li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.preview-card li .tag { flex: none; margin-top: 1px; }
.preview-card.done { border-color: var(--line); box-shadow: none; opacity: .75; }
.result-chips { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; }
.composer { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea { flex: 1; min-width: 0; resize: none; max-height: 140px; min-height: 46px; height: 46px; padding: 12px 16px; border-radius: 23px; border: 1px solid var(--line-2); background: var(--surface); font-size: 16px; outline: none; line-height: 1.35; }
.composer textarea:focus { border-color: var(--accent); }
.composer .send { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; transition: transform .15s, opacity .2s; }
.composer .send:disabled { opacity: .35; }
.composer .send:active { transform: scale(.9); }

/* Assistent-Leiste auf "Heute" */
.ask-bar { display: flex; align-items: center; gap: 12px; padding: 0 8px 0 16px; height: 54px; border-radius: 27px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text-3); font-size: 15.5px; cursor: text; box-shadow: var(--shadow); }
.ask-bar .i { color: var(--accent); }
.ask-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-bar .go { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #8b7cff, #5b8cff 55%, #38d6e8); display: grid; place-items: center; }
.ask-bar .go .i { color: #fff; width: 18px; height: 18px; }

/* ---------------------------------------------------------------- Kraft */

.ex-card { padding: 0; overflow: hidden; }
.ex-card .ex-head { padding: 14px 16px 10px; display: flex; gap: 12px; align-items: flex-start; }
.ex-card .ex-no { width: 28px; height: 28px; border-radius: 9px; background: var(--amber-soft); color: var(--amber); display: grid; place-items: center; font-weight: 750; font-size: 14px; flex: none; }
.ex-card.complete .ex-no { background: var(--green); color: #04130c; }
.ex-card .ex-name { font-weight: 680; font-size: 16px; line-height: 1.3; }
.ex-card .ex-meta { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.ex-card .ex-hint { font-size: 13px; color: var(--text-2); padding: 0 16px 10px; }
.set-row { display: grid; grid-template-columns: 34px 1fr 1fr 44px; gap: 8px; align-items: center; padding: 6px 16px; }
.set-row .no { font-size: 13px; font-weight: 700; color: var(--text-3); text-align: center; }
.set-row .input { height: 42px; text-align: center; font-weight: 650; padding: 0 8px; font-variant-numeric: tabular-nums; }
.set-row .ok { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-3); }
.set-row.logged .ok { background: var(--green); color: #04130c; border-color: transparent; }
.set-row.logged .input { background: var(--green-soft); border-color: transparent; }
.set-head { display: grid; grid-template-columns: 34px 1fr 1fr 44px; gap: 8px; padding: 4px 16px 0; font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.ex-foot { display: flex; gap: 8px; padding: 8px 16px 14px; }
.rest-timer {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(150%);
  bottom: calc(var(--safe-b) + 92px); z-index: 120;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 10px 10px 18px; border-radius: 22px;
  background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg);
  transition: transform .4s var(--spring), opacity .3s;
  opacity: 0; pointer-events: none;
}
.rest-timer.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.rest-timer b { font-size: 24px; font-weight: 760; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rest-timer small { display: block; font-size: 11px; font-weight: 700; opacity: .6; text-transform: uppercase; letter-spacing: .05em; }
.rest-timer button { height: 38px; padding: 0 14px; border-radius: 12px; background: rgba(127, 127, 127, .2); font-weight: 650; font-size: 14px; }

/* ---------------------------------------------------------------- Toast, Leer, Laden */

.toast-host { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 10px); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; max-width: 440px;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 16px;
  background: var(--text); color: var(--bg);
  font-size: 14.5px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn .4s var(--spring);
}
.toast.err { background: var(--red); color: #fff; }
.toast .i { width: 18px; height: 18px; flex: none; }
.toast button { color: var(--accent-2); font-weight: 700; margin-left: 4px; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

.empty { text-align: center; padding: 34px 20px; color: var(--text-2); }
.empty .ei { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.empty .ei .i { width: 26px; height: 26px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty p { margin: 0 auto; max-width: 300px; font-size: 14px; }

.skel { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r); border: 1px solid var(--line); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.divider { height: 1px; background: var(--line); margin: 14px 0; }
.spacer { height: 12px; }

.pill-tabs { display: flex; gap: 6px; }

.ai-text { font-size: 15px; line-height: 1.55; white-space: pre-wrap; }

details.more { margin-top: 10px; }
details.more summary { list-style: none; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary .i { transform: rotate(180deg); }
details.more summary .i { transition: transform .2s; width: 16px; height: 16px; }

.offline-banner { position: fixed; top: calc(var(--safe-t) + 8px); left: 50%; transform: translateX(-50%); z-index: 150; background: var(--amber); color: #1a1200; font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 14px; }

.color-swatch { width: 30px; height: 30px; border-radius: 9px; border: 2px solid transparent; flex: none; }
.color-swatch.on { border-color: var(--text); }
input[type="color"].swatch-input { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: none; flex: none; }
input[type="color"].swatch-input::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].swatch-input::-webkit-color-swatch { border: 0; border-radius: 10px; }

.food-card { padding: 14px 16px; }
.food-card .fm { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.food-card .fm b { color: var(--text); }

.macro-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.macro-row > div { min-width: 0; }
.macro-row .lbl { font-size: 12px; font-weight: 650; color: var(--text-2); display: flex; justify-content: space-between; margin-bottom: 6px; }
.macro-row .mval { font-size: 12.5px; color: var(--text-3); margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.macro-row .mval b { color: var(--text); font-weight: 700; }

@media (min-width: 640px) {
  .view { padding-left: 20px; padding-right: 20px; }
  .sheet { border-radius: 26px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
