/* Internal staff tool: quiet, dense, readable. CivicServe navy (#003760, from the logo) as the accent. */
:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --ink: #15212b;
  --muted: #5a6772;
  --line: #dbe1e6;
  --accent: #003760;
  --accent-ink: #ffffff;
  --accent-soft: #e3ebf4;
  --warn: #9a3412;
  --warn-soft: #fdecdf;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, Consolas, "Cascadia Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1418; --surface: #151d23; --ink: #e4eaee; --muted: #98a5af; --line: #26313a;
    --accent: #7fb0e3; --accent-ink: #0e1418; --accent-soft: #13263b; --warn: #f0a37a; --warn-soft: #3a2116;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55;
  display: grid; grid-template-rows: auto 1fr auto auto auto;
}
button { font: inherit; cursor: pointer; }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px max(16px, calc((100vw - 900px) / 2)); background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 10px; align-items: center; }
.logo { height: 30px; width: auto; display: block; }
.brand-text { border-left: 1px solid var(--line); padding-left: 10px; }
.bar h1 { font-size: 1rem; margin: 0; }
.sub { margin: 0; font-size: 0.78rem; color: var(--muted); }
.bar-actions { display: flex; gap: 12px; align-items: center; }
.who { font-size: 0.8rem; color: var(--muted); }
.ghost { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: 6px 12px; }
.ghost:hover { border-color: var(--accent); }

.log { overflow-y: auto; padding: 24px max(16px, calc((100vw - 900px) / 2)); display: flex; flex-direction: column; gap: 18px; }
.intro h2 { font-size: 1.25rem; margin: 0 0 4px; }
.intro p { margin: 0 0 14px; color: var(--muted); }
.examples { display: flex; flex-direction: column; gap: 8px; }
.example {
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--ink);
}
.example:hover { border-color: var(--accent); }

.msg { max-width: 100%; }
.msg.user {
  align-self: flex-end; max-width: 80%; background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap;
}
.msg.assistant { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.msg.assistant .body > :first-child { margin-top: 0; }
.msg.assistant .body > :last-child { margin-bottom: 0; }
.msg.assistant table { border-collapse: collapse; width: 100%; font-size: 0.88rem; display: block; overflow-x: auto; }
.msg.assistant th, .msg.assistant td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.msg.assistant th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.msg.assistant td { font-variant-numeric: tabular-nums; }
.msg.assistant code { font-family: var(--mono); font-size: 0.85em; }

.tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tool { font-family: var(--mono); font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tool.running::after { content: " …"; }
.tool.failed { background: var(--warn-soft); color: var(--warn); }
.meta { margin-top: 8px; font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.error { color: var(--warn); }
.thinking { color: var(--muted); font-style: italic; }

.composer {
  display: flex; gap: 8px; padding: 12px max(16px, calc((100vw - 900px) / 2)) 6px; background: var(--bg); border-top: 1px solid var(--line);
}
.disclaimer {
  margin: 0; padding: 0 max(16px, calc((100vw - 900px) / 2)) 12px; background: var(--bg);
  color: var(--muted); font-size: 0.75rem; text-align: center;
}
.composer textarea {
  flex: 1; resize: none; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 0;
}
.composer button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 0 18px; font-weight: 600; }
.composer button:disabled { opacity: 0.5; cursor: default; }
.notice { margin: 0; padding: 8px max(16px, calc((100vw - 900px) / 2)); background: var(--warn-soft); color: var(--warn); font-size: 0.85rem; }

@media (max-width: 600px) {
  .who { display: none; }
  .msg.user { max-width: 92%; }
}
