*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; color: #22262a; background: #f4f5f7;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.topbar { background: #1f2937; }
.topbar-inner { display: flex; align-items: center; gap: 20px; padding: 10px 16px; }
.brand { color: #fff; font-weight: 600; }
.topbar nav { display: flex; gap: 14px; flex: 1; }
.topbar nav a { color: #cbd5e1; text-decoration: none; }
.topbar nav a:hover { color: #fff; }
main { padding: 24px 16px 48px; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 20px 0 8px; }
.muted { color: #6b7280; font-size: 14px; }
.card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 20px; margin-bottom: 16px;
}
.card.narrow { max-width: 460px; margin: 48px auto; }
.card.empty { text-align: center; color: #374151; }
label { display: block; margin: 12px 0 4px; font-size: 14px; color: #374151; }
input[type=text], input[type=password] {
  width: 100%; padding: 8px 10px; margin-top: 4px;
  border: 1px solid #d1d5db; border-radius: 8px; font-size: 15px;
}
input:focus { outline: 2px solid #6366f1; border-color: transparent; }
.btn {
  display: inline-block; border: 0; border-radius: 8px; cursor: pointer;
  padding: 9px 16px; font-size: 15px;
}
.btn-primary { background: #4f46e5; color: #fff; margin-top: 16px; }
.btn-primary:hover { background: #4338ca; }
.btn-ghost { background: transparent; color: #cbd5e1; }
.btn-ghost:hover { color: #fff; }
.inline { display: inline; }
.alert { border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: 14px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.table { width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 9px 12px; font-size: 14px;
  border-bottom: 1px solid #f0f1f3; }
.table th { background: #f9fafb; color: #6b7280; font-weight: 500; }
.nowrap { white-space: nowrap; }
code { background: #f3f4f6; border-radius: 5px; padding: 1px 6px; font-size: 13px; }
.page-head { display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; }
.chips { display: flex; gap: 8px; }
.chip { border-radius: 999px; padding: 3px 12px; font-size: 13px; }
.chip-ok { background: #dcfce7; color: #166534; }
.chip-warn { background: #fef9c3; color: #854d0e; }
hr { border: 0; border-top: 1px solid #e5e7eb; margin: 18px 0; }
textarea { width: 100%; margin-top: 4px; padding: 8px 10px; font: 13px/1.5 ui-monospace,
  "Cascadia Code", Consolas, monospace; border: 1px solid #d1d5db; border-radius: 8px; }
select { width: 100%; margin-top: 4px; padding: 8px 10px; font-size: 15px;
  border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
label.checkbox { display: flex; align-items: center; gap: 8px; }
label.checkbox input { width: auto; margin: 0; }
details { margin: 14px 0; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 12px; }
summary { cursor: pointer; font-size: 14px; color: #374151; }
.light { display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 8px; vertical-align: middle; }
.light-green { background: #22c55e; } .light-yellow { background: #eab308; }
.light-red { background: #ef4444; }  .light-grey { background: #9ca3af; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-sm { padding: 6px 12px; font-size: 14px; margin: 0; }
.btn-ghost-dark { background: #eef2f7; color: #374151; text-decoration: none; }
.btn-ghost-dark:hover { background: #e2e8f0; }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-danger:hover { background: #fecaca; }
.btn-link { background: none; color: #4f46e5; text-decoration: none; }
.note { background: #fffbeb; border-color: #fde68a; }
.msg, .logs { white-space: pre-wrap; font: 12.5px/1.5 ui-monospace, Consolas, monospace;
  margin: 0; }
.logs { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px;
  overflow-x: auto; max-height: 70vh; }
.table a { color: #4f46e5; text-decoration: none; }
.msg-row { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px; }
.msg-row.msg-assistant { background: #f8fafc; }
.msg-meta { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.msg-text { white-space: pre-wrap; font-size: 14.5px; }
.pager { display: flex; gap: 8px; margin-top: 14px; }
