/* MealThang — design tokens ------------------------------------------------ */
:root {
  --bg: #f6f7f4;
  --bg-2: #eef0ea;
  --surface: #ffffff;
  --surface-2: #f9faf7;
  --border: #e3e6dd;
  --border-strong: #cfd4c6;
  --text: #1c2117;
  --text-2: #545c4c;
  --text-3: #8a9180;
  --primary: #2f7d32;
  --primary-600: #276b2a;
  --primary-50: #ecf6e8;
  --primary-100: #d6ecd0;
  --on-primary: #ffffff;
  --accent: #e8711a;
  --accent-50: #fdf0e5;
  --danger: #d03b2f;
  --danger-50: #fcebe9;
  --warn: #b7791f;
  --warn-50: #fdf5e2;
  --info: #2563eb;
  --info-50: #e8f0fe;
  --shadow-sm: 0 1px 2px rgba(28, 33, 23, .06);
  --shadow: 0 1px 3px rgba(28, 33, 23, .07), 0 4px 14px rgba(28, 33, 23, .05);
  --shadow-lg: 0 10px 40px rgba(28, 33, 23, .18);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: 236px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12150f; --bg-2: #191d15; --surface: #1b1f17; --surface-2: #20251b; --border: #2c3326; --border-strong: #3b4433;
    --text: #e9ede3; --text-2: #b1b9a6; --text-3: #7d8672; --primary: #6cc46f; --primary-600: #82d184; --primary-50: #1d2b1b;
    --primary-100: #284026; --on-primary: #0f1a0e; --accent: #f59a4f; --accent-50: #33241a; --danger: #f07167; --danger-50: #3a1d1a; --warn: #e3b04b;
    --warn-50: #33291a; --info: #7aa7ff; --info-50: #1b2438;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 3px rgba(0,0,0,.35), 0 4px 14px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12150f; --bg-2: #191d15; --surface: #1b1f17; --surface-2: #20251b; --border: #2c3326; --border-strong: #3b4433;
  --text: #e9ede3; --text-2: #b1b9a6; --text-3: #7d8672; --primary: #6cc46f; --primary-600: #82d184; --primary-50: #1d2b1b;
  --primary-100: #284026; --on-primary: #0f1a0e; --accent: #f59a4f; --accent-50: #33241a; --danger: #f07167; --danger-50: #3a1d1a; --warn: #e3b04b;
  --warn-50: #33291a; --info: #7aa7ff; --info-50: #1b2438;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 3px rgba(0,0,0,.35), 0 4px 14px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* base -------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: 14.5px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 750; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 .6em; }
small, .small { font-size: 12.5px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
[v-cloak] { display: none; }
::selection { background: var(--primary-100); }

/* layout ------------------------------------------------------------------ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; position: sticky; top: 0; height: 100vh; padding: 18px 12px;
  border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(135deg, #3f9a43, #1f6b25); color: white; box-shadow: 0 3px 10px rgba(47,125,50,.35);
}
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--text-2);
  font-weight: 550; transition: background .12s, color .12s; position: relative;
}
.nav-link:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.nav-link.router-link-active { background: var(--primary-50); color: var(--primary); }
.nav-link .badge { margin-left: auto; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 8px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.main { flex: 1; min-width: 0; padding: 26px 32px 80px; max-width: 1320px; margin: 0 auto; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.gap-sm { gap: 6px; }
.gap-lg { gap: 18px; }
.mt { margin-top: 16px; } .mt-sm { margin-top: 8px; } .mt-lg { margin-top: 26px; } .mb { margin-bottom: 16px; } .mb-sm { margin-bottom: 8px; }
.right { text-align: right; } .center { text-align: center; }

/* cards ------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); gap: 10px; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card.hover { transition: transform .12s, box-shadow .12s, border-color .12s; cursor: pointer; }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }

.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.stat .label { color: var(--text-2); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 6px; align-items: center; }
.stat .value { font-size: 26px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--text-3); font-size: 12.5px; }
.stat .icon-bg { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }

/* buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s, box-shadow .12s;
  user-select: none; text-decoration: none !important;
}
.btn:hover { background: var(--bg-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 1px 2px rgba(47,125,50,.3); }
.btn.primary:hover { background: var(--primary-600); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.xs.icon { width: 26px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.btn-group button { border: 0; background: transparent; padding: 0 12px; height: 34px; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; }
.btn-group button + button { border-left: 1px solid var(--border); }
.btn-group button.on { background: var(--primary-50); color: var(--primary); }

/* forms ------------------------------------------------------------------- */
.input, .select, .textarea {
  height: 36px; width: 100%; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); color: var(--text); font: inherit; outline: none; transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 80px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.input.sm, .select.sm { height: 30px; font-size: 13.5px; padding: 0 8px; border-radius: 7px; }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.input.invalid { border-color: var(--danger); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label-sm { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.input-group { display: flex; align-items: stretch; }
.input-group > .input, .input-group > .select { border-radius: 0; }
.input-group > :first-child { border-radius: 9px 0 0 9px; }
.input-group > :last-child { border-radius: 0 9px 9px 0; }
.input-group > * + * { margin-left: -1px; }
.input-addon { display: grid; place-items: center; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text-2); font-weight: 600; }
.search { position: relative; }
.search .input { padding-left: 34px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .15s; box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(16px); }

/* badges / chips ---------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px;
  font-weight: 650; background: var(--bg-2); color: var(--text-2); white-space: nowrap;
}
.badge.green { background: var(--primary-50); color: var(--primary); }
.badge.orange { background: var(--accent-50); color: var(--accent); }
.badge.red { background: var(--danger-50); color: var(--danger); }
.badge.yellow { background: var(--warn-50); color: var(--warn); }
.badge.blue { background: var(--info-50); color: var(--info); }
.badge.solid { background: var(--primary); color: #fff; }
.badge.count { height: 19px; min-width: 19px; padding: 0 6px; justify-content: center; font-size: 11px; background: var(--accent); color: #fff; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--text-3); }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.price-tag {
  display: inline-flex; align-items: baseline; gap: 3px; padding: 3px 9px; border-radius: 8px; background: var(--primary-50);
  color: var(--primary); font-weight: 750; font-variant-numeric: tabular-nums;
}
.price-tag small { font-weight: 600; opacity: .8; }

/* tables ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table.compact td { padding: 6px 8px; }
.table.compact th { padding: 8px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--surface-2); }
.emoji { font-size: 20px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-2); flex-shrink: 0; }
.emoji.sm { font-size: 15px; width: 26px; height: 26px; border-radius: 8px; }

/* progress ---------------------------------------------------------------- */
.bar { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; position: relative; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--primary); transition: width .4s; }
.bar > span.planned { background: var(--primary-100); }
.bar.thin { height: 5px; }
.ring { position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-label { position: absolute; text-align: center; }

/* empty / onboarding ------------------------------------------------------- */
.empty { text-align: center; padding: 38px 20px; color: var(--text-2); }
.empty .big { font-size: 42px; margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.hero {
  border-radius: 20px; padding: 34px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(1000px 300px at 90% -20%, rgba(255,255,255,.18), transparent), linear-gradient(135deg, #2f7d32, #1d5a22 60%, #174a1c);
}
.hero h1 { font-size: 30px; }
.hero p { opacity: .9; max-width: 620px; font-size: 15.5px; }
.hero .btn { border-color: rgba(255,255,255,.4); }
.hero .btn.white { background: #fff; color: #1d5a22; border-color: #fff; }
.hero .btn.glass { background: rgba(255,255,255,.12); color: #fff; }
.feature { display: flex; gap: 12px; align-items: flex-start; }
.feature .emoji { background: var(--primary-50); }

/* modal / drawer ---------------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 20, 12, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .12s; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .16s cubic-bezier(.2,.9,.3,1.2); }
.modal.wide { max-width: 900px; }
.modal.xwide { max-width: 1180px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 10px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.drawer-overlay { justify-content: flex-end; padding: 0; align-items: stretch; }
.drawer { background: var(--surface); width: 100%; max-width: 640px; height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

/* toasts ------------------------------------------------------------------ */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 16px; border-radius: 12px; background: #1d2419; color: #f0f4ea;
  box-shadow: var(--shadow-lg); font-weight: 550; animation: pop .18s; max-width: min(560px, 92vw);
}
.toast.error { background: #6b1d17; }
.toast button { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 7px; padding: 5px 10px; font: inherit; font-weight: 700; cursor: pointer; }

/* dropdown / autocomplete -------------------------------------------------- */
.dropdown { position: relative; }
.menu {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; max-height: 320px; overflow-y: auto; animation: fade .1s;
}
.menu.right { left: auto; right: 0; }
.menu-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text); white-space: nowrap; }
.menu-item:hover, .menu-item.active { background: var(--bg-2); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.menu-label { font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px 3px; }
.score { margin-left: auto; font-size: 11.5px; color: var(--text-3); }

/* tabs -------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 14px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.seg { display: inline-flex; background: var(--bg-2); padding: 3px; border-radius: 11px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* recipe cards ------------------------------------------------------------ */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.recipe-card { overflow: hidden; display: flex; flex-direction: column; }
.recipe-img { height: 150px; background: var(--bg-2) center/cover no-repeat; position: relative; display: grid; place-items: center; font-size: 44px; }
.recipe-img .fav { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.92); color: #e0475b; border-radius: 99px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; cursor: pointer; }
.recipe-img .fav.off { color: #888; }
.recipe-img .cost { font-size: 14px; position: absolute; left: 10px; bottom: 10px; background: rgba(20,26,16,.82); color: #fff; padding: 4px 10px; border-radius: 9px; font-weight: 750; font-variant-numeric: tabular-nums; backdrop-filter: blur(4px); }
.recipe-img .cost small { opacity: .75; font-weight: 600; }
.recipe-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.recipe-body h3 { font-size: 15.5px; }
.recipe-meta { display: flex; gap: 10px; color: var(--text-3); font-size: 12.5px; align-items: center; flex-wrap: wrap; }
.recipe-meta span { display: inline-flex; gap: 4px; align-items: center; }

/* plan board -------------------------------------------------------------- */
.plan-board { display: grid; grid-template-columns: 96px repeat(7, minmax(120px, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.plan-board .hcell { padding: 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-weight: 650; }
.plan-board .hcell.today { background: var(--primary-50); color: var(--primary); }
.plan-board .hcell .d { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.plan-board .hcell .w { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 700; }
.plan-board .hcell.today .w { color: var(--primary); }
.plan-board .hcell .tot { font-size: 12px; color: var(--text-2); font-weight: 600; }
.plan-board .slot-label { padding: 10px; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: flex-start; }
.plan-board .cell { border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; min-height: 84px; display: flex; flex-direction: column; gap: 5px; transition: background .1s; }
.plan-board .cell.today { background: color-mix(in srgb, var(--primary-50) 45%, transparent); }
.plan-board .cell.drop { background: var(--primary-50); outline: 2px dashed var(--primary); outline-offset: -4px; }
.plan-board .cell .add { opacity: 0; border: 1px dashed var(--border-strong); background: transparent; border-radius: 8px; color: var(--text-3); height: 28px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; transition: opacity .1s; }
.plan-board .cell:hover .add, .plan-board .cell .add.show { opacity: 1; }
.plan-board .cell .add:hover { border-color: var(--primary); color: var(--primary); }
.meal-chip {
  border-radius: 9px; padding: 7px 8px 6px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  cursor: grab; font-size: 13px; position: relative; box-shadow: var(--shadow-sm); transition: box-shadow .1s;
}
.meal-chip:hover { box-shadow: var(--shadow); }
.meal-chip .t { font-weight: 650; line-height: 1.25; }
.meal-chip .m { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 3px; gap: 4px; align-items: center; }
.meal-chip.cooked { border-left-color: var(--accent); background: var(--accent-50); border-color: transparent; }
.meal-chip.skipped { opacity: .5; border-left-color: var(--text-3); text-decoration: line-through; }
.meal-chip.free { border-left-color: var(--info); }
.meal-chip.dragging { opacity: .4; }

/* shopping ---------------------------------------------------------------- */
.shop-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.shop-item:last-child { border-bottom: 0; }
.shop-item.checked .name { text-decoration: line-through; color: var(--text-3); }
.shop-item .tick { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border-strong); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; background: var(--surface); color: transparent; transition: .12s; }
.shop-item.checked .tick { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.cat-head { padding: 9px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 700; font-size: 12.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 8px; align-items: center; }

/* receipt editor ---------------------------------------------------------- */
.receipt-lines td { padding: 5px 5px; }
.receipt-lines tr.nonfood td { opacity: .6; }
.receipt-lines .unit-price { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: 16px; padding: 34px; text-align: center; background: var(--surface-2); cursor: pointer; transition: .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-50); }
.receipt-thumb { max-width: 100%; max-height: 70vh; border-radius: 12px; border: 1px solid var(--border); }

/* misc -------------------------------------------------------------------- */
.kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--info-50); color: var(--text); align-items: flex-start; }
.callout.warn { background: var(--warn-50); }
.callout.green { background: var(--primary-50); }
.callout.red { background: var(--danger-50); }
.callout svg { flex-shrink: 0; margin-top: 2px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner.lg { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: grid; place-items: center; padding: 60px; }
.skeleton { background: linear-gradient(90deg, var(--bg-2), var(--surface-2), var(--bg-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.chart-box { position: relative; height: 240px; }
.chart-box.sm { height: 170px; }
.chart-box.lg { height: 300px; }
.chart-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 16px; font-size: 13px; }
.chart-legend li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chart-legend i { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.chart-legend .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.instructions { white-space: pre-wrap; line-height: 1.7; }
.instructions-list { padding-left: 0; margin: 0; list-style: none; counter-reset: step; }
.instructions-list li { counter-increment: step; position: relative; padding: 0 0 14px 40px; line-height: 1.6; }
.instructions-list li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-50); color: var(--primary); font-weight: 750; display: grid; place-items: center; font-size: 13px; }
.instructions-list li.section { padding-left: 0; font-weight: 700; counter-increment: none; }
.instructions-list li.section::before { display: none; }
.img-hero { height: 260px; border-radius: var(--radius); background: var(--bg-2) center/cover no-repeat; display: grid; place-items: center; font-size: 64px; }
.fab {
  position: fixed; right: 26px; bottom: 26px; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--primary); color: #fff;
  box-shadow: 0 8px 24px rgba(47,125,50,.45); color: var(--on-primary); display: grid; place-items: center; cursor: pointer; z-index: 50; transition: transform .12s;
}
.fab:hover { transform: scale(1.05); }
.fab-feedback {
  position: fixed; right: 34px; bottom: 92px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  box-shadow: var(--shadow-lg); display: grid; place-items: center; cursor: pointer; z-index: 50; transition: transform .12s, color .12s;
}
.fab-feedback:hover { transform: scale(1.08); color: var(--primary); }
.fab-menu { position: fixed; right: 26px; bottom: 92px; z-index: 51; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 230px; animation: pop .14s; }
.palette { max-width: 620px; align-self: flex-start; margin-top: 10vh; }
.palette .input { height: 50px; font-size: 16px; border: 0; box-shadow: none !important; border-radius: 18px 18px 0 0; padding-left: 46px; }
.palette .results { max-height: 380px; overflow-y: auto; padding: 6px; border-top: 1px solid var(--border); }
.bottom-nav { display: none; }
.mobile-head { display: none; }
.print-only { display: none; }
.sticky-foot { position: sticky; bottom: 0; background: var(--surface); }
.pill-num { min-width: 22px; height: 22px; border-radius: 99px; display: inline-grid; place-items: center; background: var(--bg-2); font-size: 12px; font-weight: 700; padding: 0 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.tip { border-bottom: 1px dotted var(--text-3); cursor: help; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.warn-text { color: var(--warn); }
.good-text { color: var(--primary); }
.danger-text { color: var(--danger); }
.green-text { color: var(--primary); }
.kpi-up { color: var(--danger); font-weight: 650; }
.kpi-down { color: var(--primary); font-weight: 650; }

.grid-detail { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.grid-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); align-items: start; }
.grid-receipt { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); align-items: start; }
.sticky-side { position: sticky; top: 20px; }
.dash-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-stats .stat .value { font-size: 23px; }


/* month view */
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.month-grid .mhead { padding: 8px 10px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.month-grid .mcell { min-height: 118px; padding: 5px 6px 22px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; position: relative; min-width: 0; transition: background .1s; }
.month-grid .mcell:nth-child(7n) { border-right: 0; }
.month-grid .mcell.out { background: var(--surface-2); }
.month-grid .mcell.out .mday { color: var(--text-3); }
.month-grid .mcell.today { background: color-mix(in srgb, var(--primary-50) 60%, transparent); }
.month-grid .mcell.drop { background: var(--primary-50); outline: 2px dashed var(--primary); outline-offset: -3px; }
.month-grid .mtop { display: flex; justify-content: space-between; align-items: center; }
.month-grid .mday { border: 0; background: none; font: inherit; font-weight: 750; font-size: 14px; color: var(--text); cursor: pointer; padding: 1px 6px; border-radius: 7px; }
.month-grid .mday:hover { background: var(--bg-2); }
.month-grid .mcell.today .mday { background: var(--primary); color: var(--on-primary); }
.month-grid .mmeal { font-size: 12px; line-height: 1.3; padding: 2px 6px; border-radius: 6px; background: var(--bg-2); border-left: 3px solid var(--primary); cursor: grab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-grid .mmeal:hover { background: var(--primary-50); }
.month-grid .mmeal.cooked { border-left-color: var(--accent); background: var(--accent-50); }
.month-grid .mmeal.skipped { opacity: .45; text-decoration: line-through; }
.month-grid .mmeal.free { border-left-color: var(--info); }
.month-grid .madd { position: absolute; right: 5px; bottom: 4px; width: 20px; height: 20px; border-radius: 6px; border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text-3); cursor: pointer; line-height: 1; opacity: 0; transition: opacity .1s; }
.month-grid .mcell:hover .madd { opacity: 1; }
.month-grid .madd:hover { color: var(--primary); border-color: var(--primary); }
@media (max-width: 860px) {
  .month-grid .mcell { min-height: 74px; padding: 3px 2px 18px; }
  .month-grid .mhead { padding: 6px 2px; text-align: center; font-size: 10px; }
  .month-grid .mmeal { font-size: 10px; padding: 1px 3px; border-left-width: 2px; }
  .month-grid .madd { opacity: 1; width: 16px; height: 16px; font-size: 11px; }
}


/* quick log shortcuts */
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.shortcut { position: relative; }
.shortcut-btn { width: 100%; min-height: 92px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 10px 6px; font: inherit; color: var(--text); transition: transform .08s, border-color .12s, background .12s; }
.shortcut-btn:hover { border-color: var(--primary); background: var(--primary-50); }
.shortcut-btn:active { transform: scale(.96); }
.shortcut-btn .se { font-size: 28px; line-height: 1.1; }
.shortcut-btn .sl { font-weight: 650; font-size: 13px; text-align: center; line-height: 1.2; }
.shortcut-btn .ss { font-size: 11px; color: var(--text-3); }
.shortcut-btn.add { border-style: dashed; background: transparent; }
.shortcut.editing .shortcut-btn { border-style: dashed; border-color: var(--primary); }
.shortcut-tools { display: flex; justify-content: center; gap: 2px; margin-top: 4px; }
.meal-chip.ate_out, .mmeal.ate_out { border-left-color: #a855f7; }
.meal-chip.school, .mmeal.school { border-left-color: #0ea5e9; }
.meal-chip.snack { border-left-color: #84cc16; }
.who { display: inline-flex; gap: 2px; margin-left: 4px; vertical-align: middle; }
.who span { width: 17px; height: 17px; border-radius: 50%; background: var(--bg-2); color: var(--text-2); font-size: 9px; font-weight: 700; display: inline-grid; place-items: center; }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.scan-grid img { width: 100%; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.q-box { background: var(--warn-50); border-radius: 10px; padding: 8px 10px; margin-top: 6px; }

/* responsive -------------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-dash, .grid-detail, .grid-edit, .grid-receipt { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { padding: 14px 16px 96px; }
  .mobile-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
  .app { flex-direction: column; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--text-3); padding: 4px 0; background: none; border: 0; font-family: inherit; }
  .bottom-nav a.router-link-active { color: var(--primary); text-decoration: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 22px; }
  .page-head { margin-bottom: 14px; }
  .fab { bottom: 84px; right: 16px; }
  .fab-feedback { bottom: 150px; right: 24px; }
  .fab-menu { bottom: 150px; right: 16px; }
  .modal { max-height: 100vh; border-radius: 18px 18px 0 0; align-self: flex-end; }
  .overlay { padding: 0; align-items: flex-end; }
  .overlay.palette-overlay { align-items: flex-start; padding: 10px; }
  .hide-mobile { display: none !important; }
  .stat .value { font-size: 22px; }
  .hero { padding: 24px; }
  .hero h1 { font-size: 24px; }
}
@media (min-width: 861px) { .show-mobile { display: none !important; } }

/* ---------------------------------------------------------------- food list */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px; max-height: 52vh; overflow: auto; padding: 2px; }
.catalog-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--border); cursor: pointer; min-width: 0; font-size: 13.5px; }
.catalog-item:hover { background: var(--surface-2); }
.catalog-item.on { border-color: var(--primary); background: var(--primary-50); }
.catalog-item.have { opacity: .55; cursor: default; }
.catalog-item input { accent-color: var(--primary); }
.emoji-sm { font-size: 15px; }
.mt-0 { margin-top: 0; }

/* ---------------------------------------------------------------- sign in */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background:
  radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; padding: 28px; }
.auth-card .seg { display: flex; }
.auth-card .seg button { flex: 1; justify-content: center; }
.auth-card .brand { font-size: 20px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 16%, var(--surface)); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; text-decoration: none; color: inherit; margin-bottom: 4px; }
.user-chip:hover { background: var(--surface-2); }
.user-chip .avatar { width: 30px; height: 30px; font-size: 13px; }
.user-chip small { display: block; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }

/* ---------------------------------------------------------------- marketing page & onboarding */
.pub { min-height: 100vh; background: var(--bg); color: var(--text); }
.pub-inner { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.pub-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.pub-head .pub-inner { height: 64px; }
.pub-brand { padding: 0; text-decoration: none; color: inherit; font-size: 18px; }
.pub-link { color: var(--text-2); text-decoration: none; font-weight: 600; padding: 0 10px; }
.pub-link:hover { color: var(--text); }
.mkt-hero { padding: 72px 0 56px; background: radial-gradient(900px 500px at 85% 10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
  radial-gradient(900px 600px at 0% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 18px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.mkt-hero h1 { font-size: clamp(36px, 5.4vw, 58px); line-height: 1.04; letter-spacing: -.03em; margin: 0; font-weight: 800; }
.mkt-hero .hl { color: var(--primary); }
.lead { font-size: 18px; line-height: 1.55; color: var(--text-2); margin: 0; max-width: 34em; }
.hero-art { position: relative; min-height: 340px; }
.mock { padding: 18px; box-shadow: var(--shadow-lg); }
.mock:first-child { max-width: 340px; margin-left: auto; transform: rotate(1.5deg); }
.mock-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.mock-head > span { font-size: 30px; }
.mock-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; color: var(--text-2); }
.mock-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.mock-total { display: flex; justify-content: space-between; padding-top: 12px; font-weight: 800; font-size: 17px; }
.mock-total b { color: var(--primary); }
.mock-2 { position: absolute; left: 0; bottom: -10px; width: 230px; transform: rotate(-2deg); }
.mock-big { font-size: 26px; font-weight: 800; margin: 4px 0 10px; }
.mock-bar { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.mock-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.pub-section { padding: 72px 0; }
.pub-section.alt { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.02em; text-align: center; margin: 0 0 10px; }
.section-sub { text-align: center; color: var(--text-2); margin: 0 auto 28px; max-width: 36em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
.mkt-feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature-icon { font-size: 28px; width: 52px; height: 52px; border-radius: 14px; background: var(--primary-50); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.mkt-feature h3, .step h3 { margin: 0 0 6px; font-size: 17px; }
.mkt-feature p, .step p { margin: 0; color: var(--text-2); line-height: 1.5; font-size: 14.5px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
.step { padding: 8px 4px; }
.step-n { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 800; align-items: center; justify-content: center; margin-bottom: 12px; }
.pub-cta { padding: 72px 0; background: var(--primary-50); }
.pub-cta h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 18px; letter-spacing: -.02em; }
.pub-foot { padding: 28px 0; color: var(--text-3); font-size: 13.5px; border-top: 1px solid var(--border); }
.pub-foot a { color: var(--text-2); }

.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; width: 100%; }
.plan-grid.compact { gap: 12px; }
.plan-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 22px; position: relative; transition: border-color .15s, box-shadow .15s; }
.plan-grid.compact .plan-card { padding: 16px; }
.plan-card.popular { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--shadow); }
.plan-card[role="radio"] { cursor: pointer; }
.plan-card[role="radio"]:hover { border-color: var(--border-strong); }
.plan-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.plan-card.current { border-color: var(--primary); }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-top h3 { margin: 0; font-size: 18px; }
.plan-price b { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.plan-price span { color: var(--text-3); margin-left: 6px; font-size: 14px; }
.plan-tagline { margin: 0; color: var(--text-2); font-size: 14px; }
.plan-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 14px; flex: 1; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list svg { color: var(--primary); margin-top: 2px; flex: none; }
.plan-foot { margin-top: 8px; }
.plan-radio { display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--text-2); font-size: 14px; }
.plan-radio span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); }
.plan-card.selected .plan-radio { color: var(--primary); }
.plan-card.selected .plan-radio span { border: 5px solid var(--primary); }
.xs-badge { height: 18px; font-size: 10.5px; padding: 0 6px; }
.interval-toggle button { height: 32px; }

.signup { padding: 40px 20px 72px; }
.page-h { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; text-align: center; margin: 0 0 8px; }
.stepper { display: flex; justify-content: center; gap: 22px; margin-bottom: 26px; font-size: 13px; font-weight: 600; color: var(--text-3); flex-wrap: wrap; }
.stepper .on { color: var(--primary); }
.stepper .done { color: var(--text-2); }
.plan-chip { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--primary-50); border-radius: 10px; padding: 8px 10px 8px 14px; font-size: 14px; margin-bottom: 16px; }
.checkout-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.welcome { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.welcome h2 { margin: 0; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.dots span.on { background: var(--primary); width: 22px; border-radius: 99px; }

@media (max-width: 860px) {
  .mkt-hero { padding: 40px 0 32px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-art { min-height: 0; }
  .mock-2 { position: relative; bottom: auto; margin-top: -14px; }
  .feature-grid, .steps, .plan-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .pub-section { padding: 48px 0; }
}
@media (max-width: 420px) {
  .pub-head .btn.ghost { padding: 0 8px; }
  .mock-2 { width: 200px; }
}

/* ---------------------------------------------------------------- nutrition */
.nf-panel { border: 2px solid var(--text); border-radius: 6px; padding: 8px 10px; max-width: 320px; font-size: 13.5px; background: var(--surface); }
.nf-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; border-bottom: 1px solid var(--text); padding-bottom: 4px; }
.nf-sub { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px 0; border-bottom: 6px solid var(--text); }
.nf-cal { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 17px; padding: 4px 0; border-bottom: 3px solid var(--text); }
.nf-cal b { font-size: 26px; }
.nf-row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--border-strong); }
.nf-row.ind0 span:first-child { font-weight: 700; }
.nf-row.ind1 { padding-left: 14px; }
.nf-row.ind2 { padding-left: 28px; }
.nf-row:last-child { border-bottom: 0; }
.nf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; }
.nf-grid .field.ind1 label, .nf-grid .field.ind2 label { color: var(--text-2); font-weight: 500; }
.scan-box { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.label-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.kcal-hero { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.kcal-hero > div > b { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.macro-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.macro-pills span { background: var(--bg-2); border-radius: 99px; padding: 4px 10px; font-size: 12.5px; color: var(--text-2); }
.macro-pills b { color: var(--text); }
.nf-missing { display: inline; }
.nf-missing + .nf-missing::before { content: ", "; }
.nf-missing:first-child::before { content: " "; }
/* unknown nutrition: yellow, visible but small */
.nf-warn { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: var(--warn-50); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); vertical-align: middle; margin-left: 4px; cursor: help; flex: none; }
.nf-day-pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--warn-50); color: var(--warn); font-size: 12px; font-weight: 700; cursor: help; }
.nf-day-warn { display: flex; gap: 6px; align-items: flex-start; padding: 7px 10px; border-radius: 9px; background: var(--warn-50); color: var(--text); border-left: 3px solid var(--warn); }
.nf-day-warn svg { color: var(--warn); flex: none; margin-top: 2px; }
.nf-row-missing td { background: color-mix(in srgb, var(--warn-50) 70%, transparent); }
.nf-row-missing td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.kcal-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.day-kcal { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.day-kcal.warn { color: var(--warn); }
.intake { display: flex; flex-direction: column; gap: 6px; }
.intake-row { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.intake .chip { height: 26px; padding: 0 10px; font-size: 12.5px; }
.intake.compact .chip { height: 24px; padding: 0 9px; }
.input.sm { height: 30px; font-size: 13px; padding: 0 8px; }
.intake-meal { padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.cal-bars .card-body { position: relative; }
.cal-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.cal-bar .b { width: 100%; max-width: 46px; background: var(--primary); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.cal-bar .b.warn { background: repeating-linear-gradient(45deg, var(--primary), var(--primary) 6px, var(--warn) 6px, var(--warn) 9px); }
.cal-bar .v { color: var(--text-2); white-space: nowrap; }
.goal-line { position: absolute; left: 16px; right: 16px; border-top: 2px dashed var(--accent); pointer-events: none; }

/* ---------------------------------------------------------------- barcode, goals, value, auto-plan */
.barcode-video { width: 100%; max-height: 320px; background: #000; border-radius: 12px; object-fit: cover; }
.value-row { gap: 14px; color: var(--text-2); }
.value-row b { color: var(--text); }
.goal-row { display: flex; flex-direction: column; gap: 5px; }
.autoplan-sum { gap: 16px; padding: 8px 12px; background: var(--surface-2); border-radius: 10px; }
.autoplan-list { max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.autoplan-list input { width: 17px; height: 17px; accent-color: var(--primary); }
.use-ideas { margin-top: 3px; color: var(--text-3); }
.use-ideas .link-btn + .link-btn::before { content: "· "; color: var(--text-3); font-weight: 400; }
.cook-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px;
  background: var(--accent-50); color: var(--accent); font-size: 10.5px; font-weight: 800; margin-left: 4px; vertical-align: middle; }
.leftover-box { padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 12px; }

/* live shopping */
.shoppers { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.shopper { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 99px; background: var(--primary-50); font-size: 12.5px; font-weight: 600; }
.shopper .avatar { width: 22px; height: 22px; font-size: 11px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); animation: livepulse 1.6s infinite; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 6px transparent; } }
.checked-by { font-size: 10.5px; font-weight: 800; color: var(--text-3); margin-left: 4px; }

/* cook mode */
.cook-mode { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; }
.cook-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cook-body { flex: 1; display: grid; grid-template-columns: 320px 1fr; min-height: 0; }
.cook-ings { border-right: 1px solid var(--border); overflow: auto; padding: 14px 16px; }
.cook-ings label { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 15px; cursor: pointer; }
.cook-ings label.done { opacity: .45; text-decoration: line-through; }
.cook-ings input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; margin-top: 2px; }
.cook-step { overflow: auto; padding: 28px clamp(16px, 5vw, 64px); display: flex; flex-direction: column; gap: 18px; }
.cook-step .n { font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.cook-step .txt { font-size: clamp(22px, 2.6vw, 32px); line-height: 1.4; font-weight: 500; }
.cook-nav { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: center; }
.cook-dots { display: flex; gap: 5px; flex: 1; justify-content: center; flex-wrap: wrap; }
.cook-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); cursor: pointer; }
.cook-dots span.on { background: var(--primary); }
.cook-dots span.seen { background: var(--primary-100); }
.timers { display: flex; gap: 8px; flex-wrap: wrap; }
.timer { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 700; font-size: 16px; }
.timer.running { border-color: var(--primary); background: var(--primary-50); }
.timer.done { border-color: var(--accent); background: var(--accent-50); animation: livepulse 1s infinite; }
@media (max-width: 860px) {
  .cook-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .cook-ings { border-right: 0; border-bottom: 1px solid var(--border); max-height: 32vh; }
}

/* ---------------------------------------------------------------- admin console */
.admin-tabs { flex-wrap: wrap; }
.admin-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.kpi b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--text-3); font-size: 12px; }
.kpi.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: var(--warn-50); }
.mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.mini-bars > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.mini-bars span { width: 100%; background: var(--primary); border-radius: 4px 4px 1px 1px; min-height: 2px; }
.mini-bars small { font-size: 10px; color: var(--text-3); }
.admin-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.admin-usage { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 12px; background: var(--surface-2); border-radius: 10px; color: var(--text-2); }
.admin-usage b { color: var(--text); }
.admin-list { border: 1px solid var(--border); border-radius: 12px; }
.admin-matrix td, .admin-matrix th { vertical-align: middle; }
.admin-matrix input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.admin-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.admin-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.announce { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-radius: 12px; margin-bottom: 14px; background: var(--info-50); font-size: 14px; }
.announce.warn { background: var(--warn-50); }
.announce.trial { background: var(--primary-50); }
.trial-note { font-size: 14px; color: var(--text-2); background: var(--primary-50); padding: 8px 14px; border-radius: 99px; text-align: center; }

/* ---------------------------------------------------------------- phone */
.plan-title { min-width: 140px; text-align: center; }
@media (hover: none) {
  .card.hover:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }
}
@media (max-width: 860px) {
  :root { --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); }
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; -webkit-tap-highlight-color: transparent; }
  a, button, label, input, select, textarea, .menu-item, .list-item, .tick { touch-action: manipulation; }
  .app, .pub, .auth-wrap { min-height: 100dvh; }

  /* app frame: header, bottom bar, sheets. The floating buttons covered content, so + lives in the bar. */
  .mobile-head { padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) 8px calc(16px + var(--safe-l)); }
  .main { padding: 14px calc(16px + var(--safe-r)) calc(92px + var(--safe-b)) calc(16px + var(--safe-l)); }
  .bottom-nav { align-items: center; padding: 6px calc(4px + var(--safe-r)) calc(6px + var(--safe-b)) calc(4px + var(--safe-l)); }
  .bottom-nav a, .bottom-nav button { min-height: 48px; justify-content: center; cursor: pointer; }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .nav-add span { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 12px rgba(47,125,50,.35); }
  .bottom-nav .nav-add:active span { transform: scale(.94); }
  .fab, .fab-feedback { display: none; }
  .sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 20, 12, .45); animation: fade .12s; }
  .fab-menu { left: 0; right: 0; bottom: 0; min-width: 0; max-height: calc(100dvh - var(--safe-t) - 56px); overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: 20px 20px 0 0;
    padding: 10px calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l)); animation: sheet-up .18s ease-out; }
  .more-sheet .user-chip { margin: 0; }
  .more-sheet .user-chip small { max-width: 60vw; }
  .menu-item { min-height: 44px; }
  .menu { max-width: calc(100vw - 24px); }
  .menu-item { white-space: normal; }
  .toasts { bottom: calc(76px + var(--safe-b)); width: calc(100% - 24px); }
  .toast { max-width: 100%; }

  /* sizes a thumb can hit; 16px text stops iOS zooming in on focus */
  .input, .select { height: 44px; font-size: 16px; }
  .textarea, textarea.input { font-size: 16px; }
  .input.sm, .select.sm { height: 38px; font-size: 16px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { font-size: 16px !important; }
  .input, .select, .textarea { min-width: 0; }
  .field { min-width: 0; }
  .row.wrap > .field[style*="width:"] { flex: 1 1 130px; width: auto !important; }
  .check input, .autoplan-list input { width: 20px; height: 20px; }
  .btn { height: 44px; }
  .btn.sm { height: 38px; padding: 0 12px; font-size: 14px; }
  .btn.xs { height: 32px; padding: 0 10px; font-size: 13px; }
  .btn.icon { width: 44px; padding: 0; }
  .btn.sm.icon { width: 38px; padding: 0; }
  .btn.xs.icon { width: 32px; padding: 0; }
  .btn.lg { height: auto; min-height: 50px; max-width: 100%; white-space: normal; text-align: center; }
  .btn-group button { height: 42px; }
  .chip { height: 36px; }
  .intake .chip, .intake.compact .chip { height: 34px; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar, .tabs::-webkit-scrollbar, .chips-scroll::-webkit-scrollbar { display: none; }
  .seg button { height: 38px; flex: none; white-space: nowrap; }
  .tabs { scrollbar-width: none; }
  .tab { padding: 12px 14px; }
  .link-btn { min-height: 32px; }
  .recipe-img .fav { width: 40px; height: 40px; }
  .shop-item { min-height: 56px; padding: 10px 14px; }
  .shop-item .tick { width: 30px; height: 30px; border-radius: 9px; }
  .list-item { padding: 12px 16px; }
  .card-pad { padding: 16px; }
  .card-head { padding: 12px 16px; flex-wrap: wrap; }
  .card-body { padding: 14px 16px; }
  .card-foot { padding: 12px 16px; }

  /* page layout */
  .grid-dash, .grid-detail, .grid-edit, .grid-receipt, .grid-2, .grid-3, .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px; }
  .page-head .actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); align-content: start; }
  .page-head .actions .btn { padding: 0 10px; }
  .row.wrap > .search.grow { flex: 1 1 100%; max-width: none !important; }
  .row.wrap > .select { flex: 1; min-width: 0; }
  .main { overflow-x: clip; }
  .card:has(table.table):not(:has(.edit-lines)) { overflow-x: auto; }
  .table th { white-space: normal; }
  .table.compact td, .table.compact th { padding-left: 6px; padding-right: 6px; }
  .dropzone { padding: 26px 16px; }
  .img-hero { height: 200px; }

  /* filters run sideways instead of pushing the content down a screen */
  .chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-16px - var(--safe-l)); margin-right: calc(-16px - var(--safe-r)); padding: 0 calc(16px + var(--safe-r)) 0 calc(16px + var(--safe-l)); }
  .chips-scroll > * { flex: none; }

  /* meal plan */
  .plan-nav .seg { flex: 1 1 100%; }
  .plan-nav .seg button { flex: 1; justify-content: center; }
  .plan-title { flex: 1; min-width: 0; }
  .month-grid .mcell { padding-bottom: 28px; }
  .month-grid .mday { min-width: 26px; min-height: 26px; padding: 1px 3px; }
  .month-grid .madd { width: 24px; height: 24px; font-size: 14px; right: 3px; bottom: 3px; }

  /* shopping */
  .shop-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-range .chips, .shop-range .right { grid-column: 1 / -1; }
  .shop-range .chips { align-self: auto !important; }
  .shop-range .chip { flex: 1; justify-content: center; padding: 0 6px; }
  .shop-range > .grow { display: none; }
  .shop-range .right { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; text-align: left; }
  .shop-tools > form { flex: 1 1 100%; max-width: none !important; }
  .shop-tools > .grow:not(form) { display: none; }
  .shop-tools > .seg { flex: 1 1 100%; }
  .shop-tools > .seg button { flex: 1; justify-content: center; }

  /* ingredient rows stack: the name gets the full width, amounts and actions sit under it */
  .table-wrap:has(> .edit-lines) { overflow: visible; }
  .edit-lines thead { display: none; }
  .edit-lines, .edit-lines tbody { display: block; }
  .edit-lines tr { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; grid-template-areas: "ing ing ing" "qty unit act"; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); align-items: center; }
  .edit-lines tr:last-child { border-bottom: 0; }
  .edit-lines td { padding: 0; border: 0; min-width: 0; }
  .edit-lines td[colspan] { grid-column: 1 / -1; grid-row: 1; }
  .edit-lines td:nth-child(1):not([colspan]) { grid-area: qty; }
  .edit-lines td:nth-child(2) { grid-area: unit; }
  .edit-lines td:nth-child(3) { grid-area: ing; }
  .edit-lines td:nth-child(5) { grid-area: act; }

  /* dialogs are bottom sheets, sized to the visible screen */
  .modal, .modal.wide, .modal.xwide { max-width: none; max-height: calc(100dvh - var(--safe-t) - 12px); border-radius: 20px 20px 0 0; animation: sheet-up .2s ease-out; }
  .modal-head { padding: 12px 10px 12px 16px; }
  .modal-body { padding: 16px calc(16px + var(--safe-r)) 16px calc(16px + var(--safe-l)); min-height: 0; overscroll-behavior: contain; }
  .modal-body:last-child { padding-bottom: calc(16px + var(--safe-b)); }
  .modal-foot { flex-wrap: wrap; padding: 10px calc(16px + var(--safe-r)) calc(10px + var(--safe-b)) calc(16px + var(--safe-l)); }
  .modal-foot .btn { flex: 1 1 auto; }
  .drawer { max-width: none; padding-top: var(--safe-t); }
  .overlay.palette-overlay { padding: calc(10px + var(--safe-t)) 10px 10px; }
  .modal.palette { align-self: flex-start; margin-top: 0; border-radius: 18px; max-height: calc(100dvh - var(--safe-t) - 20px); }
  .palette .results { max-height: none; flex: 1; min-height: 0; }

  /* cook mode */
  .cook-top { padding-top: calc(12px + var(--safe-t)); }
  .cook-nav { padding-bottom: calc(12px + var(--safe-b)); }
  .cook-step { padding-top: 18px; padding-bottom: 18px; }
  .cook-step .txt { font-size: clamp(20px, 5.6vw, 26px); }
  .cook-ings label { padding: 10px 0; }
}
@media (max-width: 420px) {
  .pub-head .pub-inner { padding: 0 12px; gap: 6px; }
  .pub-head .btn { padding: 0 10px; height: 38px; font-size: 14px; }
  .pub-head .pub-link { padding: 0 6px; }
  .pub-brand { font-size: 16px; gap: 7px; }
}
@keyframes sheet-up { from { transform: translateY(32px); } }

@media print {
  .sidebar, .bottom-nav, .mobile-head, .fab, .no-print, .page-head .actions { display: none !important; }
  .main { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; }
  .print-only { display: block; }
  body { background: #fff; }
}
