.population-throughput-chart {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 4px 2px;
  -webkit-overflow-scrolling: touch;
}

.population-throughput-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(88px, 1fr);
  align-items: start;
  gap: 8px;
}

.population-throughput-bar-item {
  display: grid;
  grid-template-rows: 18px 156px 34px 15px;
  gap: 5px;
  min-width: 0;
}

.population-throughput-value,
.population-throughput-meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.1;
  text-align: center;
}

.population-throughput-stage {
  position: relative;
  align-self: end;
  height: 156px;
  border-bottom: 2px solid var(--ink);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.08) 1px, transparent 1px) 0 0 / 100% 39px;
}

.population-throughput-bar {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  width: min(44px, 58%);
  transform: translateX(-50%);
  border: 1px solid rgba(0, 0, 0, 0.55);
  background: rgba(156, 29, 29, 0.34);
}

.population-throughput-error {
  position: absolute;
  left: 50%;
  bottom: var(--err-bottom);
  z-index: 2;
  width: 22px;
  height: var(--err-height);
  min-height: 7px;
  transform: translateX(-50%);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.population-throughput-error::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: var(--ink);
}

.population-throughput-error.is-single-run {
  min-height: 0;
  border-bottom: 0;
}

.population-throughput-label {
  min-width: 0;
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 30px;
}

.population-throughput-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.35;
}

.population-metric-rankings {
  gap: 12px;
}

.population-metric-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.population-compact-chart {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--soft);
  background: #fbfbf8;
}

.population-compact-chart h5 {
  margin: 0;
  font-size: var(--text-large);
  line-height: 1.2;
  text-align: center;
}

.population-compact-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(68px, 1fr);
  align-items: end;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 0 2px 3px;
  -webkit-overflow-scrolling: touch;
}

.population-compact-bar-item {
  display: grid;
  grid-template-rows: 18px 126px 34px 15px;
  gap: 5px;
  min-width: 0;
}

.population-compact-value {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.population-compact-stage {
  position: relative;
  align-self: end;
  height: 126px;
  border-bottom: 2px solid var(--ink);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.06) 1px, transparent 1px) 0 0 / 100% 31px;
}

.population-compact-bar {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  width: min(38px, 56%);
  transform: translateX(-50%);
  border: 1px solid rgba(0, 0, 0, 0.48);
  background: rgba(55, 90, 92, 0.34);
}

.population-rotation-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.population-rotation-panel > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.population-rotation-panel h3 {
  margin: 0;
  font-size: var(--title-sm);
  line-height: 1.2;
}

.population-rotation-panel header span {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.population-rotation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.population-rotation-chart {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--soft);
  background: #fbfbf8;
}

.population-rotation-chart h4 {
  margin: 0;
  font-size: var(--text-large);
  line-height: 1.2;
}

.population-rotation-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.population-rotation-summary strong {
  font-size: var(--title-sm);
  line-height: 1.1;
}

.population-rotation-summary span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.population-histogram {
  display: grid;
  grid-template-columns: repeat(var(--histogram-bin-count, 12), minmax(0, 1fr));
  align-items: end;
  gap: 3px;
  height: 116px;
  padding: 6px 6px 0;
  border-left: 1px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.06) 1px, transparent 1px) 0 0 / 100% 29px;
}

.population-histogram-bin {
  display: block;
  min-height: 2px;
  border: 1px solid rgba(0, 0, 0, 0.42);
  background: rgba(156, 29, 29, 0.28);
}

.population-histogram-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.population-leader-panel,
.population-distribution-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.population-leader-panel > div {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, 2fr) auto;
  gap: 10px;
  align-items: center;
}

