[hidden] { display: none !important; }
:root { --bg:#f7f7f5; --card:#fff; --line:#e6e7ea; --ink:#15171b; --muted:#6b7280; --accent:#0f5f8c;
  --caller:#eef2ff; --agent:#ecfdf5; --tool:#fef3c7; --bad:#fee2e2; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); display: flex; flex-direction: column; }
header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; flex-direction: column; } .eyebrow { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.spacer { flex: 1; } .facts { display: flex; gap: 8px; flex-wrap: wrap; } .facts span { font-size: 12px; background: #f3f4f6; border-radius: 999px; padding: 2px 10px; color: #374151; }
.muted { color: var(--muted); } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
button { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 14px; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger { background: #b91c1c; color: #fff; border-color: #b91c1c; }
input { font: inherit; width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.gate { position: fixed; inset: 0; background: rgba(247,247,245,.96); display: grid; place-items: center; z-index: 10; }
.gatebox { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: 320px; display: grid; gap: 10px; }
.gatebox h2 { margin: 0; font-size: 18px; } .err { color: #b91c1c; font-size: 13px; min-height: 18px; }
main { flex: 1; display: flex; min-height: 0; }
.calls { width: 300px; border-right: 1px solid var(--line); background: #fbfbfa; padding: 12px; overflow-y: auto; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.panel h3, .listh { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 8px; }
.listh { margin: 16px 2px 8px; }
.callbox { display: grid; gap: 8px; } .lbl { font-size: 12px; color: #374151; } .hint { font-size: 11.5px; color: var(--muted); }
.row { display: flex; gap: 8px; } .level { height: 4px; background: #eef0f2; border-radius: 4px; overflow: hidden; } .level i { display: block; height: 100%; width: 0; background: #10b981; transition: width .08s; }
.calllist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.calllist li { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.calllist li.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.calllist .t { display: flex; justify-content: space-between; font-size: 12.5px; } .calllist .s { font-size: 12px; color: var(--muted); }
.live { color: #b91c1c; font-weight: 600; } .live::before { content: "● "; }
.detail { flex: 1; overflow-y: auto; padding: 16px 20px; }
.empty { max-width: 680px; } .empty h1 { font-size: 22px; margin: 8px 0; } .tips li { margin: 4px 0; color: #374151; }
.vhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.pill { font-size: 12px; border-radius: 999px; padding: 1px 9px; background: #f3f4f6; margin-left: 6px; }
.pill.on { background: #fee2e2; color: #991b1b; } .pill.ok { background: #dcfce7; color: #166534; } .pill.warn { background: #fef3c7; color: #92400e; }
.sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.sum div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; } .sum b { display: block; font-size: 16px; } .sum span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cols { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.3fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
.transcript { display: grid; gap: 8px; max-height: 70vh; overflow-y: auto; }
.bubble { border-radius: 10px; padding: 7px 10px; max-width: 92%; } .bubble small { display: block; font-size: 11px; color: var(--muted); }
.bubble.caller { background: var(--caller); justify-self: start; } .bubble.agent { background: var(--agent); justify-self: end; }
.bubble.tool { background: var(--tool); justify-self: center; font-size: 12.5px; } .bubble.bad { background: var(--bad); justify-self: center; font-size: 12.5px; }
.timeline { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.timeline td { border-bottom: 1px solid #f1f1f1; padding: 5px 4px; vertical-align: top; } .timeline td:first-child { width: 62px; text-align: right; color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.lat { font-size: 11px; border-radius: 4px; padding: 0 5px; margin-left: 6px; background: #dcfce7; color: #166534; } .lat.slow { background: #fee2e2; color: #991b1b; } .lat.mid { background: #fef3c7; color: #92400e; }
/* event log JSON viewer */
.log td { padding:.3rem .3rem; }
.evt { display:inline-block; font-weight:600; padding:0 .4rem; border-radius:4px; background:#eef2ff; color:#3730a3; }
.evt-route_done,.evt-route_start,.evt-route_skipped { background:#fef3c7; color:#92400e; }
.evt-policy { background:#fde68a; color:#78350f; }
.evt-target_error,.evt-error { background:#fee2e2; color:#991b1b; }
.evt-turn_done,.evt-first_token { background:#dcfce7; color:#166534; }
.jcopy { float:right; font:inherit; font-size:10.5px; border:1px solid #e5e7eb; background:#fff; color:var(--muted); border-radius:4px; padding:0 .35rem; cursor:pointer; }
.jcopy:hover { color:var(--accent); border-color:var(--accent); }
.jv { margin-top:.25rem; line-height:1.45; white-space:normal; }
.jv details > summary { list-style:none; cursor:pointer; }
.jv details > summary::-webkit-details-marker { display:none; }
.jv details > summary::before { content:"▸"; display:inline-block; width:1em; color:#9ca3af; }
.jv details[open] > summary::before { content:"▾"; }
.jv details[open] > summary .jv-c, .jv details[open] > summary .jv-close { display:none; }
.jv details:not([open]) > .jv-end { display:none; }
.jv-kids { padding-left:1.1em; border-left:1px dotted #e5e7eb; margin-left:.35em; }
.jv-l { padding-left:1em; word-break:break-word; }
.jv-end { padding-left:1em; }
.jv-k { color:#7c3aed; } .jv-p { color:#9ca3af; } .jv-c { color:#9ca3af; font-style:italic; margin:0 .3em; }
.jv-s { color:#047857; } .jv-num { color:#1d4ed8; } .jv-b { color:#b45309; } .jv-null { color:#6b7280; font-style:italic; }
