:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #16191d;
  --muted: #626b78;
  --line: #e2e5ea;
  --accent: #1a56db;
  --bot: #f1f3f6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --surface: #171b21;
    --ink: #e8eaed;
    --muted: #99a2b0;
    --line: #262c34;
    --accent: #6d9bff;
    --bot: #1e242c;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 18px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page-head h1 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.01em; }
.page-head p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

.chat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  overflow-y: auto;
  max-height: 62vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg { max-width: 86%; padding: 10px 13px; border-radius: 12px; }
.msg p { margin: 0 0 8px; }
.msg p:last-child { margin-bottom: 0; }
.msg ul { margin: 6px 0; padding-left: 20px; }
.msg.bot { background: var(--bot); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.error { background: transparent; border: 1px solid var(--line); color: var(--muted); align-self: flex-start; }
.msg a { color: inherit; }

.typing span {
  display: inline-block; width: 6px; height: 6px; margin-right: 3px;
  border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25 } 30% { opacity: 1 } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.chips button {
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.chips button:hover { color: var(--ink); border-color: var(--accent); }

.composer { display: flex; gap: 8px; }
.composer input {
  flex: 1; padding: 11px 14px; font-size: 15px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
}
.composer input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.composer button {
  padding: 11px 20px; font-size: 15px; font-weight: 500;
  background: var(--accent); color: #fff; border: 0; border-radius: 10px; cursor: pointer;
}
.composer button:disabled { opacity: .5; cursor: default; }

.page-foot { margin-top: 14px; font-size: 13px; color: var(--muted); }
.page-foot a { color: var(--accent); }

/* ---- citation cards -------------------------------------------------- */
/* Shown under a grounded answer: the case studies or job posts it used. */

.sources {
  max-width: 86%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: -2px;
}

.sources-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 2px;
}

.source-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px 10px;
  text-decoration: none;
  color: inherit;
}

a.source-card:hover,
a.source-card:focus-visible {
  border-color: var(--accent);
}

a.source-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.source-kind {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}

.source-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.source-desc {
  display: block;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 3px;
}

.source-more {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 6px;
}

/* ---- job cards: apply call to action --------------------------------- */

.source-card.is-job .source-kind { color: var(--accent); }

.source-apply {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

a.source-card.is-job:hover .source-apply,
a.source-card.is-job:focus-visible .source-apply {
  filter: brightness(1.08);
}

@media (prefers-reduced-motion: no-preference) {
  .source-apply { transition: filter 120ms ease; }
}

@media (prefers-color-scheme: dark) {
  /* The dark accent is a light blue; white on it is ~2.6:1. Dark ink on the
     same fill reaches ~8:1 and keeps the button reading as the accent. */
  .source-apply { color: #101317; }
}

/* ---- contact call to action ------------------------------------------ */
/* Shown when an answer routes the visitor to a human. */

.contact-action { max-width: 86%; margin-top: -2px; }

.contact-btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.contact-btn:hover { filter: brightness(1.08); }

.contact-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .contact-btn { transition: filter 120ms ease; }
}

@media (prefers-color-scheme: dark) {
  /* Same contrast reason as .source-apply: dark ink on the light-blue accent. */
  .contact-btn { color: #101317; }
}
