/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--base); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); line-height: 1.55; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-60); }
.loading { padding: 80px 24px; text-align: center; color: var(--ink-60); }

/* ---------- 상단바 (iOS 내비게이션 바 느낌) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--ink-08);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: var(--wide); margin: 0 auto; height: 60px; padding: 0 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
}
.topbar-logo { font-weight: 800; font-size: 1.35rem; text-decoration: none; letter-spacing: -0.04em; justify-self: start; }
.topbar-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 2px; min-height: 48px; padding: 0 8px 0 0;
  text-decoration: none; font-weight: 600; font-size: 1rem;
}
.topbar-back span { font-size: 1.9rem; line-height: 1; margin-top: -4px; }
.topbar-title { font-weight: 700; font-size: 1rem; text-align: center; white-space: nowrap; }
.topbar-size {
  justify-self: end; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--paper); font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.topbar-size[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.demo-banner { background: var(--ink); color: var(--paper); text-align: center; font-size: 0.8rem; padding: 6px 12px; }

/* ---------- 화면 틀 ---------- */
.main { min-height: calc(100vh - 60px); outline: none; }
.screen { margin: 0 auto; padding: 28px 20px 140px; max-width: var(--wide); }
.screen.narrow { max-width: var(--narrow); }
.screen.center { text-align: center; display: flex; flex-direction: column; align-items: stretch; gap: 20px; padding-top: 56px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section { margin-top: 48px; }
.section-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; }

