:root {
  --bg: #eef7f7;
  --bg-strong: #d9eeef;
  --panel: rgba(248, 253, 252, 0.92);
  --panel-solid: #fdfcf8;
  --border: #b7d9d8;
  --text: #12333d;
  --muted: #4b6a72;
  --accent: #15a7ad;
  --accent-dark: #0d6f78;
  --accent-soft: #d7f4f3;
  --gold: #d9b46b;
  --gold-soft: #f7ebcb;
  --danger: #b14a3d;
  --shadow: 0 24px 70px rgba(18, 51, 61, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(21, 167, 173, 0.2), transparent 26%),
    radial-gradient(circle at 80% 18%, rgba(217, 180, 107, 0.26), transparent 18%),
    radial-gradient(circle at bottom right, rgba(13, 111, 120, 0.18), transparent 24%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-strong) 100%);
  overflow-y: auto;
}

html {
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

body::-webkit-scrollbar,
.chat-log::-webkit-scrollbar {
  width: 12px;
}

body::-webkit-scrollbar-track,
.chat-log::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.4);
}

body::-webkit-scrollbar-thumb,
.chat-log::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

body::-webkit-scrollbar-thumb:hover,
.chat-log::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #11b9c0 0%, var(--accent-dark) 100%);
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.ghost-link {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.24);
}

button.secondary-button {
  background: linear-gradient(180deg, var(--gold-soft) 0%, #fff8e8 100%);
  color: var(--text);
  box-shadow: 0 14px 30px rgba(217, 180, 107, 0.2);
}

button:hover,
.ghost-link:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  padding: 14px 16px;
}

textarea {
  resize: none;
  min-height: 54px;
  max-height: 140px;
}

.launcher-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.site-body {
  min-height: 100vh;
  padding: 24px;
}

.site-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.site-header h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  margin-top: 6px;
}

.site-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 360px;
  gap: 22px;
  align-items: start;
}

.site-content {
  display: grid;
  gap: 22px;
}

.site-hero {
  min-height: 320px;
}

.site-hero h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  margin-bottom: 16px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  min-height: 180px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(237, 248, 248, 0.88) 100%);
}

.feature-card h3 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
}

.feature-card p {
  line-height: 1.7;
  color: var(--muted);
}

.site-sidebar {
  position: sticky;
  top: 24px;
}

.launcher-shell {
  width: min(1120px, 100%);
  display: grid;
  gap: 22px;
}

.hero-card,
.panel {
  border: 1px solid rgba(183, 217, 216, 0.88);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 32px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--gold);
  margin-bottom: 12px;
  font-weight: 700;
}

.hero-card h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.98;
  margin-bottom: 14px;
}

.hero-copy {
  max-width: 760px;
  font-size: 1.04rem;
  line-height: 1.6;
  color: var(--muted);
}

.launcher-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
}

.panel {
  padding: 24px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.section-heading h2,
.bot-detail-card h3,
.chat-header h1 {
  font-family: Georgia, "Times New Roman", serif;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.86rem;
  background: linear-gradient(135deg, var(--accent-soft) 0%, #eefcf9 100%);
  color: var(--accent-dark);
  border: 1px solid rgba(21, 167, 173, 0.2);
}

.status-pill.error {
  background: #f9ddda;
  color: var(--danger);
  border-color: rgba(177, 74, 61, 0.2);
}

.instruction-copy {
  display: grid;
  gap: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 24px;
}

.instruction-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.field span {
  font-size: 0.92rem;
  color: var(--muted);
}

.bot-detail-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(242, 251, 250, 0.92) 100%);
  min-height: 170px;
}

.bot-detail-card p {
  color: var(--muted);
  line-height: 1.65;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}

.meta-grid dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.meta-grid dd {
  margin: 0;
}

