:root {
  --brand-ink: #123047;
  --brand-teal: #0f766e;
  --brand-sea: #127fbf;
  --brand-sand: #f3ede1;
  --brand-foam: #f7fbfd;
  --brand-line: #d7e4ea;
  --brand-warn: #f59e0b;
  --brand-danger: #dc2626;
  --brand-good: #15803d;
  --brand-muted: #5a6b77;
  --brand-panel: rgba(255, 255, 255, 0.9);
  --shadow-soft: 0 16px 40px rgba(18, 48, 71, 0.1);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

body {
  font-family: "Aptos", "Segoe UI Variable", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(18, 127, 191, 0.16), transparent 24rem),
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 22rem),
    linear-gradient(180deg, #fcf8ef 0%, #f3f8fb 42%, #eef5f7 100%);
  color: var(--brand-ink);
}

.dashboard-title-block { margin-bottom: 0.5rem; }

.quarto-dashboard .card,
.card,
.sidebar-panel,
.kpi-card,
.winner-card {
  background: var(--brand-panel);
  border: 1px solid rgba(215, 228, 234, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.card,
.quarto-dashboard .card {
  padding: 0.95rem 1rem;
}

.dashboard-page > .bslib-grid {
  grid-template-rows: none !important;
  grid-auto-rows: auto !important;
}

.flow.bslib-grid {
  grid-auto-rows: auto !important;
  align-items: start;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.sidebar { gap: 0.85rem; }

.sidebar h2 {
  margin-top: 0.35rem;
  margin-bottom: 0.55rem;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-muted);
}

.sidebar-stack,
.stack-panel {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.sidebar > .html-fill-container,
.sidebar section,
.sidebar-stack,
.sidebar .control-group,
.sidebar .multi-check-control {
  width: 100%;
  min-width: 0;
}

.kpi-grid,
.stack-panel,
.viz-host,
.table-host,
.sidebar-panel {
  min-height: 0 !important;
  height: auto !important;
}

.control-group,
.control-inline {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.control-label {
  color: var(--brand-muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.control-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  background: rgba(18, 127, 191, 0.08);
  color: var(--brand-sea);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}

.control-help:focus-visible {
  outline: 2px solid rgba(18, 127, 191, 0.25);
  outline-offset: 2px;
}

.control-help-compact {
  width: 1rem;
  height: 1rem;
  font-size: 0.62rem;
}

[data-tooltip] {
  cursor: help;
}

.tippy-box[data-theme~="dashboard-rich"] {
  max-width: min(27rem, calc(100vw - 1.5rem));
  border: 1px solid rgba(18, 48, 71, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 18px 46px rgba(18, 48, 71, 0.22);
  color: var(--brand-ink);
  font-size: 0.8rem;
  line-height: 1.38;
}

.tippy-box[data-theme~="dashboard-rich"] > .tippy-arrow {
  color: rgba(255, 255, 255, 0.99);
}

.tippy-box[data-theme~="dashboard-rich"] .tippy-content {
  padding: 0;
}

.rich-tooltip-content {
  max-width: min(27rem, calc(100vw - 1.5rem));
  padding: 0.72rem 0.78rem;
  overflow-wrap: anywhere;
  text-align: left;
}

.rich-tooltip-title {
  margin-bottom: 0.36rem;
  color: var(--brand-ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.rich-tooltip-body {
  display: grid;
  gap: 0.44rem;
}

.rich-tooltip-body p {
  margin: 0;
  color: var(--brand-ink);
}

.rich-tooltip-formula {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(215, 228, 234, 0.9);
  border-radius: 6px;
  background: rgba(247, 251, 253, 0.92);
  padding: 0.42rem 0.5rem;
  color: #123047;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
}

.rich-tooltip-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding-top: 0.36rem;
  border-top: 1px solid rgba(215, 228, 234, 0.9);
}

.rich-tooltip-links span {
  color: var(--brand-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rich-tooltip-links a {
  color: var(--brand-sea);
  font-weight: 750;
  text-decoration: none;
}

.rich-tooltip-links a:hover,
.rich-tooltip-links a:focus-visible {
  text-decoration: underline;
}

.rpd-point-tooltip {
  display: grid;
  gap: 0.5rem;
  min-width: min(22rem, calc(100vw - 2rem));
}

.rpd-point-tooltip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rpd-point-tooltip-team {
  color: var(--brand-ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.rpd-point-tooltip-status {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(215, 228, 234, 0.9);
  color: var(--brand-muted);
}

.rpd-point-tooltip-status-valid {
  background: rgba(21, 128, 61, 0.14);
  color: #15803d;
}

.rpd-point-tooltip-status-partial {
  background: rgba(18, 127, 191, 0.12);
  color: #127fbf;
}

.rpd-point-tooltip-status-invalid,
.rpd-point-tooltip-status-timeout,
.rpd-point-tooltip-status-disqualified {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.rpd-point-tooltip-status-empty {
  background: rgba(215, 228, 234, 0.7);
  color: #64748b;
}

.rpd-point-tooltip-scope {
  color: var(--brand-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.rpd-point-tooltip-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.32rem 0.8rem;
  align-items: baseline;
}

.rpd-point-tooltip-key {
  color: var(--brand-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.rpd-point-tooltip-value {
  color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: right;
}

.rpd-point-tooltip-value.is-accent {
  color: #15803d;
}

.rpd-point-tooltip-note {
  padding-top: 0.42rem;
  border-top: 1px solid rgba(215, 228, 234, 0.9);
  color: var(--brand-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.rich-tooltip-fallback {
  position: fixed;
  z-index: 9999;
  max-width: min(27rem, calc(100vw - 1.5rem));
  border: 1px solid rgba(18, 48, 71, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 18px 46px rgba(18, 48, 71, 0.22);
  color: var(--brand-ink);
  font-size: 0.8rem;
  line-height: 1.38;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  visibility: hidden;
}

.rich-tooltip-fallback[data-show="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.control-group select,
.control-inline input,
.multi-check-summary {
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-ink);
  padding: 0.7rem 0.8rem;
}

.control-group select:focus,
.control-inline input:focus,
.multi-check-search:focus,
.multi-check-summary:focus,
.share-url-box:focus,
.filter-reset:focus,
.team-button:focus,
.download-link:focus {
  outline: 2px solid rgba(18, 127, 191, 0.25);
  outline-offset: 2px;
}

.share-focus-target {
  scroll-margin-top: 1rem;
  outline: 2px solid rgba(18, 127, 191, 0.28);
  outline-offset: 3px;
  box-shadow: 0 0 0 0.35rem rgba(18, 127, 191, 0.12);
}

.filter-reset,
.team-button {
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-sea));
  color: white;
  font-weight: 700;
  padding: 0.62rem 0.9rem;
  text-align: center;
  cursor: pointer;
}

.filter-reset { margin-top: 0.2rem; }

.multi-check-control {
  position: relative;
}

.multi-check-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.multi-check-summary::-webkit-details-marker {
  display: none;
}

.multi-check-summary::after {
  content: "\25be";
  color: var(--brand-muted);
  font-size: 0.78rem;
  flex-shrink: 0;
}

.multi-check-control[open] .multi-check-summary::after {
  content: "\25b4";
}

.multi-check-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 40;
  width: min(24rem, calc(100vw - 3rem));
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
}

.sidebar .control-group select,
.sidebar .multi-check-summary,
.sidebar .multi-check-panel {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.sidebar .multi-check-panel {
  max-width: none;
}

.experiment-explorer-control .experiment-explorer-panel {
  position: static;
  width: 100%;
  max-width: none;
  margin-top: 0.45rem;
  box-shadow: 0 10px 26px rgba(18, 48, 71, 0.08);
}

.multi-check-search {
  width: 100%;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-ink);
  padding: 0.58rem 0.7rem;
  font-size: 0.82rem;
}

.experiment-explorer-facets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.55rem;
}

.experiment-explorer-facet {
  min-width: 0;
  border: 1px solid rgba(11, 88, 122, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(246, 250, 252, 0.92);
  padding: 0.5rem 0.55rem;
}

.experiment-explorer-facet-title {
  margin-bottom: 0.35rem;
  color: var(--brand-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.experiment-explorer-facet-options {
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  max-height: 6.9rem;
  overflow: auto;
  padding-right: 0.08rem;
}

.experiment-explorer-facet-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.38rem;
  color: var(--brand-ink);
  font-size: 0.76rem;
  line-height: 1.25;
}

.experiment-explorer-facet-option input {
  accent-color: var(--brand-sea);
}

.experiment-explorer-facet-label,
.experiment-explorer-option-main,
.experiment-explorer-option-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.experiment-explorer-facet-count {
  color: var(--brand-muted);
  font-size: 0.68rem;
}

.experiment-explorer-meta,
.experiment-explorer-empty {
  color: var(--brand-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.experiment-explorer-selection-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: rgba(246, 250, 252, 0.92);
}

.experiment-explorer-selection-filter-btn {
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--brand-line);
  background: transparent;
  color: var(--brand-muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.42rem 0.35rem;
  cursor: pointer;
}

.experiment-explorer-selection-filter-btn:last-child {
  border-right: 0;
}

.experiment-explorer-selection-filter-btn.is-active,
.experiment-explorer-selection-filter-btn[aria-pressed="true"] {
  background: rgba(18, 127, 191, 0.12);
  color: var(--brand-sea);
}

.experiment-explorer-selection-filter-btn:focus-visible {
  outline: 2px solid rgba(18, 127, 191, 0.25);
  outline-offset: -2px;
}

.experiment-explorer-actions .multi-check-action {
  min-width: 6.2rem;
}

.multi-check-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.multi-check-action {
  flex: 1;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-sea);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.42rem 0.7rem;
  cursor: pointer;
}

.multi-check-action:disabled {
  opacity: 0.55;
  cursor: default;
}

.multi-check-action:focus-visible {
  outline: 2px solid rgba(18, 127, 191, 0.25);
  outline-offset: 2px;
}

.multi-check-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 18rem;
  overflow: auto;
  padding-right: 0.1rem;
}

.multi-check-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.55rem;
  padding: 0.2rem 0;
  color: var(--brand-ink);
  font-size: 0.82rem;
  line-height: 1.35;
}

.experiment-explorer-option-text {
  min-width: 0;
}

.experiment-explorer-option-meta {
  color: var(--brand-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.multi-check-option input {
  margin-top: 0.12rem;
  accent-color: var(--brand-sea);
}

.team-button {
  padding: 0.2rem 0.55rem;
  font-size: 0.82rem;
}

.sidebar-panel { padding: 0.85rem 0.9rem; }

.share-panel-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.share-label {
  color: var(--brand-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.share-url-box {
  width: 100%;
  min-height: 6rem;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-ink);
  padding: 0.7rem 0.8rem;
  resize: vertical;
  font-size: 0.78rem;
  line-height: 1.4;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.share-copy-btn {
  margin-top: 0;
}

.share-feedback {
  color: var(--brand-muted);
  font-size: 0.78rem;
}

.share-feedback.good { color: var(--brand-good); }
.share-feedback.warn { color: var(--brand-warn); }

/* ── Export panel ────────────────────────────────────────── */

.export-panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.export-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.export-btn {
  flex: 1;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-sea);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.7rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}

.export-btn:hover {
  background: rgba(18, 127, 191, 0.08);
}

.export-btn:focus-visible {
  outline: 2px solid rgba(18, 127, 191, 0.25);
  outline-offset: 2px;
}

/* ── KPI grid ─────────────────────────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  grid-auto-rows: minmax(min-content, auto);
  gap: 0.8rem;
  align-items: stretch;
}

.kpi-card {
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kpi-card.kpi-good { border-left: 3px solid var(--brand-good); }
.kpi-card.kpi-warn { border-left: 3px solid var(--brand-warn); }
.kpi-card.kpi-brand { border-left: 3px solid var(--brand-teal); }

.kpi-label {
  color: var(--brand-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
}

.kpi-hint {
  color: var(--brand-muted);
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

/* ── KV list (sidebar info) ───────────────────────────────── */

.kv-list { display: grid; gap: 0.65rem; }
.kv-list.compact { gap: 0.3rem; }

.kv-item-inline {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  font-size: 0.86rem;
  padding: 0.2rem 0;
}

.kv-key-inline {
  color: var(--brand-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.kv-val-inline {
  font-weight: 600;
  word-break: break-word;
}

/* ── Download links ───────────────────────────────────────── */

.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.download-links a,
.download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--brand-line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-ink);
  text-decoration: none;
  font-size: 0.8rem;
}

.download-links a:hover { background: rgba(18, 127, 191, 0.08); }

/* ── Section captions ─────────────────────────────────────── */

.section-note {
  color: var(--brand-muted);
  font-size: 0.84rem;
  margin-bottom: 0.65rem;
}

.leaderboard-column-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}

.leaderboard-column-toolbar-label {
  color: var(--brand-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Tables ───────────────────────────────────────────────── */

.table-host,
.heatmap-wrap {
  overflow: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.leaderboard-table thead th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(18, 48, 71, 0.98), rgba(15, 118, 110, 0.95));
  color: white;
  text-align: left;
  padding: 0.62rem 0.7rem;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.leaderboard-table tbody td,
.leaderboard-table tbody th {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid rgba(215, 228, 234, 0.85);
  vertical-align: middle;
}

.leaderboard-table tbody tr:nth-child(odd) { background: rgba(247, 251, 253, 0.72); }
.leaderboard-table tbody tr:hover { background: rgba(18, 127, 191, 0.08); }
.leaderboard-table tbody tr.leaderboard-row-main.row-odd { background: rgba(247, 251, 253, 0.72); }
.leaderboard-table tbody tr.leaderboard-row-main:hover { background: rgba(18, 127, 191, 0.08); }
.leaderboard-table tbody tr.leaderboard-row-detail,
.leaderboard-table tbody tr.leaderboard-row-detail:hover {
  background: transparent !important;
}

.leaderboard-row-detail td {
  padding: 0.18rem 0.7rem 0.9rem;
  background: rgba(244, 248, 250, 0.96);
  border-bottom: 1px solid rgba(215, 228, 234, 0.85);
}

/* Tier separator between RANKED and PARTIAL groups */
.tier-separator td {
  background: rgba(245, 158, 11, 0.08) !important;
  border-top: 2px dashed rgba(245, 158, 11, 0.5);
  border-bottom: 2px dashed rgba(245, 158, 11, 0.5);
  padding: 0.3rem 0.7rem;
}
.tier-sep-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #92400e;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.col-rank { width: 3rem; text-align: center; }
.col-num { text-align: right; white-space: nowrap; }
.col-status { white-space: nowrap; }
.col-checks { white-space: nowrap; }
.col-reason { max-width: 280px; }
.col-instance { white-space: nowrap; }
.col-minimap { min-width: 16rem; }
.col-leaderboard-metric { min-width: 5.8rem; }

/* Align numeric and rank headers with their cells */
.leaderboard-table thead th.col-num  { text-align: right; }
.leaderboard-table thead th.col-rank { text-align: center; }

/* Solved fraction inside Results column */
.solved-fraction {
  font-size: 0.76rem;
  color: var(--brand-muted);
  margin-right: 0.45rem;
  white-space: nowrap;
  vertical-align: middle;
}

/* Gap-to-best badges in team detail */
.gap-best { color: var(--brand-good); font-weight: 700; font-size: 0.74rem; }
.gap-num  { color: var(--brand-muted); font-size: 0.74rem; }

/* ── Rank chip ────────────────────────────────────────────── */

.rank-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(15, 118, 110, 0.12);
  color: var(--brand-teal);
}

.rank-big {
  font-size: 0.88rem;
  padding: 0.22rem 0.7rem;
}

/* Medal chips for top 3 */
.rank-gold   { background: #fef3c7; color: #92400e; border: 1.5px solid #f59e0b; }
.rank-silver { background: #f1f5f9; color: #475569; border: 1.5px solid #94a3b8; }
.rank-bronze { background: #fdf4ec; color: #7c3a0c; border: 1.5px solid #c2855a; }

/* ── Status badge ─────────────────────────────────────────── */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.18rem 0.62rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  cursor: help;
}

.status-valid { background: var(--brand-good); }
.status-partial { background: var(--brand-sea); }
.status-invalid { background: var(--brand-danger); }
.status-timeout { background: var(--brand-warn); color: #3b2200; }
.status-disqualified { background: #475569; }
.status-empty { background: var(--brand-line); color: var(--brand-muted); }
.status-unknown { background: #94a3b8; }
.status-flagged { background: #d97706; }

/* ── Instance mini-map ────────────────────────────────────── */

.instance-minimap {
  display: inline-grid;
  gap: 0.24rem;
  align-items: start;
  max-width: 100%;
  vertical-align: middle;
}

.instance-minimap-bucketed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr));
  gap: 0.55rem 0.75rem;
  align-items: start;
  width: 100%;
}

.minimap-bucket {
  display: grid;
  gap: 0.28rem;
  align-content: start;
  min-width: 0;
}

.minimap-bucket-label {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.minimap-bucket-token {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(18, 127, 191, 0.16);
  background: rgba(18, 127, 191, 0.06);
  color: var(--brand-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.minimap-demand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2.65rem, max-content));
  justify-content: start;
  gap: 0.35rem 0.48rem;
  max-width: 100%;
  padding: 4px 5px;
  border-radius: 4px;
  background: rgba(18, 48, 71, 0.04);
}

.minimap-size-column {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-content: start;
  gap: 0.22rem;
  min-width: 2.65rem;
}

.minimap-size-label {
  color: var(--brand-muted);
  font-size: 0.68rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.minimap-size-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.minimap-group {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(18, 48, 71, 0.04);
}

.minimap-dot {
  display: inline-block;
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  cursor: help;
  flex: 0 0 auto;
}

.minimap-dot:focus-visible {
  outline: 2px solid rgba(18, 127, 191, 0.55);
  outline-offset: 2px;
}

.minimap-tooltip {
  display: grid;
  gap: 0.42rem;
  min-width: min(15rem, calc(100vw - 2rem));
  max-width: min(22rem, calc(100vw - 2rem));
  color: var(--brand-ink);
  font-size: 0.76rem;
  line-height: 1.2;
  text-align: left;
}

.minimap-tooltip::after {
  display: none;
}

.minimap-tooltip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
}

.minimap-tooltip-context {
  min-width: 0;
  color: var(--brand-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.minimap-tooltip-status {
  flex: 0 0 auto;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  color: white;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.minimap-tooltip-status-valid { background: var(--brand-good); }
.minimap-tooltip-status-partial { background: var(--brand-sea); }
.minimap-tooltip-status-invalid { background: var(--brand-danger); }
.minimap-tooltip-status-timeout { background: var(--brand-warn); color: #3b2200; }
.minimap-tooltip-status-disqualified { background: #475569; }
.minimap-tooltip-status-empty { background: var(--brand-line); color: var(--brand-muted); }
.minimap-tooltip-status-unknown { background: #94a3b8; }

.minimap-tooltip-instance {
  display: block;
  max-width: 100%;
  color: var(--brand-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.minimap-tooltip-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.26rem 0.7rem;
  align-items: baseline;
  padding-top: 0.38rem;
  border-top: 1px solid rgba(215, 228, 234, 0.9);
}

.minimap-tooltip-key {
  color: var(--brand-muted);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.minimap-tooltip-value {
  color: var(--brand-ink);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.minimap-tooltip-empty {
  grid-column: 1 / -1;
  color: var(--brand-muted);
  font-weight: 700;
}

.minimap-valid { background: var(--brand-good); }
.minimap-partial { background: var(--brand-sea); }
.minimap-invalid { background: var(--brand-danger); }
.minimap-timeout { background: var(--brand-warn); }
.minimap-disqualified { background: #475569; }
.minimap-empty { background: var(--brand-line); }
.minimap-unknown { background: #94a3b8; }

/* ── Constraint dots ──────────────────────────────────────── */

.constraint-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.constraint-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  cursor: help;
}

.constraint-dot.pass { background: var(--brand-good); }
.constraint-dot.fail { background: var(--brand-danger); }
.constraint-dot.unknown { background: var(--brand-line); }

.check-pass { color: var(--brand-good); font-weight: 700; }
.check-fail { color: var(--brand-danger); font-weight: 700; }
.check-na { color: var(--brand-muted); }

/* ── Reason display ───────────────────────────────────────── */

.reason-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.reason-text {
  font-size: 0.84rem;
  line-height: 1.35;
}

.reason-brief {
  font-size: 0.82rem;
  color: var(--brand-muted);
}

.debug-summary {
  color: var(--brand-muted);
  font-size: 0.82rem;
}

.row-detail-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.34rem 0.62rem;
  border: 1px solid rgba(18, 127, 191, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-sea);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.row-detail-toggle::after {
  content: "▸";
  font-size: 0.78rem;
}

.row-detail-toggle:hover {
  background: rgba(18, 127, 191, 0.08);
  border-color: rgba(18, 127, 191, 0.32);
}

.row-detail-toggle.is-open {
  background: linear-gradient(135deg, rgba(18, 127, 191, 0.12), rgba(15, 118, 110, 0.12));
  color: var(--brand-ink);
}

.row-detail-toggle.is-open::after {
  content: "▾";
}

.debug-details { display: block; }

.debug-details summary {
  cursor: pointer;
  color: var(--brand-sea);
  font-size: 0.8rem;
  font-weight: 600;
}

.debug-pre {
  margin: 0.4rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(18, 48, 71, 0.06);
  border: 1px solid var(--brand-line);
  color: var(--brand-ink);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Muted helper ─────────────────────────────────────────── */

.muted { color: var(--brand-muted); font-size: 0.84em; }

/* ── Mono ─────────────────────────────────────────────────── */

.mono {
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.84rem;
}

/* ── Ranking toggle ───────────────────────────────────────── */

.ranking-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.toggle-group {
  display: flex;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.toggle-group-stack {
  flex-direction: column;
}

.toggle-group-stack .toggle-btn {
  text-align: left;
}

.toggle-btn {
  flex: 1;
  padding: 0.55rem 0.7rem;
  border: none;
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-btn.active {
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-sea));
  color: white;
}

.toggle-btn:not(.active):hover { background: rgba(18, 127, 191, 0.08); }

.ranking-procedure-info {
  padding: 0.75rem 0.8rem;
  border-radius: var(--radius-sm);
}

.ranking-info-title {
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.ranking-info-body,
.ranking-info-list {
  color: var(--brand-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.ranking-info-list {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-top: 0.5rem;
}

.ranking-info-list strong {
  color: var(--brand-ink);
}

.ranking-formulas {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.ranking-formula-row {
  display: grid;
  grid-template-columns: minmax(5.8rem, max-content) minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  max-width: 100%;
}

.ranking-formula-label {
  color: var(--brand-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ranking-formula {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(215, 228, 234, 0.9);
  border-radius: 6px;
  background: rgba(247, 251, 253, 0.9);
  padding: 0.22rem 0.42rem;
  color: var(--brand-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ── Team detail ──────────────────────────────────────────── */

.team-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0.85rem;
  background: rgba(52, 58, 64, 0.16);
  backdrop-filter: blur(1.5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 150ms ease, visibility 150ms ease;
}

.team-detail-modal[data-open="true"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.team-detail-modal-surface {
  position: relative;
  width: min(88rem, 100%);
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: auto;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.55rem;
  background: var(--bs-body-bg, #fff);
  box-shadow: var(--bs-box-shadow-lg, 0 1rem 3rem rgba(0, 0, 0, 0.175));
  transform: translateY(0.45rem);
  transition: transform 150ms ease;
}

.team-detail-modal[data-open="true"] .team-detail-modal-surface {
  transform: translateY(0);
}

.team-detail-close {
  position: sticky;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-end;
  margin: 0.85rem 1rem 0 auto;
  padding: 0.4rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: rgba(52, 58, 64, 0.06);
  color: var(--brand-ink);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.team-detail-close:hover {
  background: rgba(39, 97, 227, 0.1);
  color: var(--brand-sea);
}

.team-detail-close svg {
  flex: none;
}

.team-detail-close:focus-visible,
.team-detail-modal-surface:focus-visible {
  outline: 2px solid rgba(18, 127, 191, 0.28);
  outline-offset: 3px;
}

#team-detail {
  padding: 0 1rem 1.15rem;
}

.team-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 0.68rem;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.detail-header h4 {
  margin: 0;
  font-size: 1.05rem;
}

.detail-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.eyebrow {
  color: var(--brand-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0.45rem;
}

.team-detail-results {
  display: grid;
  grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.team-detail-results-map {
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(18, 127, 191, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
}

.fix-center-panel {
  gap: 0.68rem;
}

.fix-callout {
  padding: 0.62rem 0.72rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(18, 127, 191, 0.18);
  background:
    linear-gradient(135deg, rgba(18, 127, 191, 0.1), rgba(15, 118, 110, 0.08)),
    rgba(255, 255, 255, 0.82);
}

.fix-callout-eyebrow {
  color: var(--brand-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fix-callout-title {
  margin-top: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.fix-callout-meta,
.fix-callout-subtle {
  margin-top: 0.35rem;
  color: var(--brand-muted);
  font-size: 0.82rem;
}

.debug-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 0.45rem;
}

.debug-panel {
  padding: 0.55rem 0.62rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-line);
  background: rgba(255, 255, 255, 0.74);
}

.debug-panel-title {
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-muted);
}

.breakdown-pills,
.check-pill-list,
.gap-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.breakdown-pill,
.check-pill,
.blocker-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--brand-line);
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.76rem;
  color: var(--brand-ink);
}

.breakdown-pill-emphasis,
.blocker-chip {
  font-weight: 700;
}

.blocker-chip {
  background: rgba(18, 127, 191, 0.08);
  color: var(--brand-sea);
}

.winner-note {
  color: var(--brand-good);
  font-size: 0.78rem;
  font-weight: 700;
}

.constraint-breakdown-list {
  display: grid;
  gap: 0.55rem;
}

.constraint-breakdown-item {
  display: grid;
  gap: 0.3rem;
}

.constraint-breakdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.constraint-breakdown-examples {
  display: grid;
  gap: 0.25rem;
}

.inspect-stack {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.55rem;
}

.inspect-stack-wide {
  margin-top: 0;
}

.table-row-detail-panel {
  display: grid;
  gap: 0.55rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(18, 127, 191, 0.16);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(18, 127, 191, 0.08), rgba(15, 118, 110, 0.05)),
    rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.table-row-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.table-row-detail-copy {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.table-row-detail-title {
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--brand-ink);
}

.table-row-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.table-row-detail-status {
  flex: 0 0 auto;
}

.inspect-block {
  display: grid;
  gap: 0.25rem;
}

.inspect-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-muted);
}

.inspect-line {
  font-size: 0.82rem;
  color: var(--brand-ink);
}

.action-hint {
  font-size: 0.8rem;
  color: var(--brand-ink);
  line-height: 1.35;
  max-width: 22rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.violation-detail-list,
.artifact-ref-list {
  display: grid;
  gap: 0.45rem;
}

.inspect-subdetails {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.74);
}

.inspect-subsummary {
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.5rem;
  gap: 0.2rem;
  list-style: none;
  align-items: start;
}

.inspect-subsummary::-webkit-details-marker {
  display: none;
}

.inspect-subsummary::before {
  content: "▸";
  color: var(--brand-muted);
  font-size: 0.82rem;
  line-height: 1.2;
  margin-top: 0.05rem;
}

.inspect-subdetails[open] .inspect-subsummary::before {
  content: "▾";
}

.inspect-subsummary .inspect-label,
.inspect-subsummary .inspect-peek {
  grid-column: 2;
}

.inspect-peek {
  font-size: 0.78rem;
  color: var(--brand-muted);
  line-height: 1.35;
  white-space: pre-wrap;
}

.inspect-subdetails .artifact-ref-list {
  margin-top: 0.55rem;
}

.violation-detail-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.74);
}

.violation-detail-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.violation-detail-examples,
.violation-detail-example {
  display: grid;
  gap: 0.3rem;
}

.violation-example-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.artifact-ref-row {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.74);
}

.artifact-ref-details {
  overflow: hidden;
}

.artifact-ref-summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.5rem;
  row-gap: 0.18rem;
  list-style: none;
  align-items: start;
}

.artifact-ref-summary::-webkit-details-marker {
  display: none;
}

.artifact-ref-summary::before {
  content: "▸";
  color: var(--brand-muted);
  font-size: 0.82rem;
  line-height: 1.2;
  margin-top: 0.05rem;
}

.artifact-ref-details[open] .artifact-ref-summary::before {
  content: "▾";
}

.artifact-ref-summary .artifact-ref-label,
.artifact-ref-summary .artifact-ref-path,
.artifact-ref-summary .artifact-ref-meta {
  grid-column: 2;
}

.artifact-ref-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-muted);
}

.artifact-ref-path {
  font-size: 0.76rem;
  color: var(--brand-ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.artifact-ref-meta {
  font-size: 0.78rem;
  color: var(--brand-muted);
  line-height: 1.35;
}

.artifact-preview-stack {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.artifact-preview-block {
  display: grid;
  gap: 0.25rem;
}

.artifact-full-details {
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: rgba(247, 251, 253, 0.72);
  padding: 0.5rem 0.65rem;
}

.artifact-full-summary {
  cursor: pointer;
  color: var(--brand-ink);
  font-size: 0.8rem;
  font-weight: 600;
}

.artifact-note {
  color: var(--brand-muted);
}

.summary-card {
  padding: 0.52rem 0.62rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-line);
  background: rgba(255, 255, 255, 0.74);
}

.summary-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-muted);
}

.summary-value {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

.summary-hint {
  font-size: 0.78rem;
  color: var(--brand-muted);
  margin-top: 0.1rem;
}

.overview-sidebar-grid,
.overview-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
}

.overview-family-panel,
.overview-family-card {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.overview-family-title {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.overview-family-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.2rem 0 0.45rem;
}

.overview-card-actions {
  margin-top: 0.65rem;
}

.overview-kpi-family {
  display: grid;
  gap: 0.75rem;
}

.overview-kpi-head,
.overview-family-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.overview-kpi-objective,
.overview-family-subtitle {
  color: var(--brand-muted);
  font-size: 0.78rem;
  line-height: 1.35;
  margin-top: 0.18rem;
}

.overview-kpi-leader {
  flex: 0 0 auto;
  text-align: right;
}

.overview-kpi-leader-label,
.overview-metric span,
.overview-family-count {
  color: var(--brand-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overview-kpi-leader-value {
  font-size: 1rem;
  font-weight: 800;
}

.overview-metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.45rem;
}

.overview-metric {
  min-width: 0;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(215, 228, 234, 0.9);
  border-radius: 8px;
  background: rgba(247, 251, 253, 0.78);
}

.overview-metric strong,
.overview-metric small {
  display: block;
  overflow-wrap: anywhere;
}

.overview-metric strong {
  margin-top: 0.12rem;
  font-size: 0.92rem;
}

.overview-metric small {
  color: var(--brand-muted);
  font-size: 0.72rem;
  margin-top: 0.08rem;
}

.overview-family-sections {
  display: grid;
  gap: 1rem;
}

.overview-family-section {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.9rem 0.95rem;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.66);
}

.overview-family-table {
  overflow-x: auto;
}

.comparison-family-body {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.overview-family-table .leaderboard-table {
  min-width: 760px;
}

.coverage-progress-cell,
.overview-coverage-cell {
  display: grid;
  gap: 0.22rem;
  min-width: 6rem;
}

.coverage-progress-main,
.overview-coverage-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.coverage-progress-count,
.overview-coverage {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.coverage-progress-bar,
.overview-coverage-bar {
  width: 100%;
  height: 0.42rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(199, 213, 222, 0.82);
  box-shadow: inset 0 0 0 1px rgba(90, 107, 119, 0.12);
}

.coverage-progress-bar span,
.overview-coverage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-sea), var(--brand-good));
  box-shadow: inset 0 -1px 0 rgba(18, 48, 71, 0.16);
}

.coverage-progress-compact {
  min-width: 4.75rem;
  gap: 0.16rem;
}

.coverage-progress-compact .coverage-progress-main {
  gap: 0.25rem;
}

.coverage-progress-compact .coverage-progress-bar {
  height: 0.34rem;
}

.coverage-progress-card {
  margin-top: 0.35rem;
}

.coverage-progress-pill {
  min-width: 7.4rem;
}

/* ── Violation cards ──────────────────────────────────────── */

.violation-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.7rem;
}

.violation-card {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.74);
}

.violation-card.passing { border-left: 3px solid var(--brand-good); }
.violation-card.failing { border-left: 3px solid var(--brand-danger); }

.violation-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.violation-card-title { font-weight: 700; font-size: 0.86rem; }
.violation-card-count { font-size: 0.76rem; color: var(--brand-muted); }

.violation-card-explanation {
  font-size: 0.8rem;
  color: var(--brand-muted);
  margin-bottom: 0.3rem;
}

.violation-example {
  font-size: 0.78rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  background: rgba(18, 48, 71, 0.04);
  margin-top: 0.2rem;
  font-family: "Cascadia Mono", "Consolas", monospace;
  word-break: break-word;
  line-height: 1.4;
}

.panel-title {
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-muted);
}

.panel-title.spaced { margin-top: 0.2rem; }

.panel-subtitle {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.5rem;
}

/* ── Charts: bars and funnels ─────────────────────────────── */

.bar-list,
.funnel-list {
  display: grid;
  gap: 0.65rem;
}

.bar-item,
.funnel-step {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.bar-meta,
.funnel-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.86rem;
}

.bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(18, 48, 71, 0.06);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.viz-host { min-height: 180px; }

/* ── Insights analytics layout ────────────────────────────── */

.insights-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.65rem;
}

.insight-strip-item {
  min-width: 0;
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(215, 228, 234, 0.95);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
}

.insight-strip-label,
.insight-eyebrow,
.gap-label {
  color: var(--brand-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-strip-value {
  margin-top: 0.18rem;
  color: var(--brand-ink);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.18;
}

.insight-strip-hint {
  margin-top: 0.18rem;
  color: var(--brand-muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.leader-snapshot {
  display: grid;
  gap: 0.8rem;
}

.leader-snapshot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.leader-snapshot-title {
  margin-top: 0.12rem;
  font-size: 1.45rem;
  font-weight: 850;
  line-height: 1.1;
}

.leader-snapshot-lead {
  max-width: 15rem;
  color: var(--brand-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.leader-list {
  display: grid;
  gap: 0.55rem;
}

.leader-row {
  display: grid;
  grid-template-columns: 3rem minmax(7rem, 11rem) 1fr;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0;
  border-top: 1px solid rgba(215, 228, 234, 0.85);
}

.leader-rank {
  text-align: center;
}

.leader-team .team-button,
.feature-team .team-button {
  max-width: 100%;
  white-space: nowrap;
}

.leader-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.leader-metrics span,
.leader-metric-pill,
.feature-rank,
.gap-case-meta,
.difficulty-meta span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(215, 228, 234, 0.92);
  border-radius: 999px;
  background: rgba(247, 251, 253, 0.9);
  color: var(--brand-muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.28rem 0.5rem;
}

.leader-metric-pill {
  border-radius: 0.55rem;
  padding: 0.28rem 0.5rem 0.34rem;
}

.testing-spec-shell,
.feature-scorecard,
.instance-difficulty-list,
.gap-explainer {
  display: grid;
  gap: 0.72rem;
}

.testing-spec-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.65rem;
}

.testing-spec-card {
  min-width: 0;
  padding: 0.72rem 0.78rem;
  border: 1px solid rgba(215, 228, 234, 0.92);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
}

.testing-spec-card.testing-good {
  border-color: rgba(21, 128, 61, 0.35);
  background: rgba(240, 253, 244, 0.9);
}

.testing-spec-card.testing-warn {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(255, 251, 235, 0.92);
}

.testing-card-label,
.testing-subhead {
  color: var(--brand-muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.testing-card-value {
  overflow: hidden;
  margin-top: 0.2rem;
  color: var(--brand-ink);
  font-size: 0.95rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.testing-card-hint,
.testing-note,
.testing-ok-note {
  margin-top: 0.18rem;
  color: var(--brand-muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.testing-budget-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.testing-budget-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  max-width: 100%;
  padding: 0.36rem 0.52rem;
  border: 1px solid rgba(215, 228, 234, 0.9);
  border-radius: 999px;
  background: rgba(247, 251, 253, 0.92);
  color: var(--brand-muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.testing-budget-method {
  color: var(--brand-ink);
  font-weight: 900;
}

.testing-source {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.36rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.86);
  color: var(--brand-muted);
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.testing-source-both {
  background: rgba(220, 252, 231, 0.9);
  color: #166534;
}

.testing-source-plan {
  background: rgba(219, 234, 254, 0.92);
  color: #1d4ed8;
}

.testing-source-observed {
  background: rgba(254, 243, 199, 0.92);
  color: #92400e;
}

.testing-table-wrap {
  overflow: auto;
  border: 1px solid rgba(215, 228, 234, 0.9);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.86);
}

.testing-spec-table {
  width: 100%;
  min-width: 46rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.76rem;
}

.testing-spec-table th,
.testing-spec-table td {
  padding: 0.44rem 0.54rem;
  border-bottom: 1px solid rgba(215, 228, 234, 0.7);
  text-align: left;
  vertical-align: middle;
}

.testing-spec-table thead th {
  background: rgba(238, 245, 247, 0.98);
  color: var(--brand-muted);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.testing-spec-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.missing-count {
  color: #b45309;
}

.ok-count {
  color: #15803d;
}

.testing-missing-list {
  display: grid;
  gap: 0.35rem;
}

.testing-missing-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.38rem 0.5rem;
  border: 1px solid rgba(215, 228, 234, 0.82);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
  color: var(--brand-muted);
  font-size: 0.78rem;
  font-weight: 750;
}
.heatmap-coverage-progress {
  margin-left: auto;
}

.feature-scorecard-legend,
.gap-explainer-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  color: var(--brand-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.feature-scorecard-grid {
  display: grid;
  gap: 0.8rem;
}

.feature-row {
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) 1fr;
  gap: 0.85rem;
  align-items: start;
  padding-top: 0.78rem;
  border-top: 1px solid rgba(215, 228, 234, 0.82);
}

.feature-team {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
}

.feature-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.55rem;
}

.feature-axis {
  min-width: 0;
}

.feature-axis-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
  color: var(--brand-muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.feature-axis-head strong {
  color: var(--brand-ink);
  font-weight: 800;
  white-space: nowrap;
}

.feature-track,
.difficulty-track {
  width: 100%;
  height: 0.48rem;
  margin-top: 0.28rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 48, 71, 0.08);
}

.feature-fill,
.difficulty-fill {
  height: 100%;
  border-radius: 999px;
}

.feature-good,
.difficulty-fill {
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-good));
}

.feature-mid {
  background: linear-gradient(90deg, #94a3b8, var(--brand-sea));
}

.feature-weak {
  background: linear-gradient(90deg, var(--brand-warn), #f97316);
}

.feature-missing {
  background: rgba(148, 163, 184, 0.6);
}

.difficulty-row,
.gap-explainer-row {
  display: grid;
  gap: 0.6rem;
  padding: 0.72rem 0;
  border-top: 1px solid rgba(215, 228, 234, 0.82);
}

.difficulty-row {
  grid-template-columns: 1fr minmax(7rem, 9rem);
  align-items: center;
}

.difficulty-main {
  min-width: 0;
}

.difficulty-instance,
.gap-case-title {
  color: var(--brand-ink);
  font-weight: 850;
  line-height: 1.25;
}

.difficulty-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.difficulty-score {
  text-align: right;
}

.difficulty-score strong {
  display: block;
  font-size: 1rem;
}

.difficulty-score span {
  color: var(--brand-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.difficulty-track {
  grid-column: 1 / -1;
  margin-top: -0.2rem;
}

.gap-explainer-list {
  display: grid;
  gap: 0.35rem;
}

.gap-explainer-row {
  grid-template-columns: minmax(12rem, 1.35fr) minmax(8rem, 0.75fr) minmax(9rem, 0.9fr);
  align-items: start;
}

.gap-case-meta {
  margin-top: 0.32rem;
}

.gap-best,
.gap-runner {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  color: var(--brand-muted);
  font-size: 0.78rem;
}

.gap-best strong,
.gap-runner strong {
  color: var(--brand-ink);
  font-size: 0.9rem;
  line-height: 1.25;
}

@media (max-width: 760px) {
  .leader-snapshot-head,
  .leader-row,
  .feature-row,
  .difficulty-row,
  .gap-explainer-row {
    grid-template-columns: 1fr;
  }

  .leader-snapshot-head {
    display: grid;
  }

  .leader-snapshot-lead,
  .difficulty-score {
    max-width: none;
    text-align: left;
  }
}

/* ── Insights: Algorithm comparison table ─────────────────── */

.insights-algo-wrap {
  overflow-x: auto;
}

.insights-algo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.insights-algo-table thead th {
  text-align: left;
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-muted);
  border-bottom: 1px solid rgba(18, 48, 71, 0.1);
  white-space: nowrap;
}

.insights-algo-table tbody tr {
  border-bottom: 1px solid rgba(18, 48, 71, 0.05);
  transition: background 0.15s;
}

.insights-algo-table tbody tr:hover {
  background: rgba(18, 48, 71, 0.03);
}

.insights-algo-table tbody td {
  padding: 0.35rem 0.55rem;
  vertical-align: middle;
}

.insights-algo-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.insights-algo-table .algo-name {
  font-weight: 500;
}

.insights-algo-table tr.algo-top td {
  background: rgba(13, 148, 136, 0.05);
}

.insights-algo-table tr.algo-partial .algo-name {
  color: var(--brand-muted);
}

.insights-algo-table .gap-good { color: var(--brand-good); }
.insights-algo-table .gap-warn { color: var(--brand-warn); }
.insights-algo-table .cov-full  { color: var(--brand-good); }
.insights-algo-table .cov-partial { color: var(--brand-muted); }

/* ── Insights: Per-instance BKS panel ────────────────────── */

.bks-list {
  display: grid;
  gap: 0.55rem;
}

.bks-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.bks-meta {
  display: grid;
  grid-template-columns: 5.5rem 4.5rem 5rem 2.5rem 1fr;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.bks-instance {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--brand-muted);
}

.bks-winner {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bks-gap {
  text-align: right;
  font-size: 0.78rem;
  color: var(--brand-teal);
}

.bks-gap.bks-gap-solo {
  color: var(--brand-muted);
  font-style: italic;
}

.bks-bar {
  height: 6px;
}

/* ── Heatmap ──────────────────────────────────────────────── */

.heatmap-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.heatmap-table thead th {
  position: sticky;
  color: var(--brand-ink);
  padding: 0.45rem 0.35rem;
  font-size: 0.72rem;
  text-align: center;
  font-weight: 700;
  border-bottom: 1px solid rgba(18, 48, 71, 0.14);
  z-index: 12;
}

.heatmap-table thead tr:nth-child(1) th {
  top: 0;
}

.heatmap-table thead tr:nth-child(2) th {
  top: 2.25rem;
}

.heatmap-table thead tr:nth-child(3) th {
  top: 4.4rem;
}

.heatmap-size-header {
  border-bottom: 2px solid rgba(18, 48, 71, 0.18) !important;
  font-size: 0.74rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(18, 48, 71, 0.12), rgba(18, 48, 71, 0.06));
}

.heatmap-seed {
  font-size: 0.68rem !important;
  color: var(--brand-muted) !important;
  font-weight: 600 !important;
  background: rgba(18, 48, 71, 0.04);
}

.heatmap-corner {
  text-align: left !important;
  background: linear-gradient(180deg, rgba(18, 48, 71, 0.16), rgba(18, 48, 71, 0.08));
}

.heatmap-team {
  text-align: left;
  padding: 0.5rem 0.6rem;
  white-space: nowrap;
  border-bottom: 1px solid rgba(215, 228, 234, 0.78);
  background: rgba(255, 255, 255, 0.96);
  z-index: 7;
}

.heatmap-cell {
  text-align: right;
  padding: 0.22rem 0.35rem;
  border-bottom: 1px solid rgba(215, 228, 234, 0.55);
  min-width: 4.25rem;
  font-variant-numeric: tabular-nums;
}

.heatmap-metric-header {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--brand-muted);
  text-align: center;
  padding: 0.18rem 0.35rem;
  background: rgba(18, 48, 71, 0.04);
  white-space: nowrap;
}

.heatmap-summary-header {
  background: linear-gradient(180deg, rgba(18, 48, 71, 0.16), rgba(18, 48, 71, 0.08));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.68rem !important;
}

.heatmap-summary-cell {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(215, 228, 234, 0.78);
  padding: 0.4rem 0.5rem;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  z-index: 6;
}

.heatmap-table tbody tr:nth-child(odd) .heatmap-summary-cell,
.heatmap-table tbody tr:nth-child(odd) .heatmap-team {
  background: rgba(247, 251, 253, 0.98);
}

.heatmap-table tbody tr:hover .heatmap-summary-cell,
.heatmap-table tbody tr:hover .heatmap-team {
  background: rgba(223, 241, 247, 0.98);
}

.heatmap-sticky {
  position: sticky;
  background-clip: padding-box;
}

.heatmap-col-team { left: 0; min-width: 9.5rem; width: 9.5rem; }
.heatmap-col-solved { left: 9.5rem; min-width: 7rem; width: 7rem; }
.heatmap-col-rank { left: 16.5rem; min-width: 6.5rem; width: 6.5rem; }
.heatmap-col-used { left: 23rem; min-width: 7rem; width: 7rem; }
.heatmap-col-unserved { left: 30rem; min-width: 7rem; width: 7rem; }
.heatmap-col-wait { left: 37rem; min-width: 7.5rem; width: 7.5rem; }
.heatmap-col-distance { left: 44.5rem; min-width: 6rem; width: 6rem; }
.heatmap-col-runtime { left: 50.5rem; min-width: 7rem; width: 7rem; }

.heatmap-table thead .heatmap-sticky {
  z-index: 18;
}

.heatmap-table tbody .heatmap-sticky {
  box-shadow: 1px 0 0 rgba(215, 228, 234, 0.9);
}

.heatmap-band-even {
  background: rgba(18, 48, 71, 0.028);
}

.heatmap-band-odd {
  background: rgba(15, 118, 110, 0.032);
}

.heatmap-size-start {
  border-left: 3px solid rgba(18, 48, 71, 0.22) !important;
}

.heatmap-seed-start {
  border-left: 1.5px solid rgba(18, 48, 71, 0.14) !important;
}

.heatmap-cell-inner {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 2rem;
  gap: 0.25rem;
}

.heatmap-na {
  color: var(--brand-muted);
}

.heatmap-waitride {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.08rem;
  line-height: 1.1;
}

.heatmap-wait {
  font-weight: 700;
}

.heatmap-ride {
  font-size: 0.62rem;
  opacity: 0.8;
}

.heatmap-best-marker {
  position: absolute;
  left: 0.1rem;
  top: 0.1rem;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(18, 48, 71, 0.18);
}

.hm-valid-cell {
  color: #0f172a;
  font-weight: 700;
}

.hm-perf-best {
  background: linear-gradient(180deg, #0f766e, #15803d);
  color: white;
}

.hm-perf-strong {
  background: #86efac;
  color: #14532d;
}

.hm-perf-mid {
  background: #d9f99d;
  color: #365314;
}

.hm-perf-weak {
  background: #fde68a;
  color: #78350f;
}

.hm-perf-neutral {
  background: rgba(226, 232, 240, 0.9);
  color: #334155;
}

.hm-partial,
.hm-invalid,
.hm-timeout,
.hm-disqualified,
.hm-empty,
.hm-unknown {
  font-weight: 700;
}

.hm-partial      { background: var(--brand-sea); color: white; }
.hm-invalid      { background: var(--brand-danger); color: white; }
.hm-timeout      { background: var(--brand-warn); color: #3b2200; }
.hm-disqualified { background: #475569; color: white; }
.hm-empty        { background: var(--brand-line); color: var(--brand-muted); }
.hm-unknown      { background: #94a3b8; color: white; }

.heatmap-wrap {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid rgba(215, 228, 234, 0.9);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
}

.heatmap-wrap .team-button {
  white-space: nowrap;
}

.pivot-shell {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pivot-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.pivot-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.pivot-summary {
  color: var(--brand-muted);
  font-size: 0.82rem;
}

.pivot-builder {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.pivot-catalog,
.pivot-layout {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pivot-catalog {
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 8rem);
  overflow: auto;
  padding-right: 0.15rem;
}

.pivot-catalog-title {
  color: var(--brand-muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pivot-catalog-list {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.pivot-well,
.pivot-filter-card {
  border: 1px solid rgba(215, 228, 234, 0.85);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 14px rgba(18, 48, 71, 0.05);
}

.pivot-catalog-group {
  border: 1px solid rgba(215, 228, 234, 0.82);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
}

.pivot-catalog-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.48rem 0.6rem;
  color: var(--brand-ink);
  font-size: 0.78rem;
  font-weight: 850;
  cursor: grab;
}

.pivot-catalog-group summary {
  cursor: pointer;
}

.pivot-catalog-count {
  color: var(--brand-muted);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.pivot-catalog-group-body {
  display: grid;
  gap: 0.5rem;
  padding: 0 0.42rem 0.48rem;
}

.pivot-catalog-subgroup {
  display: grid;
  gap: 0.28rem;
}

.pivot-catalog-subhead {
  color: var(--brand-muted);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.pivot-catalog-rows {
  display: grid;
  gap: 0.28rem;
}

.pivot-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.34rem 0.42rem;
  border: 1px solid rgba(18, 48, 71, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(247, 251, 253, 0.82);
  cursor: grab;
}

.pivot-catalog-head {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}

.pivot-filter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
}

.pivot-catalog-name,
.pivot-chip-label {
  font-weight: 700;
  color: var(--brand-ink);
}

.pivot-catalog-location {
  color: var(--brand-muted);
  font-size: 0.66rem;
  white-space: nowrap;
}

.pivot-catalog-actions,
.pivot-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
}

.pivot-action-btn,
.pivot-chip-remove {
  border: 1px solid rgba(18, 48, 71, 0.12);
  border-radius: 999px;
  background: rgba(243, 237, 225, 0.72);
  color: var(--brand-ink);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.34rem 0.46rem;
  cursor: pointer;
}

.pivot-chip-remove {
  padding: 0.28rem 0.5rem;
  background: rgba(255, 255, 255, 0.9);
}

.pivot-action-btn:hover,
.pivot-chip-remove:hover {
  background: rgba(18, 127, 191, 0.1);
}

.pivot-toggle-btn {
  border: 1px solid rgba(18, 48, 71, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-ink);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.pivot-toggle-btn.is-active {
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-sea));
  border-color: transparent;
  color: white;
}

.pivot-wells-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.pivot-well {
  padding: 0.58rem;
}

.pivot-well-title {
  margin-bottom: 0.38rem;
  color: var(--brand-muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pivot-chip-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  min-height: 2rem;
}

.pivot-chip {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  min-height: 1.85rem;
  width: 100%;
  padding: 0.3rem 0.42rem 0.3rem 0.54rem;
  border: 1px solid rgba(18, 48, 71, 0.1);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(18, 127, 191, 0.12), rgba(15, 118, 110, 0.08));
  cursor: grab;
}

.pivot-value-chip {
  padding-right: 0.35rem;
}

.pivot-drag-handle {
  flex: 0 0 auto;
  color: var(--brand-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.08em;
  user-select: none;
}

.pivot-chip-label {
  flex: 1 1 auto;
}

.pivot-dropzone {
  width: 1rem;
  min-height: 1.85rem;
  border: 1px dashed rgba(18, 48, 71, 0.18);
  border-radius: 999px;
  background: rgba(18, 48, 71, 0.03);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.pivot-dropzone.is-active {
  border-color: var(--brand-sea);
  background: rgba(18, 127, 191, 0.16);
  transform: scaleX(1.15);
}

.pivot-chip-list .pivot-dropzone {
  width: 100%;
  min-height: 0.55rem;
  border-radius: var(--radius-sm);
}

.pivot-filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.pivot-filter-list .pivot-dropzone {
  width: 100%;
  min-height: 0.55rem;
  border-radius: var(--radius-sm);
}

.pivot-filter-card {
  padding: 0.5rem 0.55rem;
  cursor: grab;
}

.pivot-filter-details {
  margin-top: 0.38rem;
}

.pivot-filter-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-ink);
}

.pivot-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.42rem;
  max-height: 10rem;
  overflow: auto;
  padding-right: 0.2rem;
}

.pivot-filter-pill {
  border: 1px solid rgba(18, 48, 71, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-ink);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.34rem 0.55rem;
  cursor: pointer;
}

.pivot-filter-pill.is-active {
  background: rgba(18, 127, 191, 0.14);
  border-color: rgba(18, 127, 191, 0.32);
  color: #0b4d73;
}

.pivot-agg-select {
  border: 1px solid rgba(18, 48, 71, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-ink);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.34rem 0.52rem;
}

.pivot-table-wrap {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid rgba(215, 228, 234, 0.95);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
}

.pivot-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.pivot-table th,
.pivot-table td {
  padding: 0.5rem 0.6rem;
  border-right: 1px solid rgba(215, 228, 234, 0.5);
  border-bottom: 1px solid rgba(215, 228, 234, 0.7);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pivot-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(18, 48, 71, 0.14), rgba(18, 48, 71, 0.06));
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.pivot-table-corner,
.pivot-row-header,
.pivot-total-label {
  text-align: left;
}

.pivot-row-header,
.pivot-total-label {
  background: rgba(247, 251, 253, 0.96);
  font-weight: 700;
}

.pivot-row-leaf {
  box-shadow: inset -1px 0 0 rgba(215, 228, 234, 0.9);
}

.pivot-value-cell {
  text-align: right;
}

.pivot-value-cell:not(.hm-valid-cell):not(.pivot-grand-total-cell) {
  background: rgba(255, 255, 255, 0.96);
}

.pivot-col-group {
  border-bottom: 2px solid rgba(18, 48, 71, 0.14) !important;
}

.pivot-value-header {
  background: rgba(18, 48, 71, 0.08) !important;
}

.pivot-grand-total-cell:not(.hm-valid-cell),
.pivot-total-row .pivot-total-label {
  background: rgba(18, 127, 191, 0.1);
  font-weight: 700;
}

.pivot-total-row th,
.pivot-total-row td {
  border-top: 2px solid rgba(18, 48, 71, 0.14);
}

.pivot-shell .filter-reset {
  margin-top: 0;
}

.pivot-export-btn {
  flex: 0 0 auto;
  padding: 0.5rem 0.8rem;
}

/* Checkbox labels in toolbar */
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--brand-ink);
  cursor: pointer;
  margin-right: 0.6rem;
}

.toolbar-toggle {
  border: 1px solid rgba(18, 48, 71, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-ink);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.toolbar-toggle.is-active {
  background: linear-gradient(135deg, rgba(18, 127, 191, 0.16), rgba(15, 118, 110, 0.14));
  border-color: rgba(18, 127, 191, 0.3);
  color: #0d5f78;
}

/* ── Settings / pills ─────────────────────────────────────── */

.setting-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.setting-list.compact { gap: 0.45rem; }

.setting-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--brand-line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-ink);
  font-size: 0.82rem;
}

.setting-name {
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

/* ── Diagnostics toolbar ──────────────────────────────────── */

.diagnostics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

/* ── Empty state ──────────────────────────────────────────── */

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--brand-line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.64);
  color: var(--brand-muted);
  text-align: center;
}

/* ── Method badge ─────────────────────────────────────────── */

.method-badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(15, 118, 110, 0.12);
  color: var(--brand-teal);
}

.col-method { white-space: nowrap; }

/* ── Tab tutorials ──────────────────────────────────────── */

.tab-tutorial-card {
  border-left: 4px solid var(--brand-sea);
  background: linear-gradient(135deg, rgba(235, 247, 250, 0.96), rgba(255, 255, 255, 0.98));
}

.tab-tutorial-card .card-body {
  padding: 0.9rem 1rem;
}

.tab-tutorial-eyebrow {
  color: var(--brand-sea);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tab-tutorial-copy {
  max-width: 78ch;
  margin: 0.28rem 0 0;
  color: var(--brand-ink);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ── Comparison controls ─────────────────────────────────── */

:is(#comparison, #pivot-explorer, #run-explorer, #objective-gap-matrix),
:is(#comparison, #pivot-explorer, #run-explorer, #objective-gap-matrix) .html-fill-item,
:is(#comparison, #pivot-explorer, #run-explorer, #objective-gap-matrix) .html-fill-container,
:is(#comparison, #pivot-explorer, #run-explorer, #objective-gap-matrix) .card,
:is(#comparison, #pivot-explorer, #run-explorer, #objective-gap-matrix) .card-body,
:is(#comparison, #pivot-explorer, #run-explorer, #objective-gap-matrix) .table-host,
:is(#comparison, #pivot-explorer, #run-explorer, #objective-gap-matrix) .viz-host {
  min-height: 0 !important;
  height: auto !important;
}

#comparison > .bslib-grid,
#pivot-explorer > .bslib-grid,
#run-explorer > .bslib-grid,
#objective-gap-matrix > .bslib-grid {
  grid-template-rows: auto !important;
  grid-auto-rows: auto !important;
  align-content: start;
}

#comparison > .bslib-grid > .flow.bslib-grid,
#pivot-explorer > .bslib-grid > .flow.bslib-grid,
#run-explorer > .bslib-grid > .flow.bslib-grid,
#objective-gap-matrix > .bslib-grid > .flow.bslib-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-rows: auto !important;
  align-items: start;
}

:is(#comparison, #pivot-explorer, #run-explorer, #objective-gap-matrix) .card,
:is(#comparison, #pivot-explorer, #run-explorer, #objective-gap-matrix) .card-body,
:is(#comparison, #pivot-explorer, #run-explorer, #objective-gap-matrix) .table-host,
:is(#comparison, #pivot-explorer, #run-explorer, #objective-gap-matrix) .viz-host {
  max-height: none !important;
  overflow: visible !important;
}

.comparison-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.comparison-controls .control-inline {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.comparison-controls select {
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-ink);
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
}

.rpd-team-selector {
  flex: 1 1 100%;
}

/* ── Instance RPD profile ────────────────────────────────── */

.rpd-profile-host {
  min-height: 360px;
}

.rpd-profile-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.rpd-profile-insight {
  border: 1px solid rgba(215, 228, 234, 0.9);
  border-radius: var(--radius-sm);
  background: rgba(247, 251, 253, 0.7);
  padding: 0.55rem 0.65rem;
  min-width: 0;
}

.rpd-profile-insight-label {
  color: var(--brand-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rpd-profile-insight-value {
  color: var(--brand-ink);
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 0.18rem;
  overflow-wrap: anywhere;
}

.rpd-profile-insight-hint {
  color: var(--brand-muted);
  font-size: 0.75rem;
  line-height: 1.25;
  margin-top: 0.16rem;
}

.rpd-profile-chart-wrap {
  max-width: 100%;
  max-height: min(72vh, 980px);
  overflow: auto;
  padding: 0 0.15rem 0.2rem 0;
  scrollbar-gutter: stable both-edges;
}

.rpd-filter-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.rpd-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(215, 228, 234, 0.92);
  border-radius: var(--radius-sm);
  background: rgba(247, 251, 253, 0.78);
}

.rpd-filter-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rpd-filter-group-summary {
  color: var(--brand-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.rpd-filter-group-actions,
.rpd-filter-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.rpd-filter-action,
.rpd-filter-pill {
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-ink);
  cursor: pointer;
}

.rpd-filter-action {
  padding: 0.3rem 0.68rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.rpd-filter-action.is-active {
  border-color: rgba(18, 127, 191, 0.35);
  background: rgba(18, 127, 191, 0.12);
  color: var(--brand-sea);
}

.rpd-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.32rem 0.74rem;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.68;
  transition: opacity 120ms ease, border-color 120ms ease, background 120ms ease;
}

.rpd-filter-pill.is-active {
  opacity: 1;
  border-color: rgba(18, 127, 191, 0.26);
  background: rgba(18, 127, 191, 0.08);
}

.rpd-filter-pill.is-team {
  padding-left: 0.42rem;
}

.rpd-filter-pill.is-team.is-active {
  border-color: color-mix(in srgb, var(--team-color, var(--brand-sea)) 44%, white);
  background: color-mix(in srgb, var(--team-color, var(--brand-sea)) 12%, white);
}

.rpd-filter-pill-swatch {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: var(--team-color, var(--brand-sea));
  box-shadow: inset 0 0 0 1px rgba(18, 48, 71, 0.12);
  flex-shrink: 0;
}

.rpd-profile-svg {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  flex: none;
}

.rpd-column-guide {
  stroke: rgba(215, 228, 234, 0.8);
  stroke-width: 1;
}

.rpd-row-guide {
  stroke: rgba(215, 228, 234, 0.55);
  stroke-width: 0.7;
}

.rpd-group-separator {
  stroke: rgba(18, 48, 71, 0.2);
  stroke-width: 1;
}

.rpd-group-separator-strong {
  stroke: rgba(18, 48, 71, 0.32);
  stroke-width: 1.15;
}

.rpd-group-separator-stronger {
  stroke: rgba(18, 48, 71, 0.46);
  stroke-width: 1.4;
}

.rpd-zero-line {
  stroke: rgba(18, 48, 71, 0.42);
  stroke-width: 1.2;
}

.rpd-column-title {
  font-size: 11px;
}

.rpd-instance-label {
  font-size: 10px;
}

.rpd-hierarchy-label {
  font-size: 10px;
}

.rpd-method-label {
  font-size: 11px;
  font-weight: 700;
}

.rpd-team-label {
  font-size: 10px;
  font-weight: 600;
  fill: var(--brand-ink);
}

.rpd-team-label-missing {
  fill: var(--brand-muted);
}

.rpd-team-status-label {
  fill: currentColor;
  font-size: 9px;
  font-weight: 700;
}

.rpd-team-swatch {
  stroke: rgba(18, 48, 71, 0.18);
  stroke-width: 0.8;
}

.rpd-profile-best-ring {
  pointer-events: none;
}

.rpd-profile-missing-marker {
  fill: rgba(215, 228, 234, 0.2);
  stroke: rgba(100, 116, 139, 0.8);
  stroke-width: 1;
  stroke-dasharray: 3 2;
}

.rpd-profile-bar:hover {
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.28));
}

/* ── Gap objective builder / table ───────────────────────── */

.gap-objective-builder {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.gap-objective-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.gap-objective-summary {
  color: var(--brand-muted);
  font-size: 0.82rem;
}

.gap-objective-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: stretch;
}

.gap-objective-panel {
  border: 1px solid rgba(215, 228, 234, 0.95);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  padding: 0.75rem;
}

.gap-objective-title {
  margin-bottom: 0.55rem;
  color: var(--brand-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gap-objective-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 2.4rem;
}

.gap-objective-card,
.gap-objective-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  border: 1px solid rgba(18, 48, 71, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
}

.gap-objective-card {
  justify-content: space-between;
  padding: 0.4rem 0.5rem 0.4rem 0.65rem;
  cursor: grab;
}

.gap-objective-chip {
  padding: 0.4rem 0.45rem 0.4rem 0.6rem;
  background: linear-gradient(135deg, rgba(18, 127, 191, 0.12), rgba(15, 118, 110, 0.08));
  cursor: grab;
}

.gap-objective-card-name,
.gap-objective-label {
  flex: 1 1 auto;
  font-weight: 700;
  color: var(--brand-ink);
}

.gap-objective-handle {
  flex: 0 0 auto;
  color: var(--brand-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.08em;
  user-select: none;
}

.gap-objective-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(18, 48, 71, 0.08);
  color: var(--brand-ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.gap-objective-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.25rem;
}

.gap-objective-btn,
.gap-objective-icon-btn {
  border: 1px solid rgba(18, 48, 71, 0.12);
  border-radius: 999px;
  background: rgba(243, 237, 225, 0.72);
  color: var(--brand-ink);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.38rem 0.58rem;
  cursor: pointer;
}

.gap-objective-icon-btn {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
}

.gap-objective-btn:hover,
.gap-objective-icon-btn:hover {
  background: rgba(18, 127, 191, 0.1);
}

.gap-objective-dropzone {
  width: 100%;
  min-height: 0.7rem;
  border: 1px dashed rgba(18, 48, 71, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(18, 48, 71, 0.03);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.gap-objective-dropzone.is-active {
  border-color: var(--brand-sea);
  background: rgba(18, 127, 191, 0.16);
  transform: scaleY(1.25);
}

.gap-objective-empty {
  color: var(--brand-muted);
  font-size: 0.82rem;
  padding: 0.45rem 0;
}

.gap-table-wrap { overflow: auto; }

.gap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.gap-table thead th {
  position: sticky;
  top: 0;
  background: rgba(18, 48, 71, 0.06);
  color: var(--brand-ink);
  padding: 0.45rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gap-corner {
  text-align: left !important;
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.95) !important;
}

.gap-index {
  position: sticky;
  z-index: 1;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--brand-line);
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-ink);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.gap-table thead .gap-index {
  z-index: 3;
  background: rgba(238, 245, 248, 0.98) !important;
  font-size: 0.7rem;
  text-align: left;
}

.gap-index-method { left: 0; min-width: 5.25rem; width: 5.25rem; }
.gap-index-tw { left: 5.25rem; min-width: 6.5rem; width: 6.5rem; }
.gap-index-customers { left: 11.75rem; min-width: 6rem; width: 6rem; }
.gap-index-fleet { left: 17.75rem; min-width: 4.75rem; width: 4.75rem; }
.gap-index-runtime {
  left: 22.5rem;
  min-width: 6rem;
  width: 6rem;
}
.gap-index-instance {
  left: 28.5rem;
  min-width: 11rem;
  width: 11rem;
  box-shadow: 1px 0 0 rgba(215, 228, 234, 0.9);
}

.gap-team-header { min-width: 86px; }

.gap-star-count {
  display: block;
  margin-top: 0.12rem;
  color: var(--brand-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.gap-instance {
  text-align: left;
  padding: 0.4rem 0.5rem;
  white-space: nowrap;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.8rem;
  font-weight: 600;
  border-bottom: 1px solid var(--brand-line);
  background: rgba(255, 255, 255, 0.9);
  position: sticky;
  left: 0;
}

.gap-cell {
  text-align: center;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid rgba(215, 228, 234, 0.5);
  font-size: 0.78rem;
  font-weight: 600;
}

.gap-cell-decision {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.gap-cell-vector {
  margin-top: 0.12rem;
  color: var(--brand-muted);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.25;
}

.gap-tie-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  height: 1.15rem;
  border-radius: 999px;
  background: rgba(18, 127, 191, 0.14);
  color: var(--brand-sea);
  font-size: 0.66rem;
  font-weight: 800;
}

.gap-full-star {
  color: var(--brand-good);
  font-weight: 900;
}

.gap-cell-best { background: rgba(21, 128, 61, 0.18); color: var(--brand-good); }
.gap-cell-good { background: rgba(16, 185, 129, 0.1); color: #065f46; }
.gap-cell-mid  { background: rgba(245, 158, 11, 0.12); color: #92400e; }
.gap-cell-bad  { background: rgba(220, 38, 38, 0.1); color: var(--brand-danger); }
.gap-cell-na   { background: transparent; color: var(--brand-muted); font-weight: 400; }

/* ── SVG charts ──────────────────────────────────────────── */

.chart-svg {
  width: 100%;
  height: auto;
  max-height: 420px;
}

.chart-gridline {
  stroke: var(--brand-line);
  stroke-width: 0.8;
  stroke-dasharray: 4 3;
}

.chart-axis-label {
  font-size: 11px;
  fill: var(--brand-muted);
  font-family: "Aptos", "Segoe UI Variable", sans-serif;
}

.chart-axis-title {
  font-size: 12px;
  fill: var(--brand-ink);
  font-weight: 600;
  font-family: "Aptos", "Segoe UI Variable", sans-serif;
}

.chart-legend-label {
  font-size: 11px;
  fill: var(--brand-ink);
  font-family: "Aptos", "Segoe UI Variable", sans-serif;
}

.chart-dot:hover {
  r: 7;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.25));
}

.scatter-host { min-height: 300px; }

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

@media (max-width: 960px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 1.25rem; }
  .leaderboard-table { font-size: 0.82rem; }
  .leaderboard-table thead th,
  .leaderboard-table tbody td,
  .leaderboard-table tbody th { padding: 0.55rem 0.6rem; }
  .detail-summary { grid-template-columns: repeat(2, 1fr); }
  .team-detail-results { grid-template-columns: 1fr; }
  .team-detail-modal { padding: 0.55rem; }
  #team-detail { padding: 0 1rem 1.15rem; }
  .violation-cards { grid-template-columns: 1fr; }
  .pivot-builder { grid-template-columns: 1fr; }
  .pivot-catalog {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .gap-objective-grid { grid-template-columns: 1fr; }
  .rpd-filter-panel { grid-template-columns: 1fr; }
  .rpd-profile-insights { grid-template-columns: 1fr; }
  .table-row-detail-header {
    flex-direction: column;
    align-items: stretch;
  }
  .table-row-detail-status {
    align-self: flex-start;
  }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .detail-summary { grid-template-columns: 1fr; }
  .team-detail-modal { padding: 0; }
  .team-detail-modal-surface {
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
  }
  .team-detail-close { margin: 0.65rem 0.75rem 0 auto; }
  #team-detail { padding: 0 0.85rem 1rem; }
  .instance-minimap-bucketed { grid-template-columns: 1fr; }
  .pivot-wells-grid { grid-template-columns: 1fr; }
  .pivot-chip-list {
    flex-direction: column;
    align-items: stretch;
  }
  .pivot-chip,
  .pivot-value-chip {
    width: 100%;
    border-radius: var(--radius-sm);
  }
  .pivot-dropzone {
    width: 100%;
    min-height: 0.75rem;
    border-radius: var(--radius-sm);
  }
  .gap-objective-head {
    align-items: stretch;
    flex-direction: column;
  }
  .gap-objective-chip {
    flex-wrap: wrap;
  }
}
