/* =========================================================
   BudgetMonies — Grocery Budget Meal Planner
   Fresh-food palette: leafy green primary + tomato red accent,
   warm cream surfaces, grocery-bag tan, BudgetMonies teal CTA.
   ========================================================= */

:root {
  /* Color */
  --ink:        #14241b;     /* near-black text */
  --ink-2:      #2f4338;     /* secondary text */
  --muted:      #5f7068;     /* tertiary */
  --line:       #e1e5d8;     /* hairline */
  --line-2:     #cdd6c2;
  --surface:    #ffffff;
  --surface-2:  #fdf6e3;     /* warm cream page bg */
  --surface-3:  #f6efd9;     /* deeper cream band */

  --brand:      #1f6b3e;     /* leafy green */
  --brand-ink:  #134a2a;     /* deep forest */
  --brand-soft: #e6f1e3;     /* pale green tint */

  --accent:     #d94a3a;     /* tomato red */
  --accent-ink: #a83323;
  --accent-soft:#fde6e1;

  --teal:       #0b6e6a;     /* BudgetMonies teal — secondary CTA */
  --teal-ink:   #064d4a;
  --teal-soft:  #d8efee;

  --tan:        #e8d9b8;     /* grocery-bag tan */
  --tan-2:      #d9c79a;
  --tan-ink:    #7a5f2e;

  --mint:       #b8edc5;     /* highlight on dark */
  --green:      #2f9e58;     /* positive/savings */
  --green-soft: #d6efdf;
  --gold:       #f3b335;     /* attention/reward */
  --gold-soft:  #fff2cc;

  --warn:       #b85c00;
  --warn-bg:    #fff4e5;
  --warn-line:  #f0c98a;

  --danger:     #b3261e;

  /* Spacing/scale */
  --container: 1120px;
  --radius:    14px;
  --radius-sm: 8px;

  /* Type */
  --font-ui:      'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Source Serif 4', Georgia, serif;

  --shadow-sm: 0 1px 2px rgba(31, 74, 42, .08), 0 1px 1px rgba(31, 107, 62, .05);
  --shadow:    0 10px 26px rgba(31, 74, 42, .10), 0 2px 6px rgba(31, 107, 62, .06);
  --shadow-lg: 0 28px 68px rgba(31, 74, 42, .20), 0 8px 20px rgba(31, 107, 62, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--surface-2);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

a { color: var(--accent-ink); }
a:hover { color: var(--brand); }

/* Skip link */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand); color: #fff; padding: 10px 14px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--brand); }
.brand-mark { color: var(--brand); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; color: var(--brand-ink); }
.brand-sub  { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.header-tag { font-size: 13px; color: var(--muted); }
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 11px;
  border-radius: 999px;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.site-nav a:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.site-nav .nav-cta {
  background: var(--teal);
  color: #fff;
}
.site-nav .nav-cta:hover {
  background: var(--teal-ink);
  color: #fff;
}
@media (max-width: 760px) {
  .site-header .wrap {
    gap: 14px;
    align-items: flex-start;
    flex-direction: column;
  }
  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav a {
    white-space: nowrap;
  }
}

/* Hero */
.hero {
  background:
    radial-gradient(900px 360px at 78% -8%, rgba(217, 74, 58, .15), transparent 62%),
    radial-gradient(720px 320px at 10% 10%, rgba(31, 107, 62, .14), transparent 58%),
    linear-gradient(180deg, #fffcf3 0%, var(--surface-2) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid; grid-template-columns: 1.4fr .9fr; gap: 48px;
  padding: 72px 24px 56px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; padding: 48px 16px 36px; }
}
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand-ink);
  background: linear-gradient(90deg, var(--brand-soft), var(--gold-soft));
  border: 1px solid rgba(31, 107, 62, .22);
  padding: 6px 12px; border-radius: 999px; margin: 0 0 18px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.05; letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--brand-ink);
}
.hero h1 .ink { color: var(--accent-ink); font-style: italic; }
.lede { font-size: 18px; color: var(--ink-2); margin: 0 0 22px; max-width: 60ch; }
.hero-checks {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 8px;
}
.hero-checks li {
  position: relative; padding-left: 28px; color: var(--ink-2);
}
.hero-checks li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--green); box-shadow: inset 0 0 0 3px #fff;
}

