/* Foodie — design system. Ivory, charcoal, sage and champagne. Light by design. */
:root {
  --bg: #F7F3EA; --surface: #FFFDF8; --surface-2: #F0EBDF; --track: #E7E1D2;
  --ink: #1E1D19; --ink-2: #55534A; --ink-3: #6E6B60;
  --line: rgba(30, 29, 25, .09); --line-2: rgba(30, 29, 25, .16);
  --sage: #55674A; --sage-2: #8A9C78; --sage-soft: #E5EADB; --sage-ink: #3F4F36;
  --gold: #A07C3C; --gold-2: #D4B87A; --gold-soft: #F4EBD5;
  --clay: #9A6A57; --danger: #A23E2A; --danger-soft: #F6E4DE;
  --r-sm: 10px; --r: 16px; --r-lg: 24px; --r-xl: 32px;
  --shadow-1: 0 1px 2px rgba(60, 50, 20, .04), 0 1px 1px rgba(60, 50, 20, .03);
  --shadow-2: 0 2px 6px rgba(60, 50, 20, .05), 0 12px 32px -8px rgba(60, 50, 20, .10);
  --shadow-3: 0 24px 60px -12px rgba(40, 32, 10, .28);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.47 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss03"; }
body.no-scroll { overflow: hidden; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--sage-ink); }
b, strong { font-weight: 600; }
small { font-size: 13px; }
.ic { flex: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; border-radius: 8px; }
.num, .stats dd, .stat b, .ring-num, .entry-kcal b, .pv-kcal, .calc-kcal b { font-variant-numeric: tabular-nums; }

