:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --text: #1c1917;
  --muted: #78716c;
  --faint: #a8a29e;
  --line: #e7e5e4;
  --line-strong: #d6d3d1;
  --ink: #1c1917;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --over: #b91c1c;
  --over-bg: #fee2e2;
  --bar: #d6d3d1;
  --accent: #1c1917;
  --accent-text: #ffffff;
  --focus: #2563eb;
  --combo-a: #0d9488;
  --combo-b: #0891b2;
  --reg-a: #7c3aed;
  --reg-b: #a855f7;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1b1b1a;
    --surface-2: #242423;
    --text: #f5f5f4;
    --muted: #a8a29e;
    --faint: #78716c;
    --line: #2e2d2c;
    --line-strong: #44403c;
    --ink: #f5f5f4;
    --ok: #4ade80;
    --ok-bg: #14301e;
    --over: #f87171;
    --over-bg: #3a1717;
    --bar: #44403c;
    --accent: #f5f5f4;
    --accent-text: #121212;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .35);
    --combo-a: #2dd4bf;
    --combo-b: #67e8f9;
    --reg-a: #a78bfa;
    --reg-b: #e879f9;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
a.btn { text-decoration: none; color: inherit; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.primary:hover { opacity: .9; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 13px; border-radius: 7px; }
.btn.icon { width: 34px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn.danger { color: var(--over); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.sm svg { width: 14px; height: 14px; }

.input, select.input {
  height: 36px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); min-width: 0;
}
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.input.num { width: 84px; text-align: right; }
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.field .input { color: var(--text); font-size: 15px; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 0 11px; height: 32px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--surface-2); color: var(--text); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 13px; color: var(--muted);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; height: 30px; background: var(--surface); }
.stepper button { width: 28px; height: 100%; border: 0; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; }
.stepper button:hover { color: var(--text); }
.stepper input { width: 40px; border: 0; background: transparent; text-align: center; height: 100%; padding: 0; font-size: 14px; }
.stepper input:focus { outline: none; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 20px; }
.brand { font-weight: 650; letter-spacing: -.01em; font-size: 16px; }
.tabs { display: flex; gap: 2px; margin-left: auto; }
.tabs a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; padding: 7px 12px; border-radius: 8px; }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a.on { color: var(--text); background: var(--surface-2); }
.brand { white-space: nowrap; }
@media (max-width: 480px) {
  .topbar-inner { padding: 0 12px; gap: 8px; }
  .tabs a { padding: 6px 8px; }
  main { padding: 16px 12px 64px; }
  .datebar h1 { font-size: 19px; }
}

main { max-width: 1160px; margin: 0 auto; padding: 24px 20px 80px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 18px 20px; }
.section-title { font-size: 15px; font-weight: 600; margin: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- day view ---------- */
.day-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.day-aside { position: sticky; top: 80px; display: grid; gap: 16px; }
.day-main { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 920px) {
  .day-grid { grid-template-columns: minmax(0, 1fr); }
  .day-aside { position: static; }
}

.datebar { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.datebar h1 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; margin: 0 8px 0 4px; position: relative; }
.datebar .rel { font-size: 13px; color: var(--muted); margin-left: 4px; }
.datebar h1 input[type=date] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

/* search */
.search { position: relative; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.search-box input {
  width: 100%; height: 46px; padding: 0 44px 0 40px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 16px;
}
.search-box input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.search-box kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 12px ui-monospace, monospace; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; }
.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); max-height: min(460px, 60vh); overflow-y: auto; padding: 6px;
}
.results .group { font-size: 12px; font-weight: 600; color: var(--faint); padding: 8px 10px 4px; }
.result { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.result.active { background: var(--surface-2); }
.result .r-main { min-width: 0; flex: 1; }
.result .r-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .r-name mark { background: none; color: inherit; font-weight: 700; }
.result .r-meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .r-n { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.result .r-n b { color: var(--text); font-weight: 600; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); vertical-align: 1px; }
.pill.now { background: var(--ok-bg); color: var(--ok); }
.pill.gone { color: var(--faint); }
.results .empty { padding: 14px 10px; color: var(--muted); font-size: 14px; }

/* meals */
.meal + .meal { border-top: 1px solid var(--line); }
.meal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 20px; }
.meal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.meal-head .sub { font-size: 13px; color: var(--muted); }
.meal-head .actions { margin-left: auto; display: flex; gap: 2px; }
.entry { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 72px 28px; align-items: center; gap: 12px; padding: 7px 16px 7px 14px; }
.entry.selected { background: var(--surface-2); }
.sel-box {
  width: 18px; height: 18px; padding: 0; border-radius: 5px; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--accent-text);
  opacity: 0; transition: opacity .1s;
}
.sel-box svg { width: 12px; height: 12px; stroke-width: 3; opacity: 0; }
.entry:hover .sel-box, #meals.selecting .sel-box, .sel-box:focus-visible { opacity: 1; }
.entry.selected .sel-box { background: var(--accent); border-color: var(--accent); }
.entry.selected .sel-box svg { opacity: 1; }
@media (hover: none) { .sel-box { opacity: 1; } }

