:root {
  --cream: #f4eadb;
  --paper: #fffaf1;
  --ink: #182017;
  --muted: #6f7469;
  --green: #254f38;
  --lime: #d9ee71;
  --orange: #e85d32;
  --line: #d5ccbd;
  --shadow: 0 22px 60px rgba(67, 50, 30, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Segoe UI', Arial, sans-serif;
}
button, input, select, a { touch-action: manipulation; -webkit-tap-highlight-color: rgba(232, 93, 50, .2); }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
#app:focus { outline: 2px solid rgba(232, 93, 50, .28); outline-offset: -2px; }
[hidden] { display: none !important; }

.site-header {
  min-height: 76px;
  padding: 0 clamp(20px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(24, 32, 23, .14);
}
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 14px; background: var(--ink); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.brand { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; font-weight: 700; cursor: pointer; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: var(--lime); font-family: Georgia, serif; font-size: 21px; }
.text-button { border: 0; border-bottom: 1px solid currentColor; padding: 4px 0; background: none; font-weight: 700; cursor: pointer; }

.screen { width: min(1380px, 100%); min-height: calc(100vh - 76px); margin: 0 auto; padding: clamp(48px, 7vw, 100px) clamp(20px, 5vw, 76px); }
.welcome-screen { display: grid; grid-template-columns: 1.1fr minmax(340px, 510px); align-items: center; gap: clamp(60px, 10vw, 150px); }
.eyebrow { margin: 0 0 18px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; max-width: 850px; font-size: clamp(52px, 7vw, 104px); line-height: .9; letter-spacing: -.065em; }
h1 { text-wrap: balance; }
h1 em { color: var(--orange); font-family: Georgia, serif; font-weight: 700; }
.lead { max-width: 570px; margin: 32px 0; color: #4d554a; font-size: clamp(17px, 2vw, 21px); line-height: 1.55; }
.ingredient-stamp { display: flex; flex-wrap: wrap; gap: 8px; }
.ingredient-stamp span { border: 1px solid var(--green); border-radius: 999px; padding: 7px 12px; color: var(--green); font-size: 12px; font-weight: 700; text-transform: uppercase; }

.identity-card { min-width: 0; max-width: 100%; padding: clamp(30px, 5vw, 54px); border-radius: 2px 42px 2px 2px; background: var(--paper); box-shadow: var(--shadow); }
.deadline-badge { margin: -12px 0 28px; border-left: 3px solid var(--orange); padding: 9px 12px; background: #fff0e8; color: #7a311d; font-size: 13px; font-weight: 700; line-height: 1.4; }
.deadline-badge.is-closed { border-color: #7a2118; background: #f1d8d3; }
.step-label, .section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; font-weight: 800; }
.step-label > span, .section-heading > span { display: grid; place-items: center; flex: 0 0 35px; height: 35px; border-radius: 50%; background: var(--lime); font-size: 12px; }
.identity-card > label { display: block; margin: 22px 0 8px; font-size: 14px; font-weight: 700; }
.identity-card input[type='text'], .identity-card select { width: 100%; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; padding: 11px 2px; background: transparent; color: var(--ink); font-size: 18px; }
.identity-card input::placeholder { color: #a6a398; }
.field-error { min-height: 19px; margin: 5px 0 0; color: #b22b1b; font-size: 13px; }
.primary-button, .secondary-button, .add-button { border: 0; border-radius: 3px; padding: 17px 22px; font-weight: 800; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 20px; background: var(--green); color: white; }
.primary-button:hover { background: #183c29; transform: translateY(-2px); }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.privacy-note, .results-note { margin: 13px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.builder-screen { padding-top: 48px; }
.builder-heading, .results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 50px; }
.builder-heading h1, .results-heading h1, .success-screen h1 { font-size: clamp(48px, 6vw, 82px); }
.change-person { flex: 0 0 auto; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.builder-layout { display: grid; grid-template-columns: minmax(390px, .88fr) minmax(420px, 1.12fr); gap: clamp(35px, 6vw, 90px); align-items: start; }
.burger-editor { min-width: 0; }
.burger-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 16px; }
.burger-tab-wrap { display: flex; align-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.burger-tab { border: 0; padding: 10px 14px; background: transparent; font-weight: 700; cursor: pointer; }
.burger-tab-wrap:has(.burger-tab[aria-pressed='true']) { border-color: var(--green); background: var(--green); color: white; }
.burger-tab[aria-pressed='true'] { border-color: var(--green); background: var(--green); color: white; }
.remove-burger { display: grid; place-items: center; width: 34px; height: 38px; margin-right: 3px; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); cursor: pointer; }
.ingredients-fieldset, .salad-card { margin: 0; border: 0; padding: 0; }
.section-heading { align-items: flex-start; margin: 22px 0 15px; }
.section-heading h2 { margin: 0; font-size: 22px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.ingredient-list { border-top: 1px solid var(--line); }
.check-row { position: relative; display: flex; align-items: center; gap: 15px; min-height: 67px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-row:has(input:focus-visible), .inline-choice label:has(input:focus-visible), .salad-options label:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 3px; }
.custom-check { display: grid; place-items: center; flex: 0 0 25px; height: 25px; border: 2px solid #899083; border-radius: 4px; }
.check-row input:checked + .custom-check { border-color: var(--green); background: var(--green); }
.check-row input:checked + .custom-check::after { content: '✓'; color: white; font-size: 15px; font-weight: 800; }
.check-row strong, .check-row small { display: block; }
.check-row small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.inline-choice, .salad-options { display: flex; gap: 8px; padding: 11px 0 16px 40px; border-bottom: 1px solid var(--line); }
.inline-choice label, .salad-options label { cursor: pointer; }
.inline-choice input, .salad-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.inline-choice span, .salad-options span { display: block; border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; color: var(--muted); font-size: 12px; font-weight: 700; }
.inline-choice input:checked + span, .salad-options input:checked + span { border-color: var(--orange); background: var(--orange); color: white; }
.inline-choice.is-disabled { display: none; }
.add-button { width: 100%; margin: 18px 0 34px; border: 1px dashed #8e9489; background: transparent; color: var(--green); }
.add-button span { margin-right: 8px; font-size: 20px; }
.salad-card { padding: 24px 26px; background: rgba(255,255,255,.45); }
.salad-card legend { padding: 0; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.salad-card .check-row { border: 0; }
.salad-options { display: grid; padding-left: 40px; border: 0; }
.salad-options span { border-radius: 4px; padding: 12px 14px; font-weight: 400; line-height: 1.4; }
.salad-options strong, .salad-options small { display: block; }
.salad-options strong { font-size: 13px; }
.salad-options small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.salad-options input:checked + span small { color: inherit; opacity: .86; }
.submit-order { margin-top: 25px; }
.submit-error { min-height: 20px; margin: 18px 0 -12px; color: #a42d1b; font-size: 13px; font-weight: 700; }

.preview-panel { position: sticky; top: 25px; overflow: hidden; min-height: 650px; border-radius: 2px 46px 2px 2px; padding: 24px; background: var(--green); color: white; }
.preview-topline { display: flex; justify-content: space-between; position: relative; z-index: 2; color: var(--lime); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.plate { position: relative; display: grid; place-items: center; height: 530px; margin-top: 8px; isolation: isolate; }
.plate::before { content: ''; position: absolute; width: min(90%, 560px); aspect-ratio: 1; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: inset 0 0 0 35px rgba(255,255,255,.025); }
.plate::after { content: ''; position: absolute; z-index: -1; width: 70%; height: 35px; bottom: 70px; border-radius: 50%; background: rgba(0,0,0,.32); filter: blur(12px); }
.burger-visual { position: relative; width: min(82%, 480px); height: 390px; transform: translateY(25px); }
.layer { position: absolute; left: 50%; width: var(--w, 78%); height: var(--h, 42px); bottom: var(--y); border-radius: var(--radius, 40%); transform: translateX(-50%); filter: drop-shadow(0 8px 5px rgba(0,0,0,.16)); animation: ingredient-in .32s ease both; }
.top-bun { --w: 75%; --h: 112px; --y: 250px; border-radius: 52% 52% 18% 18% / 75% 75% 20% 20%; background: radial-gradient(circle at 38% 30%, #fff3c0 0 2px, transparent 3px), radial-gradient(circle at 60% 19%, #fff3c0 0 2px, transparent 3px), radial-gradient(circle at 68% 43%, #fff3c0 0 2px, transparent 3px), linear-gradient(#e8ad4a, #b86d25); }
.top-bun.gluten-free { background: radial-gradient(circle at 35% 28%, #735127 0 2px, transparent 3px), radial-gradient(circle at 62% 22%, #735127 0 2px, transparent 3px), linear-gradient(#d9b16c, #a9793e); }
.sauce { --w: 65%; --h: 17px; --y: 235px; border-radius: 50%; background: #ed8a64; box-shadow: inset 0 -4px 0 rgba(139, 42, 28, .16); }
.sauce::after { content: ''; position: absolute; left: 18%; bottom: -8px; width: 13px; height: 14px; border-radius: 0 0 50% 50%; background: inherit; }
.bottom-sauce { --w: 62%; }
.top-sauce { --w: 67%; }
.sauce.big-tasty { background: #d5a26a; }
.lettuce { --w: 88%; --h: 42px; --y: 205px; overflow: visible; background: transparent; filter: drop-shadow(0 7px 4px rgba(0,0,0,.18)); }
.lettuce i { position: absolute; bottom: 3px; width: 31%; height: 34px; border: 2px solid #527d2a; border-radius: 65% 35% 70% 30% / 55% 50% 50% 45%; background: radial-gradient(ellipse at 50% 110%, transparent 0 39%, rgba(47,95,33,.35) 41% 44%, transparent 46%), linear-gradient(135deg, #9fce52, #5f9d34); }
.lettuce i:nth-child(1) { left: 1%; transform: rotate(-12deg); }.lettuce i:nth-child(2) { left: 18%; bottom: 8px; transform: rotate(7deg); }.lettuce i:nth-child(3) { left: 36%; width: 30%; transform: rotate(-4deg); }.lettuce i:nth-child(4) { right: 17%; bottom: 7px; transform: rotate(10deg); }.lettuce i:nth-child(5) { right: 0; transform: rotate(-8deg); }
.pickle-group { --w: 61%; --h: 28px; display: flex; justify-content: center; gap: 8px; background: transparent; filter: drop-shadow(0 6px 3px rgba(0,0,0,.16)); }
.pickle-group i { position: relative; width: 29%; aspect-ratio: 2.1; border: 4px solid #678731; border-radius: 50%; background: radial-gradient(ellipse at 30% 50%, #edf2a0 0 5%, transparent 7%), radial-gradient(ellipse at 67% 45%, #edf2a0 0 5%, transparent 7%), radial-gradient(ellipse at 50% 70%, #edf2a0 0 4%, transparent 6%), radial-gradient(ellipse, #c5d76b 0 46%, #91ad43 48% 64%, #6c8e32 66%); }
.pickle-group i:nth-child(1) { transform: rotate(-8deg); }.pickle-group i:nth-child(2) { transform: translateY(-5px) rotate(3deg); }.pickle-group i:nth-child(3) { transform: rotate(9deg); }
.tomato { --w: 76%; --h: 36px; --y: 166px; overflow: hidden; border: 4px solid #a92b1e; background: radial-gradient(ellipse at center, #f7a06d 0 32%, #ed6045 34% 61%, #c63728 63%); box-shadow: inset 0 -6px 0 rgba(123,25,20,.18); }
.tomato i { position: absolute; top: 9px; width: 15px; height: 6px; border-radius: 50%; background: #ffe5a3; box-shadow: inset 0 0 0 2px rgba(211,119,69,.45); }
.tomato i:nth-child(1) { left: 19%; transform: rotate(18deg); }.tomato i:nth-child(2) { left: 29%; top: 18px; transform: rotate(-20deg); }.tomato i:nth-child(3) { left: 40%; top: 7px; }.tomato i:nth-child(4) { left: 50%; top: 19px; transform: rotate(22deg); }.tomato i:nth-child(5) { right: 30%; top: 7px; }.tomato i:nth-child(6) { right: 19%; top: 18px; transform: rotate(-17deg); }.tomato i:nth-child(7) { right: 11%; top: 8px; }
.cheese { --w: 81%; --h: 53px; --y: 139px; border: 2px solid #dca516; border-radius: 4px; background: linear-gradient(145deg, #ffd948, #efa914); clip-path: polygon(1% 0, 99% 0, 96% 74%, 75% 78%, 62% 100%, 47% 80%, 24% 87%, 3% 72%); }
.meat { --w: 80%; --h: 82px; --y: 92px; border-radius: 46%; background: repeating-linear-gradient(170deg, #713a28 0 8px, #4a2118 9px 13px); border: 3px solid #3b1a13; border-bottom-width: 11px; box-shadow: inset 0 8px 8px rgba(255,154,92,.12); }
.bottom-bun { --w: 74%; --h: 55px; --y: 50px; border-radius: 15% 15% 45% 45%; background: linear-gradient(#bd732b, #e6a343); }
.bottom-bun.gluten-free { background: linear-gradient(#a9793e, #d9b16c); }
.empty-burger { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.66); text-align: center; }
.preview-caption { margin: 0; color: rgba(255,255,255,.62); font-size: 12px; text-align: center; }

.success-screen { display: grid; justify-items: center; align-content: center; text-align: center; }
.success-mark { display: grid; place-items: center; width: 78px; height: 78px; margin-bottom: 25px; border-radius: 50%; background: var(--lime); color: var(--green); font-size: 38px; font-weight: 800; }
.order-recap { max-width: 640px; margin: 32px auto; color: var(--muted); line-height: 1.6; }
.success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.success-actions .primary-button, .success-actions .secondary-button { width: auto; margin: 0; }
.secondary-button { border: 1px solid var(--green); background: transparent; color: var(--green); }

.results-screen { max-width: 1150px; }
.results-heading .primary-button { width: auto; margin: 0; }
.results-note { margin: -34px 0 40px; text-align: left; }
.shopping-section { margin: 0 0 58px; border: 1px solid var(--line); padding: clamp(22px, 4vw, 38px); background: var(--paper); box-shadow: var(--shadow); }
.shopping-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.shopping-heading .eyebrow { margin-bottom: 6px; }.shopping-heading h2 { margin: 0; font-size: 32px; }.shopping-heading > span { color: var(--muted); font-size: 13px; }
.shopping-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.shopping-item { min-width: 0; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.shopping-item strong, .shopping-item span, .shopping-item small { display: block; }.shopping-item strong { color: var(--orange); font-size: 24px; font-variant-numeric: tabular-nums; }.shopping-item span { margin-top: 5px; font-weight: 700; }.shopping-item small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.shopping-notes { margin-top: 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }.shopping-notes summary { color: var(--green); font-weight: 800; cursor: pointer; }.shopping-notes a { color: var(--green); }
.school-group { margin: 0 0 28px; border-top: 3px solid var(--ink); }
.school-title { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding: 18px 0; }
.school-title h2 { margin: 0; font-size: 25px; }
.school-title span { color: var(--muted); font-size: 13px; }
.order-row { display: grid; grid-template-columns: minmax(130px, .5fr) 1.5fr auto auto; align-items: start; gap: 25px; padding: 18px 0; border-top: 1px solid var(--line); content-visibility: auto; contain-intrinsic-size: auto 80px; }
.order-row h3 { margin: 0; font-size: 16px; }
.order-row p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.order-row time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.delete-order { border: 0; border-bottom: 1px solid currentColor; padding: 2px 0; background: transparent; color: #a42d1b; font-size: 12px; font-weight: 700; cursor: pointer; }
.delete-order:hover { color: #6f190f; }
.delete-order:disabled { cursor: wait; opacity: .55; }
.empty-state { border: 1px dashed #92988e; padding: 60px 24px; color: var(--muted); text-align: center; }
.school-title h2, .order-row h3, .order-row p { overflow-wrap: anywhere; }
.text-button:hover, .secondary-button:hover, .add-button:hover { color: var(--orange); border-color: var(--orange); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@keyframes ingredient-in { from { opacity: 0; transform: translateX(-50%) translateY(-14px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 860px) {
  .welcome-screen { grid-template-columns: 1fr; gap: 45px; }
  .builder-layout { grid-template-columns: 1fr; }
  .preview-panel { position: relative; top: 0; grid-row: 1; min-height: 480px; }
  .plate { height: 390px; }
  .burger-visual { width: min(90%, 450px); height: 350px; transform: scale(.82) translateY(40px); }
}
@media (max-width: 560px) {
  .site-header { min-height: 64px; }
  .site-header { padding-inline: 16px; }
  .brand { gap: 8px; font-size: 14px; }
  .site-header .text-button { font-size: 13px; }
  .screen { min-height: calc(100vh - 64px); padding-top: 38px; }
  .welcome-screen { align-content: start; }
  .identity-card { padding: 26px 20px; border-radius: 2px 26px 2px 2px; }
  .builder-heading, .results-heading { align-items: flex-start; flex-direction: column; margin-bottom: 32px; }
  .preview-panel { min-height: 390px; padding: 18px; border-radius: 2px 28px 2px 2px; }
  .plate { height: 310px; }
  .burger-visual { transform: scale(.65) translateY(70px); }
  .inline-choice, .salad-options { padding-left: 0; flex-wrap: wrap; }
  .success-actions { width: 100%; flex-direction: column; }
  .success-actions .primary-button, .success-actions .secondary-button { width: 100%; }
  .order-row { grid-template-columns: 1fr; gap: 7px; }
}
