:root {
  color-scheme: light;
  --bg: #f7f8fd;
  --surface: #ffffff;
  --surface-soft: #f7f8ff;
  --line: #e2e6f2;
  --text: #1f2740;
  --muted: #7d839d;
  --purple: #5f46c1;
  --purple-deep: #493694;
  --blue: #46a0e8;
  --gold: #f5c64d;
  --shadow: 0 24px 60px rgba(36, 43, 86, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top, rgba(95, 70, 193, 0.08), transparent 28%),
    linear-gradient(180deg, #fbfbfe 0%, #f4f6fb 100%);
  color: var(--text);
}

body.is-embed {
  background: #ffffff;
}

button,
textarea,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
}

body.is-embed .page-shell {
  min-height: 100dvh;
  gap: 0;
  padding: 0;
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 4px;
}

body.is-embed .page-header {
  display: none;
}

.assistant-logo {
  width: min(220px, 42vw);
  height: auto;
  display: block;
  object-fit: contain;
}

.assistant-lockup {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.assistant-title {
  margin: 0;
  color: #111421;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.05;
}

.assistant-subtitle {
  margin: 0;
  color: var(--purple-deep);
  font-size: 16px;
  font-weight: 700;
}

.chat-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 14px;
}

.overview-panel {
  display: grid;
  gap: 14px;
}

body.is-embed .overview-panel {
  gap: 0;
}

.pricing-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.is-embed .pricing-band {
  display: none;
}

.price-card {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid rgba(92, 102, 150, 0.12);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f9faff 100%);
  box-shadow: 0 14px 32px rgba(57, 64, 109, 0.08);
}

.price-role {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.price-value {
  color: var(--purple-deep);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.price-note {
  color: #3f4566;
  font-size: 14px;
  line-height: 1.7;
}

.role-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid rgba(92, 102, 150, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(57, 64, 109, 0.07);
}

body.is-embed .role-panel {
  margin: 12px 12px 0;
  padding: 10px 12px;
  border-radius: 18px;
  box-shadow: none;
}

.role-caption {
  margin: 0;
  color: #3c4466;
  font-size: 14px;
  font-weight: 700;
}

.role-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  padding: 4px;
  border-radius: 18px;
  background: #eef1fb;
}

.role-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  background: transparent;
  color: #56607f;
  font-weight: 700;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.role-button:hover,
.role-button:focus-visible {
  transform: translateY(-1px);
}

.role-button.is-active {
  background: linear-gradient(135deg, rgba(95, 70, 193, 0.18), rgba(70, 160, 232, 0.18));
  color: var(--purple-deep);
}

.chat-shell {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfcff 100%);
  box-shadow: var(--shadow);
}

body.is-embed .chat-shell {
  min-height: calc(100dvh - 84px);
  padding: 12px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  margin-bottom: 12px;
}

body.is-embed .suggestions {
  margin-top: 0;
}

.suggestion {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #ececf5;
  border-radius: 18px;
  background: #fbfbfd;
  color: #3b4261;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.suggestion:hover,
.suggestion:focus-visible {
  transform: translateY(-1px);
  border-color: #d7d9e7;
  background: #ffffff;
}

.thinking-strip {
  position: relative;
  height: 8px;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f8;
}

.thinking-fill {
  position: absolute;
  inset: 0 auto 0 -35%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple) 0%, var(--blue) 65%, var(--gold) 100%);
  animation: thinking-slide 1.1s linear infinite;
}

@keyframes thinking-slide {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(390%);
  }
}

.messages {
  flex: 1 1 auto;
  min-height: 48vh;
  display: grid;
  gap: 18px;
  overflow: auto;
  padding: 8px 4px 0;
}

body.is-embed .messages {
  min-height: 30vh;
}

.message {
  max-width: min(86%, 780px);
}

.message.user {
  justify-self: end;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 24px 24px 10px 24px;
  background: #ffffff;
}

.message.assistant {
  max-width: 100%;
}

.message.assistant .message-body {
  padding: 18px 22px;
  border: 1px solid #eceef7;
  border-radius: 24px;
  background: linear-gradient(180deg, #faf9fe 0%, #ffffff 100%);
}

.message-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.message-body {
  color: var(--text);
  font-size: 16px;
  line-height: 2;
  white-space: pre-wrap;
}

.composer {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding-top: 10px;
}

body.is-embed .composer {
  padding-top: 8px;
}

.composer-shell {
  position: relative;
  padding: 14px 16px 18px;
  border: 1px solid #dde1ee;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(39, 46, 88, 0.08);
}

textarea {
  width: 100%;
  min-height: 88px;
  max-height: 220px;
  padding: 10px 8px 18px;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font-size: 19px;
  line-height: 1.9;
  position: relative;
  z-index: 1;
}

textarea::placeholder {
  color: transparent;
  opacity: 1;
}

.composer-empty-copy {
  position: absolute;
  inset: 26px 22px 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 34px;
  color: #3b4371;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.8;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.composer-shell.is-empty .composer-empty-copy {
  opacity: 1;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.chat-status {
  color: var(--muted);
  font-size: 13px;
  min-height: 22px;
  min-width: 0;
}

.send-button {
  width: 56px;
  height: 56px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #e9eaf2;
  color: #5b617b;
  box-shadow: inset 0 0 0 1px rgba(223, 225, 235, 0.95);
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.send-button svg {
  width: 22px;
  height: 22px;
}

.send-button:hover,
.send-button:focus-visible {
  transform: translateY(-1px);
}

.send-button.is-busy {
  background: linear-gradient(135deg, rgba(95, 70, 193, 0.18), rgba(73, 160, 227, 0.18));
  color: var(--purple-deep);
}

.send-button:disabled {
  cursor: wait;
}

@media (max-width: 860px) {
  .page-shell {
    padding: 12px;
  }

  .assistant-logo {
    width: min(190px, 60vw);
  }

  .assistant-title {
    font-size: 30px;
  }

  .pricing-band {
    grid-template-columns: 1fr;
  }

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

  .role-switch {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-layout,
  .chat-shell {
    min-height: calc(100vh - 24px);
  }

  body.is-embed .chat-layout,
  body.is-embed .chat-shell {
    min-height: auto;
  }

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

  .messages {
    min-height: 45vh;
  }

  .message,
  .message.user {
    max-width: 100%;
  }

  .suggestions {
    flex-direction: column;
    justify-content: stretch;
  }

  .suggestion {
    width: 100%;
    text-align: right;
  }

  .composer-empty-copy {
    inset: 18px 14px 78px;
    padding: 0 18px;
    font-size: 18px;
  }
}
