:root {
  --bg: #0b0c0e; --panel: #16171c; --panel2: #1c1e24; --line: #2a2d35; --line2: #22252b;
  --text: #d8d9da; --muted: #8b8f98; --dim: #5d616b;
  --ok: #73bf69; --deg: #fade2a; --warn: #ff9830; --out: #f2495c; --blue: #5794f2; --purple: #b877d9; --none: #2b2e36;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
/* dark-only page: native controls and scrollbars follow it instead of the OS's white ones */
:root { color-scheme: dark; scrollbar-color: #3a3e48 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a3e48; border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #4a4f5b; }
body { font: 13px/1.45 Inter, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  background: rgba(11,12,14,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.brand b { font-size: 15px; letter-spacing: .3px; }
.logo { color: var(--blue); }
.sub { color: var(--muted); }
.spacer { flex: 1; }
.pill { padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 12px; border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(115,191,105,.4); background: rgba(115,191,105,.08); }
.pill.deg { color: var(--deg); border-color: rgba(250,222,42,.4); background: rgba(250,222,42,.07); }
.pill.out { color: var(--out); border-color: rgba(242,73,92,.5); background: rgba(242,73,92,.1); }
.ranges { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.ranges button { background: var(--panel); color: var(--muted); border: 0; padding: 5px 10px; font: inherit; cursor: pointer; border-right: 1px solid var(--line); }
.ranges button:last-child { border-right: 0; }
.ranges button.on { background: #24324d; color: #fff; }
.btn { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 5px 10px; font: inherit; cursor: pointer; }
.btn:hover { border-color: #3d424d; }
.links { display: flex; gap: 12px; }
.links a { color: var(--muted); }

/* layout */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 16px; }
.wide, .stats { grid-column: 1 / -1; }
.panel { background: var(--panel); border: 1px solid var(--line2); border-radius: 4px; padding: 10px 12px; min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.panel-h h2 { font-size: 13px; font-weight: 600; margin: 0; }
.hint { color: var(--muted); font-size: 12px; }
.tools { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
input[type=search] { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 4px; padding: 5px 8px; font: inherit; width: 200px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chips button { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 3px; padding: 2px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.chips button.on { border-color: var(--blue); color: #fff; background: rgba(87,148,242,.15); }

/* stat panels */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line2); border-radius: 4px; padding: 10px 12px; position: relative; overflow: hidden; }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-family: var(--mono); font-size: 26px; font-weight: 600; margin-top: 4px; letter-spacing: -.5px; }
.stat .s { color: var(--muted); font-size: 11px; margin-top: 2px; }
.stat .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--ok); }
.c-ok-t { color: var(--ok); } .c-deg-t { color: var(--deg); } .c-out-t { color: var(--out); } .c-warn-t { color: var(--warn); } .c-blue-t { color: var(--blue); }

/* service table */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.svc th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.svc th[data-sort] { cursor: pointer; }
.svc th.sorted::after { content: " ▾"; color: var(--blue); }
.svc td { padding: 5px 8px; border-bottom: 1px solid var(--line2); vertical-align: middle; white-space: nowrap; }
.svc tbody tr { cursor: pointer; }
.svc tbody tr:hover { background: var(--panel2); }
.svc .name { font-weight: 500; }
.svc .prov { color: var(--muted); font-size: 11px; }
.num { text-align: right; }
.svc th.num { text-align: right; } /* numeric headers line up with their right-aligned values */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--dim); }
.dot.ok { background: var(--ok); box-shadow: 0 0 6px rgba(115,191,105,.6); }
.dot.slow, .dot.stale { background: var(--deg); box-shadow: 0 0 6px rgba(250,222,42,.5); }
.dot.error, .dot.down { background: var(--out); box-shadow: 0 0 8px rgba(242,73,92,.8); animation: pulse 1.4s infinite; }
.dot.client, .dot.unknown { background: var(--dim); }
@keyframes pulse { 50% { opacity: .45; } }
.budget { display: flex; align-items: center; gap: 6px; min-width: 120px; }
.budget .track { flex: 1; height: 6px; background: var(--none); border-radius: 3px; overflow: hidden; }
.budget .fill { height: 100%; }
.budget .n { font-family: var(--mono); font-size: 11px; width: 42px; text-align: right; color: var(--muted); }
canvas.spark { width: 120px; height: 24px; display: block; }
canvas.strip { width: 180px; height: 14px; display: block; }
.locs { display: flex; gap: 3px; }
.locs .dot { width: 7px; height: 7px; box-shadow: none; animation: none; }
.reason { color: var(--muted); font-size: 11px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }

/* heatmap + incidents */
#heat { width: 100%; display: block; }
.legend { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 11px; margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: -6px; }
.c-ok { background: var(--ok); } .c-deg { background: var(--deg); } .c-out { background: var(--out); } .c-none { background: var(--none); }
#gantt { position: relative; }
.g-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; height: 20px; }
.g-name { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
.g-track { position: relative; height: 12px; background: var(--panel2); border-radius: 2px; }
.g-bar { position: absolute; top: 0; height: 12px; border-radius: 2px; min-width: 3px; }
.g-axis { display: grid; grid-template-columns: 150px 1fr; color: var(--dim); font-size: 10px; margin-top: 4px; }
.g-axis div:last-child { display: flex; justify-content: space-between; }
.inc { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line2); }
.inc .t { color: var(--muted); font-size: 11px; }
.empty { color: var(--muted); padding: 14px 0; text-align: center; }
.schema { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 6px 0; border-top: 1px solid var(--line2); }
.schema .kind { font-size: 11px; font-weight: 600; border-radius: 3px; padding: 1px 6px; text-align: center; }
.schema .kind.added { color: var(--blue); background: rgba(87,148,242,.12); }
.schema .kind.removed { color: var(--warn); background: rgba(255,152,48,.12); }
.schema .kind.type_changed { color: var(--out); background: rgba(242,73,92,.12); }
.schema code { font-family: var(--mono); font-size: 11px; color: var(--text); background: var(--panel2); padding: 1px 5px; border-radius: 3px; margin: 0 4px 2px 0; display: inline-block; max-width: 100%; word-break: break-all; }
.schema .t { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(920px, 100vw); background: #111317; border-left: 1px solid var(--line);
  z-index: 20; overflow-y: auto; padding: 14px 16px 30px; box-shadow: -20px 0 40px rgba(0,0,0,.5); }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 15; }
.drawer-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.d-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.d-sub { color: var(--muted); margin-top: 2px; word-break: break-all; }
.d-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.d-stats .stat .v { font-size: 20px; }
.d-panel { background: var(--panel); border: 1px solid var(--line2); border-radius: 4px; padding: 8px 10px; margin-bottom: 10px; }
.d-panel h3 { font-size: 12px; font-weight: 600; margin: 0 0 6px; color: var(--muted); }
#d-strips { width: 100%; display: block; }
.log td, .log th { padding: 4px 6px; border-bottom: 1px solid var(--line2); font-size: 12px; white-space: nowrap; text-align: left; }
.log th { color: var(--muted); font-weight: 500; }
.log-wrap { max-height: 300px; overflow-y: auto; } /* ~9 rows: on top of the drawer, the charts stay in view */
.log-wrap .log tr:first-child th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.more-btn { margin-top: 8px; width: 100%; padding: 6px; font: inherit; font-size: 12px; color: var(--blue); background: transparent; border: 1px solid var(--line2); border-radius: 4px; cursor: pointer; }
.more-btn:hover { background: var(--panel2); } .more-btn:disabled { color: var(--muted); cursor: default; }
.log td.r { max-width: 380px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }

/* incident view, palette, help */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal[hidden], .palette[hidden] { display: none; }
.modal-box { width: min(1100px, 100%); background: #111317; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal-box.small { width: min(520px, 100%); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sev { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px; letter-spacing: .3px; }
.sev.s2 { background: rgba(242,73,92,.18); color: var(--out); }
.sev.s1 { background: rgba(250,222,42,.15); color: var(--deg); }
.sev.open { background: rgba(242,73,92,.9); color: #fff; animation: pulse 1.4s infinite; }
#im-matrix { width: 100%; display: block; }
.tl { display: grid; grid-template-columns: 120px 14px 1fr; gap: 8px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line2); font-size: 12px; }
.tl .t { font-family: var(--mono); color: var(--muted); }
kbd { font-family: var(--mono); font-size: 10px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; color: var(--muted); background: var(--panel); }
.keys td { padding: 6px 8px; border-bottom: 1px solid var(--line2); }
.palette { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5); display: flex; justify-content: center; padding-top: 12vh; }
.palette-box { width: min(640px, calc(100% - 32px)); background: #15171c; border: 1px solid #3a3f4b; border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,.7); overflow: hidden; height: fit-content; }
#pal-q { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 15px; padding: 14px 16px; outline: none; }
#pal-list { max-height: 50vh; overflow-y: auto; }
.pal-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; cursor: pointer; }
.pal-item .k { color: var(--muted); font-size: 11px; margin-left: auto; }
.pal-item.on { background: #24324d; }
.svc tbody tr.sel { background: #1d2738; box-shadow: inset 3px 0 0 var(--blue); }

/* uPlot on dark */
.uplot, .u-legend { font-family: var(--mono); color: var(--text); font-size: 11px; }
.u-legend .u-marker { border-radius: 2px; }
.u-select { background: rgba(87,148,242,.15); }

.foot { color: var(--dim); font-size: 11px; padding: 6px 16px 24px; }
.foot a { color: var(--muted); }

@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid { grid-template-columns: 1fr; } .half { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .links, .sub { display: none; } .topbar { flex-wrap: wrap; }
  .d-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } input[type=search] { width: 100%; }
}
.flap { font-size: 10px; padding: 1px 6px; border-radius: 3px; background: rgba(255,152,48,.15); color: var(--warn); border: 1px solid rgba(255,152,48,.4); white-space: nowrap; }
.g-bar.flapping { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,.35) 0 3px, transparent 3px 7px) !important; }
.correl { display: flex; flex-direction: column; gap: 6px; }
.cg { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; background: var(--panel, #181b1f); border: 1px solid rgba(242,73,92,.35); border-left: 3px solid var(--out); border-radius: 4px; font-size: 12px; }
.cg.wide-out { border-color: rgba(255,152,48,.45); border-left-color: var(--warn); color: var(--warn); }
.cg-n { color: var(--text, #ccccdc); } .cg-why { color: var(--muted); font-size: 11px; }
.cg-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.chip { font: inherit; font-size: 11px; padding: 2px 8px; border-radius: 3px; cursor: pointer; background: transparent; color: var(--muted); border: 1px solid var(--line, #2c3235); }
.chip.out { color: var(--out); border-color: rgba(242,73,92,.5); } .chip.deg { color: var(--deg); border-color: rgba(250,222,42,.4); }
.chip:hover { background: rgba(255,255,255,.05); }
.dot.maint { background: var(--purple); box-shadow: 0 0 6px rgba(184,119,217,.5); }
.cg.maint { border-color: rgba(184,119,217,.4); border-left-color: var(--purple); }
.burn { white-space: nowrap; font-family: ui-monospace, monospace; font-size: 12px; }
.burn .sep { color: var(--dim); }
.burn-tag { margin-left: 6px; font-family: inherit; font-size: 10px; padding: 1px 5px; border-radius: 3px; }
.burn-tag.page { color: var(--out); border: 1px solid rgba(242,73,92,.5); background: rgba(242,73,92,.1); }
.burn-tag.ticket { color: var(--warn); border: 1px solid rgba(255,152,48,.45); }
.cg.ours { border-color: var(--line); border-left-color: var(--dim); }
.cg-detail { flex-basis: 100%; color: var(--muted); font-size: 11px; padding-left: 17px; }
/* phones: what on-call needs at a glance — state, name, availability, burn rate */
@media (max-width: 640px) {
  .svc th:nth-child(n+6), .svc td:nth-child(n+6), .svc th:nth-child(4), .svc td:nth-child(4) { display: none; }
  .svc td .reason { max-width: 52vw; display: inline-block; vertical-align: bottom; white-space: nowrap; }
  .svc .burn-tag { display: block; margin: 2px 0 0; width: max-content; margin-left: auto; }
  .svc td:nth-child(2) { white-space: normal; }
  .svc td, .svc th { padding: 5px 4px; } .svc .b6 { display: none; } .svc td .reason { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
  .cg-chips { margin-left: 0; }
}
.svc .short { display: none; }
@media (max-width: 640px) { .svc .long { display: none; } .svc .short { display: inline; } .svc td.num, .svc .burn { font-size: 11px; } }
@media (max-width: 640px) { .schema { grid-template-columns: 64px minmax(0, 1fr); } .schema .t { grid-column: 2; } }
.handoff { margin: 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line2); border-radius: 4px; font-family: var(--mono); font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; max-height: 70vh; overflow: auto; color: var(--text); }
.phase { display: flex; height: 8px; min-width: 4px; border-radius: 2px; overflow: hidden; background: var(--none); }
.phase span { display: block; height: 100%; }
.phase span.stalled { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,.35) 0 3px, transparent 3px 6px); }
.phase-legend { flex-wrap: wrap; gap: 4px 14px; margin: 0 0 8px; }
.phase-legend i { margin-right: 4px; vertical-align: -1px; }
.phase-legend .tc-cap { color: var(--muted); }
.log td:has(.phase) { width: 120px; min-width: 120px; }
.rel th, .rel td { padding: 6px 8px; border-bottom: 1px solid var(--line2); white-space: nowrap; text-align: left; font-size: 12px; }
.rel th { color: var(--muted); font-weight: 500; }
.rel th.num, .rel td.num { text-align: right; }
.rel tr:hover td { background: rgba(255,255,255,.03); }
.rel .name { font-size: 13px; } .rel .prov { color: var(--muted); font-size: 11px; }
.rel-bar { height: 3px; background: var(--none); border-radius: 2px; margin-top: 3px; min-width: 120px; }
.rel-bar i { display: block; height: 100%; border-radius: 2px; }
@media (max-width: 640px) { .rel th:nth-child(n+5), .rel td:nth-child(n+5) { display: none; } }
/* top bar on mid-size screens: never wrap a button's label; drop the extras before that */
.btn, .links a { white-space: nowrap; }
@media (max-width: 1200px) { .btn kbd, .topbar .sub { display: none; } }
@media (max-width: 980px) { .links { display: none; } }
.next { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 12.5px; }
.next code { font-family: var(--mono); font-size: 11px; background: var(--panel2); padding: 1px 5px; border-radius: 3px; }
.next a { color: var(--blue); }
.cmp { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.cmp.worse { color: var(--warn); } .cmp.better { color: var(--ok); }
.btn.stale { color: var(--out); border-color: rgba(242,73,92,.6); background: rgba(242,73,92,.1); }
.fu { margin: -2px 0 10px; padding: 8px 12px; border-radius: 4px; font-size: 12px; border: 1px solid var(--line2); border-left-width: 3px; }
.fu.late { border-left-color: var(--deg); } .fu.hung { border-left-color: var(--out); }
.fu.stuck { border-left-color: var(--blue); }

.note { display: grid; grid-template-columns: 90px auto 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line2); font-size: 12.5px; }
.note .t { color: var(--muted); font-size: 11px; }
.note-form { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; margin-top: 8px; align-items: start; }
.note-form input, .note-form textarea { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 4px; padding: 6px 8px; font: inherit; resize: vertical; }
@media (max-width: 640px) { .note-form { grid-template-columns: 1fr; } .note { grid-template-columns: 1fr; gap: 2px; } }

.ack-tag, .note-tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.ack-tag { color: var(--blue); border: 1px solid rgba(87,148,242,.45); background: rgba(87,148,242,.1); }
.note-tag { color: var(--muted); border: 1px solid var(--line); }
.ack { color: var(--blue); font-size: 12px; align-self: center; }
.note.is-ack span:last-child { color: var(--blue); }

.silence { display: flex; align-items: center; gap: 10px; margin: -2px 0 10px; padding: 6px 12px; border: 1px solid var(--line2); border-radius: 4px; font-size: 12px; color: var(--muted); }
.silence.on { color: var(--purple); border-color: rgba(184,119,217,.45); }
.silence select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; font: inherit; }
.muted-tag { font-size: 11px; }

/* what is wrong right now: opened from the pill or the "now" panels */
.pill.click, .stat.click { cursor: pointer; }
.pill.click:hover { filter: brightness(1.25); }
.stat.click:hover { border-color: #3a3e48; background: var(--panel2); }
.problems { position: absolute; z-index: 40; width: min(470px, calc(100vw - 16px)); max-height: 70vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.55); }
.problems .ph { padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.problems .pe { padding: 14px; color: var(--muted); }
.problems .pr { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line2); color: var(--text); padding: 10px 14px; cursor: pointer; font: inherit; }
.problems .pr:hover { background: var(--panel2); }
.problems .pr:last-child { border-bottom: 0; }
.problems .prh { display: flex; gap: 8px; align-items: baseline; }
.problems .lab { font-size: 11px; font-weight: 700; min-width: 58px; }
.problems .pv { color: var(--muted); font-size: 12px; }
.problems .pd { margin-left: auto; color: var(--muted); font-size: 12px; font-family: var(--mono); white-space: nowrap; }
.problems .pw { margin: 3px 0 0 66px; color: var(--muted); font-size: 12.5px; }

/* ── trace card (trace.js): a hovered row of 최근 확인, replayed ─────────────────── */
.log td.ph.traceable { cursor: pointer; }
.log td.ph.traceable:hover { background: rgba(87,148,242,.12); }
.log tr.traced td { background: rgba(87,148,242,.06); }
.log tr.traced td.ph { background: rgba(87,148,242,.14); }
.log tr.has-trace td:first-child { box-shadow: inset 2px 0 0 var(--out); }
.tc-chip { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 3px; font-size: 10px; line-height: 16px;
  color: var(--blue); border: 1px solid rgba(87,148,242,.45); background: rgba(87,148,242,.08); white-space: nowrap; }
.trace-card { position: fixed; z-index: 60; background: linear-gradient(180deg, #1b1d24, #15161b); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px 12px; box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(87,148,242,.08);
  font-size: 12px; animation: tc-in .18s ease-out; }
.trace-card.pinned { border-color: rgba(87,148,242,.5); }
@keyframes tc-in { from { opacity: 0; transform: translateY(4px) scale(.985); } }
.tc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tc-when { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-clock { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: .5px; min-width: 70px; text-align: right; }
.tc-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 4px; width: 24px; height: 24px;
  cursor: pointer; font: inherit; line-height: 20px; padding: 0; }
.tc-btn:hover { color: var(--text); border-color: var(--dim); }
.tc-route { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.tc-end { white-space: nowrap; }
.tc-srv { max-width: 45%; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.tc-arrow { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--dim) 0 4px, transparent 4px 8px); position: relative; }
.tc-arrow::after { content: ""; position: absolute; right: -1px; top: -3px; border: 3.5px solid transparent; border-left: 6px solid var(--dim); }
.tc-track { position: relative; display: flex; gap: 3px; height: 14px; }
.tc-seg { position: relative; flex-basis: 0; min-width: 38px; border-radius: 3px; background: color-mix(in srgb, var(--c) 14%, #22252b);
  overflow: hidden; transition: box-shadow .25s; }
.tc-seg > i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--c); }
.tc-seg.now { box-shadow: 0 0 10px color-mix(in srgb, var(--c) 70%, transparent); }
.tc-seg.slowest.lit { box-shadow: 0 0 0 1px var(--deg), 0 0 12px rgba(250,222,42,.35); }
.done .tc-seg.stalled { animation: tc-stall 1.1s ease-in-out infinite; }
.done .tc-seg.stalled > i { background: repeating-linear-gradient(135deg, var(--out) 0 6px, #b3283a 6px 12px); }
@keyframes tc-stall { 50% { box-shadow: 0 0 0 1px var(--out), 0 0 16px rgba(242,73,92,.75); } }
.tc-packet { position: absolute; top: 50%; left: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; pointer-events: none;
  background: #fff; box-shadow: 0 0 6px #fff, 0 0 14px var(--blue), -14px 0 12px -4px rgba(87,148,242,.7); }
.done .tc-packet { opacity: 0; transition: opacity .4s .2s; }
.tc-labels { display: flex; gap: 3px; margin-top: 5px; }
.tc-lab { flex-basis: 0; min-width: 38px; display: flex; flex-direction: column; color: var(--muted); font-size: 10.5px; overflow: hidden; }
.tc-lab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-lab b { color: var(--text); font-weight: 600; font-size: 11px; }
.tc-lab.stalled span, .tc-lab.stalled b { color: var(--out); }
.tc-stall { min-height: 16px; margin-top: 6px; color: var(--out); font-weight: 600; opacity: 0; transition: opacity .3s; }
.done .tc-stall { opacity: 1; }
.tc-verdict { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line2); opacity: 0; transform: translateY(4px);
  transition: opacity .35s .1s, transform .35s .1s; }
.done .tc-verdict { opacity: 1; transform: none; }
.tc-kind { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid currentColor; }
.k-blue { color: var(--blue); } .k-warn { color: var(--warn); } .k-out { color: var(--out); } .k-purple { color: var(--purple); }
.k-deg { color: var(--deg); } .k-dim { color: var(--muted); } .k-ok { color: var(--ok); }
.tc-headline { margin: 6px 0 8px; font-size: 13px; line-height: 1.5; color: var(--text); font-weight: 600; }
.tc-peers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 8px; }
.tc-dots { display: grid; grid-template-columns: repeat(20, 7px); gap: 3px; flex-shrink: 0; }
.tc-dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--ok); opacity: .55; transform: scale(0); }
.tc-dots i.bad { background: var(--out); opacity: 1; box-shadow: 0 0 5px rgba(242,73,92,.6); }
.done .tc-dots i { animation: tc-pop .25s ease-out forwards; }
@keyframes tc-pop { to { transform: scale(1); } }
.tc-locs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tc-loc { padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); font-size: 11px; }
.tc-loc.s-ok { color: var(--ok); } .tc-loc.s-down, .tc-loc.s-error { color: var(--out); } .tc-loc.s-slow, .tc-loc.s-stale { color: var(--deg); }
.tc-evidence { margin: 0; padding-left: 16px; color: var(--muted); line-height: 1.6; }
.tc-evidence li { opacity: 0; }
.done .tc-evidence li { animation: tc-fade .3s ease-out forwards; }
@keyframes tc-fade { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) {
  .trace-card { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto !important; max-height: 75vh; overflow: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .trace-card, .tc-seg, .tc-verdict, .done .tc-seg.stalled, .done .tc-dots i, .done .tc-evidence li { animation: none !important; transition: none !important; }
  .tc-dots i { transform: none; } .tc-evidence li { opacity: 1; }
}
.tc-cap { color: var(--muted); }