.population-panel-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.population-leader-panel strong {
  font-size: var(--title-sm);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.population-leader-panel span:last-child {
  color: var(--muted);
  font-size: var(--text-sm);
  text-align: right;
}

.population-distribution-panel > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.population-distribution-panel h3 {
  margin: 0;
  font-size: var(--title-sm);
}

.population-distribution-panel header span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.population-picker {
  display: grid;
  gap: 8px;
}

.population-picker > label {
  display: grid;
  gap: 4px;
}

.population-picker > label > span {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.population-picker input[type="search"] {
  min-height: 38px;
  border: 2px solid #000000;
  background: #ffffff;
  font-weight: 700;
}

.population-mouse-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding: 2px;
}

.population-mouse-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--rule);
  background: #fbfbfb;
  font-size: var(--text-sm);
}

.population-mouse-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.population-mouse-option b {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.population-empty {
  margin: 0;
  color: var(--muted);
}

.study-history-list {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.study-history-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--rule);
  background: #fff;
}

.study-history-card header {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.study-history-card header span,
.study-history-notes {
  color: var(--muted);
  font-size: var(--text-sm);
}

.study-history-card header strong {
  min-width: 0;
  font-size: var(--text-large);
  overflow-wrap: anywhere;
}

.study-history-meta,
.study-history-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
}

.study-history-meta span,
.study-history-notes span {
  overflow-wrap: anywhere;
}

.study-history-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 5px;
}

.study-history-metrics div {
  padding: 6px;
  border: 1px solid var(--soft);
  background: #f7f7f7;
}

.study-history-metrics b,
.study-history-metrics span {
  display: block;
}

.study-history-metrics b {
  font-family: var(--font-mono);
  font-size: var(--text-large);
}

.study-history-metrics span {
  color: var(--muted);
  font-size: var(--text-xs);
}

@media (max-width: 860px) {
  .population-leader-panel > div {
    grid-template-columns: 1fr;
  }

  .population-leader-panel span:last-child {
    text-align: left;
  }

}

