:root {
  --bg: #ffffff;
  --panel: #f6f8fa;
  --border: #d0d7de;
  --text: #1f2328;
  --text-dim: #656d76;
  --accent: #0969da;
  --danger: #cf222e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
nav .brand { font-weight: 600; color: var(--text); text-decoration: none; }
nav ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 1rem; }
nav a { color: var(--text-dim); text-decoration: none; }
nav a:hover { color: var(--accent); }
nav .logout { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: 4px;
}
button:hover { border-color: var(--accent); }
main { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 500; }
input[type="text"], input[type="password"], input[type="number"], textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem;
  width: 100%;
  font: inherit;
  border-radius: 4px;
}
textarea { font-family: ui-monospace, monospace; min-height: 200px; }
.alert-error { background: #ffebe9; border-left: 3px solid var(--danger); padding: 0.75rem; margin-bottom: 1rem; }
.transcript { background: var(--panel); padding: 1rem; border-radius: 6px; }
.turn { padding: 0.75rem; margin-bottom: 0.5rem; border-radius: 4px; border: 1px solid var(--border); }
.turn.user { background: #ddf4ff; }
.turn.assistant { background: #dafbe1; }
.turn.tool_use { background: #fff8c5; font-family: ui-monospace, monospace; font-size: 12px; }
.turn.tool_result { background: #fbefff; font-family: ui-monospace, monospace; font-size: 12px; }
.actions { margin: 1rem 0; display: flex; gap: 0.5rem; align-items: center; }
.badge-paused { background: var(--danger); color: white; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 12px; }
.turn .ts { color: var(--text-dim); font-family: ui-monospace, monospace; font-size: 12px; }
.search { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.pagination { display: flex; gap: 1rem; margin-top: 1rem; }
.pagination a { color: var(--accent); text-decoration: none; }
.summary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.card { background: var(--panel); padding: 1rem; border-radius: 6px; border: 1px solid var(--border); }
.card-label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.card-msgs { font-size: 24px; font-weight: 600; margin-top: 0.25rem; }
.card-tokens { color: var(--text-dim); font-size: 13px; }
.card-usd { color: var(--accent); font-weight: 600; margin-top: 0.5rem; }
dl.health dt { color: var(--text-dim); margin-top: 0.75rem; }
dl.health dd { margin: 0; font-size: 16px; }
.tuning-form fieldset { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 1rem; margin-bottom: 1rem; }
.tuning-form legend { padding: 0 0.5rem; font-weight: 600; }
.tuning-form .help { color: var(--text-dim); font-size: 13px; margin: 0 0 0.5rem; }
.tuning-form .default { color: var(--text-dim); font-size: 12px; margin: 0.25rem 0 0; }
.alert-saved { background: #dafbe1; border-left: 3px solid #1a7f37; padding: 0.75rem; margin-bottom: 1rem; }
