/* Layout: 주문 도구 — 상단 바, 왼쪽 상품 진열대(탭+일괄 담기+카드 격자), 오른쪽 고정 주문서. 관리자도 같은 토큰. */
:root {
  --wall: #f4f3ef; --paper: #ffffff; --ink: #23283a; --muted: #656b7b; --rule: #e1ded6;
  --sea: #2c6e73; --sea-soft: #e3eeec; --sun: #d99a3c; --sun-soft: #fbf0dc; --danger: #b3412f; --ok: #2f7d4f;
  --display: "Gowun Batang", "Nanum Myeongjo", serif;
  --body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --wall: #15181f; --paper: #1d212a; --ink: #e8e6e1; --muted: #a2a6b2; --rule: #2e333e;
    --sea: #7cc3c2; --sea-soft: #1f3335; --sun: #e9b25c; --sun-soft: #33291a; --danger: #ef8a78; --ok: #79c99a; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--wall); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.6; word-break: keep-all; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.3; }
.wrap { max-width: 1320px; margin: 0 auto; padding-inline: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--sea); background: var(--sea); color: var(--paper); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--sea); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.lg { padding: 13px 22px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
input:not([type=checkbox]):not([type=radio]), textarea, select { width: 100%; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; }
textarea { resize: vertical; }
label.f { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
.meta { font-size: 12.5px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--sea-soft); color: var(--sea); white-space: nowrap; }
.pill.warn { background: var(--sun-soft); color: var(--sun); }
.pill.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.pill.mute { background: var(--wall); color: var(--muted); }

.top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; gap: 14px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.brand b { font-family: var(--display); font-size: 20px; }
.brand span { font-size: 14px; color: var(--muted); }
.brand strong { color: var(--sea); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 8px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; }
.tabs button[aria-selected=true] { background: var(--sea-soft); color: var(--sea); font-weight: 700; }
.tabs small { font-weight: 400; opacity: .7; margin-left: 2px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; padding: 4px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--wall); padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 60; max-width: calc(100% - 32px); text-align: center; }

/* 진입 */
.enter { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.enter form { width: min(460px, 100%); background: var(--paper); border: 1px solid var(--rule); border-radius: 16px; padding: 34px 30px; display: grid; gap: 20px; }
.enter h1 { font-size: 26px; }
.enter p { margin: 0; color: var(--muted); font-size: 14px; }
.branches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 0; padding: 0; margin: 0; }
.branches label { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--rule); border-radius: 12px; padding: 14px 10px; cursor: pointer; font-weight: 700; font-size: 17px; }
.branches input { position: absolute; opacity: 0; pointer-events: none; }
.branches label:has(input:checked) { border-color: var(--sea); background: var(--sea-soft); color: var(--sea); }
.branches label:has(input:focus-visible) { outline: 2px solid var(--sun); outline-offset: 2px; }
.branches .other { grid-column: 1 / -1; }
.err { color: var(--danger); font-size: 13px; }

/* 진열대 */
.shop { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; padding-block: 20px 120px; }
.note-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.note-strip b { color: var(--ink); }
.quick { background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 16px; font-size: 14px; }
.quick .qlabel { font-weight: 700; color: var(--sea); font-size: 13px; }
.quick .qg { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.quick input[type=number] { width: 64px; padding: 5px 8px; text-align: center; }
.quick select { width: auto; padding: 5px 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.card.has { border-color: var(--sea); box-shadow: 0 0 0 2px var(--sea-soft); }
.card .ph { position: relative; aspect-ratio: 4 / 3; background: var(--wall); }
.card .ph img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
.card .star { position: absolute; top: 8px; left: 8px; font-size: 11.5px; font-weight: 700; background: var(--sun); color: #fff; border-radius: 999px; padding: 2px 8px; }
.card .cbody { padding: 10px 12px 12px; display: grid; gap: 6px; align-content: start; }
.card .nm { font-family: var(--display); font-size: 16px; font-weight: 700; }
.opts { display: grid; gap: 4px; }
.opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; border-top: 1px dashed var(--rule); }
.opt:first-child { border-top: 0; }
.opt .ol { display: grid; line-height: 1.35; }
.opt .ol small { color: var(--muted); font-size: 11.5px; }
.step { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; }
.step button { width: 30px; height: 30px; border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--sea); }
.step input { width: 40px !important; border: 0 !important; padding: 0 !important; text-align: center; background: transparent !important; border-radius: 0 !important; font-variant-numeric: tabular-nums; }
.step.on { border-color: var(--sea); background: var(--sea-soft); }

/* 주문서 패널 */
.cart { position: sticky; top: 80px; background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 18px; display: grid; gap: 14px; max-height: calc(100vh - 100px); overflow: auto; }
.cart h2 { font-size: 20px; display: flex; justify-content: space-between; align-items: baseline; }
.cgroup { display: grid; gap: 2px; }
.cgroup h3 { font-family: var(--body); font-size: 12px; color: var(--muted); letter-spacing: .04em; margin: 4px 0 2px; }
.cline { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; font-size: 13.5px; align-items: baseline; padding: 3px 0; }
.cline .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 2px; }
.cline span:first-child { overflow-wrap: anywhere; }
.totals { border-top: 1px solid var(--rule); padding-top: 10px; display: grid; gap: 4px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 18px; font-weight: 700; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 8px; border: 1px dashed var(--rule); border-radius: 10px; }
.confirm { background: var(--sun-soft); border-radius: 10px; padding: 12px; font-size: 14px; display: grid; gap: 10px; }
.mobile-bar { display: none; }

/* 주문 내역·관리자 공통 */
tr.gone td { color: var(--muted); }
tr.gone td:nth-child(-n+2) { text-decoration: line-through; }
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 18px 20px; display: grid; gap: 12px; min-width: 0; }
.list { display: grid; gap: 12px; }
.ohead { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.ohead b { font-size: 16px; }
.tbl-wrap { overflow-x: auto; }
table.t { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.t th, table.t td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 700; }
table.t td.r, table.t th.r { text-align: right; font-variant-numeric: tabular-nums; }
.done-box { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 30px 16px; }
.done-box h2 { font-size: 24px; }

@media (max-width: 960px) {
  .shop { grid-template-columns: minmax(0, 1fr); }
  .cart { position: fixed; inset: auto 0 0 0; top: auto; max-height: 85vh; border-radius: 16px 16px 0 0; z-index: 30; transform: translateY(105%); transition: transform .2s; box-shadow: 0 -10px 30px rgb(0 0 0 / .2); }
  .cart.open { transform: none; }
  .mobile-bar { display: flex; position: fixed; inset: auto 0 0 0; z-index: 25; background: var(--paper); border-top: 1px solid var(--rule); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); justify-content: space-between; align-items: center; gap: 12px; }
  .brand span { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .cart { transition: none; } }

.hist .reply { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--ok) 12%, transparent); border-left: 3px solid var(--ok); font-size: 14px; }
.hist .reply b { color: var(--ok); }
.hist .waiting { display: block; margin-top: 4px; }
/* 귀·눈으로 다시 확인해야 하는 수정 답변(음성 등) — 초록(✅) 대신 주황으로 구분 */
.hist .reply.recheck { background: color-mix(in srgb, #f76707 14%, transparent); border-left-color: #f76707; }
.hist .reply.recheck b { color: #e8590c; }
