.observablehq {
  scrollbar-gutter: stable;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.hero-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--theme-foreground-faintest);
  margin-bottom: 1rem;
}

.hero-strip h1 {
  margin: 0 0 0.35rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  align-items: center;
  color: var(--theme-foreground-muted);
  font-size: 0.92rem;
}

.experiment-context-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0.85rem 0 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--theme-foreground-faintest);
  border-bottom: 1px solid var(--theme-foreground-faintest);
  background: color-mix(in srgb, var(--theme-background), transparent 4%);
  backdrop-filter: blur(8px);
}

.experiment-context-main,
.experiment-context-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  min-width: 0;
}

.experiment-context-main > div {
  display: grid;
  gap: 0.05rem;
}

.experiment-context-main strong {
  font-size: 0.95rem;
  line-height: 1.15;
}

.experiment-context-main span,
.context-benchmark {
  color: var(--theme-foreground-muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.context-benchmark {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  background: var(--theme-background-alt);
  white-space: nowrap;
}

.evidence-quality-panel {
  margin: 1rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--theme-foreground-faintest);
  border-bottom: 1px solid var(--theme-foreground-faintest);
}

.evidence-quality-head {
  max-width: 780px;
  margin-bottom: 0.8rem;
}

.evidence-quality-head h2 {
  margin: 0.1rem 0 0.35rem;
  font-size: 1.15rem;
  line-height: 1.2;
}

.evidence-quality-head p {
  margin: 0;
  color: var(--theme-foreground-muted);
}

.evidence-quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.65rem;
}

.evidence-quality-item {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-height: 124px;
  padding: 0.75rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
}

.evidence-quality-item strong {
  font-size: 0.94rem;
}

.evidence-quality-item p {
  margin: 0;
  color: var(--theme-foreground-muted);
  font-size: 0.82rem;
  line-height: 1.34;
}

.setup-implication-band {
  margin: 1rem 0;
}

.strategy-workbench {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0 1.25rem;
}

.strategy-set-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.7rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
}