@media (max-width: 560px) {
  .population-relative-card > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .population-relative-card > header span {
    text-align: left;
  }

  .population-summary-grid {
    grid-template-columns: 1fr;
  }

  .population-metric-leader-grid {
    grid-template-columns: 1fr;
  }

  .population-metric-task-grid {
    grid-template-columns: 1fr;
  }

  .population-throughput-panel > header {
    align-items: stretch;
    flex-direction: column;
  }

  .population-throughput-tabs {
    justify-content: stretch;
  }

  .population-throughput-tabs button {
    flex: 1 1 30%;
  }

  .population-throughput-chart-wrap {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .population-throughput-y-axis {
    height: 179px;
    padding-top: 18px;
  }

  .population-throughput-bars {
    grid-auto-columns: 76px;
  }

  .population-metric-chart-grid {
    grid-template-columns: 1fr;
  }

  .population-compact-bars {
    grid-auto-columns: 72px;
  }

  .population-rotation-panel > header {
    align-items: stretch;
    flex-direction: column;
  }

  .population-rotation-grid {
    grid-template-columns: 1fr;
  }

  .population-mouse-options {
    grid-template-columns: 1fr;
    max-height: 260px;
  }

}

.heatmap-stack {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.heatmap-group {
  min-width: 0;
  max-width: 100%;
  margin-top: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.condition-heatmaps {
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  border-top: 1px solid var(--rule);
  background: #fbfbfb;
}

.condition-heatmaps h4 {
  margin: 0 0 10px;
  padding: 0 0 5px;
  color: #000000;
  font-size: var(--text-table);
  font-weight: 700;
  line-height: 1.25;
  border-bottom: 1px solid var(--soft);
  background: transparent;
}

.heatmap-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: var(--text-table);
  background: #f7f7f7;
}

.heatmap-title span {
  min-width: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.heatmap-title b {
  min-width: 0;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.heatmap-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.heatmap-legend {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 6px 8px;
  margin: 8px 0;
  padding: 8px;
  border: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  background: #ffffff;
}

.heatmap-legend span {
  min-width: 0;
  white-space: nowrap;
}

.heatmap-gradient {
  display: block;
  min-width: 120px;
  height: 12px;
  border: 1px solid var(--rule);
  font-style: normal;
}

.cpi-heatmap {
  display: grid;
  grid-template-columns: 38px repeat(11, minmax(0, 1fr));
  gap: 1px;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  padding: 8px 10px 10px;
  background: #ffffff;
}

.heatmap-axis,
.heatmap-cell {
  min-width: 0;
  min-height: 22px;
  padding: 3px 2px;
  border: 1px solid var(--rule);
  overflow: hidden;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
}

.heatmap-axis {
  color: #000000;
  font-weight: 700;
  background: #eeeeee;
}

.heatmap-corner {
  font-size: 9px;
}

.trajectory-launch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.trajectory-launch span {
  color: var(--muted);
  font-size: var(--text-table);
}

.trajectory-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  height: 30px;
  padding: 4px 9px;
  border: 1px solid #000000;
  color: #000000;
  font-size: var(--text-table);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  background: #eeeeee;
  box-shadow: var(--button-shadow-small);
}

.trajectory-open:visited {
  color: #000000;
}

.trajectory-open:hover,
.trajectory-open:focus-visible {
  color: #000000;
  background: var(--button-hover);
}

.trajectory-body {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 7px;
  padding: 8px;
}

.trajectory-inline-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.trajectory-inline-panel[hidden] {
  display: none;
}

.trajectory-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

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

.trajectory-control-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  font-size: var(--text-body);
  font-weight: 700;
  line-height: 1.25;
}

.trajectory-controls output {
  display: inline-block;
  min-width: 5.8em;
  font-family: var(--font-mono);
  font-size: var(--text-table);
  font-weight: 400;
  text-align: right;
}

.trajectory-controls input[type="range"] {
  width: 100%;
  height: 34px;
  padding: 0;
  border: 0;
  accent-color: #000000;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.trajectory-controls input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border: 0;
  background: #000000;
}

.trajectory-controls input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 26px;
  margin-top: -11.5px;
  border: 1px solid #000000;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: #ffffff;
}

.trajectory-controls input[type="range"]::-moz-range-track {
  height: 3px;
  border: 0;
  background: #000000;
}

.trajectory-controls input[type="range"]::-moz-range-progress {
  height: 3px;
  background: #000000;
}

.trajectory-controls input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 26px;
  border: 1px solid #000000;
  border-radius: 0;
  background: #ffffff;
}

.trajectory-controls input[type="range"]:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 3px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: -1px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.trajectory-profile-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  gap: 4px 12px;
  margin: 0;
  padding: 6px 7px;
  border: 1px solid var(--rule);
}

.trajectory-profile-picker legend {
  padding: 0 4px;
  font-size: var(--text-table);
  font-weight: 700;
}

.trajectory-profile-picker label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin: 0;
  font-size: var(--text-table);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.trajectory-profile-picker input {
  width: auto;
  height: auto;
  margin: 0;
  accent-color: #000000;
}

.trajectory-randomize {
  min-height: 26px;
  height: 26px;
  margin-left: auto;
  padding: 2px 8px;
  font-size: var(--text-table);
}

.trajectory-plots {
  display: grid;
  min-height: 0;
  gap: 4px;
}

.trajectory-plot {
  position: relative;
  display: grid;
  min-height: 0;
  margin: 0;
}

.trajectory-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: min(380px, 50dvh);
  border: 1px solid var(--rule);
  background: #ffffff;
}

.trajectory-frame {
  fill: none;
  stroke: #d0d0d0;
  stroke-width: 1;
}

.trajectory-guide {
  fill: none;
  stroke: #eeeeee;
  stroke-width: 1;
}

.trajectory-path {
  fill: none;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 0.75;
}

.trajectory-shadow {
  opacity: 0.12;
}