.hero-stat {
  background:
    radial-gradient(circle at 85% 15%, rgba(243, 179, 53, .30), transparent 28%),
    linear-gradient(145deg, #114a2c 0%, #1f6b3e 48%, #134a2a 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.hero-stat::after {
  content: ""; position: absolute; inset: auto -40px -40px auto;
  width: 200px; height: 200px; background: radial-gradient(circle, rgba(217, 74, 58, .35), transparent 60%);
}
.stat-card { display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 1; }
.stat-label { font-size: 13px; color: rgba(255,255,255,.78); letter-spacing: .04em; text-transform: uppercase; }
.stat-value {
  font-family: var(--font-display);
  font-size: 46px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--gold);
  line-height: 1;
}
.stat-foot { font-size: 14px; color: rgba(255,255,255,.86); }
.stat-note { font-size: 12px; color: rgba(255,255,255,.62); margin: 18px 0 0; position: relative; z-index: 1; }

/* Confirmation sequence pages */
.sequence-card {
  max-width: 720px;
}
.mini-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--brand);
  margin-bottom: 24px;
}
.mini-brand span {
  display: grid;
  line-height: 1.1;
}
.mini-brand strong {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--brand-ink);
}
.mini-brand small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .02em;
}
.sequence-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
  counter-reset: sequence;
}
.sequence-list li {
  counter-increment: sequence;
  display: grid;
  grid-template-columns: 38px 1fr;
  column-gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.sequence-list li::before {
  content: counter(sequence);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--mint);
  font-weight: 700;
}
.sequence-list strong,
.sequence-list span {
  grid-column: 2;
}
.sequence-list strong {
  color: var(--brand-ink);
}
.sequence-list span {
  color: var(--muted);
  font-size: 14px;
}
.confirm-panel {
  display: grid;
  gap: 6px;
  padding: 18px;
  margin-top: 24px;
  border: 1px solid rgba(47, 158, 88, .30);
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
}
.confirm-panel strong {
  color: var(--accent-ink);
}
.inbox-shortcuts {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(246,250,243,.82));
}
.inbox-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-ink);
}
.inbox-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.inbox-btn {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 7px;
  min-height: 78px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(31, 74, 42, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.inbox-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(31, 74, 42, .12);
  border-color: rgba(47, 158, 88, .34);
}
.mail-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(31, 74, 42, .10);
}
.mail-icon svg {
  width: 38px;
  height: 38px;
  display: block;
}
@media (max-width: 560px) {
  .inbox-buttons {
    grid-template-columns: 1fr;
  }
  .inbox-btn {
    grid-template-columns: 38px 1fr;
    justify-items: start;
    min-height: 58px;
    padding: 10px 12px;
  }
}

/* Section headings */
.section-h {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 2.6vw, 32px);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--brand-ink);
}
.section-sub { color: var(--muted); margin: 0 0 24px; }

/* Calculator / quiz card */
.calc { padding: 56px 0 24px; }
.calc form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow);
}
@media (max-width: 600px) { .calc form { padding: 22px 18px; } }

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(31, 107, 62, .15);
}
input::placeholder, textarea::placeholder { color: #9aa8a0; }

label, legend {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  margin-bottom: 6px; display: block;
}
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.submit-bar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 28px; padding-top: 24px; border-top: 1px dashed var(--line);
}

/* Buttons */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  border: 1px solid transparent;
  transition: transform .08s ease, background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--teal), #128a85);
  color: #fff;
  box-shadow: 0 2px 0 var(--teal-ink);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--teal-ink), var(--teal)); }
.btn-primary:focus-visible { outline: 3px solid rgba(11, 110, 106, .35); outline-offset: 2px; }
.btn-primary[disabled] { opacity: .6; cursor: wait; }
.btn-tomato {
  background: linear-gradient(135deg, var(--accent), #e76652);
  color: #fff;
  box-shadow: 0 2px 0 var(--accent-ink);
}
.btn-tomato:hover { background: linear-gradient(135deg, var(--accent-ink), var(--accent)); }
.btn-ghost {
  background: transparent;
  color: var(--brand);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--brand); }