.eyebrow { font-size: 0.9rem; font-weight: 700; margin: 0 0 12px; }
.display { font-size: clamp(2.1rem, 7vw, 3.6rem); line-height: 1.15; letter-spacing: -0.045em; font-weight: 800; margin: 0 0 18px; }
.title { font-size: clamp(1.6rem, 5vw, 2.1rem); line-height: 1.25; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 10px; }
.lead { font-size: 1.1rem; line-height: 1.6; color: var(--ink-80); margin: 0; }
.hint { margin: 0 0 22px; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-60); border: 1.5px dashed var(--ink-15); border-radius: var(--radius); }
.notice { padding: 16px; border-radius: var(--radius); background: var(--ink-04); }
.footer { margin-top: 64px; font-size: 0.85rem; text-align: center; }
.footer-actions { margin-top: 36px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 10px 22px; border-radius: var(--radius);
  font-weight: 700; font-size: 1.05rem; text-decoration: none; text-align: center; cursor: pointer;
  border: 2px solid var(--ink); transition: transform 0.12s var(--ease), opacity 0.12s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn-block { width: 100%; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-secondary { background: var(--paper); color: var(--ink); }
.btn-plain { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.25; cursor: not-allowed; transform: none; }
.btn-sub { font-size: 0.8rem; font-weight: 500; opacity: 0.7; }
.link { background: none; border: 0; padding: 8px 0 8px 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; min-height: 44px; }

/* ---------- 홈 ---------- */
.hero { display: grid; gap: 28px; padding-top: 12px; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; }
.howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.howto-item { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: var(--radius-l); background: var(--ink-04); }
.howto-num { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 800; }
.howto-title { display: block; font-size: 1.1rem; margin-bottom: 2px; }
.howto-body { margin: 0; color: var(--ink-80); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { position: relative; padding: 14px 16px 14px 52px; border: 1.5px solid var(--ink-15); border-radius: var(--radius); }
.checklist li::before { content: '✓'; position: absolute; left: 16px; top: 13px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 0.75rem; display: grid; place-items: center; font-weight: 800; }
.partner-cta { padding: 24px; border-radius: var(--radius-l); border: 2px solid var(--ink); display: grid; gap: 18px; }
.partner-cta .section-title { margin-bottom: 4px; }
.partner-cta p { margin: 0; }

/* ---------- 접수 단계 ---------- */
.progress { height: 6px; border-radius: 6px; background: var(--ink-08); overflow: hidden; }
.progress-bar { height: 100%; background: var(--ink); border-radius: 6px; transition: width 0.3s var(--ease); }
.step-count { margin: 14px 0 6px; font-weight: 700; color: var(--ink-60); font-size: 0.9rem; }
.wizard .title { margin-bottom: 8px; }
.wizard-body { margin-top: 20px; }

.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  min-height: 68px; padding: 14px 18px; border-radius: var(--radius); text-align: left; cursor: pointer;
  background: var(--paper); border: 2px solid var(--ink-15); transition: border-color 0.12s, background 0.12s;
}
.option:hover { border-color: var(--ink); }
.option.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.option-text { display: flex; flex-direction: column; }
.option-label { font-weight: 700; font-size: 1.08rem; }
.option-hint { font-size: 0.85rem; opacity: 0.7; }
.option-mark { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid currentColor; opacity: 0.35; display: grid; place-items: center; }
.option-mark.is-check { border-radius: 8px; }
.option.is-on .option-mark { opacity: 1; background: var(--paper); }
.option.is-on .option-mark::after { content: '✓'; color: var(--ink); font-weight: 900; font-size: 0.85rem; }

.segmented { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--ink-08); }
.segment { flex: 1; min-height: 52px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; cursor: pointer; }
.segment.is-on { background: var(--paper); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.grid-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.choice { min-height: var(--tap); border-radius: var(--radius); border: 2px solid var(--ink-15); background: var(--paper); font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.choice:hover { border-color: var(--ink); }
.choice.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--ink-15); background: var(--paper); font-weight: 600; cursor: pointer; }
.chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.photo-preview { width: 100%; max-height: 360px; object-fit: contain; border-radius: var(--radius); background: var(--ink-04); }

/* 화면 아래 고정 버튼 줄 (엄지 닿는 곳) */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 1px solid var(--ink-08);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.actionbar-inner { max-width: var(--narrow); margin: 0 auto; display: flex; gap: 10px; }
.actionbar-inner .btn:not(.btn-block) { flex: 0 0 34%; }

/* ---------- 입력칸 ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-weight: 700; font-size: 0.95rem; }
.input {
  width: 100%; min-height: var(--tap); padding: 14px 16px; border-radius: var(--radius-s);
  border: 2px solid var(--ink-15); background: var(--paper); font-size: 1.05rem; appearance: none; -webkit-appearance: none;
}
textarea.input { min-height: 120px; resize: vertical; }
select.input { background-image: linear-gradient(45deg, transparent 50%, #000 50%), linear-gradient(135deg, #000 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 44px; }
.input:focus { outline: none; border-color: var(--ink); }
.input.has-error { border-color: var(--ink); border-style: dashed; }
.field-hint { font-size: 0.85rem; color: var(--ink-60); }
.field-error, .form-error { font-size: 0.9rem; font-weight: 700; margin: 0; }
.form-error:empty { display: none; }
.form-error::before, .field-error::before { content: '! '; }

/* ---------- 목록·카드 ---------- */
.list { border: 1.5px solid var(--ink-15); border-radius: var(--radius); overflow: hidden; }
.list-row { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; min-height: 60px; }
.list-row + .list-row { border-top: 1px solid var(--ink-08); }
.list-key { color: var(--ink-60); font-size: 0.9rem; font-weight: 600; }
.list-value { font-weight: 600; }
.summary { margin-top: 24px; }

.cards { display: grid; gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius-l); border: 1.5px solid var(--ink-15); background: var(--paper); text-align: left; }
.card p { margin: 0; }
.card-link { text-decoration: none; cursor: pointer; width: 100%; font: inherit; transition: border-color 0.12s; }
.card-link:hover { border-color: var(--ink); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-title { font-size: 1.1rem; }
.card-title.big { font-size: 1.4rem; }
.card.chosen { border: 2px solid var(--ink); }
.chevron { position: absolute; right: 18px; bottom: 16px; font-size: 1.6rem; opacity: 0.4; }
.price { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.quote-msg { padding: 12px 14px; border-radius: var(--radius-s); background: var(--ink-04); }
.quote .btn, .chosen .btn { margin-top: 8px; }
.distance { font-weight: 800; white-space: nowrap; }
.contact { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--ink-08); display: grid; gap: 6px; }

.badge { color: var(--ink); display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--ink); font-size: 0.8rem; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.badge.is-solid { background: var(--ink); color: var(--paper); }

/* 진행 단계 */
.steps { list-style: none; padding: 0; margin: 20px 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 0.85rem; color: var(--ink-60); }
.step::before { content: ''; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: var(--ink-15); z-index: 0; }
.step:first-child::before { display: none; }
.step.is-done::before, .step.is-now::before { background: var(--ink); }
.step-dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink-15); background: var(--paper); }
.step.is-done .step-dot { background: var(--ink); border-color: var(--ink); }
.step.is-now .step-dot { border: 6px solid var(--ink); }
.step.is-now, .step.is-done { color: var(--ink); font-weight: 700; }