.trajectory-live {
  animation: trajectory-draw var(--trajectory-duration, 1s) linear infinite;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.trajectory-ideal {
  stroke: #000000;
}

.trajectory-model {
  stroke: #9c1d1d;
  stroke-dasharray: 4 4;
}

.trajectory-live.trajectory-model {
  stroke-dasharray: 1;
  stroke-width: 0.9;
}

.trajectory-runner {
  animation: trajectory-runner-fade var(--trajectory-duration, 1s) linear infinite;
  vector-effect: non-scaling-stroke;
}

.trajectory-ideal-runner {
  fill: #000000;
  stroke: #ffffff;
  stroke-width: 0.7;
}

.trajectory-model-runner {
  fill: #9c1d1d;
  stroke: #ffffff;
  stroke-width: 0.9;
}

@keyframes trajectory-draw {
  from {
    stroke-dashoffset: 1;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes trajectory-runner-fade {
  0% {
    opacity: 0;
  }

  4%,
  96% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trajectory-live,
  .trajectory-runner {
    animation: none;
  }

  .trajectory-live {
    stroke-dashoffset: 0;
  }
}

.trajectory-legend-swatch {
  fill: none;
  stroke-linecap: square;
  stroke-width: 1.3;
}

.trajectory-legend-text {
  fill: #000000;
  font-family: var(--font-mono);
  font-size: 9.5px;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-linejoin: round;
  stroke-width: 2.6px;
}

.trajectory-separation {
  stroke-width: 0.9;
  vector-effect: non-scaling-stroke;
}

.trajectory-separation-max {
  stroke: #990000;
}

.trajectory-separation-end {
  stroke: #444444;
  stroke-dasharray: 2 2;
}

.trajectory-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-anchor: middle;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 3.8px;
  stroke-linejoin: round;
}

.trajectory-label-max {
  fill: #990000;
}

.trajectory-label-end {
  fill: #444444;
}

.trajectory-end {
  stroke: #000000;
  stroke-width: 0.8;
}

.trajectory-ideal-end {
  fill: #000000;
}

.trajectory-model-end {
  fill: #9c1d1d;
  stroke: #9c1d1d;
}

.trajectory-note {
  margin: 0;
  font-size: var(--text-xs);
}

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

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

.auth-required-modal[hidden] {
  display: none;
}

.study-result-modal[hidden] {
  display: none;
}

.trajectory-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100dvh;
  padding: 14px;
  overflow: hidden;
}

.terms-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100dvh;
  padding: 14px;
  overflow: hidden;
}

.auth-required-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100dvh;
  padding: 14px;
  overflow: hidden;
}

.study-result-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100dvh;
  padding: 14px;
  overflow: hidden;
}

.trajectory-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
}

.terms-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
}

.auth-required-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
}

.study-result-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
}

.trajectory-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(820px, calc(100vw - 28px));
  min-width: 0;
  height: min(820px, calc(100dvh - 28px));
  max-height: calc(100dvh - 28px);
  max-width: 100%;
  overflow: hidden;
  border: 2px solid #000000;
  background: #ffffff;
}

.terms-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(760px, 100%);
  min-width: 0;
  height: min(760px, calc(100dvh - 28px));
  max-height: calc(100dvh - 28px);
  max-width: 100%;
  overflow: hidden;
  border: 2px solid #000000;
  background: #ffffff;
}

.auth-required-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  max-width: calc(100vw - 28px);
  padding: 12px;
  border: 2px solid #000000;
  color: #000000;
  background: #ffffff;
  box-shadow: 4px 4px 0 #000000;
}

.study-result-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(720px, 100%);
  min-width: 0;
  max-height: calc(100dvh - 28px);
  max-width: 100%;
  overflow: hidden;
  border: 3px solid #000000;
  background: #ffffff;
  box-shadow: 5px 5px 0 #000000;
}

.trajectory-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--rule);
  background: #eeeeee;
}

.terms-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-bottom: 2px solid #000000;
  background: #eeeeee;
}

.study-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-bottom: 2px solid #000000;
  background: #eeeeee;
}

