/* 3D 출력 견적 — 공통 스타일 (손님 화면, 관리자 화면)
   색: 밝은 종이 회색 바탕, 출력 판(텍스처 PEI)의 짙은 숯색, 신호용 파랑 한 가지.
   숫자(가격, 무게, 시간, 크기)는 프린터 화면처럼 고정폭 글꼴로 보여준다. */
:root {
  --bg: #f0f1ee;
  --surface: #ffffff;
  --surface-2: #f6f7f4;
  --ink: #16181b;
  --ink-2: #464a52;
  --muted: #727780;
  --line: #e1e3df;
  --line-2: #cdd0cb;
  --accent: #2550f0;
  --accent-ink: #ffffff;
  --accent-soft: #e9eeff;
  --plate: #1d1f23;
  --plate-2: #2a2d32;
  --fleck: #b99a57;
  --ok: #12805a;
  --ok-soft: #e3f3ec;
  --warn: #a8540c;
  --warn-soft: #fbf0e2;
  --bad: #c42b2b;
  --bad-soft: #fcebeb;
  --viewer-bg: #e4e6e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.05), 0 6px 20px -12px rgba(20, 22, 26, 0.18);
  --mono: "JetBrains Mono", Pretendard, ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121315;
    --surface: #1b1c1f;
    --surface-2: #222327;
    --ink: #f1f2f4;
    --ink-2: #c6c9cf;
    --muted: #8c9199;
    --line: #2c2e33;
    --line-2: #3b3e44;
    --accent: #5b7cff;
    --accent-soft: #1c2450;
    --plate: #0d0e10;
    --plate-2: #1a1c20;
    --ok: #3fbf86;
    --ok-soft: #14301f;
    --warn: #f0a33a;
    --warn-soft: #33261a;
    --bad: #ff6b6b;
    --bad-soft: #3a1d1d;
    --viewer-bg: #18191c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- 머리글 ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; color: inherit; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--plate); color: #7d96ff; display: grid; place-items: center; }
.printer-chip { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ---------- 버튼, 입력 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px;
  padding: 10px 16px; font-weight: 700; font-size: 15px; transition: background .12s, border-color .12s, transform .08s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; padding: 14px; font-size: 16px; border-radius: 12px; }
a.btn { text-decoration: none; color: inherit; }
button.link { border: 0; background: none; padding: 2px 4px; color: var(--accent); font-weight: 600; font-size: 13.5px; }
button.link:hover { text-decoration: underline; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 14px; color: var(--muted); font-weight: 600; }
.field { margin-top: 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input[type=text], .field input[type=tel], .field input[type=email], .field input[type=password], .field input[type=number], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: var(--surface);
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.form-error { color: var(--bad); font-weight: 600; font-size: 14px; margin-top: 12px; }
.agree { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin-top: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 8px 14px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.chip:hover { border-color: var(--ink-2); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chip small { font-weight: 500; color: var(--muted); font-size: 12px; }
.chip.on small { color: var(--accent); }

.badge { font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.badge.rough { background: var(--warn-soft); color: var(--warn); }
.badge.sliced { background: var(--ok-soft); color: var(--ok); }
.badge.busy { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

.switch { width: 44px; height: 26px; border-radius: 99px; background: var(--line-2); border: 0; position: relative; transition: background .15s; flex: none; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch.on { background: var(--accent); }
.switch.on::after { left: 21px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }

/* ---------- 첫 화면 ---------- */
.hero { max-width: 1180px; margin: 0 auto; padding: 52px 24px 40px; }
/* 넓은 화면: 왼쪽에 글과 출력 사양, 오른쪽에 업로드 판 */
.hero-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 44px; align-items: center; }
.hero h1 { font-size: 46px; line-height: 1.18; letter-spacing: -0.035em; margin: 0 0 14px; font-weight: 800; }
.hero .lead { color: var(--ink-2); margin: 0; font-size: 16.5px; max-width: 520px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.facts dd { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.hero-top .plate { min-height: 380px; }

/* 업로드 칸 = 출력 판. 짙은 텍스처 PEI에 금빛 반짝임, 올리는 동안 출력물이 층층이 쌓인다.
   반짝이 점은 dots.js 가 캔버스에 그려 마우스에 반응한다 (스크립트가 안 돌면 아래 CSS 무늬) */
.plate {
  position: relative; overflow: hidden; border-radius: 22px; min-height: 300px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,0.07), transparent 60%),
    var(--plate);
  color: #f1f2f4; display: grid; place-items: center; text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 24px 48px -28px rgba(10,12,16,0.7);
  transition: box-shadow .15s;
  cursor: pointer; /* 판 아무 데나 눌러도 파일을 고른다 */
}
.plate.busy { cursor: progress; }
.plate::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image:
    radial-gradient(rgba(214, 182, 112, 0.55) 0.7px, transparent 0.9px),
    radial-gradient(rgba(255, 255, 255, 0.10) 0.6px, transparent 0.8px);
  background-size: 7px 7px, 11px 11px;
  background-position: 0 0, 4px 6px;
}
.plate-dots { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.plate.dots-on::before { display: none; }
.plate.over { box-shadow: inset 0 0 0 2px #7d96ff, 0 24px 48px -28px rgba(10,12,16,0.7); }
.plate-print {
  position: absolute; left: 50%; bottom: 0; width: min(46%, 300px); height: 0; transform: translateX(-50%);
  border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(to top, #3d63ff 0 3px, #2a4be0 3px 4px);
  box-shadow: 0 0 0 1px rgba(125,150,255,.35), 0 0 40px rgba(61,99,255,.35);
  transition: height .3s ease-out;
  visibility: hidden; /* 높이가 0이어도 테두리 그림자는 그려져서 파란 선이 남는다. 올리는 동안에만 보인다 */
}
.plate.busy .plate-print { visibility: visible; }
.plate-body { position: relative; display: grid; justify-items: center; gap: 8px; padding: 40px 24px; }
.plate-title { font-size: 21px; letter-spacing: -0.02em; }
.plate-sub { color: #b4b8c0; font-size: 14px; }
.plate .btn.primary { margin-top: 12px; padding: 12px 22px; box-shadow: 0 6px 20px -6px rgba(37,80,240,.7); }
.plate-error { margin-top: 10px; color: #ffb4b4; font-weight: 600; font-size: 14px; max-width: 460px; }
.plate.busy .btn, .plate.busy .plate-sub { visibility: hidden; }

.how { list-style: none; counter-reset: how; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0; margin: 36px 0 0; }
.how li { counter-increment: how; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: 13.5px; color: var(--muted); }
.how li::before { content: counter(how); font-family: var(--mono); font-weight: 700; font-size: 12px; color: var(--accent); display: block; margin-bottom: 4px; }
.how b { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 2px; }
/* 첫 화면 아래: 자주 묻는 질문, 가게 이름 */
.hero-sec { margin-top: 56px; }
.hero-sec h2 { font-size: 21px; letter-spacing: -0.02em; margin: 0 0 14px; }
.faq { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.qa h3 { margin: 0 0 6px; font-size: 15px; letter-spacing: -0.01em; }
.qa p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot b { color: var(--ink); font-size: 14px; }

/* ---------- 견적 화면 ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; padding: 18px 24px 32px; max-width: 1480px; margin: 0 auto; align-items: start; }

.stage {
  position: sticky; top: 18px; height: calc(100vh - 106px); min-height: 460px;
  border-radius: 20px; overflow: hidden; background: var(--viewer-bg); border: 1px solid var(--line);
}
.viewer-canvas { position: absolute; inset: 0; }
.viewer-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.stage-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; flex-wrap: wrap; }
.stage-top > * { pointer-events: auto; }
.stage-info { display: flex; gap: 6px; align-items: center; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; box-shadow: var(--shadow); }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--ink); color: var(--surface); }
.stage-label { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 11px; font-size: 12.5px; box-shadow: var(--shadow); color: var(--ink-2); }
.legend { position: absolute; left: 12px; bottom: 12px; right: 12px; width: fit-content; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; box-shadow: var(--shadow); display: flex; gap: 12px; flex-wrap: wrap; }
.legend.legend-top { bottom: auto; top: 60px; }
/* 모델 옮기기 안내 · 옮긴 결과 알림 */
.move-hint { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--ink-2); box-shadow: var(--shadow); pointer-events: none; }
.move-hint svg { flex: none; color: var(--accent); }
.move-hint.warn { border-color: var(--bad); color: var(--ink); }
.move-hint.warn svg { color: var(--bad); }
.stage[data-mode="overhang"] .move-hint { bottom: 58px; }
.stage[data-mode="layers"] .move-hint { bottom: 80px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.layer-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); }
.layer-bar input[type=range] { flex: 1; accent-color: var(--accent); }
.layer-bar .play { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.layer-bar .info { font-size: 12.5px; min-width: 150px; text-align: right; color: var(--ink-2); }

.panel { display: flex; flex-direction: column; gap: 10px; }
.notes { display: flex; flex-direction: column; gap: 8px; }
.notes:empty { display: none; }
.note { border-radius: 12px; padding: 11px 12px; font-size: 13.5px; line-height: 1.45; display: flex; gap: 8px; align-items: flex-start; }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note .ico { flex: none; font-weight: 800; }
.note .act { margin-left: auto; flex: none; align-self: center; }

/* 단계 카드: 손님이 정하는 순서 그대로 (모델 → 재료·색 → 품질 → 세부 설정) */
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.step-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.step-head h2 { margin: 0; font-size: 16px; letter-spacing: -0.015em; }
.step-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.step-no { width: 24px; height: 24px; border-radius: 7px; background: var(--plate); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none; margin-top: 1px; }

.files { display: flex; align-items: center; gap: 6px; margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.files-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-status { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

.models { display: grid; gap: 6px; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 76px; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; transition: border-color .12s; }
.mrow.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mname { border: 0; background: none; padding: 0; text-align: left; min-width: 0; color: inherit; }
.mtitle { display: block; font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msub { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.45; margin-top: 1px; }
.msub.x { color: var(--bad); }
.mrow.off .mtitle, .mrow.off .msub { opacity: .45; text-decoration: line-through; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: var(--surface); }
.qty button { border: 0; background: var(--surface-2); width: 30px; height: 30px; font-size: 16px; line-height: 1; }
.qty button:hover { background: var(--line); }
.qty b { min-width: 28px; text-align: center; font-size: 14px; }
.mprice { text-align: right; font-weight: 700; font-size: 14px; }
.mprice.off { font-family: inherit; font-weight: 500; color: var(--muted); font-size: 13px; }
.all-qty { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 13.5px; color: var(--ink-2); }
.stepper { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.stepper button { border: 0; background: var(--surface-2); width: 32px; font-size: 16px; }
.stepper input { width: 48px; border: 0; text-align: center; font-weight: 700; background: var(--surface); padding: 5px 0; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.swatch { border: 0; background: none; padding: 0; display: grid; justify-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); min-width: 46px; }
.swatch .dot { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); transition: box-shadow .12s; }
.swatch.on { color: var(--accent); font-weight: 700; }
.swatch.on .dot { box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }

/* 여러 색: 모델(과 색이 섞인 모델의 부분)마다 작은 색 단추 */
.color-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.color-mode button { border: 0; background: transparent; border-radius: 8px; padding: 7px 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.color-mode button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 22, 26, .12); }
.cparts { display: grid; gap: 6px; margin-top: 12px; }
.cpart { border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px 10px 12px; }
.cpart-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cpart-head b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpart-head span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cslot { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.cslot-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); min-width: 92px; }
.cslot-label i { width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); flex: none; }
.minis { display: flex; flex-wrap: wrap; gap: 6px; }
.mini { width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); transition: box-shadow .12s; }
.mini[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.color-hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.color-hint b { color: var(--ink-2); }
.mdots { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: 1px; }
.mdots i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }

.quality { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.qcard { position: relative; border: 1px solid var(--line-2); background: var(--surface); border-radius: 12px; padding: 12px 10px 10px; text-align: left; display: grid; gap: 2px; }
.qcard b { font-size: 15px; }
.qcard .q-note { font-size: 12px; color: var(--muted); line-height: 1.35; }
.qcard .q-layer { font-size: 11px; color: var(--muted); margin-top: 4px; }
.qcard .q-tag { position: absolute; top: -9px; right: 8px; background: var(--plate); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.qcard.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.qcard.on b { color: var(--accent); }

details.more > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "펼치기"; margin-left: auto; font-size: 12.5px; color: var(--accent); font-weight: 600; white-space: nowrap; align-self: center; }
details.more[open] > summary::after { content: "접기"; }
details.more[open] > summary { margin-bottom: 6px; }
details.more .step-no { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2); }
.opt { padding: 14px 0 0; border-top: 1px solid var(--line); margin-top: 14px; }
.opt:first-of-type { border-top: 0; margin-top: 0; }
.opt-label { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.opt-label small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row input[type=range] { flex: 1; accent-color: var(--accent); }
.num-input { width: 74px; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; text-align: right; background: var(--surface); }

/* 가격표: 출력 판처럼 짙은 바탕에 숫자를 크게 */
.ticket { position: sticky; bottom: 12px; background: var(--plate); color: #f1f2f4; border-radius: 18px; padding: 14px 16px 16px; box-shadow: 0 -12px 32px -20px rgba(10,12,16,.55); }
.ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: #aeb3bc; }
.ticket-more { border: 0; background: none; color: #aeb3bc; font-size: 12.5px; padding: 2px 0; }
.ticket-more::after { content: " ▾"; }
.ticket-more[aria-expanded="true"]::after { content: " ▴"; }
.ticket-more:hover { color: #fff; }
.ticket .badge.busy { background: rgba(255,255,255,.10); color: #e6e8ec; border: 0; }
.ticket .badge.rough { background: rgba(240,163,58,.18); color: #ffc477; }
.ticket-total { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.15; margin: 2px 0 1px; }
.ticket-meta { font-size: 12.5px; color: #c3c7cf; margin-bottom: 12px; }
/* 정확한 금액이 나올 때까지는 숫자 대신 '계산 중' */
.ticket-total.wait { font-family: inherit; font-size: 22px; letter-spacing: -0.02em; color: #b4b8c0; animation: calc-pulse 1.4s ease-in-out infinite; }
@keyframes calc-pulse { 50% { opacity: .55; } }
.mprice.wait { color: var(--muted); font-weight: 500; }
.ticket .btn.primary { box-shadow: 0 8px 24px -10px rgba(61,99,255,.9); }
.ticket .btn.primary:disabled { opacity: .55; box-shadow: none; }
.breakdown { margin: -2px 0 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.05); }
.lines { display: grid; gap: 3px; font-size: 12.5px; color: #dfe2e7; }
.lines div { display: flex; justify-content: space-between; gap: 10px; }
.lines .min { color: #ffc477; }
.ticket-hint { font-size: 12px; color: #aeb3bc; margin: 8px 0 0; }

/* ---------- 주문 창 ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 11, 14, .5); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 18px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.radio-row { display: flex; gap: 8px; }
.radio-row label { flex: 1; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; font-weight: 600; margin: 0; cursor: pointer; }
.radio-row label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.order-sum { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: 13.5px; display: grid; gap: 4px; }
.order-sum div { display: flex; justify-content: space-between; gap: 10px; }
.order-sum .t { font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.done-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin-bottom: 14px; }
.done-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.done-grid div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; font-size: 13px; }
.done-grid b { font-size: 18px; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 980px) {
  .top { padding: 12px 16px; }
  .printer-chip { display: none; }
  .hero { padding: 32px 16px 40px; }
  .hero-top { grid-template-columns: 1fr; gap: 26px; }
  .hero h1 { font-size: 30px; }
  .facts { gap: 12px 16px; margin-top: 22px; padding-top: 16px; }
  .hero-top .plate { min-height: 240px; }
  .how { grid-template-columns: 1fr; margin-top: 24px; }
  .hero-sec { margin-top: 40px; }
  .faq { grid-template-columns: 1fr; }
  .foot { margin-top: 40px; }
  .work { grid-template-columns: 1fr; padding: 12px 12px 150px; gap: 12px; }
  .stage { position: relative; top: 0; height: 46vh; min-height: 300px; }
  .legend.legend-top { top: 100px; }
  .layer-bar .info { min-width: 0; }
  /* 가격표는 화면 아래에 붙여 둔다 */
  .ticket {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; border-radius: 18px 18px 0 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "head btn" "total btn" "meta btn" "lines lines";
    column-gap: 14px; align-items: center;
  }
  .ticket-head { grid-area: head; }
  .ticket-total { grid-area: total; font-size: 26px; }
  .ticket-meta { grid-area: meta; margin: 0; }
  .ticket .btn.block { grid-area: btn; width: auto; padding: 14px 18px; }
  .breakdown { grid-area: lines; margin: 10px 0 0; }
  .mrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name name" "qty price"; row-gap: 6px; }
  .mname { grid-area: name; }
  .qty { grid-area: qty; justify-self: start; }
  .mprice { grid-area: price; }
}
