:root {
  color-scheme: light;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --paper: #faf9f5;
  --surface: #fff;
  --soft: #f3f1ed;
  --bubble: #ebe7e1;
  --ink: #252321;
  --muted: #605b55;
  --line: #dcd8d2;
  --control-line: #a39d94;
  --charcoal: #302d2b;
  --charcoal-hover: #494440;
  --alert: #8a3f32;
  --radius: 10px;
  --content: 1384px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}
main { flex: 1; }
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 3px; }
:focus-visible[tabindex="-1"] { outline-offset: 5px; }
.wrap { width: min(90%, var(--content)); margin-inline: auto; }
.muted, .price { color: var(--muted); }
.price { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}


.hero {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 3.2vw, 50px);
  min-height: clamp(470px, 45vw, 690px);
  padding-block: clamp(48px, 5.4vw, 82px);
}
.hero h1 {
  font-size: clamp(2.65rem, 5.1vw, 5rem);
  font-weight: 790;
  line-height: 1.21;
  letter-spacing: -.062em;
  word-break: keep-all;
}
.hero-description { margin-top: clamp(17px, 2.6vw, 36px); font-size: clamp(1rem, 1.65vw, 1.6rem); word-break: keep-all; }
.hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; margin-top: clamp(24px, 3.7vw, 54px); }
.test-shortcut .button { width: 100%; }
.hero-price { margin-top: 11px; font-size: .875rem; }
.hero-price:empty { display: none; }

.button, .chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}
.button:disabled, .chat-send:disabled { cursor: default; }
.primary, .chat-send { background: var(--charcoal); color: var(--surface); }
.primary:not(:disabled):hover, .chat-send:not(:disabled):hover { background: var(--charcoal-hover); }
.primary:disabled, .chat-send:disabled { color: var(--muted); background: var(--bubble); }
.secondary { border-color: var(--control-line); background: transparent; color: var(--ink); }
.secondary:not(:disabled):hover { border-color: var(--ink); background: var(--soft); }
.secondary:disabled { border-color: var(--line); color: var(--muted); }
.hero-actions .button { min-height: clamp(50px, 5.25vw, 80px); padding-inline: 10px; font-size: clamp(.94rem, 1.7vw, 1.65rem); }

