:root {
  --bg: #f3f5f7;
  --card: #ffffff;
  --border: #d5dce4;
  --ink: #1b2733;
  --muted: #6b7280;
  --accent: #0f766e;
  --context-bar-bg: #ffd700;
  --context-bar-ink: #0b1220;
  --context-bar-muted: #1f2937;
  --topbar-height: 156px;
  --footer-height: 54px;
}

body.source-dtracker {
  --context-bar-bg: #3c96d3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #e8eef4 0%, var(--bg) 45%);
}

h1,
h2,
h3 {
  margin-top: 0;
  color: #0f172a;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1.16rem;
  font-weight: 650;
}

h3 {
  font-size: 1rem;
  font-weight: 650;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  background: #0f172a;
  color: #f8fafc;
  border-left: 20px solid var(--context-bar-bg);
  padding: 0.8rem 1.2rem;
  gap: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.18);
}

.topbar-main {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  justify-self: start;
  min-width: 0;
}

.topbar-context-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.35rem 0.75rem;
  min-width: 0;
}

.topbar a {
  color: #dbeafe;
  text-decoration: none;
}

.topbar-menu {
  justify-self: end;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.topbar-primary-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.topbar-primary-nav a {
  margin: 0;
  border-radius: 7px;
  padding: 0.42rem 0.56rem;
  font-size: 0.81rem;
  color: #f8fafc;
}

.topbar-primary-nav a:hover,
.topbar-primary-nav a:focus-visible {
  background: rgba(148, 163, 184, 0.22);
  color: #f8fafc;
}

.topbar-primary-nav a.is-active {
  font-weight: 700;
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.34);
}

.topbar-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(203, 213, 225, 0.42);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.62rem;
}

.topbar-menu-toggle:hover,
.topbar-menu-toggle:focus-visible {
  background: rgba(148, 163, 184, 0.3);
  border-color: rgba(226, 232, 240, 0.58);
}

.topbar-menu-icon {
  position: relative;
  width: 0.95rem;
  height: 0.68rem;
}

.topbar-menu-icon::before,
.topbar-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.topbar-menu-icon::before {
  top: 0;
  box-shadow: 0 0.26rem 0 0 currentColor;
}

.topbar-menu-icon::after {
  bottom: 0;
}

.topbar-nav {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 250px;
  max-width: min(420px, 92vw);
  max-height: min(78vh, 560px);
  display: grid;
  gap: 0.46rem;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.24);
  border-radius: 10px;
  padding: 0.5rem;
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.42);
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
  z-index: 1200;
}

.topbar-nav::-webkit-scrollbar {
  width: 11px;
}

.topbar-nav::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 999px;
}

.topbar-nav::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
  border: 2px solid #e2e8f0;
}

.topbar-nav[hidden] {
  display: none;
}

.topbar-nav-section {
  display: grid;
  gap: 0.12rem;
}

.topbar-nav-section + .topbar-nav-section {
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  padding-top: 0.42rem;
}

.topbar-nav-section-title {
  margin: 0.12rem 0 0.1rem;
  padding: 0 0.55rem;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #334155;
}

.topbar-nav a {
  margin: 0;
  border-radius: 7px;
  padding: 0.45rem 0.55rem;
  font-size: 0.82rem;
  color: var(--context-bar-ink);
}

.topbar-nav a:hover,
.topbar-nav a:focus-visible {
  background: #e2e8f0;
  color: var(--context-bar-ink);
}

.topbar-nav a.is-active {
  font-weight: 700;
  color: var(--context-bar-ink);
  background: #dbe7f5;
}

.topbar-nav-toggle-row {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  border-radius: 7px;
  padding: 0.45rem 0.55rem;
  font-size: 0.82rem;
  color: var(--context-bar-ink);
}

.topbar-nav-toggle-row:hover,
.topbar-nav-toggle-row:focus-visible {
  background: #e2e8f0;
  color: var(--context-bar-ink);
}

.topbar-nav-checkbox {
  width: 0.95rem;
  height: 0.95rem;
  border: 1px solid #64748b;
  border-radius: 3px;
  background: #f8fafc;
  position: relative;
  flex: 0 0 auto;
}

.topbar-nav-checkbox.is-checked {
  background: #d1fae5;
  border-color: #10b981;
}

.topbar-nav-checkbox.is-checked::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 0px;
  width: 0.3rem;
  height: 0.55rem;
  border: solid #065f46;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.topbar-nav-display-section {
  border-top: 1px solid rgba(15, 23, 42, 0.18);
  padding-top: 0.42rem;
}

.topbar-auth {
  color: #cbd5e1;
  font-size: 0.82rem;
  white-space: nowrap;
}

.topbar-auth-center {
  justify-self: center;
}

.topbar-auth strong {
  color: #f8fafc;
  font-weight: 600;
}

.topbar-auth[data-admin-gesture-target] {
  cursor: pointer;
  user-select: none;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
  text-decoration: none;
}

.topbar-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: #cbd5e1;
  font-size: 0.76rem;
}

.topbar-status-time {
  color: #f8fafc;
  font-size: 0.74rem;
}

.topbar-branch,
.topbar-source,
.topbar-fe-config,
.topbar-c2-runtime,
.topbar-dataset-group,
.topbar-compare-match {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
  color: #cbd5e1;
  font-size: 0.78rem;
}

.topbar-source {
  order: 1;
}

.topbar-fe-config {
  order: 2;
}

.topbar-c2-runtime {
  order: 3;
}

.topbar-branch {
  order: 4;
}

.topbar-dataset-group {
  order: 5;
}

.topbar-compare-match {
  order: 6;
}

.topbar-c2-runtime-control {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.topbar-c2-runtime label {
  font-weight: 600;
}

.topbar-lock-toggle {
  min-width: clamp(150px, 14vw, 190px);
  max-width: 230px;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(203, 213, 225, 0.45);
  background: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  text-align: left;
}

.topbar-lock-toggle:hover,
.topbar-lock-toggle:focus-visible {
  background: rgba(148, 163, 184, 0.3);
  border-color: rgba(226, 232, 240, 0.58);
}

.topbar-lock-toggle.is-unlocked {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.65);
}

.topbar-lock-icon {
  width: 1.05rem;
  height: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-lock-icon-svg {
  width: 1.05rem;
  height: 1.05rem;
  display: none;
}

.topbar-lock-toggle.is-locked .topbar-lock-icon-svg.is-locked {
  display: block;
}

.topbar-lock-toggle.is-unlocked .topbar-lock-icon-svg.is-unlocked {
  display: block;
}

.topbar-lock-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-c2-runtime-meta {
  color: #94a3b8;
  font-size: 0.7rem;
}

.topbar-branch-control,
.topbar-source-control,
.topbar-fe-config-control,
.topbar-dataset-group-control,
.topbar-compare-match-control {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.14rem;
}

.topbar-branch label,
.topbar-source label,
.topbar-fe-config label,
.topbar-c2-runtime label,
.topbar-dataset-group label,
.topbar-compare-match label {
  font-weight: 600;
  line-height: 1.05;
  white-space: nowrap;
}

.topbar-context-control {
  position: relative;
}

.topbar-context-control.is-context-locked {
  opacity: 0.55;
  pointer-events: none;
}

.topbar-context-toggle {
  min-width: clamp(150px, 14vw, 190px);
  max-width: 230px;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(203, 213, 225, 0.45);
  background: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
}

.topbar-context-toggle-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-context-toggle:hover,
.topbar-context-toggle:focus-visible {
  background: rgba(148, 163, 184, 0.3);
  border-color: rgba(226, 232, 240, 0.58);
  opacity: 1;
}

.topbar-context-toggle::after {
  content: "v";
  font-size: 0.72rem;
  color: #cbd5e1;
}

.topbar-context-toggle[aria-expanded="true"]::after {
  content: "^";
}

.topbar-dataset-group-select {
  min-width: 210px;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(203, 213, 225, 0.45);
  background: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
  font-size: 0.82rem;
}

.topbar-dataset-group-select:hover,
.topbar-dataset-group-select:focus-visible {
  background: rgba(148, 163, 184, 0.3);
  border-color: rgba(226, 232, 240, 0.58);
}

.topbar-dataset-group-select option,
.topbar-dataset-group-select optgroup {
  color: #0f172a;
}

.topbar-context-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 1400;
  width: min(390px, calc(100vw - 2.5rem));
  max-height: min(520px, calc(100vh - 7rem));
  overflow-y: auto;
  padding: 0.32rem;
  border: 1px solid #d1dae5;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.24);
  display: grid;
  gap: 0.25rem;
}

.topbar-context-panel[hidden] {
  display: none;
}

.topbar-context-option {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #ffffff;
  color: #0f172a;
  padding: 0.35rem 0.45rem;
  text-align: left;
  display: grid;
  gap: 0.16rem;
}

.topbar-context-option:hover,
.topbar-context-option:focus-visible {
  border-color: #dbe4ed;
  background: #f8fafc;
  opacity: 1;
}

.topbar-context-option.is-selected {
  border-color: #0f766e;
  background: #ecfdf5;
}

.topbar-context-option-meta {
  color: #64748b;
  font-size: 0.72rem;
}

