:root {
  --ink: #3E454A;
  --muted: #52879E;
  --paper: #f7fafb;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #B7E2F2;
  --line-dark: #75CCEC;
  --green: #2D6885;
  --green-soft: #eaf7fc;
  --teal: #44B0DF;
  --gold: #52879E;
  --coral: #3E454A;
  --blue: #75CCEC;
  --focus: #44B0DF;
  --shadow: 0 12px 28px rgba(45, 104, 133, 0.08);
  font-family: "Aspekta Variable", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 10% -20%, rgba(183, 226, 242, 0.75), transparent 38rem),
    var(--paper);
  color: var(--ink);
}
button, input, select { font: inherit; }
button, select, input { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 60%);
  outline-offset: 2px;
}

.app-header {
  min-height: 104px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(18px, 2.2vw, 36px) 18px;
  border-bottom: 1px solid var(--line-dark);
  background: rgba(247, 250, 251, 0.94);
}
.app-header h1 { margin: 1px 0 3px; font: 650 clamp(25px, 2.2vw, 36px)/1.05 "Aspekta Variable", sans-serif; letter-spacing: -0.025em; }
.title-position-select { position: relative; display: inline-block; }
.title-position-select > span { display: block; cursor: pointer; transition: color .15s ease; }
.title-position-select select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
}
.title-position-select > button { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; }
.title-position-select:has(> button:focus-visible) { outline: 3px solid color-mix(in srgb, var(--focus), transparent 60%); outline-offset: 2px; }
#position-menu { position: fixed; z-index: 100; top: 96px; left: clamp(18px, 2.2vw, 36px); width: min(570px, calc(100vw - 36px)); max-height: calc(100dvh - 114px); overflow-y: auto; overscroll-behavior: contain; padding: 10px; border: 1px solid var(--line-dark); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.position-menu-heading { margin: 14px 8px 5px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.position-choice { display: grid; grid-template-columns: minmax(0, 1fr) 68px; gap: 3px 12px; align-items: center; width: 100%; padding: 9px 8px; border: 0; border-radius: 4px; background: transparent; text-align: left; font: 550 13px/1.35 "Aspekta Variable", sans-serif; color: var(--ink); cursor: pointer; }
.position-choice:hover, .position-choice:focus-visible { background: var(--green-soft); outline: 2px solid var(--line); outline-offset: -2px; }
.position-choice[aria-current="true"] { background: var(--green-soft); color: var(--green); }
.position-choice-count { text-align: right; color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.position-choice-subtitle { grid-column: 1; color: var(--muted); font-size: 10px; font-weight: 400; }
.position-menu-note { margin: 10px 8px 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.title-position-select:hover > span,
.title-position-select:has(> select:focus-visible) > span { color: var(--green); }
.title-position-select:has(> select:focus-visible) { border-radius: 3px; outline: 3px solid color-mix(in srgb, var(--focus), transparent 60%); outline-offset: 2px; }
.eyebrow, .section-label { margin: 0; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.header-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.header-meta > span, .count-badge {
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.app-shell {
  --settings-size: 15.6%;
  --table-size: 34.8%;
  display: grid;
  grid-template-columns: minmax(218px, var(--settings-size)) 10px minmax(360px, 1fr) 10px minmax(350px, var(--table-size));
  gap: 2px;
  height: calc(100dvh - 104px);
  min-height: 0;
  padding: 12px;
}
.panel {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel), transparent 2%);
  box-shadow: var(--shadow);
}
.settings-panel, .table-panel { min-height: 0; }
.settings-panel {
  padding: 17px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border-radius: 14px 4px 4px 14px;
}
.analysis-column { display: grid; grid-template-rows: minmax(368px, 1fr) 10px minmax(112px, auto); gap: 2px; min-width: 0; min-height: 0; container-type: inline-size; }
.analysis-column.has-custom-results-size { grid-template-rows: minmax(368px, 1fr) 10px minmax(112px, var(--results-size)); }
.analysis-column.has-custom-results-size.is-model-details-expanded { grid-template-rows: minmax(240px, 1fr) 10px minmax(112px, var(--results-size)); }
.analysis-column.is-animating-results-size { transition: grid-template-rows 400ms cubic-bezier(.22, 1, .36, 1); }
.chart-panel { display: flex; min-width: 0; min-height: 0; padding: 0; overflow: visible; flex-direction: column; }
.chart-view-tabs {
  --chart-tab-height: 35px;
  position: relative;
  z-index: 2;
  display: flex;
  flex: none;
  align-items: flex-start;
  height: var(--chart-tab-height);
  min-width: 0;
  min-height: var(--chart-tab-height);
  padding: 0 12px 0 0;
  overflow: visible;
  scrollbar-width: none;
}
.chart-view-tabs::-webkit-scrollbar { display: none; }
.chart-view-tab {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-width: 92px;
  min-height: calc(var(--chart-tab-height) - 4px);
  margin: 0;
  padding: 6px 15px 7px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-dark);
  border-radius: 9px 9px 0 0;
  background: color-mix(in srgb, var(--line), var(--paper) 72%);
  color: var(--muted);
  box-shadow: inset 0 -3px 6px rgba(45, 104, 133, .05);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(4px);
  transition: background-color 120ms ease, color 120ms ease, transform 120ms ease;
}
.chart-view-tab + .chart-view-tab { margin-left: -3px; }
.chart-view-tab:hover { background: var(--green-soft); color: var(--green); }
.chart-view-tab[aria-disabled="true"] { color: color-mix(in srgb, var(--muted), transparent 38%); cursor: not-allowed; }
.chart-view-tab[aria-disabled="true"]:hover { background: color-mix(in srgb, var(--line), var(--paper) 72%); color: color-mix(in srgb, var(--muted), transparent 38%); }
.chart-view-tab[aria-selected="true"] {
  z-index: 3;
  min-height: var(--chart-tab-height);
  border-color: var(--line-dark);
  border-bottom-color: transparent;
  background: white;
  color: var(--green);
  box-shadow: 0 -3px 8px rgba(45, 104, 133, .07);
  transform: translateY(0);
}
.chart-view-tab[aria-selected="true"]::after {
  position: absolute;
  right: 1px;
  bottom: -2px;
  left: 1px;
  height: 3px;
  background: var(--panel-strong);
  content: "";
}
.chart-view-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 0 4px 4px 4px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  flex-direction: column;
}
#chart-panel:has(#model-diagnostics:not([hidden])) .chart-view-content { overflow-y: auto; scrollbar-gutter: stable; }
.quantile-panel { min-height: 0; max-height: min(400px, 46dvh); padding: 0 18px 17px; border-radius: 4px; overflow: auto; scrollbar-gutter: stable; }
.analysis-column.has-custom-results-size .quantile-panel { max-height: none; }
.table-panel { position: relative; display: flex; flex-direction: column; padding: 0 0 10px; border-radius: 4px 14px 14px 4px; overflow: hidden; }
.table-panel.is-model-view .header-filter-menu { display: none; }

.panel-resizer { position: relative; z-index: 12; min-width: 0; min-height: 0; border: 0; outline: 0; touch-action: none; user-select: none; }
.panel-resizer::before { position: absolute; border-radius: 999px; background: var(--green); content: ""; opacity: 0; transition: opacity 120ms ease; }
.panel-resizer:hover::before, .panel-resizer:focus-visible::before, .panel-resizer.is-active::before { opacity: .82; }
.panel-resizer:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--teal), transparent 30%); }
.panel-resizer-vertical { cursor: col-resize; }
.panel-resizer-vertical::before { top: 12px; bottom: 12px; left: 50%; width: 2px; transform: translateX(-50%); }
.panel-resizer-horizontal { cursor: row-resize; }
.panel-resizer-horizontal::before { top: 50%; right: 12px; left: 12px; height: 2px; transform: translateY(-50%); }
body.is-resizing-panels.is-resizing-vertical { cursor: col-resize; user-select: none; }
body.is-resizing-panels.is-resizing-horizontal { cursor: row-resize; user-select: none; }
body.is-resizing-panels * { cursor: inherit !important; }

@media (prefers-reduced-motion: reduce) {
  .analysis-column.is-animating-results-size { transition: none; }
}

