/* 헬바디 — 예약 화면 · 관리자 화면 공통 */
:root {
  --ink: #0E0E0F;
  --paper: #F4F2EE;
  --white: #FFFFFF;
  --red: #C30C24;
  --red-deep: #9E0A1D;
  --red-soft: #FBE9EB;
  --green: #0F7A45;
  --green-soft: #E5F4EC;
  --amber: #8A5A00;
  --amber-soft: #FFF3D6;
  --text: #161616;
  --muted: #5E5A55;
  --line: #DCD7D0;
  --line-2: #ECE8E2;
  --r: 14px;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--paper); font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; letter-spacing: -0.03em; line-height: 1.25; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.demo-bar { background: #FFE14D; color: #1B1600; font-size: 14px; line-height: 1.4; text-align: center; padding: 8px 16px; }
.demo-bar a { font-weight: 700; }

.bar { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar .in { max-width: 680px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; gap: 12px; }
.bar .logo img { height: 22px; width: auto; }
.bar .back { margin-left: auto; font-size: 15px; color: var(--muted); text-decoration: none; padding: 8px 0; }
.bar .back:hover { color: var(--text); }

.page { max-width: 680px; margin: 0 auto; padding: 24px 20px 140px; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 16px; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; background: none; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover:not(:disabled) { background: var(--red-deep); }
.btn-ink { background: var(--ink); color: var(--white); }
.btn-line { border-color: var(--line); background: var(--white); color: var(--text); }
.btn-line:hover:not(:disabled) { border-color: var(--ink); }
.btn-text { min-height: 44px; padding: 0 8px; color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14.5px; }
.btn-block { width: 100%; }

/* 진행 표시 */
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 26px; }
.progress span { font-size: 13px; color: var(--muted); padding-top: 9px; border-top: 3px solid var(--line); }
.progress span.on { color: var(--text); font-weight: 700; border-top-color: var(--red); }
.progress span.done { border-top-color: var(--ink); }

.step h1 { font-size: clamp(26px, 6vw, 34px); font-weight: 800; }
.step .sub { color: var(--muted); margin-top: 8px; }
.group { margin-top: 28px; }
.group > .label { display: block; font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.group > .hint { display: block; color: var(--muted); font-size: 14.5px; margin-bottom: 12px; }

/* 고르는 카드 */
.choices { display: grid; gap: 10px; margin-top: 22px; }
.choice { display: grid; grid-template-columns: 24px 1fr auto; gap: 4px 14px; align-items: start; padding: 18px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--white); cursor: pointer; text-align: left; width: 100%; }
.choice:hover { border-color: #9C968E; }
.choice input { margin: 3px 0 0; width: 20px; height: 20px; accent-color: var(--red); }
.choice b { font-size: 17px; }
.choice .price { font-weight: 800; white-space: nowrap; }
.choice small { grid-column: 2 / -1; color: var(--muted); font-size: 14.5px; }
.choice:has(input:checked) { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; background: #FFFBFB; }

/* 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); font-size: 15.5px; font-weight: 600; cursor: pointer; user-select: none; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--white); }
.chip input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }

.field { display: block; margin-top: 18px; }
.field > span { display: block; font-weight: 700; margin-bottom: 8px; }
.field small { display: block; color: var(--muted); font-size: 14px; margin-top: 6px; }
.input, textarea.input { width: 100%; min-height: 52px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white); font-size: 17px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(14, 14, 15, .08); }
.input[aria-invalid="true"] { border-color: var(--red); }

.consent { display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding: 16px; border-radius: 12px; background: var(--white); border: 1.5px solid var(--line); margin-top: 22px; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--red); }
.consent b { display: block; }
.consent small { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.consent details { grid-column: 2; font-size: 14px; color: var(--muted); }
.consent summary { cursor: pointer; font-weight: 600; color: var(--text); }
.consent details p { margin-top: 6px; }
.consent.need { border-color: var(--red); background: #FFFBFB; }

.note { padding: 14px 16px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); font-size: 15px; color: #3B3835; margin-top: 18px; }
.note.warn { background: var(--amber-soft); border-color: #F0D89A; color: #4A3500; }
.note.err { background: var(--red-soft); border-color: #F1B9C0; color: #7A0718; font-weight: 600; }

/* 날짜·시간 */
.dates { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.date { flex: 0 0 auto; width: 66px; padding: 10px 0; border: 1.5px solid var(--line); border-radius: 14px; background: var(--white); cursor: pointer; text-align: center; scroll-snap-align: start; }
.date b { display: block; font-size: 22px; line-height: 1.1; font-weight: 800; }
.date span { display: block; font-size: 13px; color: var(--muted); }
.date em { display: block; font-style: normal; font-size: 12px; margin-top: 4px; font-weight: 700; color: var(--green); }
.date.off { background: transparent; cursor: not-allowed; }
.date.off b, .date.off span { color: #B4AEA6; }
.date.off em { color: #B4AEA6; font-weight: 500; }
.date.sun b { color: var(--red); }
.date[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.date[aria-pressed="true"] b, .date[aria-pressed="true"] span, .date[aria-pressed="true"] em { color: var(--white); }
.more-dates { flex: 0 0 auto; width: 66px; border: 1.5px dashed var(--line); border-radius: 14px; background: transparent; cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; }
.times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.time { min-height: 50px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white); font-weight: 700; font-size: 16px; cursor: pointer; }
.time:disabled { background: transparent; color: #B4AEA6; text-decoration: line-through; cursor: not-allowed; border-style: dashed; }
.time[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: var(--white); }
.fast { display: flex; flex-wrap: wrap; gap: 8px; }
.fast button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--green); background: var(--green-soft); color: #0B5A33; font-weight: 700; cursor: pointer; }
@media (max-width: 380px) { .times { grid-template-columns: repeat(3, 1fr); } }

/* 요약 */
.summary { margin-top: 22px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 18px; }
.summary div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.summary div:first-child { border-top: 0; }
.summary dt { color: var(--muted); font-size: 15px; }
.summary dd { margin: 0; font-weight: 600; }
.summary .edit { font-size: 14px; color: var(--muted); margin-left: 6px; font-weight: 500; }

/* 아래 고정 버튼 */
.actions { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); z-index: 20; }
.actions .in { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.actions .btn-red, .actions .btn-ink { flex: 1; }
.actions .msg { font-size: 14px; color: var(--muted); }

/* 완료·내 예약 */
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--red); color: var(--white); display: grid; place-items: center; font-size: 34px; font-weight: 800; margin-bottom: 18px; }
.ticket { margin-top: 22px; background: var(--white); border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; }
.ticket .head { padding: 20px; background: var(--ink); color: var(--white); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ticket .head b { font-size: 22px; letter-spacing: .02em; }
.ticket .body { padding: 6px 20px; }
.ticket .body div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.ticket .body div:first-child { border-top: 0; }
.ticket dt { color: var(--muted); }
.ticket dd { margin: 0; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.pill.pending { background: var(--amber-soft); color: var(--amber); }
.pill.confirmed { background: var(--green-soft); color: var(--green); }
.pill.declined, .pill.cancelled, .pill.noshow { background: #EEE; color: #555; }
.pill.done { background: #E8EEF8; color: #234A86; }
.stack { display: grid; gap: 10px; margin-top: 22px; }
.mine { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); margin-bottom: 18px; font-size: 15px; text-decoration: none; }
.mine b { font-weight: 700; }

/* 관리자 */
.admin { background: #F6F5F3; }
.admin .bar .in, .admin .wide { max-width: 1120px; }
.wide { margin: 0 auto; padding: 20px 20px 80px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button { border: 0; background: none; padding: 14px 14px 12px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; font-size: 15.5px; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--red); }
.tabs .badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--red); color: var(--white); font-size: 12px; line-height: 20px; text-align: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.stats div { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stats b { display: block; font-size: 28px; font-weight: 800; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.bk { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.bk.is-pending { border-left: 4px solid #E0A100; }
.bk.is-confirmed { border-left: 4px solid var(--green); }
.bk .when { font-size: 19px; font-weight: 800; }
.bk .who { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.bk .who b { font-size: 17px; }
.bk .who a { color: var(--text); font-weight: 600; }
.bk .meta { font-size: 13.5px; color: var(--muted); }
.bk .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.bk .tags span { font-size: 13.5px; padding: 2px 10px; border-radius: 999px; background: var(--paper); font-weight: 600; }
.bk .txt { font-size: 14.5px; background: #FAF9F7; border-radius: 8px; padding: 8px 10px; }
.bk .txt b { display: block; font-size: 12.5px; color: var(--muted); }
.bk .row { display: flex; flex-wrap: wrap; gap: 6px; }
.bk textarea { min-height: 60px; font-size: 14.5px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); background: var(--white); border: 1px dashed var(--line); border-radius: var(--r); }
.daynav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.daynav h2 { font-size: 20px; margin: 0 8px; }
.slots { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.slot { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); align-items: center; }
.slot:first-child { border-top: 0; }
.slot .t { font-weight: 800; font-size: 17px; }
.slot.blocked { background: repeating-linear-gradient(-45deg, #FAFAFA 0 8px, #F1F0EE 8px 16px); }
.slot .list { display: grid; gap: 6px; }
.slot .item { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.slot .item.dim { color: #9B958D; text-decoration: line-through; }
.slot .free { color: var(--green); font-weight: 700; font-size: 14.5px; }
.slot .out { color: var(--muted); font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.panel h3 { font-size: 18px; margin-bottom: 12px; }
.hrow { display: grid; grid-template-columns: 44px 80px 1fr 16px 1fr; gap: 8px; align-items: center; padding: 6px 0; }
.hrow input[type=time] { min-height: 44px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--white); width: 100%; }
.hrow label { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.kv { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.kv:first-of-type { border-top: 0; }
.kv small { display: block; color: var(--muted); font-size: 13px; }
.kv .input { min-height: 44px; font-size: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 50; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: calc(100% - 32px); }
dialog { border: 0; border-radius: 16px; padding: 0; max-width: 520px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog .dl { padding: 22px; }
dialog h3 { font-size: 20px; margin-bottom: 6px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .stats b { font-size: 24px; }
  .slot { grid-template-columns: 56px 1fr; }
  .slot > :last-child { grid-column: 1 / -1; }
}