.auth-required-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid #000000;
}

.terms-dialog-header div {
  min-width: 0;
}

.auth-required-header div {
  min-width: 0;
}

.auth-required-header p {
  margin: 0 0 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.auth-required-header h2 {
  margin: 0;
  padding: 0;
  border: 0;
  color: #000000;
  font-size: var(--title-sm);
  line-height: 1.15;
  background: transparent;
}

.terms-dialog-header p,
.terms-updated {
  margin: 0 0 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
}

.terms-dialog-header h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: var(--title-md);
  line-height: 1.15;
  background: transparent;
}

.study-result-header h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: var(--title-md);
  line-height: 1.15;
  background: transparent;
}

.trajectory-dialog-header h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: var(--title-sm);
  line-height: 1.25;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
}

.trajectory-modal-close {
  height: 28px;
  padding: 3px 8px;
  font-size: var(--text-table);
}

.terms-modal-close {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 2px solid #000000;
  color: #000000;
  font-weight: 700;
  background: #ffffff;
}

.study-result-close {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 2px solid #000000;
  color: #000000;
  font-weight: 700;
  background: #ffffff;
}

.auth-required-close {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid #000000;
  color: #000000;
  font-size: var(--text-table);
  font-weight: 700;
  background: #ffffff;
}

.auth-required-copy {
  margin: 0;
  color: #000000;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.auth-required-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.auth-required-actions button {
  min-height: 32px;
  padding: 5px 12px;
  border: 2px solid #000000;
  color: #000000;
  font-weight: 800;
  background: #ffffff;
  box-shadow: var(--button-shadow-small);
}

.auth-required-actions button:hover,
.auth-required-actions button:focus-visible,
.auth-required-close:hover,
.auth-required-close:focus-visible {
  background: var(--button-hover);
}

.study-result-body {
  min-height: 0;
  padding: 12px;
  overflow: auto;
}

.study-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.study-throughput-preview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.study-result-validity {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #000000;
  background: #f4f4f4;
}

.study-result-validity strong {
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 800;
  line-height: 1;
}

.study-result-validity span {
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.3;
  text-align: right;
}

.study-result-validity.is-valid {
  background: #edf7ef;
}

.study-result-validity.is-invalid {
  background: #fff1f1;
}

.study-result-metric {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #000000;
  background: #ffffff;
}

.study-result-metric-wide {
  grid-column: 1 / -1;
}

.study-result-metric span {
  color: var(--muted);
  font-size: var(--text-table);
  font-weight: 700;
  line-height: 1.25;
}

.study-result-metric strong {
  color: #000000;
  font-family: var(--font-mono);
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 800;
  line-height: 1;
  overflow-wrap: anywhere;
}

.study-result-best-note {
  margin: 10px 0 0;
  color: #111111;
  font-size: var(--text-small);
  line-height: 1.35;
}

.study-result-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.study-result-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 12px;
  border: 2px solid #000000;
  color: #000000;
  font-size: var(--text-table);
  font-weight: 800;
  text-decoration: none;
  background: #ffffff;
}

.study-result-actions a:visited {
  color: #000000;
}

.terms-dialog-body {
  min-height: 0;
  padding: 12px;
  overflow: auto;
}

.terms-dialog-body section {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--soft);
}

.terms-dialog-body section:last-of-type {
  border-bottom: 0;
}

.terms-dialog-body h3 {
  margin: 0 0 7px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule);
  font-size: var(--title-sm);
  line-height: 1.2;
}

.terms-dialog-body p {
  margin-bottom: 10px;
}

.terms-full-link {
  margin: 2px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: var(--text-table);
}

.trajectory-dialog .trajectory-body {
  min-height: 0;
  overflow: hidden;
}

.trajectory-condition-picker {
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  margin: 0;
  padding: 6px 7px;
  border: 1px solid var(--rule);
}

.trajectory-condition-picker legend {
  padding: 0 4px;
  font-size: var(--text-table);
  font-weight: 700;
}

