:root {
  --bg: #0f1115;
  --panel: #181b21;
  --panel-2: #1f242c;
  --border: #2a2f38;
  --text: #d8dde6;
  --muted: #7a8190;
  --accent: #4c8bf5;
  --pass: #2bb673;
  --fail: #e2484a;
  --skip: #9aa4b2;
  --running: #f5b94c;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
.muted { color: var(--muted); font-weight: 400; }
.meta { display: flex; gap: 16px; font-size: 13px; margin-top: 4px; }
.actions { display: flex; gap: 8px; }
button {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 4px; cursor: pointer; font: inherit;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: white; }
button.primary:hover { background: #3a76d6; }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button.small { padding: 2px 8px; font-size: 12px; }

main { display: grid; grid-template-columns: 1fr 360px; gap: 0; min-height: calc(100vh - 80px); }
main.no-detail { grid-template-columns: 1fr 0; }

#groups { padding: 20px; display: flex; flex-direction: column; gap: 18px; }

.group {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px;
}
.group-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.group-header h3 {
  margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted);
}
.probes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }

.probe {
  background: var(--panel-2); border: 1px solid var(--border); border-left: 4px solid var(--muted);
  border-radius: 4px; padding: 8px 10px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: border-color 0.15s ease;
}
.probe:hover { border-color: var(--accent); }
.probe.pass    { border-left-color: var(--pass); }
.probe.fail    { border-left-color: var(--fail); }
.probe.skip    { border-left-color: var(--skip); }
.probe.running { border-left-color: var(--running); animation: pulse 1.2s ease-in-out infinite; }
.probe.pending { opacity: 0.5; }

@keyframes pulse { 0%, 100% { opacity: 0.7 } 50% { opacity: 1 } }

.probe-id   { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); width: 32px; flex-shrink: 0; }
.probe-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.probe-status { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 3px; }
.probe.pass    .probe-status { background: rgba(43, 182, 115, 0.15); color: var(--pass); }
.probe.fail    .probe-status { background: rgba(226, 72, 74, 0.15);  color: var(--fail); }
.probe.skip    .probe-status { background: rgba(154, 164, 178, 0.15);color: var(--skip); }
.probe.running .probe-status { background: rgba(245, 185, 76, 0.15); color: var(--running); }
.probe.pending .probe-status { background: rgba(154, 164, 178, 0.1); color: var(--muted); }

#detail {
  border-left: 1px solid var(--border); background: var(--panel); padding: 18px 20px;
  position: sticky; top: 56px; align-self: start; max-height: calc(100vh - 56px); overflow-y: auto;
}
#detail.hidden { display: none; }
#detail h2 { margin: 0 0 12px; font-size: 16px; font-family: ui-monospace, SFMono-Regular, monospace; }
#detail-close {
  position: absolute; top: 10px; right: 12px; padding: 2px 8px;
  background: transparent; border: none; color: var(--muted); font-size: 18px;
}
#detail-close:hover { color: var(--text); }
.detail-row { margin: 8px 0; display: flex; gap: 8px; font-size: 13px; }
.detail-row label { color: var(--muted); width: 70px; flex-shrink: 0; }
.detail-row .v { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-word; }
.detail-actions { margin-top: 12px; display: flex; gap: 6px; }

footer { padding: 10px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex;
  align-items: center; justify-content: center; z-index: 100;
}
.modal.hidden { display: none; }
.modal-inner {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 20px; min-width: 600px; max-width: 80vw; max-height: 80vh; overflow-y: auto;
  position: relative;
}
.modal-inner button[id$="-close"] {
  position: absolute; top: 10px; right: 12px; padding: 2px 8px;
  background: transparent; border: none; color: var(--muted); font-size: 18px;
}
.history-row {
  display: grid; grid-template-columns: 1fr 80px 80px 80px 120px;
  padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 13px; font-family: ui-monospace, monospace;
}
.history-row:hover { background: var(--panel-2); }
.history-row .pass-count { color: var(--pass); }
.history-row .fail-count { color: var(--fail); }
.history-row .skip-count { color: var(--skip); }
