:root {
  color-scheme: dark;
  --bg: #241304;
  --panel: #351d09;
  --panel2: #43270f;
  --line: #80623c;
  --gold: #efc776;
  --gold2: #c99744;
  --text: #fffaf0;
  --muted: #d7c9b2;
  --ok: #b8e7b3;
  --bad: #ffc3b8;
}

* { box-sizing: border-box; }
body { margin: 0; background: #15100b; color: var(--text); font-family: "Noto Sans KR", "Malgun Gothic", sans-serif; }
button, input, select { font: inherit; }
button { min-height: 48px; cursor: pointer; }
.phone { width: min(100%, 430px); min-height: 100vh; margin: 0 auto; padding: 0 14px 96px; background: radial-gradient(circle at 50% 0, #563310 0, var(--bg) 34%, #1b0f04 100%); }
.brand-crop { position: relative; height: 116px; margin: 0 -14px 2px; overflow: hidden; border-bottom: 1px solid rgba(239,199,118,.45); }
.brand-crop img { position: absolute; width: 720px; max-width: none; left: 50%; top: 0; transform: translateX(-50%); }
.card { margin: 14px 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(53,29,9,.9); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; color: var(--gold); font-size: 28px; }
h2 { margin-bottom: 14px; font-size: 20px; }
h3 { margin: 0 0 10px; font-size: 17px; color: var(--gold); }
.intro p, .prototype-note { color: var(--muted); }
.field-grid, .date-label { display: grid; gap: 12px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
input, select { width: 100%; min-width: 0; min-height: 48px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #211306; color: var(--text); font-size: 16px; }
/* iPhone은 날짜 칸을 글자 폭만큼 넓게 그려 칸 밖으로 나간다(9/25 아이폰 17 Pro 수정 화면). */
input[type="date"] { display: block; max-width: 100%; -webkit-appearance: none; appearance: none; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.time-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; margin-top: 12px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 7px; color: var(--muted); font-size: 14px; }
.chip-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.chip-row button, .category-row button, .choice { border: 1px solid var(--line); border-radius: 12px; background: #2b1909; color: var(--text); }
.chip-row button.active, .category-row button.active, .choice.active { border-color: var(--gold); background: var(--gold); color: #211306; font-weight: 800; }
.step-row { display: grid; grid-template-columns: 1fr 48px 64px 48px; align-items: center; gap: 8px; margin-top: 10px; }
.step-row button { border: 1px solid var(--line); border-radius: 12px; background: #5a422f; color: white; font-size: 24px; }
.step-row strong { text-align: center; }
.step-row button:disabled { opacity: .35; cursor: default; }
.people-notice { margin-top: 10px; }
.people-notice[hidden], .receipt-note[hidden], .change-notice[hidden] { display: none; }
.receipt-note { margin-bottom: 14px; }
/* Request status dot (9/27): drawn, not an emoji, so it looks the same on every phone. */
.status-title { display: flex; align-items: center; gap: 10px; }
.status-title::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.status-wait { --dot: #f2c94c; }
.status-ok { --dot: #6fd06a; }
.status-kept { --dot: #b7aa96; }
.receipt-summary { margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(239,199,118,.35); border-radius: 12px; background: rgba(0,0,0,.18); color: var(--text); font-size: 14px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.receipt-summary[hidden] { display: none; }
.receipt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.receipt-head { margin-bottom: 12px; }
.receipt-head h2 { min-width: 0; margin: 0; }
.receipt-no { flex: none; font-size: 13px; font-weight: 700; padding: 3px 10px; border: 1px solid rgba(239,199,118,.6); border-radius: 999px; color: var(--gold); white-space: nowrap; }
.receipt-no[hidden] { display: none; }
.change-notice { margin: 14px 0 0; }
.prefill-notice { margin: 14px 0 0; border: 1px solid var(--gold2); color: var(--gold); }
.prefill-notice[hidden] { display: none; }
.category-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.category-row button { min-height: 46px; padding: 4px; font-size: 14px; }
.popular-block { margin-bottom: 16px; padding: 12px; border: 1px solid rgba(239,199,118,.48); border-radius: 15px; background: rgba(239,199,118,.08); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.section-heading h3 { margin: 0; }
.section-heading span { color: var(--muted); font-size: 12px; }
.menu-list { display: grid; gap: 8px; margin-top: 12px; }
.popular-list { margin-top: 0; }
.menu-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 62px; padding: 8px 10px 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: #2b1909; }
.menu-row.active { border-color: var(--gold); background: #43270f; }
.menu-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 700; }
.menu-name small { padding: 3px 6px; border-radius: 999px; background: var(--gold); color: #211306; font-size: 10px; }
.menu-price { display: block; margin-top: 5px; color: var(--gold); font-size: 13px; }
.paraffin-parts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.paraffin-part { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 4px 4px 10px; border: 1px solid var(--line); border-radius: 12px; }
.paraffin-part span { font-weight: 700; }
.menu-detail { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.inline-qty { display: grid; grid-template-columns: 42px 28px 42px; align-items: center; gap: 3px; }
.inline-qty button { min-height: 42px; border: 1px solid var(--line); border-radius: 50%; background: #5a422f; color: white; font-size: 22px; }
.inline-qty button:last-child { border-color: var(--gold); background: var(--gold); color: #211306; font-weight: 900; }
.inline-qty button:disabled { opacity: .35; cursor: default; }
.inline-qty strong { text-align: center; font-size: 16px; }
.count-check { min-height: 24px; margin: 0; padding: 8px 10px; border-radius: 10px; text-align: center; background: #211306; color: var(--bad); font-size: 13px; }
.count-check.ok { border: 1px solid #6eb776; color: var(--ok); }
.pickup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
#pickupPlaceWrap { display: grid; gap: 10px; }
#popularBlock[hidden], #intakeForm[hidden], .card[hidden] { display: none; }
#pickupPlaceWrap[hidden], #pickupSearchWrap[hidden], .pickup-notice[hidden] { display: none; }
#pickupLocal { min-height: 44px; }
.pickup-results { display: grid; gap: 6px; }
.pickup-results:empty { display: none; }
.pickup-results button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #2b1909; color: var(--text); text-align: left; font-size: 15px; }
.pickup-notice { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.summary-card p { margin-bottom: 0; line-height: 1.65; color: var(--muted); }
.form-error, .connection-status { min-height: 24px; text-align: center; }
.form-error { color: var(--bad); }
.connection-status { margin-bottom: 2px; color: var(--muted); font-size: 13px; }
.connection-status.ready { color: var(--ok); }
.connection-status.error { color: var(--bad); }
.primary:disabled { opacity: .55; cursor: wait; }
.primary, .secondary { border-radius: 14px; padding: 10px 16px; font-weight: 800; }
.primary { border: 0; background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #241304; }
.secondary { border: 1px solid var(--line); background: #2a1a0d; color: var(--text); }
.sticky-action-bar { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; gap: 8px; margin: 0 -4px; padding: 9px 4px max(10px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent 0, #1b0f04 25%); }
.sticky-submit { width: 100%; min-height: 56px; font-size: 18px; box-shadow: 0 8px 28px #000; }
dialog { width: min(calc(100% - 24px), 420px); max-height: calc(100dvh - 24px); padding: 16px; border: 1px solid var(--gold2); border-radius: 18px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.76); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 0; }
.dialog-head button { min-width: 48px; border: 0; background: transparent; color: white; font-size: 28px; }
.policy-points { padding-left: 22px; line-height: 1.6; }
details { margin: 12px 0; }
details summary { min-height: 48px; display: flex; align-items: center; color: var(--gold); cursor: pointer; }
details img { width: 100%; border-radius: 10px; }
.dialog-actions { position: sticky; bottom: -16px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; padding: 10px 0 16px; background: var(--panel); }
.done-dialog { text-align: center; }
.done-dialog .primary { width: 100%; }

@media (max-width: 365px) {
  .category-row { grid-template-columns: repeat(3, 1fr); }
  .menu-row { padding-left: 10px; }
  .inline-qty { grid-template-columns: 40px 24px 40px; }
  .sticky-action-bar { grid-template-columns: 1fr; }
}