.hero-preview {
  align-self: stretch;
  min-height: clamp(300px, 32.7vw, 505px);
  align-content: start;
  border: 1px solid var(--line);
  border-radius: clamp(12px, 1.5vw, 23px);
  background: var(--surface);
}
.preview-header { display: flex; align-items: center; gap: clamp(12px, 1.4vw, 22px); padding: clamp(16px, 1.9vw, 30px) clamp(16px, 2.6vw, 40px); border-bottom: 1px solid var(--line); }
.avatar { display: grid; flex: none; place-items: center; border-radius: 50%; width: clamp(42px, 5vw, 76px); aspect-ratio: 1; color: var(--ink); background: var(--bubble); font-weight: 750; font-size: clamp(1.1rem, 2.1vw, 2rem); }
.preview-identity { display: grid; gap: 1px; line-height: 1.3; }
.preview-identity strong { font-size: clamp(1.14rem, 2.1vw, 2rem); }
.preview-identity > span, .preview-label { color: var(--muted); font-size: clamp(.875rem, 1.45vw, 1.35rem); }
.preview-label { margin-left: auto; white-space: nowrap; }
.preview-messages { display: grid; justify-items: start; gap: clamp(18px, 2vw, 32px); padding: clamp(22px, 3vw, 46px) clamp(16px, 2.25vw, 35px); font-size: clamp(1rem, 1.75vw, 1.7rem); line-height: 1.45; }
.preview-question, .preview-reply { max-width: 91%; padding: clamp(9px, 1.1vw, 17px) clamp(12px, 1.8vw, 28px); border-radius: var(--radius); word-break: keep-all; }
.preview-question { justify-self: end; background: var(--charcoal); color: var(--surface); }
.preview-reply { max-width: min(83%, 17em); background: var(--bubble); }
#my-consultation-link { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; }
.landing-topics { border-block: 1px solid var(--line); background: var(--soft); }
.landing-section, .landing-faq { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: clamp(30px, 8vw, 116px); padding-block: clamp(42px, 7vw, 100px); }
.landing-section h2, .guide h2, .landing-faq h2, .landing-final h2 { font-size: clamp(1.9rem, 3.55vw, 3.25rem); line-height: 1.18; letter-spacing: -.052em; word-break: keep-all; }
.landing-intro p { max-width: 34ch; margin-top: 16px; color: var(--muted); font-size: clamp(1rem, 1.45vw, 1.2rem); word-break: keep-all; }
.topic-list { margin: 0; }
.topic-list div { display: grid; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.topic-list div:first-child { padding-top: 0; }
.topic-list dt { font-size: 1.15rem; font-weight: 740; }
.topic-list dd { margin: 0; color: var(--muted); word-break: keep-all; }
.guide { padding-block: clamp(42px, 6.6vw, 94px); scroll-margin-top: 24px; }
.guide h2 { margin-bottom: 24px; }
.landing-faq { border-top: 1px solid var(--line); }
.landing-faq details { padding: 15px 0; border-bottom: 1px solid var(--line); }
.landing-faq details:first-child { border-top: 1px solid var(--line); }
.landing-faq summary { cursor: pointer; font-weight: 700; }
.landing-faq p { margin-top: 8px; color: var(--muted); word-break: keep-all; }
.landing-final { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: clamp(20px, 4vw, 58px); margin-bottom: clamp(28px, 5vw, 68px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.landing-final h2 { font-size: clamp(1.5rem, 2.6vw, 2.35rem); }
.guide ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; }
.guide h3 { font-size: clamp(1.06rem, 2vw, 1.85rem); letter-spacing: -.035em; }
.guide p { margin-top: 5px; color: var(--muted); font-size: clamp(.94rem, 1.4vw, 1.35rem); word-break: keep-all; }

.flow { padding-block: clamp(28px, 5.4vw, 78px); }
.sheet { max-width: 720px; margin-inline: auto; padding: clamp(20px, 4.3vw, 48px); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.sheet-header { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.sheet h1 { font-size: clamp(1.85rem, 4vw, 2.75rem); font-weight: 790; line-height: 1.2; letter-spacing: -.05em; word-break: keep-all; }
.sheet-header > .muted { margin-top: 9px; word-break: keep-all; }
.sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
#checkout, #lookup { display: grid; gap: 22px; margin-top: 23px; }
.booking-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.booking-field legend, .payer-field label { margin-bottom: 8px; padding: 0; font-weight: 720; }
.booking-field legend small { margin-left: 5px; color: var(--muted); font-size: .875rem; font-weight: 500; }
.booking-dates, .booking-times { display: grid; gap: 8px; padding: 3px; margin-inline: -3px; }
.booking-dates { grid-auto-flow: column; grid-auto-columns: minmax(76px, 1fr); overflow-x: auto; scrollbar-width: thin; }
.booking-times { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.booking-field label { position: relative; min-width: 0; }
.booking-field label > span { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 46px; padding: 6px 3px; border: 1px solid var(--control-line); border-radius: 7px; color: var(--ink); background: var(--surface); font-size: .94rem; font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer; }
.booking-dates label > span { min-height: 62px; background: var(--soft); }
.booking-dates label small { color: var(--muted); font-size: .875rem; font-weight: 500; }
.booking-field label:hover > span { border-color: var(--ink); }
.booking-field input:checked + span { border-color: var(--charcoal); background: var(--charcoal); color: var(--surface); }
.booking-field input:checked + span small { color: var(--surface); }
.booking-field input:focus-visible + span { outline: 2px solid var(--charcoal); outline-offset: 1px; }
#booking-status, .booking-selection { margin-top: 6px; font-size: .9rem; }
.booking-selection { display: block; color: var(--muted); font-weight: 650; }
.payer-field label { display: block; }
#lookup .button { justify-self: start; }
.field-help { margin-top: 7px; color: var(--muted); font-size: .875rem; }
input, textarea { width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid var(--control-line); border-radius: 8px; color: var(--ink); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.checkout-actions { justify-content: space-between; margin-top: 0; padding-top: 20px; border-top: 1px solid var(--line); }
.checkout-price { color: var(--ink); font-size: 1.125rem; font-weight: 720; }
#payment-details { display: grid; gap: 11px; margin: 24px 0 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
#payment-details div { display: grid; grid-template-columns: minmax(88px, 1fr) minmax(0, 2fr); gap: 10px; }
#payment-details dt { color: var(--muted); }
#payment-details dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.demo-note { margin-top: 14px; color: var(--muted); font-size: .94rem; word-break: keep-all; }
.flow-loading { padding-block: 42px; color: var(--muted); text-align: center; }
.flow-status { max-width: 720px; margin: 10px auto 0; color: var(--alert); font-size: .9rem; }
.flow-status:empty { display: none; }

.chat-open { background: var(--soft); }
.chat-open > .site-header, .chat-open > .site-footer { display: none; }
.chat-open .flow { width: min(calc(100% - 48px), 900px); padding: 24px 0; }
.chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: calc(100dvh - 48px); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.chat-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 12px 20px 12px 12px; border-bottom: 1px solid var(--line); }
.chat-back { display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--ink); background: transparent; cursor: pointer; }
.chat-back span { width: 11px; height: 11px; border-bottom: 2px solid; border-left: 2px solid; transform: translateX(2px) rotate(45deg); }
.chat-back:hover, .chat-action:not(:disabled):hover { background: var(--soft); }
.chat-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-avatar { width: 40px; font-size: 1rem; }
.chat-name { min-width: 0; }
.chat-identity h1 { overflow: hidden; font-size: 1.2rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
#chat-activity { margin-top: 2px; color: var(--muted); font-size: .875rem; line-height: 1.35; }
.chat-utilities { display: flex; align-items: center; gap: 3px; }
.chat-action { min-height: 44px; padding: 0 9px; border: 0; border-radius: 7px; color: var(--ink); background: transparent; font-size: .875rem; white-space: nowrap; cursor: pointer; }
.chat-action:disabled { color: var(--muted); cursor: default; }
.chat-clock { min-width: 79px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); text-align: center; }
.timer-label { color: var(--muted); font-size: .813rem; white-space: nowrap; }
.timer { font-size: 1.125rem; font-variant-numeric: tabular-nums; font-weight: 720; line-height: 1.2; }
.chat-clock[data-low] .timer { color: var(--alert); }
.chat-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 28px; }
.chat-scroll:focus-visible { outline-offset: -3px; }
.chat-waiting { margin: clamp(20px, 7vh, 64px) auto 20px; max-width: 440px; padding: clamp(18px, 4vw, 34px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); text-align: center; word-break: keep-all; }
.chat-waiting h2 { font-size: 1.5rem; letter-spacing: -.04em; }
.chat-waiting p { margin-top: 6px; color: var(--muted); }
.chat-waiting .chat-booked-time { margin-top: 12px; color: var(--ink); font-weight: 700; }
.chat-waiting .button { margin-top: 16px; }
.conversation-inner, #composer, .chat-ended, .chat-footer .flow-status { max-width: 700px; margin-inline: auto; }
.chat-date { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 22px; color: var(--muted); font-size: .875rem; }
.chat-date::before, .chat-date::after { content: ""; width: 24px; height: 1px; background: var(--line); }
#messages { display: grid; gap: 5px; padding: 0; margin: 0; list-style: none; }
.chat-message { display: grid; min-width: 0; max-width: min(88%, 540px); gap: 4px; justify-items: start; }
.chat-message.is-first:not(:first-child) { margin-top: 13px; }
.chat-message.assistant { justify-self: start; }
.chat-message.user { justify-self: end; }
.message-sender { padding-inline: 2px; color: var(--muted); font-size: .875rem; font-weight: 700; }
.message-bubble { padding: 10px 14px; border-radius: var(--radius); background: var(--bubble); line-height: 1.6; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.assistant.is-first .message-bubble { border-top-left-radius: 4px; }
.user .message-bubble { background: var(--charcoal); color: var(--surface); }
.user.is-first .message-bubble { border-top-right-radius: 4px; }
.chat-note { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: .875rem; }
.typing-dots { display: inline-flex; gap: 4px; padding: 8px; border-radius: 8px; background: var(--soft); }
.typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--charcoal); animation: chat-dot 1.2s infinite alternate ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { from { opacity: .42; } to { opacity: 1; } }
.chat-footer { padding: 12px 22px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
.chat-footer .flow-status { margin-block: 0 8px; }
#composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px; padding: 4px; border: 1px solid var(--control-line); border-radius: var(--radius); background: var(--surface); }
#composer:focus-within { outline: 2px solid var(--charcoal); outline-offset: 1px; }
#message { min-height: 44px; max-height: 136px; padding: 10px; resize: none; field-sizing: content; border: 0; background: transparent; line-height: 1.5; }
#message:focus-visible { outline: 0; }
.chat-send { min-height: 44px; padding-inline: 12px; }
.chat-ended { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .9rem; }
.ended-title { font-size: 1rem; font-weight: 750; color: var(--ink); }

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-block: 38px 28px; }
  .hero h1 { font-size: clamp(2.5rem, 8.3vw, 4rem); }
  .hero-actions { max-width: 450px; }
  .hero-preview { min-height: 245px; }
  .preview-messages { padding-bottom: 28px; }
  .guide { padding-inline: 0; }
}

@media (max-width: 640px) {
  .chat-open .flow { width: 100%; padding: 0; }
  .chat { height: 100dvh; border: 0; border-radius: 0; }
  .chat-header { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 8px; padding: 8px 12px 6px 6px; }
  .chat-clock { grid-column: 3; grid-row: 1; }
  .chat-utilities { grid-column: 2 / -1; justify-content: flex-end; }
  .chat-scroll, .chat-footer { padding-inline: 14px; }
}

@media (max-width: 520px) {
  .wrap { width: calc(100% - 32px); }
  .guide ol { grid-template-columns: 1fr; gap: 0; }
  .landing-section, .landing-faq { grid-template-columns: 1fr; gap: 22px; }
  .guide li + li { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
  .booking-times { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 370px) {
  .chat-avatar { display: none; }
  .checkout-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .typing-dots i { animation: none; }
}
