/* 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);
  --sage-rgb: 85, 103, 74; --sage-shadow-rgb: 63, 79, 54; --accent-top: #62765A; --accent-bot: #4B5C41; --accent-hi: #6A7F61;
  color-scheme: light;
}
:root[data-scheme="ocean"] { --sage: #3F6B7D; --sage-2: #86AAB8; --sage-soft: #E1ECF0; --sage-ink: #2C4E5C; --sage-rgb: 63, 107, 125; --sage-shadow-rgb: 44, 78, 92; --accent-top: #4C7C90; --accent-bot: #365C6D; --accent-hi: #5A8BA0; }
:root[data-scheme="terracotta"] { --sage: #A5573A; --sage-2: #D49A82; --sage-soft: #F5E6DE; --sage-ink: #7A3F28; --sage-rgb: 165, 87, 58; --sage-shadow-rgb: 122, 63, 40; --accent-top: #B4663F; --accent-bot: #8E432A; --accent-hi: #BE7550; }
:root[data-scheme="plum"] { --sage: #6E4A6B; --sage-2: #B08FAD; --sage-soft: #EFE4EE; --sage-ink: #4F3350; --sage-rgb: 110, 74, 107; --sage-shadow-rgb: 79, 51, 80; --accent-top: #80597D; --accent-bot: #5D3C5B; --accent-hi: #8C6689; }
:root[data-scheme="graphite"] { --sage: #3A3A38; --sage-2: #8E8E88; --sage-soft: #E9E8E4; --sage-ink: #262624; --sage-rgb: 58, 58, 56; --sage-shadow-rgb: 38, 38, 36; --accent-top: #4A4A47; --accent-bot: #2B2B29; --accent-hi: #565652; }
*, *::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(var(--sage-rgb), .4); display: inline-flex; gap: 6px; align-items: center; }
.link:hover { text-decoration-color: currentColor; }

/* ---------- layout ---------- */
.shell { min-height: 100vh; }
.main { padding: 20px 16px 132px; 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; }

/* ---------- dock: bottom navigation. Magnifies under a mouse like the macOS Dock; icon + label on touch ---------- */
.dock { position: fixed; z-index: 20; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); translate: -50% 0; display: flex; align-items: flex-end; gap: 6px; padding: 8px; border-radius: 22px; max-width: calc(100vw - 16px);
  background: rgba(255, 253, 248, .8); backdrop-filter: saturate(1.8) blur(24px); -webkit-backdrop-filter: saturate(1.8) blur(24px);
  box-shadow: inset 0 0 0 1px rgba(30, 29, 25, .09), 0 18px 44px -14px rgba(60, 50, 20, .35), 0 2px 6px rgba(60, 50, 20, .06); }
