:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  font-weight: 400;
  background: #edf2f7;
  color: #14213d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.12), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
}

code {
  font-family: "SFMono-Regular", SFMono-Regular, ui-monospace, Menlo, monospace;
}

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

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.hero-copy {
  max-width: 720px;
  margin: 12px 0 0;
  color: #475569;
}

.chat-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.api-url {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.92rem;
  word-break: break-word;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 360px;
  max-height: 56vh;
  overflow-y: auto;
  padding: 20px;
}

.message {
  max-width: min(720px, 88%);
  border-radius: 8px;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-user {
  align-self: flex-end;
  background: #2563eb;
  color: #ffffff;
}

.message-assistant {
  align-self: flex-start;
  background: #e2e8f0;
  color: #0f172a;
}

.message-system {
  align-self: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px 20px;
}

.composer textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px;
  font: inherit;
  color: #0f172a;
  background: #ffffff;
  outline: none;
}

.composer textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

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

.hint {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.primary-button,
.ghost-button {
  appearance: none;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.primary-button {
  background: #2563eb;
  color: #ffffff;
}

.primary-button:hover:enabled {
  background: #1d4ed8;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.ghost-button {
  background: transparent;
  border-color: #cbd5e1;
  color: #0f172a;
}

.ghost-button:hover {
  background: #f8fafc;
}

.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) {
  .app-shell {
    width: min(100% - 24px, 960px);
    padding: 24px 0 40px;
  }

  .panel-head,
  .composer,
  .message-list {
    padding-left: 16px;
    padding-right: 16px;
  }

  .panel-head {
    flex-direction: column;
  }

  .message {
    max-width: 100%;
  }

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