/* GO주문 디자인 체계 — 토큰·공통 부품·런타임. 한 마크업을 data-theme(warm=A안 · civic=B안)으로 색·모서리·배치 전환 (시안 docs/design 과 구현 공용 단일 원본) */

/* ───────── 토큰 ───────── */
[data-theme="warm"] {
  --bg: #FFF8F1; --surface: #FFFFFF; --surface-2: #FFF3E8; --text: #2A1F17; --muted: #8A7B6F; --line: #F1E4D8;
  --primary: #F2542D; --primary-ink: #FFFFFF; --primary-soft: #FFE6DC; --primary-strong: #D9431F;
  --accent: #FFB627; --accent-soft: #FFF3D6; --accent-ink: #8A5A00;
  --success: #1F9D55; --danger: #D93025; --info: #2F6BFF;
  --r-lg: 22px; --r: 16px; --r-sm: 12px; --r-pill: 999px;
  --shadow: 0 3px 12px rgba(120, 70, 30, .08); --shadow-lg: 0 8px 24px rgba(120, 70, 30, .14);
  --tab-inactive: grayscale(0);
}
[data-theme="civic"] {
  --bg: #F4F6F5; --surface: #FFFFFF; --surface-2: #EEF2F0; --text: #14201C; --muted: #6B7773; --line: #E4E9E7;
  --primary: #0B7A5F; --primary-ink: #FFFFFF; --primary-soft: #E3F3EE; --primary-strong: #075E49;
  --accent: #E8A317; --accent-soft: #FDF4DF; --accent-ink: #7A5300;
  --success: #1F8A4C; --danger: #C62828; --info: #2456C9;
  --r-lg: 12px; --r: 10px; --r-sm: 8px; --r-pill: 8px;
  --shadow: none; --shadow-lg: 0 4px 16px rgba(20, 32, 28, .10);
  --tab-inactive: grayscale(1);
}

/* ───────── 기본 ───────── */
.app { background: var(--bg); color: var(--text); font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif; font-size: 14px; line-height: 1.5; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
.app * { box-sizing: border-box; }
.muted { color: var(--muted); }
.strong { font-weight: 800; }
.primary-text { color: var(--primary); }
.num { font-variant-numeric: tabular-nums; }
.later { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: #6B5CFF; color: #fff; vertical-align: 2px; margin-left: 4px; letter-spacing: 0; line-height: 1.5; }
.ico { width: 20px; height: 20px; stroke-width: 2; vertical-align: -4px; }
.ico-sm { width: 16px; height: 16px; stroke-width: 2.2; vertical-align: -3px; }

/* ───────── 상단 바 ───────── */
.appbar { display: flex; align-items: center; gap: 10px; padding: 6px 16px 12px; background: var(--bg); font-weight: 700; font-size: 16px; }
.appbar .title { flex: 1; font-size: 17px; font-weight: 800; }
.appbar .icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
[data-theme="civic"] .appbar { background: var(--surface); border-bottom: 1px solid var(--line); }

/* ───────── 하단 탭 ───────── */
.tabbar { flex: none; height: 64px; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; text-align: center; font-size: 11px; color: var(--muted); padding-top: 9px; }
.tabbar .ico { display: block; margin: 0 auto 2px; }
.tabbar .on { color: var(--primary); font-weight: 700; }

/* ───────── 버튼·입력 ───────── */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: var(--r); padding: 12px 16px; font: inherit; font-weight: 700; cursor: pointer; background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-outline { background: transparent; border: 1px solid var(--line); }
.btn-danger-outline { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 16px 18px; font-size: 16px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--r-sm); }
[data-theme="warm"] .btn-primary { box-shadow: 0 6px 16px rgba(242, 84, 45, .28); }
.field { display: block; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 12px 14px; font: inherit; color: var(--text); }
.input.focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: var(--r); padding: 12px 14px; color: var(--muted); }
[data-theme="warm"] .search { box-shadow: var(--shadow); }
[data-theme="civic"] .search { background: var(--bg); }