.trajectory-condition-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  gap: 5px 12px;
}

.trajectory-condition-group {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  min-width: 0;
  gap: 6px;
  align-items: start;
}

.trajectory-condition-label {
  padding-top: 4px;
  color: var(--muted);
  font-size: var(--text-table);
  font-weight: 700;
  line-height: 1.25;
}

.trajectory-condition-values {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 4px;
}

.trajectory-condition-option {
  width: auto;
  height: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid var(--rule);
  color: #000000;
  text-align: center;
  background: #ffffff;
  font-size: var(--text-sm);
  line-height: 1.25;
  box-shadow: none;
}

.trajectory-condition-option.active {
  outline: 2px solid #000000;
  outline-offset: -2px;
  background: #eeeeee;
}

.trajectory-condition-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.trajectory-condition-option:active {
  transform: none;
}

.measured-list {
  margin-top: 0;
  border: 1px solid var(--rule);
  border-bottom: 0;
}

.records-table-head {
  display: none !important;
}

.records-tabulator {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 8px;
  border: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: #000000;
  font-family: var(--font-sans);
  font-size: var(--text-table);
  background: #ffffff;
}

.records-tabulator.tabulator {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #ffffff;
}

.records-tabulator .tabulator-tableholder {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.records-tabulator .tabulator-table,
.records-tabulator .tabulator-row,
.records-tabulator .tabulator-header .tabulator-headers {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.records-tabulator .tabulator-header {
  border-bottom: 1px solid var(--rule);
  color: #000000;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  background: #eeeeee;
}

.records-tabulator .tabulator-header .tabulator-col {
  border-right: 1px solid var(--rule);
  background: #eeeeee;
}

.records-tabulator .tabulator-header .tabulator-col:last-child {
  border-right: 0;
}

.records-tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  padding: 6px 8px;
}

.records-tabulator .tabulator-header-filter {
  margin-top: 5px;
}

.records-tabulator .tabulator-header-filter input {
  width: 100%;
  min-height: 28px;
  margin: 0;
  padding: 4px 7px;
  border: 1px solid var(--rule);
  border-radius: 0;
  color: #000000;
  font-family: var(--font-sans);
  font-size: var(--text-table);
  font-weight: 650;
  background: #ffffff;
  box-shadow: none;
}

.records-tabulator .tabulator-col-resize-handle,
.records-tabulator .tabulator-col-resize-handle-prev {
  display: none;
}

.records-tabulator .tabulator-row {
  border-bottom: 1px solid var(--soft);
  color: #000000;
  background: #ffffff;
  cursor: default;
  overflow: visible;
}

.records-tabulator .tabulator-row.tabulator-row-even {
  background: #fafafa;
}

.records-tabulator .tabulator-row:hover,
.records-tabulator .tabulator-row.is-open {
  background: #eeeeee;
}

.records-tabulator .tabulator-cell {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 8px;
  border-right: 1px solid #e0e0e0;
  overflow: visible;
  white-space: normal;
}

.records-tabulator .records-number-cell {
  justify-content: center;
  text-align: center;
}

.records-tabulator .records-name-cell {
  cursor: pointer;
}

.records-tabulator .records-name-cell:hover .records-tabulator-model,
.records-tabulator .records-name-cell:focus-within .records-tabulator-model {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.records-tabulator .records-vote-score {
  color: #000000;
  font-family: var(--font-mono);
  font-size: var(--text-table);
  font-weight: 400;
  line-height: 1;
}

.records-tabulator .tabulator-cell:last-child {
  border-right: 0;
}

.records-tabulator .records-select-cell {
  justify-content: center;
  padding-right: 4px;
  padding-left: 4px;
  cursor: default;
}

.records-compare-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #000000;
  cursor: pointer;
}

.records-tabulator .tabulator-placeholder {
  min-height: 90px;
  color: var(--muted);
}

.records-tabulator .tabulator-footer {
  border-top: 1px solid var(--rule);
  color: #000000;
  font-family: var(--font-mono);
  font-size: var(--text-table);
  background: #ffffff;
}

.records-tabulator .tabulator-footer .tabulator-page {
  min-width: 32px;
  min-height: 28px;
  margin: 2px;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  color: #000000;
  font-family: var(--font-mono);
  font-weight: 700;
  background: #ffffff;
  box-shadow: var(--button-shadow-small);
}

.records-tabulator .tabulator-footer .tabulator-page.active {
  border-color: #000000;
  background: #eeeeee;
  box-shadow: inset 0 0 0 2px #000000;
}

.records-tabulator-name {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-width: 0;
}

.records-tabulator-name-text {
  display: grid;
  min-width: 0;
  line-height: 1.18;
}

.records-tabulator-brand {
  font-size: var(--text-table);
  font-weight: 800;
}

.records-tabulator-model {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--text-sm);
  font-weight: 650;
}

