:root {
  --bg: #ffffff;
  --panel: #f6f7f9;
  --line: #e3e6ea;
  --text: #1b1f24;
  --muted: #5c6773;
  --accent: #0b6bcb;
  --accent-soft: #eaf2fb;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}

body { display: flex; flex-direction: column; }

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

/* ---------- top bar ---------- */
/* ---------- hero banner ---------- */
.hero {
  flex: 0 0 auto;
  height: 92px;
  background-image:
    linear-gradient(90deg, rgba(12,18,32,.88) 0%, rgba(12,18,32,.55) 45%, rgba(12,18,32,.15) 100%),
    url("banner.jpg");
  background-size: cover;
  background-position: center 45%;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.hero-text { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }

.hero-text .mark {
  background: var(--accent); color: #fff;
  border-radius: 6px; padding: 3px 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
}

.hero-text .title {
  color: #fff; font-size: 21px; font-weight: 600; letter-spacing: .2px;
  text-shadow: 0 1px 6px rgba(0,0,0,.55);
}

.hero-text .tagline {
  color: rgba(255,255,255,.82); font-size: 12.5px;
  text-shadow: 0 1px 5px rgba(0,0,0,.6);
}

/* Give the chat more room on a short window. */
@media (max-height: 620px) {
  .hero { height: 62px; }
  .hero-text .title { font-size: 18px; }
  .hero-text .tagline { display: none; }
}

.topbar {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex: 0 0 auto;
}

.controls { display: flex; align-items: center; gap: 8px; }

select, button {
  font: inherit; color: var(--text);
  border: 1px solid var(--line); background: #fff;
  border-radius: 6px; padding: 5px 10px; cursor: pointer;
}

select:focus-visible, button:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

button:hover { background: var(--accent-soft); }

/* ---------- banner ---------- */
.banner {
  padding: 7px 14px; font-size: 12.5px;
  background: #fff4d6; border-bottom: 1px solid #f0e0b0; color: #6b5313;
  flex: 0 0 auto;
}

/* ---------- log ---------- */
.log { flex: 1 1 auto; overflow-y: auto; padding: 18px 16px 8px; }

.empty { max-width: 560px; margin: 8vh auto 0; text-align: center; color: var(--muted); }
.empty h1 { font-size: 20px; color: var(--text); margin: 0 0 6px; }
.empty p { margin: 0 0 18px; }

.samples { display: grid; gap: 8px; }
.samples .sample { text-align: left; padding: 9px 12px; color: var(--muted); }
.samples .sample:hover { color: var(--text); border-color: var(--accent); }

.msg { max-width: 720px; margin: 0 auto 16px; display: flex; gap: 10px; }
.msg .who {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
}
.msg.user .who { background: #e7e9ec; color: #43505e; }
.msg.bot .who { background: var(--accent); color: #fff; }

.bubble { flex: 1 1 auto; min-width: 0; }
.bubble p { margin: 0 0 9px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.bubble p:last-child { margin-bottom: 0; }

.cites { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); }
.cites .label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.cites ul { margin: 5px 0 0; padding-left: 17px; }
.cites li { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }

.thinking span {
  display: inline-block; width: 6px; height: 6px; margin-right: 3px;
  background: var(--muted); border-radius: 50%; opacity: .35;
  animation: pulse 1.2s infinite;
}
.thinking span:nth-child(2) { animation-delay: .18s; }
.thinking span:nth-child(3) { animation-delay: .36s; }

@keyframes pulse { 0%, 60%, 100% { opacity: .25; } 30% { opacity: .9; } }

/* ---------- composer ---------- */
.composer {
  flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 14px 14px; border-top: 1px solid var(--line); background: var(--panel);
}

.composer textarea {
  flex: 1 1 auto; resize: none; max-height: 160px;
  font: inherit; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}

.composer button {
  padding: 9px 16px; background: var(--accent); color: #fff; border-color: var(--accent);
}
.composer button:hover { background: #0a5cb0; }
.composer button:disabled { opacity: .5; cursor: default; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1d21; --panel: #23262b; --line: #34383e;
    --text: #e8eaed; --muted: #9aa4b0; --accent-soft: #23384f;
  }
  select, button, .composer textarea { background: #2a2d33; color: var(--text); }
  .banner { background: #3a3116; border-color: #51462a; color: #e8d9a8; }
}
