.ref-page {
  --sidebar-width: 258px;
  --surface: #fafaf6;
  --ink: #183c36;
  --body: #455b54;
  --faint: #61736a;
  --hairline: #dbe1d5;
  --brass: #967642;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  background: var(--surface);
  color: var(--ink);
}

.ref-page button, .ref-page select, .ref-page input { font: inherit; }
.ref-page button { cursor: pointer; }
.ref-page button:disabled { cursor: default; }
.ref-page :is(input, select, button, summary, a):focus-visible {
  outline: 3px solid #a58043;
  outline-offset: 3px;
}
.skip-link { position: fixed; z-index: 40; top: 8px; left: 8px; transform: translateY(-160%); padding: 12px; background: white; color: var(--ink); }
.skip-link:focus { transform: translateY(0); }
.ref-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.ref-icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.ref-sidebar { padding: 25px 16px 16px; }
.ref-sidebar .brand { gap: 8px; padding: 0 3px 28px; }
.ref-brand-mark { width: 45px; height: 45px; object-fit: contain; }
.ref-sidebar .brand-subtitle { text-transform: uppercase; margin-top: 4px; }
.ref-browse { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.ref-sidebar-heading { padding: 0 12px; color: #afc5b9; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; }
.scope-list { padding-top: 12px; }
.ref-page .scope-button { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid transparent; background: transparent; color: #d4dfd6; text-align: left; border-radius: 5px; font-size: 12px; line-height: 1.4; }
.scope-button .ref-icon { color: #abc2af; width: 15px; height: 15px; }
.scope-button span { flex: 1; }
.scope-button small { color: #b7cbbf; font: 10px var(--mono); }
.ref-page .scope-button:hover { background: #1a4943; }
.ref-page .scope-button[aria-current="true"] { border-color: #477168; background: #2a544b; color: white; }
.scope-button[aria-current="true"] .ref-icon { color: #e7ca88; }
.chapter-nav-title { margin: 18px 0 10px; padding-top: 23px; border-top: 1px solid #366057; }
.ref-chapters { overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: #567369 transparent; overscroll-behavior: contain; }
.ref-page .chapter-button { min-height: 36px; padding: 8px 11px; }
.ref-page .chapter-button span { font-size: 12px; }
.library-return { flex: none; display: flex; gap: 9px; margin: 13px 0 0; border-top: 1px solid #366057; padding: 17px 10px 4px; color: #e3e8df; text-decoration: none; font-size: 12px; }
.library-return:hover, .ref-crumb a:hover { text-decoration: underline; }
.library-return span { color: #e1c487; }
.browse-toggle { display: none; }

.ref-content { max-width: 1580px; margin: auto; padding: 25px clamp(20px, 3.5vw, 62px) 0; }
.ref-crumb { display: flex; align-items: center; gap: 9px; color: #63776c; font-size: 11px; }
.ref-crumb a { color: inherit; text-decoration: none; }
.ref-crumb span[aria-hidden] { color: #acb9a8; }
.ref-intro { position: relative; display: flex; gap: 3%; align-items: center; justify-content: space-between; padding: 26px 4% 25px 0; }
.ref-intro-text { max-width: 615px; }
.ref-intro h1 { margin: 0; color: #173f36; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(40px, 3.75vw, 66px); letter-spacing: -.047em; line-height: 1.03; }
.title-break { display: none; }
.ref-intro-text p { max-width: 56ch; margin: 14px 0 0; color: var(--body); font-size: 14px; line-height: 1.68; }
.anatomy-figure { margin: 0; flex: none; width: clamp(165px, 17vw, 290px); text-align: center; }
.anatomy-figure img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; filter: grayscale(100%) sepia(15%); opacity: .88; }
.anatomy-figure figcaption { margin-top: 8px; color: #66796a; font: 9px/1.45 var(--mono); letter-spacing: .03em; }
.anatomy-figure figcaption span { margin: 0 3px; color: var(--brass); }
.ref-metrics { display: flex; border-block: 1px solid var(--hairline); padding: 14px 0; margin-bottom: 22px; }
.ref-metrics > div { padding: 0 clamp(12px, 2.4vw, 38px); display: flex; gap: 10px; align-items: baseline; border-left: 1px solid var(--hairline); }
.ref-metrics > div:first-child { padding-left: 0; border: 0; }
.ref-metrics strong { font: 400 clamp(23px, 2.05vw, 34px)/1 Georgia, serif; letter-spacing: -.045em; font-variant-numeric: lining-nums tabular-nums; }
.ref-metrics span { color: var(--faint); font-size: 11px; }
.ref-tabs { gap: 25px; margin-bottom: 19px; border-color: var(--hairline); }
.ref-tabs .tab { font-size: 12px; padding-bottom: 12px; color: var(--faint); }
.ref-tabs .tab[aria-selected="true"] { color: #1e5544; }
.ref-workbench { display: grid; grid-template-columns: minmax(0, 1.03fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.scenario-column { display: grid; gap: 18px; min-width: 0; }
.ref-page .panel { border-color: var(--hairline); box-shadow: 0 2px 8px #334a3005; border-radius: 8px; }
.ref-editor, .ref-results, .ref-method { padding: clamp(16px, 1.8vw, 28px); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; }
.card-top h2, .ref-method h2, .ref-source h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(22px, 1.8vw, 30px); font-weight: 400; letter-spacing: -.045em; line-height: 1.1; }
.ref-page .reset-all { color: #4e6858; gap: 4px; white-space: nowrap; font-size: 11px; }
.ref-page .reset-all:disabled { opacity: .58; }
.card-caption, #result-empty p { font-size: 12px; line-height: 1.6; color: var(--faint); }
.card-caption { margin: 9px 0 15px; }
.editor-search { margin-top: 18px; display: flex; gap: 9px; align-items: center; border: 1px solid #cdd7c9; border-radius: 5px; padding: 0 10px; background: #fcfdfb; color: #6d7d6e; }
.editor-search:focus-within { outline: 2px solid #86a595; outline-offset: 1px; }
.editor-search input { min-width: 0; flex: 1; border: 0; background: transparent; height: 36px; font-size: 12px; color: var(--ink); }
.editor-search input:focus-visible { outline: 0; }
.model-filter { display: grid; gap: 5px; margin-top: 12px; color: var(--faint); font-size: 10px; line-height: 1.4; font-weight: 600; }
.model-filter select { width: 100%; min-width: 0; color: #345346; background: #fff; border: 1px solid #cdd7c9; padding: 7px 6px; border-radius: 4px; font-size: 12px; font-weight: 400; text-overflow: ellipsis; }
.filter-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; color: #596d5d; margin: 15px 0 0; font-size: 11px; line-height: 1.5; }
.parameter-row { border-top: 1px solid #e4e9e1; margin-top: 12px; padding-top: 13px; }
.parameter-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.parameter-heading label { align-self: center; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.4; }
.parameter-term { display: flex; align-items: center; min-width: 0; align-self: center; }
.parameter-term label { overflow-wrap: anywhere; }
.ref-page .term-help { flex: none; font: 600 12px/1 Inter, "Segoe UI", system-ui, sans-serif; }
.ref-page .parameter-number { width: 61px; max-width: 61px; height: 28px; padding: 2px; font: 12px var(--mono); color: #255b47; border: 1px solid #cbdacb; background: #f4f8f2; }
.ref-page .parameter-number[aria-invalid="true"] { border-color: #ab593d; background: #fff3ed; }
.ref-page .parameter-range { margin: 12px 0 8px; }
.range-caption { display: flex; align-items: center; justify-content: space-between; font: 10px var(--mono); color: #657767; gap: 5px; }
.range-caption span:nth-child(2) { text-align: center; font: 10px/1.35 Inter, "Segoe UI", sans-serif; }
.parameter-row[data-edited="true"] .range-caption span:nth-child(2) { color: #926536; }
.source-info { margin-top: 8px; font-size: 11px; color: var(--body); }
.source-info summary { cursor: pointer; width: fit-content; color: #496454; line-height: 1.5; }
.source-info p { margin: 7px 0; line-height: 1.55; }
.source-info code { overflow-wrap: anywhere; font: 10px/1.5 var(--mono); }
.source-info ul { margin: 7px 0 0; padding-left: 16px; }
.source-info li { margin: 5px 0; line-height: 1.6; }
.ref-page :is(.source-info, .ref-method, .model-links) a { color: #24684e; text-underline-offset: 2px; }
.result-source, .model-links { overflow-wrap: anywhere; }
.empty-filter { font-size: 12px; line-height: 1.6; color: #5e7263; margin: 18px 0 3px; }
.pager { border-top: 1px solid #e4e9e1; display: flex; gap: 9px; align-items: center; justify-content: center; margin-top: 17px; padding-top: 13px; color: var(--faint); font-size: 11px; }
.pager button, .inline-action { border-radius: 4px; border: 1px solid #cdd8cd; background: #f8faf5; color: #2d5543; }
.pager button { height: 28px; width: 31px; }
.pager button:disabled { opacity: .45; }
.profile-status { flex: none; color: #476853; font: 10px/1.3 var(--mono); display: flex; align-items: center; gap: 5px; padding: 5px 0; }
.profile-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #658568; }
.profile-status.edited::before { background: #ad8446; }
.profile-chart { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 4px; padding-top: 8px; }
.chart-bin { min-width: 0; }
.chart-bin-value { display: block; color: #586d5d; font: 9px var(--mono); text-align: center; height: 16px; }
.chart-tracks { display: flex; justify-content: center; align-items: end; gap: 2px; height: 63px; border-bottom: 1px solid #bdcbbc; background: repeating-linear-gradient(to top, transparent, transparent 20px, #e9ede6 20px, #e9ede6 21px); }
.chart-bar { width: min(14px, 27%); display: block; }
.chart-bar.reference, .legend-reference { background-color: #c3c9a2; }
.chart-bar.scenario, .legend-scenario { background-color: #467964; }
.bin-label { font: 9px/1.3 var(--mono); text-align: center; color: #617265; display: block; margin-top: 6px; white-space: nowrap; }
.chart-legend { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 13px; font-size: 10px; color: #536b5a; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; }
.ref-page .ref-run { font-size: 13px; gap: 8px; }
.ref-run .run-arrow { margin-left: auto; }
.ref-run .ref-icon:first-child { width: 12px; }
#run-note { color: var(--faint); text-align: center; font-size: 10px; line-height: 1.5; margin: 8px 0 0; }
#run-error { margin: 12px 0 0; }
#result-empty p { margin: 12px 0 0; }
.ref-results .result-status { font-size: 10px; color: #5b7062; }
.ref-results .result-status.stale { color: #855d2d; }
.run-summary { font-size: 13px; line-height: 1.55; color: #345844; margin: 14px 0 0; }
.section-results { border-top: 1px solid #e2e7dc; padding: 11px 0; font-size: 12px; color: var(--body); }
.section-results-heading { display: flex; align-items: center; margin: 0; }
.ref-page .section-results-toggle { min-width: 0; display: flex; align-items: center; gap: 5px; border: 0; background: none; padding: 3px 0; color: #395d48; font-size: 12px; font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.section-results-toggle::before { content: ''; flex: none; width: 0; height: 0; border: 4px solid transparent; border-left-color: currentColor; }
.section-results-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.ref-results { container-type: inline-size; }
.output-table { table-layout: fixed; width: 100%; border-collapse: collapse; margin: 7px 0 0; }
.output-table th { color: var(--faint); font-size: 9px; font-weight: 500; text-align: right; padding: 5px 2px; }
.output-table td { border-top: 1px solid #edf0e9; padding: 6px 2px; }
.output-table th:first-child, .output-table td:first-child { width: 44%; text-align: left; padding-left: 0; }
.output-table td:not(:first-child) { text-align: right; overflow-wrap: anywhere; font: 10px/1.5 var(--mono); }
.output-table .delta { font-weight: 600; color: #2c664f; }
.output-term { overflow-wrap: anywhere; font-size: 11px; line-height: 1.6; }
.output-table th .term-help { width: 17px; min-width: 17px; height: 17px; margin-left: 3px; font-size: 11px; }
@container (max-width: 430px) {
  .output-table th span { display: block; }
  .output-table th .term-help { margin: 3px 0 0; }
}
.model-links { margin: 10px 0 14px; font-size: 11px; display: flex; flex-wrap: wrap; gap: 10px; }
.ref-downloads { display: block; margin: 15px 0; padding: 12px; border: 1px solid var(--hairline); border-radius: 5px; }
.ref-downloads .download-label { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.ref-downloads .download-description { margin: 4px 0 9px; font-size: 11px; line-height: 1.5; color: var(--faint); overflow-wrap: anywhere; }
.ref-downloads .download-actions { flex-wrap: wrap; gap: 6px; }
.ref-downloads .download-button { min-height: 30px; justify-content: center; color: #365c46; font-size: 11px; font-weight: 600; }
.ref-downloads .download-button:disabled { opacity: .5; }
#download-status { margin: 0; color: var(--faint); font-size: 11px; line-height: 1.5; }
#download-status:not(:empty) { margin-top: 8px; }
#download-error { margin: 10px 0 0; padding: 8px; }
.ref-method { max-width: 850px; color: var(--body); }
.ref-method h3 { font-size: 15px; margin: 25px 0 6px; font-weight: 600; color: var(--ink); }
.ref-method p { margin: 7px 0; font-size: 13px; line-height: 1.7; }
.ref-source label { display: block; margin: 18px 0 5px; color: var(--faint); font-size: 11px; font-weight: 600; }
.ref-source select { display: block; width: 100%; max-width: 580px; min-width: 0; padding: 8px; border: 1px solid #cdd7c9; border-radius: 4px; background: white; color: #345346; font-size: 13px; }
.ref-source .source-note { color: var(--faint); font-size: 11px; overflow-wrap: anywhere; }
.ref-source .source-code-scroll { margin-top: 10px; }
.method-link { display: inline-block; font-size: 12px; margin: 15px 0 0; }
.ref-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--faint); border-top: 1px solid var(--hairline); margin-top: 26px; padding: 18px 0; font-size: 10px; }
.ref-footer span:first-child { font-family: Georgia, serif; font-size: 15px; }
.ref-page .inline-action { padding: 3px 8px; margin-left: 5px; font-size: 11px; }
@media (max-width: 1250px) {
  .ref-page { --sidebar-width: 226px; }
  .ref-content { padding-inline: 25px; }
  .ref-intro { padding-right: 0; }
  .ref-workbench { gap: 14px; }
  .ref-editor, .ref-results { padding: 18px; }
}
@media (max-width: 1040px) {
  .ref-page { --sidebar-width: 201px; }
  .ref-sidebar { padding-inline: 10px; }
  .ref-workbench { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
  .ref-content { padding-inline: 18px; }
  .ref-intro h1 { font-size: clamp(36px, 4.5vw, 48px); }
  .ref-intro-text p { font-size: 13px; }
  .ref-metrics > div { gap: 6px; padding-inline: 13px; }
  .ref-editor, .ref-results { padding: 14px; }
  .card-top h2 { font-size: 22px; }
}
@media (max-width: 720px) {
  .ref-page .app-shell { display: block; }
  .ref-page .ref-sidebar { width: 100%; position: relative; height: auto; min-height: 0; padding: 8px 16px; display: grid; grid-template-columns: 1fr auto; align-items: center; z-index: auto; }
  .ref-sidebar .brand { margin: 0; padding: 0; gap: 5px; }
  .ref-brand-mark { width: 34px; height: 34px; }
  .ref-sidebar .brand-name { font-size: 15px; }
  .ref-sidebar .brand-subtitle { font-size: 6px; margin-top: 2px; }
  .ref-page .browse-toggle { display: flex; align-items: center; gap: 3px; border: 1px solid #527368; padding: 5px 6px; background: transparent; border-radius: 4px; color: #f3f4e9; font-size: 11px; }
  .ref-browse, .library-return { display: none; }
  .ref-sidebar.open .ref-browse { display: flex; grid-column: 1/-1; margin: 15px 0 0; }
  .ref-sidebar.open .ref-chapters { max-height: 180px; }
  .ref-sidebar.open .library-return { display: flex; grid-column: 1/-1; margin-bottom: 8px; }
  .chapter-nav-title { padding-top: 12px; margin: 10px 0 4px; }
  .ref-main { width: 100%; margin: 0; }
  .ref-content { padding: 15px 16px 0; }
  .ref-intro { padding: 18px 0; gap: 8px; }
  .ref-intro-text { min-width: 0; }
  .ref-intro h1 { font-size: clamp(31px, 6.5vw, 42px); }
  .ref-intro-text p { margin-top: 8px; font-size: 12px; line-height: 1.55; }
  .anatomy-figure { width: clamp(82px, 24vw, 160px); }
  .anatomy-figure figcaption { font-size: 7px; }
  .ref-metrics { margin-bottom: 14px; padding: 10px 0; }
  .ref-metrics > div { display: grid; gap: 3px; flex: 1; padding: 0 9px; }
  .ref-metrics strong { font-size: 23px; }
  .ref-metrics span { font-size: 9px; }
  .ref-tabs { gap: 18px; margin-bottom: 13px; }
  .ref-tabs .tab { font-size: 11px; }
  .ref-workbench { display: flex; flex-direction: column; gap: 12px; }
  .ref-editor, .scenario-column { width: 100%; }
  .scenario-column { gap: 12px; }
  .ref-editor { order: 2; }
  .chart-tracks { height: 42px; }
  .ref-footer { margin-top: 16px; }
}

.ref-page .editor-run { display: none; }
.ref-page .source-info .binding-definition { margin: 2px 0 6px; }
.source-info ul { max-height: 240px; overflow-y: auto; }
@media (max-width: 920px) {
  .ref-page .ref-workbench { display: flex; flex-direction: column; }
  .ref-page .scenario-column { display: contents; }
  .ref-workbench > .ref-editor, .scenario-column > section { width: 100%; }
  .ref-page .ref-editor { order: 1; }
  .ref-page #circuit-panel { order: 0; }
  .ref-page .ref-results { order: 2; }
  .ref-page .editor-run { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12px; }
}

.ref-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--hairline); margin-bottom: 19px; }
.ref-toolbar .ref-tabs { margin-bottom: 0; border: 0; align-self: stretch; align-items: stretch; }
.ref-toolbar .tab { padding: 9px 0 11px; }
.ref-toolbar .ref-run { width: auto; min-width: 152px; padding: 9px 13px; margin-bottom: 7px; gap: 7px; font-size: 12px; }
.ref-toolbar .ref-run .run-arrow { margin-left: 10px; }
.ref-toolbar .ref-run .ref-icon { height: 15px; width: 15px; }
#run-feedback #run-note:not(.sr-only) { text-align: right; margin: -12px 0 15px; font-size: 11px; }
#run-feedback #run-error { margin: 0 0 14px; }
.distribution-disclosure { font-size: 11px; color: #46624e; margin-top: 10px; }
.distribution-disclosure > summary { cursor: pointer; line-height: 1.5; }
.distribution-disclosure > summary > span:first-child { margin-left: 2px; }
.distribution-disclosure .profile-status { float: right; padding: 1px 0; }
.distribution-disclosure .card-caption { margin: 11px 0 2px; font-size: 11px; }
.distribution-disclosure .chart-legend { margin-bottom: 15px; }
@media (max-width: 720px) {
  .ref-toolbar { gap: 6px; margin-bottom: 13px; }
  .ref-toolbar .ref-run { min-width: 0; gap: 5px; padding: 7px 8px; font-size: 11px; }
  .ref-toolbar .ref-run .run-arrow { display: none; }
  .ref-toolbar .ref-tabs { gap: 12px; }
  .ref-toolbar .tab { gap: 4px; }
  .ref-toolbar .tab .ref-icon { width: 12px; height: 12px; }
  #run-feedback #run-note:not(.sr-only) { margin: -5px 0 10px; font-size: 10px; }
}
@media (max-width: 359px) {
  .ref-toolbar .ref-tabs { gap: 9px; }
  .ref-toolbar .tab .ref-icon { display: none; }
}
@media (max-width: 460px) {
  .ref-toolbar { flex-wrap: wrap; }
  .ref-toolbar .ref-tabs { width: 100%; justify-content: space-between; flex-wrap: nowrap; }
  .ref-toolbar .ref-run { width: 100%; justify-content: center; }
  .ref-source { padding: 16px; }
}

.ref-toolbar .run-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.ref-toolbar .run-actions .ref-run { margin-bottom: 0; }
.saved-run-open { padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 5px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.saved-run-open:hover { border-color: #6c8a74; background: #f5f8f3; }
.saved-run-message { margin: 0 0 14px; padding: 9px 12px; border-left: 3px solid #77917c; background: #f2f6f0; color: #345148; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.saved-run-message strong { margin-right: 5px; }
.saved-run-message details { margin-top: 5px; }
.saved-run-message details summary { cursor: pointer; }
.saved-run-message details p { margin: 5px 0; }
.saved-run-message details ul { margin: 4px 0; max-height: 10rem; overflow-y: auto; }
#saved-run-error { margin: 0 0 14px; }
@media (max-width: 860px) {
  .ref-toolbar:has(.run-actions:not([hidden])) { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .ref-toolbar .run-actions { width: 100%; justify-content: flex-start; }
  .ref-toolbar .run-actions .ref-run { width: auto; min-width: 0; flex: 1 1 auto; }
}

.ref-page .changed-model-count {
  display: inline;
  border: 0;
  border-radius: 2px;
  padding: 2px 0;
  background: transparent;
  color: #246545;
  font: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ref-page .changed-model-count[aria-pressed="true"] { background: #e0ecdf; }
.result-filter-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ref-page .result-filter-line button { padding: 3px; font-size: 11px; color: #246545; text-decoration: underline; }
.output-filter { display: flex; align-items: center; gap: 7px; min-height: 32px; font-size: 12px; color: var(--body); cursor: pointer; }
.output-filter input { width: 16px; height: 16px; margin: 0; accent-color: #326649; }
.saved-model-heading { margin: 16px 0 6px; font-size: 14px; color: var(--ink); }
.saved-model-heading ~ p { margin: 6px 0; color: var(--body); font-size: 12px; line-height: 1.55; }