.topbar-context-section-label {
  margin: 0.16rem 0 0.04rem;
  padding: 0 0.1rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.topbar-context-time {
  color: #1e293b;
  font-size: 0.72rem;
}

.topbar-context-divider {
  border-top: 1px solid #dbe4ed;
  margin: 0.05rem 0;
}

.topbar-context-expand {
  border: 1px dashed #94a3b8;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  text-align: left;
  padding: 0.3rem 0.45rem;
  font-size: 0.76rem;
}

.topbar-context-expand:hover,
.topbar-context-expand:focus-visible {
  border-color: #64748b;
  background: #eef2f7;
  opacity: 1;
}

.topbar-source-panel {
  min-width: 280px;
}

.topbar-source-option {
  width: 100%;
  border: 1px solid #dbe4ed;
  border-radius: 7px;
  background: #ffffff;
  color: #0f172a;
  padding: 0.32rem 0.45rem;
  text-align: left;
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) auto;
  gap: 0.25rem 0.45rem;
  align-items: center;
}

.topbar-source-option:hover,
.topbar-source-option:focus-visible {
  border-color: #94a3b8;
  background: #f8fafc;
  opacity: 1;
}

.topbar-source-option-indicator {
  width: 0.92rem;
  height: 0.92rem;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-source-option-indicator::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: transparent;
}

.topbar-source-option.is-selected {
  border-color: #0f766e;
  background: #ecfdf5;
}

.topbar-source-option.is-selected .topbar-source-option-indicator {
  border-color: #0f766e;
}

.topbar-source-option.is-selected .topbar-source-option-indicator::after {
  background: #0f766e;
}

.topbar-source-option-state {
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.topbar-source-option.is-selected .topbar-source-option-state {
  color: #0f766e;
}

.topbar-source-option .topbar-context-option-meta {
  grid-column: 2 / -1;
}

.topbar-branch-meta,
.topbar-source-meta,
.topbar-c2-runtime-meta,
.topbar-dataset-group-meta {
  color: #94a3b8;
  font-size: 0.7rem;
  white-space: nowrap;
}

.topbar-context-lock-note {
  color: #facc15;
  font-size: 0.69rem;
  white-space: nowrap;
}

.topbar-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-self: flex-end;
}

.topbar-nav-refresh {
  display: grid;
  gap: 0.45rem;
  justify-items: start;
}

.topbar-nav .topbar-refresh {
  align-items: flex-start;
  align-self: auto;
}

.topbar-nav .topbar-refresh-status {
  color: #475569;
}

.topbar-nav .topbar-refresh-progress {
  width: min(8rem, 100%);
}

.topbar-refresh-profile-label {
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-refresh-profile {
  min-width: 9.5rem;
  max-width: 100%;
  border-radius: 0.6rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.32rem 0.55rem;
}

.topbar-refresh-profile:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.topbar-help-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  min-width: 4.6rem;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(203, 213, 225, 0.45);
  color: #e2e8f0;
  text-decoration: none;
}

.topbar-help-toggle:hover,
.topbar-help-toggle:focus-visible {
  border-color: rgba(226, 232, 240, 0.7);
  background: rgba(148, 163, 184, 0.3);
  color: #f8fafc;
}

.topbar-help-toggle.is-enabled {
  background: #f0fdf4;
  border-color: #34d399;
  color: #065f46;
}

.topbar-help-toggle.is-enabled:hover,
.topbar-help-toggle.is-enabled:focus-visible {
  background: #dcfce7;
  border-color: #10b981;
  color: #064e3b;
}

.topbar-refresh-button {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
}

.topbar-refresh-button:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
  opacity: 1;
}

.topbar-refresh-status {
  color: #cbd5e1;
  font-size: 0.72rem;
}

.topbar-refresh-progress {
  position: relative;
  width: 5.75rem;
  height: 0.32rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(148, 163, 184, 0.24);
  overflow: hidden;
}

.topbar-refresh-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, #93c5fd, #e0f2fe);
  border-radius: inherit;
  animation: topbar-refresh-progress 1.1s linear infinite;
}

.topbar-refresh-progress[hidden] {
  display: none;
}

@keyframes topbar-refresh-progress {
  0% {
    transform: translateX(-130%);
  }
  100% {
    transform: translateX(250%);
  }
}

.container {
  max-width: 1880px;
  margin: calc(var(--topbar-height) + 1rem) auto 0;
  padding: 0 1rem calc(var(--footer-height) + 1.5rem);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.advanced-sql-card {
  margin-top: 0;
  overflow: visible;
}

.advanced-sql-list {
  margin: 0.65rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.65rem;
}

.advanced-sql-item {
  border: 1px solid #dbe4ed;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.52rem;
  list-style-position: outside;
}

.advanced-sql-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.42rem 0.55rem;
  margin-bottom: 0.32rem;
  line-height: 1.3;
}

.advanced-sql-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.38rem;
  margin-bottom: 0.32rem;
}

.advanced-sql-copy-button {
  padding: 0.24rem 0.52rem;
  font-size: 0.76rem;
}

.advanced-sql-expand-button {
  width: 2.15rem;
  min-width: 2.15rem;
  padding: 0.24rem 0;
  font-size: 0.88rem;
  line-height: 1;
  font-weight: 700;
}

.advanced-sql-params {
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.advanced-sql-query-wrap {
  position: relative;
  border: 1px solid #cdd8e5;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.advanced-sql-query-wrap.is-truncated::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.55rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.94) 58%, #ffffff 100%);
  pointer-events: none;
}

.advanced-sql-query-wrap.is-truncated::after {
  content: "...";
  position: absolute;
  right: 0.48rem;
  bottom: 0.22rem;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  color: #475569;
  background: #ffffff;
  padding: 0 0.08rem;
  pointer-events: none;
}

.advanced-sql-query {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.37;
  background: transparent;
  border: 0;
  padding: 0.52rem 0.56rem;
  max-height: min(55vh, 520px);
  overflow: auto;
}

.advanced-sql-query.is-collapsed {
  max-height: 9.7rem;
  overflow: hidden;
}

.advanced-sql-query code {
  white-space: inherit;
}

.advanced-sql-keyword {
  color: #0c4a6e;
  font-weight: 700;
}

.advanced-sql-string {
  color: #7f1d1d;
}

.advanced-sql-comment {
  color: #475569;
  font-style: italic;
}

.sql-trace-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.3rem;
}

.sql-trace-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  padding: 0.11rem 0.36rem;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.1;
}

.sql-trace-badge--live {
  border-color: #67e8f9;
  background: #ecfeff;
  color: #0e7490;
}

.sql-trace-badge--cached {
  border-color: #bef264;
  background: #f7fee7;
  color: #3f6212;
}

.sql-trace-badge--query {
  border-color: #67e8f9;
  background: #ecfeff;
  color: #0e7490;
}

body.advanced-sql-modal-open {
  overflow: hidden;
}

.advanced-sql-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
}

.advanced-sql-modal[hidden] {
  display: none;
}

.advanced-sql-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
  background: rgba(2, 6, 23, 0.74);
  color: transparent;
}

.advanced-sql-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1400px, 96vw);
  height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 22px 44px rgba(2, 6, 23, 0.52);
  overflow: hidden;
}

.advanced-sql-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.58rem 0.7rem;
  border-bottom: 1px solid #dbe4ed;
  background: #f8fafc;
}

.advanced-sql-modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.advanced-sql-modal-query {
  margin: 0;
  padding: 0.72rem 0.8rem 0.78rem;
  flex: 1 1 auto;
  overflow: auto;
  background: #ffffff;
}

.advanced-sql-modal-query code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.84rem;
  line-height: 1.44;
}

.metric-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.22rem;
}

.metric-info-button {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid #64748b;
  background: #f8fafc;
  color: #334155;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.metric-info-button:hover,
.metric-info-button:focus-visible {
  border-color: #0f766e;
  color: #0f766e;
  background: #ecfdf5;
  opacity: 1;
}

.metric-info-popover {
  position: absolute;
  top: calc(100% + 0.28rem);
  left: 0;
  z-index: 1400;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 1rem));
  border: 1px solid #cdd8e5;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  padding: 0.52rem 0.62rem;
  font-size: 0.75rem;
  line-height: 1.4;
  max-height: min(240px, calc(100vh - 1rem));
  overflow-y: auto;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.metric-info-popover.is-floating {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 16000;
}

.metric-info-popover[hidden] {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.2rem 0.9rem;
}

.summary-grid p {
  margin: 0.1rem 0;
}

.inline-form,
.collab-form,
.filters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
}

.filters-grid label,
.inline-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}

.filters-grid--scenarios {
  display: grid;
  gap: 0.75rem;
  align-items: stretch;
  margin-top: 0.7rem;
}

.filters-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.9rem;
}

.filters-heading {
  margin: 0;
  font-size: 1.04rem;
}

.filters-helper {
  margin: 0;
}

.filters-mode-helper {
  margin: 0;
}

.filters-section {
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.62rem 0.68rem 0.72rem;
}

.filters-section-title {
  margin: 0 0 0.42rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem 0.72rem;
  align-items: end;
}

.filters-row-modality {
  grid-template-columns: minmax(320px, 1fr);
}

.filters-grid--scenarios label {
  min-width: 0;
}

.filter-mode-field {
  min-width: 0;
}

.filter-mode-state {
  min-height: 1rem;
  margin: 0;
}

.filter-mode-state[data-mode="include"] {
  color: #0f766e;
}

.filter-mode-state[data-mode="exclude"] {
  color: #b91c1c;
  font-weight: 600;
}

.filter-mode-select-exclude {
  border-color: #fca5a5;
  background: #fff1f2;
}

.filters-field-search {
  grid-column: span 2;
}

.filters-checkbox-field {
  min-height: 2.3rem;
  align-self: end;
  padding-bottom: 0.25rem;
}

.scenarios-modality-filter {
  min-width: 0;
  width: 100%;
}

.filters-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.filters-actions .form-dirty-notice {
  margin: 0;
}

.filters-apply-button {
  min-width: 10.8rem;
}