.records-tabulator-suffix {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

.record-raw-results {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 12px 0;
}

.record-raw-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.record-raw-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: var(--text-table);
}

.record-raw-table th,
.record-raw-table td {
  padding: 6px 7px;
  border-right: 1px solid var(--soft);
  border-bottom: 1px solid var(--soft);
  text-align: center;
  vertical-align: middle;
}

.record-raw-table th:last-child,
.record-raw-table td:last-child {
  border-right: 0;
}

.record-raw-table thead th {
  color: #000000;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  background: #eeeeee;
}

.record-raw-table tbody th {
  font-family: var(--font-mono);
  font-size: var(--text-table);
  font-weight: 800;
  background: #fafafa;
}

.record-condition-button {
  width: 100%;
  min-height: 28px;
  padding: 4px 5px;
  border: 1px solid var(--rule);
  color: #000000;
  font-family: var(--font-mono);
  font-size: var(--text-table);
  font-weight: 700;
  line-height: 1.1;
  background: #ffffff;
  box-shadow: var(--button-shadow-small);
}

.record-condition-button:hover,
.record-condition-button:focus-visible,
.record-condition-button.is-selected {
  border-color: #000000;
  background: #eeeeee;
}

.record-cpi-map-stage {
  min-height: 260px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.record-cpi-map-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
}

.record-cpi-map-panel h3 {
  margin: 0;
  border: 0;
  font-size: var(--title-xs);
  background: transparent;
}

.record-cpi-map-panel p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-table);
  font-weight: 700;
}

.record-cpi-map-placeholder p {
  color: #000000;
}

.cpi-heatmap-empty {
  background: #ffffff;
}

.cpi-heatmap-empty .heatmap-cell-empty {
  min-height: 22px;
  border-color: #d6d6d6;
  background: #fafafa;
}

@media (max-width: 620px) {
  .records-tabulator .tabulator-header {
    display: block;
  }

  .records-tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 5px 4px;
  }

  .records-tabulator .tabulator-header-filter input {
    min-height: 36px;
    font-size: 16px;
    line-height: 1.25;
  }

  .records-tabulator .tabulator-cell {
    min-height: 36px;
    padding: 5px 4px;
  }

  .records-tabulator .records-select-cell {
    padding-right: 2px;
    padding-left: 2px;
  }

  .records-tabulator-name {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .records-tabulator-brand {
    font-size: var(--text-xs);
  }

  .records-tabulator-model {
    font-size: var(--text-table);
  }

  .record-raw-table {
    min-width: 0;
    font-size: var(--text-xs);
  }

  .record-raw-table th,
  .record-raw-table td {
    padding: 4px 2px;
    overflow-wrap: anywhere;
  }

  .record-condition-button {
    min-height: 26px;
    padding: 2px 3px;
    font-size: var(--text-xs);
  }

  .record-cpi-map-stage {
    min-height: 230px;
  }
}

