/* HeyLagos: Lagos blue, yellow and green from the proposal. Mobile first. */
:root {
  --blue: #0b3ea8;
  --blue-dark: #082f80;
  --yellow: #ffc61a;
  --green: #0a7a3b;
  --ink: #14213d;
  --muted: #5b6478;
  --line: #d9dee8;
  --bg: #ffffff;
  --panel: #f2f4f8;
  --user: #0b3ea8;
  --user-ink: #ffffff;
  --link: #0b3ea8;
  --urgent-bg: #fde8e8;
  --urgent-ink: #9b1c1c;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ecf4;
    --muted: #a3acc0;
    --line: #2c3650;
    --bg: #0e1424;
    --panel: #18223a;
    --user: #2f5fd0;
    --link: #8fb0ff;
    --urgent-bg: #4a1c1c;
    --urgent-ink: #ffd5d5;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
/* Flex items default to min-width:auto (never narrower than their content),
   so the one-line language row made the whole page wider than a phone.
   min-width:0 lets each section shrink to the screen; the row scrolls instead. */
body > * { min-width: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; cursor: pointer; }
a { color: var(--link); }

/* Header: blue bar, crest on a white badge, yellow + green stripe below. */
.top { background: var(--blue); color: #fff; position: sticky; top: 0; z-index: 5; }
.top-inner { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.crest { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.crest img { width: 40px; height: 40px; object-fit: contain; }
.wordmark { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: 6px 14px; font-size: .9rem; }
.ghost:hover { background: rgba(255,255,255,.12); }
.stripe { display: flex; height: 6px; }
.stripe span:first-child { flex: 3; background: var(--yellow); }
.stripe span:last-child { flex: 2; background: var(--green); }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 20px 16px 8px; }
.intro h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); line-height: 1.15; margin: 8px 0 6px; letter-spacing: -0.02em; }
.intro .sub { color: var(--muted); margin: 0 0 18px; }

/* Language switch: a segmented control that scrolls sideways on narrow phones. */
.langs { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 999px; padding: 3px; overflow-x: auto; scrollbar-width: none; width: max-content; max-width: 100%; }
.langs::-webkit-scrollbar { display: none; }
.langs button { border: 0; background: transparent; color: var(--ink); padding: 8px 11px; border-radius: 999px; white-space: nowrap; font-weight: 600; font-size: .92rem; }
@media (min-width: 480px) { .langs button { padding: 8px 15px; font-size: .95rem; } }
.langs button[aria-pressed="true"] { background: var(--blue); color: #fff; }

.examples { display: flex; flex-direction: column; gap: 8px; margin: 20px 0 0; }
.example { text-align: left; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.example:hover { border-color: var(--blue); }

.thread { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: 85%; padding: 10px 14px; border-radius: var(--radius); overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--user); color: var(--user-ink); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.msg.assistant .bubble { background: var(--panel); border-bottom-left-radius: 6px; }
.bubble p { margin: 0 0 .5em; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ol, .bubble ul { margin: .2em 0 .6em; padding-left: 1.3em; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 2px solid var(--green); display: grid; place-items: center; flex: none; }
.avatar img { width: 26px; height: 26px; }
.thinking { color: var(--muted); font-style: italic; }
.thinking::after { content: ""; display: inline-block; width: 1em; animation: dots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.cite { display: inline-grid; place-items: center; min-width: 1.35em; height: 1.35em; padding: 0 .25em; margin: 0 1px; font-size: .72em; font-weight: 700; border-radius: 6px; background: var(--blue); color: #fff; text-decoration: none; vertical-align: super; line-height: 1; }
.sources { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; }
.sources-title { width: 100%; margin: 0 0 2px; font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.source { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
a.source:hover { border-color: var(--green); }
.tag { background: var(--green); color: #fff; font-weight: 700; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.directory { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.directory a { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; color: var(--ink); }
.notice { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.notice.urgent { background: var(--urgent-bg); color: var(--urgent-ink); border-color: transparent; font-weight: 700; margin-bottom: 8px; }

/* Composer pinned to the bottom, clear of the phone's home indicator. */
.composer { position: sticky; bottom: 0; width: 100%; max-width: 760px; margin: 0 auto; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 22px; padding: 11px 16px; min-height: 46px; max-height: 160px; }
.composer textarea:focus { outline: none; border-color: var(--blue); }
.composer button { width: 46px; height: 46px; border-radius: 14px; border: 0; background: var(--yellow); color: #111; display: grid; place-items: center; flex: none; }
.composer button:disabled { opacity: .5; cursor: wait; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.foot { max-width: 760px; margin: 0 auto; padding: 0 16px 14px; color: var(--muted); font-size: .78rem; text-align: center; }
.foot p { margin: 0; }