/* 완료 화면 */
.done-mark { width: 88px; height: 88px; margin: 0 auto; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 2.6rem; font-weight: 800; }
.ticket { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-radius: var(--radius); border: 2px solid var(--ink); text-align: left; }
.ticket-no { font-size: 1.4rem; letter-spacing: 0.08em; }
.save-link { margin-top: 12px; display: grid; gap: 8px; }
.save-link p { margin: 0; font-size: 0.9rem; }
.url { display: block; padding: 12px; border-radius: var(--radius-s); background: var(--ink-04); font-size: 0.8rem; word-break: break-all; }

/* 업체 화면 */
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.board-head .title { margin-bottom: 4px; }
.board-head > .btn { flex: none; white-space: nowrap; min-height: 52px; }
.board-head p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tabs { margin-bottom: 18px; max-width: 520px; }

/* 시트 */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); opacity: 0; transition: opacity 0.2s; }
.sheet-panel { position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; background: var(--paper); border-radius: 24px 24px 0 0; padding: 0 20px calc(24px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform 0.25s var(--ease); }
.sheet.is-open .sheet-backdrop { opacity: 1; }
.sheet.is-open .sheet-panel { transform: none; }
.sheet-head { position: sticky; top: 0; background: var(--paper); display: flex; justify-content: space-between; align-items: center; padding: 18px 0 12px; z-index: 1; }
.sheet-title { font-size: 1.2rem; }
.sheet-close { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--paper); font-weight: 700; cursor: pointer; }

/* 알림 */
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 60; background: var(--ink); color: var(--paper); padding: 14px 22px; border-radius: 999px; font-weight: 700; transition: all 0.2s var(--ease); max-width: 90vw; text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* 운영 표 */
.table-wrap { overflow-x: auto; border: 1.5px solid var(--ink-15); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--ink-08); }
.table th { font-size: 0.8rem; color: var(--ink-60); background: var(--ink-04); white-space: nowrap; }
.table .btn { min-height: 44px; font-size: 0.85rem; padding: 6px 12px; }

/* ---------- PC (넓은 화면) ---------- */
@media (min-width: 720px) {
  .grid-choices { grid-template-columns: repeat(3, 1fr); }
  .cards.grid { grid-template-columns: repeat(2, 1fr); }
  .partner-cta { grid-template-columns: 1fr 280px; align-items: center; }
  .howto { grid-template-columns: repeat(3, 1fr); }
  .howto-item { flex-direction: column; }
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 24px; transform: translateY(24px) scale(0.98); opacity: 0; transition: all 0.2s var(--ease); }
  .sheet.is-open .sheet-panel { opacity: 1; transform: none; }
}
@media (min-width: 960px) {
  .screen { padding: 48px 32px 140px; }
  .hero { grid-template-columns: 1.3fr 1fr; align-items: end; gap: 48px; padding-top: 40px; }
  .hero-actions { padding-bottom: 12px; }
  .grid-choices { grid-template-columns: repeat(4, 1fr); }
  .cards.grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