.dock-item { position: relative; width: 62px; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 16px; background: transparent; color: var(--ink-3); text-decoration: none; font: 500 11px/1 var(--font); letter-spacing: -.005em; transform-origin: 50% 100%; cursor: pointer; transition: transform .18s var(--ease), background .15s, color .15s; -webkit-tap-highlight-color: transparent; }
.dock-item:hover { color: var(--ink); }
.dock-item.active { color: var(--sage-ink); background: var(--sage-soft); }
.dock-add { color: #fff; background: linear-gradient(160deg, var(--accent-top), var(--accent-bot)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 18px -6px rgba(var(--sage-shadow-rgb), .55); }
.dock-add:hover { color: #fff; }
.dock-item:active { transform: scale(.95); }
@media (min-width: 700px) and (hover: hover) {
  .dock { gap: 12px; padding: 10px 14px; border-radius: 26px; }
  .dock-item { width: 60px; height: 60px; border-radius: 16px; background: linear-gradient(160deg, #FFFEFA, #F1ECE0); box-shadow: inset 0 0 0 1px rgba(30, 29, 25, .09), 0 3px 8px rgba(60, 50, 20, .12); }
  .dock-item.active { background: linear-gradient(160deg, var(--sage-soft), #D5DDC8); color: var(--sage-ink); }
  .dock-add { background: linear-gradient(160deg, var(--accent-top), var(--accent-bot)); }
  .dock-item .dock-label { display: none; }
  .dock-item svg { width: 28px; height: 28px; }
  .dock-item.active::before { content: ""; position: absolute; left: 50%; bottom: -7px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--ink-2); }
  .dock-item::after { content: attr(aria-label); position: absolute; bottom: calc(100% + 14px); left: 50%; translate: -50% 4px; padding: 5px 11px; border-radius: 8px; background: rgba(40, 39, 34, .92); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), translate .2s var(--ease); }
  .dock-item:hover::after, .dock-item:focus-visible::after { opacity: 1; translate: -50% 0; }
}
.topbar { display: none; }
@media (min-width: 900px) {
  .main { padding: 28px 40px 140px; }
  .topbar { display: block; max-width: 1120px; margin: 0 auto 22px; }
  .wordmark { display: inline-block; font: 700 24px/1 var(--font); letter-spacing: -.045em; color: var(--ink); text-decoration: none; }
  .wordmark i { font-style: normal; color: var(--sage); }
}
@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: 12px; 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; border-radius: 10px; }
.btn.block { width: 100%; margin-top: 14px; }
.btn.grow { flex: 1; }
.btn-primary { background: linear-gradient(180deg, var(--accent-top), var(--accent-bot)); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 6px 16px -6px rgba(var(--sage-shadow-rgb), .6); }
.btn-primary:hover { background: linear-gradient(180deg, var(--accent-hi), var(--accent-bot)); }
.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: 12px; 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, var(--accent-hi), var(--accent-bot)); 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: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar-lg { height: 10px; }
.bar i { display: block; height: 100%; border-radius: 3px; 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(var(--sage-rgb), .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(var(--sage-rgb), .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: 18px; }
.pill { border: 0; border-bottom: 2px solid transparent; background: none; padding: 6px 0; min-height: 36px; font-size: 14px; font-weight: 600; color: var(--ink-3); transition: color .15s, border-color .15s; }
.pill:hover { color: var(--ink); }
.pill.on { color: var(--ink); border-bottom-color: var(--sage); }
.encourage { display: flex; gap: 14px; background: var(--sage-soft); border-color: rgba(var(--sage-rgb), .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(var(--sage-rgb), .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: 10px; padding: 3px; gap: 2px; border: 1px solid var(--line); }
.seg-btn { border: 0; background: none; min-height: 40px; padding: 0 10px; border-radius: 8px; 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: 8px; 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: 100px; z-index: 5; display: flex; justify-content: flex-end; padding: 4px 0; }
.savebar .btn { box-shadow: var(--shadow-2), 0 6px 16px -6px rgba(var(--sage-shadow-rgb), .6); }
.calc { margin-bottom: 18px; }
.calc-main { background: var(--sage-soft); border-radius: var(--r); padding: 16px 18px; border: 1px solid rgba(var(--sage-rgb), .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: 4px; 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 7px; border-radius: 6px; 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(104px + env(safe-area-inset-bottom)); display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.toast-item { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: #26251F; color: #F7F3EA; padding: 12px 14px 12px 16px; border-radius: 14px; 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: 8px; 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; }

/* ---------- nutrition label, nutrients, water, schemes ---------- */
.facts { margin: 0 0 18px; border-top: 2px solid var(--ink); }
.facts-title { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0 6px; border-bottom: 1px solid var(--line-2); font-size: 13px; color: var(--ink-3); }
.facts-title b { color: var(--ink); font-size: 17px; letter-spacing: -.014em; }
.fact { display: grid; grid-template-columns: 1fr auto 52px; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-variant-numeric: tabular-nums; }
.fact.sub { padding-left: 16px; color: var(--ink-2); font-size: 14px; }
.fact b { font-weight: 600; } .fact .pct { text-align: right; color: var(--ink-3); font-size: 13px; }
.fact .unk { color: var(--ink-3); }
.nutrients { display: grid; gap: 12px; }
.nut { display: grid; gap: 6px; }
.nut-top { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.nut-top b { color: var(--ink); font-weight: 600; }
.bar i.n-amber { background: var(--gold-2); } .bar i.n-sage { background: var(--sage-2); } .bar i.n-clay { background: var(--clay); }
.water { display: grid; gap: 14px; }
.water-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.water-top b { font: 600 30px/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.water-top span { color: var(--ink-3); font-size: 14px; }
.glasses { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.glass { height: 34px; border-radius: 6px; background: var(--track); transition: background .25s var(--ease); }
.glass.on { background: linear-gradient(180deg, var(--sage-2), var(--sage)); }
.water-actions { display: flex; gap: 8px; }
.water-actions .btn { flex: 1; }
.schemes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .schemes { grid-template-columns: repeat(4, 1fr); } }
.scheme { display: grid; gap: 10px; padding: 10px; text-align: left; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; font-weight: 600; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.scheme i { display: block; height: 36px; border-radius: 8px; }
.scheme[aria-pressed="true"] { border-color: var(--sage); box-shadow: 0 0 0 1px var(--sage); }
.link-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.meal-copy { margin: 0 8px 10px; padding: 8px; font-size: 14px; justify-content: center; }

/* ---------- splash, login, legal ---------- */
.splash { min-height: 100vh; display: grid; place-items: center; }
.wordmark.big { font-size: 30px; }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 580px) 1fr; background: var(--bg); }
.login-pane { position: relative; z-index: 2; display: flex; flex-direction: column; padding: 34px clamp(24px, 5vw, 76px) 26px; background: var(--surface); box-shadow: 0 0 70px rgba(60, 50, 20, .1); }
.login-body { margin: auto 0; display: grid; gap: 18px; max-width: 420px; padding: 28px 0; }
.login h1 { font: 700 clamp(38px, 4.6vw, 54px)/1.03 var(--font); letter-spacing: -.036em; }
.login .lede { margin: 0; font-size: 17px; }

.or { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.login-foot { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.login-foot a { color: var(--ink-2); }
.login-art { position: relative; overflow: hidden; background: linear-gradient(155deg, color-mix(in srgb, var(--sage-2) 38%, var(--bg)) 0, var(--sage-soft) 55%, color-mix(in srgb, var(--gold-2) 28%, var(--bg)) 100%); }
.login-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, color-mix(in srgb, var(--sage-2) 38%, var(--bg)) 0, transparent 12%, transparent 88%, color-mix(in srgb, var(--gold-2) 28%, var(--bg)) 100%); }
.art-grid { position: absolute; inset: -25% -8%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; transform: rotate(-9deg); }
.art-col { overflow: hidden; }
.art-track { display: grid; gap: 20px; animation: art-up 70s linear infinite; }
.art-col.c1 .art-track { animation-name: art-down; animation-duration: 84s; }
.art-col.c2 .art-track { animation-duration: 60s; }
.art-tile { position: relative; display: block; aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: #FBF8F0; box-shadow: inset 0 0 0 1px var(--line), 0 18px 34px -18px rgba(60, 50, 20, .35); }
.art-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-img.contain { object-fit: contain; padding: 14%; } .art-img.cover { object-fit: cover; }
@keyframes art-up { to { transform: translateY(-50%); } }
@keyframes art-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }
@keyframes art-left { to { transform: translateX(-50%); } }
@keyframes art-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (max-width: 899px) {
  .login { grid-template-columns: 1fr; }
  .login-pane { box-shadow: none; padding-top: 22px; }
  .login-art { order: -1; height: 190px; }
  .art-grid { inset: 0; transform: none; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
  .art-col.c2 { display: none; }
  .art-track { display: flex; gap: 12px; width: max-content; animation-name: art-left; }
  .art-col.c1 .art-track { animation-name: art-right; }
  .art-tile { width: 84px; height: 84px; flex: none; aspect-ratio: auto; border-radius: 16px; }
  .login-art::after { background: linear-gradient(90deg, var(--bg) 0, transparent 10%, transparent 90%, var(--bg)); }
  .login-body { margin: 0; padding: 10px 0 24px; }
}
@media (prefers-reduced-motion: reduce) { .art-track { animation: none; } }
.legal { min-height: 100vh; padding: 28px 20px 80px; }
.legal-in { max-width: 700px; margin: 0 auto; }
.legal-back { margin-bottom: 18px; }
.legal h1 { font: 700 clamp(32px, 6vw, 42px)/1.08 var(--font); letter-spacing: -.03em; }
.legal h2 { font: 700 20px/1.25 var(--font); letter-spacing: -.02em; margin: 34px 0 8px; }
.legal h3 { font-size: 16px; font-weight: 600; margin: 18px 0 4px; }
.legal p, .legal li { color: var(--ink-2); font-size: 16px; line-height: 1.6; margin: 0 0 12px; }
.legal li { margin-bottom: 6px; } .legal ul { padding-left: 22px; list-style: disc; margin: 0 0 12px; }
.legal b { color: var(--ink); } .legal a { color: var(--sage-ink); font-weight: 500; } .legal code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 14px; }
.legal-date { color: var(--ink-3) !important; font-size: 14px !important; margin: 8px 0 22px !important; }
.legal-box { background: var(--sage-soft); border-radius: 16px; padding: 16px 20px 8px; margin: 18px 0 8px; } .legal-box > b { display: block; margin-bottom: 8px; color: var(--sage-ink); }
.legal-foot { display: flex; gap: 20px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.wordmark { font: 700 24px/1 var(--font); letter-spacing: -.045em; color: var(--ink); text-decoration: none; }
.wordmark i { font-style: normal; color: var(--sage); }
.wordmark.big { font-size: 30px; display: inline-block; }

/* ---------- sign-in form (mobile first) ---------- */
.auth { display: grid; gap: 16px; }
.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line-2); }
.auth-tab { border: 0; background: none; min-height: 48px; font: 600 15px/1 var(--font); letter-spacing: -.011em; color: var(--ink-3); transition: color .2s; }
.auth-tab[aria-selected="true"] { color: var(--ink); }
.auth-ink { position: absolute; left: 0; bottom: -1px; width: 50%; height: 2px; background: var(--sage); transition: transform .4s var(--ease); }
.auth[data-mode="up"] .auth-ink { transform: translateX(100%); }
.auth-form { display: grid; gap: 0; }
.auth-form .field { margin-bottom: 14px; }
.auth-form .input { height: 52px; font-size: 16px; border-radius: 12px; }
.input-wrap .input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: 10px; color: var(--ink-3); transition: color .15s, background .15s; }
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
.fold { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .4s var(--ease), opacity .3s ease; }
.fold-in { overflow: hidden; min-height: 0; }
.auth[data-mode="up"] .fold { grid-template-rows: 1fr; opacity: 1; }
.checks { border: 0; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.checks legend { padding: 0; margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.checks .check { margin: 0; font-size: 14px; }
.checks a { color: var(--sage-ink); font-weight: 500; }
.login-msg { min-height: 0; margin: 0 0 12px; font-size: 14px; line-height: 1.4; color: var(--danger); font-weight: 500; }
.login-msg:empty { display: none; }
.auth-submit { width: 100%; min-height: 52px; font-size: 16px; position: relative; }
.auth-submit .spin { position: absolute; right: 18px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; opacity: 0; animation: spin .7s linear infinite; transition: opacity .2s; }
.auth-submit.is-busy .spin { opacity: 1; }
.auth-submit:disabled { opacity: .85; cursor: progress; }
.forgot { justify-self: center; margin-top: 14px; }
.auth[data-mode="up"] .forgot { display: none; }
.g-slot { min-height: 46px; display: flex; justify-content: center; }
.guest { justify-self: center; font-size: 15px; }
.login-body { gap: 16px; }
.login h1 { font-size: clamp(34px, 4.6vw, 50px); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.shake { animation: shake .4s ease; }
/* consent sheet: slides up on phones, fades in on desktop */
.cs { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.cs.open { visibility: visible; }
.cs-scrim { position: absolute; inset: 0; background: rgba(30, 29, 25, .4); opacity: 0; transition: opacity .3s ease; backdrop-filter: blur(3px); }
.cs.open .cs-scrim { opacity: 1; }
.cs-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 26px 26px 0 0; padding: 8px 22px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-3); transform: translateY(105%); transition: transform .45s var(--ease); display: grid; gap: 12px; }
.cs.open .cs-sheet { transform: none; }
.cs-sheet h2 { font: 700 22px/1.2 var(--font); letter-spacing: -.02em; margin-top: 10px; }
.cs-sheet .sheet-actions { margin-top: 6px; }
@media (min-width: 700px) { .cs-sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; border-radius: 24px; padding: 28px; transform: translate(-50%, -46%); opacity: 0; transition: transform .4s var(--ease), opacity .25s ease; } .cs.open .cs-sheet { transform: translate(-50%, -50%); opacity: 1; } .cs .sheet-grab { display: none; } }
@media (max-width: 899px) { .login-art { height: 150px; } .login-pane { padding-top: 18px; } .login h1 { font-size: 34px; } }
@media (max-width: 899px) and (max-height: 700px) { .login-art { display: none; } }
@media (prefers-reduced-motion: reduce) { .fold, .auth-ink, .cs-sheet, .cs-scrim { transition-duration: .01ms; } .shake { animation: none; } }
@media (max-width: 899px) {
  .login-art { height: 118px; }
  .login-pane { padding: 16px clamp(20px, 6vw, 40px) 22px; }
  .login-body { gap: 14px; padding: 6px 0 14px; }
  .login h1 { font-size: 30px; line-height: 1.06; }
  .login .lede { display: none; }
  .auth-form .input { height: 50px; }
  .auth-form .field { margin-bottom: 12px; }
  .auth { gap: 14px; }
}

.balance { display: grid; gap: 8px; margin: 2px 0 12px; }
.balance .muted { margin: 0; }
.balance-split { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); }
.balance-split span { display: inline-flex; align-items: center; gap: 6px; }