.records-compare-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0;
  padding: 7px 8px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.records-compare-toolbar[hidden] {
  display: none;
}

.records-compare-toolbar.is-empty {
  background: #fafafa;
}

.records-compare-toolbar span {
  color: var(--muted);
  font-size: var(--text-table);
  font-weight: 700;
}

.records-compare-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.records-compare-toolbar button {
  min-width: 48px;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid var(--rule);
  color: #000000;
  background: #ffffff;
  box-shadow: var(--button-shadow-small);
  font-size: var(--text-table);
  font-weight: 700;
  line-height: 1.25;
}

.records-compare-toolbar button:hover,
.records-compare-toolbar button:focus-visible {
  color: #000000;
  background: var(--button-hover);
  box-shadow: var(--button-shadow-small);
}

.records-compare-toolbar button:disabled {
  opacity: 0.45;
  cursor: default;
  background: #ffffff;
  box-shadow: var(--button-shadow-small);
}

.record-detail-modal[hidden] {
  display: none;
}

.record-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: grid;
  place-items: center;
  padding: 16px;
  overscroll-behavior: contain;
}

.record-detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
}

.record-detail-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(980px, 100%);
  max-height: min(86vh, 900px);
  border: 2px solid #000000;
  background: #ffffff;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.35);
  overflow: hidden;
  overscroll-behavior: contain;
}

.record-detail-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  background: #eeeeee;
}

.record-detail-dialog-header h2 {
  min-width: 0;
  margin: 0;
  border: 0;
  font-size: var(--title-sm);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
}

.record-detail-modal-close {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 8px;
  font-size: var(--text-table);
}

.record-detail-dialog-body {
  min-width: 0;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.records-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0 2px;
  padding: 8px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.records-pagination[hidden] {
  display: none;
}

.records-pagination button {
  width: auto;
  min-width: 32px;
  min-height: 30px;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  color: #000000;
  font-family: var(--font-mono);
  font-size: var(--text-table);
  font-weight: 700;
  background: #ffffff;
  box-shadow: var(--button-shadow-small);
}

.records-pagination button.active {
  border-color: #000000;
  background: #eeeeee;
  box-shadow: inset 0 0 0 2px #000000;
}

.records-pagination button:hover,
.records-pagination button:focus-visible {
  background: var(--button-hover);
}

.records-pagination button:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.records-pagination button:disabled {
  color: var(--muted);
  background: #f3f3f3;
  box-shadow: none;
  cursor: not-allowed;
}

.records-pagination-gap {
  padding: 0 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-table);
}

.measured-item {
  border-bottom: 1px solid var(--rule);
}

.compare-search-form {
  margin-top: 10px;
}

.compare-selector-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
}

.compare-selector-count {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-table);
}

.compare-selector-meta button {
  min-height: 28px;
  height: 28px;
  padding: 3px 8px;
  font-size: var(--text-table);
  white-space: nowrap;
}

.compare-selector {
  display: block;
  margin: 8px 0 14px;
  padding: 8px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.compare-selected-mice {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compare-selected-mice .technical-note {
  margin: 0;
}

.compare-search-results {
  margin-top: 8px;
}

.compare-selector-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: var(--text-table);
  line-height: 1.3;
}

.compare-selector-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tune-pair-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin: 10px 0 14px;
  padding: 10px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.tune-pair-form label {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: var(--text-table);
}

.tune-pair-form input {
  min-width: 0;
}

.tune-pair-form button {
  min-height: 34px;
  white-space: nowrap;
}

.tune-swap-button {
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.tune-unresolved {
  padding: 8px;
  border: 1px solid var(--soft);
  background: #ffffff;
}

.tune-unresolved p {
  margin: 0 0 6px;
}

.compare-selector-item input,
.compare-split-controls input {
  width: auto;
  height: auto;
  margin: 0;
  accent-color: #000000;
}

.compare-split-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin: 8px 0 12px;
  padding: 7px 8px;
  border: 1px solid var(--rule);
}
