/* 每日营养账本 — iPhone 移动优先 */
:root {
  --primary: #533afd;
  --primary-deep: #4434d4;
  --primary-soft: #f2f0ff;
  --primary-subtle: #b9b9f9;
  --ink: #0d253d;
  --ink-secondary: #273951;
  --ink-mute: #64748d;
  --canvas: #ffffff;
  --canvas-soft: #f2f4f8;
  --hairline: #e3e8ee;
  --hairline-input: #c3d0de;
  --ruby: #ea2261;
  --lemon: #9b6829;
  --danger: #d92b56;
  --danger-soft: #fff1f4;
  --success: #1a7f5a;
  --success-soft: #eaf7f1;
  --warn: #9b6829;
  --warn-soft: #fdf6e9;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --pill: 9999px;
  --shadow-1: 0 1px 3px rgba(0, 55, 112, .06);
  --shadow-2: 0 12px 40px rgba(13, 37, 61, .18), 0 2px 8px rgba(13, 37, 61, .08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--canvas-soft);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  font-size: 16px; font-weight: 400; line-height: 1.45;
  letter-spacing: -.01em;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 16px; }
.hidden { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }

.app-shell {
  max-width: 520px; margin: 0 auto;
  padding: calc(14px + var(--safe-top)) 14px calc(120px + var(--safe-bottom));
}

/* ── Header：小精灵 + 说话气泡 ── */
.app-header {
  display: flex; align-items: stretch; gap: 12px; margin-bottom: 22px;
}

