:root {
  --cream: #fffaf0;
  --ink: #181714;
  --muted: #77736b;
  --red: #e93a24;
  --yellow: #ffd84a;
  --green: #4f8167;
  --line: #ded8cc;
  --display: "Arial Black", Arial, sans-serif;
  --body: Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--cream); }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: var(--body); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #2673d9; outline-offset: 3px; }

.topbar { width: min(100%, 480px); margin: auto; padding: max(18px, env(safe-area-inset-top)) 18px 20px; display: flex; align-items: center; justify-content: space-between; }
.brand { border: 0; padding: 0; display: flex; align-items: center; gap: 8px; background: none; font: 15px/13px var(--display); letter-spacing: -.5px; text-align: left; cursor: pointer; }
.brand-mark { position: relative; display: grid; place-items: center; width: 31px; height: 31px; border: 3px solid var(--red); border-radius: 50%; }
.brand-mark::before, .brand-mark::after, .brand-mark span { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.brand-mark::before { transform: translate(-6px, -4px); }
.brand-mark::after { transform: translate(6px, 5px); }
.location-chip { max-width: 58%; border: 1px solid var(--line); border-radius: 999px; padding: 9px 12px; display: flex; align-items: center; gap: 6px; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.location-chip svg { width: 15px; flex: none; fill: none; stroke: var(--red); stroke-width: 2; }
.location-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#app { width: min(100%, 480px); margin: auto; padding: 2px 18px calc(32px + env(safe-area-inset-bottom)); }
.screen { display: none; animation: enter .18s ease both; }
.screen.is-active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }

.preference { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 12px; background: #eee8dc; }
.preference-button { border: 0; border-radius: 9px; padding: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.preference-button.is-active { background: white; color: var(--ink); }

.pizza-card { padding: 26px 0 22px; text-align: center; }
.pizza-art { position: relative; width: min(280px, 86vw); height: calc(59px + var(--box-count, 1) * 11px); margin: 0 auto 18px; transition: opacity .16s ease, height .2s ease; }
.pizza-art.is-loading { opacity: .35; }
.pizza-art img { position: absolute; left: 0; bottom: calc(var(--box-index) * 11px); z-index: var(--box-index); width: 100%; height: auto; display: block; }
.pizza-card h1 { margin: 0; font: clamp(29px, 8vw, 38px)/1 var(--display); letter-spacing: -1.5px; }
.pizza-size { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.pizza-store-note { display: block; margin-top: 5px; color: var(--green); font-size: 10px; font-weight: 700; }
.pizza-meta { display: flex; justify-content: center; gap: 10px; margin-top: 15px; font-size: 17px; }

.quantity-row { min-height: 64px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.quantity-copy { font-size: 13px; font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 8px; }
.step-button { min-width: 42px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; background: transparent; font-weight: 700; cursor: pointer; }
.step-button.plus { border-color: var(--red); background: var(--red); color: white; }
.quantity { min-width: 19px; text-align: center; font: 18px/1 var(--display); }
.is-hidden { display: none !important; }

.streak-info { display: block; margin: 10px 0 2px; text-align: center; font-size: 13px; color: var(--muted); }
.utility-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.utility-button { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .8px; cursor: pointer; }
.utility-button:hover { border-color: var(--ink); color: var(--ink); }
.saved-address-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.address-chip { background: var(--cream); border: 1.5px solid var(--line); border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.address-chip:hover { border-color: var(--red); background: #fff; }
.customer-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.customer-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .5px; }
.customer-fields input { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; background: #fff; color: var(--ink); }
.customer-fields input:focus { border-color: var(--red); outline: none; }
.field-row { display: flex; gap: 10px; }
.field-row label { flex: 1; }
.card-field { margin-bottom: 12px; }
.card-field small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .5px; margin-bottom: 6px; }
#cardElement { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }

.primary-button { width: 100%; min-height: 56px; border: 0; border-radius: 13px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; background: var(--red); color: white; font: 15px/1 var(--display); cursor: pointer; }
.primary-button:active { transform: translateY(1px); }
.primary-button[disabled] { opacity: .6; cursor: wait; }
.another-button, .back-button { border: 0; background: none; cursor: pointer; }
.another-button { width: 100%; padding: 18px 8px 8px; color: var(--muted); font-size: 12px; }
.another-button svg { width: 13px; margin-right: 4px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2; }
.back-button { margin: 0 0 25px; padding: 7px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.page-title { margin: 0 0 24px; font: clamp(36px, 10vw, 46px)/1 var(--display); letter-spacing: -2px; }
.centered { text-align: center; }
.eyebrow { margin: 8px 0 12px; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--green); }
.live-tag { border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; color: var(--muted); font-size: 9px; font-weight: 800; }
.tracking-top { display: flex; align-items: flex-start; justify-content: space-between; }

.summary-card { min-height: 76px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 13px; padding: 9px; display: grid; grid-template-columns: 86px 1fr auto; gap: 11px; align-items: center; }
.checkout-stack { position: relative; width: 86px; height: calc(17px + var(--box-count, 1) * 5px); }
.checkout-stack img { position: absolute; left: 0; bottom: calc(var(--box-index) * 4px); z-index: var(--box-index); width: 86px; height: auto; }
.summary-card span, .summary-card small { display: block; color: var(--muted); font-size: 10px; }
.summary-card strong { display: block; font-size: 13px; }
.summary-card > strong { font-family: var(--display); }
.checkout-option { width: 100%; border: 0; border-top: 1px solid var(--line); padding: 15px 0; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; background: transparent; text-align: left; cursor: pointer; }
.checkout-option + .checkout-option { border-bottom: 1px solid var(--line); }
.option-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--yellow); }
.checkout-option small { display: block; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .7px; }
.checkout-option strong { display: block; margin-top: 2px; font-size: 13px; }
.note-field { display: block; margin: 18px 0; }
.note-field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .6px; }
.note-field small { font-weight: 400; }
.note-field input { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 13px; background: white; }
.receipt { margin-bottom: 20px; font-size: 12px; }
.receipt > div { display: flex; justify-content: space-between; padding: 5px 1px; color: var(--muted); }
.receipt .receipt-total { margin-top: 7px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--ink); font-size: 14px; }
.fine-print { color: var(--muted); text-align: center; font-size: 9px; }

.success-screen { padding-top: 26px; }
.success-art { width: 230px; height: 65px; margin: 0 auto 22px; }
.success-art img { width: 100%; height: 100%; object-fit: contain; }
.success-screen .page-title { margin-bottom: 22px; }
.order-number { margin: 0 auto 25px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px; display: flex; justify-content: center; gap: 11px; }
.order-number span { color: var(--muted); font-size: 10px; font-weight: 700; }
.order-number strong { font: 14px/1 var(--display); }

.eta-lockup { margin: -5px 0 18px; display: flex; align-items: center; gap: 13px; }
.eta-lockup > strong { color: var(--red); font: 34px/1 var(--display); }
.eta-lockup span { border-left: 1px solid var(--line); padding-left: 12px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .7px; }
.eta-lockup b { color: var(--ink); }
.route-card, .location-map { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #e4ead8; }
.route-card { height: 195px; margin-bottom: 18px; }
.street { position: absolute; width: 130%; height: 24px; background: #fffaf0; border-top: 1px solid #d5d2c8; border-bottom: 1px solid #d5d2c8; }
.street::after { content: ""; position: absolute; left: 0; right: 0; top: 11px; border-top: 1px dashed #cbc5b7; }
.street-a { top: 48px; left: -33px; transform: rotate(15deg); }.street-b { top: 133px; left: -18px; transform: rotate(-10deg); }.street-c { top: 92px; left: 79px; transform: rotate(77deg); }
.route-line { position: absolute; inset: 0; width: 100%; height: 100%; }.route-line path { fill: none; stroke: var(--red); stroke-width: 4; stroke-dasharray: 7 6; }
.shop-pin, .home-pin { position: absolute; z-index: 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: white; font-size: 18px; }
.shop-pin { left: 20px; bottom: 20px; }.home-pin { right: 20px; top: 55px; background: var(--ink); color: white; }
.courier-dot { position: absolute; z-index: 3; left: 43%; top: 70px; width: 22px; height: 22px; border: 4px solid white; border-radius: 50%; background: var(--red); color: transparent; transition: left 1.8s, top 1.8s; }
.map-label { position: absolute; z-index: 2; padding: 3px 5px; background: white; font-size: 7px; font-weight: 800; }.shop-label { left: 17px; bottom: 4px; }.home-label { right: 22px; top: 97px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; min-height: 58px; display: grid; grid-template-columns: 20px 1fr auto; gap: 11px; }
.timeline li > span { z-index: 2; width: 13px; height: 13px; margin-top: 3px; border: 3px solid white; outline: 1px solid var(--line); border-radius: 50%; background: #aaa; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 15px; bottom: -1px; border-left: 2px dotted var(--line); }
.timeline li.is-done > span { background: var(--green); }.timeline li.is-current > span { background: var(--red); }
.timeline strong, .timeline small { display: block; }.timeline strong { font-size: 13px; }.timeline small { margin-top: 2px; color: var(--muted); font-size: 10px; }.timeline b { color: var(--red); font-size: 8px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 10; padding-top: 24px; display: flex; align-items: flex-end; justify-content: center; background: rgba(24,23,20,.55); opacity: 0; visibility: hidden; transition: .2s; }
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal-sheet { width: min(100%, 480px); max-height: 95vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); background: var(--cream); }
.drag-handle { width: 42px; height: 4px; margin: 0 auto 18px; border-radius: 99px; background: var(--line); }
.location-sheet h2, .captcha-sheet h2, .account-sheet h2, .install-sheet h2 { margin: 0 0 17px; text-align: center; font: 30px/1 var(--display); letter-spacing: -1px; }
.location-map { height: 180px; margin-bottom: 8px; }
.map-crosshair { position: absolute; z-index: 1000; top: 50%; left: 50%; transform: translate(-50%, -100%); pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.device-location-dot { width: 16px; height: 16px; border: 3px solid white; border-radius: 50%; background: #1677e8; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.leaflet-control-attribution { font-size: 7px !important; }
.map-hint { margin: 0 0 15px; color: var(--muted); text-align: center; font-size: 10px; }
.manual-location { margin-top: 17px; color: var(--muted); font-size: 12px; }
.manual-location summary { text-align: center; cursor: pointer; }
#addressForm { margin-top: 12px; }
.address-row { display: grid; grid-template-columns: 1fr 46px; gap: 7px; }
.address-row input { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: white; }
.address-row button { border: 0; border-radius: 10px; background: var(--ink); color: white; font-size: 18px; cursor: pointer; }
.inline-status { min-height: 14px; margin: 12px 0 0; color: var(--muted); text-align: center; font-size: 9px; }.inline-status.is-error { color: var(--red); font-weight: 700; }
.captcha-sheet { position: relative; padding-top: 24px; }
.modal-close { position: absolute; top: 14px; right: 16px; width: 33px; height: 33px; border: 0; border-radius: 50%; background: #eee8dc; font-size: 21px; cursor: pointer; }
.tiny-pizza { display: block; margin-bottom: 10px; text-align: center; font-size: 22px; }
.captcha-sheet > p:not(.eyebrow):not(.inline-status) { color: var(--muted); text-align: center; font-size: 12px; }
.captcha-sheet label { display: block; margin-top: 17px; text-align: center; font: 19px/1 var(--display); }
.captcha-row { display: grid; grid-template-columns: 72px 1fr; gap: 8px; margin-top: 12px; }.captcha-row input { width: 100%; border: 2px solid var(--ink); border-radius: 10px; text-align: center; font: 22px/1 var(--display); }.captcha-row button { min-height: 50px; border: 0; border-radius: 10px; background: var(--red); color: white; font: 12px/1 var(--display); cursor: pointer; }
.account-sheet, .install-sheet { position: relative; padding-top: 24px; }
.account-loading, .sign-in-section { color: var(--muted); text-align: center; font-size: 12px; }
.sign-in-section { margin-bottom: 18px; border-bottom: 1px solid var(--line); padding: 0 4px 18px; }
#googleSignInButton { min-height: 44px; margin-top: 13px; display: flex; justify-content: center; }
.profile-section { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.profile-identity img { width: 40px; height: 40px; border-radius: 50%; }
.profile-identity strong, .profile-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.text-button { border: 0; padding: 6px; background: none; color: var(--red); font-size: 11px; font-weight: 700; cursor: pointer; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 18px; }
.stat-card { border: 1px solid var(--line); border-radius: 10px; padding: 11px 5px; text-align: center; }
.stat-card strong, .stat-card small { display: block; }
.stat-card strong { font: 20px/1 var(--display); }
.stat-card small { margin-top: 5px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .5px; }
.account-list { margin-top: 17px; }
.account-list h3 { margin: 0 0 8px; font: 14px/1 var(--display); }
.badge-list { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-pill { border-radius: 999px; padding: 6px 9px; background: #eee8dc; font-size: 10px; }
.empty-account { color: var(--muted); font-size: 11px; }
.order-history-row { border-top: 1px solid var(--line); padding: 9px 1px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 11px; }
.order-history-row small { color: var(--muted); }
.install-icon { display: block; margin: 4px 0 10px; text-align: center; font-size: 34px; }
.install-steps { margin: 0 0 18px; }
.install-step { display: grid; grid-template-columns: 28px 1fr; gap: 9px; align-items: start; margin: 10px 0; font-size: 12px; }
.install-step > span:first-child { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); font-weight: 800; }
.site-footer { width: min(100%, 480px); margin: 0 auto; padding: 0 18px calc(20px + env(safe-area-inset-bottom)); text-align: center; }
.site-footer a { color: var(--muted); font-size: 10px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); max-width: calc(100% - 36px); border-radius: 9px; padding: 11px 14px; background: var(--ink); color: white; font-size: 11px; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; transition: .2s; }.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  body { padding: 20px 0; }
  .topbar, #app { width: 440px; padding-left: 0; padding-right: 0; }
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal-sheet { width: 440px; border-radius: 20px; padding-bottom: 24px; }
}

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