.strategy-set-summary > div {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.strategy-set-summary span {
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.strategy-set-summary strong {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.strategy-summary-bad,
.strategy-summary-bad strong {
  color: var(--theme-negative, #f97066) !important;
}

.strategy-workbench-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.strategy-workbench-actions span {
  margin-left: auto;
  color: var(--theme-foreground-muted);
  font-size: 0.78rem;
}

.strategy-definition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.65rem;
}

.strategy-definition-card {
  display: grid;
  align-content: start;
  gap: 0.42rem;
  min-height: 132px;
  padding: 0.78rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  color: var(--theme-foreground);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.strategy-definition-card:hover,
.strategy-definition-card:focus-visible,
.strategy-definition-card-active {
  border-color: color-mix(in srgb, var(--theme-foreground-focus), transparent 42%);
  background: color-mix(in srgb, var(--theme-background-alt), var(--theme-foreground-focus) 5%);
}

.strategy-definition-card:focus-visible {
  outline: 2px solid var(--theme-foreground-focus);
  outline-offset: 2px;
}

.strategy-definition-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.strategy-definition-card-head strong {
  font-size: 0.94rem;
}

.strategy-definition-card-head span,
.strategy-definition-card > span:last-child {
  color: var(--theme-foreground-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.strategy-definition-card-value {
  font-family: var(--sans-serif);
  font-size: 1.38rem;
  font-weight: 740;
  font-variant-numeric: tabular-nums;
}

.strategy-editor-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--theme-foreground-focus), transparent 68%);
  border-radius: 10px;
  background: var(--theme-background-alt);
}

.strategy-editor-heading,
.strategy-editor-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.strategy-editor-heading > div > span,
.strategy-editor-heading > span {
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.strategy-editor-heading h3 {
  margin: 0.12rem 0 0.3rem;
  font-size: 1.35rem;
}

.strategy-editor-heading p,
.strategy-editor-section-head p {
  max-width: 70ch;
  margin: 0;
  color: var(--theme-foreground-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.strategy-definition-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.strategy-definition-fields > label,
.strategy-risk-grid > label {
  display: grid;
  align-content: start;
  gap: 0.34rem;
  min-width: 0;
}

.strategy-definition-fields label > span:first-child,
.strategy-risk-grid label > span:first-child {
  color: var(--theme-foreground-muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.strategy-definition-fields input,
.strategy-definition-fields select,
.strategy-risk-grid input,
.strategy-model-weight input {
  width: 100%;
  min-height: 2.15rem;
}

.strategy-money-input,
.strategy-risk-input {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.strategy-editor-section-head {
  padding-top: 0.85rem;
  border-top: 1px solid var(--theme-foreground-faintest);
}

.strategy-editor-section-head > div:last-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  color: var(--theme-foreground-muted);
  font-size: 0.78rem;
}

.strategy-model-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.55rem;
}

.strategy-model-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 5.4rem;
  align-items: center;
  gap: 0.65rem;
  min-height: 78px;
  padding: 0.65rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background);
}

.strategy-model-row-selected {
  border-color: color-mix(in srgb, var(--theme-foreground-focus), transparent 58%);
}

.strategy-model-row strong,
.strategy-model-row em {
  display: block;
}

.strategy-model-row strong {
  font-size: 0.86rem;
}

.strategy-model-row em {
  margin-top: 0.15rem;
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1.35;
}

.strategy-model-check input {
  width: 1rem;
  height: 1rem;
}

.strategy-model-weight {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
}

.strategy-risk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
}

.strategy-risk-sections,
.strategy-authority-panel,
.strategy-authority-list {
  display: grid;
  gap: 0.75rem;
}

.strategy-risk-section {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 2fr);
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--theme-foreground-faintest);
}

.strategy-risk-section p,
.strategy-authority-row p,
.strategy-authority-confirmation p {
  margin: 0.2rem 0 0;
  color: var(--theme-foreground-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.strategy-authority-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.strategy-authority-summary > div,
.strategy-authority-contract > span {
  display: grid;
  gap: 0.16rem;
  padding: 0.62rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 7px;
  background: var(--theme-background-alt);
}

.strategy-authority-summary span,
.strategy-authority-contract span {
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
}

.strategy-authority-confirmation,
.strategy-authority-row {
  padding: 0.9rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 9px;
  background: var(--theme-background-alt);
}

.strategy-authority-confirmation {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  align-items: end;
  gap: 1rem;
}

.strategy-authority-confirmation label {
  display: grid;
  gap: 0.35rem;
  color: var(--theme-foreground-muted);
  font-size: 0.76rem;
}

.strategy-authority-row {
  display: grid;
  gap: 0.7rem;
}

.strategy-authority-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.strategy-authority-row-head strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1rem;
}

.strategy-authority-state {
  display: inline-flex;
  padding: 0.16rem 0.42rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.strategy-authority-enabled {
  color: var(--theme-positive, #32d583);
  background: color-mix(in srgb, var(--theme-positive, #32d583), transparent 88%);
}

.strategy-authority-warning {
  color: var(--theme-warning, #fdb022);
  background: color-mix(in srgb, var(--theme-warning, #fdb022), transparent 88%);
}

.strategy-authority-stopped {
  color: var(--theme-foreground-muted);
  background: var(--theme-background);
}

.strategy-authority-contract {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.strategy-authority-contract strong {
  color: var(--theme-foreground);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.strategy-authority-toggle {
  flex: 0 0 auto;
}

.strategy-authority-action-status,
.strategy-authority-message {
  min-height: 1.1rem;
  color: var(--theme-foreground-muted);
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  .strategy-persistence-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .strategy-persistence-actions,
  .strategy-persistence-actions .app-action {
    width: 100%;
  }

  .strategy-set-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-workbench-actions span {
    width: 100%;
    margin-left: 0;
  }

  .strategy-editor-heading,
  .strategy-editor-section-head {
    display: grid;
  }

  .strategy-editor-section-head > div:last-child {
    justify-content: flex-start;
  }

  .strategy-model-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .strategy-risk-section,
  .strategy-authority-confirmation {
    grid-template-columns: minmax(0, 1fr);
  }

  .strategy-authority-summary,
  .strategy-authority-contract {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-authority-row-head {
    display: grid;
  }

  .strategy-model-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .strategy-model-weight {
    grid-column: 2;
    max-width: 7rem;
  }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
  contain: layout paint;
}

.metric {
  min-height: 112px;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: none;
  cursor: default;
}

.metric-label {
  color: var(--theme-foreground-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.metric-value {
  color: var(--theme-foreground);
  font-size: clamp(1.35rem, 1.6vw, 1.75rem);
  line-height: 1.05;
  font-weight: 740;
  overflow-wrap: anywhere;
}

.metric-detail,
.recommendation-meta,
.page-note,
.guardrail span {
  color: var(--theme-foreground-muted);
}

.metric-detail {
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.metric-good {
  border-left: 4px solid var(--theme-green);
}

.metric-warn {
  border-left: 4px solid var(--theme-yellow);
}

.metric-bad {
  border-left: 4px solid var(--theme-red);
}

.metric-info {
  border-left: 4px solid var(--theme-blue);
}

.readiness-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
  align-items: stretch;
  margin: 1rem 0;
  contain: layout paint;
}

.readiness-card {
  min-height: 168px;
  border: 1px solid var(--theme-foreground-faintest);
  border-left: 4px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.85rem;
  display: grid;
  grid-template-rows: minmax(1.1rem, auto) auto 1fr auto;
  gap: 0.45rem;
  align-content: start;
  min-width: 0;
}

.readiness-card-title {
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
  font-weight: 740;
  letter-spacing: 0;
  line-height: 1.2;
  min-height: 1.75rem;
  text-transform: uppercase;
}

.readiness-card-value {
  color: var(--theme-foreground);
  font-size: 1.38rem;
  font-weight: 740;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.readiness-card-detail,
.readiness-card-meta {
  color: var(--theme-foreground-muted);
  font-size: 0.84rem;
  line-height: 1.34;
  overflow-wrap: anywhere;
}

.readiness-card-detail {
  color: var(--theme-foreground);
}

.readiness-card-meta {
  border-top: 1px solid var(--theme-foreground-faintest);
  padding-top: 0.45rem;
}

.readiness-card-good {
  border-left-color: var(--theme-green);
}

.readiness-card-warn {
  border-left-color: var(--theme-yellow);
}

.readiness-card-bad {
  border-left-color: var(--theme-red);
}

.readiness-card-info {
  border-left-color: var(--theme-blue);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--theme-foreground-faintest);
  color: var(--theme-foreground);
  background: var(--theme-background-alt);
}

.status-good {
  color: var(--theme-green);
  background: color-mix(in srgb, var(--theme-green), var(--theme-background) 88%);
}

.status-warn {
  color: var(--theme-yellow);
  background: color-mix(in srgb, var(--theme-yellow), var(--theme-background) 88%);
}

.status-bad {
  color: var(--theme-red);
  background: color-mix(in srgb, var(--theme-red), var(--theme-background) 88%);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background);
  contain: layout paint;
  margin: 0.5rem 0 1rem;
}

.app-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.app-table th,
.app-table td {
  padding: 0.58rem 0.65rem;
  border-bottom: 1px solid var(--theme-foreground-faintest);
  vertical-align: top;
  color: var(--theme-foreground);
}

.app-table th {
  text-align: left;
  color: var(--theme-foreground-muted);
  background: var(--theme-background-alt);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.app-table tr:last-child td {
  border-bottom: 0;
}

.app-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.inline-link-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: center;
}

.inline-link-group a,
.app-table td > a {
  white-space: nowrap;
}

.recommendation {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.8rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--theme-foreground-faintest);
}

.recommendation:last-child {
  border-bottom: 0;
}

.recommendation-rank {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--theme-foreground-focus);
  color: var(--theme-background);
  font-weight: 740;
}

.recommendation-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.recommendation p {
  margin: 0.45rem 0 0;
  color: var(--theme-foreground);
  line-height: 1.45;
}

.config-block {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  color: var(--theme-foreground);
  padding: 0.9rem;
  font-size: 0.82rem;
}

.guardrail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.7rem;
  margin: 0.75rem 0 1rem;
}

.guardrail {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.75rem;
}

.guardrail strong {
  display: block;
  margin-bottom: 0.2rem;
}

.control-panel {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.section-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.section-header-row h3 {
  margin: 0 0 0.25rem;
}

.section-header-row p,
.muted {
  color: var(--theme-foreground-muted);
  margin: 0;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.settings-grid label {
  display: grid;
  gap: 0.35rem;
  color: var(--theme-foreground-muted);
  font-size: 0.85rem;
}

.settings-grid input,
.text-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 6px;
  background: var(--theme-background);
  color: var(--theme-foreground);
  padding: 0.55rem 0.65rem;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button-row button,
.control-panel button {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 6px;
  background: var(--theme-foreground);
  color: var(--theme-background);
  padding: 0.55rem 0.8rem;
  font-weight: 700;
}

.button-row button:disabled,
.control-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.page-note {
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 1rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.review-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.review-item {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.85rem;
}

.review-item strong {
  display: block;
  margin-bottom: 0.35rem;
}

.study-frame {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.study-frame-item {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.9rem;
  min-width: 0;
}

.study-frame-kicker {
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
  font-weight: 740;
  letter-spacing: 0;
  text-transform: uppercase;
}

.study-frame-item h3 {
  margin: 0.1rem 0 0.55rem;
  font-size: 1rem;
  line-height: 1.2;
}

.study-frame-item p {
  color: var(--theme-foreground-muted);
  line-height: 1.42;
  margin: 0.48rem 0;
  overflow-wrap: anywhere;
}

.study-frame-item p:last-child {
  margin-bottom: 0;
}

.study-frame-item strong {
  color: var(--theme-foreground);
  display: block;
  font-size: 0.72rem;
  font-weight: 740;
  letter-spacing: 0;
  margin-bottom: 0.12rem;
  text-transform: uppercase;
}

.filter-chip-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0 0.25rem;
}

.filter-chip {
  align-items: baseline;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 999px;
  background: var(--theme-background-alt);
  color: var(--theme-foreground);
  display: inline-flex;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.32rem 0.58rem;
}

.filter-chip strong {
  font-size: 0.76rem;
  font-weight: 760;
}

.filter-chip em {
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
  font-style: normal;
}

.chart-story {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 0.8rem 0;
}

.chart-story article {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  min-width: 0;
  padding: 0.7rem;
}

.chart-story strong {
  color: var(--theme-foreground-muted);
  display: block;
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0;
  margin-bottom: 0.22rem;
  text-transform: uppercase;
}

.chart-story span {
  color: var(--theme-foreground);
  display: block;
  font-size: 0.84rem;
  line-height: 1.35;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  align-items: center;
  margin: 1rem 0;
  padding: 0.85rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  min-width: 0;
}

.control-grid .observablehq {
  min-width: 0;
}

.control-grid form {
  margin: 0;
  min-width: 0;
}

.control-grid input[type="number"] {
  max-width: 100%;
}

.analysis-workbench {
  margin: 1.15rem 0 1.35rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--theme-foreground-focus), transparent 68%);
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-foreground-focus), transparent 94%), transparent 48%),
    var(--theme-background-alt);
}

.analysis-workbench-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  max-width: 860px;
}

.analysis-workbench-head h2 {
  margin: 0.14rem 0 0.35rem;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.18;
}

.analysis-workbench-head p {
  margin: 0;
  color: var(--theme-foreground-muted);
  line-height: 1.45;
}

.analysis-workbench > .control-grid {
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  margin: 0.9rem 0;
  padding: 0.8rem 0 0;
  border: 0;
  border-top: 1px solid var(--theme-foreground-faintest);
  border-radius: 0;
  background: transparent;
  align-items: start;
}

.round-explorer-secondary-controls .observablehq:has(.tournament-empty) {
  display: none;
}

.analysis-selection-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-foreground-faintest);
}

.analysis-selection-summary > div {
  display: grid;
  align-content: start;
  gap: 0.24rem;
  min-height: 72px;
  padding: 0.7rem 0.75rem;
  background: var(--theme-background);
}

.analysis-selection-summary span {
  color: var(--theme-foreground-muted);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.analysis-selection-summary strong {
  font-size: 0.86rem;
  line-height: 1.35;
}

.analysis-answer-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-left: 4px solid var(--theme-foreground-focus);
  border-radius: 9px;
  background: var(--theme-background-alt);
}

.analysis-answer-panel > div > span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--theme-foreground-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.analysis-answer-panel h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  line-height: 1.08;
}

.analysis-answer-panel p {
  max-width: 74ch;
  margin: 0.45rem 0 0;
  color: var(--theme-foreground-muted);
  line-height: 1.45;
}

.analysis-answer-panel dl {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  margin: 0;
}

.analysis-answer-panel dl > div {
  display: grid;
  grid-template-columns: minmax(90px, 0.4fr) minmax(0, 1fr);
  gap: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--theme-foreground-faintest);
}

.analysis-answer-panel dt {
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
  font-weight: 720;
}

.analysis-answer-panel dd {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.analysis-answer-good {
  border-left-color: var(--theme-green);
}

.analysis-answer-warn {
  border-left-color: var(--theme-yellow);
}

.analysis-answer-bad {
  border-left-color: var(--theme-red);
}

.advanced-evidence-details {
  margin-top: 1.4rem;
}

.tournament-context-strip {
  margin: 0.75rem 0 1rem;
}

.round-window-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.round-window-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 9px;
  background: var(--theme-background-alt);
}

.round-window-card > span {
  color: var(--theme-foreground-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.round-window-card > strong {
  font-size: 1rem;
}

.round-window-card > small {
  color: var(--theme-foreground-muted);
  line-height: 1.35;
}

.round-window-card progress {
  width: 100%;
  margin-top: 0.2rem;
  accent-color: var(--theme-foreground-focus);
}

.round-window-complete {
  border-color: color-mix(in srgb, var(--theme-green), transparent 62%);
}

.round-window-active {
  border-color: color-mix(in srgb, var(--theme-foreground-focus), transparent 48%);
  background: color-mix(in srgb, var(--theme-foreground-focus), var(--theme-background) 95%);
}

.definition-comparison-layout {
  display: grid;
  gap: 0.85rem;
}

.round-performance-grid .chart-panel {
  align-content: start;
}

.round-progress-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  margin: 1.2rem 0 0.75rem;
}

.round-progress-step {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-height: 84px;
  padding: 0.8rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 9px;
  background: var(--theme-background-alt);
}

.round-progress-step > span {
  display: grid;
  flex: 0 0 1.65rem;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border-radius: 999px;
  background: var(--theme-background);
  color: var(--theme-foreground-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.round-progress-step div {
  display: grid;
  gap: 0.25rem;
}

.round-progress-step strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.round-progress-step small {
  color: var(--theme-foreground-muted);
  line-height: 1.35;
}

.round-progress-step-complete {
  border-color: color-mix(in srgb, var(--theme-green), transparent 62%);
}

.round-progress-step-complete > span {
  background: color-mix(in srgb, var(--theme-green), var(--theme-background) 84%);
  color: var(--theme-green);
}

.round-progress-step-active {
  border-color: color-mix(in srgb, var(--theme-foreground-focus), transparent 48%);
  background: color-mix(in srgb, var(--theme-foreground-focus), var(--theme-background) 94%);
}

.round-progress-step-active > span {
  background: var(--theme-foreground-focus);
  color: var(--theme-background);
}

.round-progress-connector {
  width: 1.8rem;
  height: 1px;
  background: var(--theme-foreground-faintest);
}

.round-progress-meter {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(220px, 1fr);
  align-items: center;
  gap: 0.35rem 1rem;
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
}

.round-progress-meter > div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.round-progress-meter > div span,
.round-progress-meter small {
  color: var(--theme-foreground-muted);
}

.round-progress-meter progress {
  width: 100%;
  accent-color: var(--theme-foreground-focus);
}

.round-progress-meter small {
  grid-column: 1 / -1;
  line-height: 1.35;
}

.round-evidence-bridge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0.55rem;
  margin: 1rem 0;
}

.round-evidence-card {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  min-height: 215px;
  padding: 0.9rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 9px;
  background: var(--theme-background-alt);
}

.round-evidence-card-hypothesis {
  border-color: color-mix(in srgb, var(--theme-foreground-focus), transparent 58%);
  background: color-mix(in srgb, var(--theme-foreground-focus), var(--theme-background) 95%);
}

.round-evidence-card-current {
  border-color: color-mix(in srgb, var(--theme-green), transparent 68%);
}

.round-evidence-kicker {
  color: var(--theme-foreground-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.round-evidence-card h3 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
}

.round-evidence-card p,
.round-evidence-card small {
  margin: 0;
  line-height: 1.4;
}

.round-evidence-card small {
  color: var(--theme-foreground-muted);
}

.round-evidence-arrow {
  display: grid;
  place-items: center;
  color: var(--theme-foreground-muted);
  font-size: 1.15rem;
}

.round-comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}

.round-comparison-grid > * {
  min-width: 0;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.4rem;
  margin: 1rem 0;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.4rem;
}

.segmented-control-button {
  min-height: 3.2rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--theme-foreground-muted);
  cursor: pointer;
  display: grid;
  gap: 0.16rem;
  font: inherit;
  padding: 0.48rem 0.62rem;
  text-align: left;
}

.segmented-control-button strong {
  color: inherit;
  font-size: 0.86rem;
  line-height: 1.15;
}

.segmented-control-button span {
  color: var(--theme-foreground-muted);
  font-size: 0.74rem;
  line-height: 1.2;
}

.segmented-control-button:hover,
.segmented-control-button:focus-visible,
.segmented-control-button-active {
  border-color: color-mix(in srgb, var(--theme-foreground-focus), transparent 70%);
  background: var(--theme-background);
  color: var(--theme-foreground);
}

.segmented-control-button:focus-visible {
  outline: 2px solid var(--theme-foreground-focus);
  outline-offset: 2px;
}

.setup-tab-panel {
  display: none;
}

.setup-tab-panel-active {
  display: block;
}

.setup-tab-intro {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  margin: 1rem 0;
  padding: 0.9rem;
}

.tournament-tab-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tournament-tab-intro h2 {
  margin: 0.2rem 0 0.35rem;
}

.tournament-tab-intro p {
  margin: 0;
  color: var(--theme-foreground-muted);
}

.tournament-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: min(100%, 220px);
}

.tournament-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--theme-foreground-faintest);
}

.tournament-method-grid > div {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.85rem 1rem;
}

.tournament-method-grid > div:nth-child(odd) {
  border-right: 1px solid var(--theme-foreground-faintest);
}

.tournament-method-grid > div:nth-child(n + 3) {
  border-top: 1px solid var(--theme-foreground-faintest);
}

.tournament-method-grid strong {
  font-size: 0.78rem;
}

.tournament-method-grid span {
  color: var(--theme-foreground-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.tournament-paper-metrics .metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tournament-hidden {
  display: none !important;
}

.setup-tab-kicker {
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
  font-weight: 740;
  letter-spacing: 0;
  text-transform: uppercase;
}

.setup-tab-intro h2 {
  margin: 0.12rem 0 0.35rem;
  font-size: 1.28rem;
  line-height: 1.2;
}

.setup-tab-intro p {
  color: var(--theme-foreground-muted);
  line-height: 1.45;
  margin: 0;
  max-width: 76ch;
}

.date-brush {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1rem;
  padding: 0.85rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  min-width: 0;
}

.date-brush-header,
.date-brush-footer {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  min-width: 0;
}

.date-brush-header strong {
  color: var(--theme-foreground);
  display: block;
  font-size: 0.88rem;
}

.date-brush-header span,
.date-brush-count {
  color: var(--theme-foreground-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.date-brush-readout {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background);
  color: var(--theme-foreground);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

.date-brush-svg {
  color: var(--theme-foreground-muted);
  display: block;
  overflow: visible;
  width: 100%;
}

.date-brush-svg .domain,
.date-brush-svg .tick line {
  stroke: var(--theme-foreground-faintest);
}

.date-brush-svg .tick text {
  fill: var(--theme-foreground-muted);
  font-size: 0.72rem;
}

.date-brush-layer .overlay {
  cursor: crosshair;
}

.date-brush-layer .selection {
  fill: color-mix(in srgb, var(--theme-foreground-focus), transparent 72%);
  stroke: var(--theme-foreground-focus);
  stroke-width: 1.2;
}

.date-brush-layer .handle {
  fill: var(--theme-foreground);
  fill-opacity: 0.95;
}

.date-brush-reset {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 999px;
  background: var(--theme-background);
  color: var(--theme-foreground);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
}

.date-brush-reset:hover,
.date-brush-reset:focus-visible {
  border-color: var(--theme-foreground-focus);
  outline: none;
}

.control-grid-wide {
  grid-template-columns: minmax(0, 1fr);
}

.chart-panel {
  overflow: hidden;
}

.chart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.chart-panel-header > div {
  min-width: 0;
}

.chart-panel-header h2 {
  margin: 0.05rem 0 0.2rem;
  font-size: 1.1rem;
  line-height: 1.25;
}

.chart-panel-header p {
  max-width: 68ch;
  margin: 0;
  color: var(--theme-foreground-muted);
  line-height: 1.4;
}

.chart-kicker {
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
  font-weight: 740;
  letter-spacing: 0;
  text-transform: uppercase;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: max-content;
}

.chart-panel svg {
  display: block;
  max-width: 100%;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0.85rem 0 1rem;
}

.app-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  background: var(--theme-background-alt);
  color: var(--theme-foreground);
  font-weight: 700;
  text-decoration: none;
}

.app-action-primary {
  border-color: var(--theme-foreground-focus);
  background: var(--theme-foreground-focus);
  color: #fff;
}

.app-action.app-action-primary:link,
.app-action.app-action-primary:visited {
  color: #fff;
}

.app-action[disabled],
.app-action-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  border-color: var(--theme-foreground-faintest);
  background: var(--theme-background-alt);
  color: var(--theme-foreground-muted);
}

.advanced-settings-dock {
  position: fixed;
  top: 5.25rem;
  right: 1rem;
  z-index: 24;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  pointer-events: none;
}

.advanced-settings-rail {
  display: grid;
  gap: 0.35rem;
  width: 3.25rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: color-mix(in srgb, var(--theme-background-alt), var(--theme-background) 36%);
  box-shadow: 0 0.35rem 1.2rem color-mix(in srgb, var(--theme-foreground), transparent 90%);
  padding: 0.4rem;
  pointer-events: auto;
}

.advanced-settings-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background);
  color: var(--theme-foreground);
  cursor: pointer;
  padding: 0;
}

.advanced-settings-button:hover,
.advanced-settings-button:focus-visible,
.advanced-settings-button-active {
  border-color: color-mix(in srgb, var(--theme-foreground-focus), transparent 70%);
  background: color-mix(in srgb, var(--theme-foreground-focus), var(--theme-background) 84%);
  color: var(--theme-foreground-focus);
}

.advanced-settings-button-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.advanced-settings-button::after {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  right: calc(100% + 0.55rem);
  transform: translateY(-50%);
  max-width: 12rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 6px;
  background: var(--theme-background);
  box-shadow: 0 0.35rem 1rem color-mix(in srgb, var(--theme-foreground), transparent 90%);
  color: var(--theme-foreground);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.1;
  opacity: 0;
  overflow-wrap: anywhere;
  padding: 0.35rem 0.5rem;
  pointer-events: none;
  white-space: nowrap;
}

.advanced-settings-button:hover::after,
.advanced-settings-button:focus-visible::after {
  opacity: 1;
}

.advanced-settings-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  color: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.advanced-settings-drawer {
  width: clamp(21rem, 34vw, 29rem);
  max-height: min(78vh, 46rem);
  overflow: auto;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: color-mix(in srgb, var(--theme-background), transparent 2%);
  box-shadow: 0 0.8rem 2rem color-mix(in srgb, var(--theme-foreground), transparent 88%);
  padding: 0.85rem;
  pointer-events: auto;
}

.advanced-settings-drawer[hidden] {
  display: none;
}

.advanced-settings-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--theme-foreground-faintest);
  margin-bottom: 0.8rem;
  padding-bottom: 0.75rem;
}

