:root {
  color-scheme: light;
  --canvas: #f4f6fa;
  --paper: #fff;
  --ink: #192338;
  --muted: #596578;
  --line: #e0e5ee;
  --accent: #365cdb;
  --accent-deep: #2446b4;
  --accent-soft: #eaf0ff;
  --shadow: 0 8px 28px #19345c0d, 0 1px 3px #19345c08;
  --radius: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: #365cdb26; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; text-decoration: none; }
svg, img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #5476df; outline-offset: 3px; }

.app-shell { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; overflow: auto;
  padding: 28px 17px 18px; background: #fafbfd; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 5px 32px; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; border-radius: 15px; background: var(--accent); color: white; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 20px; letter-spacing: -.05em; }
.brand-copy small, .sidebar-foot small { color: var(--muted); font-size: 11px; }
.nav-label { color: var(--muted); font-size: 12px; margin: 0 9px 8px; font-weight: 700; }
.nav-list { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 45px; padding: 8px 10px; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 700; }
.nav-item:is(:hover,[aria-current='page']) { background: var(--accent-soft); color: var(--accent-deep); }
.side-add { margin-bottom: 9px; }
.sidebar-foot { margin-top: auto; display: flex; align-items: baseline; gap: 7px; padding: 13px 8px 0; border-top: 1px solid var(--line); font-size: 12px; }
.sidebar-foot div { display: grid; gap: 3px; }
.privacy-dot { flex: 0 0 7px; height: 7px; border-radius: 50%; background: #5273cb; }
.mobile-nav { display: none; }

.main { min-width: 0; }
.topbar { background: linear-gradient(112deg,#284bbf 0%,#365cdb 58%,#3d62d8 100%); color: #fff; }
.header-inner { max-width: 1020px; margin: 0 auto; padding: 23px 28px 36px; }
.header-line, .header-actions { display: flex; align-items: center; gap: 6px; }
.header-line { justify-content: space-between; gap: 7px; }
.date-switch {
  display: inline-flex; position: relative; align-items: center; gap: 7px; min-width: 0; min-height: 46px;
  font-size: clamp(21px,4vw,29px); letter-spacing: -.055em; line-height: 1.2; font-weight: 820;
}
.date-switch svg { width: 17px; flex: 0 0 17px; }
.date-switch input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
.date-switch input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.date-switch:focus-within { outline: 2px solid white; outline-offset: 3px; border-radius: 9px; }
.header-icon, .back-today {
  display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px;
  color: white; background: #ffffff16; min-width: 44px; min-height: 44px;
}
.header-icon:hover, .header-icon.is-selected, .back-today:hover { background: #ffffff30; }
.back-today { padding: 0 9px; font-size: 12px; font-weight: 780; }
.topbar :focus-visible { outline-color: white; }
.week-strip { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; max-width: 545px; margin-top: 9px; }
.week-day {
  display: grid; justify-items: center; align-content: center; gap: 3px; padding: 4px 0 3px; min-height: 64px;
  background: transparent; color: #fff; border: 1px solid transparent; border-radius: 15px; font-weight: 700; line-height: 1.1;
}
.week-day > span { color: #f0f4ff; font-size: 12px; }
.week-day strong { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; font-size: 15px; font-variant-numeric: tabular-nums; }
.week-day i { width: 4px; height: 4px; border-radius: 50%; }
.week-day i.has-record { background: #d6e2ff; }
.week-day:hover, .week-day[aria-current='date'] { border-color: #ffffff56; }
.week-day[aria-pressed='true'] { background: #ffffff24; }
.week-day[aria-pressed='true'] strong { color: var(--accent-deep); background: white; }

.view { position: relative; max-width: 1020px; margin: -18px auto 0; padding: 19px 28px 42px; background: var(--canvas); border-radius: 25px 25px 0 0; }
.dashboard { display: grid; gap: 14px; min-width: 0; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.dashboard-heading h1, .page-title { font-size: clamp(29px,5vw,40px); line-height: 1.13; letter-spacing: -.065em; font-weight: 830; overflow-wrap: anywhere; }
.eyebrow { color: var(--accent-deep); font-size: 12px; font-weight: 800; letter-spacing: -.015em; }
.dashboard-heading .eyebrow, .page-head .eyebrow { margin-bottom: 4px; }
.local-pill, .pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-deep); font-size: 11px; font-weight: 780;
}
.local-pill { margin-bottom: 2px; white-space: nowrap; }
.local-pill svg { width: 14px; height: 14px; }
.meal-overview, .metric, .routine-link, .panel, .daily-summary {
  min-width: 0; background: var(--paper); border: 1px solid #e0e5ee; border-radius: var(--radius); box-shadow: var(--shadow);
}
.meal-overview { display: grid; gap: 13px; padding: 17px; }
.overview-main { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; }
.overview-label, .metric-head { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; font-weight: 760; }
.overview-label { width: fit-content; min-height: 44px; }
.overview-label > svg, .metric-head > svg { width: 15px; height: 15px; color: #68778b; margin-left: auto; }
.tile-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 12px; }
.tile-icon svg { width: 18px; height: 18px; }
.tone-violet { background: #eaf0ff; color: #2446b4; }
.tone-blue { background: #eaf3ff; color: #255ba3; }
.tone-mint { background: #e6f8f2; color: #187056; }
.tone-peach { background: #fff0e8; color: #a44428; }
.tone-pink { background: #ffeaf1; color: #a33661; }
.overview-value, .metric-value, .daily-summary strong, .timer-value {
  display: block; color: var(--ink); font-weight: 830; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
  letter-spacing: -.065em; line-height: 1.1;
}
.overview-value { font-size: clamp(29px,7.1vw,43px); margin: 1px 0 5px; }
.overview-value small, .metric-value small, .daily-summary strong small { font-size: .52em; letter-spacing: -.025em; }
.metric-detail { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.meal-orb {
  position: relative; display: grid; place-items: center; isolation: isolate; color: #fff;
  width: clamp(54px,18vw,94px); aspect-ratio: 1; border-radius: 36%;
  background: radial-gradient(circle at 30% 25%,#dce8ff 0%,#9ab5f3 31%,#557ce5 72%,#3b61d4 100%);
  box-shadow: inset 0 1px 2px #fff9, 0 8px 22px #4268d139; transform: rotate(-9deg);
}
.meal-orb::before { position: absolute; content: ''; inset: 13%; border: 1px solid #fff7; border-radius: 35%; }
.meal-orb svg { width: 45%; height: 45%; stroke-width: 1.8; filter: drop-shadow(0 2px 2px #2b4c9f80); }
.meal-slot-status { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
.meal-slot-status button {
  display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 42px; padding: 2px 0; border: 0; border-radius: 13px;
  background: #f3f5f9; color: var(--muted); font-size: 12px; font-weight: 760;
}
.meal-slot-status button.filled { background: var(--accent-soft); color: var(--accent-deep); }
.meal-slot-status svg { width: 14px; height: 14px; flex: 0 0 14px; }
.overview-actions { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 7px; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.metric { display: flex; flex-direction: column; gap: 5px; min-height: 151px; padding: 13px; }
.metric:hover, .routine-link:hover { border-color: #ccd9f0; }
.metric-head { font-size: 13px; }
.metric-head .tile-icon { width: 28px; height: 28px; flex-basis: 28px; border-radius: 9px; }
.metric-head .tile-icon svg { width: 16px; height: 16px; }
.metric-value { font-size: clamp(21px,5.6vw,29px); }
.metric-decoration { align-self: end; display: grid; place-items: center; margin-top: auto; width: 40px; height: 37px; border-radius: 13px; }
.metric-decoration svg { width: 22px; height: 22px; }
.routine-link { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 68px; padding: 12px 14px; }
.routine-link strong, .routine-link small { display: block; }
.routine-link strong { font-size: 15px; letter-spacing: -.03em; }
.routine-link small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.routine-link > svg { color: #68778b; }

.page-head { display: grid; gap: 3px; margin-bottom: 15px; }
.page-copy { color: var(--muted); font-size: 14px; line-height: 1.45; word-break: keep-all; }
.daily-summary {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
  padding: 16px 18px; background: linear-gradient(117deg,#fff 48%,#edf3ff 100%); color: var(--muted);
}
.daily-summary.tone-blue { background: linear-gradient(117deg,#fff 48%,#ecf5ff 100%); }
.daily-summary.tone-pink { background: linear-gradient(117deg,#fff 48%,#ffedf4 100%); }
.daily-summary p, .daily-summary span { font-size: 13px; }
.daily-summary strong { font-size: clamp(32px,8vw,47px); margin: 3px 0; }
.daily-summary .step-chart { flex: 0 1 130px; margin-top: 0; height: 54px; }
.view-grid, .meal-day-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 14px; }
.view-grid > div { min-width: 0; display: grid; gap: 14px; }
.panel { padding: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 11px; }
.panel-title, .meal-group h2 { font-size: 18px; font-weight: 820; line-height: 1.24; letter-spacing: -.04em; overflow-wrap: anywhere; }
.panel-copy, .help, .caption { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.caption { display: flex; align-items: center; gap: 6px; }
.panel > .caption { margin-block: 11px 5px; }
.meal-group-head { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; }
.meal-group-head p { margin-top: 3px; font-size: 13px; color: var(--muted); }
.meal-group-head .tile-icon { width: 46px; height: 46px; border-radius: 15px; }
.meal-group-head .tile-icon svg { width: 23px; height: 23px; }
.meal-group > .record { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.history { margin-top: 14px; }
.history > summary { cursor: pointer; padding: 9px 0; color: var(--accent-deep); font-size: 14px; font-weight: 760; }

.btn, .text-btn, .icon-btn, .round-btn, .check-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  border: 1px solid transparent; border-radius: 13px; padding: 8px 11px; line-height: 1.25; text-align: center; font-size: 13px; font-weight: 780;
}
.btn svg, .text-btn svg, .icon-btn svg { width: 17px; height: 17px; flex: 0 0 17px; }
.btn-primary, .round-btn { background: var(--accent); color: #fff; }
.btn-primary:hover, .round-btn:hover { background: var(--accent-deep); }
.btn-secondary, .round-quiet { color: var(--accent-deep); background: var(--accent-soft); }
.btn-secondary:hover, .round-quiet:hover { color: var(--accent-deep); background: #dce7ff; }
.round-btn, .check-btn { width: 44px; border-radius: 50%; flex: 0 0 44px; padding: 0; }
.btn-quiet, .text-btn { background: transparent; color: var(--accent-deep); }
.text-btn { padding-inline: 7px; }
.text-btn:hover { background: var(--accent-soft); }
.icon-btn { width: 44px; padding: 0; background: #f1f4f8; color: var(--accent-deep); }
.icon-btn:hover { background: var(--accent-soft); }
.danger-text { color: #a63855; }
.danger-text:hover { background: #ffeaf0; }
.empty-note, .banner {
  padding: 13px 10px; border: 1px dashed #dce4ef; border-radius: 14px; background: #f7f9fc;
  color: var(--muted); text-align: center; font-size: 13px; line-height: 1.5;
}
.banner { text-align: left; margin-bottom: 11px; }
.record-list { display: grid; }
.record { display: flex; align-items: center; gap: 9px; min-width: 0; padding-block: 9px; }
.record + .record { border-top: 1px solid var(--line); }
.record-thumb {
  display: grid; place-items: center; width: 47px; height: 47px; flex: 0 0 47px; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent-deep); overflow: hidden;
}
.record-thumb img { width: 100%; height: 100%; object-fit: cover; }
.record-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.record-title { font-size: 14px; font-weight: 770; }
.record-title, .record-meta, .record-tag { overflow-wrap: anywhere; }
.record-meta { color: var(--muted); font-size: 12px; line-height: 1.4; white-space: pre-wrap; }
.record-tag { width: fit-content; max-width: 100%; border-radius: 8px; padding: 3px 6px; font-size: 11px; color: var(--accent-deep); background: var(--accent-soft); }
.list-actions, .form-actions, .inline-actions, .timer-actions, .dialog-actions, .file-preview { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.list-actions { justify-content: flex-end; }
.record .list-actions { flex-wrap: nowrap; }
.entry-form { display: grid; gap: 11px; min-width: 0; scroll-margin-top: 14px; }
.entry-form + .record-list, .panel .spark-wrap + .record-list { margin-top: 12px; }
.field { display: grid; min-width: 0; gap: 5px; align-content: start; font-size: 13px; font-weight: 750; }
.field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
input:not([type='file']), textarea, select {
  min-height: 45px; width: 100%; min-width: 0; margin: 0; padding: 8px 10px; border: 1px solid #d7e0ee;
  border-radius: 11px; background: #fafbfd; color: var(--ink); font-size: 16px; font-weight: 500;
}
input[type='date'], input[type='time'], input[type='datetime-local'] { min-inline-size: 0; }
textarea { min-height: 69px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #637084; }
.file-thumb { width: 66px; height: 66px; object-fit: cover; border-radius: 12px; }
.setting-card { padding: 11px; background: #f0f4fb; border-radius: 13px; }
.settings-list { display: grid; gap: 10px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.settings-row + .settings-row { padding-top: 10px; border-top: 1px solid var(--line); }

.spark-wrap { width: 100%; min-width: 0; }
.spark-mini { margin-top: auto; }
.spark-mini .chart { max-height: 41px; }
.chart { width: 100%; height: auto; }
.chart-grid { fill: none; stroke: #e8edf6; stroke-dasharray: 4 4; }
.chart-area { fill: #dcecff; opacity: .7; }
.chart-line { fill: none; stroke: #377fe1; stroke-width: 2.3; stroke-linejoin: round; stroke-linecap: round; }
.chart-point { fill: white; stroke: #377fe1; stroke-width: 2.1; }
.chart-dates { display: flex; justify-content: space-between; color: var(--muted); padding-inline: 4px; }
.step-chart { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; height: 33px; margin-top: auto; }
.step-column { display: flex; align-items: end; border-radius: 12px; background: #fbeaf2; overflow: hidden; }
.step-column i { display: block; width: 100%; height: var(--fill); border-radius: inherit; background: #e9568c; }

.timer { text-align: center; display: grid; justify-items: center; padding: 20px 10px; background: #eff4ff; border-radius: 18px; }
.timer-value { font-size: clamp(34px,8vw,65px); margin-block: 6px; }
.timer-actions { justify-content: center; margin-top: 9px; }
.calendar { padding: 8px; border: 1px solid var(--line); border-radius: 16px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 7px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; }
.calendar-weekday { text-align: center; color: var(--muted); font-size: 12px; font-weight: 730; }
.calendar-day {
  display: grid; place-content: center; justify-items: center; gap: 3px; min-width: 0; min-height: 43px;
  padding: 2px 0; border: 1px solid transparent; border-radius: 9px; color: var(--ink); background: #f3f6fb; font-size: 13px; font-weight: 700;
}
.calendar-day.is-today { border-color: #7795e0; }
.calendar-day[aria-pressed='true'] { color: white; background: var(--accent); }
.calendar-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #587de0; }
.calendar-day[aria-pressed='true'] .calendar-dot { background: #fff; }

.routine-summary progress { display: block; flex-basis: 100%; width: 100%; height: 9px; margin-top: 6px; border: 0; border-radius: 10px; overflow: hidden; accent-color: var(--accent); background: #e7edf8; }
.routine-summary progress::-webkit-progress-bar { background: #e7edf8; }
.routine-summary progress::-webkit-progress-value { background: var(--accent); }
.routine-list { display: grid; gap: 8px; }
.routine-item { border-radius: 16px; padding: 8px; background: #f3f5f9; }
.routine-item.is-taken { background: var(--accent-soft); }
.routine-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 3px; }
.routine-row time, .routine-row p { font-size: 12px; color: var(--muted); }
.routine-row h3 { font-size: 15px; overflow-wrap: anywhere; }
.routine-row p { margin-top: 2px; overflow-wrap: anywhere; }
.routine-item .list-actions { margin-top: 3px; }
.routine-item .icon-btn { background: #fff; }
.check-btn { color: #3458ba; background: #fff; border: 1px dashed #a7b9eb; }
.check-btn[aria-pressed='true'] { color: #fff; background: var(--accent); border-style: solid; }

.toast { position: fixed; z-index: 20; right: 14px; bottom: 16px; max-width: calc(100vw - 28px); padding: 10px 14px; border-radius: 13px; background: #203a75; color: #fff; font-size: 13px; line-height: 1.45; box-shadow: var(--shadow); }
dialog {
  width: min(92vw,475px); max-height: calc(100dvh - max(22px,env(safe-area-inset-top)) - max(22px,env(safe-area-inset-bottom)));
  overflow: auto; overscroll-behavior: contain; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 22px 64px #172c5947;
}
dialog:not([open]) { display: none; }
dialog::backdrop { background: #192e5777; }
body:has(dialog[open]) { overflow: hidden; }
.quick-meal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quick-meal-head h2, .dialog-head h2 { font-size: 23px; line-height: 1.22; letter-spacing: -.045em; }
.dialog-head p { margin-block: 6px 12px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.dialog-actions { justify-content: end; }
.quick-meal-picker {
  position: relative; display: flex; justify-content: center; align-items: center; gap: 7px; min-height: 51px;
  border: 1px dashed #a4b8ec; border-radius: 14px; background: var(--accent-soft); color: var(--accent-deep); font-size: 14px; font-weight: 800;
}
.quick-meal-picker:focus-within { outline: 2px solid #5476df; outline-offset: 2px; }
.quick-meal-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.quick-meal details { border-top: 1px solid var(--line); }
.quick-meal summary { min-height: 44px; padding-block: 11px; color: var(--accent-deep); font-size: 14px; font-weight: 760; cursor: pointer; }
.quick-meal summary span { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.quick-meal details .inline-actions { margin-top: 6px; }
.quick-meal-status { color: var(--accent-deep); font-size: 13px; }
.quick-meal-status:not(:empty) { margin-bottom: 6px; }
.quick-meal-save { width: 100%; font-size: 15px; }
.add-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 11px; }
.add-option {
  display: flex; align-items: center; gap: 8px; min-height: 56px; min-width: 0; padding: 8px;
  border: 1px solid var(--line); border-radius: 15px; background: #f7f9fc; text-align: left; font-size: 13px;
}
.add-option:hover { border-color: #a9bcef; }
.add-primary { background: var(--accent-soft); }
.add-option strong, .add-option small { display: block; overflow-wrap: anywhere; }
.add-option small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.3; }

@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 180px minmax(0,1fr); }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .header-inner {
    padding: calc(10px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 30px max(16px,env(safe-area-inset-left));
  }
  .header-actions { gap: 3px; }
  .header-icon, .back-today { background: transparent; }
  .week-strip { max-width: none; margin-top: 5px; }
  .view {
    margin-top: -17px; padding: 15px max(14px,env(safe-area-inset-right)) calc(92px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
  }
  .mobile-nav {
    position: fixed; z-index: 10; inset: auto 0 0; display: grid; grid-template-columns: 1fr 1fr minmax(55px,1.05fr) 1fr 1fr; gap: 1px;
    align-items: start; justify-items: center; min-height: 65px;
    padding: 4px max(7px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left));
    border: 1px solid #e0e5ee; border-bottom: 0; border-radius: 22px 22px 0 0; background: #fff; box-shadow: 0 -6px 24px #19345c10;
  }
  .mobile-item {
    display: grid; align-content: center; justify-items: center; gap: 3px; width: 100%; min-height: 49px;
    border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 770;
  }
  .mobile-item[aria-current='page'] { color: var(--accent-deep); }
  .mobile-item[aria-current='page'] svg { stroke-width: 2.25; }
  .nav-add {
    display: grid; place-items: center; width: 55px; height: 55px; margin-top: -12px; padding: 0;
    border: 0; border-radius: 50%; color: #fff; background: linear-gradient(145deg,#5074e6,#2b4fcf); box-shadow: 0 7px 16px #345bd351;
  }
  .nav-add svg { width: 27px; height: 27px; }
  .toast { bottom: calc(73px + env(safe-area-inset-bottom)); }
}
@media (max-width: 540px) {
  .dashboard { gap: 11px; }
  .meal-overview { gap: 10px; padding: 13px; }
  .meal-orb { width: clamp(52px,17vw,72px); }
  .metric-grid { gap: 9px; }
  .metric { min-height: 133px; padding: 10px; border-radius: 20px; }
  .view-grid, .meal-day-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .view-grid > div { gap: 10px; }
  .panel { padding: 13px; border-radius: 19px; }
  .quick-meal {
    inset: auto 0 0; width: 100%; max-width: 100%; max-height: calc(100dvh - max(14px,env(safe-area-inset-top))); margin: 0;
    padding: 13px max(14px,env(safe-area-inset-right)) calc(15px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
    border-radius: 24px 24px 0 0;
  }
}
@media (max-width: 355px) {
  .header-inner { padding-inline: 9px; }
  .header-actions { gap: 0; }
  .date-switch { font-size: 19px; gap: 4px; }
  .overview-actions .btn { gap: 4px; padding-inline: 4px; font-size: 12px; }
  .overview-actions .btn svg { width: 14px; height: 14px; flex-basis: 14px; }
  .local-pill { padding-inline: 5px; }
  .metric-head { gap: 4px; }
  .record-thumb { width: 37px; height: 37px; flex-basis: 37px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