.btn-lg { padding: 14px 22px; font-size: 16px; }

/* Results */
.results {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-3) 100%);
  padding: 48px 0 64px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 12px;
}
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.kpi.accent {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.kpi.accent .kpi-label { color: rgba(255,255,255,.78); }
.kpi.accent .kpi-value { color: var(--mint); }
.kpi.accent .kpi-sub   { color: rgba(255,255,255,.72); }
.kpi.tomato {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.kpi.tomato .kpi-label { color: rgba(255,255,255,.85); }
.kpi.tomato .kpi-value { color: #fff; }
.kpi.tomato .kpi-sub   { color: rgba(255,255,255,.82); }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.kpi-value {
  display: block; margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 32px; letter-spacing: -0.02em; color: var(--brand-ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi-value-sm {
  font-size: clamp(18px, 2.4vw, 22px) !important;
  line-height: 1.2;
  font-family: var(--font-display);
  font-weight: 600;
}
.kpi-sub { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }

/* Warn banner */
.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: #6c3a00;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin: 0 0 18px;
}
.warn strong { color: var(--warn); }

/* Gate */
.gate {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 28px;
  box-shadow: var(--shadow);
}
.gate-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
}
@media (max-width: 800px) { .gate-grid { grid-template-columns: 1fr; gap: 22px; } }
.gate h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 28px); font-weight: 600;
  margin: 0 0 10px; color: var(--brand-ink);
}
.gate-sub { color: var(--ink-2); margin: 0 0 14px; }
.gate-list { padding: 0; list-style: none; display: grid; gap: 6px; color: var(--ink-2); }
.gate-list li { padding-left: 22px; position: relative; }
.gate-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700;
}
.gate-form input[type="text"],
.gate-form input[type="email"] { margin-bottom: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 14px; font-size: 13px; color: var(--ink-2); font-weight: 400; }
.check input { margin-top: 3px; }
.gate-foot { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.gate-msg { margin-top: 10px; font-size: 14px; min-height: 1.4em; }
.gate-msg.error { color: var(--danger); }
.gate-msg.success { color: var(--brand-ink); }

/* Why section */
.why { padding: 48px 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 56px 24px;
}
@media (max-width: 800px) { .why-grid { grid-template-columns: 1fr; gap: 20px; padding: 36px 16px; } }
.why-grid h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--brand-ink);
  font-size: 19px;
  margin: 0 0 8px;
}
.why-grid p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
}

/* Disclaimer */
.disclaimer-section {
  background: var(--surface-2);
  padding: 36px 0 56px;
}
.disclaimer-section h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
}
.disclaimer-section p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  max-width: 820px;
  line-height: 1.6;
}

/* Footer */
.site-footer {
  background: var(--brand-ink);
  color: rgba(255,255,255,.78);
  padding: 28px 0;
}
.site-footer p { margin: 0; font-size: 14px; }
.foot-sub { color: rgba(255,255,255,.55); font-size: 12px; margin-top: 4px !important; }

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .45s ease var(--d, 0ms), transform .45s ease var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
}

/* View / loading pages (used by view.php) */
.loader-shell {
  min-height: 70vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}
.loader-card {
  max-width: 560px; width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow);
}
.loader-card h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 28px; margin: 0 0 8px; color: var(--brand-ink);
}
.loader-card p { color: var(--ink-2); margin: 0 0 18px; }
.spinner {
  width: 44px; height: 44px; margin: 0 auto 20px;
  border-radius: 50%;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress {
  height: 6px; background: var(--brand-soft); border-radius: 999px; overflow: hidden;
  margin: 0 0 12px;
}
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--green));
  transition: width .4s ease;
}