.advanced-settings-drawer h3 {
  margin: 0.1rem 0 0.2rem;
  font-size: 1.05rem;
  line-height: 1.2;
}

.advanced-settings-drawer p {
  margin: 0;
  color: var(--theme-foreground-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.advanced-settings-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  color: var(--theme-foreground-muted);
  cursor: pointer;
  padding: 0;
}

.advanced-settings-close:hover,
.advanced-settings-close:focus-visible {
  border-color: var(--theme-foreground-focus);
  color: var(--theme-foreground-focus);
}

.advanced-settings-panel-stack {
  display: grid;
  gap: 0.75rem;
}

.advanced-settings-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  color: var(--theme-foreground-muted);
  font-size: 0.86rem;
}

.advanced-settings-list {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.advanced-settings-list li {
  display: grid;
  gap: 0.15rem;
  border-top: 1px solid var(--theme-foreground-faintest);
  padding-top: 0.45rem;
}

.advanced-settings-list strong {
  color: var(--theme-foreground);
  line-height: 1.25;
}

.advanced-settings-list span {
  color: var(--theme-foreground-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.advanced-settings-drawer .ai-chat-panel {
  border: 0;
  background: transparent;
  margin: 0;
  padding: 0;
}

@media (min-width: 1024px) {
  body.has-advanced-settings-dock #observablehq-main {
    padding-right: 4.9rem;
  }
}

.setup-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 1rem;
  margin: 1rem 0;
}

.setup-panel h2 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.setup-panel p {
  margin: 0;
  color: var(--theme-foreground-muted);
  line-height: 1.45;
}

.setup-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.85rem 0;
}

