/* Bowlie comic look: white paper, ink outlines, hard offset shadows,
   bright accents for actions and pastels for the mascot and dishes. */

@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --ink: #2b2541;
  --ink-2: #554f6d;
  --muted: #847f9b;
  --line: #ebe8f3;
  --bg: #ffffff;
  --soft: #faf9fd;

  --coral: #ff7465;
  --sun: #ffc93f;
  --mint: #35d3a0;
  --sky: #5aafff;
  --grape: #a284ff;

  --pink-p: #ffdbe8;
  --mint-p: #d3f5e6;
  --sun-p: #fff1bf;
  --lav-p: #e8dfff;
  --sky-p: #d9ecff;
  --peach-p: #ffe4d2;

  --r-lg: 26px;
  --r: 18px;
  --r-sm: 12px;
  --bw: 2.5px;
  --sh: 4px 4px 0 var(--ink);
  --sh-sm: 2px 2px 0 var(--ink);
  --sh-lg: 6px 6px 0 var(--ink);

  --display: "Fredoka", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  --tabbar: 0px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 500 16px/1.55 var(--body); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.has-modal { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 5vw, 44px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */

.page { max-width: 1160px; margin: 0 auto; padding: 28px var(--gutter) 48px; }
.view { animation: view-in .35s ease both; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 20px; align-content: start; }
.center { text-align: center; justify-content: center; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.eyebrow { display: inline-block; font: 700 13px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }

.boot { min-height: 70vh; display: flex; gap: 10px; align-items: center; justify-content: center; }
.boot-dot { width: 14px; height: 14px; border-radius: 50%; border: var(--bw) solid var(--ink); background: var(--sun); animation: hop .9s ease-in-out infinite; }
.boot-dot:nth-child(2) { background: var(--coral); animation-delay: .15s; }
.boot-dot:nth-child(3) { background: var(--mint); animation-delay: .3s; }
.noscript { padding: 40px; text-align: center; }

/* ---------- top bar & tab bar ---------- */

.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: var(--bw) solid var(--ink); }
.topbar-in { max-width: 1160px; margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand .mascot { width: 46px; height: auto; }
.brand-word { font: 700 26px/1 var(--display); letter-spacing: -.02em; }
.topnav { margin-left: auto; display: flex; gap: 6px; }
.navlink {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  font-weight: 800; text-decoration: none; border: var(--bw) solid transparent; color: var(--ink-2);
}
.navlink svg { width: 20px; height: 20px; }
.navlink:hover { color: var(--ink); background: var(--soft); }
.navlink.is-active { color: var(--ink); background: var(--sun-p); border-color: var(--ink); box-shadow: var(--sh-sm); }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; }

.tabbar { display: none; }

@media (max-width: 860px) {
  :root { --tabbar: 74px; }
  .topnav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; inset: auto 0 0 0; z-index: 30;
    background: #fff; border-top: var(--bw) solid var(--ink); padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar .navlink { flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 4px; border-radius: 14px; justify-content: center; }
  .tabbar .navlink.is-active { box-shadow: none; }
  .page { padding-top: 20px; }
}

/* ---------- buttons, chips, pills ---------- */

.btn {
  --btn-bg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; min-height: 46px; border-radius: 999px; cursor: pointer;
  font: 600 16px/1.1 var(--display); letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  background: var(--btn-bg); color: var(--ink); border: var(--bw) solid var(--ink); box-shadow: var(--sh);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { filter: brightness(1.04) saturate(1.05); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: var(--sh-sm); }
.btn-coral { --btn-bg: var(--coral); }
.btn-sun { --btn-bg: var(--sun); }
.btn-mint { --btn-bg: var(--mint); }
.btn-sky { --btn-bg: var(--sky); }
.btn-grape { --btn-bg: var(--grape); }
.btn-white { --btn-bg: #fff; }
.btn-danger { --btn-bg: #ffe0dc; color: #b42318; }
.btn-lg { padding: 14px 24px; min-height: 54px; font-size: 18px; }
.btn-sm { padding: 7px 13px; min-height: 36px; font-size: 14px; box-shadow: var(--sh-sm); }
.btn-sm:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--ink); }

.icon-btn {
  width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: #fff; border: var(--bw) solid var(--ink); box-shadow: var(--sh-sm); transition: transform .08s, box-shadow .08s, background .15s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--sun-p); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 999px; cursor: pointer;
  background: #fff; border: var(--bw) solid var(--ink); font-weight: 800; font-size: 15px; transition: transform .08s, background .15s, box-shadow .08s;
}
.chip:hover { background: var(--soft); }
.chip[aria-pressed="true"] { background: var(--mint-p); box-shadow: var(--sh-sm); }
.chip[aria-pressed="true"]::before { content: "✓"; font-weight: 900; }
.chip:active { transform: translate(1px, 1px); }
.chips-days .chip { min-width: 54px; justify-content: center; }
.chips-days .chip[aria-pressed="true"]::before { content: none; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; text-decoration: none;
  font-weight: 800; font-size: 14px; background: var(--soft); border: 2px solid var(--line);
}
.pill svg { width: 17px; height: 17px; }
a.pill:hover { border-color: var(--ink); }
.pill-mint { background: var(--mint-p); border-color: var(--ink); }

/* ---------- cards, bubbles, bursts ---------- */

.card { background: #fff; border: var(--bw) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--sh); padding: 24px; }
.halftone { background-image: radial-gradient(rgba(43, 37, 65, .11) 1.3px, transparent 1.7px); background-size: 13px 13px; }

.bubble {
  position: relative; background: #fff; border: var(--bw) solid var(--ink); border-radius: 20px; box-shadow: var(--sh-sm);
  padding: 12px 16px; font-weight: 700; line-height: 1.4; max-width: 340px;
}
.bubble::after {
  content: ""; position: absolute; width: 16px; height: 16px; background: #fff;
  border-left: var(--bw) solid var(--ink); border-bottom: var(--bw) solid var(--ink);
}
.bubble-left::after { left: -10px; top: 50%; margin-top: -8px; transform: rotate(45deg); }
.bubble-bottom::after { left: 50%; bottom: -10px; margin-left: -8px; transform: rotate(-45deg); }

.burst { position: relative; display: inline-grid; place-items: center; width: 92px; height: 92px; flex: none; }
.burst::before, .burst::after {
  content: ""; position: absolute; inset: 0;
  clip-path: polygon(50% 0%, 61% 18%, 82% 9%, 79% 31%, 100% 38%, 84% 53%, 97% 72%, 75% 74%, 70% 96%, 52% 83%, 33% 98%, 27% 76%, 4% 76%, 15% 56%, 0% 39%, 21% 31%, 17% 9%, 39% 18%);
}
.burst::before { background: var(--ink); }
.burst::after { inset: 4px; background: var(--sun); }
.burst > span { position: relative; z-index: 1; font: 700 15px/1.05 var(--display); text-align: center; transform: rotate(-8deg); }
.burst b { display: block; font-size: 1.9em; line-height: .95; }
.burst-coral::after { background: var(--coral); }
.burst-mint::after { background: var(--mint); }
.burst-sm { width: 64px; height: 64px; }
.burst-sm > span { font-size: 12px; }

/* ---------- mascot ---------- */

.mascot { overflow: visible; }
.mascot .m-body { animation: bob 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.mascot.is-waving .m-arm-l { animation: wave 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 100% 100%; }
.mascot.is-stirring .m-right { animation: stir 1s ease-in-out infinite; transform-box: fill-box; transform-origin: 0% 92%; }
.mascot .m-eyes { animation: blink 5s infinite; transform-box: fill-box; transform-origin: 50% 50%; }

/* ---------- forms ---------- */

.field { display: grid; gap: 7px; }
.label { font-weight: 800; font-size: 15px; }
.input {
  width: 100%; padding: 13px 16px; border-radius: 14px; background: #fff; font-weight: 600;
  border: var(--bw) solid var(--ink); box-shadow: inset 0 0 0 0 transparent; transition: box-shadow .15s;
}
.input::placeholder { color: #aaa6bd; }
.input:focus { outline: none; box-shadow: var(--sh-sm); background: #fffef7; }
.input:disabled { background: var(--soft); color: var(--muted); border-color: var(--line); }
.input.is-invalid { border-color: #d92d20; background: #fff7f6; }
.field-error { color: #b42318; font-weight: 700; font-size: 14px; }
.form-error { background: #fff1ef; border: 2px solid #f3a59c; color: #9b1c12; padding: 10px 14px; border-radius: 12px; font-weight: 700; }
.hint { color: var(--muted); font-size: 14px; font-weight: 600; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; font-weight: 800; font-size: 13px; cursor: pointer; padding: 6px 8px; color: var(--ink-2); }

.stepper { display: flex; align-items: center; gap: 18px; }
.stepper-value { min-width: 92px; text-align: center; }
.stepper-value .big { display: block; font: 700 54px/1 var(--display); }
.stepper-value .small { font-weight: 800; color: var(--ink-2); }
.btn-round { width: 56px; height: 56px; border-radius: 50%; font: 700 30px/1 var(--display); padding: 0; min-height: 0; }
.people-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; margin-top: 14px; }
.people-row svg { width: 38px; height: 38px; animation: pop .3s ease both; }

.kcal-value { font: 700 46px/1 var(--display); }
.kcal-value small { font: 800 15px/1 var(--body); color: var(--ink-2); margin-left: 4px; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 18px 0; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 14px; border-radius: 99px; border: var(--bw) solid var(--ink); background: linear-gradient(90deg, var(--coral) 0 var(--fill, 40%), #fff var(--fill, 40%)); }
.range::-moz-range-track { height: 9px; border-radius: 99px; border: var(--bw) solid var(--ink); background: #fff; }
.range::-moz-range-progress { height: 9px; border-radius: 99px; background: var(--coral); border: var(--bw) solid var(--ink); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 50%; background: var(--sun); border: var(--bw) solid var(--ink); box-shadow: var(--sh-sm); }
.range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--sun); border: var(--bw) solid var(--ink); box-shadow: var(--sh-sm); }
.chip[data-kcal-preset] small { font-weight: 700; color: var(--ink-2); }

/* Choice cards: rows on narrow forms, three columns when there is room. */
.choices-wrap { container-type: inline-size; }
.choices { display: grid; gap: 12px; padding: 6px 9px 0 0; }
.choice {
  position: relative; display: grid; grid-template-columns: 80px 1fr; grid-template-areas: "emoji title" "emoji text";
  align-items: center; column-gap: 10px; padding: 11px 14px 11px 8px; border-radius: var(--r); cursor: pointer; text-align: left;
  background: #fff; border: var(--bw) solid var(--ink); transition: transform .08s, background .15s, box-shadow .08s;
}
.choice:hover { background: var(--soft); }
.choice:active { transform: translate(1px, 1px); }
.choice[aria-checked="true"] { background: var(--mint-p); box-shadow: var(--sh-sm); }
.choice[aria-checked="true"]::after {
  content: "✓"; position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; background: var(--sun); border: 2px solid var(--ink); font-weight: 900; font-size: 14px; animation: pop .25s ease both;
}
.choice-emoji { grid-area: emoji; justify-self: center; font-size: 20px; line-height: 1; letter-spacing: -2px; white-space: nowrap; }
.choice-title { grid-area: title; font: 700 18px/1.15 var(--display); }
.choice-text { grid-area: text; font-size: 13px; font-weight: 700; color: var(--ink-2); line-height: 1.3; }
@container (min-width: 470px) {
  .choices { grid-template-columns: repeat(3, 1fr); }
  .choice {
    grid-template-columns: 1fr; grid-template-areas: "emoji" "title" "text"; align-content: start; justify-items: center;
    text-align: center; row-gap: 5px; padding: 14px 8px 12px;
  }
  .choice-emoji { font-size: 26px; margin-bottom: 2px; }
}

/* ---------- landing ---------- */

.landing { display: grid; gap: 64px; padding-bottom: 24px; }
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center;
  border: var(--bw) solid var(--ink); border-radius: 34px; box-shadow: var(--sh-lg); padding: clamp(24px, 5vw, 56px); position: relative; overflow: hidden;
}
.hero-copy { display: grid; gap: 22px; justify-items: start; position: relative; z-index: 1; }
.hero-title { font-size: clamp(38px, 6.4vw, 66px); font-weight: 700; }
.hero-title .hl { background: linear-gradient(transparent 58%, var(--sun) 58% 90%, transparent 90%); padding: 0 4px; }
.lead { font-size: 19px; color: var(--ink-2); max-width: 540px; font-weight: 600; }
.hero-art { display: grid; justify-items: center; gap: 14px; position: relative; }
.hero-art .mascot { width: min(320px, 70vw); height: auto; }
.hero-art .burst { position: absolute; right: 0; bottom: 2%; transform: rotate(10deg); width: 136px; height: 136px; }
.hero-art .burst > span { font-size: 14px; }
.hero-blob { position: absolute; width: 380px; height: 380px; border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%; background: var(--pink-p); right: -60px; bottom: -80px; }
.hero-blob.b2 { width: 180px; height: 180px; background: var(--mint-p); left: 44%; top: -60px; }

.section-head { display: grid; gap: 8px; text-align: center; justify-items: center; margin-bottom: 26px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 22px; }
.feature { display: grid; gap: 10px; align-content: start; }
.feature-icon { width: 64px; height: 64px; display: grid; place-items: center; font-size: 32px; border-radius: 22px; border: var(--bw) solid var(--ink); }
.feature p { color: var(--ink-2); font-weight: 600; }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 22px; counter-reset: how; padding: 0; margin: 0; list-style: none; }
.how li { counter-increment: how; display: grid; gap: 8px; padding-top: 6px; }
.how li::before {
  content: counter(how); width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  font: 700 22px/1 var(--display); background: var(--sun); border: var(--bw) solid var(--ink); box-shadow: var(--sh-sm);
}
.how p { color: var(--ink-2); font-weight: 600; }
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; background: var(--mint-p); }
.cta-band .mascot { width: 110px; height: auto; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero-art { order: -1; }
  .hero-art .mascot { width: 220px; }
  .hero-art .burst { right: 0; bottom: 0; width: 112px; height: 112px; }
  .hero-art .burst > span { font-size: 11.5px; }
  .day-card .burst-sm { right: -8px; }
}

/* ---------- auth & wizard ---------- */

.auth { max-width: 560px; margin: 8px auto 0; display: grid; gap: 20px; }
.auth-top { display: flex; align-items: center; justify-content: center; gap: 16px; }
.auth-top .mascot { width: 128px; height: auto; flex: none; }
.auth-card { display: grid; gap: 18px; }
.auth-card h1 { font-size: 32px; }
.wizard-steps { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.wizard-steps li { flex: 1; height: 10px; border-radius: 99px; border: 2px solid var(--ink); background: #fff; transition: background .3s; }
.wizard-steps li.is-done { background: var(--mint); }
.wizard-steps li.is-current { background: var(--sun); }
.wizard-body { display: grid; gap: 18px; animation: step-in .3s ease both; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; }
.wizard-actions .btn:last-child { margin-left: auto; }
.cooking { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; }
.cooking .mascot { width: 210px; height: auto; }
.dots { display: flex; gap: 8px; }
.dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--coral); border: 2px solid var(--ink); animation: hop .9s ease-in-out infinite; }
.dots span:nth-child(2) { background: var(--sun); animation-delay: .15s; }
.dots span:nth-child(3) { background: var(--mint); animation-delay: .3s; }

/* ---------- plan ---------- */

.plan-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.plan-title { display: grid; gap: 10px; }
.week-nav { display: flex; align-items: center; gap: 10px; }
.week-label { font: 600 19px/1.2 var(--display); min-width: 190px; text-align: center; }
.plan-mascot { display: flex; align-items: center; gap: 14px; }
.plan-mascot .mascot { width: 106px; height: auto; flex: none; }
.plan-mascot .bubble { max-width: 300px; font-size: 15px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 26px; }

.days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 22px; }
.day-card { padding: 0; overflow: visible; display: flex; flex-direction: column; animation: card-in .45s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: calc(var(--i, 0) * 55ms); }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; position: relative; }
.day-name { display: inline-block; padding: 5px 13px; border-radius: 12px; border: 2px solid var(--ink); font-size: 18px; background: var(--tint, var(--sun-p)); }
.day-date { margin-left: 8px; font-weight: 800; color: var(--muted); font-size: 14px; }
.day-card.is-today { box-shadow: var(--sh-lg); }
.day-card .burst-sm { position: absolute; right: -14px; top: -20px; transform: rotate(12deg); }
.tint-0 { --tint: var(--pink-p); } .tint-1 { --tint: var(--mint-p); } .tint-2 { --tint: var(--sun-p); } .tint-3 { --tint: var(--lav-p); }
.tint-4 { --tint: var(--sky-p); } .tint-5 { --tint: var(--peach-p); } .tint-6 { --tint: var(--pink-p); }

.meal { position: relative; padding: 10px 14px 14px; }
.meal + .meal { border-top: 2px dashed var(--line); }
.meal-slot { font-weight: 800; font-size: 13px; color: var(--ink-2); margin: 0 0 6px 4px; }
.meal-row { display: flex; align-items: center; gap: 10px; }
.dish {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; text-align: left; padding: 8px; margin: -2px 0;
  background: none; border: 2px solid transparent; border-radius: 18px; cursor: pointer; transition: background .15s, border-color .15s;
}
.dish:hover { background: var(--soft); border-color: var(--line); }
.dish-emoji {
  width: 66px; height: 66px; flex: none; display: grid; place-items: center; font-size: 34px;
  border: var(--bw) solid var(--ink); border-radius: 42% 58% 55% 45% / 50% 44% 56% 50%; background: var(--peach-p);
}
.dish-text { min-width: 0; display: grid; gap: 2px; }
.dish-name { font: 600 18px/1.15 var(--display); }
.dish-sub { color: var(--ink-2); font-weight: 600; font-size: 14px; line-height: 1.3; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 5px; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.meta > span { display: inline-flex; align-items: center; gap: 4px; }
.meta svg { width: 15px; height: 15px; }
.tag { padding: 1px 8px; border-radius: 99px; background: var(--soft); border: 1.5px solid var(--line); }
.c-peach { background: var(--peach-p); } .c-mint { background: var(--mint-p); } .c-sun { background: var(--sun-p); }
.c-pink { background: var(--pink-p); } .c-lav { background: var(--lav-p); } .c-sky { background: var(--sky-p); }
.dice-btn:hover { background: var(--sun); }
.dice-btn:hover svg { animation: wiggle .5s ease; }
.meal.is-rolling .dish { animation: shake .45s ease infinite; }
.meal.is-rolling .dice-btn svg { animation: roll .55s linear infinite; }
.meal.is-new .dish { animation: flip-in .5s cubic-bezier(.2, .9, .3, 1.4) both; }
.pow {
  position: absolute; right: 64px; top: 4px; pointer-events: none; font: 700 18px/1 var(--display); color: var(--ink);
  background: var(--sun); border: 2px solid var(--ink); border-radius: 10px; padding: 4px 9px; transform: rotate(-8deg);
  animation: pow 1.1s ease forwards;
}

.empty { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 40px 24px; max-width: 560px; margin: 20px auto; }
.empty .mascot { width: 150px; height: auto; }
.empty p { color: var(--ink-2); font-weight: 600; }

.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 22px; }
.skeleton { height: 190px; border-radius: var(--r-lg); border: var(--bw) solid var(--line); background: linear-gradient(100deg, var(--soft) 30%, #fff 50%, var(--soft) 70%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }

/* ---------- modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(43, 37, 65, .42); animation: fade-in .18s ease both; overflow-y: auto;
}
.modal-backdrop.is-leaving { animation: fade-out .18s ease both; }
.modal {
  position: relative; width: min(720px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: #fff;
  border: var(--bw) solid var(--ink); border-radius: 28px; box-shadow: var(--sh-lg); animation: modal-in .3s cubic-bezier(.2, .9, .3, 1.3) both;
}
.modal:focus { outline: none; }
.modal-sm { width: min(440px, 100%); }
.modal-close { position: absolute; right: 14px; top: 14px; z-index: 2; }
.modal-pad { padding: 28px; }
.modal-loading { padding: 50px 24px; display: grid; justify-items: center; gap: 12px; font-weight: 700; color: var(--ink-2); }
.modal-loading .mascot { width: 110px; height: auto; }

.recipe-head { display: flex; gap: 20px; align-items: center; padding: 28px 70px 26px 28px; border-bottom: var(--bw) solid var(--ink); border-radius: 26px 26px 0 0; }
.recipe-emoji { width: 104px; height: 104px; flex: none; display: grid; place-items: center; font-size: 56px; background: #fff; border: var(--bw) solid var(--ink); border-radius: 44% 56% 52% 48% / 52% 46% 54% 48%; box-shadow: var(--sh-sm); }
.recipe-head h2 { font-size: clamp(24px, 4vw, 32px); margin: 4px 0; }
.recipe-head p { color: var(--ink-2); font-weight: 700; }
.recipe-body { display: grid; grid-template-columns: 1fr 1.25fr; gap: 28px; padding: 26px 28px 8px; }
.recipe-body h3 { margin-bottom: 12px; font-size: 20px; }
.ing-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ing-list li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 2px dotted var(--line); font-weight: 600; }
.ing-list b { min-width: 74px; font-weight: 900; }
.step-list { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.step-list li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; gap: 12px; font-weight: 600; }
.step-list li::before {
  content: counter(step); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  background: var(--sun); border: 2px solid var(--ink); font: 700 16px/1 var(--display);
}
.recipe-foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 18px 28px 26px; }
@media (max-width: 640px) {
  .recipe-body { grid-template-columns: 1fr; }
  .recipe-head { flex-direction: column; align-items: flex-start; padding: 24px 22px 20px; }
  .recipe-emoji { width: 84px; height: 84px; font-size: 44px; }
  .recipe-body, .recipe-foot { padding-left: 22px; padding-right: 22px; }
}

.confirm { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 30px 26px 26px; }
.confirm .mascot { width: 100px; height: auto; }
.confirm p { color: var(--ink-2); font-weight: 600; }
.confirm .row { margin-top: 8px; }

/* ---------- shopping ---------- */

.shop-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 22px; }
.shop-head h1 { margin: 6px 0 4px; }
.progress-wrap { display: grid; gap: 6px; min-width: min(320px, 100%); }
.progress { height: 20px; border-radius: 99px; border: var(--bw) solid var(--ink); background: #fff; overflow: hidden; }
.progress > span {
  display: block; height: 100%; width: 0; background: var(--mint); border-right: var(--bw) solid var(--ink); transition: width .4s ease;
  background-image: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(255, 255, 255, .35) 8px 16px);
}
.progress > span[data-full] { border-right: 0; }
.progress-label { font-weight: 800; font-size: 14px; color: var(--ink-2); text-align: right; }

.order-card { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; background: var(--sun-p); margin-bottom: 18px; }
.order-card .mascot { width: 92px; height: auto; }
.order-copy p { color: var(--ink-2); font-weight: 600; margin-top: 4px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
@media (max-width: 860px) {
  .order-card { grid-template-columns: auto 1fr; }
  .order-actions { grid-column: 1 / -1; justify-content: stretch; }
  .order-actions .btn { flex: 1 1 220px; }
}
@media (max-width: 460px) { .topbar-actions .btn-coral { display: none; } }
@media (max-width: 420px) { .order-card .mascot { width: 70px; } }

.shop-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.groups { columns: 2 360px; column-gap: 22px; }
.group { break-inside: avoid; margin-bottom: 22px; padding: 18px 18px 10px; }
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.group-emoji { font-size: 24px; }
.group-head h2 { font-size: 19px; flex: 1; }
.count { min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center; border-radius: 99px; background: var(--soft); border: 2px solid var(--line); font-weight: 900; font-size: 13px; }
.count.is-zero { background: var(--mint-p); border-color: var(--ink); }
.group-pantry { border-style: dashed; box-shadow: none; background: var(--soft); }
.group-pantry .hint { margin: 0 0 8px; }
.items { list-style: none; margin: 0; padding: 0; }
.item + .item { border-top: 2px dotted var(--line); }
.item-label { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 2px; cursor: pointer; }
.check {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin: 0; cursor: pointer; flex: none; display: grid; place-items: center;
  border: var(--bw) solid var(--ink); border-radius: 8px; background: #fff; transition: background .15s, transform .1s;
}
.check::after { content: ""; width: 12px; height: 7px; border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(-45deg) scale(0); margin-top: -3px; transition: transform .15s cubic-bezier(.2, .9, .3, 1.5); }
.check:checked { background: var(--mint); }
.check:checked::after { transform: rotate(-45deg) scale(1); }
.check:active { transform: scale(.9); }
.item-text { min-width: 0; display: grid; }
.item-name { font-weight: 800; }
.item-for { font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.item-amount { text-align: right; font-weight: 900; white-space: nowrap; display: grid; }
.item-amount small { font-weight: 700; color: var(--muted); font-size: 12px; }
.item.is-done .item-name, .item.is-done .item-amount { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }

.cart-head { display: flex; gap: 16px; align-items: center; padding: 28px 70px 18px 28px; }
.cart-head .mascot { width: 84px; height: auto; flex: none; }
.cart-head p { color: var(--ink-2); font-weight: 600; margin-top: 6px; }
.cart-progress { display: flex; align-items: center; gap: 12px; padding: 0 28px 14px; }
.cart-progress .progress { flex: 1; }
.cart-list { list-style: none; margin: 0; padding: 0 20px; display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; }
.cart-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line); transition: background .2s, border-color .2s, transform .2s; }
.cart-item.is-current { border-color: var(--ink); background: var(--sun-p); box-shadow: var(--sh-sm); }
.cart-item.is-done { background: var(--mint-p); border-color: transparent; }
.cart-item.is-done .cart-text b { text-decoration: line-through; }
.cart-num { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--ink); font: 700 14px/1 var(--display); background: #fff; }
.cart-item.is-done .cart-num { background: var(--mint); }
.cart-text { display: grid; min-width: 0; }
.cart-text small { color: var(--ink-2); font-weight: 700; }
.cart-foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 18px 28px 26px; }
@media (max-width: 520px) {
  .cart-head { flex-direction: column; align-items: flex-start; padding: 24px 22px 14px; }
  .cart-progress { padding: 0 22px 12px; }
  .cart-list { padding: 0 12px; }
  .cart-foot { padding: 16px 22px 22px; }
}

/* ---------- settings ---------- */

.settings-head { margin-bottom: 24px; display: grid; gap: 6px; }
.settings-head p { color: var(--ink-2); font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; align-items: start; }
.settings-card { display: grid; gap: 22px; }
.settings-card h2 { display: flex; align-items: center; gap: 10px; }
.settings-section { display: grid; gap: 12px; }
.settings-section + .settings-section { padding-top: 22px; border-top: 2px dashed var(--line); }
.card-actions { display: flex; justify-content: flex-end; gap: 10px; }
.sub-card { background: var(--lav-p); display: grid; gap: 12px; }
.sub-badge { justify-self: start; padding: 6px 14px; border-radius: 99px; background: #fff; border: var(--bw) solid var(--ink); font: 600 17px/1.2 var(--display); box-shadow: var(--sh-sm); }
.sub-card p { color: var(--ink-2); font-weight: 600; }
.danger-zone { display: grid; gap: 14px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }

.email-row { display: flex; gap: 10px; }
.email-row .input { flex: 1; min-width: 0; }
.email-row .btn { box-shadow: var(--sh-sm); }
.status-ok { color: #177a55; font-weight: 800; }
.status-warn { color: #9a5b00; }
.modal-field { width: 100%; text-align: left; }

/* ---------- e-mail confirmation ---------- */

.confirm-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 22px; padding: 12px 18px;
  background: var(--sun-p); border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh-sm); font-weight: 700;
}
.confirm-banner p { flex: 1 1 280px; line-height: 1.4; }
.confirm-banner-emoji { font-size: 28px; line-height: 1; }
.field-link { justify-self: end; margin-top: -8px; font-weight: 800; font-size: 14px; color: var(--ink-2); text-underline-offset: 3px; }

/* ---------- legal pages & footer ---------- */

.legal { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; padding: clamp(22px, 4vw, 40px); }
.legal h1 { font-size: clamp(30px, 5vw, 40px); hyphens: manual; }
.legal h2 { font-size: 20px; margin-top: 14px; }
.legal p, .legal li { color: var(--ink-2); font-weight: 600; }
.legal ul { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.legal b { color: var(--ink); }
.legal address { font-style: normal; font-weight: 700; line-height: 1.6; }
.legal code { font-size: 14px; background: var(--soft); border: 1.5px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.todo { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--sun-p); border: 2px dashed var(--ink); font-weight: 800; font-size: 14px; color: var(--ink); }
.site-footer { text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; padding: 0 var(--gutter) calc(28px + var(--tabbar)); }
.site-footer a { color: var(--ink-2); font-weight: 800; text-underline-offset: 3px; }

/* ---------- toast ---------- */

#toast-root { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + var(--tabbar)); transform: translateX(-50%); display: grid; gap: 10px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; padding: 13px 18px; border-radius: 16px; background: #fff; border: var(--bw) solid var(--ink); box-shadow: var(--sh);
  font-weight: 800; animation: toast-in .3s cubic-bezier(.2, .9, .3, 1.3) both;
}
.toast-success { background: var(--mint-p); }
.toast-error { background: #ffe2de; }
.toast.is-leaving { animation: toast-out .25s ease both; }

/* ---------- motion ---------- */

@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes step-in { from { opacity: 0; transform: translateX(16px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-10deg); } }
@keyframes stir { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(9deg); } }
@keyframes blink { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.1); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-18deg); } 70% { transform: rotate(14deg); } }
@keyframes roll { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-3px) rotate(-1deg); } 75% { transform: translateX(3px) rotate(1deg); } }
@keyframes flip-in { from { transform: rotateX(80deg) scale(.9); opacity: 0; } }
@keyframes pow { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 25% { transform: scale(1.15) rotate(-8deg); opacity: 1; } 70% { transform: scale(1) rotate(-8deg); opacity: 1; } 100% { transform: translateY(-12px) rotate(-8deg); opacity: 0; } }
@keyframes shimmer { to { background-position: -150% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
