:root {
  --bg: #0c0c0d;
  --accent: #e2ff55;
  --accent-ink: #111111;
  --accent-soft: rgba(226, 255, 85, 0.14);
  --card: #151515;
  --field: #1c1c1d;
  --text: #e9e9ea;
  --strong: #ffffff;
  --muted: #a3a3a6;
  --border: #2a2a2b;
  --radius: 10px;
  --radius-day: 12px;
  --shadow: none;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.43 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; word-break: keep-all; overflow-wrap: break-word; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page { position: relative; width: 100%; max-width: 100vw; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; }

/* ---------- 카드 (컴퓨터: 3열) ---------- */
.card {
  display: grid; grid-template-columns: 280px 480px 280px; width: 1040px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card[data-view="form"] { grid-template-columns: 280px 760px; }
.card[data-view="form"] .cal, .card[data-view="form"] .slots { display: none; }
.card:not([data-view="form"]) .book-form { display: none; }

/* 왼쪽 정보 */
.info { border-right: 1px solid var(--border); min-width: 0; }
.banner { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; border-radius: var(--radius) 0 0 0; }
.info-body { padding: 20px 24px 24px; position: relative; }
.avatar { display: block; width: 24px; height: 24px; margin-top: -12px; border-radius: 9999px; border: 2px solid var(--card); position: relative; }
.host { margin: 8px 0 0; color: var(--muted); font-weight: 600; font-size: 14px; line-height: 20px; }
h1 { margin: 8px 0 0; color: var(--text); font-size: 20px; line-height: 28px; font-weight: 600; }
.desc { margin: 8px 0 0; line-height: 20px; }
.meta { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-direction: column; gap: 16px; font-weight: 500; }
.meta li { display: flex; align-items: center; gap: 8px; line-height: 20px; }
.meta .when { align-items: flex-start; color: var(--strong); }
.meta .when svg { margin-top: 2px; color: var(--accent); }
.tz { position: relative; }
.tz-btn { display: inline-flex; align-items: center; gap: 2px; cursor: pointer; font-weight: 400; }
.tz-btn input { border: 0; background: none; padding: 0; cursor: pointer; width: auto; field-sizing: content; }
.tz-btn input:focus { outline: none; }
.tz-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tz-btn .chev { width: 20px; height: 20px; stroke-width: 2.5; }
.tz-menu {
  position: absolute; top: 28px; left: 0; z-index: 10; width: 240px; max-height: 240px; overflow: auto;
  list-style: none; margin: 0; padding: 4px; background: var(--field); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.tz-menu li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-weight: 400; }
.tz-menu li:hover, .tz-menu li:focus { background: var(--bg); outline: none; }
.tz-menu li[aria-selected="true"] { color: var(--accent); font-weight: 600; }

/* 달력 */
.cal { padding: 12px 20px; border-right: 1px solid var(--border); min-width: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; height: 36px; margin-bottom: 16px; }
.month { margin: 0; font-size: 16px; font-weight: 600; color: var(--strong); }
.month span { color: var(--muted); font-weight: 500; }
.nav { display: flex; }
.nav button { width: 36px; height: 36px; border: 0; background: none; border-radius: var(--radius); display: grid; place-items: center; color: var(--muted); }
.nav button:hover:not(:disabled) { background: var(--bg); color: var(--strong); }
.nav button:disabled { opacity: .4; cursor: default; }
.weekdays, .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekdays { margin-bottom: 16px; text-align: center; font-size: 12px; font-weight: 500; color: var(--strong); line-height: 20px; }
.day {
  aspect-ratio: 1; border: 1px solid transparent; border-radius: var(--radius-day); background: none; padding: 0;
  font-size: 14px; font-weight: 300; color: var(--text); position: relative;
}
.day:disabled { cursor: default; }
.day.open { background: var(--accent-soft); color: var(--strong); font-weight: 500; }
.day.open:hover { border-color: var(--accent); }
.day.selected { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.day.today::after { content: ""; position: absolute; left: 50%; bottom: 14%; width: 4px; height: 4px; margin-left: -2px; border-radius: 9999px; background: currentColor; }

/* 빈 시간 */
.slots { position: relative; min-width: 0; }
.slots-inner { position: absolute; inset: 0; overflow-y: auto; padding: 12px 20px; }
.slots-head { height: 24px; display: flex; align-items: baseline; gap: 4px; margin-bottom: 12px; font-size: 16px; font-weight: 500; color: var(--strong); }
.slots-head strong { font-weight: 600; }
.slots-head span { font-size: 14px; color: var(--text); }
.status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
.status.visible { position: static; width: auto; height: auto; clip: auto; margin: 4px 0 12px; padding: 20px 16px; border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; color: var(--muted); }
.slot-list { display: flex; flex-direction: column; gap: 8px; }
.slot {
  height: 40px; width: 100%; background: var(--field); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); font-size: 14px; font-weight: 500; color: var(--text);
}
.slot:hover { border-color: var(--accent); color: var(--accent); }

/* 입력 양식 */
.book-form { padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.book-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; color: var(--strong); }
.book-form b { color: var(--accent); font-weight: 600; }
.book-form input, .book-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--field);
  padding: 9px 12px; font-weight: 400; color: var(--strong); resize: vertical;
}
.book-form input:focus, .book-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.error { margin: 0; min-height: 20px; color: #ff9b7a; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.primary, .ghost { height: 36px; padding: 0 16px; border-radius: var(--radius); font-weight: 600; }
.primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); font-weight: 800; }
.primary:hover { background: #ecff8a; }
.primary:disabled { opacity: .6; cursor: wait; }
.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* 확정 화면 */
.done {
  width: min(600px, calc(100% - 32px)); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 40px 32px; text-align: center;
}
.check { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 9999px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.check svg { width: 28px; height: 28px; stroke-width: 2.5; }
.done h2 { margin: 0; font-size: 20px; font-weight: 600; color: var(--strong); }
.done-sub { margin: 8px 0 24px; color: var(--muted); }
.done dl { display: grid; grid-template-columns: 64px 1fr; gap: 12px 16px; text-align: left; margin: 0 0 28px; padding: 24px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.done dt { font-weight: 600; color: var(--strong); }
.done dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

.mock-note { position: absolute; bottom: 16px; left: 16px; right: 16px; margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.mock-note::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 9999px; background: var(--accent); vertical-align: middle; }

/* ---------- 태블릿·휴대폰: 세로로 쌓기 ---------- */
@media (max-width: 1079px) {
  .page { justify-content: flex-start; }
  .card, .card[data-view="form"] { display: flex; flex-direction: column; width: 100%; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  .info, .cal { border-right: 0; }
  .banner { border-radius: 0; }
  .info-body { padding-bottom: 16px; }
  .meta { margin-top: 32px; }
  .slots-inner { position: static; padding: 12px 24px 24px; }
  .slots-head { margin-bottom: 16px; }
  .book-form { padding: 8px 24px 32px; }
  .done { margin: 24px 0; }
  .mock-note { position: static; margin: 0 16px 24px; }
}
@media (min-width: 641px) and (max-width: 1079px) {
  .info, .cal { width: 340px; }
}
@media (max-width: 640px) {
  .weekdays { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 14px 0; margin-bottom: 8px; }
  .actions button { flex: 1; }
  .done { padding: 32px 20px; }
}

.code-row{display:flex;gap:8px}
.code-row input{flex:1;min-width:0}
.code-row button{white-space:nowrap;flex:none}
.consent{font-size:12px;color:var(--muted);line-height:1.5;margin:4px 0 0}
.consent a{color:inherit;text-decoration:underline}

/* 상담 방식 고르기 */
.method { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.method legend { font-weight: 500; color: var(--strong); margin-bottom: 6px; padding: 0; }
.book-form label.pick { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--text); cursor: pointer; }
.book-form label.pick input { width: auto; accent-color: var(--accent); }

.back-link { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; font-size: 14px; }
.back-link:hover { text-decoration: underline; }
