/* ============================================================
   食迹 — Nurio 风格网页原型
   设计要点：暗色网格纸、荧光胶带、手绘感、细线卡片、浅蓝主按钮
   ============================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

:root {
  --bg: #0b0d0c;
  --surface: #101312;
  --card: #151817;
  --card-2: #1a1e1c;
  --sheet: #121514;
  --ink: #eef1ec;
  --ink-2: #b9c0b9;
  --muted: #79807a;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .17);
  --line-soft: rgba(255, 255, 255, .055);
  --grid: rgba(255, 255, 255, .038);
  --accent: #cfe3fb;
  --accent-ink: #0c1210;
  --lime: #d8f36a;
  --blue: #8ab4f8;
  --green: #8fe06a;
  --yellow: #f2d24b;
  --red: #ff8a7a;
  --scrim: rgba(3, 5, 4, .62);
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);

  /* validated chart series (dark surface #151817) */
  --s-blue: #3987e5;
  --s-green: #199e70;
  --s-amber: #c98500;
  --chart-line: #a9cbf2;
  --chart-grid: rgba(255, 255, 255, .07);

  --thumb-a: #232823;
  --thumb-b: #171b18;
}

[data-theme="light"] {
  --bg: #f2f1ea;
  --surface: #f7f6f0;
  --card: #fffefa;
  --card-2: #f4f2ea;
  --sheet: #fffdf7;
  --ink: #151713;
  --ink-2: #4d534c;
  --muted: #858b83;
  --line: rgba(15, 20, 14, .12);
  --line-strong: rgba(15, 20, 14, .24);
  --line-soft: rgba(15, 20, 14, .07);
  --grid: rgba(15, 20, 14, .055);
  --accent: #1d2a20;
  --accent-ink: #f7f8f1;
  --lime: #d8f36a;
  --blue: #2a72c9;
  --green: #1f8a3d;
  --yellow: #b37a00;
  --red: #cf4b3f;
  --scrim: rgba(40, 44, 38, .34);
  --shadow: 0 18px 40px rgba(40, 40, 30, .16);

  --s-blue: #2a78d6;
  --s-green: #1baf7a;
  --s-amber: #eda100;
  --chart-line: #2a78d6;
  --chart-grid: rgba(15, 20, 14, .10);

  --thumb-a: #efede3;
  --thumb-b: #e3e1d5;
}

