:root {
  --theme: #5746e3;
  --page-background: #eeedfc;
  --card-background: #ffffff;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --link: #1a73e8;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-background);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-primary);
  background: var(--page-background);
  font-family: Roboto, Arial, "Noto Sans KR", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 1px;
}

.page-shell {
  width: min(640px, calc(100% - 24px));
  margin: 12px auto 36px;
}

.intro-card,
.question-card,
.response-card {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-background);
  box-shadow: 0 1px 2px rgb(60 64 67 / 8%);
}

.theme-bar {
  height: 10px;
  background: var(--theme);
}

.intro-copy {
  padding: 19px 24px 20px;
}

.intro-copy h1 {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.25;
  outline: none;
}

.response-card[hidden] {
  display: none;
}

#details-step[hidden] {
  display: none;
}

.step-kicker {
  margin: 0 0 7px !important;
  color: var(--theme);
  font-size: 13px !important;
  font-weight: 500;
  line-height: 20px !important;
}

.chat-screen {
  overflow: hidden;
  background: #fff;
}

.chat-header {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid #e5e8ed;
  background: #fff;
}

.agent-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #6554e8, #4030bd);
  box-shadow: 0 2px 5px rgb(64 48 189 / 24%);
}

.agent-avatar svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.agent-info {
  min-width: 0;
  flex: 1;
}

.agent-info h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 23px;
  outline: none;
}

.agent-info p {
  display: flex;
  margin: 3px 0 0;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 18px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border: 2px solid #dff6e6;
  border-radius: 50%;
  background: #1eaa59;
}

.chat-menu {
  color: #80868b;
  font-size: 18px;
  letter-spacing: 2px;
}

.chat-thread {
  min-height: 430px;
  padding: 18px 20px 22px;
  background:
    radial-gradient(circle at 12px 12px, rgb(87 70 227 / 3%) 1px, transparent 1px) 0 0 / 24px 24px,
    #f5f6fa;
}

.chat-day {
  display: flex;
  margin-bottom: 18px;
  align-items: center;
  gap: 10px;
  color: #9aa0a6;
  font-size: 11px;
  text-align: center;
}

.chat-day::before,
.chat-day::after {
  height: 1px;
  flex: 1;
  background: #e1e4e9;
  content: "";
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(7px);
  animation: chat-message-in 320ms ease forwards;
}

.message-one {
  margin-top: 0;
  animation-delay: 80ms;
}

.message-two {
  animation-delay: 260ms;
}

.message-three {
  animation-delay: 440ms;
}

.agent-avatar-small {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.agent-avatar-small svg {
  width: 24px;
  height: 24px;
}

.avatar-spacer {
  width: 34px;
  flex: 0 0 34px;
}

.message-column {
  max-width: calc(100% - 44px);
}

.message-sender {
  display: block;
  margin: 0 0 5px 2px;
  color: #5f6368;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
}

.message-bubble {
  width: fit-content;
  max-width: 470px;
  padding: 11px 13px;
  border: 1px solid #e0e3e8;
  border-radius: 4px 15px 15px 15px;
  color: #2a2d31;
  background: #fff;
  box-shadow: 0 1px 2px rgb(60 64 67 / 8%);
  font-size: 14px;
  line-height: 22px;
}

.message-bubble-emphasis {
  border-color: #d8d2ff;
  background: #f5f2ff;
}

.message-bubble strong {
  color: #4937cf;
  font-weight: 700;
}

.message-time {
  display: block;
  margin: 4px 0 0 4px;
  color: #9aa0a6;
  font-size: 10px;
  line-height: 14px;
}

.message-template {
  margin: 20px 0 0 44px;
  padding: 13px 14px;
  border: 1px solid #ded9ff;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 5px rgb(60 64 67 / 8%);
  opacity: 0;
  animation: chat-message-in 320ms 620ms ease forwards;
}

.message-template > span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 16px;
}

.message-template-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.message-template-row strong {
  color: #3c4043;
  font-size: 14px;
  line-height: 21px;
}

#copy-report-message {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid #d5d8dd;
  border-radius: 6px;
  color: var(--theme);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