.dashboard-controls {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(220px, 260px) minmax(220px, 260px) minmax(300px, 1fr) auto;
  gap: 0.6rem 0.85rem;
  align-items: start;
  margin-top: 0.35rem;
}

.dashboard-scope-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
  margin: 0.7rem 0 0.45rem;
}

.dashboard-scope-stat {
  display: grid;
  gap: 0.18rem;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.7rem 0.82rem;
}

.dashboard-scope-stat-label {
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-scope-stat-value {
  color: #0f172a;
  font-size: 1.35rem;
  line-height: 1.1;
}

.dashboard-scope-stats-note {
  margin: 0 0 0.45rem;
}

.dashboard-control {
  min-width: 0;
}

.dashboard-control-title {
  margin: 0;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}

.dashboard-controls .modality-filter {
  min-width: 0;
  width: 100%;
}

.dashboard-controls > .modality-filter[data-modality-filter-label="Modalities"] {
  grid-column: 4;
  grid-row: 1;
}

.dashboard-controls .modality-filter-legend {
  margin: 0;
}

.dashboard-controls .modality-filter-toggle {
  min-width: 0;
}

.dashboard-metric-visibility-panel {
  width: min(250px, calc(100vw - 2rem));
}

.dashboard-metric-visibility-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
}

.dashboard-metric-visibility-option:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.dashboard-metric-visibility-option:focus-within {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.16);
}

.dashboard-metric-visibility-option input[type="checkbox"] {
  margin: 0;
}

.dashboard-metric-visibility-label {
  font-size: 0.82rem;
}

.dashboard-more-filters-group {
  grid-column: 4;
  grid-row: 2;
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.dashboard-more-filters-toggle {
  justify-self: start;
}

.dashboard-more-filters-panel {
  display: grid;
  gap: 0.55rem;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.48rem 0.52rem;
}

.dashboard-more-filters-panel[hidden] {
  display: none;
}

.dashboard-compute-host-control {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.dashboard-compute-host-control input {
  min-width: 0;
  width: 100%;
}

.dashboard-compute-host-control select {
  min-width: 0;
  width: 100%;
}

.dashboard-filter-mode-selects {
  display: grid;
  gap: 0.35rem;
}

.dashboard-more-filters-panel .modality-filter {
  width: 100%;
}

.dashboard-controls-submit {
  grid-column: 5;
  grid-row: 2;
  align-self: end;
  margin-bottom: 0.05rem;
}

.settings-scale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
  margin: 0.45rem 0 0.8rem;
}

.settings-scale-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem 0.55rem;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.settings-scale-card legend {
  padding: 0 0.25rem;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
}

.settings-scale-card label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
}

.settings-branch-visibility {
  grid-column: 1 / -1;
}

.settings-branch-visibility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.45rem;
}

.settings-branch-visibility-item {
  border: 1px solid #dbe4ed;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.42rem 0.5rem;
  display: grid;
  gap: 0.16rem;
  align-content: start;
}

.settings-branch-visibility-item input[type="checkbox"] {
  margin: 0 0 0.15rem;
}

.settings-branch-visibility-item.is-locked {
  background: #f8fafc;
  border-style: dashed;
}

.settings-data-quality-list {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0 0.8rem;
}

.settings-data-quality-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.5rem 0.6rem;
}

.settings-data-quality-item h2 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.settings-data-quality-item.severity-critical {
  border-color: #fca5a5;
  background: #fef2f2;
}

.settings-data-quality-item.severity-warning {
  border-color: #fcd34d;
  background: #fffbeb;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.modality-filter {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 250px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.modality-filter-legend {
  padding: 0;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 600;
}

.modality-filter-toggle {
  min-width: 240px;
  width: 100%;
  text-align: left;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #c8d0d9;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
}

.modality-filter-toggle::after {
  content: "v";
  font-size: 0.75rem;
  color: #64748b;
}

.modality-filter-toggle[aria-expanded="true"]::after {
  content: "^";
}

.modality-filter-panel {
  position: absolute;
  top: calc(100% + 0.2rem);
  left: 0;
  z-index: 20;
  width: min(360px, calc(100vw - 2rem));
  max-height: 260px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid #d1dae5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
  display: grid;
  gap: 0.25rem;
}

.modality-filter[data-modality-filter-label="Tags"] .modality-filter-panel {
  width: min(540px, calc(100vw - 2rem));
  max-height: min(460px, calc(100vh - 14rem));
}

.modality-filter[data-modality-filter-label="Dataset Groups"] .modality-filter-panel {
  width: min(620px, calc(100vw - 2rem));
  max-height: min(460px, calc(100vh - 14rem));
}

.modality-filter-panel[hidden] {
  display: none;
}