.setup-checklist {
  display: grid;
  gap: 0.55rem;
  margin: 0.8rem 0 0;
}

.setup-step {
  display: grid;
  grid-template-columns: 1.8rem 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.65rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background);
}

.setup-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 1px solid var(--theme-foreground-faintest);
  color: var(--theme-foreground-muted);
  font-weight: 740;
}

.setup-step-complete .setup-step-index {
  border-color: var(--theme-green);
  background: color-mix(in srgb, var(--theme-green), var(--theme-background) 88%);
  color: var(--theme-green);
}

.setup-step strong {
  display: block;
  margin-bottom: 0.15rem;
}

.copy-field {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background);
  padding: 0.7rem;
  margin-bottom: 0.65rem;
}

.copy-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  color: var(--theme-foreground-muted);
  font-size: 0.76rem;
  font-weight: 740;
  text-transform: uppercase;
  letter-spacing: 0;
}

.copy-field button {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 6px;
  background: var(--theme-background-alt);
  color: var(--theme-foreground);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}

.copy-field code,
.copy-field pre {
  display: block;
  overflow-x: auto;
  white-space: pre;
  overflow-wrap: normal;
  margin: 0;
  color: var(--theme-foreground);
  font-size: 0.82rem;
  line-height: 1.45;
}

.setup-footnote {
  font-size: 0.84rem;
}

.scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}

.order-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
  margin: 0.75rem 0 1rem;
}

.order-flow-step {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.75rem;
}

.order-flow-step strong {
  display: block;
  margin-bottom: 0.25rem;
}

.model-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
  contain: layout paint;
}

.model-card {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.9rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.backtest-model-selector {
  margin: 1rem 0;
}

.backtest-model-selector .table-wrap {
  margin: 0;
}

.backtest-model-table {
  width: 100%;
  min-width: 650px;
  font-size: 0.78rem;
}

.backtest-model-table th,
.backtest-model-table td {
  padding: 0.42rem 0.5rem;
  vertical-align: middle;
}

.backtest-model-table th:nth-child(2) {
  width: 30%;
}

.backtest-model-table th:nth-child(3) {
  width: 19%;
}

.backtest-model-table strong,
.backtest-model-table small {
  display: block;
}

.backtest-model-table small {
  margin-top: 0.08rem;
  color: var(--theme-foreground-muted);
  font-size: 0.7rem;
  line-height: 1.2;
}

.backtest-model-check {
  width: 2.4rem;
  text-align: center;
}

.backtest-model-check input {
  width: 1rem;
  height: 1rem;
}

.backtest-model-row-selected {
  background: color-mix(in srgb, var(--theme-foreground-focus), transparent 92%);
}

.backtest-model-selection-note {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.1rem 0;
  color: var(--theme-foreground-muted);
  font-size: 0.75rem;
}

.backtest-model-selection-note > span:first-child {
  color: var(--theme-foreground);
  font-weight: 720;
  white-space: nowrap;
}

.model-card-button {
  width: 100%;
  color: var(--theme-foreground);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.model-card-button:hover {
  border-color: var(--theme-foreground-muted);
}

.model-card-button:focus-visible {
  outline: 2px solid var(--theme-foreground-focus);
  outline-offset: 2px;
}

.allocation-editor {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.allocation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7rem, auto);
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.75rem 0.85rem;
}

.allocation-row strong,
.allocation-row em {
  display: block;
}

.allocation-row em {
  color: var(--theme-foreground-muted);
  font-style: normal;
  font-size: 0.84rem;
}

.allocation-input {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

.allocation-input input {
  width: 5.5rem;
  max-width: 100%;
}

.ai-settings-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.ai-mode-explainer {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.9rem;
  margin: 1rem 0;
}

.ai-mode-explainer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.ai-mode-explainer-head h2 {
  margin: 0.1rem 0 0.25rem;
  font-size: 1.15rem;
  line-height: 1.25;
}

.ai-mode-explainer-head p {
  margin: 0;
  max-width: 76ch;
  color: var(--theme-foreground-muted);
  line-height: 1.42;
}

.ai-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.7rem;
}

.ai-mode-card {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background);
  padding: 0.75rem;
}

.ai-mode-card strong {
  display: block;
  margin: 0.45rem 0 0.25rem;
  line-height: 1.25;
}

.ai-mode-card p {
  margin: 0;
  color: var(--theme-foreground-muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.routing-settings-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.ai-setting-panel {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.85rem;
  min-width: 0;
}

.ai-setting-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}

.ai-setting-head strong,
.ai-setting-row strong,
.ai-setting-number strong {
  display: block;
  line-height: 1.25;
}

.ai-setting-head p,
.ai-setting-row em,
.ai-setting-number em {
  display: block;
  color: var(--theme-foreground-muted);
  font-style: normal;
  line-height: 1.35;
  font-size: 0.84rem;
}

.ai-setting-head p {
  margin: 0.25rem 0 0;
}

.ai-setting-row,
.ai-setting-number {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.65rem 0;
  border-top: 1px solid var(--theme-foreground-faintest);
}

.ai-setting-number {
  grid-template-columns: minmax(0, 1fr) minmax(7rem, auto);
  align-items: center;
}

.ai-setting-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
}

.ai-setting-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0.18rem 0 0;
}

.ai-setting-number input,
.ai-setting-number select {
  width: 100%;
  max-width: 12rem;
  justify-self: end;
}

.allocation-question-box {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.85rem;
}

.allocation-question-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.prompt-chip {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 999px;
  background: var(--theme-background);
  color: var(--theme-foreground);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.35rem 0.55rem;
}

.prompt-chip:hover,
.prompt-chip:focus-visible {
  border-color: var(--theme-foreground-focus);
}

.allocation-question-textarea {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background);
  color: var(--theme-foreground);
  font: inherit;
  line-height: 1.4;
  padding: 0.7rem;
}

.ai-answer-panel {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.9rem;
  margin: 1rem 0;
}

.ai-answer-panel h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.ai-answer-panel p {
  max-width: 78ch;
  color: var(--theme-foreground);
  line-height: 1.45;
}

.ai-answer-list {
  margin: 0.65rem 0 0;
  padding-left: 1.1rem;
}

.ai-answer-list li {
  margin: 0.3rem 0;
  color: var(--theme-foreground-muted);
  line-height: 1.4;
}

.ai-chat-panel {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.9rem;
  margin: 1rem 0;
}

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

.ai-chat-head h3 {
  margin: 0.1rem 0 0.25rem;
  font-size: 1.05rem;
}

.ai-chat-head p {
  margin: 0;
  color: var(--theme-foreground-muted);
  line-height: 1.4;
  max-width: 78ch;
}

.ai-chat-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ai-chat-transcript {
  display: grid;
  gap: 0.65rem;
  max-height: 24rem;
  overflow: auto;
  padding: 0.2rem;
}

.ai-chat-message {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background);
  padding: 0.75rem;
}

.ai-chat-message strong {
  display: block;
  margin-bottom: 0.25rem;
}

.ai-chat-message p {
  margin: 0.25rem 0;
  line-height: 1.45;
}

.ai-chat-message ul {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}

.ai-chat-message li {
  margin: 0.25rem 0;
  color: var(--theme-foreground-muted);
  line-height: 1.4;
}

.ai-chat-user {
  border-color: var(--theme-foreground-faint);
}

.ai-chat-assistant {
  background: color-mix(in srgb, var(--theme-background-alt) 70%, var(--theme-background));
}

.ai-chat-compose {
  display: grid;
  gap: 0.6rem;
}

.ai-chat-input {
  width: 100%;
  min-height: 5rem;
  resize: vertical;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background);
  color: var(--theme-foreground);
  font: inherit;
  line-height: 1.4;
  padding: 0.7rem;
}

.ai-chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ai-chat-actions span {
  color: var(--theme-foreground-muted);
  font-size: 0.84rem;
}

.model-card-selected {
  border-color: var(--theme-foreground-focus);
  box-shadow: inset 0 0 0 1px var(--theme-foreground-focus);
}

.model-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.model-card-head strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.model-card-head span,
.model-card p,
.model-card-metrics span {
  color: var(--theme-foreground-muted);
}

.model-card p {
  margin: 0;
  line-height: 1.4;
}

.model-card-detail-link {
  display: inline-flex;
  margin-top: auto;
  padding-top: 0.7rem;
  color: var(--theme-foreground-focus);
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
}

.model-card-detail-link:hover {
  text-decoration: underline;
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0 0 1rem;
}

.definition-block {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 0.6rem;
  background: var(--theme-background-alt);
}

.definition-block h2 {
  margin: 0.2rem 0 0.45rem;
  font-size: 1rem;
}

.definition-block p {
  margin: 0;
  color: var(--theme-foreground-muted);
  line-height: 1.45;
}

@media (max-width: 700px) {
  .definition-grid {
    grid-template-columns: 1fr;
  }
}

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

.model-card-metrics div {
  border-top: 1px solid var(--theme-foreground-faintest);
  padding-top: 0.45rem;
}