#copy-report-message:hover {
  background: #f6f3ff;
}

#copy-report-message svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.chat-action-panel {
  padding: 16px 20px 18px;
  border-top: 1px solid #e5e8ed;
  background: #fff;
}

.kakao-chat-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 11px;
  justify-content: center;
  padding: 12px 17px;
  border: 1px solid #e6cf00;
  border-radius: 9px;
  color: #191919;
  background: #fee500;
  box-shadow: 0 2px 5px rgb(0 0 0 / 13%);
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  text-decoration: none;
  transition: background-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.kakao-chat-button:hover {
  background: #f6df00;
  box-shadow: 0 4px 9px rgb(0 0 0 / 18%);
  transform: translateY(-1px);
}

.kakao-chat-button:focus-visible,
#copy-report-message:focus-visible {
  outline: 3px solid rgb(26 115 232 / 28%);
  outline-offset: 3px;
}

.kakao-chat-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.kakao-chat-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.chat-button-arrow {
  margin-left: auto;
  font-size: 20px;
  font-weight: 400;
}

.trusted-domain {
  display: flex;
  margin: 9px 0 0;
  align-items: center;
  gap: 5px;
  justify-content: center;
  color: #777c82;
  font-size: 11px;
  line-height: 17px;
}

.trusted-domain svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

@keyframes chat-message-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.submit-another-button {
  display: block;
  margin: 18px auto 0;
  padding: 0;
  border: 0;
  color: var(--link);
  background: transparent;
  font-weight: 500;
  line-height: 20px;
  text-decoration: underline;
  text-underline-offset: 1px;
  cursor: pointer;
}

.submit-another-button:focus-visible {
  border-radius: 2px;
  outline: 3px solid rgb(26 115 232 / 22%);
  outline-offset: 2px;
}

.intro-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.question-card {
  min-width: 0;
  width: 100%;
  margin-top: 12px;
  padding: 23px 24px 22px;
}

.text-question-card {
  min-height: 150px;
  padding-top: 24px;
}

.text-question-label {
  display: block;
  font-size: 16px;
  line-height: 24px;
}

.field-help {
  margin: 5px 0 18px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 20px;
}

