:root {
  color-scheme: only light;
  --page: #fbfaf6;
  --sun: #ccefd8;
  --sun-deep: #43845f;
  --sky: #eefaf2;
  --mint: #e2f7e9;
  --mint-strong: #bfe8cd;
  --ink: #28513c;
  --muted: #607b6d;
  --line: #cfe8d8;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  color-scheme: only light;
  scroll-behavior: smooth;
  background-color: var(--page) !important;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background-color: var(--page) !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

.lightBackdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.shell {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(36px, env(safe-area-inset-bottom));
  background-color: var(--page) !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.brandLogo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }

.language {
  display: flex;
  padding: 4px;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(32,48,42,.1);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(44,70,57,.06);
}

.language button {
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}
.language button.active { color: #173d28; background: var(--mint); }

.welcome { text-align: center; margin: 0 auto 24px; }
.eyebrow {
  margin: 0 0 8px;
  color: #347451;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 8vw, 58px);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.lead {
  max-width: 610px;
  margin: 16px auto 8px;
  color: #3e5048;
  font-size: clamp(17px, 3.5vw, 21px);
  line-height: 1.55;
}
.guide { margin: 0 auto 16px; color: var(--muted); font-size: 14px; }
.hopeLine {
  width: fit-content;
  max-width: 100%;
  margin: 12px auto 10px;
  padding: 10px 16px;
  border: 1px solid #dbece7;
  border-radius: 999px;
  color: #315549;
  background: linear-gradient(135deg, #f1f9fc, #f1faf5);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
}

.introButton, .listenButton, .replyButton, .newButton, .hearContactButton, .fieldVoiceButton {
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid rgba(32,48,42,.12);
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
  font-weight: 800;
  box-shadow: 0 7px 22px rgba(44,70,57,.08);
  cursor: pointer;
}

.contactField { min-width: 0; }
.fieldVoiceButton {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border-radius: 14px;
  background: #f5fbf7;
}
.hearContactButton {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border-radius: 14px;
  background: var(--mint);
}

.yanaContactVoiceActions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.yanaContactVoiceButton {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  height: auto;
  padding: 12px 10px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.contactCard, .talkCard, .answerCard, .continueCard, .sharedContextCard {
  padding: clamp(20px, 5vw, 34px);
  border: 1px solid rgba(32,48,42,.1);
  border-radius: 28px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 22px 60px rgba(44,70,57,.12);
}

.contactCard, .continueCard, .sharedContextCard { margin-bottom: 18px; background: rgba(247,253,249,.98); }
.contactIntro { margin: 10px 0 18px; color: var(--muted); line-height: 1.55; }
.fieldGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

input[type="text"], input[type="tel"], input[type="email"] {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: #fffefb;
  color-scheme: light;
  -webkit-text-fill-color: var(--ink);
  font-size: 16px;
}
input::placeholder, textarea::placeholder { color: #7a8982; opacity: 1; -webkit-text-fill-color: #7a8982; }

input:focus, textarea:focus { outline: 4px solid rgba(77,152,112,.18); border-color: var(--sun-deep); }

.deliveryChoice {
  display: flex;
  gap: 10px;
  margin: 18px 0 14px;
  padding: 0;
  border: 0;
}
.deliveryChoice legend { width: 100%; margin-bottom: 8px; font-weight: 850; }
.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 15px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}
.choice.active { border-color: var(--sun-deep); background: var(--mint); }
.choice input { accent-color: var(--sun-deep); }
.emailField { margin-bottom: 14px; }
.consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 14px; line-height: 1.5; }
.consent input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; accent-color: #24704d; }
.contactNote { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.startSessionButton {
  width: 100%;
  min-height: 58px;
  margin-top: 18px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: #24704d;
  box-shadow: 0 10px 24px rgba(36,112,77,.2);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}
.startSessionButton:disabled { opacity: .7; cursor: wait; }

.sectionHeading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.talkHeading { flex: 1 1 auto; min-width: 0; }

.step {
  margin: 0 0 6px;
  color: #347451;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .04em;
}
h2 { margin: 0; font-size: clamp(21px, 4.5vw, 29px); line-height: 1.28; }

.timer {
  flex: 0 0 auto;
  min-width: 70px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  background: #f5f5ef;
  font-variant-numeric: tabular-nums;
  text-align: center;
  font-weight: 800;
}

.micButton {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 78px;
  margin: 16px 0 12px;
  border: 0;
  border-radius: 22px;
  color: #173d28;
  background: linear-gradient(135deg, #dcf5e4, #a9ddb9);
  box-shadow: 0 12px 26px rgba(67,132,95,.2);
  font-size: 21px;
  font-weight: 900;
  cursor: pointer;
}

.micButton.recording {
  color: #214a35;
  background: linear-gradient(135deg, #d8f4e1, #9ed9b3);
  box-shadow: 0 12px 30px rgba(67,132,95,.25);
  animation: breathe 1.8s ease-in-out infinite;
}
.micButton:disabled, .finishButton:disabled { opacity: .55; cursor: wait; }
.micIcon { font-size: 28px; }

@keyframes breathe {
  50% { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(67,132,95,.32); }
}

.status {
  min-height: 26px;
  margin: 0 0 18px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}
.status.live { color: #2d7350; font-weight: 800; }
.status.busy { color: #55705f; font-weight: 800; }
.status.error { color: #8a5b18; font-weight: 800; }

label { display: block; margin-bottom: 8px; font-weight: 850; }

textarea {
  display: block;
  width: 100%;
  min-height: 170px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: #fffefb;
  color-scheme: light;
  -webkit-text-fill-color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  resize: vertical;
}
.micHelp { margin: -4px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
.finishButton {
  width: 100%;
  min-height: 58px;
  margin-top: 14px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: #24704d;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(36,112,77,.22);
  cursor: pointer;
}

.answerCard { margin-top: 22px; background: linear-gradient(145deg, #effaf3, #fbfffc); }
.answer {
  margin-top: 18px;
  color: #263b31;
  font-size: 17px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.deliveryStatus { margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--sky); font-size: 14px; font-weight: 800; }
.deliveryStatus:empty { display: none; }
.deliveryStatus.error { color: #765019; background: #fff8e7; }
.answerActions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.listenButton { background: var(--mint); }
.replyButton { color: #fff; background: #43845f; }
.newButton { background: var(--white); }
.voiceNote { margin: 9px 0 0; color: var(--muted); font-size: 12px; }

.safety {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  color: #665226;
  background: #fff9e8;
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}
.privacy { margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.portal { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 24px; padding: 24px 18px; border: 1px solid var(--line); border-radius: 22px; color: var(--muted); background: var(--mint); font-size: 14px; text-align: center; }
.portal a { color: #1f6d4a; font-size: 18px; font-weight: 900; }
.portalQr { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 8px; }
.portalQr img { width: 148px; height: 148px; padding: 7px; border-radius: 14px; background: #fff; box-shadow: 0 7px 22px rgba(44,70,57,.1); }
.portalQr span { max-width: 280px; font-size: 13px; font-weight: 750; }
.appShare { width: min(480px, 100%); margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.appShare > strong, .appShare > span { display: block; }
.appShare > strong { color: var(--ink); font-size: 17px; }
.appShare > span { margin-top: 5px; font-size: 13px; }
.appShareActions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.appShareActions button { min-height: 48px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; font-weight: 900; cursor: pointer; }
.codeRow { display: flex; gap: 10px; align-items: stretch; }
.codeInput { flex: 1 1 auto; min-width: 0; }
.openButton, .sendLinkButton {
  min-height: 52px;
  padding: 11px 18px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: #43845f;
  font-weight: 900;
  cursor: pointer;
}
.sharedFrom { margin: 10px 0; color: var(--muted); font-weight: 800; }
.sharedContext { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; white-space: pre-wrap; line-height: 1.65; }
.shareCard { margin-top: 24px; padding-top: 24px; border-top: 2px solid var(--line); }
.shareCard h3 { margin: 0; color: var(--ink); font-size: clamp(20px, 4vw, 25px); }
.shareHelp { margin: 10px 0 16px; color: var(--muted); line-height: 1.55; }
.relationshipChoice { display: flex; gap: 10px; margin: 0 0 14px; padding: 0; border: 0; }
.relationshipChoice legend { width: 100%; margin-bottom: 8px; font-weight: 850; }
.sendLinkButton { width: 100%; margin-top: 12px; background: #4d9870; }
.inlineStatus { min-height: 24px; margin: 10px 0 0; color: var(--muted); font-size: 14px; font-weight: 850; }
.inlineStatus.success { padding: 12px 14px; border-radius: 14px; color: #286044; background: var(--mint); }
.inlineStatus.error { color: #765019; }
.handoffFallback { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #f5fcf7; }
.handoffFallback > p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.handoffDetails { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px; }
.handoffDetails span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.handoffDetails input { min-height: 46px; padding: 9px 11px; font-size: 13px; background: #fff; }
.handoffDetails .shareCode { text-align: center; font-size: 20px; font-weight: 900; letter-spacing: .12em; }
.handoffQrCard { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: center; margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.handoffQrCard img { display: block; width: 132px; height: 132px; padding: 5px; border-radius: 12px; background: #fff; }
.handoffQrCard strong, .handoffQrCard span { display: block; }
.handoffQrCard strong { margin-bottom: 6px; color: var(--ink); font-size: 16px; }
.handoffQrCard span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.fallbackActions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.openSmsButton, .copyShareButton {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}
.openSmsButton { color: #fff; background: #43845f; }
.copyShareButton { color: var(--ink); background: var(--mint); }
.hidden { display: none !important; }

@media (max-width: 520px) {
  :root {
    --sky: #f5fafc;
    --mint: #f2faf6;
    --mint-strong: #e8f5ee;
    --line: #dfe9e5;
    --ink: #25332d;
    --muted: #5f6c66;
  }
  html, body, .shell { background-color: var(--page) !important; }
  .shell { padding-left: 12px; padding-right: 12px; }
  .topbar { align-items: flex-start; margin-bottom: 16px; }
  .brand { font-size: 14px; }
  .language { background: #fff; box-shadow: none; }
  .language button { padding-left: 9px; padding-right: 9px; font-size: 13px; }
  .language button.active { background: #f0f8fb; }
  .welcome { margin-bottom: 16px; }
  .lead { margin-top: 10px; }
  .guide { margin-bottom: 10px; }
  .contactCard, .talkCard, .answerCard, .continueCard, .sharedContextCard {
    border-color: #e4ebe8;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(38,58,49,.06);
  }
  .fieldGrid { grid-template-columns: 1fr; }
  .deliveryChoice { display: grid; grid-template-columns: 1fr 1fr; }
  .choice { justify-content: center; padding-left: 10px; padding-right: 10px; }
  .sectionHeading { display: flex; gap: 8px; }
  .timer { min-width: 62px; padding: 7px 9px; }
  .micButton { min-height: 72px; border: 1px solid #dce9e4; color: var(--ink); background: #f1f8fb; box-shadow: none; font-size: 22px; }
  .micButton.recording { background: #edf8f2; box-shadow: none; }
  .startSessionButton, .finishButton, .openButton, .sendLinkButton, .replyButton, .openSmsButton {
    border: 1px solid #d4e4dd;
    color: var(--ink);
    background: #eef8f3;
    box-shadow: none;
  }
  .listenButton, .hearContactButton, .fieldVoiceButton, .copyShareButton { background: #f1f8fb; box-shadow: none; }
  .choice.active { border-color: #cbded6; background: #f2faf6; }
  .answerCard { background: #fff; }
  .safety { color: #4e5753; background: #f7fafb; }
  .portal { background: #f4faf8; }
  .answerActions > button { width: 100%; }
  .yanaContactVoiceActions { grid-template-columns: 1fr; }
  .codeRow { flex-direction: column; }
  .openButton { width: 100%; }
  .handoffDetails, .fallbackActions { grid-template-columns: 1fr; }
  .appShareActions { grid-template-columns: 1fr; }
  .handoffQrCard { grid-template-columns: 108px 1fr; }
  .handoffQrCard img { width: 108px; height: 108px; }
}

@media (max-width: 410px) {
  .topbar { flex-wrap: wrap; }
  .language { width: 100%; justify-content: center; }
  .language button { flex: 1 1 0; }
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: only light !important; }
  html, body, .shell { color: var(--ink); background-color: var(--page) !important; }
  .contactCard, .talkCard, .answerCard, .continueCard, .sharedContextCard,
  .language, .choice, .sharedContext, .handoffFallback, .handoffQrCard,
  input, textarea, button { color: var(--ink); background-color: #ffffff; }
  input, textarea { -webkit-text-fill-color: var(--ink); }
  .lightBackdrop { filter: none !important; opacity: 1 !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .micButton.recording { animation: none; }
}