.modality-filter-option {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  padding: 0.3rem 0.4rem;
  text-align: left;
  display: grid;
  align-items: center;
  grid-template-columns: 1rem 1fr auto;
  gap: 0.45rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.modality-filter-option:hover {
  border-color: #dbe4ed;
  background: #f8fafc;
}

.modality-filter-option:focus-visible {
  border-color: #0f766e;
  outline: 1px solid #0f766e;
}

.modality-filter-indicator {
  width: 1rem;
  height: 1rem;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: #ffffff;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.modality-filter-option[data-state="include"] .modality-filter-indicator {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

.modality-filter-option[data-state="exclude"] .modality-filter-indicator {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

.modality-filter-state {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modality-filter-option[data-state="include"] .modality-filter-state {
  color: #0f766e;
}

.modality-filter-option[data-state="exclude"] .modality-filter-state {
  color: #b91c1c;
}

.modality-filter-option[data-state="neutral"] .modality-filter-state {
  color: #64748b;
}

.modality-filter[data-modality-filter-label="Tags"] .modality-filter-option {
  align-items: start;
  grid-template-columns: 1rem minmax(0, 1fr) auto;
}

.modality-filter[data-modality-filter-label="Tags"] .modality-filter-option .mono {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modality-filter[data-modality-filter-label="Dataset Groups"] .modality-filter-option {
  align-items: start;
  grid-template-columns: 1rem minmax(0, 1fr) auto;
}

.modality-filter[data-modality-filter-label="Dataset Groups"] .modality-filter-option .mono {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modality-filter[data-modality-filter-label="Dataset Groups"] .modality-filter-option[data-state="include"] {
  border-color: #1e3a8a;
  background: #eff6ff;
}

.modality-filter[data-modality-filter-label="Dataset Groups"] .modality-filter-option[data-state="include"] .modality-filter-state {
  color: #1e3a8a;
  font-weight: 700;
}

.modality-filter[data-modality-filter-label="Dataset Groups"] .modality-filter-indicator {
  border-radius: 999px;
  border-color: #1e3a8a;
  color: transparent;
  background: #ffffff;
  position: relative;
}

.modality-filter[data-modality-filter-label="Dataset Groups"] .modality-filter-indicator::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #1e3a8a;
  opacity: 0;
}

.modality-filter[data-modality-filter-label="Dataset Groups"] .modality-filter-option[data-state="include"] .modality-filter-indicator {
  border-color: #1e3a8a;
  background: #ffffff;
}

.modality-filter[data-modality-filter-label="Dataset Groups"] .modality-filter-option[data-state="include"] .modality-filter-indicator::after {
  opacity: 1;
}

.modality-filter[data-modality-filter-label="Dataset Groups"] .modality-filter-option:focus-visible {
  border-color: #1e3a8a;
  outline: 1px solid #1e3a8a;
}

.modality-filter-helper,
.modality-filter-summary {
  margin: 0;
}

.modality-filter-hidden {
  display: none;
}

.modality-filter-section-label {
  margin: 0.15rem 0.2rem 0.05rem;
  padding-top: 0.2rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

input,
select,
button,
textarea {
  border: 1px solid #c8d0d9;
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
}

textarea {
  min-width: 320px;
  font-family: inherit;
}

button {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

button.button-pending {
  background: #c2410c;
  border-color: #c2410c;
  color: #ffffff;
}

button.button-pending.loading-bar {
  color: #ffffff;
}

.form-dirty-notice {
  margin: 0;
  color: #9a3412;
  font-size: 0.83rem;
  font-weight: 600;
}

.button-secondary {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #cbd5e1;
}

.button-secondary:hover {
  opacity: 0.95;
}

.topbar .topbar-help-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 4.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(30, 41, 59, 0.84);
  color: #e2e8f0;
  font-weight: 650;
}

.topbar .topbar-help-toggle:hover,
.topbar .topbar-help-toggle:focus-visible {
  border-color: rgba(148, 163, 184, 0.85);
  background: rgba(51, 65, 85, 0.92);
  color: #f8fafc;
}

.topbar .topbar-help-toggle.is-enabled,
.topbar .topbar-help-toggle.is-enabled:hover,
.topbar .topbar-help-toggle.is-enabled:focus-visible {
  border-color: #34d399;
  background: #d1fae5;
  color: #065f46;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0.15rem;
  margin-left: 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #f8fafc;
  color: #334155;
}

.icon-button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

.icon-button:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  opacity: 1;
}

.scenario-readable-id-row {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.scenario-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem 0.8rem;
  margin-bottom: 0.55rem;
}

.scenario-detail-subtitle {
  margin: 0.15rem 0 0;
}

.scenario-detail-subtitle-context {
  font-size: 0.82rem;
}

.scenario-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.5rem 0 0.75rem;
}

.scenario-detail-tab-button {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #0f172a;
  padding: 0.34rem 0.72rem;
  font-size: 0.78rem;
  font-weight: 650;
}

.scenario-detail-tab-button:hover,
.scenario-detail-tab-button:focus-visible {
  border-color: #94a3b8;
  background: #eef2f7;
}

.scenario-detail-tab-button.is-active {
  border-color: #0f766e;
  background: #d1fae5;
  color: #065f46;
}

.scenario-detail-tab-panel[hidden] {
  display: none;
}

.scenario-detail-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.85rem;
  margin-top: 0.6rem;
}

.scenario-detail-panel {
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.68rem;
}

.scenario-detail-panel h2 {
  margin: 0 0 0.45rem;
  font-size: 0.96rem;
}

.scenario-detail-table {
  margin: 0;
}

.scenario-detail-table th,
.scenario-detail-table td {
  padding: 0.36rem 0.45rem;
}

.scenario-detail-kv-table th {
  width: 38%;
  min-width: 126px;
  background: #f1f5f9;
  text-align: left;
}

.scenario-detail-kv-table td {
  background: #ffffff;
}

.scenario-detail-metrics-table th,
.scenario-detail-metrics-table td {
  text-align: right;
}

.scenario-detail-metrics-table th:first-child,
.scenario-detail-metrics-table td:first-child {
  text-align: left;
}

.scenario-detail-metrics-table td {
  background: #ffffff;
}

.scenario-detail-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.scenario-detail-data-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.scenario-detail-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.5rem;
  text-align: center;
}

.scenario-data-button.scenario-detail-action-button {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.scenario-detail-links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.scenario-detail-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  text-align: center;
}

@media (max-width: 760px) {
  .scenario-detail-data-actions,
  .scenario-detail-links-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.scenario-data-button-small {
  width: auto;
  min-width: 0;
  padding: 0.5rem 0.72rem;
  font-size: 0.84rem;
  border-width: 1px;
  border-radius: 8px;
}

.scenario-jira-sync-form {
  margin-top: 0.48rem;
  align-items: center;
}

.scenario-jira-sync-button {
  padding: 0.28rem 0.56rem;
  font-size: 0.78rem;
  line-height: 1.2;
}

.dvc-command-card {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.dvc-command-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.dvc-command-title {
  margin: 0;
  font-size: 1.02rem;
}

.dvc-command-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.dvc-command-copy-button {
  min-width: 4.7rem;
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #334155;
}

.dvc-command-pre {
  margin: 0;
  border-radius: 8px;
  padding: 0.72rem 0.86rem;
  background: #111827;
  border: 1px solid #374151;
  color: #e5e7eb;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

.dvc-command-pre + .dvc-command-pre {
  margin-top: 0.72rem;
}

.matrix-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.matrix-table {
  table-layout: fixed;
  min-width: 920px;
}

.matrix-col-label {
  width: 12rem;
}

.matrix-col-data {
  width: calc((100% - 12rem) / 3);
}

.matrix-table tbody > tr > th:first-child,
.matrix-table tfoot > tr > th:first-child {
  min-width: 12rem;
  width: 12rem;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-grid-shell {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}

.dashboard-grid-table-scroll {
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-block-scale {
  flex: 0 0 9.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5fb 100%);
  padding: 0.5rem 0.55rem;
}

.dashboard-block-scale-title {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e293b;
}

.dashboard-block-scale-body {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  min-height: 11.5rem;
}

.dashboard-block-scale-track {
  width: 1rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  flex: 0 0 auto;
}

.dashboard-block-scale-values {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.25rem;
  min-width: 0;
}

.dashboard-block-scale-value {
  display: block;
  font-size: 0.73rem;
  color: #334155;
  line-height: 1.2;
  white-space: nowrap;
}

.scenarios-table-scroll {
  overflow-y: visible;
}

.matrix-table th,
.matrix-table td,
.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 0.45rem;
  vertical-align: top;
}

.matrix-table th,
.data-table th {
  background: #f8fafc;
  font-size: 0.85rem;
  white-space: nowrap;
}

.matrix-table tfoot th,
.data-table tfoot th {
  background: #eef2f7;
  position: sticky;
  bottom: 0;
  z-index: 1;
}

#scenario-history-table tfoot {
  display: none;
}

.grid-cell {
  position: relative;
  overflow: hidden;
}

.grid-cell::before {
  content: attr(data-cell-number);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.14);
  pointer-events: none;
  z-index: 0;
}

.grid-cell::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.grid-cell > * {
  position: relative;
  z-index: 1;
}

.grid-color-scale {
  max-width: 560px;
}

.grid-color-scale-bar {
  height: 1rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
}

.grid-color-scale-range {
  margin: 0.4rem 0 0;
}

.cell-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.cell-link:hover {
  background: #f0fdfa;
}

.combo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.35rem;
}

.combo-list-label {
  font-weight: 600;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.55rem 0 0.2rem;
}

.csv-export-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
}

.combo-pill {
  display: inline-block;
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #14532d;
  font-size: 0.82rem;
}

.combo-pill a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.combo-pill-empty-state {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

.combo-pill-clear {
  border-color: #fecaca;
  background: #fff7ed;
  color: #9a3412;
}

.button-link {
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.84rem;
  line-height: 1.2;
  padding: 0.42rem 0.62rem;
}

.button-link:hover {
  opacity: 0.92;
}

.scenario-data-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 28rem);
  padding: 0.78rem 1rem;
  border: 2px solid #0f766e;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.22);
}

.scenario-data-button:hover {
  opacity: 0.97;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.28);
}

.scenario-data-button:focus-visible {
  outline: 3px solid #99f6e4;
  outline-offset: 2px;
}

.small-text {
  font-size: 0.78rem;
}

.report-links {
  margin: 0;
  padding-left: 1.1rem;
}

.report-links li + li {
  margin-top: 0.15rem;
}

.issue-ticket-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem;
  margin-top: 0.2rem;
}

.jira-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.26rem;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.72rem;
  line-height: 1.28;
  text-decoration: none;
  white-space: nowrap;
}

.jira-pill:hover {
  opacity: 0.96;
}

.jira-pill-selected {
  font-weight: 700;
}

.jira-pill-triage {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
}

.jira-pill-issue {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

.jira-status-unknown,
.jira-status-unassigned {
  border-color: #d1d5db;
  background: #f8fafc;
  color: #64748b;
}

.jira-status-backlog,
.jira-status-to-do,
.jira-status-todo,
.jira-status-open {
  border-color: #9ca3af;
  background: #f3f4f6;
  color: #4b5563;
}

.jira-status-assigned,
.jira-status-review,
.jira-status-in-review,
.jira-status-in-progress,
.jira-status-in_progress {
  border-color: #0052cc;
  background: #ebf2ff;
  color: #0052cc;
}

.jira-status-done,
.jira-status-merged,
.jira-status-closed,
.jira-status-resolved,
.jira-status-won-t-do,
.jira-status-wont-do {
  border-color: #5fa321;
  background: #edf8e3;
  color: #3f7a12;
}

.jira-status-groomed,
.jira-status-in-qa,
.jira-status-testing,
.jira-status-blocked,
.jira-status-on-hold,
.jira-status-on_hold {
  border-color: #d1d5db;
  background: #f8fafc;
  color: #64748b;
}

.jira-issue-color-0 {
  border-color: #9c27b0;
  background: #f3e5f5;
  color: #6a1b9a;
}

.jira-issue-color-1 {
  border-color: #3f51b5;
  background: #e8eaf6;
  color: #283593;
}

.jira-issue-color-2 {
  border-color: #1976d2;
  background: #e3f2fd;
  color: #0d47a1;
}

.jira-issue-color-3 {
  border-color: #0288d1;
  background: #e1f5fe;
  color: #01579b;
}

.jira-issue-color-4 {
  border-color: #00796b;
  background: #e0f2f1;
  color: #004d40;
}

.jira-issue-color-5 {
  border-color: #388e3c;
  background: #e8f5e9;
  color: #1b5e20;
}

.jira-issue-color-6 {
  border-color: #f9a825;
  background: #fff8e1;
  color: #8d6e00;
}

.jira-issue-color-7 {
  border-color: #ef6c00;
  background: #fff3e0;
  color: #bf360c;
}

.jira-issue-color-8 {
  border-color: #d84315;
  background: #fbe9e7;
  color: #bf360c;
}

.jira-issue-color-9 {
  border-color: #ad1457;
  background: #fce4ec;
  color: #880e4f;
}

.metric-stack {
  display: grid;
  gap: 0.16rem;
  min-width: 126px;
}

.metric-stack div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
}

.metric-label {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.criteria-grid {
  display: grid;
  gap: 0.2rem;
  min-width: 200px;
}

.criteria-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid #dbe3ec;
  background: #f8fafc;
}

