/* Browser probes — dedicated monitor view */

.probes-workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

/* ── Status strip ─────────────────────────────────────────── */

.probes-status-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-sm);
  background: var(--shell-panel);
  font-size: 0.76rem;
  color: var(--shell-text-secondary);
  line-height: 1.4;
}

.probes-status-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-soft);
}

.probes-status-strip.is-empty .probes-status-dot {
  background: var(--shell-muted);
  box-shadow: none;
}

.probes-status-text {
  font-weight: 600;
  color: var(--shell-text);
}

.probes-status-meta {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--shell-muted);
  white-space: nowrap;
}

/* ── Toolbar ──────────────────────────────────────────────── */

.probes-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-md);
  background: var(--shell-elevated);
}

.probes-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 220px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-sm);
  background: var(--shell-panel);
}

.probes-search-wrap svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--shell-muted);
}

.probes-search-wrap input {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--shell-text);
  outline: none;
}

.probes-filter-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--shell-panel);
  border: 1px solid var(--shell-border);
}

.probes-filter-chip {
  padding: 6px 12px;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--shell-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}

.probes-filter-chip:hover {
  color: var(--shell-text-secondary);
}

.probes-filter-chip.is-active {
  color: var(--shell-text);
  background: var(--shell-elevated);
  box-shadow: var(--shadow-xs);
}

.probes-filter-chip[data-probe-filter="devtools"].is-active { color: #1d4ed8; }
.probes-filter-chip[data-probe-filter="eval"].is-active { color: #b91c1c; }
.probes-filter-chip[data-probe-filter="script"].is-active { color: #c2410c; }
.probes-filter-chip[data-probe-filter="live"].is-active { color: var(--success); }

.probes-toolbar-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Layout ───────────────────────────────────────────────── */

.probes-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 0;
}

.probes-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: calc(var(--header-height) + 12px);
}

.probes-card {
  padding: 14px 16px;
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-md);
  background: var(--shell-panel);
}

.probes-card h3 {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

.probes-breakdown {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.probes-breakdown li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--shell-elevated);
  font-size: 0.76rem;
}

.probes-breakdown-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--shell-text-secondary);
  font-weight: 500;
}

.probes-breakdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.probes-breakdown-dot.is-purple { background: #7c3aed; }
.probes-breakdown-dot.is-blue { background: #3b82f6; }
.probes-breakdown-dot.is-red { background: #ef4444; }
.probes-breakdown-dot.is-orange { background: #f97316; }
.probes-breakdown-dot.is-green { background: var(--success); }

.probes-breakdown-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--shell-text);
}

.probes-legend {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.probes-legend-item {
  padding-left: 10px;
  border-left: 3px solid var(--shell-border);
}

.probes-legend-item.is-devtools { border-left-color: #3b82f6; }
.probes-legend-item.is-eval { border-left-color: #ef4444; }
.probes-legend-item.is-script { border-left-color: #f97316; }

.probes-legend-item dt {
  margin: 0 0 2px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--shell-text);
}

.probes-legend-item dd {
  margin: 0;
  font-size: 0.7rem;
  color: var(--shell-muted);
  line-height: 1.45;
}

.probes-legend-item code {
  font-size: 0.68rem;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--shell-elevated);
}

/* ── Session list ─────────────────────────────────────────── */

.probes-main {
  min-width: 0;
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-md);
  background: var(--shell-panel);
  overflow: hidden;
}

.probes-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--shell-border);
  background: var(--shell-elevated);
}

.probes-list-head h3 {
  margin: 0 0 3px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--shell-text);
}

.probes-list-lead {
  margin: 0;
  font-size: 0.72rem;
  color: var(--shell-muted);
  line-height: 1.4;
  max-width: 48ch;
}

.probes-count-label {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--purple);
  background: var(--purple-soft);
  border: 1px solid #ddd6fe;
}

.probes-list {
  display: flex;
  flex-direction: column;
}

.probes-loading,
.probes-empty {
  padding: 48px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--shell-muted);
  line-height: 1.5;
}

.probes-empty-cta {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Probe row ────────────────────────────────────────────── */

.probe-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--shell-border);
  transition: background 0.1s;
}

.probe-row:last-child {
  border-bottom: none;
}

.probe-row:hover {
  background: var(--shell-elevated);
}

.probe-row.is-live {
  background: linear-gradient(90deg, var(--success-soft) 0%, transparent 55%);
}

.probe-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  border: 1px solid var(--shell-border);
  background: var(--shell-elevated);
  color: var(--purple);
}

.probe-row-icon.is-devtools {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.probe-row-icon.is-eval {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.probe-row-icon.is-script {
  border-color: #fdba74;
  background: #fff7ed;
  color: #c2410c;
}

.probe-row-body {
  min-width: 0;
}

.probe-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.probe-row-id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--shell-text);
  background: none;
  padding: 0;
}

.probe-row-time {
  font-size: 0.68rem;
  color: var(--shell-muted);
}

.probe-row-live {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.probe-row-page {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--shell-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.probe-row-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}

.probe-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.66rem;
  font-weight: 700;
  border: 1px solid #c4b5fd;
  background: #f5f3ff;
  color: #6d28d9;
}

.probe-chip.is-devtools { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.probe-chip.is-eval { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.probe-chip.is-script { border-color: #fdba74; background: #fff7ed; color: #c2410c; }

.probe-row-env {
  font-size: 0.68rem;
  color: var(--shell-muted);
}

.probe-row-actions {
  flex-shrink: 0;
}

/* Hide unrelated panels on probes view */
body[data-monitor-view="probes"] #live-banner,
body[data-monitor-view="probes"] #attention-panel {
  display: none !important;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 960px) {
  .probes-layout {
    grid-template-columns: 1fr;
  }

  .probes-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .probes-detect-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .probes-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .probes-toolbar-actions {
    margin-left: 0;
    justify-content: flex-end;
  }

  .probes-sidebar {
    grid-template-columns: 1fr;
  }

  .probe-row {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .probe-row-actions {
    grid-column: 1 / -1;
    justify-self: start;
    padding-left: 48px;
  }

  .probes-status-meta {
    margin-left: 0;
    width: 100%;
  }
}