.model-card-metrics span,
.model-card-metrics strong {
  display: block;
}

.model-card-metrics strong {
  font-variant-numeric: tabular-nums;
}

.card {
  contain: paint;
}

.card > svg {
  display: block;
  max-width: 100%;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.process-step {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.7rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.85rem;
}

a.process-step {
  color: inherit;
  text-decoration: none;
}

a.process-step:hover,
a.process-step:focus-visible {
  border-color: var(--theme-foreground-muted);
  background: color-mix(in srgb, var(--theme-background-alt) 82%, var(--theme-foreground) 18%);
}

.process-action {
  display: inline-block;
  margin-top: 0.55rem;
  color: var(--theme-foreground-focus);
  font-size: 0.78rem;
  font-weight: 760;
}

.process-step-static {
  border-style: dashed;
}

.strategy-persistence-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.9rem 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
}

.strategy-persistence-panel strong,
.strategy-persistence-panel p {
  display: block;
  margin: 0.2rem 0 0;
}

.strategy-persistence-panel p {
  color: var(--theme-foreground-muted);
  font-size: 0.88rem;
}

.strategy-persistence-state {
  display: inline-block;
  margin-right: 0.55rem;
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.strategy-persistence-good { color: var(--theme-green); }
.strategy-persistence-warn { color: var(--theme-yellow); }
.strategy-persistence-bad { color: var(--theme-red); }

.strategy-persistence-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.strategy-editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.9rem 0 0.2rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--theme-foreground-faintest);
}

.strategy-editor-tabs button {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--theme-foreground-muted);
  padding: 0.52rem 0.7rem;
  font-weight: 680;
}

.strategy-editor-tabs button:hover,
.strategy-editor-tabs button:focus-visible,
.strategy-editor-tabs .strategy-editor-tab-active {
  border-color: var(--theme-foreground-faintest);
  background: var(--theme-background);
  color: var(--theme-foreground);
}

.strategy-editor-step {
  min-height: 15rem;
}

.process-index {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--theme-foreground-focus);
  color: var(--theme-background);
  font-weight: 740;
}

.process-step strong {
  display: block;
  line-height: 1.25;
}

.process-step p {
  margin: 0.25rem 0 0;
  color: var(--theme-foreground-muted);
  line-height: 1.4;
}

.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1rem;
  align-items: start;
  margin: 1rem 0;
}

.method-panel {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
  padding: 0.9rem;
}

.method-panel h2,
.method-panel h3 {
  margin-top: 0;
}

.method-panel p {
  line-height: 1.45;
}

.method-list {
  margin: 0;
  padding-left: 1.1rem;
}

.method-list li {
  margin: 0.35rem 0;
  color: var(--theme-foreground-muted);
  line-height: 1.4;
}

.workspace-panel {
  display: none;
  margin-top: 1rem;
}

.workspace-intro {
  max-width: 820px;
  margin: 1.1rem 0 0.8rem;
}

.workspace-intro h2 {
  margin: 0.12rem 0 0.4rem;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.08;
}

.workspace-intro p,
.page-lede {
  color: var(--theme-foreground-muted);
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0;
  max-width: 82ch;
}

.page-lede {
  margin: -0.15rem 0 1rem;
}

.orientation-details {
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-background-alt);
}

.orientation-details > summary {
  cursor: pointer;
  padding: 0.65rem 0.8rem;
  color: var(--theme-foreground-muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.orientation-details[open] {
  padding: 0 0.8rem 0.8rem;
}

.orientation-details[open] > summary {
  margin: 0 -0.8rem 0.6rem;
  border-bottom: 1px solid var(--theme-foreground-faintest);
}

.reader-guide {
  background: color-mix(in srgb, var(--theme-background-alt) 76%, transparent);
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  margin: 1rem 0;
  padding: 1rem;
}

.reader-guide-head h2 {
  font-size: 1.2rem;
  margin: 0.12rem 0 0.8rem;
}

.reader-guide-head {
  position: relative;
  cursor: pointer;
  list-style: none;
  padding-right: 5rem;
}

.reader-guide-head::-webkit-details-marker {
  display: none;
}

.reader-guide-head::after {
  position: absolute;
  top: 0.25rem;
  right: 0;
  color: var(--theme-foreground-muted);
  content: "Hide guide";
  font-size: 0.72rem;
  font-weight: 650;
}

.reader-guide:not([open]) .reader-guide-head h2 {
  margin-bottom: 0;
}

.reader-guide:not([open]) .reader-guide-head::after {
  content: "Show guide";
}

.reader-guide-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reader-guide-item {
  border-top: 2px solid var(--theme-foreground-focus);
  padding-top: 0.55rem;
}

.reader-guide-item strong {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.reader-guide-item p {
  color: var(--theme-foreground-muted);
  line-height: 1.45;
  margin: 0.3rem 0 0;
}

.backtest-position-atlas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 1.25rem;
}

.backtest-position-card {
  min-width: 0;
}

.backtest-position-card .chart-panel-header {
  margin-bottom: 0.25rem;
}

.backtest-position-card .chart-panel-header p {
  font-size: 0.78rem;
  line-height: 1.3;
}

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

.section-label {
  margin: 1.15rem 0 0.45rem;
}

.control-room-hero {
  align-items: center;
  padding: 0.35rem 0 1.05rem;
}

.control-room-hero h1 {
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1;
  margin-top: 0.18rem;
  max-width: 760px;
}

.next-action-card {
  align-items: center;
  background: var(--theme-background-alt);
  border: 1px solid var(--theme-foreground-faintest);
  border-left: 4px solid var(--theme-blue);
  border-radius: 8px;
  display: flex;
  gap: 1.25rem;
  justify-content: space-between;
  margin: 1rem 0;
  padding: 1rem;
}

.next-action-card h2 {
  font-size: 1.3rem;
  line-height: 1.15;
  margin: 0.12rem 0 0.3rem;
}

.next-action-card p {
  color: var(--theme-foreground-muted);
  line-height: 1.45;
  margin: 0;
  max-width: 72ch;
}

.next-action-good {
  border-left-color: var(--theme-green);
}

.next-action-warn {
  border-left-color: var(--theme-yellow);
}

.next-action-bad {
  border-left-color: var(--theme-red);
}

.workflow-route-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 1rem 0;
}

.workflow-route {
  background: var(--theme-background-alt);
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 0.3rem;
  min-height: 130px;
  padding: 0.9rem;
  text-decoration: none;
}

.workflow-route:hover,
.workflow-route:focus-visible {
  border-color: var(--theme-foreground-muted);
  transform: translateY(-1px);
}

.workflow-route span {
  color: var(--theme-foreground-muted);
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workflow-route strong {
  font-size: 1rem;
  line-height: 1.2;
}

.workflow-route small {
  color: var(--theme-foreground-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.compact-control-grid {
  align-items: start;
}

.audit-details {
  background: var(--theme-background-alt);
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  margin: 0.75rem 0;
}

.audit-details summary {
  cursor: pointer;
  font-weight: 740;
  padding: 0.85rem 1rem;
}

.audit-details .details-body {
  border-top: 1px solid var(--theme-foreground-faintest);
  color: var(--theme-foreground-muted);
  padding: 0.25rem 1rem 1rem;
}

.empty-evidence-state {
  align-items: flex-start;
  background: var(--theme-background-alt);
  border: 1px dashed var(--theme-foreground-faintest);
  border-radius: 8px;
  color: var(--theme-foreground-muted);
  display: grid;
  gap: 0.3rem;
  margin: 0.75rem 0 1rem;
  padding: 1rem;
}

.empty-evidence-state strong {
  color: var(--theme-foreground);
}

.empty-evidence-state span {
  line-height: 1.45;
}

.site-auth-bar {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(28rem, calc(100vw - 2rem));
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-background), transparent 4%);
  color: var(--theme-foreground);
  box-shadow: 0 0.35rem 1.2rem color-mix(in srgb, var(--theme-foreground), transparent 88%);
  padding: 0.4rem 0.5rem 0.4rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1;
}

.site-auth-bar__identity {
  min-width: 0;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--theme-foreground-muted);
}

.site-auth-bar__logout,
.site-auth-bar__action {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 999px;
  background: var(--theme-background-alt);
  color: var(--theme-foreground);
  padding: 0.25rem 0.5rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

html[data-site-authenticated="false"] .site-auth-protected-link:not([data-site-login-action])::after {
  content: "Sign in";
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 999px;
  color: var(--theme-foreground-muted);
  padding: 0.08rem 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.site-access-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  border: 1px solid color-mix(in srgb, var(--theme-foreground-focus), transparent 65%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--theme-foreground-focus), transparent 94%);
  padding: 0.85rem 1rem;
}

.site-access-notice > div {
  display: grid;
  gap: 0.2rem;
}

.site-access-notice span {
  color: var(--theme-foreground-muted);
  line-height: 1.45;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(17rem, 0.65fr);
  gap: clamp(1.25rem, 4vw, 3.5rem);
  align-items: center;
  margin: 0.4rem 0 1.25rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 10%, color-mix(in srgb, var(--theme-foreground-focus), transparent 84%), transparent 38%),
    linear-gradient(135deg, var(--theme-background-alt), var(--theme-background));
  padding: clamp(1.4rem, 4vw, 3.4rem);
}

