:root {
  --bg: #f6f8f9; --surface: #ffffff; --ink: #14212b; --muted: #546573; --line: #d8e0e5;
  --accent: #0b5f73; --accent-ink: #ffffff; --accent-soft: #e3f0f3; --error: #a12a2a;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f171c; --surface: #16222a; --ink: #e6edf1; --muted: #9db0bc; --line: #2a3a44;
    --accent: #5fb4c7; --accent-ink: #0f171c; --accent-soft: #1b3440; --error: #ff8a80;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--accent); color: var(--accent-ink); padding: 20px 0 16px; margin-bottom: 20px; }
.top h1 { margin: 0; font-size: 1.4rem; }
.top .tag { margin: 4px 0 0; opacity: .9; font-size: .95rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2 { margin-top: 0; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, textarea { width: 100%; font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
input:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
button { font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); padding: 10px 18px; }
button:disabled { opacity: .55; cursor: wait; }
#login-form button { margin-top: 14px; }
#turnstile { margin-top: 12px; }
.error { color: var(--error); min-height: 1.4em; margin: 10px 0 0; }
.turn { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 14px; }
.turn .q { font-weight: 700; margin: 0 0 8px; }
.turn .a p { margin: 0 0 10px; }
.turn .a ul { margin: 0 0 10px; padding-left: 22px; }
.turn .a.err { color: var(--error); }
.thinking { color: var(--muted); font-style: italic; }
.cite { display: inline-block; min-width: 1.4em; padding: 0 4px; margin: 0 1px; font-size: .75em;
  line-height: 1.5; text-align: center; vertical-align: super; border-radius: 4px; text-decoration: none;
  background: var(--accent-soft); color: var(--ink); }
.sources { margin: 10px 0 0; padding: 10px 0 0 22px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.sources li { margin-bottom: 4px; }
.sources li.used a { font-weight: 600; }
.sources a { color: var(--accent); word-break: break-word; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.examples button { background: var(--accent-soft); color: var(--ink); font-weight: 500; font-size: .9rem;
  padding: 8px 12px; text-align: left; }
.ask { display: flex; gap: 10px; align-items: flex-end; }
.ask textarea { resize: vertical; min-height: 52px; }
.fine { color: var(--muted); font-size: .85rem; margin: 10px 0 40px; }
.linklike { background: none; color: var(--accent); padding: 0; font-weight: 500; text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 520px) { .ask { flex-direction: column; align-items: stretch; } }
