/* 3案共通。色はCRISPの実画面から採った深緑・生成り・ブロンズを基準にしている。 */
:root {
  color-scheme: light;
  --forest: #093B2D;
  --forest-2: #174C3D;
  --forest-line: #2B5A4C;
  --cream: #F9F8F4;
  --stone: #E9E8E2;
  --stone-2: #DDDCD3;
  --bronze: #BB8B52;
  --bronze-ink: #805622;
  --ink: var(--forest);
  --ink-2: #48665C;
  --on-dark: #F4F2EA;
  --on-dark-2: #B8C9C2;
  --danger: #A83A3A;
  --danger-on-dark: #FF9B8F;
  --p: #C9336B;
  --f: #A97708;
  --c: #6658B8;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --curve: 32px;
  --num: "Avenir Next", "Hiragino Sans", system-ui, sans-serif;
  --jp: "Avenir Next", "Hiragino Sans", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
}
:root.framed { --sat: 62px; --sab: 34px; }
.on-dark { --p: #D9588A; --f: #B58A1C; --c: #7F78D6; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* 背景を下部メニューと同色にし、iOSのホーム画面アプリで下端に隙間が出ても途切れて見えないようにする */
html, body { height: 100%; margin: 0; background: var(--stone); overflow: hidden; overscroll-behavior: none; }
body {
  color: var(--ink); font: 500 14px/1.45 var(--jp);
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
input { -webkit-appearance: none; appearance: none; }
button {
  margin: 0; padding: 0; border: 0; background: none; text-align: inherit;
  cursor: pointer; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button:disabled { opacity: .38; cursor: default; }
button:not(:disabled):active { opacity: .72; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
svg { display: block; }
.icon { width: 22px; height: 22px; flex: none; }
.num { font-family: var(--num); }
.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---------- 画面の骨格 ---------- */
.app {
  position: relative; height: 100vh; height: 100dvh; max-width: 440px; margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden; background: var(--stone); isolation: isolate;
}
.screen {
  position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--cream);
  border-radius: 0 0 var(--curve) var(--curve);
}
.scroll {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: none;
}
.scroll::-webkit-scrollbar, .hscroll::-webkit-scrollbar { display: none; }
.hscroll { display: flex; overflow-x: auto; scrollbar-width: none; }

.hd {
  position: sticky; top: 0; z-index: 3; height: calc(var(--sat) + 52px); padding: var(--sat) 12px 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--forest); color: var(--on-dark);
}
.hd-title { font: 700 14px var(--num); letter-spacing: .06em; }
.hd-left { justify-self: start; padding-left: 4px; }
.hd-right { justify-self: end; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.date { display: flex; align-items: center; }
.date .icon { width: 18px; height: 18px; }
.date strong { min-width: 86px; text-align: center; font: 700 17px var(--num); white-space: nowrap; }
.date small { margin-left: 3px; font: 700 12px var(--jp); }
.today-label { font: 700 12px var(--num); letter-spacing: .1em; }

.nav {
  position: relative; z-index: 4; flex: none; background: var(--stone);
  padding: 5px 6px max(8px, calc(var(--sab) - 4px));
  display: flex; align-items: center;
}
.tab {
  flex: 1; min-width: 44px; height: 54px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--forest); font: 700 10.5px var(--num); letter-spacing: .035em; text-align: center;
}
.tab .icon { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--bronze-ink); }

/* ---------- 数値とメーター ---------- */
.meter {
  --fill: var(--forest);
  position: relative; display: flex; gap: 2px; height: 7px; overflow: hidden; border-radius: 99px;
  background: rgba(9, 59, 45, .10);
  background: color-mix(in srgb, var(--fill) 20%, var(--track-base, #fff));
}
.meter.p { --fill: var(--p); } .meter.f { --fill: var(--f); } .meter.c { --fill: var(--c); }
.meter.kcal { --fill: var(--bronze); }
.meter b { flex: none; background: var(--fill); border-radius: 99px; }
.meter em { flex: 1; background: var(--danger); }
.on-dark .meter { --track-base: var(--forest); }
.on-dark .meter em { background: var(--danger-on-dark); }
.key { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.key.p { background: var(--p); } .key.f { background: var(--f); } .key.c { background: var(--c); }
.state-over { color: var(--danger); }
.on-dark .state-over { color: var(--danger-on-dark); }
.state-icon { display: inline-block; width: 12px; height: 12px; margin-right: 2px; vertical-align: -1px; stroke-width: 2.6; }

/* ---------- 食品 ---------- */
.food { width: 100%; height: 100%; }
.squircle { display: grid; place-items: center; flex: none; background: var(--stone); border-radius: 36%; }
.squircle > .food { width: 78%; height: 78%; }
.pile { display: flex; align-items: center; }
.pile > .food { width: 34px; height: 34px; flex: none; }
.pile > .food + .food { margin-left: -10px; }
.ellipsis { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- シート ---------- */
#layer:empty { display: none; }
#layer { position: absolute; inset: 0; z-index: 10; }
.shade { position: absolute; inset: 0; width: 100%; background: rgba(9, 59, 45, .57); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: var(--kb, 0px);
  max-height: calc(100% - max(var(--sat), var(--vt, 0px)) - 12px - var(--kb, 0px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px 20px 0 0; background: var(--cream); animation: rise .2s ease-out;
}
.sheet.tall { height: calc(100% - max(var(--sat), var(--vt, 0px)) - 12px - var(--kb, 0px)); }
.sheet.still { animation: none; }
@keyframes rise { from { transform: translateY(24px); } }
.sh-head { flex: none; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 8px 8px 0; }
.sh-head h2 { grid-column: 2; text-align: center; font-size: 15px; font-weight: 700; }
.sh-head .icon-btn { grid-column: 3; }
.sh-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 20px 20px; overscroll-behavior: contain; }
.sh-foot { flex: none; padding: 10px 20px max(14px, var(--sab)); background: var(--stone); }
:root.keyboard .sh-foot { padding-bottom: 10px; }

.primary, .secondary {
  width: 100%; min-height: 54px; padding: 0 16px; border-radius: 4px; text-align: center; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.primary { background: var(--forest); color: var(--on-dark); }
.secondary { border: 1px solid var(--forest); }
.linkbtn { min-height: 44px; padding: 0 4px; color: var(--bronze-ink); text-decoration: underline; text-underline-offset: 3px; }
.linkbtn.danger { color: var(--danger); }
.stack .linkbtn { text-align: center; }

.pills { display: flex; gap: 4px; }
.pill {
  flex: 1; min-height: 44px; padding: 0 10px; border-radius: 99px; text-align: center; white-space: nowrap;
}
.pill[aria-pressed="true"] { background: var(--forest); color: var(--on-dark); font-weight: 700; }
/* 見た目は小さく、押せる範囲は44pxのまま */
.pill.mini { position: relative; z-index: 0; background: none; }
.pill.mini::before { content: ""; position: absolute; z-index: -1; inset: 5px; border-radius: 50%; }
.pill.mini[aria-pressed="true"]::before { background: var(--forest); }

.find {
  display: flex; align-items: center; gap: 9px; height: 46px; margin-top: 10px; padding: 0 14px;
  border-radius: 99px; background: var(--stone);
}
.find .icon { width: 18px; height: 18px; }
.find input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font-size: 16px; outline-offset: 0; }
.find input::placeholder { color: var(--ink-2); }
.find input { -webkit-appearance: none; appearance: none; }
.sh-head h2 small { margin-left: 6px; color: var(--bronze-ink); font-size: 12px; }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.methods button {
  height: 50px; border: 1px solid var(--forest); border-radius: 4px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.group { margin: 18px 0 2px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.f-row { display: flex; align-items: center; min-height: 68px; border-bottom: 1px solid var(--stone); }
.f-row .open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; min-height: 60px; }
.f-row .squircle { width: 48px; height: 48px; }
.f-row .txt { flex: 1; min-width: 0; }
.f-row .txt b, .f-row .txt small { display: block; }
.f-row .txt b { font-size: 14px; overflow-wrap: anywhere; }
.f-row .txt small { color: var(--ink-2); font-size: 11px; }
.round {
  position: relative; width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  border: 1px solid currentColor; border-radius: 50%;
}
.round .count {
  position: absolute; top: -5px; right: -4px; min-width: 20px; height: 20px; padding: 0 4px;
  border-radius: 99px; display: grid; place-items: center; background: var(--forest); color: var(--on-dark);
  font: 700 11px var(--num);
}
.foot-sum {
  width: 100%; min-height: 56px; padding: 0 18px; display: flex; align-items: center; gap: 12px;
  border-radius: 4px; background: var(--forest); color: var(--on-dark);
}
.foot-sum .n {
  width: 32px; height: 32px; display: grid; place-items: center; flex: none;
  border: 1px solid currentColor; border-radius: 50%; font: 600 13px var(--num);
}
.foot-sum b { flex: 1; }
.empty-note { padding: 28px 0; color: var(--ink-2); text-align: center; line-height: 1.8; }

.picked { display: flex; align-items: center; gap: 14px; padding: 4px 0 8px; }
.picked .squircle { width: 68px; height: 68px; }
.picked > div { min-width: 0; overflow-wrap: anywhere; }
.picked h3 { font-size: 18px; }
.picked p { color: var(--ink-2); font-size: 12px; }
.qty { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; margin: 12px 0; }
.qty > button { width: 56px; height: 56px; border: 1px solid var(--forest); border-radius: 50%; text-align: center; font: 700 14px var(--num); }
.qty label { display: flex; justify-content: center; align-items: baseline; gap: 4px; min-width: 0; }
.qty input {
  width: 3.3ch; max-width: 100%; min-width: 0; padding: 0; border: 0; border-bottom: 2px solid var(--stone-2); border-radius: 0;
  background: none; text-align: center; font: 700 50px var(--num);
}
.qty label span { font: 700 18px var(--num); }
.presets { display: flex; gap: 6px; }
.presets button { flex: 1; height: 44px; border-radius: 99px; background: var(--stone); text-align: center; font: 600 12px var(--num); }
.nutri { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; margin: 12px 0; padding: 12px 4px; border-radius: 6px; background: var(--stone); text-align: center; }
.nutri dt { color: var(--ink-2); font-size: 11px; }
.nutri dd { font: 700 19px var(--num); }
.field-label { display: block; margin: 14px 0 5px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.segs { display: flex; gap: 3px; padding: 3px; border-radius: 99px; background: var(--stone); }
.segs .pill { min-height: 44px; padding: 0 4px; font-size: 13px; }
.input {
  width: 100%; min-width: 0; height: 48px; padding: 0 10px; border: 1px solid #A9B5AE; border-radius: 4px;
  background: #fff; font: 600 16px var(--jp);
}
.four { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 6px; }
.four .field-label { white-space: nowrap; }
.four .input { padding: 0 6px; text-align: center; font: 700 18px var(--num); }
.now-amt { display: flex; align-items: center; gap: 8px; }
.now-amt .input { width: 108px; font: 700 18px var(--num); text-align: center; }
.calc { margin-top: 10px; color: var(--ink-2); font-size: 12px; }
.warn { display: flex; gap: 6px; margin-top: 8px; padding: 9px 10px; border-radius: 4px; background: #F6DEDA; color: var(--danger); font-size: 12px; }
.warn .icon { width: 17px; height: 17px; }
.source { padding: 10px 12px; border-left: 3px solid var(--bronze); background: var(--stone); font-size: 12px; }
.stack { display: grid; gap: 8px; }

/* ---------- 読み取り ---------- */
.scanner {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow-y: auto;
  padding: var(--sat) 0 0; background: #17130F; color: #fff;
}
.sc-head { flex: none; display: grid; grid-template-columns: 60px 1fr 60px; align-items: center; height: 56px; }
.sc-head .icon-btn { margin-left: 10px; border-radius: 50%; background: #fff; color: #111; }
.sc-head h2 { text-align: center; font: 700 14px var(--num); letter-spacing: .06em; }
.sc-view { flex: 1; min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sc-frame { position: relative; width: 76%; max-width: 300px; aspect-ratio: 1.42; display: grid; place-items: center; }
.sc-frame i { position: absolute; width: 34px; height: 34px; border: 0 solid #fff; }
.sc-frame i:nth-of-type(1) { top: 0; left: 0; border-top-width: 4px; border-left-width: 4px; border-radius: 12px 0 0 0; }
.sc-frame i:nth-of-type(2) { top: 0; right: 0; border-top-width: 4px; border-right-width: 4px; border-radius: 0 12px 0 0; }
.sc-frame i:nth-of-type(3) { bottom: 0; left: 0; border-bottom-width: 4px; border-left-width: 4px; border-radius: 0 0 0 12px; }
.sc-frame i:nth-of-type(4) { bottom: 0; right: 0; border-bottom-width: 4px; border-right-width: 4px; border-radius: 0 0 12px 0; }
.sc-code { width: 70%; height: 54%; padding: 12px; background: #E7E1D4; transform: rotate(-3deg); opacity: .82; }
.sc-code svg { width: 100%; height: 100%; }
.sc-hint { padding: 18px 24px 0; text-align: center; font-size: 13px; }
.sc-demo { flex: none; margin: 12px 14px; padding: 8px; border: 1px dashed #94897D; border-radius: 6px; }
.sc-demo p { margin-bottom: 6px; color: #C9BFB4; font-size: 11px; }
.sc-demo div { display: flex; gap: 6px; }
.sc-demo button { flex: 1; min-height: 44px; border-radius: 4px; background: #382F27; font-size: 12px; text-align: center; }
.sc-foot { flex: none; padding: 12px 20px max(14px, var(--sab)); background: #000; }
.sc-foot button { width: 100%; height: 54px; border-radius: 99px; background: var(--stone); color: var(--forest); text-align: center; font-weight: 700; }

/* ---------- 通知 ---------- */
.toast {
  position: absolute; z-index: 20; left: 12px; right: 12px; top: calc(var(--sat) + 2px);
  min-height: 48px; padding: 2px 6px 2px 14px; display: flex; align-items: center; gap: 2px;
  border-radius: 8px; background: #2F5E4F; color: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .24);
}
.toast:empty { display: none; }
/* シート内では見出しと閉じるボタンを隠さないよう、下部ボタンの上に出す */
.sheet-open .toast { top: auto; bottom: calc(max(14px, var(--sab)) + 74px + var(--kb, 0px)); }
.toast span { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; }
.toast button { min-height: 44px; padding: 0 7px; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* ---------- 推移・設定 ---------- */
.page { padding: 14px 20px 28px; }
.page h2 { font-size: 16px; }
.avg { margin: 12px 0; padding: 14px; border-radius: 6px; background: var(--stone); }
.avg > p { color: var(--ink-2); font-size: 12px; }
.avg > .avg-main { color: var(--ink); }
.avg > .avg-sub { margin-top: 6px; }
.avg-main { display: flex; align-items: baseline; gap: 5px; }
.avg-main b { font: 700 48px/1.15 var(--num); }
.avg-main span { font-weight: 700; }
.avg dl { display: flex; gap: 14px; margin-top: 4px; }
.avg dt, .avg dd { display: inline; }
.avg dd { font: 700 15px var(--num); margin-left: 3px; }
.metric { display: flex; gap: 4px; }
.metric .pill { font: 600 13px var(--num); }
.chart { position: relative; height: 178px; margin: 22px 0 0; display: flex; border-bottom: 1px solid var(--stone-2); }
.col { position: relative; z-index: 1; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.col b { width: 24px; border-radius: 4px 4px 0 0; background: var(--fill, var(--forest)); }
.col.now b { opacity: .36; }
.col[aria-pressed="true"] b { box-shadow: 0 0 0 2px var(--cream), 0 0 0 4px var(--bronze); }
.chart.p { --fill: var(--p); } .chart.f { --fill: var(--f); } .chart.c { --fill: var(--c); }
.target { position: absolute; left: 0; right: 0; height: 1px; background: var(--ink-2); pointer-events: none; }
.target span { position: absolute; z-index: 2; right: 0; bottom: 2px; padding: 0 3px; background: var(--cream); color: var(--ink-2); font: 600 10px var(--jp); }
.axis { display: flex; padding-top: 5px; }
.axis span { flex: 1; text-align: center; color: var(--ink-2); font-size: 11px; }
.readout { min-height: 44px; margin-top: 8px; padding: 10px 12px; border-radius: 4px; background: var(--stone); font-size: 13px; }
.details summary { min-height: 44px; padding-top: 13px; color: var(--bronze-ink); font-size: 12px; }
.details table { width: 100%; border-collapse: collapse; font: 500 12px var(--num); font-variant-numeric: tabular-nums; }
.details th, .details td { padding: 6px 2px; border-bottom: 1px solid var(--stone); text-align: right; }
.details th:first-child { text-align: left; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 14px; }
.cal .w { color: var(--ink-2); font-size: 11px; text-align: center; }
.cal button { height: 48px; border-radius: 6px; background: var(--stone); text-align: center; font: 600 12px var(--num); }
.cal button:disabled { background: transparent; }
.cal button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--bronze); }
.marks { height: 10px; margin-top: 4px; display: flex; gap: 4px; justify-content: center; }
.m-k, .m-p { display: inline-block; width: 8px; height: 8px; }
.m-k { border-radius: 50%; background: var(--forest); }
.m-p { background: var(--p); transform: rotate(45deg) scale(.86); }
.legend { display: flex; gap: 14px; margin-top: 10px; color: var(--ink-2); font-size: 11px; }
.legend i { margin-right: 4px; }
.sample { margin-top: 14px; color: var(--ink-2); font-size: 11px; }
.settings button { width: 100%; min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--stone); }
.settings b { flex: 1; }
.settings small { color: var(--ink-2); font: 500 12px var(--num); }
.settings .icon { width: 17px; height: 17px; }

/* ---------- PCで比較するときのiPhone枠 ---------- */
.status, .island, .home-bar { display: none; }
.framed .status {
  position: absolute; z-index: 30; top: 0; left: 0; right: 0; height: 54px; padding: 14px 32px 0 48px;
  display: flex; justify-content: space-between; align-items: center; color: #fff; pointer-events: none;
  font: 600 16px system-ui;
}
.framed .status svg { width: 68px; height: 13px; }
.framed .island { display: block; position: absolute; z-index: 31; top: 11px; left: calc(50% - 62px); width: 124px; height: 36px; border-radius: 20px; background: #000; pointer-events: none; }
.framed .home-bar { display: block; position: absolute; z-index: 30; bottom: 8px; left: calc(50% - 67px); width: 134px; height: 5px; border-radius: 3px; background: #1A1A1A; pointer-events: none; }
.framed .app.scanning .home-bar { background: #fff; }

@media (max-width: 374px) { .page { padding-left: 6px; padding-right: 6px; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

/* 確定UI：画面はA案（ステージ型）、下部メニューはB案（HOME / TREND / ADD / SCAN / SETTINGS） */
[data-view="home"] .screen { background: var(--forest); }
.a-home { padding: 0 14px 36px; }

.ticket { --track-base: #fff; position: relative; padding: 9px 14px 10px; border-radius: 6px; background: var(--stone); }
.lead { display: flex; justify-content: center; align-items: baseline; gap: 7px; white-space: nowrap; }
.lead b { font: 700 54px/1.08 var(--num); }
.lead span { font-size: 13px; font-weight: 700; }
.stage { position: relative; margin: 2px 4px 0; padding-top: 40px; }
.bubble {
  position: absolute; top: 2px; transform: translateX(-50%); min-width: 62px; height: 27px; padding: 0 11px;
  display: grid; place-items: center; border-radius: 99px; background: var(--bronze); color: #03231A;
  font: 700 14px var(--num);
}
.tail { position: absolute; top: 28px; transform: translateX(-50%); border: 6px solid transparent; border-top: 7px solid var(--bronze); }
.bubble.over { background: var(--danger); color: #fff; }
.tail.over { border-top-color: var(--danger); }
.stage .meter { height: 10px; background: #fff; }
.ends { display: flex; justify-content: space-between; padding-top: 4px; color: var(--ink-2); font: 600 11px var(--num); }
.perf { position: relative; margin: 6px -14px 8px; border-top: 2px dashed var(--cream); }
.perf::before, .perf::after { content: ""; position: absolute; top: -8px; width: 14px; height: 14px; border-radius: 50%; background: var(--forest); }
.perf::before { left: -7px; } .perf::after { right: -7px; }
.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.macro h3 { display: flex; align-items: center; white-space: nowrap; font: 700 12px var(--num); }
.macro h3 small { margin-left: 4px; color: var(--ink-2); font: 500 10.5px var(--jp); }
.macro .left { height: 33px; display: flex; align-items: center; white-space: nowrap; font-weight: 700; }
.macro .left b { font: 700 23px var(--num); }
.macro .left small { font-size: 11px; }
.macro .meter { height: 6px; }
.macro .ate { margin-top: 3px; color: var(--ink-2); font: 600 10.5px var(--num); }

.meals-title { display: flex; justify-content: space-between; align-items: center; height: 30px; color: var(--on-dark); }
.meals-title h2 { font-size: 14px; }
.meals-title span { color: var(--on-dark-2); font-size: 11px; }
.meals { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.meal { border-radius: 6px; background: var(--cream); }
.meal-top { display: flex; align-items: center; padding-right: 7px; }
.meal-open { flex: 1; min-width: 0; min-height: 54px; display: flex; align-items: center; gap: 9px; padding: 3px 4px 3px 10px; }
.meal-open .pile { width: 70px; flex: none; justify-content: center; }
.meal-open .pile:empty { height: 34px; border: 1.5px dashed #A9B5AE; border-radius: 99px; }
.meal-open .pile > .food { width: 32px; height: 32px; }
.meal-open .pile > .food + .food { margin-left: -13px; }
.meal-txt { flex: 1; min-width: 0; }
.meal-line { display: flex; align-items: baseline; gap: 6px; }
.meal-line b { font-size: 14px; }
.meal-line span { font: 700 13px var(--num); white-space: nowrap; }
.meal-txt small { display: block; color: var(--ink-2); font-size: 11px; }
.meal-top .round { border-color: transparent; background: var(--stone); }
.meal.is-on { background: #fff; }
.meal.is-on .meal-top .round { background: var(--forest); color: var(--on-dark); }

/* どの区分を選んでも、4区分の一覧と1タップが同じ位置に残る */
.one-tap-head { display: flex; align-items: center; justify-content: space-between; height: 44px; color: var(--on-dark); }
.one-tap-head h2 { font-size: 14px; white-space: nowrap; }
.one-tap-head .pills { gap: 0; }
.one-tap-head .pill { flex: none; width: 44px; padding: 0; font-size: 12px; }
.one-tap-head .pill[aria-pressed="true"] { color: var(--forest); }
.one-tap-head .pill[aria-pressed="true"]::before { background: var(--stone); }
.one-tap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.one-tap button { min-width: 0; height: 50px; display: flex; align-items: center; gap: 2px; padding: 0 5px 0 3px; border-radius: 6px; background: var(--cream); }
.one-tap .food { width: 34px; height: 34px; flex: none; }
.one-tap b, .one-tap small { display: block; }
.one-tap b { font-size: 11px; }
.one-tap small { color: var(--ink-2); font: 600 10.5px var(--num); }

/* ---------- 下部メニュー（B案） ---------- */
.nav .add-tab { position: relative; justify-content: flex-end; padding-bottom: 5px; }
.add-tab .orb {
  position: absolute; left: 50%; top: -25px; transform: translateX(-50%); width: 60px; height: 60px;
  display: grid; place-items: center; border: 4px solid var(--stone); border-radius: 50%;
  background: var(--forest); color: var(--on-dark);
}
.add-tab .orb .icon { width: 26px; height: 26px; }
.page, .settings { padding-bottom: 36px; } /* 中央の＋に隠れない余白 */

/* 高さが足りない端末だけ詰める（iPhone 17のホーム画面アプリでは詰まらない） */
@media (max-height: 820px) {
  .lead b { font-size: 48px; }
  .ticket { padding-top: 7px; padding-bottom: 8px; }
  .meals-title { height: 26px; }
  .meals { gap: 5px; }
  .one-tap button { height: 48px; }
}
@media (max-height: 760px) {
  .lead b { font-size: 42px; }
  .stage { padding-top: 35px; }
  .bubble { top: 0; height: 25px; }
  .tail { top: 24px; }
  .meals-title { height: 24px; }
  .meal-open { min-height: 48px; padding-top: 0; padding-bottom: 0; }
  .meals { gap: 4px; }
}
@media (max-width: 374px) {
  .macro h3 small { display: none; }
  .lead b { font-size: 42px; }
  .lead span { font-size: 11px; }
  .one-tap .food { width: 24px; height: 24px; }
}
