/* Fuel Log — calm, phone-first. One accent (garden green), semantic berry/amber for gut + warnings. */
:root {
  --bg: #f2f4f1;
  --card: #ffffff;
  --sunk: #eaeee9;
  --ink: #141c18;
  --muted: #65716a;
  --line: #e0e5e1;
  --accent: #1f6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e0efe7;
  --berry: #b23c5e;
  --berry-soft: #f6e3e9;
  --amber: #b5791c;
  --amber-soft: #f6ecda;
  --track: #e5eae6;
  --moss: #5b9a62; --moss-dark: #3f7a48; --clay: #c9784f; --clay-dark: #a85f3b; --sky: #e8f1ec; --sun: #e9b949; --soil: #8a6a4f;
  --shadow: 0 1px 2px rgba(20, 28, 24, .04), 0 8px 24px rgba(20, 28, 24, .06);
  --shadow-up: 0 -8px 30px rgba(20, 28, 24, .08);
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1411; --card: #172019; --sunk: #121a15; --ink: #e9efeb; --muted: #94a39a; --line: #263029;
    --accent: #62c89c; --accent-ink: #0e1411; --accent-soft: #1b3428; --berry: #e47c9b; --berry-soft: #3a1f28;
    --amber: #e2ab53; --amber-soft: #372c19; --track: #222c25;
    --moss: #6fb377; --moss-dark: #4e8f57; --clay: #c9784f; --clay-dark: #a85f3b; --sky: #15211b; --sun: #e9b949; --soil: #6e5541;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); --shadow-up: 0 -8px 30px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, label:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; position: relative; border-radius: 14px; padding: 14px 18px; font-weight: 600; cursor: pointer; transition: transform .1s, background .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--card); border: 1.5px solid var(--line); }
.btn.big { width: 100%; padding: 16px; font-size: 17px; }
.btn.sm { padding: 9px 14px; font-size: 14px; border-radius: 12px; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.link { background: none; padding: 10px; font-size: 15px; }
.btn.danger { color: var(--berry); }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; }
.icon-btn svg, .tab svg, .plus svg, .lm-ic svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- Gate ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.gate-inner { max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gate img { border-radius: 18px; }
.gate h1 { font-family: var(--display); font-size: 34px; margin: 4px 0 0; }
.gate p { color: var(--muted); margin: 0 0 8px; }

/* ---------- Layout ---------- */
.view {
  max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px;
  padding-top: max(18px, env(safe-area-inset-top));
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; }
h1 { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 1.05; margin: 2px 0 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 0; letter-spacing: -.005em; }
.sec-head, .card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card { background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.note { margin: 10px 0 0; }

/* ---------- Hero: calorie ring ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; background: var(--card); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); }
.ring-wrap { position: relative; width: 132px; height: 132px; }
.ring { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring-track { stroke: var(--track); }
.ring-fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1), stroke .3s; }
.ring-fill.over { stroke: var(--amber); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; min-width: 0; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-k { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-v { font-family: var(--display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.pbar { grid-column: 1 / -1; }
.pbar-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 6px; }
.pbar-v { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pbar-track { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.pbar-fill { height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .6s cubic-bezier(.2,.8,.2,1); }

/* ---------- Meals ---------- */
.meals { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.meal { width: 100%; display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; text-align: left; }
.meal + .meal { border-top: 1px solid var(--line); }
.meal:active { background: var(--sunk); }
.m-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--sunk); display: grid; place-items: center; color: var(--muted); }
.m-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.meal.done .m-ic { background: var(--accent); color: var(--accent-ink); }
.meal.busy .m-ic { background: var(--accent-soft); color: var(--accent); }
.m-txt { min-width: 0; }
.m-slot { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.m-name { display: block; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal:not(.done) .m-name { color: var(--muted); font-weight: 500; }
.m-kcal { text-align: right; font-variant-numeric: tabular-nums; }
.m-kcal b { display: block; font-weight: 600; font-size: 15px; }
.m-kcal span { display: block; font-size: 12px; white-space: nowrap; color: var(--muted); }
.m-flag { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--berry); }
.m-add { font-size: 13px; font-weight: 600; color: var(--accent); }

/* ---------- Photos ---------- */
.photos { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.photo { flex: none; width: 112px; scroll-snap-align: start; }
.photo img { width: 112px; height: 112px; object-fit: cover; border-radius: 14px; display: block; background: var(--sunk); }
.photo span { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 500; }
.photo em { display: block; font-style: normal; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Quiet check-ins ---------- */
.quiet { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--muted); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.pill.set { color: var(--ink); }
.pill.set .dot { background: var(--accent); }
.pill.set.meh .dot { background: var(--amber); }
.pill.set.rough .dot { background: var(--berry); }
.status { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }

/* ---------- Trends ---------- */
.seg { display: inline-flex; background: var(--sunk); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button[aria-selected="true"], .seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.kpi { font-family: var(--display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .bar.over { fill: var(--amber); }
.chart .bar.empty { fill: var(--track); }
.chart .target { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 4; opacity: .5; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .lbl { fill: var(--muted); font-size: 10px; font-family: var(--body); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent-soft); }
.chart .pt { fill: var(--card); stroke: var(--accent); stroke-width: 2; }
.chart .pt.last { fill: var(--accent); }
.chart .empty-msg { fill: var(--muted); font-size: 12px; font-family: var(--body); }
.gutstrip { display: grid; grid-template-columns: repeat(var(--n, 7), 1fr); gap: 4px; }
.gs { aspect-ratio: 1; border-radius: 6px; background: var(--track); max-height: 34px; }
.gs.good { background: var(--accent); } .gs.meh { background: var(--amber); } .gs.rough { background: var(--berry); }
.insight { margin: 12px 0 0; font-size: 14px; line-height: 1.45; }
.cons { display: grid; grid-template-columns: repeat(var(--n, 7), 1fr); gap: 4px; }
.cs { aspect-ratio: 1; border-radius: 6px; background: var(--track); max-height: 34px; }
.cs.p1 { background: color-mix(in srgb, var(--accent) 30%, var(--track)); }
.cs.p2 { background: color-mix(in srgb, var(--accent) 60%, var(--track)); }
.cs.p3 { background: var(--accent); }

/* ---------- Body ---------- */
.pthumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pthumb { min-width: 0; }
.pthumb img, .pempty { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; display: block; background: var(--sunk); clip-path: inset(0 round 14px); }
.pempty { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.pthumb.private img { filter: blur(16px) saturate(.5); }
.pthumb span { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 500; text-transform: capitalize; }
.pose-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pose-row .btn { padding: 12px 6px; }
.two-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.metric { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; text-align: left; }
.metric b { font-family: var(--display); font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
  padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent); }
.plus { justify-self: center; width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent); transform: translateY(-10px); }
.plus svg { width: 26px; height: 26px; stroke-width: 2.4; }
.plus:active { transform: translateY(-10px) scale(.95); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom));
  width: min(92vw, 440px); background: var(--ink); color: var(--bg); border-radius: 16px; padding: 14px 16px;
  box-shadow: var(--shadow); z-index: 6; display: flex; flex-direction: column; gap: 10px; font-weight: 500; font-size: 15px;
}
.toast-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.toast-slots button { border: 1.5px solid color-mix(in srgb, var(--bg) 35%, transparent); color: var(--bg); border-radius: 10px; padding: 8px 2px; font-size: 13px; font-weight: 600; }
.toast-slots button.on { background: var(--bg); color: var(--ink); }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 12, 10, .4); z-index: 7; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: var(--card);
  border-radius: 26px 26px 0 0; box-shadow: var(--shadow-up);
  padding: 10px max(20px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; max-height: 90vh; overflow-y: auto;
  animation: up .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 4px; }
.sheet h2 { font-size: 20px; }
.two-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.logmenu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; }
.lm { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-align: center; cursor: pointer; }
.lm-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--sunk); display: grid; place-items: center; color: var(--accent); }
.lm-ic svg { width: 26px; height: 26px; }
.lm:active .lm-ic { background: var(--accent-soft); }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.opt b { font-weight: 600; font-size: 16px; display: block; }
.opt small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.opt .badge { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.logged { background: var(--sunk); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.logged b { font-weight: 600; }
.logged .ln-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.logged .ln-note { font-size: 13px; }
.other { display: flex; gap: 8px; margin: 0; }
.other input { flex: 1; min-width: 0; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); font-size: 16px; }
.portion { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chips3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chip { padding: 18px 8px; border-radius: 16px; border: 1.5px solid var(--line); font-weight: 600; font-size: 16px; }
.chip.on[data-v="good"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip.on[data-v="meh"] { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.chip.on[data-v="rough"] { border-color: var(--berry); background: var(--berry-soft); color: var(--berry); }
.w-entry { text-align: center; font-family: var(--display); font-weight: 800; font-size: 64px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.w-entry small { font-size: 22px; color: var(--muted); margin-left: 6px; font-weight: 600; }
.steppers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.steppers button { padding: 16px 4px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.set-row input { width: 120px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.cmp-controls { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; }
.cmp-controls select { min-width: 0; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font-size: 15px; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp figure { margin: 0; min-width: 0; }
.cmp img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; background: var(--sunk); }
.cmp-stats { text-align: center; font-weight: 600; margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- Scanner ---------- */
.scanner { position: fixed; inset: 0; z-index: 9; background: #000; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 50%; top: 42%; width: min(78vw, 340px); height: 150px; transform: translate(-50%, -50%); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.85); }
.scan-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); display: flex; justify-content: flex-end; }
.scan-close { width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.5); display: grid; place-items: center; color: #fff; }
.scan-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.scan-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 12px; color: #fff; text-align: center; }
.scan-bottom p { margin: 0; font-weight: 600; font-size: 16px; }
.scan-manual { display: flex; gap: 8px; }
.scan-manual input { flex: 1; min-width: 0; padding: 14px; border-radius: 14px; border: 0; background: rgba(255,255,255,.92); color: #141c18; font-size: 16px; }
.prod { display: flex; gap: 14px; align-items: center; }
.prod img { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: var(--sunk); flex: none; }
.prod img[src=""], .prod img:not([src]) { visibility: hidden; }
.prod-flags { margin: 0; font-size: 14px; font-weight: 600; color: var(--berry); background: var(--berry-soft); padding: 10px 12px; border-radius: 12px; }
.prod-total { text-align: center; font-family: var(--display); font-weight: 800; font-size: 28px; font-variant-numeric: tabular-nums; }
.prod-total small { display: block; font-family: var(--body); font-weight: 500; font-size: 13px; color: var(--muted); }
.slot-seg { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
.slot-seg button { padding: 10px 2px; }
.btn svg { flex: none; }
.logged-item { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.logged-item + .logged-item { border-top: 1px solid var(--line); padding-top: 10px; }
.logged-item .x { color: var(--berry); font-size: 13px; font-weight: 600; padding: 4px; }

/* ---------- Home ---------- */
.hdr-btns { display: flex; gap: 8px; }
label.icon-btn { position: relative; cursor: pointer; }
.sun-badge { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); font-weight: 700; font-variant-numeric: tabular-nums; }
.sun-badge svg { width: 20px; height: 20px; fill: none; stroke: var(--sun); stroke-width: 2; stroke-linecap: round; }
.sun-badge svg circle { fill: var(--sun); }
.garden-card { position: relative; background: linear-gradient(180deg, var(--sky), var(--card) 75%); border-radius: 24px; padding: 18px 18px 16px; box-shadow: var(--shadow); overflow: hidden; }
.garden { width: 100%; aspect-ratio: 16 / 10; }
.garden svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bubble { position: relative; background: var(--card); border-radius: 16px; padding: 12px 14px; font-weight: 500; font-size: 15px; line-height: 1.35; box-shadow: var(--shadow); max-width: 92%; margin: 0 auto 4px; text-align: center; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: var(--card); transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.sunbar { height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; margin-top: 6px; }
.sunbar-fill { height: 100%; width: 0; background: var(--sun); border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.sun-note { margin: 8px 0 0; text-align: center; }
.moss-body { animation: bob 3.2s ease-in-out infinite; transform-origin: 50% 100%; transform-box: fill-box; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-3px) scale(1.01, .99); } }
.g-item { animation: pop .5s cubic-bezier(.2,1.4,.4,1) both; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.story { background: var(--card); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); border-left: 4px solid var(--sun); }
.story p { margin: 6px 0 0; font-size: 15px; line-height: 1.45; }
.upnext { background: var(--card); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.upnext h2 { font-size: 22px; }
.upnext p { margin: 0 0 8px; }
.wins { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.wins li { display: flex; gap: 12px; align-items: center; padding: 12px 16px; font-size: 15px; }
.wins li + li { border-top: 1px solid var(--line); }
.wins li .w-ic { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.wins li .w-ic svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wins li.empty { color: var(--muted); }
.wins li .w-sun { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--clay-dark); white-space: nowrap; }
/* check-in */
.ci-row { display: flex; flex-direction: column; gap: 8px; }
.ci-k { font-size: 13px; font-weight: 600; color: var(--muted); }
.ci-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ci-opts.mood { grid-template-columns: repeat(5, 1fr); }
.ci-opts button { padding: 13px 4px; border-radius: 14px; border: 1.5px solid var(--line); font-weight: 600; font-size: 15px; }
.ci-opts button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ci-opts[data-field="gut"] button.on[data-v="meh"] { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.ci-opts[data-field="gut"] button.on[data-v="rough"] { border-color: var(--berry); background: var(--berry-soft); color: var(--berry); }
.moodstrip { display: grid; grid-template-columns: repeat(var(--n, 7), 1fr); gap: 4px; }
.ms { aspect-ratio: 1; border-radius: 6px; background: var(--track); max-height: 34px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--accent-ink); }
.ms.m1 { background: var(--berry); } .ms.m2 { background: color-mix(in srgb, var(--berry) 50%, var(--amber)); } .ms.m3 { background: var(--amber); } .ms.m4 { background: color-mix(in srgb, var(--accent) 60%, var(--track)); } .ms.m5 { background: var(--accent); }

@media (prefers-reduced-motion: reduce) { *, .sheet { transition: none !important; animation: none !important; } }
