/* ==========================================================================
   부산어디 Pay — 데모 UI
   공통 디자인 시스템(projects/docs/DESIGN-SYSTEM.md)의 토큰을 그대로 쓴다.
   라이트 단일 · 1px 선 · 숫자 중심 · 브랜드 오렌지는 행동에만.
   ========================================================================== */

@font-face {
  font-family: "Pretendard Variable";
  src: url("../fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-display: swap;
}

:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --surface-2: #f1f3f6;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #9aa1ac;
  --line: #e5e8ec;
  --line-2: #eef0f3;
  --brand: #f26b3a;
  --brand-ink: #0e2a44;
  --brand-soft: #fff1ea;
  --brand-deep: #b4451c;
  --ok: #0e9f6e;
  --ok-soft: #e9f8f2;
  --warn: #d97706;
  --warn-soft: #fdf3e5;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --focus: #2563eb;
  --sol-a: #9945ff;
  --sol-b: #14f195;
  --r-card: 16px;
  --r-input: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-up: 0 12px 32px rgba(16, 24, 40, 0.12);
  --sidebar: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
h1, h2, h3, h4, p, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sub { color: var(--ink-2); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- 공통 컴포넌트 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.06s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  display: flex; align-items: center; justify-content: center; width: 100%;
  height: 52px; border: 0; border-radius: 14px; background: var(--brand); color: #fff;
  font-weight: 700; font-size: 16.5px; letter-spacing: -0.01em;
  box-shadow: 0 6px 16px rgba(242, 107, 58, 0.24);
  transition: background 0.15s, transform 0.06s, box-shadow 0.15s;
}
.btn-primary:hover { background: #e85f2c; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { background: #f3b7a2; box-shadow: none; cursor: default; }
.btn-ghost {
  border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13.5px;
  padding: 8px 6px; border-radius: 8px;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 18px 20px 0;
}
.card-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.card-head .hint { font-size: 12px; color: var(--ink-3); }
.card-body { padding: 14px 20px 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); color: #0b7a55; }
.chip.warn { background: var(--warn-soft); color: #a15a05; }
.chip.danger { background: var(--danger-soft); color: #a71d1d; }
.chip.brand { background: var(--brand-soft); color: var(--brand-deep); }
.chip.line { background: transparent; border: 1px solid var(--line); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-mode {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
}
.badge-mode i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); display: block; }
.badge-mode.devnet i { background: var(--ok); }

table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  background: var(--surface-2); padding: 9px 12px; letter-spacing: 0.02em;
}
table.data th:first-child { border-radius: 8px 0 0 8px; }
table.data th:last-child { border-radius: 0 8px 8px 0; }
table.data td { padding: 12px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: #fafbfc; }
table.data .amt { text-align: right; font-weight: 600; }
table.data .neg { color: var(--ink-2); }

.empty { padding: 28px 4px; text-align: center; color: var(--ink-3); font-size: 13px; }

input[type="text"], input[type="number"], input[type="email"], select, textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r-input);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 14.5px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
label.field .helptext { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }

.alert { border-radius: 12px; padding: 12px 14px; font-size: 13px; display: flex; gap: 9px; align-items: flex-start; }
.alert.error { background: var(--danger-soft); color: #a71d1d; }
.alert.warn { background: var(--warn-soft); color: #8a4c04; }
.alert.info { background: var(--brand-soft); color: var(--brand-deep); }

/* ---------------------------------------------------------------- 사장님 셸 */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--brand-ink); color: #fff; padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh;
}
.brandmark { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brandmark .logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand); display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #fff; letter-spacing: -0.03em;
}
.brandmark .name { font-weight: 700; letter-spacing: -0.01em; font-size: 15.5px; }
.brandmark .role { font-size: 11px; color: #93a6bd; letter-spacing: 0.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: #c6d2e1; white-space: nowrap;
}
.nav a svg { flex: 0 0 16px; opacity: .9; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, 0.13); color: #fff; font-weight: 600; }
.nav a .ico { width: 16px; text-align: center; opacity: 0.8; font-size: 13px; }
.nav .sep { font-size: 10.5px; letter-spacing: 0.08em; color: #6f839c; padding: 16px 12px 6px; }
.sidebar-foot { margin-top: auto; font-size: 11px; color: #7f93ac; line-height: 1.7; padding: 0 8px; }
.sidebar-foot b { color: #c6d2e1; font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 16px 28px; background: rgba(246, 247, 249, 0.86);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.topbar .spacer { flex: 1; }
.topbar .date { font-size: 12.5px; color: var(--ink-3); }
.merchant-pick { display: flex; align-items: center; gap: 8px; }
.merchant-pick select { height: 34px; width: auto; padding: 0 30px 0 11px; font-size: 12.5px; font-weight: 600; border-radius: 9px; background: var(--surface); }
.content { padding: 24px 28px 48px; max-width: 1220px; width: 100%; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px 15px; box-shadow: var(--shadow); }
.stat .label { font-size: 12px; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 14px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: 2px; }
.stat .foot { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.stat.accent { background: var(--brand-soft); border-color: #ffd9c8; }
.stat.accent .value { color: var(--brand-deep); }

.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 148px; padding: 8px 0 0; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: flex-end; height: 100%; }
.bars .bar .col { width: 100%; max-width: 46px; border-radius: 7px 7px 3px 3px; background: #ffd9c8; position: relative; transition: background .15s; }
.bars .bar.on .col { background: var(--brand); }
.bars .bar .col:hover { background: var(--brand); }
.bars .bar .v { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bars .bar .d { font-size: 11px; color: var(--ink-3); }
.bars .bar.on .d { color: var(--ink); font-weight: 700; }

.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.list .item:last-child { border-bottom: 0; }
.list .item .t { width: 46px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.list .item .who { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .item .amt { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }

.steps { display: flex; gap: 6px; margin: 14px 0 10px; }
.steps .s { flex: 1; height: 5px; border-radius: 99px; background: var(--line); }
.steps .s.on { background: var(--brand); }
.step-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); }
.step-labels b { color: var(--ink); font-weight: 700; }
.settle-card .big { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.settle-card .when { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

/* ---------------------------------------------------------------- 모바일 결제 화면 */
.stage {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(1000px 420px at 50% -10%, rgba(242, 107, 58, 0.10), transparent 70%),
    linear-gradient(180deg, #f8f6f4 0%, var(--bg) 55%);
}
.phone {
  width: 390px; max-width: 100%; background: var(--surface); border-radius: 30px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(14, 42, 68, 0.14), 0 2px 6px rgba(14, 42, 68, 0.06);
  display: flex; flex-direction: column; min-height: 690px;
}
.phone-bar {
  height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  border-bottom: 1px solid var(--line-2);
}
.phone-bar .t { font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: -0.01em; }
.icon-btn {
  width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2);
  display: grid; place-items: center; font-size: 15px;
}
.icon-btn:hover { background: var(--surface-2); }
.sheet { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.shop-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.shop-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.divider { height: 1px; background: var(--line-2); margin: 18px 0 0; }

.amount { text-align: center; padding: 24px 0 4px; }
.amount .krw { font-size: 40px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.amount .krw .cur { font-size: 22px; font-weight: 600; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.amount .usdc { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.amount .fx { font-size: 11.5px; color: var(--ink-3); margin-top: 7px; }
.reward {
  display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand-soft);
  color: var(--brand-deep); font-size: 13px; font-weight: 600; padding: 11px; border-radius: 12px; margin: 20px 0 4px;
}
.reward b { font-weight: 800; }

.rows { margin: 6px 0 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.row:last-child { border-bottom: 0; }
.row > span:first-child { color: var(--ink-3); font-weight: 500; }
.row .v { color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.row .v .chev { color: var(--ink-3); font-weight: 400; }
.spacer { flex: 1; }

.countdown { text-align: center; font-size: 12px; color: var(--ink-3); margin: 18px 0 10px; font-variant-numeric: tabular-nums; }
.countdown.warn { color: var(--danger); font-weight: 600; }
.pay-note { text-align: center; font-size: 11px; color: var(--ink-3); margin-top: 12px; line-height: 1.6; }
.pay-note a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }

details.qr-fold { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
details.qr-fold summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 11px 0; list-style: none; }
details.qr-fold summary::-webkit-details-marker { display: none; }
details.qr-fold .qr-body { display: flex; gap: 12px; align-items: center; padding: 0 0 12px; }
details.qr-fold img { width: 96px; height: 96px; border-radius: 8px; border: 1px solid var(--line); }
details.qr-fold .uri { font-size: 10.5px; color: var(--ink-3); word-break: break-all; line-height: 1.5; }

/* 성공 화면 */
.done-wrap { padding: 34px 22px 24px; text-align: center; }
.done-mark {
  width: 64px; height: 64px; border-radius: 50%; margin: 6px auto 18px; display: grid; place-items: center;
  background: #fff; position: relative; color: var(--ok); font-size: 30px; font-weight: 700;
  box-shadow: 0 0 0 3px transparent;
}
.done-mark::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sol-a), var(--sol-b));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: pop 0.4s ease-out;
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done-wrap h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.done-amount { font-size: 34px; font-weight: 700; letter-spacing: -0.04em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.done-points { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.done-points b { color: var(--brand-deep); }
.receipt-card { text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-top: 22px; background: var(--surface); }
.receipt-card .head { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-bottom: 10px; font-weight: 600; }
.receipt-card .line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 5px 0; }
.receipt-card .line span:first-child { color: var(--ink-2); }
.receipt-card .tx { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; font-variant-numeric: tabular-nums; }
.receipt-card .tx a { color: var(--brand-deep); font-weight: 600; }
.done-actions { display: flex; gap: 8px; margin-top: 18px; }
.done-actions .btn { flex: 1; height: 46px; }
.ledger-mini { margin-top: 18px; text-align: left; }
.ledger-mini summary { font-size: 11.5px; color: var(--ink-3); cursor: pointer; }
.ledger-mini table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.ledger-mini td { padding: 4px 0; border-bottom: 1px dashed var(--line-2); color: var(--ink-2); }
.ledger-mini td:last-child { text-align: right; }

/* ---------------------------------------------------------------- 테이블오더 */
.table-head { padding: 20px 22px 0; }
.table-head .brand-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--brand); letter-spacing: 0.02em; }
.table-head .brand-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.table-head h1 { font-size: 22px; letter-spacing: -0.03em; margin-top: 10px; }
.table-head .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.menu-list { padding: 8px 22px 0; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.menu-item .info { flex: 1; min-width: 0; }
.menu-item .n { font-size: 14.5px; font-weight: 600; }
.menu-item .note { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.menu-item .p { font-size: 13.5px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 34px; height: 34px; border: 0; background: var(--surface); color: var(--ink-2); font-size: 16px; line-height: 1; }
.stepper button:hover { background: var(--surface-2); }
.stepper input { width: 34px; height: 34px; border: 0; text-align: center; font-size: 13.5px; font-weight: 700; padding: 0; font-variant-numeric: tabular-nums; }
.stepper input:focus { box-shadow: none; }
.cart-bar {
  position: sticky; bottom: 0; margin-top: 8px; padding: 14px 22px calc(16px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.cart-bar .rowline { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.cart-bar .rowline .k { font-size: 12.5px; color: var(--ink-3); }
.cart-bar .rowline .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 알고몽 에이전트 */
.chat-card { display: flex; flex-direction: column; min-height: 560px; }
.chat-log { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 88%; }
.msg .avatar {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 26px; background: var(--brand-soft); color: var(--brand-deep);
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
}
.msg .bubble { background: var(--surface-2); border-radius: 4px 12px 12px 12px; padding: 11px 13px; font-size: 13.5px; line-height: 1.62; }
.msg .bubble p + p { margin-top: 8px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--brand-ink); color: #fff; border-radius: 12px 4px 12px 12px; }
.msg .note { font-size: 10.5px; color: var(--ink-3); margin-top: 7px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.msg .note .cite { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; cursor: help; }
.msg table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.msg table th { text-align: left; color: var(--ink-3); font-weight: 600; font-size: 10.5px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.msg table td { padding: 5px 6px; border-bottom: 1px solid var(--line-2); }
.msg table td.r, .msg table th.r { text-align: right; }
.typing span { display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%; background: var(--ink-3); animation: blink 1.1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.chat-input { display: flex; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.chat-input input { height: 46px; }
.chat-input .btn { height: 46px; padding: 0 16px; background: var(--brand-ink); color: #fff; border: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 4px; }
.chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-size: 12px; color: var(--ink-2); }
.chips button:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-soft); }

/* ---------------------------------------------------------------- 히트맵 */
.heat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.heat-cell {
  position: relative; border-radius: 14px; border: 1px solid var(--line); padding: 15px 15px 14px; min-height: 104px;
  display: flex; flex-direction: column; justify-content: space-between; transition: transform .12s, box-shadow .12s;
  background: var(--surface); text-align: left; width: 100%;
}
.heat-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); }
.heat-cell .d { font-size: 13px; font-weight: 700; }
.heat-cell .n { font-size: 11.5px; opacity: .75; margin-top: 2px; }
.heat-cell .amt { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); }
.heat-legend .sw { width: 22px; height: 10px; border-radius: 3px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-bar .seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.filter-bar .seg a { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.filter-bar .seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.detail-panel { border-left: 1px solid var(--line); padding: 18px 20px; background: var(--surface); border-radius: var(--r-card); }

/* ---------------------------------------------------------------- 온보딩 */
.onboard-wrap { max-width: 720px; margin: 0 auto; padding: 40px 24px 64px; }
.onboard-head { text-align: center; margin-bottom: 26px; }
.onboard-head .kicker { font-size: 11.5px; font-weight: 700; color: var(--brand); letter-spacing: 0.04em; }
.onboard-head h1 { font-size: 26px; letter-spacing: -0.03em; margin-top: 8px; }
.onboard-head p { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }
.stepbar { display: flex; align-items: center; gap: 8px; margin: 0 0 24px; }
.stepbar .node { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.stepbar .node .n { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; background: var(--surface); }
.stepbar .node.on { color: var(--ink); }
.stepbar .node.on .n { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepbar .node.done .n { background: var(--brand-soft); border-color: #ffd9c8; color: var(--brand-deep); }
.stepbar .bar { flex: 1; height: 1px; background: var(--line); }
.checkline { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.checkline input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.summary-box { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; font-size: 13px; display: flex; flex-direction: column; gap: 7px; }
.summary-box .kv { display: flex; justify-content: space-between; gap: 10px; }
.summary-box .kv span:first-child { color: var(--ink-2); }
.summary-box .kv span:last-child { font-weight: 600; }

/* ---------------------------------------------------------------- 허브 */
.hub { max-width: 1120px; margin: 0 auto; padding: 36px 24px 64px; }
.hub-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.hub-top .kicker { font-size: 11.5px; font-weight: 700; color: var(--brand); letter-spacing: 0.05em; }
.hub-top h1 { font-size: 30px; letter-spacing: -0.035em; margin-top: 8px; line-height: 1.25; }
.hub-top p { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; max-width: 560px; }
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); }
.tile .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-deep); font-size: 15px; }
.tile h3 { font-size: 15px; font-weight: 700; }
.tile p { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.tile .go { margin-top: auto; font-size: 12px; font-weight: 600; color: var(--brand-deep); }
.hub-side { display: flex; flex-direction: column; gap: 14px; }
.kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; }
.kpi .k { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.kpi .v { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.foot-note { margin-top: 28px; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }
.foot-note b { color: var(--ink-2); }

/* ---------------------------------------------------------------- QR 인쇄 */
.qr-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.qr-card { border: 1px dashed var(--line); border-radius: 14px; padding: 18px; text-align: center; }
.qr-card img { width: 148px; height: 148px; }
.qr-card .n { font-weight: 700; font-size: 14px; margin-top: 8px; }
.qr-card .t { font-size: 11.5px; color: var(--ink-3); }

/* ---------------------------------------------------------------- 반응형 */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; overflow-x: auto; }
  .brandmark { padding: 0; flex: 0 0 auto; }
  .brandmark .role { display: none; }
  .nav { flex-direction: row; gap: 4px; }
  .nav a { height: 34px; padding: 0 10px; font-size: 12.5px; white-space: nowrap; }
  .nav .sep { display: none; }
  .sidebar-foot { display: none; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 16px; }
  .topbar .date { display: none; }
  .heat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .phone { border-radius: 0; min-height: 100vh; border: 0; box-shadow: none; }
  .stage { padding: 0; display: block; background: var(--surface); }
  .amount .krw { font-size: 36px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qr-sheet { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- 주문 내역 · 온보딩 레일 */
.order-lines { margin-top: 6px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.order-lines .ol-head { font-size: 11.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; margin-bottom: 4px; }
.order-lines .ol-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; color: var(--ink-2); }
.order-lines .ol-row span:last-child { color: var(--ink); font-weight: 600; }
.order-lines .qty { color: var(--ink-3); font-size: 12px; }
.tile .ico svg { color: var(--brand-deep); }
.onboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 16px; align-items: start; }
.onboard-rail { display: flex; flex-direction: column; gap: 12px; }
.rail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 16px 15px; }
.rail-card h3 { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.rail-card p { font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.rail-card .cmp { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line-2); }
.rail-card .cmp:last-child { border-bottom: 0; }
.rail-card .cmp b { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .onboard-grid { grid-template-columns: 1fr; } }
@media print {
  .sidebar, .topbar, .foot-note { display: none !important; }
  .shell { grid-template-columns: 1fr; }
}
