:root {
  --paper: #F7F8F4; --surface: #FFFFFF; --sunk: #EDF0EA; --line: #DDE2DA;
  --ink: #1C2B24; --ink-2: #4E5E56; --ink-3: #5B6B63;
  --green: #2E7D5B; --green-ink: #FFFFFF; --green-soft: #DCEFE4;
  --protein: #3A6FB0; --carbs: #D49A1F; --fat: #B84F78; --water: #3B9CC4;
  --danger: #B7412E; --over: #C4572E;
  --r-sm: 8px; --r: 14px; --r-lg: 22px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Public Sans', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
/* the two dark blocks must stay identical: system preference, and the Me > Preferences override */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0F1915; --surface: #16221D; --sunk: #1D2B25; --line: #2A3A33;
    --ink: #E7EEE9; --ink-2: #AFC0B7; --ink-3: #95A89F;
    --green: #4FB487; --green-ink: #08130E; --green-soft: #1E3A2D;
    --protein: #6E9DDB; --carbs: #E8B54A; --fat: #DB7DA2; --water: #5DB8DE;
    --danger: #E3735F; --over: #E8835B;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #0F1915; --surface: #16221D; --sunk: #1D2B25; --line: #2A3A33;
  --ink: #E7EEE9; --ink-2: #AFC0B7; --ink-3: #95A89F;
  --green: #4FB487; --green-ink: #08130E; --green-soft: #1E3A2D;
  --protein: #6E9DDB; --carbs: #E8B54A; --fat: #DB7DA2; --water: #5DB8DE;
  --danger: #E3735F; --over: #E8835B;
  color-scheme: dark;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 17px/1.45 var(--body); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
a { color: var(--green); }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 0.875rem; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- shell ---------- */
#app { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 12px) 18px calc(var(--safe-b) + 110px); }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 18px; }
.datenav { display: flex; align-items: center; gap: 4px; }
.datenav button.date { background: none; border: 0; padding: 6px 8px; font-family: var(--display); font-size: 1.6rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.datenav .date svg { width: 18px; height: 18px; color: var(--ink-3); margin-top: 3px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--sunk); }
.icon-btn svg { width: 22px; height: 22px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar nav { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: 64px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.72rem; color: var(--ink-3); text-decoration: none; padding: 6px 0; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--green); font-weight: 700; }
.tabbar .log-btn { justify-self: center; width: 58px; height: 58px; margin-top: -26px; border-radius: 50%; border: 4px solid var(--paper);
  background: var(--green); color: var(--green-ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px -6px rgba(20, 70, 45, .55); }
.tabbar .log-btn svg { width: 28px; height: 28px; }

/* ---------- budget panel (the one bold element) ---------- */
.budget { background: var(--surface); border-radius: var(--r-lg); padding: 20px; border: 1px solid var(--line); }
.budget-top { display: grid; grid-template-columns: 168px 1fr; gap: 18px; align-items: center; }
.ring { position: relative; width: 168px; height: 168px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--sunk); }
.ring .bar { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.ring.over .bar { stroke: var(--over); }
.ring .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .big { font-family: var(--display); font-size: 2.6rem; font-weight: 750; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ring .lbl { font-size: 0.85rem; color: var(--ink-2); margin-top: 4px; }
.ring.over .big { color: var(--over); }
.equation { display: grid; gap: 8px; }
.equation div { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.equation div:last-child { border: 0; }
.equation span:first-child { color: var(--ink-2); font-size: 0.92rem; }
.equation .num { font-size: 1.15rem; font-weight: 650; }
.equation div:has(+ .aside) { border: 0; }
.equation .aside { margin-top: 2px; }
.equation .aside span { font-size: 0.82rem; color: var(--ink-3); font-weight: 400; }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.macro .lab { font-size: 0.82rem; color: var(--ink-2); white-space: nowrap; }
.macro .val { font-family: var(--display); font-weight: 650; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.macro .val small { font-family: var(--body); font-weight: 400; color: var(--ink-3); font-size: 0.78rem; }
.meter { height: 7px; border-radius: 99px; background: var(--sunk); overflow: hidden; margin-top: 5px; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--green)); transition: width .5s ease; }
.meter.over i { background: var(--over); }

/* ---------- strip of small trackers ---------- */
.strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; text-align: left; cursor: pointer; }
.tile .k { font-size: 0.85rem; color: var(--ink-2); }
.tile .v { font-family: var(--display); font-size: 1.35rem; font-weight: 700; }
.water-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.drops { display: flex; gap: 3px; flex: 1; }
.drops i { flex: 1; height: 18px; border-radius: 4px 4px 7px 7px; background: var(--sunk); }
.drops i.on { background: var(--water); }
.tile.met { border-color: color-mix(in srgb, var(--water) 55%, var(--line)); background: color-mix(in srgb, var(--water) 8%, var(--surface)); }
.met-tag { color: var(--ink); font-weight: 700; margin-left: 6px; }
.mini { position: relative; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); cursor: pointer; display: grid; place-items: center;  font-size: 1.1rem; line-height: 1; }
.mini::before { content: ''; position: absolute; inset: -6px; }
.mini:disabled { opacity: .4; cursor: default; }
#waterPlus { background: var(--water); color: #fff; border: 0; }

/* ---------- meals ---------- */
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.meal { margin-top: 12px; padding: 4px 14px; }
.meal-head { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.meal-head h2 { flex: 1; }
.meal-head .num { color: var(--ink-2); font-size: 1rem; }
.meal-head .link-btn.quiet { font-size: 0.85rem; }
.add-btn { border: 1px solid var(--line); background: transparent; color: var(--green); font-weight: 700; font-size: 0.9rem; border-radius: 99px; min-height: 38px; padding: 0 14px; cursor: pointer; white-space: nowrap; position: relative; }
.add-btn::before { content: ''; position: absolute; inset: -4px; }
.meal .entry { border-bottom: 0; border-top: 1px solid var(--line); }
.entry { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.entry .main { flex: 1; min-width: 0; }
.entry .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .sub { color: var(--ink-3); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .kcal { font-family: var(--display); font-weight: 650; font-variant-numeric: tabular-nums; }
.link-btn { background: none; border: 0; color: var(--green); font-weight: 700; padding: 8px 4px; cursor: pointer; }
.link-btn.quiet { color: var(--ink-3); font-weight: 400; }

/* ---------- forms & buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 99px; border: 0;
  background: var(--green); color: var(--green-ink); font-weight: 700; cursor: pointer; width: 100%; }
.btn.secondary { background: var(--sunk); color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn.danger-fill { background: var(--danger); color: var(--paper); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 38px; width: auto; padding: 0 14px; font-size: 0.9rem; }
.btn-row { display: flex; gap: 10px; }
.photo-row { margin-bottom: 10px; }
.photo-row .btn { flex: 1; padding: 0 12px; }
.btn svg { width: 22px; height: 22px; flex: none; }
.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 0.9rem; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-size: 17px; }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: 2px solid var(--green); border-color: transparent; }
.pw { position: relative; }
.pw .input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--green); font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seg { display: flex; background: var(--sunk); border-radius: 99px; padding: 4px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 99px; cursor: pointer; font-size: 0.92rem; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.switch input { width: 48px; height: 28px; appearance: none; background: var(--line); border-radius: 99px; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(20px); }
.error { color: var(--danger); font-size: 0.92rem; margin: 6px 0 12px; }
.note { background: var(--sunk); border-radius: var(--r-sm); padding: 12px 14px; font-size: 0.92rem; color: var(--ink-2); }

/* ---------- sheets ---------- */
body.sheet-open { overflow: hidden; }
.sheet:focus { outline: none; }
.grabber, .sheet-head { touch-action: none; }
.sheet-head .link-btn { white-space: nowrap; }
.confirm-msg { margin: 0 0 18px; color: var(--ink-2); }
.scrim { position: fixed; inset: 0; background: rgba(8, 20, 14, .45); z-index: 40; animation: fade .2s ease; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: var(--r-lg) var(--r-lg) 0 0; animation: rise .28s cubic-bezier(.2,.8,.2,1); max-width: 560px; margin: 0 auto; }
.sheet.full { height: 96dvh; max-height: 96dvh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 10px; }
.sheet-head h2 { flex: 1; }
.sheet-body { padding: 4px 18px calc(var(--safe-b) + 22px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1; }
.grabber { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 8px auto 0; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- log menu ---------- */
.log-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.log-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line); cursor: pointer; text-align: left; }
.log-opt svg { width: 26px; height: 26px; color: var(--green); }
.log-opt b { font-size: 1rem; }
.log-opt span { font-size: 0.82rem; color: var(--ink-3); }

/* ---------- food lists ---------- */
.meal-pick { margin-bottom: 10px; }
.search-box { position: sticky; top: 0; background: var(--paper); padding: 2px 0 10px; z-index: 2; display: flex; gap: 8px; }
.search-box .input { border-radius: 99px; padding-left: 18px; }
.food-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.food-row .main { flex: 1; min-width: 0; }
.food-row .name { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.food-row .sub { color: var(--ink-3); font-size: 0.85rem; }
.food-row .kcal { text-align: right; font-family: var(--display); font-weight: 650; white-space: nowrap; }
.food-row .kcal small { display: block; font-family: var(--body); font-weight: 400; color: var(--ink-3); font-size: 0.75rem; }
.add-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex: none; border: 0; cursor: pointer; }
.badge { display: inline-block; font-size: 0.72rem; padding: 1px 7px; border-radius: 99px; background: var(--sunk); color: var(--ink-2); margin-left: 4px; vertical-align: 1px; font-weight: 400; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.section-label { font-size: 0.9rem; color: var(--ink-2); font-weight: 700; margin: 18px 0 2px; }
.empty { text-align: center; padding: 34px 12px; color: var(--ink-3); }
.empty .btn { margin: 14px auto 0; display: flex; max-width: 100%; }
.empty b { display: block; color: var(--ink); font-family: var(--display); font-size: 1.1rem; margin-bottom: 4px; }

/* ---------- food detail ---------- */
.food-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.food-hero .big { font-family: var(--display); font-size: 2.8rem; font-weight: 750; line-height: 1; letter-spacing: -0.03em; }
.macro-split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--sunk); margin: 12px 0 8px; }
.macro-split i { display: block; height: 100%; }
.macro-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 0.88rem; }
.macro-legend b { display: block; font-family: var(--display); font-size: 1.1rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.nutri { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.95rem; }
.nutri td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.nutri td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.stepper button { flex: none; width: 46px; height: 48px; border: 0; background: none; font-size: 1.4rem; cursor: pointer; color: var(--green); }
.stepper input { flex: 1; min-width: 0; width: 100%; border: 0; background: none; text-align: center; font-family: var(--display); font-size: 1.2rem; height: 48px; }
.stepper input:focus { outline: none; }

/* ---------- AI ---------- */
.ai-photo { position: relative; border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.ai-photo img { width: 100%; display: block; max-height: 260px; object-fit: cover; }
.ai-photo button { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 99px; padding: 6px 12px; cursor: pointer; }
.ai-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ai-item input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--green); margin-top: 3px; }
.ai-item .edit-cal { width: 82px; text-align: right; min-height: 40px; padding: 6px 10px; }
.ai-total { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 10px; }
.ai-total > div { text-align: right; }
.ai-total .num { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.conf-low { color: var(--over); }
.thinking { display: flex; align-items: center; gap: 10px; padding: 24px 0; color: var(--ink-2); justify-content: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--sunk); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- scanner ---------- */
#scanner { width: 100%; border-radius: var(--r); overflow: hidden; background: #000; min-height: 260px; }
#scanner video { border-radius: var(--r); }

/* ---------- progress ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 14px 0; }
.stat-row > div { background: var(--surface); padding: 12px; }
.stat-row .v { font-family: var(--display); font-size: 1.45rem; font-weight: 700; }
.stat-row .k { font-size: 0.8rem; color: var(--ink-3); }
.chart-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 12px 8px; margin: 12px 0; }
.chart-wrap h3 { margin: 0 4px 2px; }
.chart-wrap .sub { margin: 0 4px 8px; font-size: 0.85rem; color: var(--ink-3); }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.readout { margin: 0 4px 6px; font-weight: 700; font-size: 0.95rem; font-variant-numeric: tabular-nums; min-height: 1.45em; }
.readout.two { min-height: 2.9em; }
.chart circle { fill: var(--ink-3); opacity: .55; }
.chart circle.sel { fill: var(--ink); opacity: 1; r: 5px; }
.chart .cursor { stroke: var(--ink-3); opacity: .5; }
.chart { touch-action: pan-y; cursor: crosshair; width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font: 11px var(--body); fill: var(--ink-3); }
.chart .goal { stroke: var(--ink-2); stroke-dasharray: 4 4; }
.chart .gridl { stroke: var(--line); }

.boot { min-height: 80dvh; display: grid; place-content: center; justify-items: center; gap: 18px; }
.boot .brand-mark { width: 64px; height: 64px; }

/* ---------- auth / onboarding ---------- */
.auth { min-height: 88dvh; display: flex; flex-direction: column; justify-content: center; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand-mark { width: 44px; height: 44px; }
.brand b { font-family: var(--display); font-size: 1.6rem; letter-spacing: -0.02em; }
.auth h1 { font-size: 2.2rem; line-height: 1.1; margin-bottom: 8px; }
.auth p.lead { color: var(--ink-2); margin: 0 0 26px; }
.steps-dots { display: flex; gap: 6px; margin-bottom: 18px; }
.steps-dots i { flex: 1; height: 4px; border-radius: 99px; background: var(--line); }
.steps-dots i.on { background: var(--green); }
.suggest { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin: 10px 0 18px; }
.suggest .big { font-family: var(--display); font-size: 3rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }

/* ---------- settings ---------- */
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 16px; margin: 10px 0 22px; }
.group > .item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.group > .item:last-child { border-bottom: 0; }
.group > .item .v { color: var(--ink-3); white-space: nowrap; }
.group > .item .v svg { display: block; width: 18px; height: 18px; }
.code-row { display: flex; gap: 8px; align-items: center; }
.code-row .code { flex: 1; min-width: 0; }
.code-row .btn { flex: none; }
.code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; background: var(--sunk); padding: 10px 12px; border-radius: var(--r-sm); word-break: break-all; font-size: 0.88rem; user-select: all; }
ol.howto { padding-left: 20px; margin: 8px 0; }
ol.howto li { margin-bottom: 8px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); transform: translateX(-50%); background: var(--ink); color: var(--paper);
  padding: 12px 18px; border-radius: 99px; z-index: 60; font-weight: 700; display: flex; gap: 14px; align-items: center; animation: rise .25s ease; max-width: 92vw; }
.toast button { background: none; border: 0; color: var(--green-soft); font-weight: 700; cursor: pointer; }

@media (min-width: 600px) {
  .sheet { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: var(--r-lg); max-height: 86dvh; width: 540px; animation: fade .2s ease; }
  .sheet.full { height: 86dvh; max-height: 86dvh; }
  .grabber { display: none; }
  #app:has(.auth-page) { padding-block: 24px; }
  .auth-page { min-height: calc(100dvh - 48px); display: grid; align-content: center; }
  .auth { min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px !important; }
  .auth .input { background: var(--paper); }
}
@media (max-width: 380px) {
  .budget-top { grid-template-columns: 140px 1fr; }
  .ring { width: 140px; height: 140px; }
  .ring .big { font-size: 2.1rem; }
  .group > .item .v { white-space: normal; text-align: right; }
}

.amount-grid { display: grid; grid-template-columns: 150px 1fr; gap: 10px; margin-top: 18px; }
