.dea-page { min-height: 100vh; }

.dea-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.25rem;
  align-items: start;
}

.dea-content { min-width: 0; display: grid; gap: 1.25rem; }

.dea-page section[id] { scroll-margin-top: 6rem; }

.dea-side-nav { position: sticky; top: 6rem; padding: 1rem; }
.dea-side-nav h2 { margin: 0 0 1rem; }
.dea-side-nav nav { display: grid; gap: .45rem; }
.dea-side-nav a {
  min-height: 2.35rem;
  display: flex;
  align-items: center;
  padding: .48rem .7rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: .88rem;
  font-weight: 720;
  text-decoration: none;
}
.dea-side-nav a:hover, .dea-side-nav a:focus { color: var(--blue-600); border-color: rgba(31,111,235,.28); background: #fff; }
.dea-side-nav a.hidden, .dea-side-nav a[hidden] { display: none !important; }

.dea-workflow { padding: 1rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm); }
.dea-workflow ol { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .7rem; margin: 0; padding: 0; list-style: none; }
.dea-workflow li { position: relative; min-width: 0; padding: .8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.dea-workflow li span { display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin-right: .45rem; border: 1px solid var(--border); border-radius: 50%; color: var(--text-secondary); font-weight: 800; }
.dea-workflow li strong { color: var(--navy-950); }
.dea-workflow li small { display: block; margin: .55rem 0 0 2.55rem; color: var(--text-secondary); line-height: 1.4; }
.dea-workflow li.active span { border-color: var(--blue-600); background: var(--blue-600); color: #fff; }
.dea-workflow li.complete span { border-color: #16a34a; background: #dcfce7; color: #166534; }

.section-header, .results-header, .subsection-heading, .detail-selector {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.section-header, .results-header { margin-bottom: 1rem; }
.section-header h2, .results-header h2, .subsection-heading h3, .detail-selector h3 { margin: 0 0 .25rem; }
.section-header p, .results-header p, .subsection-heading p, .detail-selector p { margin: 0; color: var(--text-secondary); }
.editor-actions, .actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.privacy-note { margin-bottom: 1rem; padding: .7rem .8rem; }

.template-loader { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: .75rem; }
.template-loader label { display: grid; min-width: 0; gap: .4rem; color: var(--navy-950); font-weight: 750; }
.template-loader select { width: 100%; min-height: 44px; padding: .62rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-primary); font: inherit; }
.template-helper { margin: .55rem 0 0; color: var(--text-secondary); font-size: .9rem; }
.template-context { margin: 1rem 0; padding: 1rem; border: 1px solid #b9d5ff; border-left: 4px solid var(--blue-600); border-radius: 8px; background: #f3f8ff; color: var(--text-secondary); }
.template-context > strong { display: block; color: var(--navy-950); font-size: 1rem; }
.template-context p { margin: .35rem 0 0; }
.template-context-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; margin-top: .8rem; }
.template-context-grid div { padding: .7rem; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.template-context-grid span { display: block; color: var(--blue-600); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.template-context-grid strong { display: block; margin-top: .25rem; color: var(--navy-950); }
.template-measures { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; margin-top: .65rem; }
.template-measures section { padding: .75rem; border-radius: 7px; background: #fff; }
.template-measures h4 { margin: 0 0 .4rem; color: var(--navy-950); }
.template-measures ul { display: grid; gap: .4rem; margin: 0; padding-left: 1.1rem; }
.template-measures li { line-height: 1.45; }
.template-safeguard { margin-top: .75rem !important; padding-top: .75rem; border-top: 1px solid #b9d5ff; }

.model-choice-grid, .measure-builder { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.model-choice-grid label, .upload-row label, .detail-selector label { display: grid; min-width: 0; gap: .4rem; color: var(--navy-950); font-weight: 750; }
.model-choice-grid select, .upload-row input, .detail-selector select, .measure-row input, .data-table input {
  width: 100%; min-height: 42px; padding: .62rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-primary); font: inherit;
}
.model-choice-grid small { color: var(--text-secondary); font-size: .84rem; font-weight: 500; line-height: 1.5; }
.method-note, .import-guidance { margin-top: 1rem; padding: 1rem; border-left: 3px solid var(--blue-500); background: var(--surface); color: var(--text-secondary); line-height: 1.6; }
.method-note strong, .import-guidance h3, .import-guidance strong { color: var(--navy-950); }
.import-guidance h3, .import-guidance p { margin: 0; }
.import-guidance > p + * { margin-top: .75rem; }
.import-columns { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; margin: 1rem 0; }
.import-columns div { display: grid; gap: .3rem; padding: 0 1rem; border-left: 1px solid var(--border); }
.import-columns div:first-child { padding-left: 0; border-left: 0; }
.import-columns span { font-size: .9rem; }
.example-row { padding: .65rem .75rem; border-radius: 7px; background: var(--blue-100); }

.measure-builder { margin-top: 1.2rem; }
.measure-builder > div { min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.measure-list { display: grid; gap: .55rem; margin-top: .75rem; }
.measure-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .5rem; align-items: center; }
.measure-row button, .data-table .remove-dmu { min-width: 44px; padding: .55rem; }
.upload-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: .75rem; margin-top: 1rem; }
.upload-status { margin: .6rem 0 0; color: var(--text-secondary); font-size: .9rem; }
.data-heading { margin-top: 1.25rem; }
.sample-adequacy { margin-top: .8rem; padding: .8rem; border: 1px solid var(--border); border-left: 4px solid var(--blue-600); border-radius: 8px; background: var(--surface); color: var(--text-secondary); }
.sample-adequacy strong { color: var(--navy-950); }
.sample-adequacy p { margin: .3rem 0 0; }
.sample-adequacy.warning { border-color: #f5c451; border-left-color: #d97706; background: #fff9e8; }
.sample-adequacy.ready { border-color: #86efac; border-left-color: #16a34a; background: #f0fdf4; }
.data-quality-panel, .model-guidance, .executive-summary-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.data-quality-panel .subsection-heading { align-items: center; }
.quality-status {
  display: inline-flex;
  min-height: 1.9rem;
  flex: 0 0 auto;
  align-items: center;
  padding: .3rem .6rem;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: .75rem;
  font-weight: 800;
}
.quality-status.ready { background: #dcfce7; color: #047857; }
.quality-status.warning { background: #fff4d6; color: #9a6700; }
.quality-status.critical { background: #fff1f0; color: #b42318; }
.quality-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: .7rem;
  margin-top: .85rem;
}
.quality-grid article {
  min-width: 0;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.quality-grid span {
  display: block;
  color: var(--text-secondary);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.quality-grid strong {
  display: block;
  margin-top: .3rem;
  color: var(--navy-950);
  font-size: 1.1rem;
}
.quality-list {
  display: grid;
  gap: .45rem;
  margin: .85rem 0 0;
  padding: 0;
  list-style: none;
}
.quality-list li {
  padding: .65rem .75rem;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
}
.quality-list li.warning { background: #fff9e8; color: #854d0e; }
.quality-list li.critical { background: #fff1f0; color: #b42318; }
.quality-list li.ready { background: #f0fdf4; color: #047857; }

.model-guidance {
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(220px,.65fr);
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
  background: var(--surface);
}
.model-guidance h3, .model-guidance p { margin: 0; }
.model-guidance p { margin-top: .35rem; color: var(--text-secondary); line-height: 1.55; }
.model-recommendation {
  display: grid;
  gap: .35rem;
  align-content: center;
  padding: .8rem;
  border: 1px solid #b9d5ff;
  border-radius: 8px;
  background: #f3f8ff;
  color: var(--text-secondary);
  line-height: 1.5;
}
.model-recommendation strong { display: block; color: var(--navy-950); }

.table-scroll { max-width: 100%; overflow-x: auto; margin-top: .8rem; border: 1px solid var(--border); border-radius: 8px; }
.data-table, .result-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.data-table th, .data-table td, .result-table th, .result-table td { padding: .7rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data-table th:last-child, .data-table td:last-child, .result-table th:last-child, .result-table td:last-child { border-right: 0; }
.data-table tr:last-child td, .result-table tr:last-child td { border-bottom: 0; }
.data-table th, .result-table th { background: var(--surface); color: var(--text-secondary); font-size: .78rem; text-transform: uppercase; }
.data-table input { min-width: 115px; }
.data-table .dmu-name { min-width: 170px; }
.metric-kind { display: block; margin-top: .2rem; color: var(--blue-600); font-size: .7rem; }
.error { margin-top: 1rem; padding: .75rem; border: 1px solid #fda29b; border-radius: 8px; background: #fff1f0; color: #b42318; }
.actions { margin-top: 1rem; }
.hidden { display: none !important; }

.summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .8rem; }
.summary-grid article { min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.summary-grid span { display: block; color: var(--text-secondary); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.summary-grid strong { display: block; margin-top: .45rem; color: var(--navy-950); font-size: 1.35rem; }
.executive-summary-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
  border-left: 4px solid var(--blue-600);
  background: #f3f8ff;
}
.executive-summary-panel > div:first-child > span {
  color: var(--blue-600);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}
.executive-summary-panel h3 { margin: .35rem 0 .45rem; color: var(--navy-950); }
.executive-summary-panel p { margin: .35rem 0 0; color: var(--text-secondary); line-height: 1.55; }
.executive-facts {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: .65rem;
}
.executive-facts article {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: .15rem 1rem;
  align-items: center;
  min-width: 0;
  padding: .75rem .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.executive-facts span, .peer-profile-grid article > span {
  display: block;
  color: var(--text-secondary);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.executive-facts strong {
  display: block;
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-top: 0;
  color: var(--navy-950);
  text-align: right;
  overflow-wrap: anywhere;
}
.executive-facts small { display: block; grid-column: 1; margin-top: .1rem; color: var(--text-secondary); line-height: 1.4; }
.interpretation-panel { margin-top: 1rem; padding: 1rem; border-left: 4px solid var(--blue-600); border-radius: 8px; background: #f3f8ff; }
.interpretation-panel h3 { margin: 0 0 .5rem; }
.interpretation-panel p { margin: .4rem 0 0; color: var(--text-secondary); }
.result-section { margin-top: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; }
.result-section > h3 { margin: 0; }
.section-intro { margin: .35rem 0 0; color: var(--text-secondary); }
.status-pill { display: inline-flex; min-height: 1.8rem; align-items: center; padding: .25rem .55rem; border-radius: 999px; background: #dcfce7; color: #047857; font-size: .78rem; font-weight: 800; }
.status-pill.review { background: #fff4d6; color: #9a6700; }
.action-summary-table td:last-child { min-width: 300px; line-height: 1.5; }

.scenario-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.scenario-heading h3 { margin: .15rem 0 .3rem; }
.scenario-heading p { margin: 0; color: var(--text-secondary); }
.scenario-eyebrow { color: var(--blue-600); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.scenario-toggle { display: inline-flex; min-height: 48px; flex: 0 0 auto; align-items: center; gap: .7rem; padding: .55rem .75rem .55rem 1rem; border: 1px solid var(--navy-950); border-radius: 8px; background: var(--navy-950); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.scenario-toggle:hover { background: var(--navy-800); }
.scenario-toggle:focus-visible { outline: 3px solid rgba(45,127,249,.35); outline-offset: 3px; }
.scenario-switch { position: relative; width: 48px; height: 26px; border-radius: 999px; background: #98a2b3; transition: background-color .2s ease; }
.scenario-switch::after { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; content: ''; transition: transform .2s ease; }
.scenario-toggle[aria-pressed="true"] .scenario-switch { background: var(--success); }
.scenario-toggle[aria-pressed="true"] .scenario-switch::after { transform: translateX(22px); }
.scenario-explainer { display: grid; gap: .65rem; margin-top: 1rem; padding: 1rem; border-left: 3px solid var(--blue-500); background: var(--surface); color: var(--text-secondary); }
.scenario-explainer p { margin: 0; }
.scenario-explainer strong { color: var(--navy-950); }
.scenario-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
.scenario-grid > section { min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; }
.scenario-grid h4 { margin: 0; color: var(--navy-950); }
.scenario-grid h4 + p { min-height: 3.15rem; margin: .35rem 0 0; color: var(--text-secondary); font-size: .88rem; }
.scenario-grid .result-table { min-width: 560px; }
.scenario-interpretation { margin-top: 1rem; }
.orientation-diagnostic { min-width: 0; padding: 0 !important; border: 1px solid var(--border); border-radius: 8px; }
.orientation-diagnostic summary { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; color: var(--navy-950); font-weight: 800; cursor: pointer; list-style: none; }
.orientation-diagnostic summary::-webkit-details-marker { display: none; }
.orientation-summary-title { color: var(--navy-950); font-size: 1rem; font-weight: 800; }
.orientation-summary-title small { display: block; margin-top: .2rem; color: var(--text-secondary); font-size: .75rem; font-weight: 700; }
.diagnostic-chevron { width: .7rem; height: .7rem; flex: 0 0 auto; border-right: 2px solid var(--blue-600); border-bottom: 2px solid var(--blue-600); transform: rotate(45deg); transition: transform .2s ease; }
.orientation-diagnostic[open] .diagnostic-chevron { transform: rotate(225deg); }
.orientation-diagnostic > p, .orientation-diagnostic > .table-scroll { margin-right: 1rem; margin-left: 1rem; }
.orientation-diagnostic > .table-scroll { margin-bottom: 1rem; }
.fixed-frontier-badge, .record-badge { display: inline-flex; align-items: center; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: 0; }
.fixed-frontier-badge { min-height: 2rem; flex: 0 0 auto; padding: .35rem .65rem; background: var(--blue-100); color: var(--blue-600); }
.record-badge { min-height: 1.7rem; padding: .25rem .5rem; }
.record-badge.reference { background: var(--blue-100); color: var(--blue-600); }
.record-badge.future { background: #dcfce7; color: #047857; }
.resource-scenario-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin-top: 1rem; }
.resource-scenario-grid.scenario-values-only { grid-template-columns: 1fr; }
.scenario-mode-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin-top: 1rem; }
.scenario-mode-card { display: flex; min-width: 0; align-items: flex-start; gap: .75rem; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
.scenario-mode-card:hover { border-color: #b9d5ff; box-shadow: 0 14px 30px rgba(16,42,71,.08); }
.scenario-mode-card:has(input:checked) { border-color: #8bbcff; background: #eef6ff; box-shadow: 0 0 0 3px rgba(45,127,249,.16); }
.scenario-mode-card input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; accent-color: var(--blue-600); }
.scenario-mode-card span { display: grid; gap: .25rem; min-width: 0; }
.scenario-mode-card strong { color: var(--navy-950); font-size: 1rem; }
.scenario-mode-card small { color: var(--text-secondary); font-size: .88rem; line-height: 1.5; }
.scenario-editor-block, .scenario-settings { min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; }
.reference-selector { display: grid; gap: .5rem; margin: 1rem 0 0; padding: 0; border: 0; }
.reference-option { display: grid; grid-template-columns: auto minmax(0,1fr) auto; min-height: 48px; align-items: center; gap: .65rem; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.reference-option input { width: 20px; height: 20px; accent-color: var(--blue-600); }
.reference-option span { min-width: 0; }
.reference-option strong, .reference-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-option small { margin-top: .15rem; color: var(--text-secondary); }
.reference-option em { color: var(--blue-600); font-size: .68rem; font-style: normal; font-weight: 800; }
.scenario-name-field, .scenario-value-grid label { display: grid; gap: .4rem; color: var(--navy-950); font-weight: 750; }
.scenario-name-field { margin-top: 1rem; }
.scenario-name-field input, .scenario-value-grid input, .scenario-settings select { width: 100%; min-height: 44px; padding: .62rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-primary); font: inherit; }
.scenario-value-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; margin-top: .75rem; }
.scenario-value-grid label span small { display: block; margin-top: .12rem; color: var(--text-secondary); font-size: .76rem; font-weight: 600; }
.scenario-settings { margin-top: 1rem; }
.scenario-settings > div:first-child h3, .scenario-settings > div:first-child p { margin: 0; }
.scenario-settings > div:first-child p { margin-top: .25rem; color: var(--text-secondary); }
.scenario-settings .model-choice-grid { margin: 1rem 0; }
.scenario-summary-grid { grid-template-columns: repeat(5,minmax(0,1fr)); margin-top: 1rem; }
.scenario-summary-grid strong { overflow-wrap: anywhere; font-size: 1.05rem; }
.scenario-warning { margin-top: 1rem; padding: 1rem; border: 1px solid #f5c451; border-left: 4px solid #d97706; border-radius: 8px; background: #fff9e8; color: #854d0e; }
.scenario-warning p { margin: .35rem 0 0; }
.compact-result-table { min-width: 520px; }

.efficiency-chart { display: grid; gap: .7rem; margin-top: 1rem; }
.efficiency-row { display: grid; grid-template-columns: minmax(120px,1fr) minmax(220px,3fr) 64px; align-items: center; gap: .75rem; }
.efficiency-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.efficiency-track { position: relative; height: 18px; overflow: hidden; border-radius: 999px; background: var(--surface-alt); }
.efficiency-track i { display: block; width: var(--score); height: 100%; border-radius: inherit; background: var(--blue-600); }
.efficiency-row.efficient .efficiency-track i { background: var(--success); }
.efficiency-value { text-align: right; font-weight: 800; }
.chart-summary { margin: 1rem 0 0; color: var(--text-secondary); }
.detail-selector label { width: min(100%,300px); flex: 0 0 300px; }
.peer-summary { margin-top: 1rem; padding: .85rem; border-radius: 8px; background: var(--surface); color: var(--text-secondary); }
.peer-summary strong { color: var(--navy-950); }
.peer-profile-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: .75rem;
  margin-top: .85rem;
}
.peer-profile-grid article {
  min-width: 0;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.peer-profile-grid strong {
  display: block;
  margin-top: .35rem;
  color: var(--navy-950);
}
.peer-profile-grid p {
  margin: .45rem 0 0;
  color: var(--text-secondary);
  line-height: 1.5;
}
.peer-profile-grid ul { display: grid; gap: .35rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.peer-profile-grid li { display: flex; justify-content: space-between; gap: .75rem; color: var(--text-secondary); }
.peer-profile-grid li strong { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer-profile-grid li span { flex: 0 0 auto; font-weight: 750; }
.lp-calculation { margin-top: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.lp-calculation-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.lp-calculation-header h4, .lp-calculation-header p { margin: 0; }
.lp-calculation-header p { margin-top: .25rem; color: var(--text-secondary); }
.lp-calculation-header > span { flex: 0 0 auto; padding: .35rem .55rem; border-radius: 999px; background: var(--blue-100); color: var(--blue-600); font-size: .78rem; font-weight: 800; }
.lp-objective { margin-top: 1rem; padding: .85rem; border-left: 3px solid var(--blue-500); background: #fff; }
.lp-objective span, .lp-constraints h5, .lp-solution h5 { color: var(--text-secondary); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.math-equation { margin-top: .3rem; color: var(--navy-950); font-family: Cambria, "Times New Roman", serif; font-size: 1.05rem; line-height: 1.5; overflow-wrap: anywhere; }
.lp-constraints, .lp-solution { margin-top: 1rem; }
.lp-constraints h5, .lp-solution h5 { margin: 0 0 .55rem; }
.lp-constraints ul { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.lp-constraints li { padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.lp-constraints li > span { color: var(--text-secondary); font-size: .82rem; font-weight: 700; }
.lp-solution { padding: .8rem; border-radius: 8px; background: #fff; color: var(--text-secondary); }
.lp-solution p { margin: .35rem 0 0; }
.lp-solution strong { color: var(--navy-950); }
.positive-change { color: #047857; font-weight: 750; }
.negative-change { color: #b42318; font-weight: 750; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media (prefers-reduced-motion: reduce) { .scenario-switch, .scenario-switch::after, .diagnostic-chevron { transition: none; } }
@media (max-width: 1080px) {
  .dea-layout { grid-template-columns: 1fr; }
  .dea-side-nav { position: static; }
  .dea-workflow ol { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .scenario-grid, .scenario-mode-grid { grid-template-columns: 1fr; }
  .resource-scenario-grid { grid-template-columns: 1fr; }
  .scenario-summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .executive-summary-panel, .model-guidance { grid-template-columns: 1fr; }
  .peer-profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .section-header, .results-header, .subsection-heading, .detail-selector, .scenario-heading { align-items: stretch; flex-direction: column; }
  .editor-actions button, .actions button, .section-header > button, .results-header > button { width: 100%; }
  .model-choice-grid, .measure-builder, .import-columns, .summary-grid, .upload-row, .template-loader, .template-context-grid, .template-measures, .scenario-value-grid, .scenario-summary-grid, .quality-grid, .executive-facts { grid-template-columns: 1fr; }
  .template-loader .editor-actions button { width: 100%; }
  .import-columns div { padding: .75rem 0; border-left: 0; border-top: 1px solid var(--border); }
  .import-columns div:first-child { border-top: 0; }
  .dea-workflow ol { grid-template-columns: 1fr; }
  .detail-selector label { width: 100%; flex-basis: auto; }
  .lp-calculation-header { align-items: stretch; flex-direction: column; }
  .lp-calculation-header > span { align-self: flex-start; }
  .scenario-toggle { width: 100%; justify-content: space-between; }
  .fixed-frontier-badge { align-self: flex-start; }
  .reference-option { grid-template-columns: auto minmax(0,1fr); }
  .reference-option em { grid-column: 2; }
  .efficiency-row { grid-template-columns: minmax(90px,1fr) minmax(120px,2fr) 54px; font-size: .84rem; }
}
@media print {
  .tool-topnav, .dea-workflow, .dea-side-nav, #data-preparation, #model-setup, #run-analysis, .results-header button, #scenario-analysis.hidden { display: none !important; }
  .dea-layout { display: block; }
  .panel { break-inside: avoid; box-shadow: none !important; }
}
