:root {
  --bg: #f7f7f5; --panel: #ffffff; --text: #1d1d1b; --muted: #6b6b66; --line: #e3e2dd;
  --accent: #3a5bd9; --accent-text: #ffffff; --ok: #1f8a4c; --warn: #b26b00; --bad: #c0362c;
  --user: #3a5bd9; --bot: #1f8a4c; --radius: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151514; --panel: #1f1f1d; --text: #ecebe6; --muted: #9a9993; --line: #33332f;
          --accent: #7d95ff; --accent-text: #10131f; --ok: #4fc483; --warn: #e0a03a; --bad: #ff7a6e;
          --user: #7d95ff; --bot: #4fc483; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
header { display: flex; gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line);
         background: var(--panel); flex-wrap: wrap; }
header a { color: var(--text); text-decoration: none; font-weight: 600; }
header nav { display: flex; gap: 14px; }
header nav a { font-weight: 400; color: var(--muted); }
header .key { margin-left: auto; display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 0 0 16px; } h2 { font-size: 16px; margin: 0 0 10px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
table { width: 100%; border-collapse: collapse; } td, th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: 13px; }
button, .button { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--text);
                  padding: 7px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
                          border-radius: 8px; padding: 7px 9px; width: 100%; }
textarea { min-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > * { flex: 1 1 160px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.pill.ok { color: var(--ok); } .pill.bad { color: var(--bad); } .pill.warn { color: var(--warn); }
.stat { font-size: 28px; font-weight: 600; }
.lights { display: flex; gap: 20px; }
.light { display: flex; align-items: center; gap: 8px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); transition: background .08s, box-shadow .08s; }
.dot.user.on { background: var(--user); box-shadow: 0 0 0 5px color-mix(in srgb, var(--user) 25%, transparent); }
.dot.bot.on { background: var(--bot); box-shadow: 0 0 0 5px color-mix(in srgb, var(--bot) 25%, transparent); }
.transcript { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.turn { padding: 8px 10px; border-radius: 8px; background: var(--bg); border-left: 3px solid var(--line); }
.turn.user { border-left-color: var(--user); } .turn.assistant { border-left-color: var(--bot); }
.turn.tool { border-left-color: var(--warn); font-size: 13px; color: var(--muted); }
.turn .who { font-size: 12px; color: var(--muted); }
.turn.interim { opacity: .6; }
.lat { font-variant-numeric: tabular-nums; }
.error { color: var(--bad); white-space: pre-wrap; }
input[type=range] { padding: 0; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.check input { width: auto; }
