:root {
  --blue: #08a0e1;
  --blue-ink: #0788c0;
  --blue-weak: #e6f5fc;
  --blue-halo: #d6effa;
  --ink: #14212b;
  --ink-2: #3b4a55;
  --muted: #66757f;
  --muted-2: #97a3ac;
  --line: #dce3e8;
  --line-soft: #edf1f4;
  --bg: #f4f7f9;
  --card: #ffffff;
  --ok: #1db66b;
  --danger: #e5484d;
  --warn-bg: #fff1e2;
  --warn: #b4570a;
  --photo: repeating-linear-gradient(135deg, #e3ecf2 0 8px, #edf3f7 8px 16px);
  --bottom-pad: calc(12px + env(safe-area-inset-bottom));
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #e9eef2;
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
input, textarea, button { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
#app { position: relative; max-width: 480px; min-height: 100vh; margin: 0 auto; background: var(--bg); padding-bottom: 120px; }
.loading { padding: 80px 16px; text-align: center; color: var(--muted); }
.page { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border-radius: 18px; padding: 18px; }
.card-title { font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.5; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }
.error { color: var(--danger); }

/* 상단바 */
.topbar { position: sticky; top: 0; z-index: 5; height: 52px; padding: 0 8px; padding-top: env(safe-area-inset-top); box-sizing: content-box; display: flex; align-items: center; background: #fff; }
.topbar h1 { margin: 0; font-size: 17px; font-weight: 700; }
.topbar .back { width: 44px; height: 44px; border: 0; background: none; font-size: 26px; display: grid; place-items: center; }
.topbar .tag { margin-left: auto; margin-right: 12px; }
.tag { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 6px; }
.tag.warn { color: var(--warn); background: var(--warn-bg); }

/* 하단 고정 버튼 영역 */
.bottom { position: fixed; z-index: 6; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; padding: 12px 16px var(--bottom-pad); background: var(--bg); display: flex; gap: 8px; }
.bottom.white { background: #fff; border-top: 1px solid var(--line-soft); }
.bottom.fade { background: linear-gradient(rgba(244, 247, 249, 0), var(--bg) 30%); }
.btn { flex: 1; height: 56px; border: 0; border-radius: 16px; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.soft { background: var(--blue-weak); color: var(--blue-ink); }
.btn.gray { background: var(--line-soft); color: var(--ink-2); flex: 0 0 100px; }
.btn.off { background: var(--line); color: #7a8893; }
.btn:disabled { opacity: .6; }

/* 메뉴 목록 */
.hero { background: var(--blue); padding: calc(6px + env(safe-area-inset-top)) 16px 52px; display: flex; align-items: center; justify-content: space-between; }
.hero img { height: 50px; display: block; }
.pill { border: 0; border-radius: 20px; padding: 8px 12px; font-size: 13px; font-weight: 700; background: #fff; color: var(--blue-ink); }
.store-card { margin: -38px 16px 0; position: relative; background: #fff; border-radius: 18px; padding: 16px 18px; box-shadow: 0 6px 20px rgba(20, 33, 43, .08); display: flex; flex-direction: column; gap: 10px; }
.store-status { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.dot.off { background: var(--muted-2); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.tile span { display: block; font-size: 12px; color: var(--muted); }
.tile b { display: block; font-size: 17px; margin-top: 2px; }

.tabs { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 16px 16px 10px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; border: 0; border-radius: 20px; padding: 9px 15px; font-size: 14px; font-weight: 700; background: #fff; color: var(--ink-2); }
.tab.on { background: var(--ink); color: #fff; }

.menus { display: flex; flex-direction: column; gap: 10px; padding: 4px 16px; }
.menu { display: flex; gap: 14px; background: #fff; border-radius: 16px; padding: 12px; width: 100%; border: 0; text-align: left; }
.photo { position: relative; flex-shrink: 0; overflow: hidden; background: var(--photo); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu .photo { width: 96px; height: 96px; border-radius: 12px; }
.soldout-cover { position: absolute; inset: 0; background: rgba(20, 33, 43, .55); color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.menu .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 2px 0; }
.menu.soldout .info { opacity: .45; }
.menu .name { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; }
.best { font-size: 11px; font-weight: 700; color: var(--blue-ink); background: var(--blue-weak); padding: 2px 6px; border-radius: 6px; }
.menu .desc { font-size: 13px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu .price { font-size: 16px; font-weight: 700; margin-top: auto; }

.a2hs-card { margin: 20px 16px 0; border: 1.5px dashed #b9d9ea; border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; width: calc(100% - 32px); background: none; text-align: left; }
.a2hs-card b { display: block; font-size: 14px; }
.a2hs-card small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.a2hs-card .chev { font-size: 20px; color: var(--blue-ink); }

.cartbar { justify-content: space-between; padding: 0 20px; box-shadow: 0 8px 20px rgba(8, 160, 225, .35); }
.cartbar .left { display: flex; align-items: center; gap: 8px; }
.count { background: #fff; color: var(--blue-ink); border-radius: 12px; min-width: 24px; height: 24px; font-size: 13px; display: grid; place-items: center; padding: 0 6px; }

/* 메뉴 상세 */
.detail { background: #fff; min-height: 100vh; }
.detail .photo { width: 100%; height: 280px; }
.round-back { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; font-size: 22px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); display: grid; place-items: center; }
.section { padding: 20px 20px 12px; border-bottom: 8px solid var(--bg); }
.section.head { padding: 22px 20px 18px; }
.section h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.section .desc { font-size: 14px; color: var(--muted); line-height: 1.55; margin-top: 8px; }
.section .price { font-size: 20px; font-weight: 800; margin-top: 12px; }
.group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 16px; font-weight: 700; }
.req { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #f0f3f5; color: var(--muted); }
.req.on { background: var(--blue-weak); color: var(--blue-ink); }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.mark { width: 22px; height: 22px; flex-shrink: 0; border: 2px solid #c9d3da; background: #fff; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; }
.opt input[type=radio] + .mark { border-radius: 50%; }
.opt input:checked + .mark { border-color: var(--blue); background: var(--blue); }
.opt input:checked + .mark::after { content: '✓'; }
.opt input:focus-visible + .mark { outline: 2px solid var(--blue-ink); outline-offset: 2px; }
.opt .label { flex: 1; font-size: 15px; }
.opt .extra { font-size: 14px; color: var(--muted); }
.qty-row { padding: 20px; display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 700; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 20px; }
.stepper span { min-width: 28px; text-align: center; font-size: 16px; font-weight: 700; }
.stepper.sm { border-radius: 10px; }
.stepper.sm button { width: 34px; height: 34px; font-size: 17px; }
.stepper.sm span { min-width: 20px; font-size: 14px; }

/* 장바구니 */
.cart-card { padding: 6px 18px; }
.cart-row { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.cart-row .info { flex: 1; min-width: 0; }
.cart-row .name { font-size: 15px; font-weight: 700; }
.cart-row .opts { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.cart-row .line { font-size: 15px; font-weight: 700; margin-top: 6px; }
.cart-row .side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.remove { border: 0; background: none; color: var(--muted-2); font-size: 18px; padding: 0; }
.more { width: 100%; border: 0; background: none; padding: 14px 0; font-size: 14px; font-weight: 700; color: var(--blue-ink); }
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.hours { display: flex; gap: 8px; overflow-x: auto; margin: 14px -18px 0; padding: 2px 18px; scrollbar-width: none; scroll-snap-type: x proximity; }
.hours::-webkit-scrollbar { display: none; }
.hour { flex: 0 0 auto; min-width: 72px; height: 54px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; scroll-snap-align: center; }
.hour b { font-size: 15px; }
.hour small { font-size: 11px; font-weight: 600; color: var(--muted); }
.hour.picked small { color: var(--blue-ink); }
.hour.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.hour.on small { color: #c9d3da; }
.hour:disabled { border-color: var(--line-soft); background: var(--bg); color: #a9b4bc; cursor: not-allowed; }
.slots.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.slot { height: 54px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.slot b { font-size: 15px; }
.slot small { font-size: 11px; font-weight: 600; }
.slot.on { border-color: var(--blue); background: var(--blue); color: #fff; }
.slot:disabled { border-color: var(--line-soft); background: var(--bg); color: #a9b4bc; cursor: not-allowed; }
.link { border: 0; background: none; color: var(--blue-ink); font-size: 13px; font-weight: 700; padding: 0; }
textarea, .input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 16px; outline: none; background: #fff; }
textarea { resize: none; font-size: 14px; }
.input { height: 50px; }
textarea:focus, .input:focus { border-color: var(--blue); }
.total-row { display: flex; justify-content: space-between; align-items: center; }
.total-row b { font-size: 20px; font-weight: 800; }

/* 주문자 정보 */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span:first-child { font-size: 14px; font-weight: 700; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv span { color: var(--muted); flex-shrink: 0; }
.kv b { text-align: right; }
.kv.total { padding-top: 12px; border-top: 1px solid var(--line-soft); }
.kv.total span { color: var(--ink); font-weight: 700; }
.kv.total b { font-size: 18px; font-weight: 800; }
.agree { display: flex; align-items: flex-start; gap: 10px; padding: 4px; cursor: pointer; font-size: 13px; color: var(--ink-2); line-height: 1.5; position: relative; }

/* 결제 (테스트) */
.pay { background: #fff; min-height: 100vh; }
.pay-amount { padding: 24px 20px; display: flex; flex-direction: column; gap: 6px; border-bottom: 8px solid var(--bg); }
.pay-amount .big { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.timer { margin-top: 10px; background: var(--bg); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-2); }
.timer b { font-size: 16px; font-weight: 800; color: var(--blue-ink); font-variant-numeric: tabular-nums; }
.methods { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.method { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; font-weight: 600; position: relative; }
.method input { position: absolute; opacity: 0; }
.method .ring { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c9d3da; display: grid; place-items: center; }
.method:has(input:checked) { border-color: var(--blue); background: #f2fafe; }
.method input:checked + .ring { border-color: var(--blue); }
.method input:checked + .ring::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }

/* 주문 상태 */
.status-hero { position: relative; background: var(--blue); color: #fff; padding: calc(28px + env(safe-area-inset-top)) 24px 64px; text-align: center; }
.hero-back { position: absolute; left: 8px; top: calc(4px + env(safe-area-inset-top)); width: 44px; height: 44px; display: grid; place-items: center; font-size: 30px; color: #fff; }
.status-hero.gray { background: #5b6b77; }
.status-hero .label { font-size: 14px; font-weight: 600; }
.status-hero .no { font-size: 56px; font-weight: 800; line-height: 1.1; margin-top: 4px; letter-spacing: -.02em; }
.status-hero .head { font-size: 20px; font-weight: 700; margin-top: 12px; text-wrap: balance; }
.status-hero .sub { font-size: 14px; margin-top: 6px; line-height: 1.5; }
.status-card { margin: -40px 16px 0; position: relative; background: #fff; border-radius: 18px; padding: 20px; box-shadow: 0 6px 20px rgba(20, 33, 43, .08); }
.status-card .pickup { display: flex; justify-content: space-between; align-items: center; }
.status-card .pickup span { font-size: 14px; color: var(--muted); }
.status-card .pickup b { font-size: 20px; font-weight: 800; }
.steps { list-style: none; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line-soft); }
.step { display: flex; gap: 14px; }
.step .rail { display: flex; flex-direction: column; align-items: center; width: 22px; }
.step .dot2 { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; background: var(--line); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.step .bar { flex: 1; width: 2px; min-height: 18px; background: #e5eaee; }
.step:last-child .bar { background: transparent; }
.step .txt { padding: 1px 0 18px; font-size: 15px; font-weight: 500; color: var(--muted-2); }
.step.done .dot2, .step.cur .dot2 { background: var(--blue); }
.step.done .dot2::after { content: '✓'; }
.step.done .bar { background: var(--blue); }
.step.cur .dot2 { box-shadow: 0 0 0 5px var(--blue-halo); }
.step.done .txt { color: var(--ink); }
.step.cur .txt { color: var(--ink); font-weight: 800; }
.items-card { margin: 12px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.item span { color: var(--ink-2); }
.item small { display: block; font-size: 12px; color: #7a8893; }
.item b { font-weight: 600; white-space: nowrap; }
.item.total { padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 15px; }
.item.total span, .item.total b { color: var(--ink); font-weight: 800; }
.status-actions { margin: 12px 16px 0; display: flex; flex-direction: column; gap: 8px; }

/* 내 주문 */
.my-order { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.my-order .no { min-width: 48px; height: 48px; border-radius: 12px; background: var(--blue-weak); color: var(--blue-ink); font-size: 20px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }
.my-order .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.my-order .info b { font-size: 15px; }
.my-order .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--blue-weak); color: var(--blue-ink); white-space: nowrap; }
.st-ready { background: var(--ok); color: #fff; }
.st-done { background: #f0f3f5; color: var(--muted); }
.st-rejected, .st-cancelled { background: #fdecec; color: #c4262b; }
.order-link { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; }

/* 홈 화면 추가 시트 */
.dim { position: fixed; inset: 0; background: rgba(16, 22, 27, .45); z-index: 20; }
.sheet { position: fixed; z-index: 21; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; background: #fff; border-radius: 24px 24px 0 0; padding: 12px 22px calc(22px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
@keyframes up { from { transform: translate(-50%, 100%); } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.grabber { touch-action: none; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 18px; }
.sheet-head { display: flex; align-items: center; gap: 14px; }
.app-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--blue) url(icons/icon-192.png) center / cover; flex-shrink: 0; }
.sheet-head b { display: block; font-size: 18px; font-weight: 800; }
.sheet-head small { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #f0f3f5; border-radius: 12px; padding: 4px; margin-top: 20px; }
.seg button { height: 38px; border: 0; border-radius: 9px; font-size: 14px; font-weight: 700; background: transparent; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.guide { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.guide li { display: flex; align-items: center; gap: 14px; font-size: 15px; line-height: 1.45; }
.guide .n { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-weak); color: var(--blue-ink); font-size: 14px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.guide b { color: var(--blue-ink); }
.sheet .note { font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.sheet .btn { flex: none; width: 100%; margin-top: 24px; height: 56px; }

.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: rgba(20, 33, 43, .92); color: #fff; font-size: 14px; font-weight: 600; padding: 12px 18px; border-radius: 24px; z-index: 30; max-width: calc(100% - 32px); text-align: center; }

/* 사업자 정보 · 약관 */
.biz { margin: 28px 16px 0; padding-top: 18px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.biz b { flex-basis: 100%; font-size: 12px; color: var(--ink-2); }
.biz a { text-decoration: underline; }
.biz-links, .policy-links { flex-basis: 100%; display: flex; gap: 14px; margin-top: 4px; }
.biz-links button, .policy-links button { border: 0; background: none; padding: 4px 0; font-size: 12px; font-weight: 700; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.policy-links { margin: -6px 0 0 36px; }
.sheet.policy { max-height: 88vh; display: flex; flex-direction: column; }
.sheet.policy h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.policy-text { overflow-y: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.7; color: var(--ink-2); -webkit-overflow-scrolling: touch; }
.sheet.policy .btn { margin-top: 16px; }
.sheet.snap { transition: transform .2s ease-out; }
