/* 6 Week Plan – dark "glass" theme with neon accents */
:root {
  --bg: #070b16;
  --bg-2: #0d1426;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --ink: #eef2fb;
  --muted: #8b95ab;
  --cyan: #22d3ee;
  --mint: #34d399;
  --grad: linear-gradient(135deg, #22d3ee 0%, #34d399 100%);
  --P: #60a5fa;
  --C: #fb923c;
  --V: #34d399;
  --F: #facc15;
  --danger: #fb7185;
  --radius: 20px;
  --tabs-h: 72px;
  --glow: 0 0 0 1px rgba(34, 211, 238, .35), 0 8px 30px -6px rgba(34, 211, 238, .45);
  font-size: 17px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(600px 400px at 85% -10%, rgba(34, 211, 238, .16), transparent 60%),
    radial-gradient(500px 400px at -10% 30%, rgba(52, 211, 153, .10), transparent 60%),
    radial-gradient(500px 500px at 110% 90%, rgba(96, 165, 250, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom));
}
h1, h2, h3, .title, .hero-ring b, .stat b { font-family: "Space Grotesk", Inter, sans-serif; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
::selection { background: rgba(34, 211, 238, .35); }

svg.i { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
svg.i.fill { fill: currentColor; }

/* utility */
.m0 { margin: 0; } .mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.mt6 { margin-top: 6px; } .mt8 { margin: 8px 0 0; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb10 { margin-bottom: 10px; } .mb12 { margin-bottom: 12px; }
.grow { flex: 1; } .fw5 { font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; align-items: center; gap: 10px; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.label { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 6px 0 8px; font-weight: 600; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(7, 11, 22, .72);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 28px; height: 28px; border-radius: 50%;
  background: conic-gradient(from -90deg, var(--cyan), var(--mint) 75%, rgba(255,255,255,.1) 75%);
  -webkit-mask: radial-gradient(circle, transparent 7px, #000 8px); mask: radial-gradient(circle, transparent 7px, #000 8px);
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, .6));
}
.topbar h1 { font-size: 1.3rem; margin: 0; font-weight: 700; }
#topbar-extra {
  font-size: .78rem; font-weight: 600; color: var(--cyan); text-align: right;
  background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .25);
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
#topbar-extra:empty { display: none; }

main { max-width: 720px; margin: 0 auto; padding: 16px 14px 24px; outline: none; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Floating tab bar ---------- */
.tabs {
  position: fixed; z-index: 20;
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
  display: flex; padding: 6px;
  background: rgba(16, 22, 40, .78);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--line-2); border-radius: 26px;
  box-shadow: 0 12px 40px -10px rgba(0, 0, 0, .7);
}
.tabs a {
  flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 58px; border-radius: 20px; color: var(--muted); font-size: .7rem; font-weight: 600; text-decoration: none;
  transition: color .2s, background .2s;
}
.tabs a .ico svg { width: 24px; height: 24px; }
.tabs a.active { color: var(--ink); background: rgba(34, 211, 238, .12); }
.tabs a.active .ico { color: var(--cyan); filter: drop-shadow(0 0 6px rgba(34, 211, 238, .8)); }
.badge {
  position: absolute; top: 4px; left: calc(50% + 6px);
  background: var(--grad); color: #04111a; border-radius: 10px; font-size: .66rem; font-weight: 800;
  min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; text-align: center;
  box-shadow: 0 0 10px rgba(34, 211, 238, .6);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.card h2 { font-size: 1.1rem; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.card h2 svg.i { color: var(--cyan); }
.card h3 { font-size: .8rem; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-family: Inter, sans-serif; }

/* ---------- Buttons ---------- */
.btn {
  border: 0; border-radius: 14px; padding: 12px 16px; min-height: 50px;
  background: var(--grad); color: #04111a; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  box-shadow: 0 6px 22px -8px rgba(34, 211, 238, .7);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn.secondary { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.secondary svg.i { color: var(--cyan); }
.btn.ghost { background: transparent; color: var(--cyan); box-shadow: inset 0 0 0 1.5px rgba(34, 211, 238, .5); }
.btn.danger { background: rgba(251, 113, 133, .12); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(251, 113, 133, .3); }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: .92rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; box-shadow: none; }
label.btn { cursor: pointer; }
.icon-btn {
  border: 0; background: transparent; width: 44px; height: 44px; border-radius: 14px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover, .icon-btn:active { background: var(--surface-2); color: var(--ink); }
.icon-btn.round { border-radius: 50%; background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn.tiny { width: 32px; height: 32px; }
.fav-btn svg.i { width: 24px; height: 24px; }
.fav-btn.on { color: var(--F); filter: drop-shadow(0 0 6px rgba(250, 204, 21, .6)); }

/* ---------- Inputs ---------- */
input[type=text], input[type=search], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 12px 14px; min-height: 50px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); border-radius: 14px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #67718a; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .2); }
select option { background: var(--bg-2); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* toggle switch */
.toggle-row { margin: 8px 0 14px; cursor: pointer; }
.toggle { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 999px; flex: none; position: relative; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .2s; cursor: pointer; margin: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #cfd6e4; transition: transform .2s, background .2s; }
.toggle:checked { background: var(--grad); }
.toggle:checked::after { transform: translateX(20px); background: #04111a; }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px;
  padding: 8px 16px; font-size: .9rem; font-weight: 600; color: var(--muted); min-height: 42px; transition: all .15s;
}
.chip.on { background: rgba(34, 211, 238, .14); border-color: rgba(34, 211, 238, .6); color: var(--ink); box-shadow: 0 0 14px -4px rgba(34, 211, 238, .7); }

/* portion pills */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 4px 11px; border: 1px solid currentColor; background: transparent; opacity: .9; }
.pill.P { color: var(--P); } .pill.C { color: var(--C); } .pill.V { color: var(--V); } .pill.F { color: var(--F); }
.pill.done { color: #04111a !important; opacity: 1; }
.pill.P.done { background: var(--P); border-color: var(--P); box-shadow: 0 0 12px -2px var(--P); }
.pill.C.done { background: var(--C); border-color: var(--C); box-shadow: 0 0 12px -2px var(--C); }
.pill.V.done { background: var(--V); border-color: var(--V); box-shadow: 0 0 12px -2px var(--V); }
.pill.F.done { background: var(--F); border-color: var(--F); box-shadow: 0 0 12px -2px var(--F); }
.dots { display: inline-flex; gap: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.P { background: var(--P); box-shadow: 0 0 6px var(--P); } .dot.C { background: var(--C); box-shadow: 0 0 6px var(--C); }
.dot.V { background: var(--V); box-shadow: 0 0 6px var(--V); } .dot.F { background: var(--F); box-shadow: 0 0 6px var(--F); }

/* ---------- Today ---------- */
.datebar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.datebar .date { flex: 1; text-align: center; font-weight: 700; font-family: "Space Grotesk", sans-serif; font-size: 1.1rem; }
.datebar .date small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; font-family: Inter, sans-serif; }

.hero { display: flex; align-items: center; gap: 18px; padding: 18px;
  background: linear-gradient(140deg, rgba(34, 211, 238, .12), rgba(52, 211, 153, .05) 60%, rgba(255,255,255,.03));
  border-color: rgba(34, 211, 238, .22); }
.hero-ring {
  --p: 0; width: 112px; height: 112px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(var(--cyan), var(--mint) calc(var(--p) * 1%), rgba(255, 255, 255, .08) 0);
  display: grid; place-items: center;
  filter: drop-shadow(0 0 14px rgba(34, 211, 238, .35));
}
.hero-ring > div { width: 88px; height: 88px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; align-content: center; text-align: center; }
.hero-ring b { font-size: 1.6rem; line-height: 1; }
.hero-ring small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }
.hero-stats { flex: 1; display: grid; gap: 8px; min-width: 0; }
.hs { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); }
.hs b { color: var(--ink); }
.mini-ring { --p: 0; --c: var(--cyan); width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.1) 0);
  -webkit-mask: radial-gradient(circle, transparent 6px, #000 7px); mask: radial-gradient(circle, transparent 6px, #000 7px); }
.r-meal { --c: var(--mint); } .r-shake { --c: var(--P); } .r-water { --c: var(--cyan); }
.next { font-size: .85rem; color: var(--cyan); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.next b { color: var(--ink); }

.meal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.meal-head h2 { margin: 0; flex: 1; }
.meal-ico {
  width: 42px; height: 42px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: rgba(34, 211, 238, .12); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .25);
}
.meal-ico svg.i { width: 22px; height: 22px; }
.meal-ico.breakfast { background: rgba(251, 146, 60, .12); color: var(--C); box-shadow: inset 0 0 0 1px rgba(251, 146, 60, .3); }
.meal-ico.lunch { background: rgba(52, 211, 153, .12); color: var(--mint); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .3); }
.meal-ico.dinner { background: rgba(167, 139, 250, .14); color: #a78bfa; box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .3); }
.meal-ico.shake-ico { background: rgba(96, 165, 250, .12); color: var(--P); box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .3); }
.done-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; color: var(--mint); background: rgba(52, 211, 153, .12); padding: 4px 10px; border-radius: 999px; }
.empty-meal { margin: 12px 0; padding: 12px; border: 1px dashed var(--line-2); border-radius: 14px; text-align: center; }

.entries { list-style: none; margin: 12px 0 10px; padding: 0; display: grid; gap: 8px; }
.entry { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 8px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.entry .name { flex: 1; min-width: 0; }
.entry .name a { color: var(--ink); font-weight: 600; }
.entry .name .sub { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.entry.is-done { opacity: .6; }
.entry.is-done .name a, .entry.is-done .name > span:first-child { text-decoration: line-through; }
.check {
  width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-2); background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: all .15s;
}
.check svg.i { width: 18px; height: 18px; }
.check:hover { border-color: var(--mint); color: rgba(52, 211, 153, .5); }
.check.on { background: var(--mint); border-color: var(--mint); color: #04111a; box-shadow: 0 0 14px -2px var(--mint); }
.meal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.shake { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.shake .info { flex: 1; min-width: 0; }
.shake .info b { display: block; font-family: "Space Grotesk", sans-serif; }
.shake.is-done { border-color: rgba(52, 211, 153, .35); }
.shake-btn { min-width: 112px; }

.water-bar { height: 10px; background: rgba(255,255,255,.08); border-radius: 6px; overflow: hidden; margin: 12px 0; }
.water-bar > div { height: 100%; background: linear-gradient(90deg, #3b82f6, var(--cyan)); border-radius: 6px; transition: width .3s; box-shadow: 0 0 12px var(--cyan); }
.meal-ico.water { width: 36px; height: 36px; border-radius: 12px; }

.notice { display: flex; gap: 10px; align-items: flex-start; background: rgba(250, 204, 21, .08); border: 1px solid rgba(250, 204, 21, .25); padding: 12px 14px; border-radius: 16px; margin-bottom: 14px; font-size: .92rem; }
.notice.green { background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .3); }
.notice svg.i { color: var(--F); margin-top: 1px; }
.notice.green svg.i { color: var(--mint); }

/* ---------- Recipes ---------- */
.searchbox { position: relative; margin-bottom: 12px; }
.searchbox svg.i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox input { padding-left: 44px; }
.recipe-list { display: grid; gap: 10px; }
@media (min-width: 560px) { .recipe-list { grid-template-columns: 1fr 1fr; } }
.recipe-card {
  position: relative; display: block; color: inherit; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 14px 20px;
  transition: border-color .15s, transform .12s, background .15s;
}
.recipe-card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.recipe-card.cat-fish::before { background: var(--P); box-shadow: 0 0 10px var(--P); }
.recipe-card.cat-veg::before { background: #a3e635; box-shadow: 0 0 10px #a3e635; }
.recipe-card.cat-side::before { background: var(--F); box-shadow: 0 0 10px var(--F); }
.recipe-card:hover { text-decoration: none; border-color: rgba(34, 211, 238, .4); background: rgba(255,255,255,.06); }
.recipe-card:active { transform: scale(.98); }
.recipe-card h3 { margin: 0 0 6px; font-size: 1.02rem; font-family: "Space Grotesk", sans-serif; display: flex; align-items: center; gap: 6px; }
.recipe-card .meta { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.meta .t { display: inline-flex; align-items: center; gap: 4px; }
.fav-star { color: var(--F); display: inline-flex; filter: drop-shadow(0 0 4px rgba(250, 204, 21, .6)); }

.recipe-detail h2.title { font-size: 1.5rem; margin: 0 0 6px; display: block; }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; }
.ing-list li:first-child { border-top: 0; }
.ing-list .q { min-width: 76px; font-weight: 700; color: var(--cyan); font-family: "Space Grotesk", sans-serif; }
.directions { white-space: pre-line; margin: 0; color: #d3d9e6; }
.stepper { display: inline-flex; align-items: center; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.stepper button { border: 0; background: transparent; width: 46px; height: 46px; font-size: 1.3rem; font-weight: 700; color: var(--cyan); }
.stepper span { min-width: 30px; text-align: center; font-weight: 700; font-family: "Space Grotesk", sans-serif; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; margin-bottom: 10px; min-height: 40px; }
.portion-box { background: rgba(34, 211, 238, .07); border: 1px solid rgba(34, 211, 238, .2); border-radius: 16px; padding: 12px 14px; font-size: .9rem; }

/* ---------- Shopping ---------- */
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px; border-radius: 16px; min-height: 60px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); transition: border-color .15s;
}
.tile:hover { border-color: rgba(34, 211, 238, .4); }
.tile svg.i { width: 26px; height: 26px; color: var(--cyan); }
.tile b { display: block; font-size: .92rem; }
.tile small { color: var(--muted); font-size: .76rem; }
.shop-group h3 { margin: 20px 6px 8px; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.shop-list { list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.shop-item { display: flex; align-items: center; gap: 6px; padding: 6px 2px 6px 8px; border-top: 1px solid var(--line); min-height: 58px; }
.shop-item:first-child { border-top: 0; }
.shop-item .tap { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; background: none; border: 0; text-align: left; padding: 4px 0; }
.shop-item .name { flex: 1; min-width: 0; font-weight: 500; }
.shop-item .name small { display: block; color: var(--muted); font-size: .76rem; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-item .qty { font-weight: 700; color: var(--cyan); white-space: nowrap; font-family: "Space Grotesk", sans-serif; }
.shop-item.done { opacity: .5; }
.shop-item.done .name, .shop-item.done .qty { text-decoration: line-through; }

/* ---------- Progress ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; margin-bottom: 8px; }
.stat { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 16px; padding: 12px 4px; }
.stat b { display: block; font-size: 1.5rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat b.up { background: none; color: var(--danger); }
.stat span { font-size: .72rem; color: var(--muted); }
.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
table.log { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.log th, table.log td { padding: 9px 4px; border-top: 1px solid var(--line); text-align: right; }
table.log th:first-child, table.log td:first-child { text-align: left; }
table.log th { font-size: .7rem; color: var(--muted); border-top: 0; text-transform: uppercase; letter-spacing: .08em; }
.down { color: var(--mint); font-weight: 700; }
.up { color: var(--danger); font-weight: 700; }
.portion-row { margin: 8px 0; }
.portion-row b { width: 86px; flex: none; font-weight: 600; }

/* ---------- Food list ---------- */
.verdict { padding: 12px 14px; border-radius: 16px; font-weight: 600; margin-bottom: 12px; }
.verdict .rules, .verdict .small { font-weight: 500; margin-top: 6px; }
.verdict.yes { background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .35); color: var(--mint); }
.verdict.no { background: rgba(251, 113, 133, .1); border: 1px solid rgba(251, 113, 133, .35); color: var(--danger); }
.food-list { list-style: none; margin: 0; padding: 0; }
.food-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); min-height: 50px; }
.food-list li:first-child { border-top: 0; }
.food-list .n { flex: 1; }
.food-list .p { font-size: .8rem; color: var(--muted); text-align: right; }
.tag { font-size: .66rem; background: rgba(163, 230, 53, .12); color: #a3e635; padding: 2px 7px; border-radius: 999px; font-weight: 700; margin-left: 6px; }
.sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.sw.P { background: var(--P); box-shadow: 0 0 8px var(--P); } .sw.C { background: var(--C); box-shadow: 0 0 8px var(--C); }
.sw.V { background: var(--V); box-shadow: 0 0 8px var(--V); } .sw.F { background: var(--F); box-shadow: 0 0 8px var(--F); }
ul.rules { margin: 0; padding-left: 20px; }
ul.rules li { margin: 5px 0; }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(2, 4, 10, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 40; animation: fadein .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-width: 720px; margin: 0 auto;
  background: linear-gradient(180deg, #121a30, #0b1122);
  border: 1px solid var(--line-2); border-bottom: 0; border-radius: 26px 26px 0 0;
  max-height: 86vh; overflow-y: auto; padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px -10px rgba(0, 0, 0, .7); animation: up .25s cubic-bezier(.2, .9, .3, 1);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 6px auto 14px; }
.sheet h2 { margin: 0 0 12px; font-size: 1.25rem; }
.sheet .opt-list { list-style: none; margin: 10px 0 12px; padding: 0; }
.sheet .opt-list button {
  width: 100%; text-align: left; border: 0; background: none; padding: 12px 6px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center; min-height: 52px; border-radius: 10px;
}
.sheet .opt-list button:hover { background: var(--surface); }
.sheet .opt-list li:first-child button { border-top: 0; }
.sheet .opt-list button .p { margin-left: auto; color: var(--muted); font-size: .8rem; text-align: right; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px 4px; font-weight: 700; min-height: 44px; border-radius: 10px; color: var(--muted); }
.seg button.on { background: var(--grad); color: #04111a; box-shadow: 0 4px 14px -4px rgba(34, 211, 238, .7); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 26px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: rgba(20, 28, 50, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(34, 211, 238, .35); color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-size: .9rem; font-weight: 500; z-index: 60;
  transition: opacity .2s, transform .2s; max-width: 90vw; text-align: center; box-shadow: var(--glow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { text-align: center; color: var(--muted); padding: 36px 10px; }
.empty .big { display: block; margin-bottom: 10px; color: var(--cyan); }
.empty .big svg.i { width: 44px; height: 44px; filter: drop-shadow(0 0 10px rgba(34, 211, 238, .5)); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media print {
  .tabs, .topbar, .no-print { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card, .shop-list { background: #fff; border-color: #ccc; }
  .shop-item .qty { color: #000; }
}


/* =========================================================
   WILLCO START-UP ANIMATION (from Willco Home Organiser)
   About 2.5 seconds; tap to skip. app.js adds .done when ready.
   If anything goes wrong it fades out on its own after 6 seconds.
   ========================================================= */
.boot {
  --cyan: #22d3ee; --violet: #8b5cf6; --magenta: #f472b6; --lime: #a3e635; --muted: #8b91b8;
  --neon: linear-gradient(120deg, #22d3ee 0%, #8b5cf6 55%, #f472b6 100%);
  --display: "Orbitron", "Space Grotesk", system-ui, sans-serif;
  --heading: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.boot {
  color: #e8ecff;
  position: fixed; inset: 0;
  z-index: 200;
  background: radial-gradient(ellipse at 50% 45%, #10143a 0%, #05060f 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  overflow: hidden;
  cursor: pointer;
  animation: boot-failsafe 0.6s 6s forwards;
}
.boot.done { animation: boot-out 0.7s cubic-bezier(.6,0,.2,1) forwards; pointer-events: none; }
@keyframes boot-out { to { opacity: 0; transform: scale(1.08); filter: blur(6px); visibility: hidden; } }
@keyframes boot-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

.boot-grid {
  position: absolute; inset: -50%;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.12) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(62deg) translateY(10%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 15%, transparent 60%);
  opacity: 0;
  animation: boot-grid-in 1s 0.1s ease-out forwards, gridmove 3s linear infinite;
}
@keyframes boot-grid-in { to { opacity: 1; } }

/* Logo with spinning neon rings */
.boot-core { position: relative; width: 190px; height: 190px; display: grid; place-items: center; margin-bottom: 18px; }
.ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  opacity: 0;
}
.r1 { border-top-color: var(--cyan); border-bottom-color: var(--cyan); filter: drop-shadow(0 0 8px var(--cyan));
      animation: ring-in 0.6s 0.15s ease-out forwards, spin 2.2s 0.15s linear infinite; }
.r2 { inset: 18px; border-left-color: var(--violet); border-right-color: var(--violet); filter: drop-shadow(0 0 8px var(--violet));
      animation: ring-in 0.6s 0.3s ease-out forwards, spin 1.6s 0.3s linear infinite reverse; }
.r3 { inset: 36px; border-top-color: var(--magenta); filter: drop-shadow(0 0 8px var(--magenta));
      animation: ring-in 0.6s 0.45s ease-out forwards, spin 1.1s 0.45s linear infinite; }
@keyframes ring-in { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; } }
@keyframes spin { to { rotate: 360deg; } }

.boot-logo {
  width: 86px; height: 86px;
  border-radius: 26px;
  background: var(--neon);
  color: #05060f;
  font: 800 2.6rem var(--display);
  display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.3) inset, 0 0 40px rgba(139, 92, 246, 0.8), 0 0 90px rgba(34, 211, 238, 0.45);
  opacity: 0;
  animation: logo-pop 0.7s 0.45s cubic-bezier(.3,1.6,.5,1) forwards, logo-glow 1.6s 1.2s ease-in-out infinite;
}
@keyframes logo-pop { from { opacity: 0; transform: scale(0) rotate(-30deg); } to { opacity: 1; transform: none; } }
@keyframes logo-glow { 50% { box-shadow: 0 0 0 1px rgba(255,255,255,0.3) inset, 0 0 60px rgba(34, 211, 238, 0.9), 0 0 120px rgba(244, 114, 182, 0.5); } }

/* WILLCO, letter by letter */
.boot-title { margin: 0; display: flex; gap: 0.08em; font: 800 3.4rem var(--display); letter-spacing: 0.12em; }
.boot-title span {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff, #9fb2ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 16px rgba(34, 211, 238, 0.55));
  opacity: 0;
  animation: letter-in 0.5s calc(0.8s + var(--i) * 0.08s) cubic-bezier(.2,.9,.3,1.2) forwards;
}
@keyframes letter-in {
  0%   { opacity: 0; transform: translateY(-28px) scale(1.4); filter: blur(10px); }
  60%  { opacity: 1; transform: translateY(3px); filter: blur(0) drop-shadow(0 0 22px var(--magenta)); }
  80%  { transform: translateX(-2px); }
  100% { opacity: 1; transform: none; filter: drop-shadow(0 0 16px rgba(34, 211, 238, 0.55)); }
}
.boot-sub {
  margin: 0;
  font: 600 1rem var(--heading);
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.9em;
  padding-left: 0.9em;
  opacity: 0;
  animation: sub-in 0.8s 1.35s ease-out forwards;
}
@keyframes sub-in { from { opacity: 0; letter-spacing: 1.6em; } to { opacity: 0.9; letter-spacing: 0.5em; } }

/* Loading bar and status lines */
.boot-bar {
  width: min(320px, 70vw); height: 4px;
  margin-top: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.boot-bar i {
  display: block; height: 100%; width: 0;
  background: var(--neon);
  box-shadow: 0 0 12px var(--cyan);
  animation: bar 1.9s 0.4s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes bar { 30% { width: 35%; } 60% { width: 62%; } to { width: 100%; } }
.boot-status { position: relative; height: 1.4em; width: 300px; margin: 10px 0 0; font: 500 0.85rem var(--body); color: var(--muted); text-align: center; }
.boot-status span { position: absolute; inset: 0; opacity: 0; }
.boot-status span:nth-child(1) { animation: status 0.55s 0.4s both; }
.boot-status span:nth-child(2) { animation: status 0.55s 0.95s both; }
.boot-status span:nth-child(3) { animation: status 0.55s 1.5s both; }
.boot-status span:nth-child(4) { animation: status-last 0.4s 2.05s forwards; color: var(--lime); }
@keyframes status { 0% { opacity: 0; transform: translateY(6px); } 20%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes status-last { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .boot-core { width: 150px; height: 150px; }
  .boot-logo { width: 70px; height: 70px; font-size: 2.1rem; }
  .boot-title { font-size: 2.4rem; }
  .boot-sub { font-size: 0.8rem; }
}
/* With reduced motion the start-up screen is skipped straight away */
@media (prefers-reduced-motion: reduce) { .boot { display: none; } }

@keyframes gridmove { to { background-position: 0 48px, 48px 0; } }