html, body { margin: 0; height: 100%; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body {
  background: #070808;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

button, input, select { font: inherit; color: inherit; }
input, textarea, select { -webkit-user-select: text; user-select: text; }
button, a, .tab, .day, .chip, .mode { touch-action: manipulation; -webkit-touch-callout: none; }
img { -webkit-user-drag: none; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
input { border: 0; outline: 0; background: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 14px; height: 14px; }
.ic-xs { width: 12px; height: 12px; }

/* ---------- shell ---------- */
.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}
.grid-layer {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
}

@media (min-width: 560px) {
  body { display: grid; place-items: center; padding: 18px; }
  .app {
    height: min(930px, calc(100dvh - 36px));
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 40px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0,0,0,.4);
  }
}

.screen {
  position: absolute; inset: 0; z-index: 1;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(112px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  display: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen.is-active { display: block; animation: screen-in .26s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; }
.page-head h1 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; }
.date-btn { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.date-btn .ic { color: var(--ink); transform: rotate(0deg); }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--ink-2);
  border: 1px solid transparent;
}
.icon-btn:hover { background: rgba(127, 132, 125, .1); }
.icon-btn:active { transform: scale(.94); }

/* ---------- week ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 14px; }
.day {
  height: 50px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 14px; color: var(--muted);
  border: 1.4px solid transparent;
  transition: .18s;
}
.day .dw { font-size: 9.5px; color: var(--muted); }
.day .dn { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.day:hover { color: var(--ink-2); }
.day.is-today { color: var(--ink); }
.day.is-today .dw { color: var(--lime); }
.day.is-on { color: var(--ink); border-color: var(--ink); background: rgba(255,255,255,.03); font-weight: 650; }
.day.is-on .dw { color: var(--ink-2); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 156px 1fr; gap: 14px; align-items: center; }
.ring-wrap { position: relative; width: 156px; height: 156px; display: grid; place-items: center; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line-strong); stroke-width: 1.4; stroke-dasharray: 2 7; stroke-linecap: round; }
.ring-base { fill: none; stroke: var(--line-soft); stroke-width: 9; }
.ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 0 100;
  transition: stroke-dasharray .7s cubic-bezier(.2,.8,.2,1);
}
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding-top: 2px; }
.ring-kcal { font-size: 33px; font-weight: 750; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-unit { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; }
.goal-btn {
  margin-top: 7px; font-size: 10px; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-2);
}
.goal-btn:hover { color: var(--ink); border-color: var(--ink-2); }

.macros { display: flex; flex-direction: column; }
.macro { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.macro:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 3px; }
.dot.p { background: var(--blue); }
.dot.c { background: var(--green); }
.dot.f { background: var(--yellow); }
.macro .k { font-size: 13.5px; color: var(--ink-2); }
.macro .v { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.macro .v em { font-style: normal; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 14px 0 12px; }
.pager i { width: 5px; height: 5px; border-radius: 99px; background: var(--line-strong); }
.pager i.on { width: 46px; height: 4px; background: var(--accent); }
.goal-state { text-align: center; font-size: 11px; color: var(--muted); margin: -6px 0 12px; }
.goal-state.over { color: var(--red); }
.goal-state.ok { color: var(--green); }

/* ---------- photo card ---------- */
.photo-card {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 10px 12px 10px 10px; border-radius: 18px;
  background: linear-gradient(112deg, var(--card-2), var(--card) 60%);
  border: 1px solid var(--line);
  transition: .18s;
}
.photo-card:active { transform: scale(.985); }
.photo-art { width: 86px; height: 66px; flex: none; border-radius: 14px; background: rgba(233,231,224,.08); display: grid; place-items: center; overflow: hidden; }
.photo-art svg { width: 88px; height: 66px; }
.photo-txt { flex: 1; min-width: 0; }
.photo-txt b { display: block; font-size: 14.5px; font-weight: 650; }
.photo-txt small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.circle-go { width: 30px; height: 30px; border-radius: 99px; border: 1px solid var(--line-strong); display: grid; place-items: center; flex: none; color: var(--ink-2); }

/* ---------- meals ---------- */
.meal-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.meal {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 12px 14px 6px;
}
.meal-head { display: flex; align-items: center; gap: 8px; }
.meal-head .m-name { font-size: 15px; font-weight: 650; }
.meal-head .m-arrow { color: var(--muted); }
.meal-head .m-kcal { margin-left: auto; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.meal-head .m-kcal small { font-weight: 400; font-size: 10px; color: var(--muted); margin-left: 2px; }
.meal-macros { display: flex; gap: 16px; padding: 7px 0 2px; }
.mm { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.food-row { display: grid; grid-template-columns: 50px 1fr auto; gap: 11px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.food-row:first-of-type { border-top: 0; }
.thumb {
  width: 50px; height: 50px; border-radius: 13px;
  background: linear-gradient(150deg, var(--thumb-a), var(--thumb-b));
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 19px; font-weight: 700; color: var(--ink-2);
  overflow: hidden;
}
.thumb span { opacity: .85; }
.thumb { position: relative; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.food-row[data-entry] { cursor: pointer; }
.food-row[data-entry]:active { background: rgba(127, 132, 125, .05); }
.food-name { font-size: 14.5px; font-weight: 550; }
.food-sub { font-size: 11px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.food-macros { display: flex; gap: 10px; margin-top: 4px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.food-macros i { display: inline-flex; align-items: center; gap: 3px; font-style: normal; }
.food-kcal { text-align: right; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.food-kcal small { display: block; font-size: 9.5px; color: var(--muted); }

.add-row { display: flex; align-items: center; gap: 12px; padding: 12px 0 10px; border-top: 1px solid var(--line-soft); width: 100%; text-align: left; }
.add-sq { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.add-row span { font-size: 13.5px; color: var(--ink-2); }

.meal-empty {
  border: 1px dashed var(--line-strong); border-radius: 20px;
  padding: 16px; display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 13.5px;
  background: transparent; width: 100%;
}
.meal-empty .add-sq { border-style: dashed; }

/* ---------- fab ---------- */
.home-fade {
  position: absolute; left: 0; right: 0; bottom: calc(74px + env(safe-area-inset-bottom)); height: 96px; z-index: 34;
  background: linear-gradient(to top, var(--bg) 26%, color-mix(in srgb, var(--bg) 55%, transparent) 62%, transparent 100%);
  pointer-events: none;
}
.fab {
  position: absolute; right: 18px; bottom: calc(94px + env(safe-area-inset-bottom)); z-index: 35;
  height: 48px; padding: 5px 14px 5px 5px; border-radius: 999px;
  display: flex; align-items: center; gap: 7px;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255,255,255,.08);
  transition: transform .16s;
}
.fab:active { transform: scale(.95); }
.fab-mic { width: 38px; height: 38px; border-radius: 999px; background: rgba(0, 0, 0, .12); display: grid; place-items: center; }
.fab-mic .ic { width: 20px; height: 20px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: absolute; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40;
  height: 68px; border-radius: 999px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255,255,255,.05);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); }
.tab span { font-size: 10.5px; letter-spacing: .02em; }
.tab .ic { width: 21px; height: 21px; }
.tab.is-on { color: var(--ink); }
.tab.is-on .ic { stroke-width: 1.9; }

/* ---------- scan ---------- */
.screen-scan { padding: 0; background: #050706; }
.scan-view { position: absolute; inset: 0; overflow: hidden; }
.scan-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(90% 55% at 50% 38%, #232b24 0%, #121613 48%, #070908 100%),
    #070908;
}
.scan-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(55% 40% at 50% 45%, transparent 0%, rgba(0,0,0,.55) 100%);
}
.scan-plate {
  position: absolute; left: 50%; top: 46%; width: 62%;
  transform: translate(-50%, -50%);
  opacity: .92; filter: saturate(.9);
}
.scan-plate svg { width: 100%; height: auto; }

.tape {
  background: var(--lime); color: #161b10;
  font-weight: 800; font-size: 13.5px; letter-spacing: .02em;
  padding: 7px 30px; display: inline-block;
  clip-path: polygon(2% 8%, 98% 0, 100% 88%, 96% 100%, 3% 96%, 0 82%);
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.tape-scan { position: absolute; top: calc(30px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%) rotate(-2.4deg); z-index: 4; }
.scan-top { position: absolute; top: calc(82px + env(safe-area-inset-top)); left: 0; right: 0; display: flex; justify-content: center; z-index: 4; }
.pill-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35); color: #e9efe8;
  background: rgba(10, 12, 10, .62);
  font-size: 12.5px;
}
.scan-frame { position: absolute; top: 25%; left: 9%; right: 9%; bottom: 33%; z-index: 3; }
.scan-frame i { position: absolute; width: 30px; height: 30px; border: 0 solid rgba(255,255,255,.85); }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-top-width: 2.5px; border-left-width: 2.5px; border-top-left-radius: 8px; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-top-width: 2.5px; border-right-width: 2.5px; border-top-right-radius: 8px; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 2.5px; border-left-width: 2.5px; border-bottom-left-radius: 8px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2.5px; border-right-width: 2.5px; border-bottom-right-radius: 8px; }
.scan-hint {
  position: absolute; top: calc(25% + 14px); left: 0; right: 0; text-align: center;
  font-size: 12px; color: rgba(240, 245, 238, .72); z-index: 4;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.scan-modes { position: absolute; left: 0; right: 0; bottom: calc(208px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 34px; z-index: 4; }

/* barcode panel */
.bc-panel {
  position: absolute; left: 20px; right: 20px; z-index: 5;
  bottom: calc(252px + env(safe-area-inset-bottom));
  background: rgba(12, 14, 12, .94);
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 18px; padding: 10px;
}
.bc-input-row { display: flex; gap: 8px; }
.bc-input-row input {
  flex: 1; height: 42px; border-radius: 12px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13);
  padding: 0 12px; color: #eef1ec; font-size: 14px; font-variant-numeric: tabular-nums;
}
.bc-input-row input::placeholder { color: rgba(238, 241, 236, .45); }
.bc-input-row button { height: 42px; padding: 0 16px; border-radius: 12px; background: var(--lime); color: #161b10; font-weight: 700; font-size: 13px; }
.bc-scan {
  width: 100%; margin-top: 8px; height: 36px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .16); color: #dfe5dd; font-size: 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.bc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.bc-actions .bc-scan { margin-top: 0; }
.bc-history { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; scrollbar-width: none; }
.bc-history::-webkit-scrollbar { display: none; }
.bc-history:empty { display: none; }
.bc-chip {
  flex: none; max-width: 132px; height: 26px; padding: 0 10px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05); color: #cfd6cc; font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bc-name-input {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  font-size: 16.5px; font-weight: 650; color: var(--ink); padding: 2px 0 6px; outline: 0;
}
.bc-name-input:focus { border-bottom-color: var(--line-strong); }
.bc-warn {
  font-size: 11.5px; line-height: 1.6; color: var(--yellow);
  background: rgba(242, 210, 75, .08); border: 1px solid rgba(242, 210, 75, .18);
  border-radius: 12px; padding: 9px 12px; margin: 4px 0 10px;
}
.mode { font-size: 13px; color: rgba(240,245,238,.5); padding-bottom: 6px; border-bottom: 2px solid transparent; }
.mode.is-on { color: #f3f6f0; border-bottom-color: #f3f6f0; }
.scan-controls {
  position: absolute; left: 0; right: 0; bottom: calc(116px + env(safe-area-inset-bottom)); z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 44px;
}
.round-btn {
  width: 46px; height: 46px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.07);
  color: #eef2ec; display: grid; place-items: center;
}
.shutter { width: 76px; height: 76px; border-radius: 999px; border: 3px solid rgba(255,255,255,.92); display: grid; place-items: center; }
.shutter span { width: 58px; height: 58px; border-radius: 999px; background: #f5f7f2; transition: transform .12s; }
.shutter:active span { transform: scale(.9); }
.scan-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.scan-shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.06) 26%, rgba(0,0,0,.06) 55%, rgba(0,0,0,.72));
}
.scan-analyzing {
  position: absolute; inset: 0; z-index: 8;
  display: grid; place-items: center; align-content: center; gap: 14px;
  background: rgba(5, 7, 6, .84);
  color: #eef2ec; font-size: 13px;
}
.spinner { width: 34px; height: 34px; border-radius: 99px; border: 2px solid rgba(255,255,255,.18); border-top-color: var(--lime); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- train ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px;
  background: rgba(255,255,255,.02);
}
.chip.is-on { background: var(--lime); color: #171c10; border-color: transparent; font-weight: 650; }

.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin-bottom: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat .n { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .n small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.stat .l { font-size: 11px; color: var(--muted); margin-top: 2px; }

.ex-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ex-icon { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(150deg, var(--thumb-a), var(--thumb-b)); display: grid; place-items: center; color: var(--ink-2); font-weight: 700; font-size: 15px; flex: none; border: 1px solid var(--line); }
.ex-main { flex: 1; min-width: 0; }
.ex-name { font-size: 14.5px; font-weight: 600; }
.ex-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ex-check { width: 28px; height: 28px; border-radius: 999px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; flex: none; }
.ex-check.done { background: var(--lime); border-color: transparent; color: #171c10; }
.ex-check .ic { width: 15px; height: 15px; stroke-width: 2.4; }

.section-label { font-size: 11.5px; color: var(--ink-2); font-weight: 650; letter-spacing: .04em; margin: 18px 2px 10px; display: flex; align-items: center; gap: 8px; }
.section-label::after { content: ""; height: 1px; flex: 1; background: var(--line-soft); }

/* ---------- trends ---------- */
.trend-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 12px; }
.trend-tabs::-webkit-scrollbar { display: none; }
.ttab {
  flex: none; height: 36px; padding: 0 15px; border-radius: 12px;
  border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px;
}
.ttab.is-on { background: rgba(255,255,255,.06); color: var(--ink); border-color: var(--line-strong); font-weight: 600; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 13px; background: rgba(127,132,125,.09); margin-bottom: 14px; }
.seg button { height: 30px; border-radius: 10px; font-size: 12px; color: var(--muted); }
.seg button.is-on { background: var(--card-2); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.2); font-weight: 600; }

.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 14px 10px; margin-bottom: 12px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.chart-title { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.chart-big { font-size: 26px; font-weight: 720; letter-spacing: -.03em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.chart-big small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.chart-delta { font-size: 11.5px; color: var(--green); background: rgba(143, 224, 106, .12); padding: 3px 8px; border-radius: 999px; margin-top: 5px; }
.chart-delta.down { color: var(--green); }
.chart-body { position: relative; margin-top: 10px; }
.chart-body svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-table-btn { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.chart-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { text-align: right; padding: 5px 4px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; color: var(--muted); }
.chart-table th { font-weight: 500; color: var(--muted); }

.legend { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); }
.legend i { width: 8px; height: 8px; border-radius: 2px; }

.tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: #232823; color: #f2f5ee; border: 1px solid rgba(255,255,255,.14);
  font-size: 11px; padding: 5px 8px; border-radius: 8px; white-space: nowrap;
  transform: translate(-50%, -130%); opacity: 0; transition: opacity .12s;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
.tip.on { opacity: 1; }

.tile-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.tile .n { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile .n small { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.tile .l { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---------- sheets ---------- */
.sheet-root { position: absolute; inset: 0; z-index: 95; }
.sheet-root[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .24s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 91%; overflow-y: auto; scrollbar-width: none;
  background: var(--sheet); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(102%);
  transition: transform .3s cubic-bezier(.2,.85,.25,1);
  box-shadow: 0 -20px 60px rgba(0,0,0,.45);
}
.sheet::-webkit-scrollbar { display: none; }
.sheet-root.is-open .scrim { opacity: 1; }
.sheet-root.is-open .sheet { transform: none; }
.sheet-handle { width: 42px; height: 4px; border-radius: 99px; background: var(--line-strong); margin: 4px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.sheet-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.x-btn { width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center; color: var(--muted); background: rgba(127,132,125,.1); flex: none; }

.btn { height: 48px; border-radius: 999px; font-size: 15px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 22px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); width: 100%; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--ink-2); }
.btn:active { transform: scale(.985); }

.srow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); width: 100%; text-align: left; }
.srow:last-child { border-bottom: 0; }
.srow .lbl { font-size: 14px; }
.srow .val { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.srow .ic { width: 15px; height: 15px; color: var(--muted); }
.sgroup { margin-bottom: 10px; }
.sgroup-title { font-size: 11px; color: var(--muted); letter-spacing: .1em; margin: 18px 2px 4px; font-weight: 600; }

.toggle { width: 46px; height: 27px; border-radius: 999px; background: rgba(127,132,125,.25); position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 99px; background: #f2f4ee; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(19px); }

.field { margin-bottom: 10px; }
.field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; height: 44px; border-radius: 12px;
  background: rgba(127,132,125,.07); border: 1px solid var(--line);
  padding: 0 12px; font-size: 14.5px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.field input:focus { border-color: var(--line-strong); }
.field .static {
  width: 100%; height: 44px; border-radius: 12px;
  background: rgba(127,132,125,.07); border: 1px solid var(--line);
  padding: 0 12px; display: flex; align-items: center;
  font-size: 14.5px; color: var(--muted);
}
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* result sheet */
.result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.result-head .thumb { width: 54px; height: 54px; }
.result-head .name { font-size: 16.5px; font-weight: 650; }
.result-head .tag { font-size: 11px; color: var(--muted); margin-top: 2px; }
.advice { background: rgba(127,132,125,.07); border: 1px solid var(--line-soft); border-radius: 14px; padding: 11px 12px; margin-bottom: 12px; }
.advice .t { font-size: 11.5px; color: var(--ink-2); font-weight: 650; margin-bottom: 4px; }
.advice p { font-size: 11.5px; color: var(--ink-2); line-height: 1.55; }
.advice ol { margin: 0; padding-left: 15px; }
.advice li { font-size: 11.5px; color: var(--ink-2); line-height: 1.55; margin-bottom: 2px; }
.note { font-size: 10px; color: var(--muted); margin: 6px 0 12px; line-height: 1.5; }
.select-row { display: flex; align-items: center; justify-content: space-between; height: 46px; border: 1px solid var(--line); border-radius: 13px; padding: 0 12px; margin-bottom: 9px; font-size: 13.5px; }
.select-row select { background: transparent; border: 0; color: var(--ink); font-size: 13.5px; text-align: right; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; font-size: 13.5px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 10px; }
.sheet-actions .btn { height: 46px; }

/* food picker */
.picker-total { display: flex; align-items: baseline; gap: 8px; padding: 2px 0 10px; }
.picker-total .n { font-size: 24px; font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.picker-total .u { font-size: 10px; color: var(--muted); }
.picker-total .mm { margin-left: auto; }
.search { display: flex; align-items: center; gap: 9px; height: 42px; border-radius: 999px; border: 1px solid var(--line); padding: 0 14px; margin-bottom: 10px; color: var(--muted); }
.search input { flex: 1; font-size: 13.5px; color: var(--ink); }
.search .ic { width: 17px; height: 17px; }
.seg-tabs { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.seg-tabs::-webkit-scrollbar { display: none; }
.stab { flex: none; height: 32px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.stab.is-on { background: rgba(255,255,255,.06); color: var(--ink); border-color: var(--line-strong); }
.pick-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 11px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.pick-row .thumb { width: 46px; height: 46px; font-size: 17px; }
.add-mini { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--ink-2); }
.add-mini:active { background: rgba(255,255,255,.08); }

/* voice */
.voice-stage { display: grid; place-items: center; padding: 10px 0 18px; }
.voice-orb { width: 108px; height: 108px; border-radius: 999px; background: radial-gradient(circle at 35% 30%, rgba(216,243,106,.28), rgba(216,243,106,.05) 65%); border: 1px solid rgba(216,243,106,.35); display: grid; place-items: center; position: relative; padding: 0; cursor: pointer; }
.voice-type { display: flex; gap: 8px; margin: 4px 0 10px; }
.voice-type input {
  flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(127, 132, 125, .07); padding: 0 12px; font-size: 14px; color: var(--ink);
}
.voice-type button { height: 44px; padding: 0 16px; border-radius: 12px; background: var(--lime); color: #161b10; font-weight: 700; font-size: 13px; }
.voice-orb::after { content: ""; position: absolute; inset: -12px; border-radius: 99px; border: 1px solid rgba(216,243,106,.18); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.18); opacity: 0; } }
.voice-orb .ic { width: 38px; height: 38px; color: var(--lime); }
.voice-status { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.transcript { margin: 4px 0 14px; padding: 12px 14px; border-radius: 14px; background: rgba(127,132,125,.07); border: 1px solid var(--line-soft); font-size: 14px; line-height: 1.6; }
.transcript .cursor { display: inline-block; width: 7px; height: 15px; background: var(--lime); vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.parsed { display: flex; flex-direction: column; gap: 8px; }
.parsed-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 13px; border: 1px solid var(--line-soft); background: rgba(127,132,125,.05); font-size: 13px; }
.parsed-row .thumb { width: 36px; height: 36px; font-size: 14px; border-radius: 10px; }
.parsed-row .pc { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* toast */
.toast {
  position: absolute; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px);
  background: #242924; color: #f2f5ee; border: 1px solid rgba(255,255,255,.14);
  font-size: 12.5px; padding: 9px 16px; border-radius: 999px; z-index: 80;
  opacity: 0; transition: .22s; pointer-events: none; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast button { margin-left: 10px; color: var(--lime); font-weight: 700; font-size: 12.5px; pointer-events: auto; }
.toast { max-width: 92%; white-space: normal; text-align: center; }
.field input[readonly] { color: var(--muted); }
.edit-hint { font-size: 11px; color: var(--muted); margin: -4px 0 10px 2px; }

/* date picker */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 8px; }
.cal-head b { font-size: 16px; }
.cal-sub { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.cal-nav { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); border: 1px solid var(--line); }
#calPrev .ic { transform: rotate(180deg); }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-week span { text-align: center; font-size: 10.5px; color: var(--muted); padding: 6px 0; }
.cal-day { height: 40px; border-radius: 12px; position: relative; font-size: 13px; color: var(--ink-2); display: grid; place-items: center; }
.cal-day.is-on { border: 1.4px solid var(--ink); color: var(--ink); font-weight: 650; }
.cal-day.is-today { color: var(--lime); }
.cal-day.is-on.is-today { color: var(--ink); }
.cal-dot { position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 99px; background: var(--lime); }
.cal-empty { height: 40px; }

/* empty trend */
.trend-empty {
  background: var(--card); border: 1px dashed var(--line-strong); border-radius: 20px;
  padding: 28px 18px; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 4px;
}
.trend-empty b { font-size: 15px; }
.trend-empty span { font-size: 12px; color: var(--muted); }
.te-ring { width: 44px; height: 44px; border-radius: 99px; border: 2px dashed var(--line-strong); margin-bottom: 8px; }
.food-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* onboarding */
.onboarding {
  position: absolute; inset: 0; z-index: 90;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(16px + env(safe-area-inset-bottom));
}
.onboarding::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
}
.ob-top, .ob-body, .ob-foot { position: relative; z-index: 1; }
.ob-top { display: flex; align-items: center; justify-content: space-between; height: 34px; }
.ob-dots { display: flex; align-items: center; gap: 6px; }
.ob-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--line-strong); }
.ob-dots i.on { width: 22px; background: var(--accent); }
.ob-skip { font-size: 12px; color: var(--muted); }
.ob-back { width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center; color: var(--ink-2); }
.ob-back .ic { transform: rotate(180deg); }
.ob-body { flex: 1; overflow-y: auto; padding: 10px 0 8px; scrollbar-width: none; }
.ob-body::-webkit-scrollbar { display: none; }
.ob-art { height: 116px; display: grid; place-items: center; margin: 6px 0 10px; }
.ob-art svg { height: 100%; width: auto; }
.ob-body h2 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.ob-sub { font-size: 12.5px; color: var(--muted); line-height: 1.65; margin-top: 6px; }
.ob-copy { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; font-size: 13px; line-height: 1.7; color: var(--ink-2); margin-top: 12px; }
.ob-list { margin: 12px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 12.5px; line-height: 1.8; }
.ob-quick {
  width: 100%; height: 46px; margin-top: 8px; padding: 0 14px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); font-size: 13.5px; text-align: left;
}
.ob-quick .ic { color: var(--ink-2); }
.ob-quick span { margin-left: auto; font-size: 11px; color: var(--muted); }
.ob-quick:active { background: rgba(127,132,125,.08); }
.ob-foot { padding-top: 10px; }
.ob-foot .btn { width: 100%; }
.ob-link { width: 100%; margin-top: 10px; font-size: 11.5px; color: var(--muted); text-decoration: underline; }
.ob-goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 12px; }
.ob-goal {
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-2);
}
.ob-goal small { font-size: 10.5px; color: var(--muted); }
.ob-goal b { font-size: 19px; font-weight: 720; color: var(--ink); font-variant-numeric: tabular-nums; }
.ob-goal.is-on { border-color: var(--lime); background: rgba(216, 243, 106, .07); }
.ob-custom { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; height: 48px; }
.ob-custom label { font-size: 12px; color: var(--muted); }
.ob-custom input { flex: 1; font-size: 17px; font-weight: 650; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.ob-custom span { font-size: 11px; color: var(--muted); }
.perm-copy { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; margin: 4px 0 14px; }

/* weekly report */
.report-hero { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 14px; }
.report-hero b { font-size: 38px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.report-hero span { font-size: 11.5px; color: var(--muted); }
.report-hero em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); }
.macro-bar { display: grid; grid-template-columns: 42px 1fr 74px; gap: 10px; align-items: center; margin: 11px 0; font-size: 11.5px; color: var(--ink-2); }
.macro-bar .track { height: 6px; border-radius: 99px; background: rgba(127, 132, 125, .16); overflow: hidden; }
.macro-bar .fill { display: block; height: 100%; border-radius: 99px; }
.macro-bar .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* empty day */
.empty-day {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 13px 14px; margin-top: 14px;
  border: 1px dashed var(--line-strong); border-radius: 18px;
}
.empty-day .ed-art { width: 42px; height: 42px; border-radius: 12px; background: rgba(127,132,125,.08); display: grid; place-items: center; color: var(--muted); flex: none; }
.empty-day b { display: block; font-size: 13.5px; }
.empty-day span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.empty-day .circle-go { margin-left: auto; }

/* splash */
.splash {
  position: absolute; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-align: center; padding: 32px;
  transition: opacity .45s, visibility .45s;
}
.splash.is-gone { opacity: 0; visibility: hidden; }
.splash-art { width: 132px; height: 132px; margin-bottom: 14px; }
.splash-kicker { font-size: 10px; letter-spacing: .32em; color: var(--lime); font-weight: 700; }
.splash h2 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; margin-top: 6px; }
.splash-sub { font-size: 12.5px; color: var(--muted); margin: 6px 0 26px; }
.splash .btn { width: 180px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.bc-warn-link { margin-left: 4px; font-size: 11.5px; color: var(--yellow); text-decoration: underline; }

.install-tip {
  position: absolute; left: 14px; right: 14px; z-index: 36;
  bottom: calc(150px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 16px;
  background: rgba(20, 24, 21, .97); border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.install-tip-txt { flex: 1; min-width: 0; }
.install-tip b { display: block; font-size: 12.5px; }
.install-tip span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.install-tip #installTipGo {
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--lime); color: #161b10; font-size: 11.5px; font-weight: 700; flex: none;
}
.install-tip .tip-x { width: 24px; height: 24px; display: grid; place-items: center; color: var(--muted); flex: none; }