/* 小精灵：白色圆形容器 + 透明底动画 WebP */
.emote-stage {
  position: relative; width: 92px; height: 92px; flex: none;
  border-radius: 50%; background: #fff;
  overflow: hidden; isolation: isolate;
  box-shadow: 0 2px 10px rgba(13,37,61,.10);
}
.emote-float {
  position: absolute; inset: 0;
  transform-origin: center 70%;
  animation: emote-breathe 3.2s ease-in-out infinite;
}
@keyframes emote-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.035); }
}
/* 双层交叉淡入：循环动画在父层，转场在子层，互不冲突 */
.emote-frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; opacity: 0; transform: scale(.88);
  transition: opacity .26s ease, transform .34s cubic-bezier(.34,1.56,.64,1);
  will-change: opacity, transform;
}
.emote-frame.is-active { opacity: 1; transform: scale(1); }
/* 情绪专属循环动画 */
.emote-stage.mood-happy .emote-float,
.emote-stage.mood-love .emote-float { animation: emote-bounce 1.8s ease-in-out infinite; }
.emote-stage.mood-sad .emote-float,
.emote-stage.mood-cry .emote-float { animation: emote-sway 4.4s ease-in-out infinite; }
.emote-stage.mood-thinking .emote-float { animation: emote-nod 3.6s ease-in-out infinite; }
@keyframes emote-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-7px); } 70% { transform: translateY(1px); } }
@keyframes emote-sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes emote-nod { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

/* 说话气泡：上下边与精灵容器严格对齐（同高 92px） */
.speech-bubble {
  position: relative; flex: 1; min-width: 0; align-self: stretch;
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: 20px 20px 20px 6px;
  padding: 16px 18px; box-shadow: var(--shadow-1);
  min-height: 92px; display: flex; align-items: center;
}
.speech-tail {
  position: absolute; left: -9px; bottom: 20px;
  width: 14px; height: 14px; background: var(--canvas);
  border-left: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  transform: rotate(45deg);
}
.speech-text {
  font-size: 15px; font-weight: 500; color: var(--ink-secondary); line-height: 1.5;
  animation: speech-in .3s ease both;
}
@keyframes speech-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.speech-bubble.listening .speech-text { color: var(--primary-deep); }
.speech-caret::after {
  content: ''; display: inline-block; width: 1px; height: 1em;
  margin-left: 2px; vertical-align: -2px; background: var(--primary); opacity: 0;
}
.speech-bubble.typing .speech-caret::after { animation: caret-blink .8s step-end infinite; }
@keyframes caret-blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
.ai-badge {
  position: absolute; top: 2px; right: 0;
  font-size: 10px; font-weight: 600; color: var(--primary-deep);
  background: var(--primary-subtle); border-radius: var(--pill); padding: 3px 8px;
}

/* ── Layout / Card ── */
.layout { display: flex; flex-direction: column; gap: 14px; }
.panel {
  background: var(--canvas);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 18px 16px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
.hint { font-size: 13px; color: var(--ink-mute); margin: 0 0 12px; line-height: 1.5; }

/* ── Calendar ── */
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-arrow {
  width: 32px; height: 32px; border: none; border-radius: 10px;
  background: var(--canvas-soft); color: var(--ink-secondary);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0;
}
.cal-arrow:active { background: var(--primary-soft); color: var(--primary); }
.cal-today {
  min-height: 32px; padding: 0 10px; border: none; border-radius: 10px;
  background: var(--canvas-soft); color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer;
}
.cal-today:active { background: var(--primary-soft); }
.cal-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-weekdays { margin-bottom: 4px; }
.cal-weekdays span { text-align: center; font-size: 11px; color: var(--ink-mute); padding: 4px 0; }
.cal-weekdays span:nth-child(6), .cal-weekdays span:nth-child(7) { color: var(--ruby); opacity: .7; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1; min-height: 42px;
  border: none; background: transparent; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; cursor: pointer; padding: 2px; color: var(--ink);
}
.cal-cell.empty { cursor: default; }
.cal-cell:active:not(.empty) { background: var(--primary-soft); }
.cal-cell .d { font-size: 14px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.cal-cell .k { font-size: 9px; color: var(--ink-mute); line-height: 1; font-variant-numeric: tabular-nums; }
.cal-cell.has .k { color: var(--primary); font-weight: 600; }
.cal-cell.today .d { color: var(--primary); font-weight: 700; }
.cal-cell.selected { background: var(--primary); }
.cal-cell.selected .d, .cal-cell.selected .k { color: #fff; }
.cal-cell.selected .k { opacity: .85; }
.cal-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 11px; color: var(--ink-mute); }
.cal-legend { display: inline-flex; align-items: center; gap: 4px; }
.cal-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.cal-legend .dot-has { background: var(--primary); }
.cal-legend .dot-today { background: var(--canvas); border: 1.5px solid var(--primary); }
.cal-total { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ── Buttons ── */
.btn {
  min-height: 46px; padding: 10px 20px; border-radius: var(--pill);
  font-size: 15px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--primary); background: var(--canvas); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .1s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:active { background: var(--primary-deep); }
.btn.btn-photo { border-color: var(--hairline-input); color: var(--ink); }
.text-btn {
  min-height: 40px; padding: 0 10px; border: 1px solid transparent;
  background: transparent; color: var(--primary);
  font-size: 14px; font-weight: 500; cursor: pointer; border-radius: 10px;
}
.text-btn:active { background: var(--primary-soft); }
.text-btn.danger { color: var(--danger); }
.btn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--hairline); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-state { font-size: 12px; color: var(--ink-mute); }

/* ── Summary cards ── */
.summary-cal { font-size: 12px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.macro-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.macro-card {
  border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: 12px 13px;
  background: var(--canvas);
}
.macro-card .mc-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.macro-card .mc-name { font-size: 12px; font-weight: 500; color: var(--ink-mute); }
.macro-card .mc-value { font-size: 26px; font-weight: 650; letter-spacing: -.8px; font-variant-numeric: tabular-nums; margin-top: 4px; }
.macro-card .mc-value small { font-size: 12px; font-weight: 400; color: var(--ink-mute); }
.macro-card .mc-status { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: var(--pill); white-space: nowrap; }
.macro-card .mc-status.ok { background: var(--success-soft); color: var(--success); }
.macro-card .mc-status.low { background: var(--warn-soft); color: var(--warn); }
.macro-card .mc-status.high { background: var(--danger-soft); color: var(--danger); }
.macro-card .mc-status.none { background: #f1f4f8; color: var(--ink-mute); }
.bar { height: 5px; border-radius: var(--pill); background: #eaf0f6; margin-top: 10px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: var(--pill); transition: width .3s ease; }
.bar.over { background: var(--danger-soft); }
.bar.over > span { background: var(--danger); }
.macro-card[data-key="kcal"] .bar > span { background: var(--ink-secondary); }
.macro-card[data-key="p"] .bar > span { background: var(--primary); }
.macro-card[data-key="c"] .bar > span { background: var(--lemon); }
.macro-card[data-key="f"] .bar > span { background: var(--ruby); }

/* ── Timeline ── */
.timeline { display: flex; flex-direction: column; gap: 12px; }
.meal-group { border-top: 1px solid var(--hairline); padding-top: 10px; }
.meal-group:first-child { border-top: none; padding-top: 0; }
.meal-title { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--ink-mute); margin-bottom: 4px; }
.meal-title .meal-kcal { font-variant-numeric: tabular-nums; }
.record-row { display: flex; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid var(--hairline); font-size: 14px; flex-wrap: wrap; }
.record-row:last-child { border-bottom: none; }
.record-row .r-name { font-weight: 600; min-width: 66px; }
.record-row .r-meal { flex: 0 0 auto; border: 1px solid var(--hairline-input); background: var(--canvas); color: var(--ink-mute); border-radius: 8px; font-size: 11px; line-height: 18px; min-width: 22px; padding: 0 4px; cursor: pointer; }
.record-row .r-meal:active { background: var(--primary-soft); color: var(--primary); }
.record-row .r-grams { color: var(--primary); font-weight: 500; border-bottom: 1px dashed var(--primary); font-variant-numeric: tabular-nums; }
.record-row .r-grams input { width: 68px; min-height: 32px; padding: 0 6px; border: 1px solid var(--primary); border-radius: 8px; }
.record-row .r-macro { color: var(--ink-mute); font-size: 11px; flex: 1; font-variant-numeric: tabular-nums; }
.record-row .r-del { border: none; background: transparent; color: #9aa8b8; cursor: pointer; font-size: 18px; padding: 2px 6px; }
.record-row .r-del:active { color: var(--danger); }
.totals-bar {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--primary-soft); color: var(--primary-deep);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.empty-day { color: var(--ink-mute); font-size: 13px; padding: 18px 0; text-align: center; }
.footer-row { justify-content: flex-end; }
.backup-hint { margin: 10px 0 0; font-size: 11px; line-height: 1.5; color: var(--ink-mute); text-align: center; }

/* ── Suggestions ── */
.suggest-source { font-size: 11px; color: var(--ink-mute); margin-bottom: 8px; }
.suggest-list { display: flex; flex-direction: column; gap: 8px; }
.suggest-item {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 12px; border-radius: var(--radius-md); font-size: 13px;
  background: var(--canvas-soft); border: 1px solid var(--hairline); line-height: 1.5;
}
.suggest-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex: none; }
.suggest-item.warn { background: var(--warn-soft); border-color: #f0d9a8; }
.suggest-item.warn .dot { background: var(--lemon); }
.suggest-item.good { background: var(--success-soft); border-color: #bfe6d5; }
.suggest-item.good .dot { background: var(--success); }
.suggest-item.ai { background: var(--primary-soft); border-color: var(--primary-subtle); }
.suggest-item.ai .dot { background: var(--primary); }

/* ── Settings ── */
.settings-panel { padding: 6px 16px; }
.settings-toggle { font-size: 15px; font-weight: 600; min-height: 50px; width: 100%; text-align: left; }
.settings-body { padding-top: 12px; border-top: 1px solid var(--hairline); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.settings-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-grid label { font-size: 11px; color: var(--ink-mute); display: flex; flex-direction: column; gap: 4px; }
.settings-grid input, .settings-grid select {
  min-height: 44px; padding: 0 10px; border: 1px solid var(--hairline-input);
  border-radius: 10px; background: var(--canvas); color: var(--ink);
  font-size: 16px; font-weight: 400;
}
.subhead { font-size: 12px; color: var(--ink-mute); margin: 16px 0 8px; font-weight: 600; }
.toggle-list { display: flex; flex-direction: column; gap: 4px; margin: 16px 0; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; min-height: 44px; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--primary); }
.switch-row small { color: var(--ink-mute); font-size: 11px; }
.settings-body > .btn { width: 100%; margin-bottom: 8px; }

/* ── Floating mic button ── */
.mic-fab {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(22px + var(--safe-bottom));
  width: 74px; height: 74px; border-radius: 50%; border: none;
  background: linear-gradient(145deg, #6249ff, #3d27d6);
  color: #fff; cursor: pointer; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(83, 58, 253, .42), 0 2px 6px rgba(13, 37, 61, .2);
  transition: transform .12s, box-shadow .2s;
}
.mic-fab:active { transform: translateX(-50%) scale(.93); }
.mic-fab-icon { width: 34px; height: 34px; fill: currentColor; position: relative; z-index: 2; }
.mic-fab-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(83, 58, 253, .25);
  animation: fab-breathe 2.8s ease-in-out infinite;
}
@keyframes fab-breathe {
  0%, 100% { transform: scale(1); opacity: .8; }
  50% { transform: scale(1.12); opacity: .3; }
}

/* ── Voice sheet ── */
.voice-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(13, 37, 61, .38);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: overlay-in .22s ease both;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
.voice-sheet {
  width: 100%; max-width: 520px;
  background: var(--canvas);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 8px 18px calc(18px + var(--safe-bottom));
  box-shadow: var(--shadow-2);
  max-height: 86vh; overflow-y: auto;
  animation: sheet-up .34s cubic-bezier(.22, .9, .3, 1) both;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.voice-overlay.closing .voice-sheet { animation: sheet-down .24s ease both; }
.voice-overlay.closing { animation: overlay-out .24s ease both; }
@keyframes sheet-down { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes overlay-out { from { opacity: 1; } to { opacity: 0; } }
.sheet-handle { width: 38px; height: 4px; border-radius: 3px; background: #d5dde6; margin: 4px auto 12px; }
.voice-head { display: flex; align-items: center; justify-content: space-between; }
.voice-head h3 { margin: 0; font-size: 17px; font-weight: 650; }
.voice-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--canvas-soft); color: var(--ink-mute); font-size: 22px; line-height: 1; cursor: pointer;
}

.voice-orb {
  position: relative; width: 108px; height: 108px; margin: 18px auto 8px;
  border-radius: 50%;
  background: linear-gradient(145deg, #6249ff, #3d27d6);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(83, 58, 253, .34);
  transition: transform .25s;
}
.voice-orb svg { width: 46px; height: 46px; fill: #fff; position: relative; z-index: 2; }
.voice-orb .orb-wave {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid rgba(83, 58, 253, .35); opacity: 0;
}
.voice-orb.listening { animation: orb-pulse 1.2s ease-in-out infinite; }
.voice-orb.listening .orb-wave { animation: orb-ring 1.6s ease-out infinite; }
.voice-orb.listening .orb-wave-2 { animation-delay: .8s; }
@keyframes orb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes orb-ring { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }

.voice-wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 26px; margin: 6px 0 2px; }
.voice-wave span { width: 4px; height: 5px; border-radius: 3px; background: var(--primary-subtle); transition: background .2s; }
.voice-orb.listening + .voice-wave span { animation: wave 1s ease-in-out infinite; }
.voice-wave span:nth-child(2) { animation-delay: .1s; }
.voice-wave span:nth-child(3) { animation-delay: .2s; }
.voice-wave span:nth-child(4) { animation-delay: .3s; }
.voice-wave span:nth-child(5) { animation-delay: .4s; }
.voice-wave span:nth-child(6) { animation-delay: .5s; }
.voice-wave span:nth-child(7) { animation-delay: .6s; }
@keyframes wave { 0%, 100% { height: 5px; } 50% { height: 20px; background: var(--primary); } }

.voice-status { text-align: center; font-size: 14px; color: var(--ink-mute); margin: 6px 0 0; min-height: 20px; }
.voice-transcript {
  text-align: center; font-size: 16px; font-weight: 600; color: var(--ink);
  margin: 10px 0 0; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--primary-soft); line-height: 1.5;
}
.voice-buttons { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.voice-buttons .btn { min-width: 150px; }

.voice-result { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); animation: fade-up .28s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.voice-result .preview-head { margin-bottom: 10px; }
.voice-autosave { text-align: center; font-size: 12px; color: var(--success); font-weight: 600; margin: 12px 0 0; }
.voice-undo { display: block; margin: 8px auto 0; }

.voice-manual { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); animation: fade-up .28s ease both; }
.voice-manual textarea {
  width: 100%; min-height: 66px; resize: none;
  padding: 12px; border: 1px solid var(--hairline-input); border-radius: var(--radius-md);
  background: var(--canvas); color: var(--ink); font-size: 16px; line-height: 1.5;
}
.voice-links { text-align: center; margin-top: 10px; }

/* ── Preview / manual add (in sheet) ── */
.preview-area { margin-top: 14px; padding: 12px; border-radius: var(--radius-md); background: var(--canvas-soft); border: 1px solid var(--hairline); }
.preview-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.source-tag { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: var(--pill); background: var(--primary-subtle); color: var(--primary-deep); }
.source-tag.ai { background: #e8f7f0; color: var(--success); }
.date-hint { font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 7px 9px; margin-bottom: 8px; }
.entry-list { display: flex; flex-direction: column; gap: 6px; }
.entry-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 8px 10px; font-size: 14px;
}
.entry-item .name { font-weight: 600; min-width: 60px; }
.entry-item .detail { color: var(--ink-mute); font-size: 11px; flex: 1; font-variant-numeric: tabular-nums; }
.entry-item .del { border: none; background: transparent; color: var(--danger); cursor: pointer; font-size: 20px; line-height: 1; padding: 2px 6px; }
.entry-item.unknown { border-color: #f0d9a8; background: var(--warn-soft); }
.empty-hint { font-size: 12px; color: var(--ink-mute); margin: 8px 0; }
.warn-box { font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.ai-debug { margin-top: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 10px; color: #c0d4e8; background: var(--ink); border-radius: 8px; padding: 8px 10px; max-height: 130px; overflow: auto; }
.manual-add { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.manual-add select, .manual-add input {
  min-height: 40px; padding: 0 8px; border: 1px solid var(--hairline-input);
  border-radius: 10px; background: var(--canvas); font-size: 14px; font-weight: 400;
}
.manual-add select:first-child { flex: 1; min-width: 110px; }
.manual-add input { width: 70px; font-variant-numeric: tabular-nums; }
.manual-add .unit { color: var(--ink-mute); font-size: 12px; }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: calc(110px + var(--safe-bottom)); transform: translateX(-50%);
  max-width: calc(100vw - 40px); padding: 11px 18px; border-radius: var(--pill);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; z-index: 200;
  box-shadow: var(--shadow-2); text-align: center;
  animation: toast-in .2s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 600px) {
  .app-shell { padding-left: 20px; padding-right: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