.selbar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: var(--shadow); padding: 8px 8px 8px 16px; animation: up .15s ease-out;
}
body.has-selbar #toast-root { bottom: 84px; }
@media (max-width: 560px) { .selbar .muted { display: none; } }

.hovertip { position: fixed; z-index: 70; pointer-events: none; filter: drop-shadow(0 6px 20px rgb(0 0 0 / .18)); }
.label.mini { width: 250px; padding: 10px 12px 8px; }
.label.mini h2 { font-size: 17px; letter-spacing: -.01em; line-height: 1.15; font-weight: 800; }
.label.mini .l-sub { font-size: 12px; border-bottom-width: 6px; padding: 2px 0 4px; }
.label.mini .l-cal { border-bottom-width: 3px; padding: 4px 0 2px; }
.label.mini .l-cal .k { font-size: 11px; }
.label.mini .l-cal .k b { font-size: 16px; }
.label.mini .l-cal .v { font-size: 24px; }
.label.mini .l-cal .v small { font-size: 11px; }
.label.mini .l-dvhead { font-size: 11px; }
.label.mini .l-row { font-size: 12px; padding: 2px 0 1px; }
.label.mini .l-row .g { display: none; }
.label.mini .l-thick { border-bottom-width: 6px; }
.label [data-k] { cursor: default; }
.label:not(.mini) [data-k]:hover { background: var(--surface-2); }