.text-input {
  display: block;
  width: min(360px, 100%);
  height: 36px;
  padding: 7px 0 6px;
  border: 0;
  border-bottom: 1px solid #9aa0a6;
  border-radius: 0;
  color: var(--text-primary);
  background: transparent;
  font-size: 14px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.text-input::placeholder {
  color: #9aa0a6;
}

.text-input:focus {
  border-bottom-color: var(--theme);
  box-shadow: 0 1px 0 var(--theme);
}

.submission-disclosure {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid #e1e4e9;
  border-radius: 8px;
  color: var(--text-secondary);
  background: #f8f9fa;
  font-size: 12px;
  line-height: 19px;
}

.submission-disclosure strong {
  display: block;
  margin-bottom: 2px;
  color: #3c4043;
  font-weight: 600;
}

.details-actions {
  display: flex;
  min-height: 52px;
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 12px;
}

.details-primary-actions {
  display: flex;
  gap: 10px;
}

.back-button {
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  color: var(--theme);
  background: transparent;
  font-weight: 500;
  cursor: pointer;
}

.back-button {
  padding: 0 14px;
  border: 1px solid #dadce0;
  background: #fff;
}

.back-button:hover {
  background: rgb(87 70 227 / 7%);
}

.back-button:focus-visible,
.text-input:focus-visible {
  outline: 3px solid rgb(26 115 232 / 22%);
  outline-offset: 2px;
}

.question-card legend {
  float: left;
  width: 100%;
  margin: 0 0 15px;
  padding: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.question-card legend + * {
  clear: both;
}

.option-list {
  display: grid;
  gap: 16px;
}

.option {
  display: flex;
  min-height: 24px;
  align-items: flex-start;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 24px;
}

.option input {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 3px 14px 0 0;
  appearance: none;
  border: 2px solid #9aa0a6;
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  outline: none;
}

.option input::after {
  position: absolute;
  top: 1px;
  left: 4px;
  width: 5px;
  height: 9px;
  transform: rotate(45deg) scale(0);
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  transition: transform 90ms ease-out;
}

.option input:checked {
  border-color: var(--theme);
  background: var(--theme);
}

.option input:checked::after {
  transform: rotate(45deg) scale(1);
}

.option input:focus-visible {
  box-shadow: 0 0 0 8px rgb(87 70 227 / 14%);
}

.form-actions {
  display: flex;
  min-height: 48px;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 12px;
}

.submit-button,
.clear-button {
  border: 0;
  cursor: pointer;
}

.submit-button {
  min-width: 73px;
  height: 36px;
  padding: 0 20px;
  border-radius: 4px;
  color: #fff;
  background: var(--theme);
  box-shadow: 0 1px 2px rgb(60 64 67 / 18%);
  font-weight: 500;
  letter-spacing: 0.2px;
}

.submit-button:hover {
  background: #4f3ed5;
  box-shadow: 0 2px 4px rgb(60 64 67 / 25%);
}

.submit-button:focus-visible,
.clear-button:focus-visible,
.help-button:focus-visible {
  outline: 3px solid rgb(26 115 232 / 28%);
  outline-offset: 2px;
}

.submit-button:active {
  box-shadow: none;
  transform: translateY(1px);
}

.clear-button {
  min-height: 36px;
  padding: 0 8px;
  color: var(--theme);
  background: transparent;
  font-weight: 500;
}

.clear-button:hover {
  border-radius: 4px;
  background: rgb(87 70 227 / 7%);
}

.form-footer {
  padding: 7px 20px 0;
  color: var(--text-secondary);
  text-align: center;
}

.form-footer p {
  margin: 8px 0;
  font-size: 12px;
  line-height: 16px;
}

.form-footer a {
  color: inherit;
}

.privacy-notice {
  color: #3c4043;
  font-weight: 500;
}

.purpose-notice {
  max-width: 560px;
  margin-right: auto !important;
  margin-left: auto !important;
}

.support-wordmark {
  margin-top: 18px;
  color: #6f7076;
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
}

.help-button {
  position: fixed;
  bottom: 22px;
  left: 18px;
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  border: 2px solid #9aa0a6;
  border-radius: 50%;
  color: #7b8085;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.snackbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 10;
  min-width: 240px;
  padding: 14px 20px;
  transform: translateX(-50%);
  border-radius: 4px;
  color: #fff;
  background: #323232;
  box-shadow: 0 3px 8px rgb(0 0 0 / 24%);
  text-align: center;
}

.snackbar[hidden] {
  display: none;
}

@media (max-width: 520px) {
  .page-shell {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .intro-copy,
  .question-card {
    padding-right: 24px;
    padding-left: 24px;
  }

  .intro-copy h1 {
    font-size: 28px;
    line-height: 1.3;
  }

  .chat-header {
    min-height: 72px;
    padding: 13px 15px;
  }

  .agent-avatar {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .agent-avatar svg {
    width: 29px;
    height: 29px;
  }

  .agent-avatar-small {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .agent-avatar-small svg {
    width: 22px;
    height: 22px;
  }

  .agent-info h1 {
    font-size: 16px;
  }

  .chat-thread {
    min-height: 0;
    padding: 16px 13px 19px;
  }

  .avatar-spacer {
    width: 32px;
    flex-basis: 32px;
  }

  .message-column {
    max-width: calc(100% - 42px);
  }

  .message-bubble {
    padding: 10px 12px;
    font-size: 13px;
    line-height: 21px;
  }

  .message-template {
    margin-left: 42px;
  }

  .chat-action-panel {
    padding: 14px 13px 16px;
  }

  .kakao-chat-button {
    min-height: 52px;
    font-size: 15px;
  }

  .form-footer {
    padding-right: 10px;
    padding-left: 10px;
  }

  .details-actions {
    gap: 12px;
  }

  .details-primary-actions {
    gap: 6px;
  }

  .back-button,
  .submit-button {
    padding-right: 12px;
    padding-left: 12px;
  }

  .help-button {
    bottom: 16px;
    left: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
