:root {
  --bg-top: #f7f4ed;
  --bg-bottom: #ece7db;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --text: #171511;
  --muted: #6e675d;
  --border: rgba(30, 25, 18, 0.1);
  --accent: #1f8f47;
  --accent-dark: #176737;
  --chip: #f3efe5;
  --shadow: 0 24px 60px rgba(35, 28, 17, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100vh;
  color: var(--text);
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.chatbot_shell {
  width: min(100%, 1000px);
  height: 100vh;
  margin: 0 auto;
  padding: 28px 20px 42px;
  display: flex;
  overflow: hidden;
}

.chatbot_frame {
  width: min(100%, 900px);
  margin: 0 auto;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.chatbot_hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex: 0 0 auto;
}

.chatbot_hero_copy {
  min-width: 0;
}

.chatbot_eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.chatbot_hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 36px);
  line-height: 1.02;
}

.chatbot_lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.chatbot_back {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(31, 143, 71, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(31, 143, 71, 0.08);
}

.chatbot_panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 18px;
}

.chatbot_messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 2px 16px;
}

.chatbot_message {
  max-width: 88%;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
  line-height: 1.58;
  font-size: 14px;
}

.chatbot_message p {
  margin: 0;
  white-space: pre-wrap;
}

.chatbot_message.bot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 92%;
  border: 0;
  border-radius: 0;
  padding: 0;
  align-self: flex-start;
  background: transparent;
}

.chatbot_bot_avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-top: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6b7cff 0%, #1f8f47 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(31, 143, 71, 0.18);
}

.chatbot_bot_content {
  position: relative;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px 18px 18px 18px;
  padding: 13px 15px 14px;
  background: var(--panel-strong);
  box-shadow: 0 10px 24px rgba(35, 28, 17, 0.08);
}

.chatbot_bot_content::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 15px;
  width: 12px;
  height: 12px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--panel-strong);
  transform: rotate(45deg);
}

.chatbot_bot_name {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.chatbot_answer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chatbot_answer_paragraph {
  margin: 0;
  white-space: pre-wrap;
}

.chatbot_answer_section {
  padding: 11px 12px;
  border: 1px solid rgba(31, 143, 71, 0.14);
  border-radius: 12px;
  background: rgba(31, 143, 71, 0.055);
}

.chatbot_answer_section_title {
  margin-bottom: 5px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.chatbot_answer_section_body {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.chatbot_answer_list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chatbot_answer_list li {
  position: relative;
  padding-left: 14px;
  line-height: 1.55;
}

.chatbot_answer_list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.chatbot_inline_link {
  color: var(--accent-dark);
  font-style: italic;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chatbot_inline_link:hover {
  color: var(--accent);
}

.chatbot_message.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.chatbot_message_meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chatbot_message_links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chatbot_message_link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(31, 143, 71, 0.12);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.chatbot_quick_actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chatbot_chip {
  border: 1px solid rgba(30, 25, 18, 0.08);
  background: var(--chip);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1;
}

.chatbot_chip:hover {
  background: rgba(31, 143, 71, 0.12);
}

.chatbot_composer {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
}

textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 14px 15px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
}

button,
textarea {
  outline: none;
}

button:focus,
textarea:focus,
.chatbot_back:focus {
  box-shadow: 0 0 0 3px rgba(31, 143, 71, 0.14);
}

#send-button {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #28a354 0%, #1f8f47 100%);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#send-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.chatbot_sr_only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 720px) {
  .chatbot_shell {
    padding: 18px 14px 28px;
  }

  .chatbot_frame {
    width: 100%;
  }

  .chatbot_hero {
    flex-direction: column;
    align-items: stretch;
  }

  .chatbot_back {
    align-self: flex-end;
  }

  .chatbot_panel {
    padding: 14px;
    border-radius: 24px;
  }

  .chatbot_messages {
    padding: 4px 2px 16px;
  }

  .chatbot_message {
    max-width: 100%;
  }

  .chatbot_message.bot {
    max-width: 100%;
    gap: 8px;
  }

  .chatbot_bot_avatar {
    width: 34px;
    height: 34px;
    font-size: 10px;
  }

  .chatbot_composer {
    grid-template-columns: 1fr;
  }

  #send-button {
    min-height: 50px;
  }
}