.contrib {
  width: 300px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 10px 12px; font-size: 13px;
}
.contrib .c-head { display: flex; justify-content: space-between; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.contrib .c-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; gap: 8px; padding: 4px 0 5px; }
.contrib .c-row i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--bar); border-radius: 2px; }
.contrib .c-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrib .c-v { font-weight: 600; }
.contrib .c-p { text-align: right; color: var(--muted); }
.contrib .c-empty { color: var(--muted); padding: 4px 0; }
.contrib .c-head b.ok { color: var(--ok); }
.contrib .c-head b.over { color: var(--over); }
.contrib .c-head span { color: var(--muted); }
.contrib .c-p { min-width: 36px; }
.entry:last-child { padding-bottom: 14px; }
.entry .e-name { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .e-meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .e-cal { text-align: right; font-size: 14px; }
.entry .e-cal small { display: block; font-size: 12px; color: var(--muted); }
.entry .del { opacity: .45; }
.entry:hover .del { opacity: 1; }
@media (max-width: 560px) {
  .entry { grid-template-columns: 18px minmax(0, 1fr) auto 28px; }
  .entry .e-cal { display: none; }
}


/* suggestions */
.sugg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 16px 12px 20px; }
.sugg-controls { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sugg-group { border-top: 1px solid var(--line); }
.sugg-group-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px 6px 20px; font-size: 13.5px; font-weight: 600; }
.sugg-group-head .muted { font-weight: 400; }
.sugg-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 7px 16px 7px 20px; }
.sugg-item .s-name { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg-item .s-meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg-item .s-n { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.sugg-item .s-act { display: flex; gap: 2px; }
.sugg-foot { display: flex; align-items: center; gap: 10px; padding: 8px 16px 16px 20px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.sugg-empty { padding: 4px 20px 20px; color: var(--muted); font-size: 14px; }
@media (max-width: 560px) {
  .sugg-item { grid-template-columns: minmax(0, 1fr) auto; }
  .sugg-item .s-n { display: none; }
}

/* ---------- nutrition label ---------- */
.label {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 14px 16px 12px;
  font-family: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, sans-serif;
}
.label h2 { font-size: 30px; font-weight: 900; letter-spacing: -.02em; line-height: 1; margin: 0; }
.label .l-sub { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0 6px; border-bottom: 10px solid var(--ink); }
.label .l-cal { display: flex; align-items: flex-end; justify-content: space-between; padding: 6px 0 4px; border-bottom: 5px solid var(--ink); }
.label .l-cal .k { font-size: 13px; font-weight: 700; }
.label .l-cal .k b { display: block; font-size: 22px; font-weight: 900; line-height: 1.05; }
.label .l-cal .v { font-size: 34px; font-weight: 900; line-height: 1; text-align: right; }
.label .l-cal .v small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.label .l-dvhead { text-align: right; font-size: 12px; font-weight: 700; padding: 4px 0 3px; border-bottom: 1px solid var(--ink); }
.label .l-row {
  position: relative; display: flex; justify-content: space-between; gap: 8px;
  font-size: 14px; padding: 4px 0 3px; border-bottom: 1px solid var(--line-strong);
}
.label .l-row .fill { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--bar); }
.label .l-row .fill.ok { background: var(--ok); }
.label .l-row .fill.over { background: var(--over); }
.label .l-row.indent { padding-left: 16px; }
.label .l-row.indent .fill { left: 16px; }
.label .l-row.deep { padding-left: 30px; }
.label .l-row.deep .fill { left: 30px; }
.label .l-row b { font-weight: 800; }
.label .l-row .p { font-weight: 800; }
.label .l-row .p.ok { color: var(--ok); }
.label .l-row .p.over { color: var(--over); }
.label .l-row .g { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.label .l-thick { border-bottom: 10px solid var(--ink); }
.label .l-mid { border-bottom: 5px solid var(--ink); }
.label .l-note { font-size: 11.5px; color: var(--muted); padding-top: 7px; line-height: 1.35; }

/* ---------- calendar ---------- */
.cal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 920px) { .cal-grid { grid-template-columns: minmax(0, 1fr); } }
.cal { overflow: hidden; }
.cal-head { display: flex; align-items: center; gap: 6px; padding: 14px 14px 10px 20px; }
.cal-head h2 { margin: 0 auto 0 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 12px; color: var(--faint); font-weight: 600; padding: 0 8px 6px; }
.cal-dow div { padding: 0 6px; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 8px 8px; }
.cal-day {
  min-height: 84px; border-radius: 8px; padding: 6px 7px; border: 1px solid transparent;
  background: var(--surface-2); text-align: left; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.cal-day.out { background: transparent; color: var(--faint); }
.cal-day.future { background: transparent; border-color: var(--line); }
.cal-day:hover { border-color: var(--line-strong); }
.cal-day.sel { border-color: var(--ink); }
.cal-day .d { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cal-day.today .d { color: var(--accent-text); background: var(--accent); border-radius: 999px; width: 22px; height: 22px; display: grid; place-items: center; margin: -2px 0 0 -3px; }
.cal-day .c { font-size: 15px; font-weight: 650; margin-top: auto; letter-spacing: -.01em; }
.cal-day .c small { font-size: 11px; font-weight: 500; color: var(--muted); }
.cal-day .bars { display: grid; gap: 3px; }
.cal-day .bars i { display: block; height: 3px; border-radius: 3px; background: var(--line-strong); overflow: hidden; }
.cal-day .bars i b { display: block; height: 100%; background: var(--bar); }
.cal-day .bars i b.ok { background: var(--ok); }
.cal-day .bars i b.over { background: var(--over); }
@media (max-width: 560px) {
  .cal-day { min-height: 60px; padding: 4px; }
  .cal-day .c { font-size: 12px; }
  .cal-day .c small { display: none; }
}
.cal-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.cal-stats > div { padding: 12px 20px; }
.cal-stats > div + div { border-left: 1px solid var(--line); }
.cal-stats .k { font-size: 12.5px; color: var(--muted); }
.cal-stats .v { font-size: 17px; font-weight: 600; }
@media (max-width: 560px) { .cal-stats > div { padding: 10px 12px; } }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); padding: 0 20px 14px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; background: var(--bar); }
.legend span:first-child::before { display: none; }
.legend .ok::before { background: var(--ok); }
.legend .over::before { background: var(--over); }

/* ---------- saved / settings ---------- */
.page-title { font-size: 22px; font-weight: 650; letter-spacing: -.015em; margin: 0 0 18px; }
.stack { display: grid; gap: 20px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 20px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row .l-main { flex: 1; min-width: 0; }
.list-row .l-name { font-weight: 500; }
.list-row .l-meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.empty-note { padding: 18px 20px; color: var(--muted); font-size: 14px; }

.goals { width: 100%; border-collapse: collapse; }
.goals td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.goals tr:first-child td { border-top: 0; }
.goals td:first-child { padding-left: 20px; font-weight: 500; white-space: nowrap; }
.goals td:last-child { padding-right: 20px; }
.goals .vals { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.goals select.input { width: 120px; }
@media (max-width: 560px) {
  .goals td:first-child { white-space: normal; }
  .goals select.input { width: 96px; }
  .goals .input.num { width: 68px; }
}
.setting { padding: 14px 20px; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting .s-label { font-weight: 500; margin-bottom: 8px; }
.setting .s-label span { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .32); display: grid; place-items: start center; padding: 9vh 16px 16px; overflow-y: auto; }
.modal { width: 100%; max-width: 460px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.modal.wide { max-width: 600px; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 16px 4px 20px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.modal-body { padding: 14px 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 6px 20px 18px; }
.mini-n { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 8px; }
.mini-n > div { padding: 8px 10px; }
.mini-n > div + div { border-left: 1px solid var(--line); }
.mini-n .k { font-size: 12px; color: var(--muted); }
.mini-n .v { font-size: 16px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.form-grid .span-3 { grid-column: span 3; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 480px) { .form-grid { grid-template-columns: repeat(2, 1fr); } .form-grid .span-3, .form-grid .span-2 { grid-column: span 2; } }
.combo-items { border: 1px solid var(--line); border-radius: 8px; }
.combo-items .entry { padding: 7px 10px 7px 12px; grid-template-columns: minmax(0, 1fr) auto 28px; }
.combo-items .entry:last-child { padding-bottom: 7px; }
.combo-items .entry + .entry { border-top: 1px solid var(--line); }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--bg); padding: 10px 14px 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); animation: up .18s ease-out; }
.toast button { background: transparent; border: 0; color: inherit; font-weight: 600; text-decoration: underline; padding: 0; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: 100%; max-width: 320px; display: grid; gap: 12px; }
.login h1 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; margin: 0 0 6px; }
.login .input { height: 42px; font-size: 15px; }
.login .btn { height: 42px; }
.login .err { color: var(--over); font-size: 13.5px; min-height: 18px; }

.notice { font-size: 13px; color: var(--muted); padding: 10px 20px; border-top: 1px solid var(--line); }

/* ---------- combo & regulars groups ---------- */
/* Text-only accents: combos are teal, regulars are purple. Used everywhere these show up. */
.t-combo, .t-reg { -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.t-combo { background-image: linear-gradient(90deg, var(--combo-a), var(--combo-b)); }
.t-reg { background-image: linear-gradient(90deg, var(--reg-a), var(--reg-b)); }
/* A combo that is also a regular: teal into purple. */
.t-both { -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  background-image: linear-gradient(90deg, var(--combo-a), var(--combo-b) 45%, var(--reg-a) 55%, var(--reg-b)); }
.t-both mark { color: transparent; }
.t-combo mark, .t-reg mark { color: transparent; }

/* Group header lines up with item names; its items are indented one step under it. */
.grp-head { display: flex; align-items: center; gap: 10px; padding: 7px 16px 2px 44px; min-height: 34px; }
.grp-head .grp-name { font-size: 14.5px; font-weight: 600; }
.grp-head .sub { font-size: 12.5px; color: var(--muted); }
.grp-head .btn { opacity: 0; }
.grp:hover .grp-head .btn, #meals.selecting .grp-head .btn { opacity: 1; }
@media (hover: none) { .grp-head .btn { opacity: 1; } }
.grp .entry { padding-left: 34px; }
.meal-regs { padding: 2px 16px 12px 44px; }

/* ---------- regulars ---------- */
.regulars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.reg-chip { display: inline-flex; align-items: center; height: 28px; border: 1px dashed var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 13px; }
.reg-chip:hover { border-color: var(--faint); color: var(--text); }
.reg-chip button { border: 0; background: transparent; color: inherit; height: 100%; display: inline-flex; align-items: center; gap: 4px; }
.reg-chip .reg-add { padding: 0 4px 0 9px; }
.reg-chip .reg-add svg { color: var(--reg-a); }
.reg-chip .reg-x { padding: 0 8px 0 4px; color: var(--faint); }
.reg-chip .reg-x:hover { color: var(--text); }
.reg-chip svg { width: 13px; height: 13px; }
.chip.sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.reg-row { flex-wrap: wrap; }
.plan-label { cursor: default; }
@media (max-width: 560px) { .reg-row .chips { width: 100%; } }