.landing-hero-copy h1 {
  max-width: 13ch;
  margin: 0.35rem 0 0.85rem;
  font-size: clamp(2.5rem, 6.5vw, 5.5rem);
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.landing-hero-copy > p {
  max-width: 62ch;
  margin: 0;
  color: var(--theme-foreground-muted);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.58;
}

.landing-hero-actions {
  margin: 1.15rem 0 0.75rem;
}

.landing-hero-copy > small {
  display: block;
  max-width: 75ch;
  color: var(--theme-foreground-muted);
  line-height: 1.45;
}

.landing-proof-card {
  display: grid;
  gap: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--theme-foreground-focus), transparent 48%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--theme-background), transparent 2%);
  box-shadow: 0 0.8rem 2.5rem color-mix(in srgb, var(--theme-foreground), transparent 92%);
  padding: 1.25rem;
}

.landing-proof-card > strong {
  font-size: clamp(2.05rem, 4.5vw, 3.45rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1;
}

.landing-proof-card > span {
  color: var(--theme-foreground-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.landing-proof-card > small {
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.landing-proof-comparison {
  display: grid;
  gap: 0.3rem;
}

.landing-proof-comparison > span {
  color: var(--theme-foreground-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.landing-proof-comparison > span b {
  color: var(--theme-foreground);
}

.landing-proof-comparison > strong {
  margin-top: 0.12rem;
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.landing-proof-divider {
  height: 1px;
  margin: 0.35rem 0;
  background: var(--theme-foreground-faintest);
}

.landing-evidence-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 1.25rem;
  border-top: 1px solid var(--theme-foreground-faintest);
  border-bottom: 1px solid var(--theme-foreground-faintest);
}

.landing-evidence-band > div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  padding: 0.72rem 0.85rem;
  border-right: 1px solid var(--theme-foreground-faintest);
}

.landing-evidence-band > div:last-child {
  border-right: 0;
}

.landing-evidence-band span {
  color: var(--theme-foreground-muted);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.landing-evidence-band strong {
  font-size: 0.86rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.landing-break-even {
  display: grid;
  grid-template-columns: minmax(11rem, 0.35fr) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
  margin: 1rem 0;
  border: 1px solid var(--theme-foreground-faintest);
  border-left: 4px solid var(--theme-blue);
  border-radius: 10px;
  background: var(--theme-background-alt);
  padding: 1rem;
}

.landing-break-even-good {
  border-left-color: var(--theme-green);
}

.landing-break-even-warn {
  border-left-color: var(--theme-yellow);
}

.landing-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.42rem 0.8rem;
  min-width: max-content;
  color: var(--theme-foreground-muted);
  font-size: 0.72rem;
}

.landing-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.landing-chart-key {
  display: inline-block;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: #8b939f;
}

.landing-chart-key-model {
  background: #4f7cff;
}

.landing-chart-key-hurdle {
  width: 0.85rem;
  height: 0;
  border-top: 2px dashed #f5b700;
  border-radius: 0;
  background: none;
}

.landing-chart-key-start {
  width: 0.85rem;
  height: 0;
  border-top: 2px solid var(--theme-foreground);
  border-radius: 0;
  background: none;
  opacity: 0.55;
}

.landing-chart-insight {
  display: grid;
  grid-template-columns: minmax(9rem, 0.7fr) minmax(9rem, 0.7fr) minmax(15rem, 1.6fr);
  gap: 1px;
  overflow: hidden;
  margin: 0.85rem 0 0.25rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  background: var(--theme-foreground-faintest);
}

.landing-chart-insight > div {
  display: grid;
  gap: 0.18rem;
  padding: 0.72rem 0.8rem;
  background: var(--theme-background);
}

.landing-chart-insight span {
  color: var(--theme-foreground-muted);
  font-size: 0.66rem;
  font-weight: 780;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.landing-chart-insight strong {
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.landing-chart-insight small,
.landing-chart-caption {
  color: var(--theme-foreground-muted);
  line-height: 1.4;
}

.landing-chart-insight-leader {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--theme-foreground-focus), transparent 93%), transparent),
    var(--theme-background) !important;
}

.landing-cycle-chart svg {
  margin-top: 0.15rem;
}

.landing-chart-caption {
  max-width: 92ch;
  margin: -0.2rem 0 0;
  padding: 0 0.2rem 0.2rem;
  font-size: 0.75rem;
}

.landing-chart-caption strong {
  color: var(--theme-foreground);
}

.landing-break-even h2 {
  margin: 0.15rem 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  line-height: 1;
}

.landing-break-even p {
  margin: 0;
  color: var(--theme-foreground-muted);
  line-height: 1.5;
}

.landing-cycle-chart {
  margin-bottom: 1rem;
}

.landing-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0.75rem 0 1.5rem;
}

.landing-method-grid > section {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  min-height: 220px;
  border-top: 3px solid var(--theme-foreground-faintest);
  background: var(--theme-background-alt);
  padding: 1rem;
}

.landing-method-grid h2 {
  margin: 0.15rem 0 0.2rem;
  font-size: 1.25rem;
}

.landing-method-grid p {
  margin: 0;
  color: var(--theme-foreground-muted);
  line-height: 1.5;
}

.landing-method-grid a {
  align-self: end;
  margin-top: 0.55rem;
  font-weight: 700;
  text-decoration: none;
}

.landing-final-cta .action-row {
  flex: 0 0 auto;
}

.pricing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(15rem, 0.7fr);
  gap: 1.5rem;
  align-items: center;
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme-foreground-focus), transparent 90%), var(--theme-background-alt));
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.pricing-hero h1 {
  max-width: 18ch;
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.02;
}

.pricing-hero p {
  max-width: 58ch;
  margin: 0;
  color: var(--theme-foreground-muted);
  font-size: 1.03rem;
  line-height: 1.55;
}

.pricing-price-card {
  display: grid;
  gap: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--theme-foreground-focus), transparent 55%);
  border-radius: 12px;
  background: var(--theme-background);
  padding: 1.25rem;
  box-shadow: 0 0.5rem 2rem color-mix(in srgb, var(--theme-foreground), transparent 92%);
}

.pricing-price {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1;
}

.pricing-price span {
  margin-right: 0.12rem;
  font-size: 1.25rem;
  vertical-align: top;
}

.pricing-cadence,
.pricing-price-card small {
  color: var(--theme-foreground-muted);
}