.criteria-key {
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.scenario-modalities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.modality-pill {
  display: inline-block;
  padding: 0.13rem 0.44rem;
  border-radius: 999px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0c4a6e;
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: nowrap;
}

.modality-pill-empty {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

.scenario-solutions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.solution-pill {
  display: inline-block;
  padding: 0.13rem 0.44rem;
  border-radius: 999px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: nowrap;
}

.solution-pill-empty {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

.dataset-coverage-table th,
.dataset-coverage-table td {
  vertical-align: top;
}

.dataset-coverage-cell {
  display: grid;
  gap: 0.3rem;
  min-width: 190px;
}

.dataset-coverage-cell-title,
.dataset-coverage-cell-meta,
.dataset-coverage-empty {
  margin: 0;
}

.dataset-coverage-solution-list {
  display: grid;
  gap: 0.2rem;
}

.dataset-coverage-solution-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.muted {
  color: var(--muted);
}

.collab-form-row {
  background: #fafafa;
}

.scenarios-table {
  min-width: 1760px;
}

.scenarios-table thead th {
  position: relative;
  z-index: 1;
  padding-right: 0.85rem;
  background: #dce7f5;
  color: #0f172a;
  font-weight: 700;
  border-bottom: 2px solid #93acd0;
  transition: box-shadow 0.12s ease;
}

.scenarios-table thead th.scenarios-table-header-pinned {
  z-index: 18;
  box-shadow: 0 2px 0 #93acd0;
}

.scenarios-context-hint {
  margin: 0.35rem 0 0.4rem;
}

.table-header-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.table-sort-button {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 4px;
  color: #475569;
  font-size: 0.68rem;
  line-height: 1;
  padding: 0.08rem 0.3rem;
  cursor: pointer;
}

.table-sort-button:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.table-sort-button.table-sort-button-active {
  border-color: #0f766e;
  color: #0f766e;
  background: #e6fffa;
}

.column-resizer {
  position: absolute;
  top: 0.2rem;
  right: -1px;
  width: 8px;
  height: calc(100% - 0.4rem);
  cursor: col-resize;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.scenarios-table thead th:hover .column-resizer {
  opacity: 1;
}

.column-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 1px;
  background: #94a3b8;
}

body.column-resize-active {
  cursor: col-resize;
  user-select: none;
}

.column-controls {
  margin: 0.5rem 0 0.65rem;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.4rem 0.55rem;
}

.column-controls > summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}

.column-controls-grid {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.35rem 0.65rem;
}

.column-controls-grid label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
}

.pagination-form {
  align-items: center;
}

.pagination-controls {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.pagination-page-number {
  min-width: 2.1rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.pagination-page-number-active {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
  font-weight: 700;
}

.pagination-ellipsis {
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.pagination-status {
  margin: 0;
}

.scenarios-navigation-status {
  margin: 0.2rem 0 0;
  position: relative;
  padding-left: 0;
}

.scenarios-loading .scenarios-navigation-status {
  color: #0f172a;
}

.scenarios-loading .scenarios-navigation-status::before {
  content: "";
  display: block;
  width: min(340px, 48vw);
  height: 0.28rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(90deg, #0891b2 0%, #22d3ee 48%, #0891b2 100%);
  background-size: 220% 100%;
  margin: 0 0 0.35rem;
  animation: scenarios-navigation-pulse 1.1s linear infinite;
}

@keyframes scenarios-navigation-pulse {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 220% 50%;
  }
}

.scenarios-table tbody tr.scenario-data-row {
  cursor: pointer;
}

.scenarios-table tbody tr.scenario-data-row:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: -2px;
}

.scenarios-table tbody tr.scenario-data-row:hover {
  background: #f8fafc;
}

.scenarios-table tbody tr.scenario-data-row-expanded {
  background: #edf3f8;
}

.scenarios-table tbody tr.scenario-data-row-band-even {
  background: #f8fbff;
}

.scenarios-table tbody tr.scenario-data-row-band-odd {
  background: #ebf2fc;
}

.scenarios-table tbody tr.scenario-data-row-expanded.scenario-data-row-band-even,
.scenarios-table tbody tr.scenario-data-row-expanded.scenario-data-row-band-odd {
  background: #edf3f8;
}

.pin-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.6rem;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
}

.pin-status-pill-pinned {
  border-color: #fdba74;
  background: #ffedd5;
  color: #9a3412;
}

.pin-cell-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.pinned-scenarios-card {
  margin-top: 1rem;
  border: 2px solid #fb923c;
  background: #fff7ed;
  box-shadow: 0 3px 10px rgba(249, 115, 22, 0.12);
}

.pinned-scenarios-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 4px solid #ea580c;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
}

.pinned-scenarios-header h2 {
  margin: 0;
  font-weight: 800;
  color: #7c2d12;
}

.pinned-scenarios-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pinned-status-message {
  margin: 0.3rem 0 0.1rem;
}

.pinned-status-message.pinned-status-message-error {
  color: #9f1239;
}

.pinned-scenarios-table {
  min-width: 1760px;
}

.pinned-scenarios-table th,
.pinned-scenarios-table td {
  border-right: 1px solid #f2c9a0;
}

.pinned-scenarios-table th:last-child,
.pinned-scenarios-table td:last-child {
  border-right: 0;
}

.pinned-scenarios-table thead th {
  background: #ffd8ad;
  color: #7c2d12;
  font-weight: 700;
  border-bottom: 2px solid #fb923c;
}

.pinned-scenarios-table tbody tr.pinned-scenario-row {
  background: #ffe9d2;
}

.pinned-scenarios-table tbody tr.pinned-scenario-row:nth-child(even) {
  background: #ffdcb8;
}

.pinned-scenarios-table tbody tr.pinned-scenario-row:hover {
  background: #ffd2a5;
  box-shadow: inset 3px 0 0 #ea580c;
}

.pinned-scenarios-table tbody tr.pinned-scenario-row.pin-context-row-active,
.scenarios-table tbody tr.scenario-data-row.pin-context-row-active {
  box-shadow: inset 3px 0 0 #ea580c;
}

.pinned-row-drag-cell {
  width: 3rem;
  text-align: center;
}

.pinned-row-drag-handle {
  display: inline-block;
  cursor: grab;
  color: #9a3412;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.pinned-scenario-row-dragging {
  opacity: 0.5;
}

.context-menu-affordance {
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1;
  opacity: 0.65;
  user-select: none;
}

tr:hover .context-menu-affordance,
tr:focus-within .context-menu-affordance {
  opacity: 1;
  color: #334155;
}

.pin-context-menu {
  position: fixed;
  z-index: 1205;
  min-width: 210px;
  padding: 0.28rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.pin-context-menu[hidden] {
  display: none;
}

.pin-context-menu-item {
  width: 100%;
  border: 0;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  border-radius: 6px;
  padding: 0.38rem 0.48rem;
}

.export-context-menu {
  min-width: 270px;
}

.export-context-checkbox {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
}

.export-context-checkbox input {
  margin: 0;
  accent-color: #0f766e;
}

.export-context-checkbox span {
  line-height: 1.2;
}

.pin-context-menu-label {
  margin: 0.08rem 0.24rem;
  padding: 0.14rem 0.35rem 0.08rem;
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pin-context-menu-label[data-pin-context-label="copy"] {
  margin-top: 0.22rem;
  border-top: 2px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 4px;
  padding-top: 0.34rem;
}

.pin-context-menu-item:hover {
  background: #f8fafc;
}

.pin-context-menu-item[data-pin-context-action="unpin"] {
  color: #9f1239;
  font-weight: 700;
}

.pin-context-menu-item[data-pin-context-action="unpin"]:hover {
  background: #ffe4e6;
  color: #881337;
}

.histogram-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.histogram-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.84rem;
}

#gospa-histogram {
  width: 100%;
  height: auto;
  background: #f8fafc;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
}

#dashboard-histogram-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.15rem;
}

#dashboard-metric-histogram {
  width: auto;
  max-width: none;
  height: auto;
  background: #f8fafc;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
}

.dashboard-histogram-bar {
  cursor: pointer;
  opacity: 0.94;
}

.dashboard-histogram-bar:hover,
.dashboard-histogram-bar:focus {
  opacity: 1;
  stroke: #0f172a;
  stroke-width: 1.2;
}

.data-table tbody tr:nth-child(even):not(.upset-row):not(.scenario-data-row):not(.pinned-scenario-row) {
  background: #fcfdff;
}

.state-pill {
  display: inline-block;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: lowercase;
}

.state-unassigned {
  color: #334155;
  background: #e2e8f0;
}

.state-assigned {
  color: #0f172a;
  background: #dbeafe;
}

.state-in_review {
  color: #7c2d12;
  background: #ffedd5;
}

.state-investigated {
  color: #14532d;
  background: #dcfce7;
}

.state-jira {
  color: #1e293b;
  background: #e0f2fe;
}

.upset-table td.upset-cell {
  text-align: center;
}

.upset-row {
  cursor: pointer;
}

.upset-row:hover {
  background: #f8fafc;
}

.upset-dot {
  display: inline-block;
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 999px;
  border: 1px solid #94a3b8;
  background: #ffffff;
}

.upset-dot-on {
  border-color: #0f766e;
  background: #14b8a6;
}

.dashboard-upset-plot {
  margin-top: 0.45rem;
}

.dashboard-upset-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.15rem;
  max-height: clamp(190px, 40vh, 320px);
}

.dashboard-upset-svg {
  display: block;
  width: auto;
  min-width: 0;
  max-width: none;
  height: auto;
  max-height: clamp(190px, 40vh, 320px);
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5fb 100%);
  border: 1px solid #d7e0ea;
  border-radius: 10px;
}

.dashboard-upset-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  padding: 0.85rem;
  font-size: 0.84rem;
}

.dashboard-upset-axis-label {
  fill: #334155;
  font-size: 10px;
  font-weight: 600;
}

.dashboard-upset-axis-hint {
  fill: #475569;
  font-size: 10px;
}

.dashboard-upset-axis-count {
  fill: #64748b;
  font-size: 10px;
  font-weight: 600;
}

.dashboard-upset-axis-label-clickable {
  cursor: pointer;
}

.dashboard-upset-axis-label-clickable:hover,
.dashboard-upset-axis-label-clickable:focus {
  fill: #0f766e;
  text-decoration: underline;
}