.action-stack {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.ghost-link {
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg, var(--panel-solid) 0%, #f2fbfb 100%);
  color: var(--text);
  border: 1px solid var(--border);
}

.chat-body {
  min-height: 100vh;
  padding: 16px;
}

.floating-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 14px 18px;
  z-index: 20;
}

.floating-launcher.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.launcher-label {
  font-weight: 700;
}

.launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.support-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 48px));
  border-radius: 28px;
  border: 1px solid rgba(183, 217, 216, 0.88);
  background: var(--panel-solid);
  box-shadow: 0 30px 90px rgba(18, 51, 61, 0.22);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  will-change: transform, opacity;
}

.support-widget.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, rgba(236, 250, 249, 0.96) 0%, rgba(250, 247, 238, 0.96) 100%);
  border-bottom: 1px solid rgba(183, 217, 216, 0.88);
}

.widget-header h3 {
  font-family: Georgia, "Times New Roman", serif;
  margin-top: 2px;
}

.widget-subtitle {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.icon-button {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(183, 217, 216, 0.88);
  box-shadow: none;
  padding: 10px 12px;
}

.widget-messages {
  min-height: 340px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 18px;
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, rgba(250, 253, 251, 0.92) 0%, rgba(245, 250, 250, 0.92) 100%);
  overscroll-behavior: contain;
}

.message {
  max-width: 88%;
  padding: 14px 16px;
  border-radius: 20px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.message-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.message-meta {
  margin-top: 8px;
  font-size: 0.76rem;
  opacity: 0.72;
}

.message.pending {
  opacity: 0.96;
  min-width: 74px;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.45;
  animation: typingPulse 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}

.widget-composer {
  padding: 14px;
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(183, 217, 216, 0.88);
  background: #fcfbf6;
}

#messageInput {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, height 0.08s ease;
}

#messageInput:focus {
  outline: none;
  border-color: rgba(21, 167, 173, 0.65);
  box-shadow: 0 0 0 4px rgba(21, 167, 173, 0.12);
}

.widget-actions {
  display: flex;
  justify-content: flex-end;
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.chat-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.chat-header,
.chat-log,
.chat-composer {
  border: 1px solid rgba(183, 217, 216, 0.88);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.chat-header {
  border-radius: 24px;
  padding: 18px 18px 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.chat-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.chat-tools {
  display: grid;
  gap: 10px;
}

.mini-button {
  background: linear-gradient(180deg, var(--gold-soft) 0%, #fff7e5 100%);
  color: var(--text);
  border: 1px solid rgba(217, 180, 107, 0.45);
  box-shadow: none;
  padding: 10px 12px;
}

.chat-log {
  border-radius: 28px;
  padding: 18px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  min-height: 340px;
}

.message {
  max-width: 88%;
  padding: 14px 16px;
  border-radius: 20px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.message.user {
  justify-self: end;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
}

.message.assistant {
  background: linear-gradient(180deg, #f9f4e6 0%, #f5ecd9 100%);
  border: 1px solid rgba(217, 180, 107, 0.18);
}

.message.system {
  justify-self: center;
  max-width: 100%;
  background: linear-gradient(180deg, #eefcfb 0%, #e4f5f6 100%);
  color: var(--muted);
  border: 1px dashed rgba(21, 167, 173, 0.4);
}

.chat-composer {
  border-radius: 24px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.composer-row {
  display: flex;
  gap: 10px;
}

.composer-row button {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .launcher-grid {
    grid-template-columns: 1fr;
  }

  .site-grid,
  .experience-grid {
    grid-template-columns: 1fr;
  }

  .site-sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .launcher-body,
  .site-body,
  .chat-body {
    padding: 12px;
  }

  .hero-card,
  .panel,
  .chat-header,
  .chat-log,
  .chat-composer {
    border-radius: 22px;
  }

  .chat-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .composer-row {
    flex-direction: column;
  }

  .site-header {
    flex-direction: column;
  }

  .floating-launcher,
  .support-widget {
    right: 12px;
    bottom: 12px;
  }

  .support-widget {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}