.panel-heading, .chart-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.panel-heading h2, .chart-heading h2 { margin: 3px 0 0; font: 650 18px/1.15 "Aspekta Variable", sans-serif; }
.text-button { border: 0; background: none; color: var(--green); padding: 3px 0; cursor: pointer; font-size: 12px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.settings-actions { display: flex; align-items: center; gap: 16px; }
.chart-jump, .settings-scroll-note { display: none; }

.field { display: grid; gap: 5px; margin-top: 17px; }
.field > span, .choice-group legend, .weighting-title { color: var(--ink); font-size: 11px; font-weight: 750; }
.field-description { color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.choice-group { grid-template-columns: repeat(auto-fit, minmax(min(78px, 100%), 1fr)); gap: 4px; margin-inline: 0; padding: 0; border: 0; }
.choice-group legend { grid-column: 1 / -1; margin-bottom: 5px; padding: 0; }
.choice-group label { display: flex; align-items: center; min-width: 0; gap: 3px; padding: 7px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-strong); font-size: clamp(8.5px, .72vw, 10.5px); line-height: 1.1; letter-spacing: -.01em; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.choice-group input { margin: 0; accent-color: var(--green); }
.choice-group label:has(input:checked) { background: var(--green-soft); color: var(--green); font-weight: 700; }
.dollar-basis-setting { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.axis-settings { gap: 7px; }
.axis-view-settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.axis-control-setting { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.scatter-axis-heading { color: var(--green); font-size: 9.5px; }
.scatter-axis-heading:not(:first-child) { margin-top: 5px; padding-top: 7px; border-top: 1px solid var(--line); }
.scatter-display-settings { margin-inline: 0; padding: 0; border: 0; }
.scatter-display-settings > legend { margin-bottom: 5px; padding: 0; color: var(--ink); font-size: 11px; font-weight: 750; }
.scatter-display-options { display: grid; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.scatter-display-option { display: flex; min-width: 0; align-items: center; gap: 4px; padding: 6px 7px; background: white; color: var(--ink); font-size: 9.5px; }
.scatter-display-option label { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; gap: 5px; cursor: pointer; }
.scatter-display-option input { flex: none; margin: 0; accent-color: var(--green); }
.scatter-display-option:has(input:checked) { background: var(--green-soft); color: var(--green); font-weight: 700; }
.scatter-display-option:has(input:disabled) { color: var(--muted); opacity: .55; }
.scatter-display-option:has(input:disabled) label { cursor: not-allowed; }
.scatter-display-option .info-tooltip { flex: none; width: 13px; height: 13px; margin: 0; font-size: 8px; }
.model-settings { gap: 9px; }
.model-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.model-settings-heading > strong { font-size: 11px; }
.model-settings-heading .text-button { flex: none; font-size: 9px; }
.model-settings .field { margin-top: 0; }
.model-option { display: flex; align-items: center; gap: 4px; padding: 7px 8px; border: 1px solid var(--line); background: var(--panel-strong); font-size: 9.5px; }
.model-option label { display: flex; flex: 1; align-items: center; gap: 5px; cursor: pointer; }
.model-option input { margin: 0; accent-color: var(--green); }
.model-option:has(input:checked) { background: var(--green-soft); color: var(--green); font-weight: 700; }
.model-option:has(input:disabled) { opacity: .56; }
.model-option .info-tooltip { flex: none; width: 13px; height: 13px; margin: 0; font-size: 8px; }
.model-input-grid, .model-category-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.model-input-grid label, .model-category-inputs label { display: grid; min-width: 0; gap: 3px; color: var(--muted); font-size: 8.5px; font-weight: 650; }
.model-input-grid input, .model-category-inputs select { min-width: 0; width: 100%; padding: 7px 6px; border: 1px solid var(--line-dark); border-radius: 5px; background: white; font-size: 9.5px; }
.model-input-grid label:has(input:disabled) { opacity: .5; }
.model-input-grid input[aria-invalid="true"] { border-color: #8b2831; box-shadow: 0 0 0 1px #8b2831; }
.model-input-grid label:nth-child(-n+2), .model-category-inputs label:nth-child(3) { grid-column: 1 / -1; }
.model-category-inputs label:first-child, .model-category-inputs label:last-child { grid-column: 1 / -1; }
.weighting-field { position: sticky; z-index: 8; top: -17px; margin-inline: -17px; padding: 12px 17px 9px; border: 0; border-bottom: 1px solid var(--line); background: #fff; box-shadow: 0 7px 13px rgba(45, 104, 133, .12); }
.weighting-field::after { position: absolute; top: 0; right: 0; bottom: 0; width: 9px; background: #fff; content: ""; pointer-events: none; }
.weighting-title { display: flex; align-items: center; gap: 3px; }
.auto-weight-rule { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 7px; padding: 7px 8px; border: 1px solid var(--green); background: color-mix(in srgb, var(--green-soft), white 12%); color: var(--green); }
.auto-weight-rule label { display: flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 750; cursor: pointer; }
.auto-weight-rule > span { color: var(--muted); font-size: 8px; font-weight: 600; text-align: right; }
.auto-weight-rule:has(input:checked) { background: var(--green); color: white; }
.auto-weight-rule:has(input:checked) > span { color: var(--line); }
.auto-weight-rule input { flex: none; margin: 0; accent-color: var(--green); }
.auto-weight-rule:has(input:checked) input { accent-color: white; }
.auto-weight-rule:has(input:disabled) { border-color: var(--line); background: var(--paper); opacity: .62; }
.auto-weight-rule:has(input:disabled) label { cursor: not-allowed; }
.component-group-label { margin-top: 8px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.weighting-components { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 5px; border: 1px solid var(--line); background: var(--line); }
.weighting-components > label { min-width: 0; background: white; color: var(--ink); font-size: 9px; }
.weighting-components > label { display: flex; align-items: center; gap: 4px; padding: 5px 6px; cursor: pointer; }
.weighting-components > label:has(input:checked) { background: var(--green-soft); color: var(--green); font-weight: 700; }
.weighting-components label:has(input:disabled) { opacity: .48; cursor: not-allowed; }
.weighting-components input, .stream-balance-rule input { flex: none; margin: 0; accent-color: var(--green); }
.stream-balance-rule { display: flex; align-items: center; gap: 4px; margin-top: 7px; padding: 6px 7px; border-left: 3px solid var(--line-dark); background: var(--paper); color: var(--ink); font-size: 9px; }
.stream-balance-rule label { display: flex; flex: 1; align-items: center; gap: 4px; cursor: pointer; }
.stream-balance-rule:has(input:checked) { background: var(--green-soft); color: var(--green); font-weight: 700; }
.stream-balance-rule:has(input:disabled) { opacity: .48; }
.stream-balance-rule:has(input:disabled) label { cursor: not-allowed; }
.stream-balance-rule .info-tooltip { flex: none; width: 13px; height: 13px; margin: 0; font-size: 8px; }
.weighting-description { display: block; margin: 8px 0 0; padding: 0 1px; }
.info-tooltip { position: relative; display: inline-grid; place-items: center; width: 15px; height: 15px; margin: 0 1px; padding: 0; border: 1px solid var(--line-dark); border-radius: 50%; background: var(--panel-strong); color: var(--green); font-size: 9px; font-weight: 800; line-height: 1; cursor: help; vertical-align: 1px; }
.help-tooltip { position: fixed; z-index: 100; width: min(250px, calc(100vw - 16px)); padding: 8px 10px; border: 1px solid var(--green); background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 10px; font-weight: 450; line-height: 1.45; pointer-events: none; }
select, input[type="number"], input[type="search"] {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: var(--panel-strong);
  padding: 8px 9px;
  font-size: 12px;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%; background-size: 4px 4px; background-repeat: no-repeat; padding-right: 25px; }
input[type="range"] { width: 100%; accent-color: var(--green); }
.compact { margin-top: 13px; }
.compact output { float: right; color: var(--green); font-variant-numeric: tabular-nums; }
.subsettings { margin-top: 12px; padding: 1px 11px 12px; border-left: 2px solid var(--line-dark); background: var(--green-soft); }
.discrete-weight-editors { margin-top: 8px; border-left: 2px solid var(--line-dark); }
.discrete-weight-editors details { border-bottom: 1px solid var(--line); background: white; }
.discrete-weight-editors summary { padding: 7px 9px; color: var(--green); font-size: 9.5px; font-weight: 700; cursor: pointer; }
.discrete-weight-note { margin: 0; padding: 0 9px 7px; color: var(--muted); font-size: 8.5px; line-height: 1.4; }
.discrete-weight-grid { display: grid; grid-template-columns: minmax(0, 1fr) 55px; gap: 5px 7px; align-items: center; max-height: 185px; overflow-y: auto; padding: 7px 9px 9px; background: var(--green-soft); }
.discrete-weight-category { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--ink); font-size: 9px; }
.discrete-weight-category > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discrete-weight-category .info-tooltip { flex: none; width: 13px; height: 13px; font-size: 8px; }
.discrete-weight-grid input { width: 100%; border: 1px solid var(--line-dark); padding: 4px; font-size: 9px; font-variant-numeric: tabular-nums; }
.input-with-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.input-with-unit span { font-size: 11px; color: var(--muted); }
.settings-panel, .table-scroll, .discrete-weight-grid, .chart-legend, .quantile-panel, .quantile-grid.is-percentiles, .filter-options {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--green), transparent 52%) transparent;
}
.settings-panel::-webkit-scrollbar, .table-scroll::-webkit-scrollbar, .discrete-weight-grid::-webkit-scrollbar, .quantile-panel::-webkit-scrollbar,
.chart-legend::-webkit-scrollbar, .quantile-grid.is-percentiles::-webkit-scrollbar, .filter-options::-webkit-scrollbar { width: 8px; height: 8px; }
.settings-panel::-webkit-scrollbar-track, .table-scroll::-webkit-scrollbar-track, .discrete-weight-grid::-webkit-scrollbar-track, .quantile-panel::-webkit-scrollbar-track,
.chart-legend::-webkit-scrollbar-track, .quantile-grid.is-percentiles::-webkit-scrollbar-track, .filter-options::-webkit-scrollbar-track { background: transparent; }
.settings-panel::-webkit-scrollbar-thumb, .table-scroll::-webkit-scrollbar-thumb, .discrete-weight-grid::-webkit-scrollbar-thumb, .quantile-panel::-webkit-scrollbar-thumb,
.chart-legend::-webkit-scrollbar-thumb, .quantile-grid.is-percentiles::-webkit-scrollbar-thumb, .filter-options::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green), transparent 52%);
  background-clip: padding-box;
}

.chart-heading { align-items: flex-end; }
.live-stats { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.live-stats span { min-width: 74px; padding-left: 8px; border-left: 1px solid var(--line); color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.live-stats b { display: block; color: var(--ink); font-size: 15px; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.live-stats i { font-style: normal; }
.math-expression { font-style: italic; text-transform: none; letter-spacing: normal; white-space: nowrap; }
.math-expression sup { font-size: .7em; line-height: 0; vertical-align: super; }
.chart-wrap { position: relative; flex: 1 1 0; min-height: 180px; margin-top: 10px; }
.chart-panel:has(.scatter-controls:not([hidden])) .chart-wrap { min-height: 160px; }
.scatter-controls { display: flex; justify-content: flex-start; align-items: center; min-height: 24px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.scatter-correlations { display: block; align-self: center; margin-right: 4px; color: var(--ink); font-size: 9px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.model-diagnostics { flex: none; min-width: 0; margin-top: 6px; border-top: 1px solid var(--line); }
.model-diagnostic-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.model-diagnostic-strip > span { min-width: 0; padding: 6px 8px; border-right: 1px solid var(--line); color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .025em; }
.model-diagnostic-strip > span:last-child { border-right: 0; }
.model-diagnostic-strip b { display: block; overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.model-profile-reasons { margin: 0; padding: 5px 8px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--coral), white 92%); color: color-mix(in srgb, var(--coral), var(--ink) 38%); font-size: 8.5px; line-height: 1.35; }
.model-details-panel > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.model-details-grid { display: grid; grid-template-columns: minmax(0, max-content) minmax(230px, 1fr); align-items: start; gap: 18px; margin-top: 9px; }
.model-details-grid h3 { margin: 0 0 6px; font-size: 10px; }
.model-comparison-scroll { max-width: 100%; overflow-x: auto; }
.model-comparison-table { width: auto; min-width: 0; max-width: 100%; border-collapse: collapse; font-size: 9px; }
.model-comparison-table th, .model-comparison-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.model-comparison-table thead th:not(:first-child) { line-height: 1.15; white-space: normal; }
.model-comparison-table th:first-child, .model-comparison-table td:first-child { text-align: left; }
.model-comparison-table th:first-child { width: 112px; max-width: 112px; white-space: normal; }
.model-method-content { display: flex; align-items: center; gap: 5px; }
.model-method-content .model-method-button { min-width: 0; max-width: 88px; white-space: normal; }
.model-method-content .model-spec-button { margin: 0; }
.model-comparison-table th:not(:first-child), .model-comparison-table td:not(:first-child) { width: 1%; }
.model-comparison-table tr.is-selected { background: var(--green-soft); color: var(--green); font-weight: 700; }
.model-comparison-table tr.is-actionable { cursor: pointer; }
.model-comparison-table tr.is-actionable:hover { background: color-mix(in srgb, var(--green-soft), white 35%); }
.model-comparison-table tr.is-actionable:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.model-method-button { display: inline; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--green); font: inherit; font-weight: 750; text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.model-method-button[aria-pressed="true"] { color: var(--ink); text-decoration-thickness: 2px; }
.model-contributions { display: grid; gap: 3px; }
.model-no-contributions { margin: 0; color: var(--muted); font-size: 9px; }
.model-contribution { display: grid; grid-template-columns: 80px minmax(50px, 1fr); padding-right: 44px; align-items: center; gap: 4px; font-size: 8px; }
.model-contribution > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-contribution-track { position: relative; height: 8px; background: color-mix(in srgb, var(--line), transparent 42%); }
.model-contribution-track::after { position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: var(--muted); content: ""; opacity: .5; }
.model-contribution-bar { position: absolute; top: 1px; bottom: 1px; background: var(--teal); }
.model-contribution.is-negative .model-contribution-bar { background: var(--green); }
.model-contribution-track > output { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; text-align: left; font-variant-numeric: tabular-nums; }
.model-limitations { margin-top: 9px !important; padding-top: 7px; border-top: 1px solid var(--line); }
.model-limitations:empty { display: none; }
.model-profile-warning { color: var(--coral); }
.model-density-area { fill: color-mix(in srgb, var(--blue), transparent 68%); }
.model-density-line { fill: none; stroke: var(--green); stroke-width: 2.5; }
.model-interval-95 { fill: color-mix(in srgb, var(--line), transparent 48%); }
.model-interval-80 { fill: color-mix(in srgb, var(--blue), transparent 45%); }
.model-interval-50 { fill: color-mix(in srgb, var(--teal), transparent 28%); }
.model-reference-line { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 3; }
.model-reference-label { fill: var(--ink); font-size: 9px; font-weight: 750; paint-order: stroke; stroke: white; stroke-width: 3px; }
.model-median-line { stroke: var(--green); stroke-width: 1.5; }
.job-ad-interval { fill: none; stroke: var(--muted); stroke-width: 1.6; opacity: .78; pointer-events: none; vector-effect: non-scaling-stroke; }
.job-ad-interval-cap { stroke-width: 1.3; }
.job-ad-interval-endpoint { fill: white; stroke-width: 1.3; }
.interval-swatch { position: relative; width: 16px !important; height: 8px !important; background: transparent !important; }
.interval-swatch::before { position: absolute; top: 3px; right: 0; left: 0; height: 1.5px; background: var(--muted); content: ""; }
.interval-swatch::after { position: absolute; top: 1px; left: 7px; width: 2px; height: 6px; background: var(--muted); content: ""; }
.weight-component-control + .weight-component-control { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
#comparability-profile-field { margin-top: 8px; padding-left: 0; border-left: 0; }
.weight-profile-slot { margin-top: 7px; }
.weight-profile-figure { min-width: 0; padding: 8px 7px 3px; border: 1px solid var(--line); background: color-mix(in srgb, var(--green-soft), white 35%); }
.weight-profile-heading { display: flex; align-items: center; gap: 4px; }
.weight-profile-heading strong { color: var(--ink); font-size: 10px; }
.weight-profile-heading .info-tooltip { flex: none; width: 13px; height: 13px; margin: 0; font-size: 8px; }
.weight-profile-figure > span { display: block; min-height: 22px; margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.weight-profile-figure svg { display: block; width: 100%; height: auto; margin-top: 2px; overflow: visible; }
.weight-profile-axis { stroke: var(--line-dark); stroke-width: 1; }
.weight-profile-grid-line { stroke: color-mix(in srgb, var(--line), white 28%); stroke-width: 1; }
.weight-profile-curve { fill: none; stroke: var(--green); stroke-width: 2; }
.weight-profile-target { stroke: var(--teal); stroke-width: 1; stroke-dasharray: 3 2; }
.weight-profile-rp-reference { stroke: var(--green); stroke-width: 1.4; }
.weight-profile-rp-label { fill: var(--green); font-size: 8px; font-weight: 750; }
.weight-profile-label { fill: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.weight-profile-axis-title { fill: var(--ink); font-size: 9px; font-weight: 650; }
.rp-scale-reference { margin-top: 9px; border: 1px solid var(--line); background: white; }
.rp-scale-reference summary { padding: 7px 8px; color: var(--green); font-size: 9.5px; font-weight: 750; cursor: pointer; }
.rp-scale-reference p { margin: 0; padding: 0 8px 8px; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.rp-scale-reference a { color: var(--green); font-weight: 650; text-underline-offset: 2px; }
#salary-chart { display: block; width: 100%; height: 100%; min-height: 0; overflow: visible; }
.axis-variable-control { cursor: pointer; }
.axis-variable-label { fill: var(--ink); font-size: 10px; font-weight: 700; }
.axis-variable-control:hover .axis-variable-label, .axis-variable-control:focus .axis-variable-label { fill: var(--green); }
.axis-variable-triangle { fill: var(--teal); }
.axis-selector-popover { position: absolute; z-index: 25; width: min(230px, calc(100% - 16px)); padding: 9px; border: 1px solid var(--line-dark); border-radius: 7px; background: white; box-shadow: var(--shadow); }
.axis-selector-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; color: var(--ink); font-size: 11px; }
.axis-selector-heading button { border: 0; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.axis-selector-popover label { display: grid; grid-template-columns: 68px minmax(0, 1fr); align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.axis-selector-popover label + label { margin-top: 6px; }
.axis-selector-popover select { padding-block: 5px; font-size: 10px; }
.axis text { fill: var(--muted); font-size: 10px; }
.axis line, .axis path { stroke: var(--line-dark); }
.grid-line { stroke: color-mix(in srgb, var(--line), white 45%); stroke-width: 1; }
.bar-block { cursor: pointer; stroke: rgba(255,255,255,.84); stroke-width: .7; transition: fill .12s, stroke .12s, stroke-width .12s; }
.bar-block:hover, .bar-block.is-focused { fill: var(--bar-hover-fill); stroke: var(--ink); stroke-width: 1.4; }
.scatter-point { cursor: pointer; stroke: white; stroke-width: 1.2; opacity: .86; transition: opacity .12s, stroke-width .12s; }
.scatter-point:hover, .scatter-point:focus-visible, .scatter-point.is-focused { opacity: 1; stroke: var(--ink); stroke-width: 2; }
.rp-reference-guide { stroke: var(--green); stroke-width: 1.2; stroke-dasharray: 5 4; opacity: .72; pointer-events: none; }
.rp-chart-marker { cursor: pointer; }
.rp-chart-marker-logo { filter: drop-shadow(0 0 .75px white) drop-shadow(0 1px 1.5px rgba(45, 104, 133, .5)); }
.rp-chart-marker:focus .rp-chart-marker-logo, .rp-chart-marker:hover .rp-chart-marker-logo { filter: drop-shadow(0 0 1px white) drop-shadow(0 0 2px rgba(45, 104, 133, .82)); }
.covariance-contour { fill: none; stroke: var(--ink); stroke-width: 1.1; pointer-events: none; }
.density-line-outline, .density-line { fill: none; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.density-line-outline { stroke: rgba(255, 255, 255, .96); stroke-width: 6.5; }
.density-line { stroke: var(--coral); stroke-width: 3; }
.rug-line { stroke: var(--green); stroke-width: 1; opacity: .36; transition: opacity .1s, stroke-width .1s; }
.rug-line.is-highlighted { stroke: var(--ink); stroke-width: 3; opacity: 1; }
.quantile-guide { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 4 3; pointer-events: none; }
.empirical-quantile-guide { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 5 4; stroke-linecap: round; opacity: .62; pointer-events: none; }
.empirical-quantile-label { fill: var(--green); font-size: 10px; font-weight: 700; paint-order: stroke; stroke: rgba(255, 255, 255, .96); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none; }
.empirical-quantile-label.amount { fill: var(--ink); font-size: 9px; font-weight: 550; }
.curve-quantile-tick-outline, .curve-quantile-tick { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.curve-quantile-tick-outline { stroke: rgba(255, 255, 255, .96); stroke-width: 4; }
.curve-quantile-tick { stroke: var(--ink); stroke-width: 1.2; }
.curve-quantile-label { fill: var(--green); font-size: 10px; font-weight: 700; paint-order: stroke; stroke: rgba(255, 255, 255, .96); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none; }
.curve-quantile-label.amount { fill: var(--ink); font-size: 9px; font-weight: 550; }
.chart-annotation { fill: var(--muted); font-size: 10px; }
.chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  width: min(320px, calc(100% - 10px));
  padding: 12px 13px 10px;
  border: 1px solid var(--line-dark);
  background: color-mix(in srgb, var(--ink), transparent 2%);
  color: white;
  box-shadow: 0 12px 28px rgba(45, 104, 133, .24);
  font-size: 10.5px;
  line-height: 1.35;
}
.chart-tooltip-heading strong { display: block; font-size: 13px; line-height: 1.25; }
.chart-tooltip-heading span { display: block; margin-top: 2px; color: var(--line); }
.chart-tooltip-value { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-top: 9px; padding: 8px 0; border-block: 1px solid rgba(183, 226, 242, .32); }
.chart-tooltip-value span { max-width: 165px; color: var(--line); font-size: 8.5px; line-height: 1.3; text-transform: uppercase; letter-spacing: .04em; }
.chart-tooltip-value strong { color: white; font-size: 17px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-tooltip dl { margin: 7px 0 0; }
.chart-tooltip dl div { display: grid; grid-template-columns: minmax(80px, .72fr) minmax(0, 1.28fr); gap: 10px; padding: 2px 0; }
.chart-tooltip dt { color: var(--line); }
.chart-tooltip dd { margin: 0; overflow-wrap: anywhere; color: white; font-weight: 600; text-align: right; }
.chart-tooltip-hint { margin: 8px 0 0; padding-top: 7px; border-top: 1px solid rgba(183, 226, 242, .32); color: var(--line); font-size: 8.5px; }
.chart-legend { display: flex; gap: 8px 14px; flex-wrap: wrap; max-height: 52px; overflow-y: auto; color: var(--muted); font-size: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.swatch { width: 9px; height: 9px; display: inline-block; }
.model-legend-95 { background: color-mix(in srgb, var(--line), transparent 48%); }
.model-legend-80 { background: color-mix(in srgb, var(--blue), transparent 45%); }
.model-legend-50 { background: color-mix(in srgb, var(--teal), transparent 28%); }
.model-reference-swatch { border-top-style: dashed; border-top-color: var(--ink); }
.tier-a { background: #2D6885; }
.tier-b { background: var(--teal); }
.tier-c { background: var(--blue); }
.line-swatch { width: 16px; border-top: 2px solid var(--coral); }
.rug-swatch { width: 16px; height: 8px; display: inline-block; background: repeating-linear-gradient(90deg, var(--green) 0 1px, transparent 1px 4px); }
.contour-swatch { width: 15px; height: 9px; display: inline-block; border: 1px solid var(--ink); border-radius: 50%; }
.point-size-legend { gap: 7px !important; }
.point-size-legend-label { color: var(--ink); font-weight: 650; }
.point-size-key { gap: 3px !important; }
.point-size-swatch { display: inline-block; flex: none; border: 1px solid var(--ink); border-radius: 50%; background: color-mix(in srgb, var(--blue), white 25%); }
.model-training-status { color: var(--green); font-size: 9px; font-weight: 700; white-space: nowrap; }

.inline-heading { align-items: center; }
.quantile-basis { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.quantile-controls { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.mark-curve-toggle { display: flex; align-items: center; gap: 5px; color: var(--ink); font-size: 10px; white-space: nowrap; }
.mark-curve-toggle input { margin: 0; accent-color: var(--green); }
.inline-select { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.inline-select select { width: auto; padding-block: 6px; }
.custom-quantiles { display: grid; grid-template-columns: auto minmax(190px, 1fr); align-items: center; gap: 7px 12px; margin-top: 11px; color: var(--muted); font-size: 10.5px; }
.custom-quantiles input { width: 100%; border: 1px solid var(--line-dark); padding: 6px 8px; }
.custom-quantiles small { grid-column: 1 / -1; color: #8b2831; }
.quantile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(95px, 1fr)); border: 1px solid var(--line); margin-top: 11px; }
.quantile-grid.is-percentiles { grid-template-columns: repeat(10, minmax(62px, 1fr)); max-height: 180px; overflow-y: auto; }
.quantile-cell { border: 0; border-right: 1px solid var(--line); background: transparent; padding: 9px 8px; text-align: left; cursor: crosshair; }
.quantile-cell:last-child { border-right: 0; }
.quantile-cell:hover, .quantile-cell:focus-visible { background: var(--green-soft); }
.quantile-cell span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.quantile-cell sup { font-size: .68em; line-height: 0; vertical-align: super; }
.quantile-cell strong { display: block; margin-top: 2px; font-size: 13px; font-variant-numeric: tabular-nums; }

.results-tabs { position: sticky; z-index: 4; top: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 -18px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.results-tabs button { min-height: 38px; border: 0; border-right: 1px solid var(--line); border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.results-tabs button:last-child { border-right: 0; }
.results-tabs button[aria-selected="true"] { border-bottom-color: var(--green); background: var(--green-soft); color: var(--green); }
.results-tabs button span { display: inline-grid; min-width: 17px; height: 17px; margin-left: 3px; padding: 0 4px; place-items: center; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.results-tabs button[aria-selected="true"] span { background: #fff; color: var(--green); }
.results-tab-panel { min-width: 0; }
.result-note { margin: 7px 0 0; color: var(--green); font-size: 11px; line-height: 1.45; }
.result-status { min-height: 15px; margin: 6px 0 0; color: var(--green); font-size: 11px; font-weight: 650; }
.result-action { min-height: 31px; border: 1px solid var(--green); background: var(--green); color: #fff; padding: 6px 10px; font-size: 11px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.result-action:disabled { border-color: var(--line-dark); background: var(--paper); color: var(--muted); cursor: not-allowed; }

.scenario-toolbar { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.scenario-toolbar label { display: grid; flex: 1 1 170px; gap: 3px; color: var(--ink); font-size: 11px; font-weight: 700; }
.scenario-toolbar input { width: 100%; min-height: 31px; border: 1px solid var(--line-dark); padding: 6px 8px; background: #fff; font-size: 11px; }
.scenario-toolbar > span { align-self: center; color: var(--green); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scenario-empty { margin: 10px 0 0; padding: 13px; border-block: 1px solid var(--line); color: var(--muted); font-size: 11px; text-align: center; }
.scenario-table-wrap { margin-top: 8px; overflow-x: auto; border: 1px solid var(--line); }
.scenario-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 11px; }
.scenario-table th, .scenario-table td { padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; }
.scenario-table th:last-child, .scenario-table td:last-child { border-right: 0; }
.scenario-table tr:last-child th, .scenario-table tr:last-child td { border-bottom: 0; }
.scenario-table thead { position: static; }
.scenario-table thead th { position: static; background: var(--green-soft); color: var(--ink); text-transform: none; letter-spacing: 0; white-space: normal; }
.scenario-table tbody th { position: sticky; z-index: 1; left: 0; width: 112px; background: var(--paper); color: var(--green); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.scenario-name-input { width: 100%; min-width: 105px; border: 0; border-bottom: 1px solid var(--line-dark); padding: 3px 2px; background: transparent; color: var(--ink); font-size: 11px; font-weight: 750; }
.scenario-column-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.scenario-column-actions button { min-height: 26px; border: 0; padding: 3px 1px; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.scenario-column-actions button:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; opacity: .7; }
.scenario-metric-value { display: block; color: var(--ink); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.scenario-delta { display: block; margin-top: 1px; color: var(--green); font-size: 11px; font-weight: 600; }
.scenario-assumption-different { background: color-mix(in srgb, var(--green-soft), white 22%); color: var(--green); font-weight: 650; }
.scenario-stale { display: block; margin-top: 3px; color: #8b2831; font-size: 11px; }
.scenario-stale-cell { color: #8b2831; font-weight: 650; }

.robustness-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 9px; }
.robustness-toolbar fieldset { display: flex; flex: 1 1 auto; align-items: center; gap: 5px 10px; flex-wrap: wrap; margin: 0; padding: 0; border: 0; }
.robustness-toolbar legend { float: left; margin-right: 3px; color: var(--ink); font-size: 11px; font-weight: 750; }
.robustness-toolbar label { display: inline-flex; align-items: center; gap: 3px; min-height: 26px; color: var(--ink); font-size: 11px; white-space: nowrap; }
.robustness-toolbar input { margin: 0; accent-color: var(--green); }
.robustness-summary { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); margin-top: 8px; border: 1px solid var(--line); }
.robustness-summary > div { padding: 7px 8px; border-right: 1px solid var(--line); }
.robustness-summary > div:last-child { border-right: 0; }
.robustness-summary span { display: block; color: var(--green); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.robustness-summary strong { display: block; margin-top: 2px; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.robustness-figure { margin-top: 9px; }
.robustness-figure h3, .robustness-comparison h3 { margin: 0 0 4px; color: var(--ink); font-size: 11px; }
.robustness-figure svg { display: block; width: 100%; height: auto; overflow: visible; }
.robustness-axis { stroke: var(--line-dark); stroke-width: 1; }
.robustness-range { stroke: var(--line-dark); stroke-width: 5; stroke-linecap: round; }
.robustness-current { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 2; }
.robustness-point { fill: var(--green); stroke: #fff; stroke-width: 1.5; }
.robustness-point.is-current { fill: var(--ink); }
.robustness-point-hit { fill: transparent; pointer-events: none; }
.robustness-spec-point, .robustness-current-point { outline: none; pointer-events: none; }
.robustness-spec-point.is-hovered .robustness-point, .robustness-spec-point:focus-visible .robustness-point,
.robustness-current-point.is-hovered .robustness-point, .robustness-current-point:focus-visible .robustness-point { stroke: var(--ink); stroke-width: 2.5; }
.robustness-spec-point:focus-visible .robustness-point-hit,
.robustness-current-point:focus-visible .robustness-point-hit { fill: color-mix(in srgb, var(--teal), transparent 82%); }
.robustness-pointer-overlay { fill: transparent; pointer-events: all; cursor: default; }
.robustness-pointer-overlay.is-actionable { cursor: pointer; }
.robustness-label { fill: var(--ink); font-size: 11px; font-weight: 650; }
.robustness-tick { fill: var(--green); font-size: 11px; }
.robustness-tooltip { position: fixed; z-index: 110; width: min(320px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: hidden; padding: 9px 11px; border: 1px solid var(--green); background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 11px; line-height: 1.35; pointer-events: none; }
.robustness-tooltip > strong { display: block; font-size: 12px; }
.robustness-tooltip dl { margin: 6px 0 0; }
.robustness-tooltip dl div { display: grid; grid-template-columns: minmax(82px, .8fr) minmax(0, 1.2fr); gap: 8px; padding: 1px 0; }
.robustness-tooltip dl div.is-changed { margin-inline: -5px; padding-inline: 4px; border-left: 2px solid var(--line-dark); background: color-mix(in srgb, var(--teal), transparent 82%); }
.robustness-tooltip dt { color: var(--line); }
.robustness-tooltip dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.robustness-value-diff { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; }
.robustness-value-diff del { color: var(--line); font-weight: 500; text-decoration-color: #fff; text-decoration-thickness: 1px; }
.robustness-diff-arrow { color: var(--line-dark); font-weight: 750; }
.robustness-value-diff strong { color: #fff; font-size: inherit; font-weight: 800; }
.robustness-change-tag { display: inline-block; margin-left: 3px; color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.robustness-tooltip p { margin: 6px 0 0; color: var(--line); font-size: 10.5px; }
.robustness-comparisons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.robustness-comparison { min-width: 0; padding-top: 7px; border-top: 1px solid var(--line); }
.robustness-comparison-list { display: grid; gap: 3px; }
.robustness-comparison-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 11px; }
.robustness-comparison-row span { min-width: 0; color: var(--green); }
.robustness-comparison-row strong { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.robustness-audit { margin-top: 9px; border-top: 1px solid var(--line); }
.robustness-audit > summary { min-height: 32px; padding: 7px 0 4px; color: var(--green); font-size: 11px; font-weight: 750; cursor: pointer; }
.robustness-audit > summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus), transparent 60%); outline-offset: 2px; }
.robustness-table-wrap { max-height: 185px; overflow: auto; border: 1px solid var(--line); }
.robustness-table-wrap:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus), transparent 60%); outline-offset: -3px; }
.robustness-table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 11px; }
.robustness-table th, .robustness-table td { padding: 5px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.robustness-table th:last-child, .robustness-table td:last-child { border-right: 0; }
.robustness-table thead { position: static; }
.robustness-table thead th { position: sticky; top: 0; background: var(--paper); color: var(--ink); font-size: 11px; text-transform: uppercase; }
.robustness-table td.is-number { text-align: right; font-variant-numeric: tabular-nums; }
.robustness-table tr.is-invalid { color: #8b2831; background: #fff7f7; }
.robustness-warning { margin: 7px 0 0; color: #8b2831; font-size: 10.5px; line-height: 1.4; }

.range-filter { padding: 10px 11px 12px; }
.range-filter > div:first-child { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--ink); font-size: 9.5px; font-weight: 650; }
.range-filter output { color: var(--green); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dual-range { position: relative; height: 17px; }
.dual-range::before { content: ""; position: absolute; inset: 7px 0 auto; height: 3px; border-radius: 2px; background: var(--line); }
.dual-range::after { content: ""; position: absolute; z-index: 1; top: 7px; left: var(--range-low, 0%); right: calc(100% - var(--range-high, 100%)); height: 3px; background: var(--teal); pointer-events: none; }
.dual-range input[type="range"] { position: absolute; inset: 0; width: 100%; height: 17px; margin: 0; background: transparent; pointer-events: none; appearance: none; }
.dual-range input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: transparent; }
.dual-range input[type="range"]::-webkit-slider-thumb { position: relative; z-index: 2; width: 13px; height: 13px; margin-top: -5px; border: 1px solid white; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); appearance: none; pointer-events: auto; cursor: grab; }
.dual-range input[type="range"]::-moz-range-track { height: 3px; background: transparent; }
.dual-range input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 1px solid white; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); pointer-events: auto; cursor: grab; }
.table-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-gutter: stable; border-block: 1px solid var(--line); background: #fff; }
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1568px; font-size: 10.5px; }
th, td { padding: 7px 7px; border-right: 1px solid #edf3f5; border-bottom: 1px solid #edf3f5; text-align: left; vertical-align: middle; }
th:last-child, td:last-child { border-right: 0; }
thead { position: sticky; top: 0; z-index: 3; }
thead th { padding-top: 0; padding-bottom: 0; border-right-color: var(--line-dark); border-bottom-color: var(--line-dark); background: #f3f8fa; color: var(--ink); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
thead button[data-sort] { display: inline-flex; align-items: center; gap: 3px; border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
thead button.stacked-sort > span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
thead button.stacked-sort > span > span { white-space: nowrap; }
thead button[data-sort]::after { content: "↕"; color: var(--muted); font-size: 10px; opacity: .55; }
thead button[data-active="true"]::after { content: "↓"; color: var(--green); opacity: 1; }
thead button[data-active="true"][data-direction="asc"]::after { content: "↑"; }
.filterable-column { position: relative; padding-right: 5px; }
.header-controls {
  --header-control-size: 24px;
  --header-control-gap: 0px;
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  width: max-content;
  min-height: calc(var(--header-control-size) * 2 + var(--header-control-gap));
  padding-right: var(--header-control-size);
}
.header-controls > button[data-sort] {
  width: auto;
  min-width: max-content;
  min-height: calc(var(--header-control-size) * 2 + var(--header-control-gap));
  justify-content: flex-start;
  white-space: normal;
  line-height: 1.05;
  text-align: left;
}
.header-controls > button[data-sort]::after {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: var(--header-control-size);
  height: var(--header-control-size);
  place-items: center;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
  font-size: 8px;
  line-height: 1;
  transform: translateY(6px);
}
.header-controls > button[data-sort]:hover::after,
.header-controls > button[data-sort]:focus-visible::after { border: 0; background: transparent; color: var(--green); opacity: 1; }
.filter-menu details { position: relative; }
.filter-menu summary { position: relative; min-width: 76px; padding: 5px 20px 5px 6px; border: 1px solid var(--line-dark); border-radius: 3px; background: white; color: var(--green); font-size: 9px; font-weight: 650; text-transform: none; letter-spacing: 0; cursor: pointer; list-style: none; }
.filter-menu summary::-webkit-details-marker { display: none; }
.filter-menu summary::after { content: "▾"; position: absolute; right: 6px; }
.filter-popover { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: 245px; max-height: 280px; border: 1px solid var(--line-dark); background: white; box-shadow: 0 12px 30px rgba(45, 104, 133, .18); color: var(--ink); text-align: left; text-transform: none; letter-spacing: 0; }
.header-filter-menu {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  width: var(--header-control-size);
  height: var(--header-control-size);
}
.header-filter-menu details { width: var(--header-control-size); height: var(--header-control-size); }
.header-filter-menu summary {
  display: grid;
  width: var(--header-control-size);
  min-width: var(--header-control-size);
  height: var(--header-control-size);
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.header-filter-menu summary::before { width: 8px; height: 8px; background: var(--muted); clip-path: polygon(0 0, 100% 0, 62% 45%, 62% 100%, 38% 100%, 38% 45%); content: ""; transform: translateY(-6px); }
.header-filter-menu summary::after { display: none; }
.header-filter-menu summary:hover { border: 0; background: transparent; }
.header-filter-menu summary:focus-visible { border: 0; background: transparent; outline: 2px solid var(--green); outline-offset: -4px; }
.header-filter-menu summary[data-active="true"] { border: 0; background: transparent; }
.header-filter-menu summary:hover::before,
.header-filter-menu summary[data-active="true"]::before { background: var(--green); }
.header-filter-menu .filter-popover { top: calc(100% + 4px); right: 0; left: auto; }
[data-filter-menu="title"] .filter-popover { right: auto; left: 0; }
.filter-status { padding: 7px 8px; border-bottom: 1px solid var(--line); background: #f7fbfd; color: var(--green); font-size: 9px; font-weight: 700; }
.numeric-filter-popover { width: 270px; }
.filter-actions { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.filter-actions button { border: 0; padding: 0; background: transparent; color: var(--green); font-size: 9px; font-weight: 700; cursor: pointer; text-decoration: underline; }
.filter-options { max-height: 235px; overflow: auto; padding: 4px 0; }
.filter-options label { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 7px; padding: 5px 8px; color: var(--ink); font-size: 10px; font-weight: 450; cursor: pointer; white-space: normal; }
.filter-options label:hover { background: var(--green-soft); }
.filter-options input { margin: 1px 0 0; accent-color: var(--green); }
.filter-group + .filter-group { border-top: 1px solid var(--line); }
.filter-group-heading { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 7px; width: 100%; padding: 6px 8px; background: #f3f8fa; color: var(--green); font-size: 9px; font-weight: 750; text-align: left; cursor: pointer; }
.filter-group-heading:hover { background: var(--green-soft); }
.filter-group-heading input { margin: 1px 0 0; accent-color: var(--green); }
.filter-group-title { min-width: 0; white-space: normal; }
.filter-group label { padding-left: 18px; }
.filter-group > .filter-group-heading { padding-left: 8px; }
#organization-table tbody tr { background: white; }
#organization-table tbody tr:nth-child(even) { background: #f8fafb; }
#organization-table tbody tr:hover { background: var(--green-soft); }
#organization-table tbody tr.is-focused { outline: 2px solid var(--green); outline-offset: -2px; background: #e4f4fa; }
#organization-table tbody tr.is-excluded { color: #8a918d; }
#organization-table tbody tr.is-unavailable { opacity: .62; }
#organization-table tbody tr.is-plot-ineligible:not(.rp-reference-row) td:not(.check-column) { background: #f2f5f6; color: #7b898f; }
#organization-table tbody tr.is-plot-ineligible:not(.rp-reference-row):hover td:not(.check-column) { background: #eaf1f4; }
#organization-table tbody tr.is-plot-ineligible .organization-name,
#organization-table tbody tr.is-plot-ineligible .organization-links a,
#organization-table tbody tr.is-plot-ineligible .role-holder,
#organization-table tbody tr.is-plot-ineligible .role-title,
#organization-table tbody tr.is-plot-ineligible .source-cell a { color: #7b898f; }
.rp-reference-row td {
  position: sticky;
  z-index: 2;
  top: var(--rp-reference-top, var(--table-header-height, 29px));
  border-color: color-mix(in srgb, var(--line), transparent 68%);
  background: var(--green);
  color: white;
  font-weight: 650;
  white-space: nowrap;
}
.rp-reference-row:hover td { background: var(--green); }
.rp-reference-row .rp-reference-name { font-size: 11px; font-weight: 800; }
.rp-reference-row .rp-reference-source { color: white; text-decoration-color: color-mix(in srgb, white, transparent 38%); text-underline-offset: 2px; }
.rp-reference-row .rp-reference-preview { border-color: rgba(255, 255, 255, .72); background: transparent; color: white; }
.rp-reference-row .rp-reference-preview:hover { background: rgba(255, 255, 255, .14); }
.check-column { width: 28px; text-align: center; }
.check-column > button[data-sort] { justify-content: center; width: 100%; }
.row-toggle { accent-color: var(--green); }
#organization-table tbody tr.is-plot-ineligible .row-toggle:checked { accent-color: #7b898f; }
.org-cell { min-width: 166px; }
.organization-name { display: inline-block; max-width: 100%; color: var(--ink); font-size: 11px; font-weight: 700; text-decoration: none; }
a.organization-name:hover { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.organization-links { display: flex; width: max-content; gap: 7px; margin-top: 3px; }
.organization-links a { color: var(--muted); font-size: 8.5px; text-decoration: none; }
.organization-links a:hover { color: var(--green); text-decoration: underline; }
.title-column, .title-cell { width: 112px; min-width: 102px; max-width: 133px; }
.title-cell { color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; white-space: normal; }
.title-cell .role-title, .title-cell .role-holder { display: block; }
.title-cell .role-holder { margin-top: 3px; color: var(--ink); font-size: 8.5px; font-weight: 650; line-height: 1.25; }
.evidence-cell { color: var(--muted); white-space: nowrap; }
.tier-column, .tier-cell { width: 72px; min-width: 72px; max-width: 72px; }
.tier-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.money-cell { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.weight-column, .weight-cell { width: 82px; min-width: 82px; }
#weight-column-label { line-height: 1.05; }
#weight-column-label > span { display: block; white-space: nowrap; }
.score-column, .score-cell { min-width: 56px; }
.score-cell { text-align: right; }
.weight-input { width: 68px; min-width: 68px; border: 1px solid var(--line-dark); border-radius: 4px; padding: 5px 8px; font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.weight-input::-webkit-inner-spin-button, .weight-input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.weight-input[type="number"] { appearance: textfield; }
.weight-input:not(.is-user-modified) { background: var(--green-soft); color: var(--green); }
.weight-input.is-user-modified { border-color: var(--green); box-shadow: inset 0 0 0 1px rgba(45, 104, 133, .14); }
.url-state-error { position: fixed; z-index: 30; top: 8px; left: 50%; max-width: min(620px, calc(100vw - 24px)); margin: 0; padding: 8px 12px; border: 1px solid #b45b65; border-radius: 6px; background: #fff4f4; color: #77212a; font-size: 11px; transform: translateX(-50%); box-shadow: var(--shadow); }
.topic-cell { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metadata-cell { max-width: 180px; color: var(--muted); }
.metadata-cell.has-explainer { cursor: help; text-decoration: underline dotted color-mix(in srgb, var(--muted), transparent 35%); text-underline-offset: 2px; }
.metadata-evidence-button { max-width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: underline dotted color-mix(in srgb, var(--muted), transparent 35%); text-underline-offset: 2px; cursor: pointer; }
.metadata-evidence-button:hover, .metadata-evidence-button:focus-visible { color: var(--green); text-decoration-style: solid; }
.metadata-cell span, .metadata-cell small { display: block; }
.metadata-cell small { margin-top: 2px; color: color-mix(in srgb, var(--muted), white 18%); font-size: 8.5px; }
.number-cell { text-align: right; font-variant-numeric: tabular-nums; }
.preview-button { border: 1px solid var(--line-dark); background: var(--green-soft); color: var(--green); padding: 4px 6px; cursor: pointer; font-size: 9px; font-weight: 750; white-space: nowrap; }
.source-link { color: var(--green); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.source-cell { white-space: nowrap; }
.source-cell .preview-button { margin-right: 7px; }

@media (pointer: coarse) {
  .header-filter-menu summary::before { width: 10px; height: 10px; }
}

.organization-preview { position: fixed; z-index: 90; width: min(360px, calc(100vw - 16px)); max-height: min(360px, calc(100vh - 16px)); overflow: auto; padding: 13px 14px; border: 1px solid var(--line-dark); background: white; box-shadow: 0 16px 42px rgba(45, 104, 133, .22); color: var(--ink); }
.organization-preview strong { display: block; font-size: 13px; }
.organization-preview p { margin: 8px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.organization-preview div { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.organization-preview a { color: var(--green); font-size: 10px; font-weight: 650; text-underline-offset: 2px; }

.source-dialog { width: min(650px, calc(100vw - 30px)); max-height: calc(100vh - 30px); overflow: auto; padding: 0; border: 1px solid #8f9994; border-radius: 2px; background: var(--panel); box-shadow: 0 30px 80px rgba(0,0,0,.26); }
.source-dialog::backdrop { background: rgba(20, 28, 24, .53); backdrop-filter: blur(2px); }
.dialog-shell { position: relative; padding: 26px; }
.dialog-shell h2 { margin: 5px 0 18px; font: 650 24px/1.15 "Aspekta Variable", sans-serif; }
.dialog-close, .model-dialog-close { position: absolute; right: 13px; top: 10px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted); }
.evidence-value { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-block: 1px solid var(--line); background: var(--green-soft); }
.evidence-value span { color: var(--muted); font-size: 11px; }
.evidence-value mark { padding: 3px 7px; background: var(--line); color: var(--ink); font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.evidence-text { margin: 18px 0; line-height: 1.65; font-size: 13px; }
.evidence-meta { display: grid; grid-template-columns: 120px 1fr; margin: 0; border-top: 1px solid var(--line); font-size: 11px; }
.evidence-meta dt, .evidence-meta dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
.evidence-meta dt { padding-right: 8px; color: var(--muted); font-weight: 700; }
.evidence-meta dd { overflow-wrap: anywhere; }
.category-provenance { margin-top: 16px; border-block: 1px solid var(--line); }
.category-provenance > summary { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; color: var(--green); font-size: 11px; font-weight: 750; cursor: pointer; }
.category-provenance > summary span { color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.category-provenance-intro { margin: 0 0 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.category-provenance-records section { padding: 9px 0; border-top: 1px solid var(--line); }
.category-provenance-records h3 { display: grid; grid-template-columns: 115px 1fr; gap: 8px; margin: 0; font: inherit; }
.category-provenance-records h3 span { color: var(--muted); font-size: 10px; }
.category-provenance-records h3 strong { color: var(--ink); font-size: 10.5px; }
.category-provenance-records p { margin: 5px 0 0 123px; font-size: 10.5px; line-height: 1.5; }
.provenance-citations { margin: 5px 0 0 123px; color: var(--muted); font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.provenance-citations a, .category-provenance-links a { color: var(--green); text-underline-offset: 2px; }
.category-provenance-links { display: flex; flex-wrap: wrap; gap: 7px 12px; padding: 9px 0 12px; border-top: 1px solid var(--line); font-size: 9.5px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.dialog-actions a { display: inline-block; padding: 9px 12px; font-size: 11px; font-weight: 750; text-decoration: none; }
.secondary-link { border: 1px solid var(--line-dark); color: var(--green); }
.primary-link { background: var(--green); color: white; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 1250px) {
  .app-shell { grid-template-columns: minmax(218px, var(--settings-size)) 10px minmax(420px, 1fr); grid-template-rows: calc(100dvh - 128px) 520px; height: auto; }
  #settings-panel { grid-column: 1; grid-row: 1; }
  #settings-panel-resizer { grid-column: 2; grid-row: 1; }
  .analysis-column { grid-column: 3; grid-row: 1; }
  #table-panel-resizer { display: none; }
  .table-panel { grid-column: 1 / -1; min-height: 520px; border-radius: 4px 4px 14px 14px; }
  .settings-panel { border-radius: 14px 4px 4px 4px; }
  .analysis-column { min-height: 0; }
}

@media (max-width: 820px) {
  .app-header { align-items: flex-start; flex-direction: column; min-height: 0; }
  .header-meta { justify-content: flex-start; }
  .app-shell { display: block; height: auto; min-height: 0; padding: 8px; }
  .panel-resizer { display: none; }
  .settings-panel, .chart-panel, .quantile-panel, .table-panel { margin-bottom: 8px; border-radius: 6px; }
  .settings-panel { max-height: min(360px, 50dvh); }
  .chart-jump { display: inline-block; }
  .settings-scroll-note { display: block; margin: 8px 0 0; color: var(--muted); font-size: 11px; }
  .analysis-column { display: block; min-height: 0; }
  .chart-panel { min-height: min(480px, calc(100dvh - 24px)); max-height: calc(100dvh - 24px); }
  .chart-view-tabs { --chart-tab-height: 44px; }
  .chart-view-tab { padding-inline: 18px; }
  .chart-view-content { padding: 12px 14px 10px; }
  .chart-heading { align-items: flex-start; flex-direction: column; }
  .live-stats { justify-content: flex-start; }
  .scatter-controls { align-items: flex-start; }
  .quantile-grid, .quantile-grid.is-percentiles { grid-template-columns: repeat(2, 1fr); }
  .quantile-cell { border-bottom: 1px solid var(--line); }
  .custom-quantiles { grid-template-columns: 1fr; }
  .custom-quantiles small { grid-column: auto; }
  .table-panel { height: 620px; }
  .quantile-panel { max-height: none; }
  .results-tabs button { min-height: 44px; }
  .result-action { min-height: 44px; }
  .robustness-toolbar { align-items: stretch; flex-direction: column; }
  .robustness-toolbar .result-action { align-self: flex-start; }
  .robustness-toolbar label { min-height: 40px; padding-block: 5px; }
  .scenario-column-actions button, .robustness-audit > summary { min-height: 40px; }
  .robustness-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .robustness-summary > div:nth-child(2) { border-right: 0; }
  .robustness-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .robustness-comparisons { grid-template-columns: 1fr; }
  .category-provenance-records h3 { grid-template-columns: 1fr; gap: 3px; }
  .category-provenance-records p, .provenance-citations { margin-left: 0; }
}

@container (max-width: 520px) {
  .chart-heading { align-items: flex-start; flex-direction: column; }
  .live-stats { justify-content: flex-start; width: 100%; }
  .model-diagnostic-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-diagnostic-strip > span:nth-child(2) { border-right: 0; }
  .model-diagnostic-strip > span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .model-details-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-legend { min-height: 22px; max-height: 22px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
  .chart-legend span { flex: none; white-space: nowrap; }
}

@media (max-height: 720px) and (min-width: 821px) {
  .app-shell { min-height: 0; }
  .analysis-column { grid-template-rows: minmax(247px, 1fr) 10px minmax(60px, auto); min-height: 0; }
  .analysis-column.has-custom-results-size { grid-template-rows: minmax(247px, 1fr) 10px minmax(60px, var(--results-size)); }
  .analysis-column.has-custom-results-size.is-model-details-expanded { grid-template-rows: minmax(210px, 1fr) 10px minmax(60px, var(--results-size)); }
  .chart-heading h2 { font-size: 16px; }
  .chart-view-content { padding-block: 10px; }
  .chart-wrap { min-height: 80px; }
  .chart-panel:has(.scatter-controls:not([hidden])) .chart-wrap { min-height: 80px; }
  .chart-legend { min-height: 22px; max-height: 22px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
  .chart-legend span { flex: none; white-space: nowrap; }
  .quantile-panel { max-height: clamp(60px, calc(100dvh - 352px), min(400px, 46dvh)); }
}

@media (max-height: 720px) and (min-width: 821px) {
  @container (max-width: 520px) {
    .chart-panel { min-height: 283px; }
    .chart-wrap,
    .chart-panel:has(.scatter-controls:not([hidden])) .chart-wrap { min-height: 80px; }
    .quantile-panel { max-height: clamp(60px, calc(100dvh - 388px), min(400px, 46dvh)); }
  }
}

/* A short landscape screen scrolls the workspace instead of squeezing the plot
   and its axis labels into the results/table boundary. */
@media (min-width: 821px) and (max-width: 1250px) and (max-height: 450px) {
  .app-shell { grid-template-rows: 560px 520px; }
  .analysis-column,
  .analysis-column.has-custom-results-size,
  .analysis-column.has-custom-results-size.is-model-details-expanded {
    grid-template-rows: minmax(420px, 1fr) 10px minmax(112px, var(--results-size, auto));
  }
  .chart-wrap,
  .chart-panel:has(.scatter-controls:not([hidden])) .chart-wrap { min-height: 220px; }
}
/* Model specifications and uncertainty views remain usable on small screens. */
.model-explanation-dialog { width: 88vw; max-width: 1400px; height: 87vh; max-height: 90vh; box-sizing: border-box; padding: 2rem 2.5rem; border: 1px solid #b6c9ce; border-radius: 14px; color: #253b42; background: #fbfdfd; }
.model-explanation-dialog::backdrop { background: rgb(18 44 52 / 48%); }
.model-explanation-dialog > form { position: sticky; top: -24px; height: 0; margin: -24px -32px 24px 0; text-align: right; z-index: 2; }
.model-dialog-close { position: relative; top: 0; right: 0; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: #fbfdfd; color: var(--green); font-size: 24px; cursor: pointer; }
.model-explanation-dialog h2 { padding-right: 2rem; }
.model-explanation-dialog section { margin: 1.5rem 0; }
.model-explanation-dialog h3 { margin-bottom: .5rem; }
.model-explanation-dialog p { max-width: 100ch; line-height: 1.6; }
.model-equation { padding: 1rem; background: #edf3f4; border-radius: 7px; overflow-x: auto; white-space: pre-wrap; line-height: 1.65; font-size: .95rem; }
.model-effect-figure { width: 100%; min-width: 900px; }
#model-explanation-content { overflow-x: auto; }
.model-driver-button { border: 0; padding: 0; background: transparent; font: inherit; color: inherit; text-align: left; text-decoration: underline dotted; cursor: pointer; }
.model-spec-button { margin-left: .45rem; flex-shrink: 0; }
.organization-footprint { display: block; font-size: 8px; color: var(--muted); }
.metric-tooltip { width: auto; height: auto; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; text-decoration: underline dotted; white-space: nowrap; }
.quantile-uncertainty { display: block; font-size: .72rem; color: #52879e; margin-top: .3rem; }
.model-focus-mixture { grid-column: 1 / -1; padding: .6rem; background: #edf3f4; border-radius: 6px; }
.model-focus-mixture p { font-size: .75rem; }
#model-focus-weights label { display: grid; grid-template-columns: 1fr 60px; gap: .4rem; align-items: center; font-size: .73rem; margin: .25rem 0; }
#model-focus-weights input { width: 60px; }
#model-focus-error { color: #9f3d33; }
@media (max-width: 700px) { .model-explanation-dialog { width: 94vw; padding: 1rem; } .model-equation { font-size: .8rem; } }

.chart-wrap:has(#scatter-matrix:not([hidden])) { overflow: hidden; }
#salary-chart[hidden] { display: none; }
#scatter-matrix { height: 100%; }
.relationship-explorer { display: flex; flex-direction: column; flex: 1; height: 100%; min-height: 0; min-width: 0; }
.relationship-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 28%); gap: 10px; flex: 1; min-height: 0; }
.relationship-controls { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0; font-size: 11px; }
.relationship-controls > label { display: grid; gap: 3px; font-size: inherit; min-width: 0; max-width: 100%; }
.relationship-controls select { padding: 4px 28px 4px 6px; min-height: 28px; min-width: 0; max-width: 100%; text-overflow: ellipsis; font: inherit; }
.relationship-features { min-width: 0; min-height: 0; margin: 0; padding: 5px; border: 1px solid var(--line); border-radius: 4px; overflow: auto; font-size: 11px; }
.relationship-features legend { font-weight: 650; }
.relationship-feature-list { display: grid; gap: 7px; padding-top: 4px; }
.relationship-feature-list label { display: flex; gap: 5px; align-items: center; font: inherit; }
.relationship-feature-list input { margin: 0; accent-color: var(--green); }
.relationship-feature-group { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 6px 0; border: 0; border-top: 1px solid var(--line); }
.relationship-feature-group legend { padding: 0 4px 0 0; color: var(--muted); }
.relationship-sizing { display: flex; align-self: flex-end; gap: 8px; min-height: 28px; }
.relationship-sizing button { font: inherit; }
.relationship-sizing button[aria-pressed="true"] { font-weight: 750; color: var(--ink); }
.relationship-explorer.is-expanded .relationship-scroll { overflow: auto; }
.relationship-explorer.is-expanded .relationship-matrix { width: auto; height: auto; min-width: 100%; max-width: none; }
.relationship-scroll { min-width: 0; min-height: 0; overflow: hidden; }
.relationship-matrix { display: block; width: 100%; height: 100%; max-width: 100%; font-family: inherit; }
.model-explanation-dialog[open]:has(.relationship-explorer) { display: flex; flex-direction: column; overflow: hidden; }
.model-explanation-dialog:has(.relationship-explorer) > h2 { flex: none; }
.model-explanation-dialog:has(.relationship-explorer) #model-explanation-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.model-joint-explorer { display: flex; flex: 1; min-height: 0; }
.relationship-cell[role="button"] { cursor: pointer; }
.relationship-cell[role="button"]:hover > rect:first-child, .relationship-cell[role="button"]:focus > rect:first-child { stroke: #253b42; stroke-width: 2; }
.relationship-note { margin: 6px 0; font-size: 11px; line-height: 1.45; color: var(--muted); }
#model-joint-drivers { margin: 12px 0 8px; font-size: 10px; }
#model-driver-joint { padding-bottom: 64px; }
#model-joint-preview { margin: 0 44px 0 84px; min-width: 50px; }
.compact-correlation { position: relative; aspect-ratio: 1; width: 100%; }
.compact-correlation svg { display: block; width: 100%; height: 100%; }
.compact-correlation-label { position: absolute; font-size: 7px; line-height: 1; white-space: nowrap; }
.compact-correlation-label.is-left { right: calc(100% + 4px); transform: translateY(-50%); }
.compact-correlation-label.is-bottom { top: calc(100% + 4px); writing-mode: vertical-rl; transform: translateX(-50%); }
.model-effect-row.is-selected .model-effect-estimate { font-weight: 700; }
.driver-view-actions { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
@media (max-width: 700px) { .model-explanation-dialog > form { top: -8px; margin: -8px -8px 8px 0; } }

.model-contribution-heading { display: grid; grid-template-columns: 80px 1fr; gap: 4px; margin: 5px 0 2px; color: var(--muted); font-size: 8px; font-weight: 650; }
.model-contribution-heading span:last-child { text-align: center; }
.model-sort-button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.model-comparison-table th[aria-sort="ascending"] button::after { content: " ▴"; }
.model-comparison-table th[aria-sort="descending"] button::after { content: " ▾"; }
.model-settings label:not(:has(input[type="checkbox"])) { display: grid; gap: 3px; min-width: 0; color: var(--muted); font-size: 10px; font-weight: 650; }
.model-settings :is(select, input[type="number"]) { font-size: 10px; font-weight: 450; padding: 7px 6px; }
.model-settings select { padding-right: 25px; }
.model-settings option { font-size: inherit; }
.model-settings label > span { color: inherit; font-size: inherit; font-weight: inherit; }
.model-settings .model-option { font-size: 10px; }
#model-settings-note:empty { display: none; }
.results-tabs:has(#results-tab-model-details:not([hidden])) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.model-comparison-table thead .model-sort-button { white-space: normal; text-decoration: none; }

#empirical-robustness-options[hidden] { display: none; }

.benchmark-scope-note { max-width: 78ch; margin: .5rem 0 0; color: var(--muted, #52646d); font-size: .82rem; line-height: 1.4; }

/* Let the workspace use the height left by navigation and the wrapping header. */
@media (min-width: 1251px) {
  body { display: flex; flex-direction: column; height: 100dvh; }
  .app-header { flex-shrink: 0; }
  .app-shell { flex: 1 1 0; height: auto; }
}
