:root {
  --bg: #f6f7f9; --card: #fff; --text: #1b1f24; --muted: #6b7280; --line: #e5e7eb;
  --primary: #2563eb; --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --user: #e0f2fe; --agent: #f3f4f6;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); }
header { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
h1 { font-size: 18px; margin: 0; } h2 { font-size: 15px; margin: 0 0 10px; } h3 { font-size: 13px; margin: 14px 0 6px; }
nav { display: flex; gap: 6px; align-items: center; }
nav button { background: none; border: 1px solid transparent; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; }
nav button.active { background: var(--bg); border-color: var(--line); }
main { padding: 16px 20px; max-width: 1400px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; }
.grid2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
label { display: block; margin: 8px 0; font-size: 13px; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; color: var(--text); }
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
button { padding: 7px 14px; border: 1px solid var(--line); background: var(--card); border-radius: 6px; cursor: pointer; font: inherit; }
button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button:disabled { opacity: .5; cursor: default; }
button.small { padding: 2px 8px; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.muted { color: var(--muted); font-weight: normal; } .small { font-size: 12px; }
.pill { padding: 2px 10px; border-radius: 999px; background: var(--agent); font-size: 12px; }
.pill.ok { background: #dcfce7; color: var(--ok); } .pill.warn { background: #fef3c7; color: var(--warn); } .pill.bad { background: #fee2e2; color: var(--bad); }
.error { color: var(--bad); font-size: 12px; margin-top: 6px; white-space: pre-wrap; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-bottom: 8px; min-height: 18px; }
.stats b { color: var(--text); }
.transcript { height: 440px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: #fafafa; }
.bubble { max-width: 85%; padding: 7px 10px; border-radius: 10px; margin: 6px 0; white-space: pre-wrap; position: relative; }
.bubble.user { background: var(--user); margin-left: auto; }
.bubble.agent { background: var(--agent); }
.bubble.partial { opacity: .6; font-style: italic; }
.bubble.interrupted { border-left: 3px solid var(--warn); }
.bubble .meta { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #e0e7ff; color: #3730a3; margin-left: 6px; }
.badge.slow { background: #fee2e2; color: var(--bad); } .badge.mid { background: #fef3c7; color: var(--warn); } .badge.fast { background: #dcfce7; color: var(--ok); }
.sys { font-size: 11px; color: var(--muted); text-align: center; margin: 4px 0; }
.tools { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.toolcard { border: 1px dashed var(--line); border-radius: 6px; padding: 6px 10px; font-size: 12px; background: #fffbeb; }
.toolcard code { font-size: 11px; white-space: pre-wrap; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
tbody tr.clickable { cursor: pointer; } tbody tr.clickable:hover { background: var(--bg); }
pre { font-size: 11px; background: #fafafa; border: 1px solid var(--line); border-radius: 6px; padding: 8px; overflow-x: auto; }
#profile-list { list-style: none; padding: 0; margin: 0; }
#profile-list li { padding: 8px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
#profile-list li:hover { background: var(--bg); }
#profile-list .stack { display: block; font-size: 11px; color: var(--muted); }
code { background: #f3f4f6; padding: 1px 4px; border-radius: 4px; font-size: 12px; }