.pricing-price-card small {
  line-height: 1.45;
}

.pricing-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0.75rem 0 1.5rem;
}

.pricing-tier {
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 12px;
  background: var(--theme-background-alt);
  padding: 1.25rem;
}

.pricing-tier-member {
  border-color: color-mix(in srgb, var(--theme-foreground-focus), transparent 45%);
  background: color-mix(in srgb, var(--theme-foreground-focus), transparent 95%);
}

.pricing-tier h2 {
  margin: 0.35rem 0 0.75rem;
}

.pricing-tier ul {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding-left: 1.15rem;
}

.pricing-boundaries {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1.5rem;
}

.pricing-boundaries > div {
  display: grid;
  gap: 0.35rem;
  border-top: 3px solid var(--theme-foreground-faintest);
  background: var(--theme-background-alt);
  padding: 1rem;
}

.pricing-boundaries span {
  color: var(--theme-foreground-muted);
  line-height: 1.45;
}

.research-table {
  margin: 0.75rem 0 1.25rem;
}

.research-table > .table-wrap {
  margin: 0;
}

.research-table .app-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  font-size: 0.8rem;
}

.research-table .app-table th,
.research-table .app-table td {
  padding: 0.48rem 0.55rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.research-table .app-table small {
  color: var(--theme-foreground-muted);
  line-height: 1.3;
}

.research-table .app-table code {
  font-size: 0.75rem;
  white-space: normal;
}

.research-table-evidence .app-table {
  min-width: 980px;
}

.research-table-evidence th:nth-child(1) {
  width: 18%;
}

.research-table-evidence th:nth-child(2) {
  width: 11%;
}

.research-table-evidence th:nth-child(3),
.research-table-evidence th:nth-child(4),
.research-table-evidence th:nth-child(5) {
  width: 23.67%;
}

.research-table-sequence th:nth-child(1) {
  width: 5%;
}

.research-table-sequence th:nth-child(2) {
  width: 24%;
}

.research-table-sequence th:nth-child(3) {
  width: 38%;
}

.research-table-sequence th:nth-child(4) {
  width: 15%;
}

.research-table-sequence th:nth-child(5) {
  width: 18%;
}

.research-table-contract th:nth-child(1) {
  width: 20%;
}

.research-table-contract th:nth-child(2) {
  width: 45%;
}

.research-table-contract th:nth-child(3) {
  width: 35%;
}

@media (max-width: 760px) {
  body {
    max-width: 100vw !important;
    overflow-x: hidden;
  }

  .research-table {
    max-width: 100%;
  }

  .research-table .table-wrap {
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  #observablehq-sidebar-toggle {
    top: 0.75rem !important;
    right: 0.75rem !important;
    left: auto !important;
    width: 2rem !important;
    height: 2rem !important;
    border: 1px solid var(--theme-foreground-faintest);
    border-radius: 999px;
    background: var(--theme-background-alt) !important;
    cursor: pointer !important;
    z-index: 25;
  }

  #observablehq-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(18rem, 85vw) !important;
    transform: translateX(-100%) !important;
    transition: transform 160ms ease;
    z-index: 20;
  }

  #observablehq-sidebar-toggle:checked ~ #observablehq-sidebar {
    transform: translateX(0) !important;
  }

  #observablehq-sidebar-toggle:checked ~ #observablehq-sidebar-backdrop {
    display: block !important;
  }

  #observablehq-center {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 1rem !important;
  }

  #observablehq-main,
  #observablehq-footer {
    width: calc(100vw - 2rem) !important;
    min-width: 0;
    max-width: calc(100vw - 2rem) !important;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  #observablehq-footer nav {
    grid-template-columns: 1fr;
  }

  .hero-strip {
    display: block;
  }

  .next-action-card {
    align-items: stretch;
    display: grid;
  }

  .workflow-route-grid {
    grid-template-columns: 1fr;
  }

  .strategy-persistence-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .strategy-persistence-actions,
  .strategy-persistence-actions .app-action {
    width: 100%;
  }

  .experiment-context-bar {
    position: static;
    display: grid;
    gap: 0.65rem;
  }

  .experiment-context-main,
  .experiment-context-badges {
    align-items: flex-start;
  }

  .metric-grid,
  .evidence-quality-grid,
  .reader-guide-grid,
  .backtest-position-atlas,
  .review-band,
  .control-grid,
  .model-card-grid,
  .order-flow,
  .process-flow,
  .setup-panel,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .tournament-paper-metrics .metric-grid,
  .tournament-method-grid {
    grid-template-columns: 1fr;
  }

  .tournament-method-grid > div:nth-child(odd) {
    border-right: 0;
  }

  .tournament-method-grid > div:nth-child(n + 2) {
    border-top: 1px solid var(--theme-foreground-faintest);
  }

  .analysis-workbench {
    padding: 0.8rem;
  }

  .analysis-workbench-head {
    display: block;
  }

  .analysis-workbench > .control-grid,
  .analysis-selection-summary {
    grid-template-columns: 1fr;
  }

  .analysis-answer-panel {
    grid-template-columns: 1fr;
  }

  .round-progress-overview,
  .round-window-strip,
  .round-evidence-bridge,
  .round-comparison-grid {
    grid-template-columns: 1fr;
  }

  .round-progress-connector {
    width: 1px;
    height: 1rem;
    margin-left: 1.6rem;
  }

  .round-evidence-arrow {
    min-height: 1rem;
    transform: rotate(90deg);
  }

  .round-progress-meter {
    grid-template-columns: 1fr;
  }

  .round-progress-meter small {
    grid-column: auto;
  }

  .tournament-tab-intro {
    flex-direction: column;
  }

  .tournament-action-row {
    justify-content: flex-start;
    width: 100%;
  }

  .chart-panel-header {
    display: block;
  }

  .landing-chart-legend {
    justify-content: flex-start;
    min-width: 0;
    margin-top: 0.55rem;
  }

  .landing-chart-insight {
    grid-template-columns: 1fr;
  }

  .ai-mode-explainer-head {
    display: block;
  }

  .action-row {
    align-items: stretch;
  }

  .legend-row {
    justify-content: flex-start;
    min-width: 0;
    margin-top: 0.5rem;
  }

  .app-action {
    width: 100%;
  }

  .advanced-settings-dock {
    top: auto;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .advanced-settings-dock-open {
    align-items: stretch;
  }

  .advanced-settings-rail {
    align-self: flex-end;
  }

  .advanced-settings-drawer {
    width: min(100%, calc(100vw - 5.4rem));
    max-height: min(72vh, 38rem);
  }

  .advanced-settings-button::after {
    display: none;
  }

  .allocation-row {
    grid-template-columns: 1fr;
  }

  .ai-settings-editor,
  .routing-settings-editor,
  .ai-setting-number,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .ai-setting-number input,
  .ai-setting-number select,
  .text-input {
    max-width: 100%;
    justify-self: stretch;
  }

  .section-header-row {
    display: block;
  }

  .allocation-input {
    justify-self: stretch;
  }

  .allocation-input input {
    width: 100%;
  }

  .metric {
    min-height: 100px;
  }

  .site-auth-bar {
    right: 0.75rem;
    bottom: 0.75rem;
    max-width: calc(100vw - 1.5rem);
  }

  .site-auth-bar__identity {
    max-width: 46vw;
  }

  .site-access-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-hero,
  .landing-break-even,
  .landing-method-grid,
  .pricing-hero,
  .pricing-comparison,
  .pricing-boundaries {
    grid-template-columns: 1fr;
  }

  .landing-hero-copy h1 {
    max-width: 15ch;
  }

  .landing-evidence-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-evidence-band > div:nth-child(2) {
    border-right: 0;
  }

  .landing-evidence-band > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--theme-foreground-faintest);
  }

  .landing-method-grid > section {
    min-height: 0;
  }

  .backtest-model-selection-note {
    display: grid;
  }
}