.dashboard-upset-matrix-guide {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.dashboard-upset-bar-axis {
  stroke: #cbd5e1;
  stroke-width: 1;
}

.dashboard-upset-highlight {
  fill: #dbeafe;
  opacity: 0;
}

.dashboard-upset-bar {
  fill: #2563eb;
  opacity: 0.84;
}

.dashboard-upset-count {
  fill: #1e293b;
  font-size: 10px;
  font-weight: 600;
  text-anchor: middle;
}

.dashboard-upset-connector {
  stroke: #60a5fa;
  stroke-width: 2;
  stroke-linecap: round;
}

.dashboard-upset-dot {
  fill: #ffffff;
  stroke: #94a3b8;
  stroke-width: 1.2;
}

.dashboard-upset-dot-on {
  fill: #1d4ed8;
  stroke: #1d4ed8;
}

.dashboard-upset-hit {
  fill: transparent;
  cursor: pointer;
}

.dashboard-upset-column.is-active .dashboard-upset-highlight,
.dashboard-upset-column:focus-within .dashboard-upset-highlight {
  opacity: 0.56;
}

.dashboard-upset-column.is-active .dashboard-upset-bar,
.dashboard-upset-column:focus-within .dashboard-upset-bar {
  fill: #0f766e;
  opacity: 1;
}

.dashboard-upset-column.is-active .dashboard-upset-connector,
.dashboard-upset-column:focus-within .dashboard-upset-connector {
  stroke: #0d9488;
}

.dashboard-upset-column.is-active .dashboard-upset-dot-on,
.dashboard-upset-column:focus-within .dashboard-upset-dot-on {
  fill: #0f766e;
  stroke: #0f766e;
}

@media (max-width: 1080px) {
  .dashboard-grid-shell {
    flex-direction: column;
  }

  .dashboard-block-scale {
    flex-basis: auto;
    width: 100%;
  }

  .dashboard-block-scale-body {
    min-height: 8rem;
  }
}

.viz-shell {
  border: 1px solid #d7e0ea;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  padding: 0.75rem;
}

.viz-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.viz-header h2,
.viz-header h3 {
  margin: 0;
}

.viz-header p {
  margin: 0;
}

.viz-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  margin: 0.45rem 0 0.5rem;
}

.viz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: #334155;
}

.viz-legend-swatch {
  width: 0.9rem;
  height: 0.34rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #94a3b8;
}

.viz-legend-swatch-primary {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.viz-legend-swatch-secondary {
  background: #0f766e;
  border-color: #0f766e;
}

.viz-legend-swatch-danger {
  background: #b91c1c;
  border-color: #b91c1c;
}

.viz-legend-swatch-muted {
  background: #64748b;
  border-color: #64748b;
}

.viz-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem 0.9rem;
  flex-wrap: wrap;
  margin: 0.4rem 0 0.58rem;
}

.viz-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.viz-chart-wrap {
  position: relative;
}

.viz-chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  background: linear-gradient(180deg, #f9fbff 0%, #f1f5fb 100%);
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  touch-action: pan-y pinch-zoom;
}

.viz-chart-loading {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  color: #334155;
  font-size: 0.76rem;
  line-height: 1;
  padding: 0.45rem 0.7rem;
}

.viz-chart-loading[hidden] {
  display: none;
}

.viz-spinner {
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: viz-spinner-rotate 0.8s linear infinite;
}

@keyframes viz-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.viz-tooltip {
  position: absolute;
  z-index: 3;
  max-width: min(240px, calc(100% - 1rem));
  border: 1px solid #c6d2e3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
  color: #0f172a;
  font-size: 0.76rem;
  line-height: 1.35;
  padding: 0.36rem 0.5rem;
  pointer-events: none;
}

.viz-focus-guide {
  stroke: #94a3b8;
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
  pointer-events: none;
}

.viz-focus-point {
  fill: #1d4ed8;
  stroke: #ffffff;
  stroke-width: 1.8;
  pointer-events: none;
}

.viz-series-line {
  stroke-width: 2.6;
}

.viz-series-line-primary {
  stroke: #1d4ed8;
}

.viz-series-line-secondary {
  stroke: #0f766e;
}

.viz-series-line-danger {
  stroke: #b91c1c;
}

.viz-interactive-point {
  fill: #1d4ed8;
  stroke: #ffffff;
  stroke-width: 1.3;
  cursor: pointer;
  opacity: 0.88;
  vector-effect: non-scaling-stroke;
  transition: opacity 110ms ease, stroke-width 110ms ease, filter 110ms ease;
}

.viz-interactive-point:hover,
.viz-interactive-point:focus-visible {
  opacity: 1;
  stroke-width: 2.2;
  filter: drop-shadow(0 0 1px rgba(30, 64, 175, 0.35));
}

.metrics-time-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.8rem;
  margin-top: 0.55rem;
}

.metrics-time-controls label {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.84rem;
}

.compare-more-filters-group {
  display: grid;
  gap: 0.45rem;
  min-width: 260px;
}

.compare-more-filters-toggle {
  justify-self: start;
}

.compare-more-filters-panel {
  display: grid;
  gap: 0.55rem;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.48rem 0.52rem;
}

.compare-more-filters-panel[hidden] {
  display: none;
}

.compare-compute-host-control {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.compare-compute-host-control input {
  width: 100%;
  min-width: 0;
}

.compare-more-filters-panel .modality-filter {
  width: 100%;
}

.compute-host-quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.compute-host-chip {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 999px;
  padding: 0.16rem 0.52rem;
  font-size: 0.74rem;
  line-height: 1.25;
  color: #0f172a;
  cursor: pointer;
  max-width: min(100%, 320px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.compute-host-chip:hover,
.compute-host-chip:focus-visible {
  border-color: #94a3b8;
  background: #f8fafc;
}

.compute-host-chip.is-selected {
  border-color: #0f172a;
  background: #0f172a;
  color: #ffffff;
}

.compute-host-more-toggle {
  font-size: 0.73rem;
  line-height: 1.2;
  padding: 0.14rem 0.48rem;
}

.compute-host-other-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.compute-host-other-panel[hidden] {
  display: none;
}

.commit-finder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  gap: 0.55rem 0.8rem;
  width: 100%;
}

.commit-finder-card {
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  padding: 0.58rem 0.64rem;
  border: 1px solid #d7e1ec;
  border-radius: 9px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fc 100%);
}

.commit-finder-card label {
  margin: 0;
}

.commit-finder-heading {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.commit-finder-search {
  font-size: 0.82rem;
  width: 100%;
}

.commit-finder-meta {
  min-height: 1.1rem;
  line-height: 1.35;
}

.metrics-time-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.metrics-time-actions .form-dirty-notice {
  margin: 0;
}

.metrics-time-actions .filters-apply-button {
  min-width: 11rem;
}

.secondary-button {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 6px;
  padding: 0.34rem 0.58rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.metrics-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.metrics-time-card {
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #fcfdff;
  padding: 0.72rem 0.72rem 0.58rem;
  min-width: 0;
}

.metrics-time-card h3 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}

.metrics-time-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.metrics-time-magnify-button {
  flex: 0 0 auto;
  font-size: 0.75rem;
  padding: 0.28rem 0.5rem;
}

.metrics-time-card p {
  margin: 0.24rem 0 0.36rem;
}

.metrics-time-card svg {
  width: 100%;
  height: auto;
  display: block;
  background: linear-gradient(180deg, #f9fbff 0%, #f1f5fb 100%);
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  touch-action: pan-y pinch-zoom;
}

.metrics-time-point-link,
.metrics-time-point-dot {
  cursor: pointer;
}

.metrics-time-card.metrics-time-card-magnified {
  grid-column: 1 / -1;
}

.metrics-time-combo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.15rem 0 0.55rem;
}

.metrics-time-upset-plot {
  margin-bottom: 0.35rem;
}

.metrics-time-upset-column-inactive {
  opacity: 0.36;
}

.eval-block-timeseries-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

.eval-gospa-scale-card {
  margin-top: 0.6rem;
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5fb 100%);
  padding: 0.6rem 0.7rem;
  display: grid;
  gap: 0.45rem;
}

.eval-gospa-scale-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.eval-gospa-scale-header h2 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e293b;
}

.eval-gospa-scale-legend {
  display: grid;
  gap: 0.3rem;
}

.eval-gospa-scale-track {
  height: 0.95rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

.eval-gospa-scale-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
  align-items: center;
}

.eval-gospa-scale-value {
  font-size: 0.73rem;
  color: #334155;
  line-height: 1.2;
  white-space: nowrap;
}

.eval-gospa-scale-value:nth-child(2) {
  text-align: center;
}

.eval-gospa-scale-value:nth-child(3) {
  text-align: right;
}