/* 칩·세그먼트·스위치 */
.chips { display: flex; gap: 8px; overflow: hidden; }
.chip { flex: none; padding: 8px 14px; border-radius: var(--r-pill); background: var(--surface); font-size: 13px; font-weight: 600; border: 1px solid var(--line); }
.chip.on { background: var(--text); color: #fff; border-color: var(--text); }
[data-theme="warm"] .chip { border-color: transparent; box-shadow: var(--shadow); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: var(--r); padding: 4px; gap: 4px; }
.seg > * { text-decoration: none; white-space: nowrap; text-align: center; padding: 9px 4px; border-radius: calc(var(--r) - 4px); font-weight: 700; font-size: 13px; color: var(--muted); }
.seg > .on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.switch { width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch.on { background: var(--primary); }
.switch.on::after { left: 21px; }
.radio, .check { width: 22px; height: 22px; flex: none; border: 2px solid var(--line); border-radius: 50%; display: grid; place-items: center; }
.check { border-radius: 6px; }
.radio.on { border-color: var(--primary); }
.radio.on::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.check.on { border-color: var(--primary); background: var(--primary); }
.check.on::after { content: "✓"; color: #fff; font-size: 13px; font-weight: 800; line-height: 1; }

/* 배지·태그 */
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.tag.gray { background: var(--surface-2); color: var(--muted); }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); }
.tag.danger { background: #FDE7E5; color: var(--danger); }
[data-theme="warm"] .tag { border-radius: 99px; }
.star { color: var(--accent); font-weight: 800; }

/* ───────── 면·목록 ───────── */
.section { padding: 0 16px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 16px 8px; font-weight: 800; font-size: 16px; }
.section-title small { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
[data-theme="civic"] .card { border: 1px solid var(--line); }
.card-pad { padding: 16px; }
.divider { height: 8px; background: var(--bg); }
[data-theme="warm"] .divider { height: 12px; }
.list { background: var(--surface); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row small { display: block; color: var(--muted); font-size: 12.5px; }
.kv { display: flex; justify-content: space-between; padding: 4px 0; }
.kv.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 16px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.notice.primary { background: var(--primary-soft); color: var(--primary-strong); }

/* 음식 사진 자리(시안) */
.food { display: grid; place-items: center; font-size: 34px; background: linear-gradient(135deg, #F6D1A8, #E79B63); flex: none; overflow: hidden; }
.food.f2 { background: linear-gradient(135deg, #F3E3B3, #D8B35C); }
.food.f3 { background: linear-gradient(135deg, #F7C6B4, #D9674A); }
.food.f4 { background: linear-gradient(135deg, #D9E8C4, #86B35D); }
.food.f5 { background: linear-gradient(135deg, #E8D6F0, #A77FC2); }
.food.f6 { background: linear-gradient(135deg, #CFE3F2, #6A9CC4); }

/* ───────── 공공 안내 ───────── */
.public { display: flex; gap: 12px; align-items: center; margin: 4px 16px 14px; padding: 16px; border-radius: var(--r-lg); background: linear-gradient(120deg, var(--primary), #FF8A4C); color: #fff; }
.public .seal { display: none; }
.public b { display: block; font-size: 16px; line-height: 1.35; }
.public span { font-size: 12.5px; opacity: .92; }
[data-theme="civic"] .public { background: var(--primary-soft); color: var(--primary-strong); padding: 12px 14px; }
[data-theme="civic"] .public .seal { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 800; font-size: 13px; }
[data-theme="civic"] .public b { font-size: 13.5px; color: var(--primary); }
[data-theme="civic"] .public span { opacity: 1; }

/* ───────── 업종 ───────── */
.cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 4px; padding: 0 12px 6px; }
.cat { text-align: center; font-size: 12px; font-weight: 600; }
.cat i { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 5px; border-radius: 18px; background: var(--surface); font-style: normal; font-size: 24px; box-shadow: var(--shadow); }
[data-theme="civic"] .cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 6px; }
[data-theme="civic"] .cat { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; }
[data-theme="civic"] .cat i { display: inline; width: auto; height: auto; margin: 0 3px 0 0; background: none; box-shadow: none; font-size: 14px; }
[data-theme="civic"] .cat.on { background: var(--text); color: #fff; border-color: var(--text); }

/* ───────── 가게 카드 (A: 큰 사진 카드 / B: 목록 행) ───────── */
.store { display: flex; flex-direction: column; background: var(--surface); margin: 0 16px 14px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.store .food { height: 118px; font-size: 44px; position: relative; }
.store .food .ribbon { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 700; background: #fff; color: var(--primary); padding: 3px 8px; border-radius: 99px; }
.store .info { padding: 12px 14px 14px; }
.store .name { font-size: 16px; font-weight: 800; }
.store .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.store .meta .dist, .store .meta .min { display: none; }
.store .tags { display: none; margin-top: 6px; gap: 4px; }
.store.closed { opacity: .55; }
[data-theme="civic"] .stores { background: var(--surface); border-top: 1px solid var(--line); }
[data-theme="civic"] .store { flex-direction: row; gap: 12px; margin: 0; padding: 14px 16px; border-radius: 0; border-bottom: 1px solid var(--line); box-shadow: none; }
[data-theme="civic"] .store .food { width: 76px; height: 76px; border-radius: 10px; font-size: 30px; }
[data-theme="civic"] .store .food .ribbon { display: none; }
[data-theme="civic"] .store .info { padding: 0; flex: 1; min-width: 0; }
[data-theme="civic"] .store .name { font-size: 15.5px; font-weight: 700; }
[data-theme="civic"] .store .meta .dist, [data-theme="civic"] .store .meta .min { display: inline; }
[data-theme="civic"] .store .tags { display: flex; }

/* ───────── 매장 상세 머리 ───────── */
.store-hero { height: 190px; font-size: 64px; position: relative; }
.store-head { position: relative; margin: -36px 16px 0; background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-lg); }
.store-head h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.store-head .meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.facts div { padding: 9px 4px; text-align: center; font-size: 11.5px; color: var(--muted); }
.facts div + div { border-left: 1px solid var(--line); }
.facts b { display: block; color: var(--text); font-size: 14px; margin-top: 2px; }
.store-head .tag { margin-top: 10px; }
[data-theme="civic"] .store-hero { display: none; }
[data-theme="civic"] .store-head { margin: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); }
.only-civic { display: none !important; }
[data-theme="civic"] .only-civic { display: flex !important; }
.float-back { position: absolute; left: 14px; top: 46px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .92); display: grid; place-items: center; color: #2A1F17; }

/* 메뉴 탭 (A: 칩 / B: 밑줄 탭) */
.menu-tabs { display: flex; gap: 8px; padding: 14px 16px 6px; overflow: hidden; }
.menu-tabs > * { flex: none; padding: 8px 14px; border-radius: 99px; background: var(--surface); font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.menu-tabs .on { background: var(--text); color: #fff; }
[data-theme="civic"] .menu-tabs { gap: 18px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
[data-theme="civic"] .menu-tabs > * { padding: 12px 0 10px; border-radius: 0; background: none; box-shadow: none; color: var(--muted); }
[data-theme="civic"] .menu-tabs .on { color: var(--text); border-bottom: 2.5px solid var(--text); }
.menu-group-title { padding: 16px 16px 4px; font-weight: 800; font-size: 15px; }

/* 메뉴 행 */
.menu-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.menu-item .txt { flex: 1; min-width: 0; }
.menu-item .name { font-size: 15px; font-weight: 700; }
.menu-item p { margin: 3px 0 6px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.menu-item .price { font-weight: 800; }
.menu-item .food { width: 88px; height: 88px; border-radius: var(--r); }
.menu-item.soldout { opacity: .45; }
[data-theme="civic"] .menu-item { background: var(--surface); }
[data-theme="civic"] .menu-item .food { width: 72px; height: 72px; font-size: 28px; }
[data-theme="civic"] .menu-item.soldout { opacity: 1; color: var(--muted); }
[data-theme="civic"] .menu-item.soldout .food { filter: grayscale(1); opacity: .5; }
.best { font-size: 10.5px; font-weight: 800; color: var(--primary); margin-right: 4px; }

/* 장바구니 바 (A: 떠 있는 알약 / B: 하단 고정) */
.cartbar { position: absolute; left: 14px; right: 14px; bottom: 16px; }
.cartbar > .hint { display: none; }
.cartbar .btn { width: 100%; justify-content: space-between; padding: 15px 18px; border-radius: 18px; font-size: 15px; }
.cartbar .count { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 99px; background: #fff; color: var(--primary); font-size: 13px; }
[data-theme="civic"] .cartbar { left: 0; right: 0; bottom: 0; padding: 10px 16px 18px; background: var(--surface); border-top: 1px solid var(--line); }
[data-theme="civic"] .cartbar > .hint { display: block; text-align: center; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
[data-theme="civic"] .cartbar .btn { border-radius: 12px; box-shadow: none; }
[data-theme="civic"] .cartbar .count { background: rgba(255, 255, 255, .2); color: #fff; }

/* 하단 시트 */
.dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .38); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 24px 24px 0 0; max-height: 86%; display: flex; flex-direction: column; overflow: hidden; }
[data-theme="civic"] .sheet { border-radius: 14px 14px 0 0; }
.sheet .grab { width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: 10px auto 4px; }
.sheet .body { flex: 1; overflow: hidden; padding: 6px 18px; }
.sheet .foot { padding: 12px 16px 18px; border-top: 1px solid var(--line); }
.opt-group { padding: 14px 0; border-bottom: 1px solid var(--line); }
.opt-group h4 { margin: 0 0 8px; font-size: 15px; display: flex; gap: 6px; align-items: center; }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; }
.opt .grow { flex: 1; }
.opt.soldout { color: var(--muted); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-pill); }
.stepper span { width: 36px; text-align: center; padding: 6px 0; font-weight: 700; }

/* ───────── 주문 진행 (A: 가로 막대 / B: 세로 타임라인) ───────── */
.progress { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 11.5px; color: var(--muted); text-align: center; }
.progress li::before { content: ""; display: block; height: 6px; border-radius: 99px; background: var(--line); margin-bottom: 6px; }
.progress li.done::before, .progress li.cur::before { background: var(--primary); }
.progress li.cur { color: var(--primary); font-weight: 800; }
.progress time { display: none; }
[data-theme="civic"] .progress { display: block; text-align: left; font-size: 13.5px; color: var(--text); }
[data-theme="civic"] .progress li { display: flex; align-items: flex-start; gap: 12px; position: relative; padding-bottom: 14px; }
[data-theme="civic"] .progress li::before { width: 12px; height: 12px; border-radius: 50%; margin: 4px 3px 0; flex: none; }
[data-theme="civic"] .progress li:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
[data-theme="civic"] .progress li.done::after { background: var(--primary); }
[data-theme="civic"] .progress li.cur::before { box-shadow: 0 0 0 4px var(--primary-soft); }
[data-theme="civic"] .progress time { display: inline; margin-left: auto; color: var(--muted); font-size: 12px; }
.map { position: relative; background: #F4EDE4; }
[data-theme="civic"] .map { background: #E8EEEB; }
.map svg { display: block; width: 100%; height: 100%; }
.map .road { stroke: #fff; }
.map .route { stroke: var(--primary); }
.map .me { fill: var(--accent); }
.map .rider { fill: var(--primary); }
.map .shop { fill: var(--text); }
.eta small { color: var(--muted); font-size: 13px; }
.eta b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.person { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface-2); }
.person .ava { width: 44px; height: 44px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.person .grow { flex: 1; font-size: 13px; color: var(--muted); }
.person .grow b { display: block; color: var(--text); font-size: 15px; }
.round-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; }
[data-theme="civic"] .person { background: var(--surface); border: 1px solid var(--line); }
[data-theme="civic"] .round-btn { border-radius: 8px; width: auto; height: auto; padding: 7px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }

/* 주문 카드 */
.order-card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px 16px; margin: 0 16px 12px; }
[data-theme="civic"] .order-card { margin: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); }
.order-card .top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.order-card .body { display: flex; gap: 12px; margin-top: 10px; }
.order-card .food { width: 56px; height: 56px; border-radius: var(--r-sm); font-size: 24px; }
.order-card .actions { display: flex; gap: 8px; margin-top: 12px; }
.order-card .actions .btn { flex: 1; }

/* 포인트 */
.wallet { margin: 4px 16px 0; padding: 20px; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--primary), #FF8A4C); color: #fff; }
.wallet small { opacity: .9; }
.wallet b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 12px; }
.wallet .row { display: flex; gap: 8px; font-size: 12.5px; }
.wallet .row span { flex: 1; background: rgba(255, 255, 255, .18); border-radius: 12px; padding: 8px 10px; }
.wallet .row em { display: block; font-style: normal; font-weight: 800; font-size: 14px; }
[data-theme="civic"] .wallet { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
[data-theme="civic"] .wallet b { color: var(--primary); }
[data-theme="civic"] .wallet .row span { background: var(--bg); }
.amount-plus { color: var(--primary); font-weight: 800; }
.amount-minus { color: var(--text); font-weight: 800; }

/* 테마 고르기 */
.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-pick .opt-card { width: 100%; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; border: 2px solid var(--line); border-radius: var(--r); padding: 10px; font-size: 12.5px; font-weight: 700; text-align: center; }
.theme-pick .opt-card.on { border-color: var(--primary); }
.theme-pick .swatch { height: 64px; border-radius: 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 5px; padding: 8px; }
.theme-pick .swatch i { display: block; height: 10px; border-radius: 4px; }

/* ═════════ 업무 앱(가맹점·배달원) ═════════ */
.work { display: flex; height: 100%; }
.side { width: 88px; flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 4px; }
.side .brand { width: 44px; height: 44px; border-radius: var(--r); background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; margin-bottom: 10px; }
.side a { width: 72px; padding: 9px 0; border-radius: var(--r); text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; position: relative; }
.side a .ico { display: block; margin: 0 auto 3px; width: 22px; height: 22px; }
.side a.on { background: var(--primary-soft); color: var(--primary-strong); }
.side a .dot { position: absolute; top: 5px; right: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; }
.side .spacer { flex: 1; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .title { font-size: 18px; font-weight: 800; }
.topbar .grow { flex: 1; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-strong); font-weight: 800; font-size: 13px; }
.state-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(31, 138, 76, .2); }
.stat { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.3; }
.stat b { display: block; font-size: 15px; color: var(--text); }

/* 칸반 */
.board { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 12px; min-height: 0; }
.col { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
.col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 14px; padding: 2px 4px; }
.col-head .n { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--surface-2); display: inline-grid; place-items: center; font-size: 12.5px; }
.col-head.alert .n { background: var(--danger); color: #fff; }
.ticket { background: var(--surface); border-radius: var(--r); padding: 12px 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.ticket .t-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); }
.ticket .t-top b { font-size: 15px; color: var(--text); }
.ticket .items { margin: 6px 0 8px; font-size: 13.5px; line-height: 1.5; }
.ticket .items small { color: var(--muted); }
.ticket .t-foot { display: flex; gap: 6px; align-items: center; }
.ticket .t-foot .btn { flex: 1; }
.ticket.new { border: 2px solid var(--danger); box-shadow: 0 0 0 4px rgba(217, 48, 37, .12); }
.ticket.late .t-top .timer { color: var(--danger); font-weight: 800; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.bar-timer { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 6px 0 10px; }
.bar-timer i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.bar-timer.warn i { background: var(--accent); }

/* 모달 */
.modal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 520px; background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden; }
.modal .m-head { padding: 18px 22px; background: var(--danger); color: #fff; display: flex; justify-content: space-between; align-items: center; }
.modal .m-head b { font-size: 20px; }
.modal .m-body { padding: 18px 22px; }
.modal .m-foot { padding: 0 22px 22px; }
.time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.time-grid .btn { flex-direction: column; padding: 14px 4px; font-size: 20px; font-weight: 800; background: var(--surface-2); }
.time-grid .btn small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.time-grid .btn.on { background: var(--primary); color: #fff; }
.time-grid .btn.on small { color: rgba(255, 255, 255, .85); }

/* 표 */
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }

/* 메뉴 관리 */
.split { flex: 1; display: grid; grid-template-columns: 230px 1fr; min-height: 0; }
.cat-list { background: var(--surface); border-right: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; }
.cat-row .grow { flex: 1; }
.cat-row small { color: var(--muted); font-weight: 500; }
.cat-row.on { background: var(--primary-soft); color: var(--primary-strong); }
.handle { color: var(--muted); cursor: grab; }
.menu-admin { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.menu-admin .food { width: 52px; height: 52px; border-radius: var(--r-sm); font-size: 22px; }
.menu-admin .grow { flex: 1; min-width: 0; }
.menu-admin .grow small { display: block; color: var(--muted); font-size: 12.5px; }
.menu-admin.off .food { filter: grayscale(1); opacity: .5; }
.menu-admin.off .name { color: var(--muted); }
.sold-seg { display: inline-grid; grid-auto-flow: column; background: var(--surface-2); border-radius: var(--r-sm); padding: 3px; gap: 2px; font-size: 12.5px; font-weight: 700; }
.sold-seg span { padding: 6px 10px; border-radius: calc(var(--r-sm) - 3px); color: var(--muted); white-space: nowrap; }
.sold-seg .on-sale { background: var(--surface); color: var(--success); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.sold-seg .on-today { background: var(--accent); color: #fff; }
.sold-seg .on-off { background: var(--text); color: #fff; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 400px; background: var(--surface); box-shadow: -10px 0 30px rgba(0, 0, 0, .15); display: flex; flex-direction: column; }
.drawer .d-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 16px; }
.drawer .d-body { flex: 1; overflow: hidden; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.drawer .d-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.photo-drop { height: 92px; border: 2px dashed var(--line); border-radius: var(--r); display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }
.linked { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; }
.linked .grow { flex: 1; }
.linked small { display: block; color: var(--muted); }

/* 배달원 — 밀어서 확정(오작동 방지)·큰 터치 영역 */
.slide { position: relative; height: 62px; border-radius: var(--r-pill); background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; overflow: hidden; }
[data-theme="civic"] .slide { border-radius: 14px; }
.slide .knob { border: 0; padding: 0; position: absolute; left: 5px; top: 5px; width: 52px; height: 52px; border-radius: calc(var(--r-pill) - 5px); background: #fff; color: var(--primary); display: grid; place-items: center; }
[data-theme="civic"] .slide .knob { border-radius: 10px; }
.slide .hint { opacity: .85; }
.slide.done { background: var(--success); }
.big-action { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.big-action .btn { flex-direction: column; padding: 14px 6px; font-size: 13px; }
.big-action .btn .ico { width: 24px; height: 24px; }
.job { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; margin: 0 16px 12px; }
[data-theme="civic"] .job { border: 1px solid var(--line); }
.job .route { display: grid; grid-template-columns: 18px 1fr; gap: 2px 10px; margin: 12px 0; font-size: 14px; }
.job .route i { width: 10px; height: 10px; border-radius: 50%; margin: 5px auto 0; background: var(--text); }
.job .route i.to { background: var(--primary); }
.job .route s { width: 2px; height: 16px; background: var(--line); margin: 0 auto; text-decoration: none; }
.job .route small { display: block; color: var(--muted); font-size: 12.5px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--success); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(31, 157, 85, .2); }
.live.off { color: var(--muted); }
.live.off::before { background: var(--muted); box-shadow: none; }

/* ═════════ 런타임(실제 앱) — 겹침 화면·토스트·드래그 ═════════ */
html, body { margin: 0; }
body.app { min-height: 100dvh; }
.overlay { display: none; position: fixed; inset: 0; z-index: 50; }
.overlay.open { display: block; }
.overlay .dim { position: fixed; animation: go-fade .15s ease-out; }
.overlay .sheet { position: fixed; max-width: 640px; margin: 0 auto; animation: go-up .2s ease-out; }
.overlay .modal { position: fixed; max-width: calc(100vw - 32px); animation: go-fade .15s ease-out; }
.overlay .drawer { position: fixed; max-width: 100vw; animation: go-left .2s ease-out; }
@keyframes go-fade { from { opacity: 0; } }
@keyframes go-up { from { transform: translateY(40px); opacity: .6; } }
@keyframes go-left { from { transform: translateX(40px); opacity: .6; } }
#go-toasts { position: fixed; left: 0; right: 0; bottom: 84px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--text, #222); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); transition: opacity .3s; }
.toast.error { background: var(--danger, #c62828); }
.toast.hide { opacity: 0; }
.sort-ghost { opacity: .4; }
.slide .knob { touch-action: none; cursor: grab; transition: transform .15s; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: inherit; }
button { font: inherit; }

/* 앱 틀 — 가운데 열(휴대폰 폭), 고정 하단 탭·상단 바·장바구니 바 */
.shell { max-width: 640px; margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; }
.shell.has-tabbar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.shell.has-cartbar { padding-bottom: 96px; }
.tabbar.fixed { position: fixed; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; z-index: 40; height: auto; padding: 9px 0 calc(9px + env(safe-area-inset-bottom)); }
.tabbar a { text-decoration: none; color: inherit; display: block; }
.appbar.sticky { position: sticky; top: 0; z-index: 30; }
.appbar a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; }
.cartbar.fixed { position: fixed; max-width: 612px; margin: 0 auto; z-index: 35; }
[data-theme="civic"] .cartbar.fixed { max-width: 640px; }
.cartbar a.btn { text-decoration: none; }
a.store, a.order-card, a.list-row { text-decoration: none; color: inherit; }
.page-pad { padding: 8px 16px 16px; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty .ico { width: 40px; height: 40px; display: block; margin: 0 auto 10px; stroke-width: 1.6; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
input.input, textarea.input, select.input { appearance: none; -webkit-appearance: none; outline: none; }
input.input:focus, textarea.input:focus, select.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.store-hero { background-size: cover; background-position: center; }
.menu-item .food img, .store .food img, .order-card .food img { width: 100%; height: 100%; object-fit: cover; }
.menu-item { background: transparent; border: 0; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.menu-item:disabled { cursor: default; }
.shell:has(.cartbar.fixed) { padding-bottom: 110px; }
.shell.has-tabbar:has(.cartbar.fixed) { padding-bottom: 180px; }
.shell.has-tabbar .cartbar.fixed { bottom: calc(80px + env(safe-area-inset-bottom)); }
[data-theme="civic"] .shell.has-tabbar .cartbar.fixed { bottom: calc(64px + env(safe-area-inset-bottom)); border-bottom: 1px solid var(--line); }
.pwa-install { display: flex; flex-direction: column; gap: 8px; }
.pwa-install [hidden] { display: none !important; }
.overlay .sheet .body { overflow: auto; }
/* 실제 입력 요소를 라디오·체크 모양으로 */
input.radio, input.check { appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; background: var(--surface); }
input.radio:checked { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 0 5px, transparent 5.5px); }
input.check:checked { border-color: var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat; }
input.radio:disabled, input.check:disabled { opacity: .4; cursor: default; }
label.opt { cursor: pointer; }
.stepper button { width: 36px; padding: 6px 0; border: 0; background: none; font-weight: 800; font-size: 16px; color: var(--text); cursor: pointer; }
.stepper input { width: 36px; border: 0; text-align: center; font: inherit; font-weight: 700; background: none; color: var(--text); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.menu-group-anchor { scroll-margin-top: 64px; }
.menu-tabs.sticky { position: sticky; top: 0; z-index: 20; background: var(--bg); }
[data-theme="civic"] .menu-tabs.sticky { background: var(--surface); }
.menu-tabs a { text-decoration: none; color: inherit; }
.menu-tabs { overflow-x: auto; scrollbar-width: none; }
.sheet-slot { display: contents; }
.sheet-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
fieldset.opt-group { border: 0; border-bottom: 1px solid var(--line); margin: 0; min-width: 0; }
fieldset.opt-group:last-of-type { border-bottom: 0; }
.opt-group legend { padding: 0; width: 100%; }
.app a.cat, .app a.search, .app a.chip, .app a.tag { text-decoration: none; color: inherit; }
.app a.chip.on { color: #fff; }

/* 리뷰 — 별점 입력(오른쪽부터 채움 트릭), 칭찬 태그 칩, 사진 칸, 별점 분포 */
.stars-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-input label { font-size: 40px; line-height: 1; color: var(--line); cursor: pointer; transition: color .1s; }
.stars-input input:checked ~ label, .stars-input label:hover, .stars-input label:hover ~ label { color: var(--accent); }
.stars-input input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 4px; }
label.chip { cursor: pointer; }
label.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.chip:has(input:checked) { background: var(--text); color: #fff; border-color: var(--text); }
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-row .ph { width: 72px; height: 72px; border-radius: var(--r-sm); background: var(--surface-2); display: grid; place-items: center; color: var(--muted); overflow: hidden; position: relative; }
.photo-row .ph img { width: 100%; height: 100%; object-fit: cover; }
label.ph { cursor: pointer; border: 2px dashed var(--line); background: var(--surface); }
.review-card { padding: 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.review-card .head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.review-card .stars { color: var(--accent); font-size: 14px; letter-spacing: 1px; }
.review-card .text { font-size: 14px; margin: 6px 0; white-space: pre-line; }
.review-card .photos { display: flex; gap: 6px; margin: 8px 0; overflow-x: auto; }
.review-card .photos img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.review-card .reply { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; }
.rating-summary { display: flex; gap: 18px; align-items: center; padding: 18px 16px; background: var(--surface); }
.rating-summary .big { font-size: 38px; font-weight: 800; line-height: 1; }
.rating-bars { flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.rating-bars div { display: flex; align-items: center; gap: 6px; }
.rating-bars i { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rating-bars i b { display: block; height: 100%; background: var(--accent); }
.sort-row { display: flex; gap: 6px; padding: 4px 16px 0; overflow-x: auto; scrollbar-width: none; }
.sort-row a { flex: none; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 5px 10px; border-radius: var(--r-pill); }
.sort-row a.on { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
[data-theme="civic"] .sort-row a.on { border: 1px solid var(--line); }
input.toggle { appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
input.toggle::before { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: left .15s; }
input.toggle:checked { background: var(--primary); }
input.toggle:checked::before { left: 21px; }

/* ═════════ 업무 앱 틀(가맹점) — 넓으면 세로 메뉴, 좁으면 하단 탭 ═════════ */
body.merchant .work { min-height: 100dvh; }
body.merchant .side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
body.merchant .side a { display: block; }
body.merchant .side .brand { display: grid; color: #fff; }
body.merchant .main { min-height: 100dvh; }
body.merchant .topbar { position: sticky; top: 0; z-index: 30; flex-wrap: wrap; }
body.merchant .page { padding: 14px 16px 28px; }
.m-only { display: none !important; }
@media (max-width: 860px) {
  body.merchant .side { display: none; }
  body.merchant .main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .m-only { display: grid !important; }
  .d-only { display: none !important; }
  body.merchant .topbar .stat { display: none; }
}
.state-pill.closed { background: var(--surface-2); color: var(--muted); }
.state-pill.closed::before { background: var(--muted); box-shadow: none; }
.state-pill.paused { background: var(--accent-soft); color: var(--accent-ink); }
.state-pill.paused::before { background: var(--accent); box-shadow: none; }
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
[data-theme="civic"] .panel { border: 1px solid var(--line); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 800; }
.table-wrap { overflow-x: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.kpis .card b { display: block; font-size: 21px; letter-spacing: -.02em; }
.seg > button { border: 0; background: none; cursor: pointer; font: inherit; }
body.merchant .board { align-items: start; }
body.merchant .ticket { transition: box-shadow .15s; }
body.merchant .ticket:hover { box-shadow: var(--shadow-lg); }
@media (max-width: 860px) {
  body.merchant .board { grid-template-columns: 1fr; }
  body.merchant .board [data-col-panel] { display: none; }
  body.merchant .board [data-col-panel].col-active { display: flex; }
  body.merchant .board .col-head { display: none; }
}
.overlay .drawer { width: min(420px, 100vw); }
.modal .m-body { max-height: calc(100dvh - 220px); overflow-y: auto; }
