:root {
  --bg: #0f1115; --panel: #161a21; --panel2: #1c212a; --line: #262c37; --text: #d7dbe3; --muted: #8a93a3;
  --accent: #4d8dff; --trace: #6b7280; --debug: #64748b; --info: #3b82f6; --warn: #f59e0b; --error: #ef4444; --fatal: #c026d3;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f6f7f9; --panel: #fff; --panel2: #f1f3f6; --line: #e1e4ea; --text: #1d2330; --muted: #677085; color-scheme: light; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; }
button, input, select { font: inherit; color: inherit; }
input, select { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; }

.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 15px; white-space: nowrap; }
.logo { color: var(--accent); }
.keyform { display: flex; gap: 8px; flex: 1; max-width: 520px; }
.keyform input { flex: 1; }
.who { margin-left: auto; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); align-items: center; }
.filters .grow { flex: 1 1 260px; }
#idVal { width: 180px; }
.live { display: flex; align-items: center; gap: 6px; color: var(--muted); user-select: none; }

.summary { padding: 10px 16px 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--muted); }
.chip b { color: var(--text); }
.hist { display: flex; align-items: flex-end; gap: 1px; height: 72px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.bar { flex: 1; display: flex; flex-direction: column-reverse; min-width: 2px; cursor: zoom-in; height: 100%; justify-content: flex-start; }
.bar:hover { filter: brightness(1.3); }
.bar span { display: block; width: 100%; }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding: 2px 2px 0; }

main { padding: 6px 16px 40px; }
.msg { color: var(--muted); padding: 6px 0; min-height: 28px; }
.msg.err { color: var(--error); }
table.logs { width: 100%; border-collapse: collapse; table-layout: fixed; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.logs th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); }
.logs td { padding: 3px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logs tr.row { cursor: pointer; }
.logs tr.row:hover td { background: var(--panel); }
.logs tr.row.new td { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 25%, transparent); } }
.c-time { width: 190px; } .c-lvl { width: 64px; } .c-svc { width: 140px; }
td.msgcell { unicode-bidi: plaintext; }
.lvl { font-weight: 700; text-transform: uppercase; font-size: 11px; }
.lvl.trace { color: var(--trace); } .lvl.debug { color: var(--debug); } .lvl.info { color: var(--info); }
.lvl.warn { color: var(--warn); } .lvl.error { color: var(--error); } .lvl.fatal { color: var(--fatal); }
tr.detail td { white-space: normal; background: var(--panel); padding: 10px 12px; }
.detail pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; unicode-bidi: plaintext; max-height: 420px; overflow: auto; }
.detail .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail .ctx { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.detail .ctx div { white-space: pre-wrap; unicode-bidi: plaintext; }
.detail .ctx .self { color: var(--accent); font-weight: 700; }
.more { text-align: center; padding: 12px; }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; }
  .c-svc, .logs td:nth-child(3) { display: none; }
  .c-time { width: 92px; }
  #idVal { width: 120px; }
}