/* ---------- type ---------- */
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.page-head h1, .datebar h1 { font: 700 clamp(30px, 5vw, 34px)/1.12 var(--font); letter-spacing: -.022em; }
.display { font: 700 clamp(38px, 9vw, 52px)/1.04 var(--font); letter-spacing: -.034em; }
.lede { font-size: 17px; color: var(--ink-2); max-width: 46ch; margin-top: 14px; }
.lede.sm { font-size: 15px; margin: 6px 0 22px; }
.muted { color: var(--ink-2); font-size: 14px; }
.muted.center, .center { text-align: center; }
.muted.pad, .pad { padding: 20px; }
.pad-sm { padding: 12px 0; }
.fineprint { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.hint { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.hint.spaced { margin: 2px 0 12px; }
.link { background: none; border: 0; padding: 0; color: var(--sage-ink); font-weight: 500; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(85, 103, 74, .4); display: inline-flex; gap: 6px; align-items: center; }
.link:hover { text-decoration-color: currentColor; }

/* ---------- layout ---------- */
.shell { min-height: 100vh; }
.main { padding: 20px 16px 120px; outline: none; }
.page { max-width: 1120px; margin: 0 auto; display: grid; gap: 16px; }
.page.narrow { max-width: 720px; }
.page-head { display: grid; gap: 4px; padding: 4px 0; }
.page-head.row { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.cols { display: grid; gap: 16px; }
.col { display: grid; gap: 16px; align-content: start; min-width: 0; }

.side { display: none; }
.tabbar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: center; padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 253, 248, .86); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border-top: 1px solid var(--line); }
.tabbar .nav-link { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 0; }
.tab-add { justify-self: center; width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; border: 0; background: linear-gradient(160deg, #66795A, #4A5B40); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -6px rgba(63, 79, 54, .55), inset 0 1px 0 rgba(255, 255, 255, .22); transition: transform .2s var(--ease); }
.tab-add:active { transform: scale(.94); }
.nav-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink-3); font-weight: 500; border-radius: 12px; justify-content: center; transition: color .15s, background .15s; }
.nav-link.active { color: var(--sage-ink); }
.nav-link:hover { color: var(--ink); }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 252px 1fr; }
  .side { display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; padding: 28px 18px; border-right: 1px solid var(--line); background: rgba(255, 253, 248, .5); }
  .brand { display: flex; align-items: center; gap: 10px; font: 700 20px/1 var(--font); letter-spacing: -.03em; text-decoration: none; color: var(--ink); padding: 0 10px; }
  .side nav { display: grid; gap: 2px; }
  .side .nav-link { justify-content: flex-start; padding: 11px 12px; font-size: 15px; }
  .side .nav-link.active { background: var(--sage-soft); }
  .side-add { margin-top: auto; }
  .tabbar { display: none; }
  .main { padding: 40px 40px 80px; }
}
@media (min-width: 1040px) { .cols { grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; } .col-side { position: sticky; top: 24px; } }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head.pad { padding: 18px 20px 0; margin: 0; }
.card h2 { font-size: 17px; font-weight: 600; letter-spacing: -.005em; }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--gold-soft); border: 1px solid rgba(160, 124, 60, .25); border-radius: var(--r); padding: 10px 14px; font-size: 14px; color: #5B4519; }
.banner .link { margin-left: auto; color: #5B4519; }
.note { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }
.note .ic { margin-top: 2px; }
.note.warn { color: #7A5A1E; }
.callout { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r); padding: 12px 14px; font-size: 14px; margin-top: 10px; }
.callout p { color: var(--ink-2); margin-top: 2px; }
.callout-quiet { background: var(--surface-2); }
.callout-warn { background: var(--gold-soft); color: #5B4519; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 15px; transition: transform .15s var(--ease), background .15s, box-shadow .15s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn.block { width: 100%; margin-top: 14px; }
.btn.grow { flex: 1; }
.btn-primary { background: linear-gradient(180deg, #62765A, #4B5C41); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 6px 16px -6px rgba(63, 79, 54, .6); }
.btn-primary:hover { background: linear-gradient(180deg, #6A7F61, #51644A); }
.btn-quiet { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { background: #EAE4D5; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger-quiet { background: transparent; color: var(--danger); border-color: rgba(162, 62, 42, .25); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); transition: background .15s, color .15s, transform .15s; flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.solid { background: var(--sage-soft); color: var(--sage-ink); }
.icon-btn.solid:hover { background: #D8E0CB; }
.logo-mark { width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center; background: linear-gradient(160deg, #6A7F61, #465739); color: #F7F3EA; box-shadow: var(--shadow-2); }
.logo-mark.sm { width: 34px; height: 34px; border-radius: 10px; }

/* ---------- today ---------- */
.datebar { display: flex; align-items: center; gap: 4px; }
.datebar-label { flex: 1; min-width: 0; text-align: center; }
.datebar h1 { font-size: clamp(24px, 4.2vw, 32px); }
.hero { display: grid; gap: 22px; padding: 24px 20px; background: linear-gradient(180deg, #FFFEFA, #FBF8F0); }
.ring-wrap { position: relative; width: min(240px, 56vw); margin: 0 auto; }
@media (min-width: 560px) { .ring-wrap { width: 100%; } }
.ring { display: block; width: 100%; }
.ring-arc { transition: stroke-dashoffset .9s var(--ease); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-num { font: 600 clamp(46px, 11vw, 58px)/1 var(--font); letter-spacing: -.035em; }
.ring-num.over { color: var(--gold); }
.ring-cap { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.stats { display: flex; justify-content: center; gap: 36px; margin-bottom: 18px; }
.stats div { text-align: center; }
.stats dt { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stats dd { font-size: 20px; font-weight: 600; }
.macros { display: grid; gap: 14px; }
.macro-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; color: var(--ink-2); }
.macro-top > span:first-child { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.macro-top b { color: var(--ink); }
.miss { text-decoration: none; color: var(--gold); font-weight: 600; cursor: help; }
.bar { height: 7px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar-lg { height: 10px; }
.bar i { display: block; height: 100%; border-radius: 99px; transition: width .7s var(--ease); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.m-protein { background: var(--sage); }
.m-carbs { background: var(--gold-2); }
.m-fat { background: var(--clay); }
@media (min-width: 560px) { .hero { grid-template-columns: 240px 1fr; align-items: center; gap: 36px; padding: 28px; } .stats { justify-content: flex-start; } }

.meals { display: grid; gap: 12px; }
@media (min-width: 720px) { .meals { grid-template-columns: 1fr 1fr; } }
.meal { padding: 8px 8px 8px; display: flex; flex-direction: column; }
.meal-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; }
.meal-sub { font-size: 13px; color: var(--ink-3); }
.entries { display: grid; }
.entry { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; border-radius: 0; transition: background .15s; min-height: 56px; }
.entries li:last-child .entry { border-radius: 0 0 var(--r) var(--r); }
.entry:hover { background: var(--surface-2); }
.entry-main { display: grid; min-width: 0; }
.entry-main b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-main small { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-kcal { text-align: right; display: grid; flex: none; }
.entry-kcal b { font-size: 16px; line-height: 1.1; }
.entry-kcal small { color: var(--ink-3); font-size: 11px; }
.meal-empty { margin: 4px 8px 8px; padding: 16px; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: none; color: var(--ink-3); font-size: 14px; text-align: center; transition: border-color .15s, color .15s, background .15s; }
.meal-empty:hover { border-color: var(--sage-2); color: var(--sage-ink); background: var(--sage-soft); }
.nudge { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--sage-soft); border-color: rgba(85, 103, 74, .2); }
.nudge p { color: var(--ink-2); font-size: 14px; margin-top: 2px; max-width: 42ch; }

.goal-nums { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 14px; }
.goal-nums small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 500; }
.goal-nums b { font: 600 32px/1 var(--font); letter-spacing: -.03em; }
.goal-arrow { color: var(--ink-3); align-self: center; }
.goal .unit { margin-left: auto; color: var(--ink-3); font-weight: 500; }
.goal .muted { margin-top: 10px; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.bar-ok { fill: var(--sage); } .bar-over { fill: var(--gold-2); } .bar-none { fill: var(--track); }
.bar-sel { stroke: var(--ink); stroke-width: 1.5; }
.axis { font: 500 11px var(--font); fill: var(--ink-3); }
.axis-strong { fill: var(--ink); font-weight: 700; } .axis-gold { fill: var(--gold); }
.target-line, .goal-line { stroke: var(--gold); stroke-width: 1.4; stroke-dasharray: 5 5; }
.grid { stroke: var(--line); }
.area { fill: rgba(85, 103, 74, .09); }
.wline { fill: none; stroke: var(--sage); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dot { }
.chart .dot { fill: var(--surface); stroke: var(--sage); stroke-width: 2.2; }
.chart .dot-last { fill: var(--sage); stroke: var(--surface); stroke-width: 3; }
.chart .dot-sample { fill: var(--surface); stroke-dasharray: 2 2; }
.pt:focus-visible { outline: none; } .pt:focus-visible .dot, .pt:hover .dot { stroke-width: 3.5; }
.legend { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-3); }
.legend i { width: 9px; height: 9px; border-radius: 3px; margin-left: 8px; }

/* ---------- diary & progress ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-row.four { grid-template-columns: 1fr 1fr; }
@media (min-width: 800px) { .stat-row.four { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px; display: grid; gap: 2px; align-content: start; }
.stat small { color: var(--ink-3); font-weight: 500; }
.stat b { font: 600 clamp(24px, 5vw, 30px)/1.1 var(--font); letter-spacing: -.03em; }
.stat b i { font: 500 13px var(--font); color: var(--ink-3); font-style: normal; margin-left: 3px; }
.stat span { font-size: 12.5px; color: var(--ink-3); }
.day-list li + li .day-row, .w-list li + li { border-top: 1px solid var(--line); }
.day-row { width: 100%; display: grid; grid-template-columns: 74px 1fr 72px; gap: 14px; align-items: center; padding: 14px 18px; background: none; border: 0; text-align: left; transition: background .15s; }
.day-row:hover { background: var(--surface-2); }
.day-name { display: grid; } .day-name small { color: var(--ink-3); }
.day-bar { display: grid; gap: 8px; min-width: 0; }
.day-macros, .result-macros { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.mini { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mini .dot { width: 7px; height: 7px; }
.day-kcal { text-align: right; display: grid; } .day-kcal small { color: var(--ink-3); }
.day-empty { color: var(--ink-3); font-size: 14px; }
.pills { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 999px; }
.pill { border: 0; background: none; padding: 6px 14px; min-height: 32px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pill.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.encourage { display: flex; gap: 14px; background: var(--sage-soft); border-color: rgba(85, 103, 74, .18); color: var(--sage-ink); align-items: flex-start; }
.encourage p { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 48px 20px; color: var(--ink-2); }
.empty .ic { color: var(--sage); }
.w-row { display: grid; grid-template-columns: 1fr auto 44px 44px; align-items: center; padding: 6px 8px 6px 20px; gap: 2px; }
.w-row b { display: block; font-weight: 600; } .w-row small { color: var(--ink-3); }
.delta { font-size: 13px; color: var(--ink-3); padding-right: 8px; font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
.field { display: grid; gap: 0; margin-bottom: 16px; align-content: start; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input { width: 100%; height: 48px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; font: inherit; font-size: 16px; color: var(--ink); transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none; }
.input::placeholder { color: #9A978B; }
.input:hover:not(:disabled) { border-color: rgba(30, 29, 25, .3); }
.input:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 4px rgba(85, 103, 74, .16); }
.input:disabled { background: var(--surface-2); color: var(--ink-2); }
.input[aria-invalid="true"], .has-err .input { border-color: var(--danger); }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2355534A' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 52px; }
.suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 13px; pointer-events: none; }
.err { color: var(--danger); font-size: 13px; margin-top: 6px; font-weight: 500; }
.grid-2, .grid-3, .grid-4, .qty-row, .split { display: grid; gap: 0 14px; }
.grid-2, .qty-row, .split { grid-template-columns: 1fr 1fr; }
.qty-row { grid-template-columns: 1.1fr 1fr; }
.grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: 1fr 1.4fr 1.2fr; } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 480px) { .grid-2:not(.keep) { grid-template-columns: 1fr; } .split, .qty-row { grid-template-columns: 1fr 1fr; } }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 14px; padding: 3px; gap: 2px; border: 1px solid var(--line); }
.seg-btn { border: 0; background: none; min-height: 40px; padding: 0 10px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--ink-2); transition: background .2s var(--ease), color .2s, box-shadow .2s; }
.seg-btn[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(60, 50, 20, .14); }
.seg-sm .seg-btn { font-size: 13px; padding: 0 4px; min-height: 36px; }
.choice-list { display: grid; gap: 8px; }
.choice-list.row3 { margin-bottom: 18px; }
@media (min-width: 640px) { .choice-list.row3 { grid-template-columns: repeat(3, 1fr); } }
.choice { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); transition: border-color .15s, background .15s, box-shadow .15s; }
.choice:hover { border-color: var(--sage-2); }
.choice b { display: block; font-weight: 600; } .choice small { color: var(--ink-3); display: block; }
.choice .radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; display: grid; place-items: center; background: var(--surface); }
.choice[aria-checked="true"] { border-color: var(--sage); background: var(--sage-soft); box-shadow: 0 0 0 1px var(--sage); }
.choice[aria-checked="true"] .radio { border-color: var(--sage); }
.choice[aria-checked="true"] .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--sage); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); margin-top: 18px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--sage); margin: 1px 0 0; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 500; color: var(--ink-2); border: 1px solid transparent; }
.chip-sage { background: var(--sage-soft); color: var(--sage-ink); }
.chip-btn { cursor: pointer; transition: background .15s, border-color .15s; } .chip-btn:hover { border-color: var(--sage-2); background: var(--sage-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.inline-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.form-card { display: grid; gap: 4px; } .form-card h2 { margin-bottom: 12px; }
.savebar { position: sticky; bottom: 76px; z-index: 5; display: flex; justify-content: flex-end; padding: 4px 0; }
@media (min-width: 900px) { .savebar { bottom: 16px; } }
.savebar .btn { box-shadow: var(--shadow-2), 0 6px 16px -6px rgba(63, 79, 54, .6); }
.calc { margin-bottom: 18px; }
.calc-main { background: var(--sage-soft); border-radius: var(--r); padding: 16px 18px; border: 1px solid rgba(85, 103, 74, .18); }
.calc-kcal { margin: 2px 0 12px; font-size: 14px; color: var(--ink-2); } .calc-kcal b { font: 600 38px/1 var(--font); letter-spacing: -.035em; color: var(--ink); margin-right: 4px; }
.splitbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; } .splitbar i { display: block; height: 100%; }
.calc-macros { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.calc-how { margin: 12px 2px 0; font-size: 14px; color: var(--ink-2); } .calc-how summary { cursor: pointer; font-weight: 500; color: var(--sage-ink); padding: 4px 0; }
.calc-how ul { padding: 6px 0 0 18px; list-style: disc; display: grid; gap: 4px; }
.calc .fineprint { margin-top: 12px; }
.about a { font-weight: 500; }

/* ---------- onboarding ---------- */
.ob { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px 40px; background: radial-gradient(900px 500px at 15% -10%, #E9EEDF 0, transparent 60%), radial-gradient(800px 500px at 100% 0, #F4EBD5 0, transparent 55%), var(--bg); }
.ob-card { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 28px 22px 22px; box-shadow: var(--shadow-2); }
@media (min-width: 600px) { .ob-card { padding: 40px 40px 32px; } }
.ob-progress { display: flex; gap: 6px; margin-bottom: 28px; } .ob-progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--track); transition: background .3s; } .ob-progress i.on { background: var(--sage); }
.ob-hero { margin-bottom: 26px; display: grid; justify-items: start; gap: 22px; } .ob-hero .lede { margin: 0; }
.ob-title { font: 700 28px/1.14 var(--font); letter-spacing: -.025em; }
.ob-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; gap: 12px; }
.ob-actions .btn-primary { min-width: 160px; }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(30, 29, 25, .38); backdrop-filter: blur(3px); animation: fade .25s ease both; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 92dvh; display: flex; flex-direction: column; background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-3); animation: rise .35s var(--ease) both; outline: none; padding-bottom: env(safe-area-inset-bottom); }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 4px 12px; flex: none; }
.sheet-head h2 { flex: 1; font: 700 22px/1.2 var(--font); letter-spacing: -.02em; padding: 4px 8px; }
.sheet-body { overflow-y: auto; padding: 4px 20px 24px; display: flex; flex-direction: column; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }
.sheet-tools { display: grid; gap: 12px; padding-bottom: 6px; position: sticky; top: 0; background: var(--surface); z-index: 2; padding-top: 4px; }
.searchbar { display: flex; gap: 8px; position: relative; align-items: center; }
.search-ic { position: absolute; left: 14px; color: var(--ink-3); display: grid; pointer-events: none; }
.search-input { padding-left: 42px; flex: 1; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin: 0 -20px; padding: 0 16px; }
.tab { border: 0; background: none; padding: 10px 12px; font-weight: 600; font-size: 14px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; min-height: 44px; }
.tab.on { color: var(--ink); border-color: var(--sage); }
.results { flex: 1 0 auto; padding-top: 6px; min-height: 160px; }
.sheet-tools, .sheet-head, .sheet-foot { flex: none; }
.group-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 18px 0 4px; display: flex; align-items: center; gap: 8px; }
.group-title .count { text-transform: none; letter-spacing: 0; font-weight: 500; }
.result-list li { border-bottom: 1px solid var(--line); position: relative; }
.result { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 4px; background: none; border: 0; text-align: left; border-radius: 12px; transition: background .15s; min-height: 64px; }
.result:hover { background: var(--surface-2); }
.result-main { display: grid; gap: 3px; min-width: 0; }
.result-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.result-main > small { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-macros { margin-top: 2px; }
.has-actions .result { padding-right: 90px; } .row-actions { position: absolute; right: 0; top: 10px; display: flex; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; letter-spacing: .02em; white-space: nowrap; }
.badge-off { background: #E8EEF2; color: #35505F; } .badge-sample { background: var(--gold-soft); color: #6B5120; } .badge-mine { background: var(--sage-soft); color: var(--sage-ink); }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); margin: 10px 0; font-size: 14px; }
.notice p { color: var(--ink-2); margin-top: 2px; } .notice .btn { margin-top: 10px; } .notice .ic { margin-top: 2px; color: var(--ink-3); }
.notice-warn { background: var(--gold-soft); } .notice-warn .ic { color: var(--gold); }
.skeletons { display: grid; gap: 10px; padding: 8px 0; } .skeletons i { display: block; height: 64px; border-radius: 14px; background: linear-gradient(90deg, var(--surface-2) 25%, #F6F2E8 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sheet-foot { display: grid; gap: 8px; padding-top: 16px; margin-top: auto; border-top: 1px solid var(--line); }
.detail-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.food-name { font: 700 22px/1.2 var(--font); letter-spacing: -.02em; margin-bottom: 6px; }
.detail .muted { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.star { color: var(--ink-3); } .star.on { color: var(--gold); }
.preview { background: var(--surface-2); border-radius: var(--r-lg); padding: 18px 18px 14px; margin-bottom: 18px; }
.pv-main { display: flex; align-items: baseline; gap: 8px; color: var(--ink-2); } .pv-kcal { font: 600 46px/1 var(--font); color: var(--ink); letter-spacing: -.035em; }
.pv-macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.pv-macros div { display: grid; gap: 1px; } .pv-macros small { color: var(--ink-3); } .pv-macros b { font-size: 17px; font-variant-numeric: tabular-nums; } .pv-macros .dot { margin-bottom: 4px; }
.src { margin-bottom: 18px; } .src a { font-weight: 500; }
.sheet-actions { display: flex; gap: 10px; margin-top: 8px; }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 580px; max-height: min(86vh, 760px); border-radius: 28px; transform: translate(-50%, -50%); animation: pop .3s var(--ease) both; }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 16px; }
}

/* ---------- toast ---------- */
#toast { position: fixed; z-index: 60; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom)); display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
@media (min-width: 900px) { #toast { bottom: 28px; } }
.toast-item { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: #26251F; color: #F7F3EA; padding: 12px 14px 12px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-3); animation: rise-sm .3s var(--ease) both; max-width: 100%; }
.toast-item .ic { color: var(--sage-2); }
.toast-undo { background: rgba(255, 255, 255, .12); border: 0; color: #fff; font-weight: 600; padding: 6px 12px; border-radius: 99px; min-height: 32px; } .toast-undo:hover { background: rgba(255, 255, 255, .2); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes rise-sm { from { transform: translateY(10px); opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.chart-slot { width: 100%; min-height: 150px; }
.legend .bar-ok { background: var(--sage); } .legend .bar-over { background: var(--gold-2); }

/* ---------- food photos ---------- */
.thumb { position: relative; flex: none; display: grid; place-items: center; overflow: hidden; background: #FBF8F0; border: 1px solid var(--line); color: var(--sage-2); }
.thumb-sm { width: 44px; height: 44px; border-radius: 12px; }
.thumb-md { width: 56px; height: 56px; border-radius: 15px; }
.thumb-lg { width: 88px; height: 88px; border-radius: 22px; }
.thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.thumb-img.contain { object-fit: contain; padding: 4px; }
.thumb-img.cover { object-fit: cover; }
.thumb-empty { background: var(--sage-soft); }
.entry { gap: 12px; }
.entry-main { flex: 1; }
.result { justify-content: flex-start; }
.result-main { flex: 1; }
.detail-top { align-items: center; gap: 16px; }
.detail-name { flex: 1; min-width: 0; }
.thumb:not(.thumb-empty) > .ic { visibility: hidden; }

/* ---------- welcome moment ---------- */
.welcome { position: fixed; inset: 0; z-index: 100; cursor: pointer; }
.w-bg { position: absolute; inset: 0; background: radial-gradient(900px 500px at 50% 40%, #FFFEFA, var(--bg)); opacity: 1; transition: opacity 2.4s ease; }
.w-bg.fade { opacity: 0; }
.w-canvas { position: absolute; inset: 0; }

/* Apple-style type: one family, semibold/bold only, headline rows at 17px */
.entry-main b, .result-main b, .day-name b, .w-row b, .choice b, .macro-top > span:first-child { font-weight: 600; letter-spacing: -.011em; }
.card h2, .meal-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.014em; }
.btn { letter-spacing: -.011em; }