.branch-compare-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  padding: 0.12rem 0.48rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.branch-compare-status-regressed {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.branch-compare-status-improved {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.branch-compare-status-unchanged {
  background: #e2e8f0;
  color: #334155;
  border-color: #cbd5e1;
}

.branch-compare-status-new_in_compare {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.branch-compare-status-missing_from_compare {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.branch-compare-status-no_data {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.branch-compare-status-inconclusive {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.branch-compare-delta-regressed {
  color: #b91c1c;
  font-weight: 700;
}

.branch-compare-delta-improved {
  color: #166534;
  font-weight: 700;
}

.branch-compare-grid-block + .branch-compare-grid-block {
  margin-top: 1rem;
}

.branch-compare-grid-table .matrix-col-data {
  width: 26%;
}

.branch-compare-grid-cell {
  position: relative;
  overflow: hidden;
  vertical-align: top;
  padding: 0.1rem;
}

.branch-compare-grid-cell::before {
  content: attr(data-cell-number);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.14);
  pointer-events: none;
  z-index: 0;
}

.branch-compare-grid-cell::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.branch-compare-grid-cell > * {
  position: relative;
  z-index: 1;
}

.branch-compare-grid-cell-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-height: 6rem;
  padding: 0.44rem 0.46rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.56rem;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
  text-align: center;
}

.branch-compare-grid-cell-link:hover {
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px #bfdbfe;
}

.branch-compare-grid-status-link {
  text-decoration: none;
  border-radius: 6px;
  padding: 0.1rem 0.18rem;
}

.branch-compare-grid-status-link:hover {
  background: #eff6ff;
}

.branch-compare-grid-total-link {
  text-decoration: none;
  border-radius: 4px;
  padding: 0.04rem 0.18rem;
}

.branch-compare-grid-total-link:hover {
  background: #f1f5f9;
}

.branch-compare-grid-status {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 0.36rem;
  align-items: baseline;
  justify-content: center;
  line-height: 1.05;
}

.branch-compare-grid-status-label {
  font-size: 0.84rem;
  font-weight: 700;
}

.branch-compare-grid-status-value {
  font-size: 1.26rem;
  line-height: 1;
}

.branch-compare-grid-status-regressed {
  color: #991b1b;
}

.branch-compare-grid-status-improved {
  color: #166534;
}

.branch-compare-grid-status-unchanged {
  color: #334155;
}

.branch-compare-grid-total {
  margin-top: 0.14rem;
  font-size: 0.72rem;
}

.branch-compare-grid-stats {
  margin-top: 0.2rem;
  width: 100%;
  border-top: 1px dashed #cbd5e1;
  padding-top: 0.16rem;
  display: grid;
  gap: 0.12rem;
  line-height: 1.22;
}

.branch-compare-scatter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  align-items: center;
  margin: 0.35rem 0 0.52rem;
  font-size: 0.79rem;
  color: #334155;
}

.branch-compare-scatter-orientation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.45rem;
  margin: 0.3rem 0 0.36rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.branch-compare-scatter-orientation-left {
  color: #b91c1c;
  text-align: left;
}

.branch-compare-scatter-orientation-arrow {
  color: #475569;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.branch-compare-scatter-orientation-right {
  color: #15803d;
  text-align: right;
}

.branch-compare-scatter-wrap {
  max-width: 860px;
  margin: 0 auto;
}

.branch-compare-scatter-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.branch-compare-scatter-swatch {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-block;
}

.branch-compare-scatter-swatch-regressed {
  background: #ef4444;
  border-color: #dc2626;
}

.branch-compare-scatter-swatch-improved {
  background: #22c55e;
  border-color: #16a34a;
}

.branch-compare-scatter-swatch-unchanged {
  background: #64748b;
  border-color: #475569;
}

.branch-compare-scatter-grid {
  stroke: #dbe5f1;
  stroke-width: 1;
}

.branch-compare-scatter-axis {
  stroke: #64748b;
  stroke-width: 1.2;
}

.branch-compare-scatter-parity {
  stroke: #334155;
  stroke-width: 1.45;
  stroke-dasharray: 7 5;
}

.branch-compare-scatter-label {
  fill: #1e293b;
  font-size: 12px;
  font-weight: 600;
}

.branch-compare-scatter-region-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.94);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.branch-compare-scatter-region-label-regressed {
  fill: #b91c1c;
}

.branch-compare-scatter-region-label-improved {
  fill: #15803d;
}

.branch-compare-scatter-tick {
  fill: #475569;
  font-size: 11px;
}

.branch-compare-scatter-empty {
  fill: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.branch-compare-scatter-point {
  stroke: #ffffff;
  stroke-width: 1.4;
  opacity: 0.88;
  cursor: pointer;
  vector-effect: non-scaling-stroke;
  transition: opacity 110ms ease, stroke-width 110ms ease, filter 110ms ease;
}

.branch-compare-scatter-point:hover,
.branch-compare-scatter-point:focus-visible {
  opacity: 1;
  stroke-width: 2;
  filter: drop-shadow(0 0 5px rgba(15, 23, 42, 0.25));
}

.branch-compare-scatter-point-regressed {
  fill: #dc2626;
}

.branch-compare-scatter-point-improved {
  fill: #16a34a;
}

.branch-compare-scatter-point-unchanged {
  fill: #64748b;
}

.branch-compare-scatter-point-no_data {
  fill: #64748b;
}

.paired-stats-card h2 {
  margin-bottom: 0.35rem;
}

.paired-chart-wrap {
  max-width: 860px;
  margin: 0.35rem auto 0;
}

.paired-chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.paired-chart-axis {
  stroke: #64748b;
  stroke-width: 1.2;
}

.paired-chart-grid {
  stroke: #d1d9e3;
  stroke-width: 1;
}

.paired-chart-bar {
  fill: #60a5fa;
  opacity: 0.88;
}

.paired-chart-line {
  stroke: #1d4ed8;
  stroke-width: 2.2;
}

.paired-chart-current-n {
  stroke: #dc2626;
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.paired-chart-empty {
  fill: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.paired-chart-tick {
  fill: #64748b;
  font-size: 11px;
}

.paired-chart-axis-label {
  fill: #475569;
  font-size: 11px;
  font-weight: 600;
}

.paired-confidence-label-high {
  color: #166534;
}

.paired-confidence-label-medium {
  color: #854d0e;
}

.paired-confidence-label-low {
  color: #991b1b;
}

.paired-grid-block + .paired-grid-block {
  margin-top: 0.95rem;
}

.paired-grid-cell {
  vertical-align: top;
  padding: 0.3rem;
}

.paired-grid-cell-content {
  display: grid;
  gap: 0.3rem;
  min-height: 6rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.45rem;
  background: #ffffff;
  font-size: 0.76rem;
  line-height: 1.2;
}

.paired-grid-metric {
  display: grid;
  gap: 0.16rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  padding: 0.3rem 0.34rem;
  background: rgba(255, 255, 255, 0.82);
}

.paired-grid-metric-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334155;
}

.paired-grid-metric-power-sufficient {
  border-color: #86efac;
}

.paired-grid-metric-power-moderate {
  border-color: #fcd34d;
}

.paired-grid-metric-power-insufficient {
  border-color: #fca5a5;
}

.paired-grid-metric-sufficiency-sufficient {
  background: #f0fdf4;
}

.paired-grid-metric-sufficiency-moderate {
  background: #fefce8;
}

.paired-grid-metric-sufficiency-insufficient {
  background: #fef2f2;
}

.paired-grid-cell-power-sufficient .paired-grid-cell-content {
  border-color: #86efac;
}

.paired-grid-cell-power-moderate .paired-grid-cell-content {
  border-color: #fcd34d;
}

.paired-grid-cell-power-insufficient .paired-grid-cell-content {
  border-color: #fca5a5;
}

.paired-grid-cell-sufficiency-sufficient .paired-grid-cell-content {
  background: #dcfce7;
}

.paired-grid-cell-sufficiency-moderate .paired-grid-cell-content {
  background: #fef9c3;
}

.paired-grid-cell-sufficiency-insufficient .paired-grid-cell-content {
  background: #fee2e2;
}

.paired-influence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  text-transform: capitalize;
}

.paired-influence-neutral {
  background: #e2e8f0;
  color: #334155;
}

.paired-influence-moderate {
  background: #fef9c3;
  color: #854d0e;
}

.paired-influence-strong {
  background: #fee2e2;
  color: #991b1b;
}

.scenario-metrics-warning-banner {
  margin-bottom: 0.7rem;
}

.scenario-metrics-warning-banner ul {
  margin: 0.45rem 0 0;
}

.scenario-metrics-warning-banner li + li {
  margin-top: 0.18rem;
}

.eval-block-timeseries-cell {
  min-height: 16.5rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.eval-block-timeseries-cell h3 {
  font-size: 0.78rem;
}

.eval-block-timeseries-cell::before {
  content: attr(data-cell-number);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.35rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.12);
  pointer-events: none;
  z-index: 0;
}

.eval-block-timeseries-cell::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.33);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.eval-block-timeseries-cell > * {
  position: relative;
  z-index: 1;
}

.eval-block-timeseries-chart-wrap svg {
  min-height: 12.2rem;
}

.eval-block-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.eval-block-modal[hidden] {
  display: none;
}

.eval-block-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: rgba(2, 6, 23, 0.56);
  cursor: pointer;
}

.eval-block-modal-panel {
  position: relative;
  width: min(1100px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 1px solid #d5dee8;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 26px 56px rgba(2, 6, 23, 0.28);
  padding: 0.8rem;
}

.eval-block-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}

.eval-block-modal-header h2 {
  margin: 0;
}

body.modal-open {
  overflow: hidden;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.history-branch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 0.45rem 0 0.15rem;
}

.history-branch-legend[hidden] {
  display: none;
}

.history-branch-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: #334155;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #ffffff;
  padding: 0.14rem 0.46rem;
  transition: opacity 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.history-branch-legend-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  flex: 0 0 auto;
}

.history-branch-legend-item-value {
  color: #64748b;
  font-size: 0.69rem;
}

.history-branch-legend-item.is-muted {
  opacity: 0.55;
}

.history-branch-legend-item.is-active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.history-tooltip-branch {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.75rem;
  color: #1e293b;
}

.history-tooltip-branch-swatch {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.3);
  flex: 0 0 auto;
}

.history-branch-point-hit {
  fill: transparent;
  cursor: pointer;
}

.history-branch-point-hit:focus-visible {
  fill: rgba(37, 99, 235, 0.12);
  stroke: #2563eb;
  stroke-width: 1.1;
}

.history-branch-point-dot {
  pointer-events: none;
  transition: stroke-width 120ms ease, filter 120ms ease;
}

