:root { --bg:#f7f2e9; --paper:#fcf9f3; --paper-2:#fffdf9; --ink:#213c30; --muted:#475d51; --line:#c2cabb; --red:#a4382c; --red-dark:#8f3125; --red-soft:#f0d9cc; --jade:#345e49; --gold:#936724; --mist:#e7ece1; --shadow:none; }
body { background:var(--bg); font-size:15px; }
button, input, select { color:inherit; }
button { font-weight:600!important; }
button:disabled { opacity:.45; cursor:not-allowed; }
button:focus-visible, a:focus-visible { outline:2px solid var(--jade); outline-offset:3px; }
.app { width:min(820px,100%); padding:0 22px calc(154px + env(safe-area-inset-bottom)); }
.landscape { height:180px; padding:16px 22px 110px; margin:0 -22px 18px; background:var(--paper); align-items:flex-start; position:relative; }
.landscape::after { content:""; position:absolute; left:0; right:0; bottom:0; height:94px; background:url('/static/assets/shanshui.webp') center 57% / cover no-repeat; }
.brand { align-self:flex-start; }
.brand-mark, .decor-strip { display:none; }
.brand h1 { font-family:Georgia,'Times New Roman',serif; font-size:30px; font-weight:500; margin-top:5px; color:var(--ink); }
.brand .eyebrow { font-size:13px; color:var(--muted); }
.top .icon-btn { background:var(--paper); border:1px solid var(--line); flex:0 0 44px; }
.owner-switch { width:220px; margin:0 auto 14px; background:transparent; border:1px solid var(--line); }
.owner-switch button { min-height:36px; }
.owner-switch button.active, .segment button.active { background:var(--jade); box-shadow:none; color:white; }
.summary { border:0; border-radius:0; padding:0 0 22px; background:none; border-bottom:1px solid var(--line); }
.day-row { margin-bottom:16px; }
.day-row .icon-btn { border:0; background:none; font-size:24px; }
.date-control { position:relative; flex:1; text-align:center; }
.date-btn { width:100%; background:transparent; font-weight:500!important; }
#dayPicker { position:absolute; inset:0; width:100%; opacity:0; cursor:pointer; }
.calorie-row { justify-content:center; gap:24px; }
.ring { width:84px; height:84px; flex-basis:84px; background:conic-gradient(var(--red) var(--progress),#e3e7da 0); }
.ring::before { inset:7px; background:var(--bg); box-shadow:none; }
.ring span { font-size:15px; font-weight:600; }
.calories { font-size:19px; font-weight:400; line-height:1.3; }
#totalKcal { font-size:32px; font-weight:600; }
.left { color:var(--jade); font-size:13px; max-width:230px; line-height:1.5; }
.view-note { font-size:13px; max-width:280px; }
.view-note:empty { display:none; }
.macro-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin-top:24px; }
.macro-chip { border:0; border-radius:0; background:none; padding:0; display:flex; flex-direction:column; align-items:stretch; gap:6px; }
.macro-chip span { display:block; width:auto; height:auto; background:none; border-radius:0; color:var(--muted); font-size:13px; font-weight:500; }
.macro-chip b { font-size:13px; font-weight:600; white-space:normal; overflow:visible; }
.macro-chip i { width:100%; background:#e0e5d9; height:4px; }
.macro-chip em { background:var(--jade); }
.macro-chip:nth-child(2) em { background:var(--gold); }
.macro-chip:nth-child(3) em { background:var(--red); }
.tabs { position:fixed; bottom:0; left:50%; transform:translateX(-50%); z-index:10; width:min(820px,100%); margin:0; padding:8px 12px calc(8px + env(safe-area-inset-bottom)); display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:0; border-top:1px solid var(--line); border-radius:0; background:var(--paper); }
.tab { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:5px; font-size:12px; min-height:52px; border-radius:4px; color:var(--muted); }
.tab.active { background:transparent; color:var(--red); box-shadow:none; }
.tab svg { width:22px; height:22px; }
.quick-head { margin:18px 0 12px; }
h2 { font-size:18px; font-weight:600; }
.text-btn { border:0; padding:0 8px; background:transparent; font-size:13px; color:var(--red); }
.quick-list { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
.quick-chip { grid-template-columns:minmax(0,1fr); gap:6px; padding:12px; background:#edf0e7; border:0; min-height:72px; }
.quick-chip .emoji { display:none; }
.quick-name { white-space:normal; font-size:13px; line-height:1.3; overflow-wrap:anywhere; font-weight:500; }
.quick-kcal { grid-column:1; font-weight:400; font-size:12px; }
.day-tools { display:flex; gap:8px; margin:12px 0 22px; }
.day-tools button { flex:1; font-size:13px; padding:0 8px; background:transparent; border:1px solid var(--line); }
.empty-day { background:transparent; border:0; padding:26px 14px; }
.empty-day span { font-size:13px; }
.empty-icon { color:var(--jade); }
.meal-card { background:var(--paper-2); border:1px solid var(--line); padding:14px; }
.meal-head { align-items:flex-start; }
.meal-head span { font-size:12px; line-height:1.6; }
.entry { grid-template-columns:minmax(0,1fr) auto; }
.entry-main b, .suggestion-main b { white-space:normal; font-size:14px; line-height:1.4; font-weight:600; overflow-wrap:break-word; }
.entry-actions { gap:0; }
.icon-btn.slim { width:32px; height:40px; min-height:40px; border:0; background:transparent; }
.icon-btn.slim svg { width:17px; height:17px; }
.entry-main span { font-size:13px; line-height:1.6; }
.favorite-list { gap:0; }
.favorite-row { display:grid; gap:10px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; padding:16px 0; min-width:0; }
.favorite-pick { display:grid; grid-template-columns:minmax(0,1fr) 44px; gap:7px 12px; padding:0; border:0; background:none; text-align:left; width:100%; min-width:0; }
.favorite-name { grid-column:1/-1; font-size:16px; font-weight:600; line-height:1.45; white-space:normal; overflow-wrap:break-word; }
.favorite-measures { grid-column:1; display:flex; flex-wrap:wrap; gap:4px 14px; font-size:14px; font-weight:400; color:var(--muted); line-height:1.5; }
.favorite-measures > span { white-space:nowrap; }
.favorite-add { display:grid; place-items:center; grid-column:2; grid-row:2; align-self:center; width:44px; height:44px; border-radius:6px; background:var(--mist); color:var(--jade); }
.favorite-measures { align-self:center; }
.favorite-add svg { width:20px; height:20px; }
.favorite-bottom { display:flex; align-items:center; gap:12px; min-width:0; }
.favorite-macros { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; flex:1; min-width:0; margin:0; }
.favorite-macros > div { min-width:0; }
.favorite-macros dt { font-size:12px; line-height:1.5; color:var(--muted); }
.favorite-macros dd { margin:2px 0 0; font-size:14px; line-height:1.5; font-variant-numeric:tabular-nums; }
.favorite-row .favorite-remove { width:44px; min-width:44px; height:44px; color:var(--muted); }
body[data-tab="favorites"] .summary, body[data-tab="history"] .summary { display:none; }
.suggestion-note,.soft-note { background:#e9eee3; border:0; font-weight:400; font-size:13px; line-height:1.6; text-align:left; }
.suggestion-card { background:var(--paper-2); border-color:var(--line); }
.suggestion-card p { font-size:13px; line-height:1.5; }
.fab { display:none; }
.toast { top:max(10px,env(safe-area-inset-top)); bottom:auto; background:#213c30; color:#fff; font-size:14px; line-height:1.4; }
.sheet-body { background:var(--paper); max-height:92dvh; padding:12px 18px calc(22px + env(safe-area-inset-bottom)); overscroll-behavior:contain; }
body.modal-open { overflow:hidden; }
.sheet-actions { grid-template-columns:1fr 1fr; }
.sheet-actions #parseBtn { grid-column:1 / -1; }
.sheet-actions .ghost-btn { font-size:14px; padding:0 8px; }
.portion-only .sheet-actions { display:flex; }
.portion-only .file-label { border:0; background:none; font-size:14px; color:var(--muted); }
.goal-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.draft-row input, .field input { background:#fff; color:var(--ink); border-color:#929f91; font-size:16px; min-height:46px; }
.draft-row label { color:var(--muted); font-size:13px; line-height:1.4; }
.draft-row input[readonly] { background:#eef1e8; }
.draft-row { gap:12px 8px; }
.draft-row .food-name-field { grid-column:1 / -1; }
.draft-row > label:nth-child(2), .draft-row > label:nth-child(3) { grid-column:span 2; }
.draft-title { font-size:14px; flex-direction:column; align-items:flex-start; }
.draft-title span { text-align:left; }
.draft-title b { font-weight:500; }
.draft-confirm { min-height:48px; }
.food-source-note { font-size:13px; line-height:1.5; }
.food-source-note a, .barcode-credit a { color:var(--jade); text-decoration:underline; }
.scanner-body { max-height:92dvh; }
#scanVideo { display:none; width:100%; height:210px; object-fit:cover; background:#263d35; border-radius:6px; }
#scanVideo.active { display:block; }
#scanStatus { font-size:13px; color:var(--muted); line-height:1.5; }
.scan-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:12px 0 18px; }
.scan-actions button, .scan-actions label { font-size:13px; }
#barcodeForm { display:flex; align-items:center; gap:10px; }
#barcodeForm .field { flex:1; min-width:0; font-size:12px; }
#barcodeForm .primary-btn { margin-top:8px; }
.barcode-credit { text-align:center; color:var(--muted); font-size:13px; }
.wide { width:100%; }
.package-unit { grid-column:1/-1; }
.package-unit select { min-height:42px; width:100%; border:1px solid var(--line); border-radius:6px; background:white; padding:8px; font:inherit; font-size:16px; }
@media(min-width:700px) { .landscape { height:195px; } .landscape::after{height:109px;} .quick-list {grid-template-columns:repeat(4,minmax(0,1fr));} .calorie-row{justify-content:flex-start;padding-left:16px;} .summary {display:grid;grid-template-columns:1fr 1fr;column-gap:25px;} .day-row {grid-column:1/-1;} .macro-grid{align-self:center;margin-top:0;} }
@media(max-width:560px) {
  .draft-row,.package-values {grid-template-columns:repeat(2,minmax(0,1fr));}
  .draft-row > label:nth-child(2),.draft-row > label:nth-child(3) {grid-column:span 1;}
  .sheet-actions {grid-template-columns:1fr;}
  .suggestion-card {grid-template-columns:minmax(0,1fr) 44px;gap:8px;}
  .suggestion-icon {display:none;}
  .suggestion-card .icon-btn {width:44px;height:44px;}
  .pantry-tools {grid-template-columns:1fr;}
  .pantry-tools input,.pantry-tools select {font-size:16px;min-height:46px;}
}
@media(max-width:380px) { .app{padding-left:14px;padding-right:14px;} .landscape{margin-left:-14px;margin-right:-14px;padding-left:16px;padding-right:16px;} .brand h1{font-size:28px;} .brand .eyebrow{font-size:12px;} .calorie-row{gap:14px;align-items:center;} #totalKcal{font-size:28px;} .calories{font-size:16px;} .macro-grid{gap:8px;} .macro-chip b{font-size:12px;overflow-wrap:anywhere;} .entry{grid-template-columns:1fr;} .entry-actions{justify-content:flex-end;} }
.package-edit > label:nth-child(n+4) {display:none;}
.primary-btn {color:#fff;min-height:46px;}
.ghost-btn {min-height:46px;}
input::placeholder,textarea::placeholder {color:#58695e;opacity:1;}
.sheet-body .eyebrow {font-size:13px;color:var(--muted);}
.sheet-body h2 {font-size:20px;}
.sheet-body {scroll-padding-bottom:20px;}
.package-values {padding-top:10px;}
.package-values label {font-size:13px;}
.package-values > b {font-size:15px;}
.package-unit select {border-color:#929f91;}
.app {padding-bottom:calc(105px + env(safe-area-inset-bottom));}
.icon-btn.slim {width:44px;height:44px;min-height:44px;}
.date-control:focus-within {outline:2px solid var(--jade);outline-offset:2px;border-radius:4px;}
.portion-only .sheet-head .eyebrow {display:none;}
#foodSheet .sheet-body {display:flex;flex-direction:column;overflow:hidden;}
#foodSheet .sheet-head,#foodSheet .grab {flex-shrink:0;}
.food-scroll {min-height:0;overflow-y:auto;overscroll-behavior:contain;scroll-padding:12px;padding:0 2px 4px;}
.food-footer {display:grid;gap:4px;flex-shrink:0;padding-top:12px;border-top:1px solid var(--line);}
.food-footer:empty {display:none;}
.food-footer .text-btn {min-height:40px;}
#foodSheet .sheet-head {margin-bottom:0;padding-bottom:12px;border-bottom:1px solid var(--line);}
.food-scroll {padding-top:12px;}
.food-footer .draft-title {font-size:13px;color:var(--ink);padding-bottom:6px;line-height:1.45;}
