:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #111827;
  --panel-2: #172033;
  --panel-3: #202b42;
  --line: #2b3854;
  --text: #edf3ff;
  --muted: #a8b6cc;
  --soft: #d1dcf0;
  --accent: #80b7ff;
  --accent-2: #8df2c8;
  --warn: #ffd47a;
  --bad: #ff908d;
  --shadow: 0 24px 80px rgb(0 0 0 / 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgb(64 111 176 / 0.3), transparent 30rem),
    radial-gradient(circle at 90% 10%, rgb(53 214 166 / 0.16), transparent 28rem),
    linear-gradient(135deg, #070a11, var(--bg) 55%, #0d1320);
  color: var(--text);
}

button,
input {
  font: inherit;
}

code {
  color: var(--accent-2);
}

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

.hero {
  max-width: 780px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--soft);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
}

.status-panel {
  display: grid;
  grid-template-columns: 1.45fr repeat(3, minmax(150px, 0.7fr));
  gap: 12px;
  margin: 24px 0;
}

.status-card,
.trust,
.chat-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.065), rgb(255 255 255 / 0.025));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.status-card {
  min-height: 116px;
  padding: 16px;
  border-radius: 20px;
}

.status-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: clamp(1.2rem, 2.3vw, 1.8rem);
  line-height: 1.1;
}

.label,
.detail {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.detail {
  margin-top: 8px;
}

.trust {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  background-color: rgb(17 24 39 / 0.75);
}

.trust h2 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.trust p {
  margin: 0;
  color: var(--soft);
}

.chat-card {
  overflow: hidden;
  border-radius: 28px;
  background-color: rgb(12 18 29 / 0.88);
}

.log {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 300px;
  max-height: min(58vh, 620px);
  overflow: auto;
  padding: 22px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  max-width: min(760px, 92%);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-2);
}

.message.user .bubble {
  border-color: rgb(128 183 255 / 0.55);
  background: linear-gradient(135deg, #24436d, #1b3153);
}

.message.assistant .bubble {
  background: linear-gradient(180deg, var(--panel), #101725);
}

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

.citation {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--accent);
  font-size: 0.86rem;
}

.citation b {
  color: var(--muted);
}

.message-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.ask-form {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: rgb(10 15 24 / 0.9);
}

#questionInput {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-2);
  color: var(--text);
}

#questionInput::placeholder {
  color: #8494ad;
}

#questionInput:focus-visible,
button:focus-visible {
  outline: 3px solid rgb(128 183 255 / 0.75);
  outline-offset: 2px;
}

button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #5f8dff);
  color: #061121;
  font-weight: 800;
  cursor: pointer;
}

.ask-form button {
  flex: 0 0 auto;
  padding: 0 22px;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 18px;
}

.examples button {
  min-height: 36px;
  padding: 7px 11px;
  border-color: var(--line);
  background: transparent;
  color: var(--soft);
  font-size: 0.84rem;
  font-weight: 650;
}

.examples button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .status-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 22px;
  }

  .status-panel {
    grid-template-columns: 1fr;
  }

  .log {
    padding: 14px;
  }

  .bubble {
    max-width: 100%;
  }

  .ask-form {
    flex-direction: column;
  }
}
