:root {
  color-scheme: light;
  --background: #f4f7f5;
  --surface: #ffffff;
  --ink: #17211b;
  --muted: #627068;
  --line: #d9e2dc;
  --accent: #0f8b6f;
  --accent-strong: #0b6f5a;
  --soft: #e8f4ef;
  --danger: #a83c32;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 139, 111, 0.12), transparent 34rem),
    var(--background);
}

button,
textarea {
  font: inherit;
}

.shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 33, 27, 0.12);
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.logo-mark {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #284f9e);
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0;
}

.ask-form {
  display: grid;
  gap: 14px;
  padding: 28px;
}

label {
  color: var(--muted);
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background: #fbfdfc;
  line-height: 1.5;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 139, 111, 0.14);
}

button {
  justify-self: start;
  min-width: 120px;
  border: 0;
  border-radius: 8px;
  padding: 12px 20px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.answer {
  border-top: 1px solid var(--line);
  background: var(--soft);
  padding: 28px;
}

.answer-content {
  display: grid;
  gap: 16px;
  white-space: normal;
  border: 1px solid rgba(15, 139, 111, 0.18);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  line-height: 1.55;
}

.answer-content section + section {
  margin-top: 24px;
}

.answer-content h2,
.answer-content h3,
.answer-content p {
  margin: 0;
}

.answer-content h2,
.answer-content h3 {
  margin-bottom: 12px;
}

.answer-content.empty {
  color: var(--muted);
}

.answer-content.error {
  color: var(--danger);
  border-color: rgba(168, 60, 50, 0.25);
  background: #fff8f7;
}

.sb-message {
  display: grid;
  gap: 16px;
  max-width: 100%;
}

.sb-message > p {
  margin: 0;
}

.sb-message-user {
  justify-self: end;
  max-width: min(78%, 620px);
  border: 1px solid rgba(15, 139, 111, 0.24);
  border-radius: 8px;
  padding: 12px 14px;
  color: #ffffff;
  background: var(--accent);
}

.sb-message-assistant {
  justify-self: start;
  width: 100%;
}

.sb-message.pending {
  color: var(--muted);
}

.sb-message.error {
  color: var(--danger);
}

.sb-product-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdfc;
}

.sb-follow-up {
  border: 1px solid rgba(15, 139, 111, 0.28);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
  background: #f4fbf8;
}

.sb-follow-up h3 {
  color: var(--accent-strong);
}

.sb-product-title {
  font-size: 1.05rem;
  line-height: 1.3;
}

.sb-product-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.sb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 700;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.sb-button:hover {
  border-color: var(--accent);
  background: var(--soft);
  transform: translateY(-1px);
}

.sb-button-primary {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.sb-button-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.sb-related-articles ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sb-disclaimer {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.94rem;
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 920px);
    padding: 20px 0;
  }

  .brand,
  .ask-form,
  .answer {
    padding: 20px;
  }

  .brand {
    align-items: flex-start;
  }

  .sb-actions {
    flex-direction: column;
  }

  .sb-button {
    width: 100%;
  }
}
