:root {
  --bg: #f6f4ee; --card: #ffffff; --ink: #1e2a1e; --muted: #6b756b;
  --green: #1a7a2e; --green-dk: #145c23; --gold: #b98a1d; --red: #b3372f;
  --line: #e3ded2; --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.hidden { display: none !important; }
.view { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--red); min-height: 1.2em; }

h1 { font-size: 1.35rem; margin: 0.4em 0; }
header { display: flex; justify-content: space-between; align-items: center; }

.auth-card { background: var(--card); border-radius: var(--radius); padding: 28px 22px; margin-top: 18vh; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.auth-card input, .tabpanel input, .tabpanel select {
  width: 100%; padding: 12px; margin: 8px 0; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
button { font-size: 1rem; border-radius: 10px; border: none; padding: 12px 16px; cursor: pointer; }
button.primary { background: var(--green); color: #fff; width: 100%; font-weight: 600; }
button.primary:active { background: var(--green-dk); }
button.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
button.link { background: none; color: var(--green); padding: 8px; }
button:disabled { opacity: .55; }

.tabs-mini { display: flex; gap: 8px; margin: 12px 0; }
.mini-tab { flex: 1; background: #eee; padding: 10px; }
.mini-tab.active { background: var(--green); color: #fff; }

.tabbar { display: flex; gap: 6px; margin: 12px 0 4px; position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 5; }
.tab { flex: 1; background: #e9e5d8; padding: 10px 4px; font-weight: 600; }
.tab.active { background: var(--ink); color: #fff; }
.tabpanel { padding-top: 8px; }

.banner {
  background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  margin: 8px 0 12px; border-left: 6px solid var(--green);
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.banner.over { border-left-color: var(--red); }
.banner .big { font-size: 1.5rem; font-weight: 700; }
.bar { height: 8px; background: #e9e5d8; border-radius: 4px; margin-top: 8px; overflow: hidden; }
.bar > div { height: 100%; background: var(--green); border-radius: 4px; }
.banner.over .bar > div { background: var(--red); }

.row { display: flex; align-items: center; }
.gap { gap: 8px; margin: 8px 0; }
.grow { flex: 1; }
#btn-plan { flex: 2; }

.day-card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.day-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.day-name { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.meal-cost { font-weight: 700; white-space: nowrap; }
.tag { display: inline-block; background: #eef3e6; color: var(--green-dk); font-size: .75rem; padding: 2px 8px; border-radius: 20px; margin: 2px 4px 2px 0; }
.badge { font-size: .72rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.badge.est { background: #fdf3d8; color: var(--gold); }
.badge.ver { background: #e2f0e5; color: var(--green-dk); }
.steps { margin: 8px 0 0; padding-left: 20px; font-size: .92rem; color: #3a443a; }
.cost-lines { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.swap-btn { margin-top: 8px; font-size: .85rem; padding: 8px 12px; }

.checklist, .pricelist { list-style: none; padding: 0; margin: 8px 0; }
.checklist li, .pricelist li {
  background: var(--card); border-radius: 10px; padding: 12px 14px; margin: 6px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.checklist li.done { opacity: .45; text-decoration: line-through; }
.checklist .qty, .pricelist .qty { color: var(--muted); font-size: .85rem; }
.price-val { font-weight: 700; }
.pricelist li { cursor: pointer; }

fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #eee; padding: 8px 14px; border-radius: 20px; font-size: .9rem; }
.chip.on { background: var(--ink); color: #fff; }

.history-item { background: var(--card); border-radius: 10px; padding: 12px 14px; margin: 6px 0; display: flex; justify-content: space-between; align-items: center; }