.history-branch-point-dot.is-active {
  stroke-width: 1.4;
  filter: drop-shadow(0 0 2px rgba(15, 23, 42, 0.24));
}

.history-focus-point-branch {
  stroke: #ffffff;
  stroke-width: 1.8;
}

.scenario-history-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 0.95rem;
  align-items: start;
}

.scenario-history-panel,
.scenario-modality-panel {
  min-width: 0;
}

#scenario-history-chart {
  width: 100%;
  height: auto;
  background: #f8fafc;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
}

#scenario-modality-observation-chart {
  width: 100%;
  height: auto;
  background: #f8fafc;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
}

.scenario-note {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.7rem;
  margin-bottom: 0.8rem;
}

.scenario-note h3 {
  margin: 0 0 0.35rem;
}

.scenario-note-form {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.scenario-note-form textarea {
  width: 100%;
  min-width: 0;
}

.scenario-note-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
}

.scenario-note-body {
  white-space: pre-wrap;
  margin: 0 0 0.4rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-badge-ok {
  background: #dcfce7;
  color: #166534;
}

.status-badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.scenario-data-clean-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.scenario-data-clean-panel {
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.65rem;
}

.scenario-data-clean-panel-full {
  margin: 0 0 0.72rem;
}

.scenario-data-clean-panel h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.scenario-data-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.comment-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.6rem;
}

.comment-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f9fafb;
  padding: 0.6rem 0.7rem;
}

.comment-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.25rem;
}

.comment-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.comment-card p {
  white-space: pre-wrap;
  margin: 0.3rem 0 0.55rem;
}

.comment-edit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.comment-edit-form textarea {
  flex: 1;
  min-width: 220px;
}

.comment-delete-form {
  margin: 0;
}

.json-panel {
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
  margin-bottom: 0.65rem;
}

.json-panel > summary {
  cursor: pointer;
  padding: 0.5rem 0.65rem;
  font-weight: 600;
  color: #0f172a;
}

.json-panel[open] > summary {
  border-bottom: 1px solid #dbe4ee;
}

.json-view {
  margin: 0;
  padding: 0.65rem;
  max-height: 460px;
  overflow: auto;
  font-size: 0.77rem;
  line-height: 1.4;
  white-space: pre;
  background: #f8fafc;
  border-radius: 0 0 8px 8px;
}

.notice {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
}

.notice.success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.notice.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.notice.warning {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.loading-bar {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #e2e8f0;
  color: #ffffff;
  padding: 0.25rem 0.5rem;
}

.loading-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(226, 232, 240, 0) 0%,
    rgba(148, 163, 184, 0.35) 45%,
    rgba(226, 232, 240, 0) 100%
  );
  animation: loading-bar-slide 1.2s ease-in-out infinite;
}

@keyframes loading-bar-slide {
  to {
    transform: translateX(100%);
  }
}

.app-footer {
  border-top: 1px solid #1e293b;
  background: #0f172a;
  color: #dbeafe;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  padding: 1.22rem 1.1rem 0.85rem;
  font-size: 0.78rem;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  box-shadow: 0 -3px 12px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.app-footer.is-context-muted {
  border-top-color: #4b5563;
  background: #374151;
  color: #e5e7eb;
}

.app-footer.is-context-muted::before {
  background: #6b7280;
}

.app-footer.is-context-muted strong {
  color: #f3f4f6;
}

.app-footer.is-context-muted a {
  color: #f3f4f6;
}

.app-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 20px;
  background: var(--context-bar-bg);
}

.app-footer > * {
  position: relative;
  z-index: 1;
}

.app-footer strong {
  color: #f8fafc;
}

.app-footer a {
  color: #bfdbfe;
  text-decoration: none;
}

.app-footer a:hover,
.app-footer a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 1200px) {
  .dashboard-controls {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .dashboard-controls > .modality-filter {
    grid-column: 1 / -1;
  }

  .dashboard-controls > .modality-filter[data-modality-filter-label="Modalities"],
  .dashboard-controls > .modality-filter[data-modality-filter-label="Tags"] {
    grid-row: auto;
  }

  .dashboard-more-filters-group {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .dashboard-controls-submit {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: start;
    margin-bottom: 0;
  }

  .scenario-history-layout {
    grid-template-columns: 1fr;
  }

  .filters-row-modality {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }

  .filters-row-modality .scenarios-modality-filter {
    grid-column: 1 / -1;
  }

  .eval-block-timeseries-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .dashboard-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-more-filters-panel {
    padding: 0.45rem;
  }

  .eval-block-timeseries-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .topbar-main,
  .topbar-menu {
    justify-self: start;
  }

  .topbar-context-strip {
    width: 100%;
    gap: 0.4rem 0.55rem;
  }

  .topbar-menu {
    flex-wrap: wrap;
  }

  .topbar-auth-center {
    justify-self: start;
  }

  .topbar-status {
    font-size: 0.72rem;
  }

  .topbar-branch,
  .topbar-source,
  .topbar-fe-config,
  .topbar-c2-runtime,
  .topbar-dataset-group,
  .topbar-compare-match {
    align-self: stretch;
  }

  .topbar-context-toggle {
    min-width: 0;
    width: 100%;
  }

  .topbar-dataset-group-select {
    min-width: 0;
    width: 100%;
  }

  .topbar-context-panel {
    width: min(420px, calc(100vw - 2.2rem));
  }

  .topbar-refresh {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    align-self: auto;
  }

  .topbar-nav {
    left: 0;
    right: auto;
    min-width: min(340px, calc(100vw - 2.2rem));
    max-height: min(82vh, 540px);
  }

  .matrix-table,
  .data-table {
    font-size: 0.78rem;
  }

  textarea {
    min-width: 220px;
  }

  .modality-filter {
    min-width: 220px;
  }

  .modality-filter-panel {
    width: min(340px, calc(100vw - 2.5rem));
  }

  .modality-filter[data-modality-filter-label="Tags"] .modality-filter-panel {
    width: min(440px, calc(100vw - 2.5rem));
    max-height: min(56vh, 420px);
  }

  .modality-filter[data-modality-filter-label="Dataset Groups"] .modality-filter-panel {
    width: min(440px, calc(100vw - 2.5rem));
    max-height: min(56vh, 420px);
  }

  .filters-field-search {
    grid-column: auto;
  }

  .filters-row,
  .filters-row-modality {
    grid-template-columns: 1fr;
  }

  .filters-actions {
    justify-content: flex-start;
  }

  .metrics-time-grid {
    grid-template-columns: 1fr;
  }

  .metrics-time-controls {
    align-items: stretch;
  }

  .metrics-time-controls label {
    min-width: 220px;
  }

  .compare-more-filters-group {
    width: 100%;
    min-width: 0;
  }

  .compare-more-filters-panel {
    min-width: 0;
  }

  .commit-finder-grid {
    grid-template-columns: 1fr;
  }

  .metrics-time-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .viz-header {
    align-items: stretch;
  }

  .viz-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .viz-toolbar label {
    font-size: 0.82rem;
  }

  .viz-tooltip {
    font-size: 0.8rem;
    max-width: min(260px, calc(100% - 0.75rem));
  }
}

@media (max-width: 640px) {
  .topbar {
    border-left-width: 10px;
    padding: 0.44rem 0.58rem;
    gap: 0.32rem;
  }

  .topbar-main {
    gap: 0.22rem;
  }

  .brand {
    font-size: 0.86rem;
  }

  .topbar-status,
  .topbar-branch-meta,
  .topbar-source-meta,
  .topbar-c2-runtime-meta,
  .topbar-dataset-group-meta,
  .topbar-context-lock-note,
  .topbar-refresh-status {
    display: none;
  }

  .topbar-branch label,
  .topbar-source label,
  .topbar-fe-config label,
  .topbar-c2-runtime label,
  .topbar-dataset-group label,
  .topbar-compare-match label {
    display: none;
  }

  .topbar-auth-center {
    font-size: 0.72rem;
  }

  .topbar-menu {
    gap: 0.28rem;
  }

  .topbar-primary-nav {
    gap: 0.2rem;
  }

  .topbar-primary-nav a {
    padding: 0.3rem 0.44rem;
    font-size: 0.75rem;
  }

  .topbar-menu-toggle {
    font-size: 0.74rem;
    padding: 0.3rem 0.44rem;
  }

  .topbar-branch-control,
  .topbar-source-control,
  .topbar-fe-config-control,
  .topbar-c2-runtime-control,
  .topbar-dataset-group-control,
  .topbar-compare-match-control {
    width: 100%;
  }

  .topbar-context-toggle,
  .topbar-lock-toggle,
  .topbar-dataset-group-select {
    width: 100%;
    padding: 0.24rem 0.46rem;
    font-size: 0.74rem;
    border-radius: 7px;
  }

  .topbar-context-panel {
    width: min(340px, calc(100vw - 1.2rem));
    max-height: min(68vh, 420px);
  }

  .topbar-refresh {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
  }

  .topbar-nav {
    max-height: min(78vh, 420px);
  }

  .topbar-refresh-button {
    padding: 0.22rem 0.5rem;
    font-size: 0.72rem;
  }

  .topbar-help-toggle {
    min-width: 0;
    padding: 0.2rem 0.48rem;
    font-size: 0.68rem;
  }

  .app-footer {
    gap: 0.22rem 0.42rem;
    padding: 0.5rem 0.62rem 0.42rem;
    font-size: 0.68rem;
  }

  .app-footer::before {
    height: 9px;
  }

  .app-footer > span:nth-of-type(1),
  .app-footer > span:nth-of-type(3) {
    display: none;
  }

  .app-footer > span {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