/* Plan viewer */
.plan-wrap { padding: 40px 0 64px; }
.plan-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.plan-head h1 {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em;
  font-size: clamp(28px, 3.4vw, 40px); margin: 0; color: var(--brand-ink);
}
.plan-head .actions { display: flex; gap: 8px; }
.plan-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.plan-section h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 22px; margin: 0 0 12px; color: var(--brand-ink);
}
.plan-section h3 { font-size: 16px; margin: 16px 0 6px; color: var(--brand-ink); }
.plan-section ul, .plan-section ol { padding-left: 22px; }
.plan-section li { margin-bottom: 6px; color: var(--ink-2); }
.plan-section p { color: var(--ink-2); margin: 0 0 10px; }

/* Phase / day card used inside plan-section */
.phase-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 10px;
}
.phase-card .phase-h {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 6px;
}
.phase-card .phase-title { font-weight: 600; color: var(--brand-ink); }
.phase-card .phase-meta  { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Grocery list grid (view.php section 3) */
.grocery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.grocery-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: #fff;
}
.grocery-card h3 {
  font-family: var(--font-display);
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--brand-ink);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--brand-soft);
  display: flex; align-items: center; gap: 6px;
}
.grocery-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}
.grocery-card li {
  font-size: 14px;
  color: var(--ink-2);
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}
.grocery-card li:last-child { border-bottom: 0; }
.grocery-card.tan { background: var(--surface-2); }
.grocery-card.tan h3 { border-bottom-color: var(--tan-2); }

/* Budget breakdown row */
.budget-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.budget-row:last-child { border-bottom: 0; }
.budget-row .b-label { color: var(--ink-2); font-weight: 500; }
.budget-row .b-value { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--brand-ink); }

/* Tag */
.tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid rgba(217, 74, 58, .25);
  padding: 4px 10px;
  border-radius: 999px;
  vertical-align: middle;
}

/* =========================================================
   GROCERY BUDGET MEAL PLANNER — quiz form
   ========================================================= */

/* Question grid — two columns on desktop, stack on mobile */
.q-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 28px;
  row-gap: 32px;
  margin-top: 18px;
}
@media (max-width: 800px) {
  .q-grid { grid-template-columns: 1fr; gap: 24px; }
}
.q-card {
  background: linear-gradient(180deg, #ffffff 0%, #fffdf3 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  margin: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.q-card:hover,
.q-card:focus-within {
  border-color: rgba(31, 107, 62, .34);
  box-shadow: var(--shadow);
}
.q-card.full { grid-column: 1 / -1; }
.q-card legend {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--brand-ink);
  padding: 0 4px;
  margin-bottom: 14px;
}
.q-card .hint {
  margin: -4px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

/* Segmented radios */
.seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
@media (max-width: 600px) { .seg { grid-template-columns: 1fr; } }
.q-card .seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .q-card .seg { grid-template-columns: 1fr; }
}
.q-card .seg label,
.seg label {
  position: relative;
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .15s, background-color .15s, transform .1s;
  margin-bottom: 0;
}
.q-card .seg label:hover,
.seg label:hover { border-color: var(--line-2); background: #fff; }
.q-card .seg label input,
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.q-card .seg label span,
.seg label span {
  display: block;
  font-weight: 600;
  color: var(--brand-ink);
  font-size: 15px;
  margin-bottom: 2px;
}
.q-card .seg label small,
.seg label small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.q-card .seg label:has(input:checked),
.seg label:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand), 0 10px 22px rgba(31, 107, 62, .10);
}
.q-card .seg label:has(input:checked) span,
.seg label:has(input:checked) span { color: var(--brand-ink); }

/* Chips for pantry/avoid multi-select */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s;
  user-select: none;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { border-color: var(--line-2); background: #fff; }
.chip:has(input:checked) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.chip:has(input:checked) span::before {
  content: "✓ ";
  font-weight: 700;
  margin-right: 2px;
}
/* "Avoid" chips use tomato when selected */
.chip.avoid:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
}

/* Section header inside calc */
.calc .section-h {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--brand-ink);
  font-size: clamp(22px, 2.6vw, 30px);
  margin: 8px 0 4px;
  letter-spacing: -0.01em;
}
.calc .section-sub {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 15px;
}

/* Hero stat polish */
.hero-stat .stat-card {
  border-left: 0;
  box-shadow: 0 22px 54px rgba(19, 74, 42, .24);
}
