:root {
  --navy: #18375f;
  --navy-deep: #102742;
  --blue: #2d6ca2;
  --teal: #138a8a;
  --yellow: #f3c300;
  --orange: #d36c23;
  --red: #b43b36;
  --green: #347a52;
  --ink: #172230;
  --muted: #617184;
  --line: #d7dee6;
  --surface: #ffffff;
  --wash: #f3f6f9;
  --soft-blue: #eaf2f8;
  --soft-yellow: #fff8d8;
  --shadow: 0 10px 28px rgba(16,39,66,.08);
  font-family: "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--wash); font-size: 16px; }
button, select, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.app-shell.nav-collapsed { grid-template-columns: 78px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy-deep); color: #fff; padding: 24px 18px; display: flex; flex-direction: column; gap: 24px; }
.brand-block { display: flex; gap: 12px; align-items: center; padding: 0 8px; }
.brand-block strong, .brand-block span { display: block; }
.brand-block strong { font-size: 16px; }
.brand-block span { color: #bdd0e2; font-size: 12px; margin-top: 3px; }
.brand-block .version-tag { display:inline-block; width:max-content; margin-top:6px; padding:2px 5px; border:1px solid rgba(255,255,255,.35); color:#fff; font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.logo-mark { width: 42px; height: 42px; border: 2px solid var(--yellow); display: grid; place-items: center; font-weight: 800; letter-spacing: .06em; }
.sidebar-toggle { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04); color: #d7e4ef; min-height: 36px; border-radius: 5px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; }
.sidebar-toggle:hover { background: rgba(255,255,255,.1); }
#navList { display: grid; gap: 6px; }
.nav-group { display: grid; gap: 4px; margin-bottom: 10px; }
.nav-group-label { padding: 4px 12px; color: #7fa0bc; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-btn { width: 100%; display: grid; grid-template-columns: 30px 1fr; align-items: center; border: 0; padding: 12px 12px; border-radius: 6px; text-align: left; color: #d7e4ef; background: transparent; }
.nav-btn:hover { background: rgba(255,255,255,.08); }
.nav-btn.active { background: #fff; color: var(--navy-deep); font-weight: 700; box-shadow: inset 4px 0 var(--yellow); }
.nav-icon { font-size: 18px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.16); padding: 18px 8px 0; display: flex; gap: 10px; align-items: flex-start; }
.sidebar-foot strong, .sidebar-foot span { display: block; }
.sidebar-foot strong { font-size: 13px; }
.sidebar-foot span { font-size: 12px; color: #bdd0e2; margin-top: 3px; }
.data-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); margin-top: 4px; flex: none; }
.nav-collapsed .sidebar { padding: 20px 10px; gap: 18px; }
.nav-collapsed .brand-block { justify-content: center; padding: 0; }
.nav-collapsed .brand-copy, .nav-collapsed .nav-group-label, .nav-collapsed .nav-btn span:last-child, .nav-collapsed .sidebar-foot, .nav-collapsed .toggle-copy { display: none; }
.nav-collapsed .nav-btn { grid-template-columns: 1fr; text-align: center; padding: 12px 6px; }
.nav-collapsed .sidebar-toggle span:first-child { transform: rotate(180deg); }
main { min-width: 0; }
.topbar { min-height: 78px; padding: 12px 24px; display: grid; grid-template-columns: minmax(205px,.8fr) 135px minmax(300px,1.35fr) auto auto; gap: 14px; align-items: center; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.scope-selector, .year-selector, .bridge-selector { display: grid; grid-template-rows: 18px 40px; gap: 6px; align-items: end; min-width: 0; }
.scope-selector label, .year-selector label, .bridge-selector label { display:flex; align-items:flex-end; min-height:18px; font-size: 13px; line-height:1; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.scope-selector select { width: 100%; min-width: 0; font-weight: 650; }
.year-selector select { width: 100%; min-width: 0; font-weight: 650; }
.bridge-selector select { width: 100%; min-width: 0; }
select, input[type="number"], input[type="text"] { border: 1px solid #b7c3cf; border-radius: 4px; background: #fff; padding: 9px 10px; min-height: 40px; color: var(--ink); }
.bridge-selector select { min-width: 0; font-weight: 650; }
.selection-lock { display: flex; align-items: center; gap: 9px; border-left: 1px solid var(--line); padding-left: 18px; }
.selection-lock strong, .selection-lock span { display: block; }
.selection-lock strong { font-size: 14px; }
.selection-lock span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.lock-icon { color: var(--green); font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 8px; border-left: 1px solid var(--line); padding-left: 14px; min-width: 128px; }
.user-chip strong, .user-chip span { display: block; }
.user-chip strong { font-size: 13px; }
.user-chip span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid !important; place-items: center; background: var(--navy); color: #fff !important; font-size: 11px !important; font-weight: 800; margin: 0 !important; }
#app { padding: 30px; max-width: 2100px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.eyebrow { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--blue); margin-bottom: 5px; }
h1 { font-size: clamp(28px, 3vw, 42px); line-height: 1.05; margin: 0; color: var(--navy-deep); letter-spacing: -.025em; }
h2 { font-size: 20px; line-height: 1.2; margin: 0; color: var(--navy-deep); }
h3 { font-size: 16px; margin: 0; color: var(--navy-deep); }
p { line-height: 1.5; }
.subtitle { margin: 8px 0 0; color: var(--muted); max-width: 760px; }
.status-pill { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.status-pill.reported { background: #e6f3eb; color: #235e3c; }
.status-pill.demo { background: var(--soft-yellow); color: #715b00; border: 1px solid #e8d47d; }
.status-pill.pending { background: #edf0f4; color: #4b5968; }
.grid { display: grid; gap: 18px; }
.grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 18px 20px 12px; }
.card-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.metric { border-top: 4px solid var(--blue); padding: 16px 18px 18px; min-height: 128px; }
.metric.yellow { border-color: var(--yellow); }
.metric.teal { border-color: var(--teal); }
.metric.orange { border-color: var(--orange); }
.metric-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.metric-value { font-size: 35px; font-weight: 780; line-height: 1; color: var(--navy-deep); margin: 13px 0 7px; }
.metric-value.compact { font-size: 29px; }
.metric-note { font-size: 12px; color: var(--muted); }
.rating-row { display: grid; grid-template-columns: 140px 1fr 42px; gap: 12px; align-items: center; margin: 15px 0; }
.rating-row strong { font-size: 14px; }
.bar-track { height: 11px; background: #e6ebf0; position: relative; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); }
.bar-fill.poor { background: var(--orange); }
.bar-fill.good { background: var(--green); }
.rating-number { font-weight: 800; text-align: right; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 690px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f4f7fa; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.click-row { cursor: pointer; }
.click-row:hover td { background: #f3f8fc; }
.click-row.selected td { background: #e9f2f8; }
.condition { font-weight: 750; }
.condition.poor { color: var(--red); }
.condition.fair { color: #a95d15; }
.condition.good { color: var(--green); }
.delta.down { color: var(--red); font-weight: 800; }
.delta.up { color: var(--green); font-weight: 800; }
.detail-band { background: var(--navy); color: #fff; padding: 20px 22px; display: flex; justify-content: space-between; gap: 20px; align-items: center; border-radius: 8px 8px 0 0; }
.detail-band h2 { color: #fff; font-size: 25px; }
.detail-band p { margin: 5px 0 0; color: #d6e4ef; }
.score-disc { width: 78px; height: 78px; border: 8px solid var(--yellow); border-radius: 50%; display: grid; place-items: center; font-size: 27px; font-weight: 800; flex: none; }
.profile-hero-grid { display: grid; grid-template-columns: minmax(0,2.1fr) minmax(260px,.8fr); gap: 18px; align-items: stretch; }
.thumbnail-card { overflow: hidden; display: grid; grid-template-rows: minmax(235px,1fr) auto; box-shadow: var(--shadow); }
.thumbnail-frame { position: relative; min-height: 235px; background: linear-gradient(145deg,#dbe6ee,#f5f8fa); overflow: hidden; }
.bridge-thumbnail-img { width: 100%; height: 100%; min-height: 235px; object-fit: cover; display: block; }
.thumbnail-fallback { height: 100%; min-height: 235px; padding: 24px; display: grid; align-content: center; justify-items: center; text-align: center; color: var(--muted); }
.thumbnail-fallback[hidden] { display: none; }
.thumbnail-fallback strong { color: var(--navy-deep); margin: 8px 0 5px; }
.thumbnail-fallback span { font-size: 12px; line-height: 1.45; max-width: 230px; }
.thumbnail-icon { width: 48px; height: 48px; border: 2px solid var(--blue); color: var(--blue); display: grid; place-items: center; font-size: 24px; }
.thumbnail-caption { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.thumbnail-caption span { color: var(--muted); font-size: 12px; }
.thumbnail-caption strong { color: var(--navy-deep); font-size: 13px; }
.facts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; }
.fact { padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact:nth-child(4n) { border-right: 0; }
.fact span, .fact strong { display: block; }
.fact span { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.formula { background: var(--navy-deep); color: #fff; padding: 18px 20px; border-radius: 6px; font-family: Consolas, monospace; line-height: 1.65; }
.cs-weight-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 14px 0; }
.cs-weight-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.cs-weight-grid input { width: 100%; }
.formula strong { color: var(--yellow); }
.notice { padding: 14px 16px; border-left: 5px solid var(--yellow); background: var(--soft-yellow); font-size: 14px; line-height: 1.45; }
.notice.blue { border-color: var(--blue); background: var(--soft-blue); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding: 0 20px; }
.tab { border: 0; background: transparent; padding: 13px 12px 11px; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; }
.tab.active { color: var(--navy); border-color: var(--yellow); }
.component-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 4px; background: #eef3f7; color: var(--navy); font-size: 12px; font-weight: 750; }
.cs-bar { width: 160px; display: flex; height: 14px; overflow: hidden; background: #eee; }
.cs1 { background: #438a5e; }.cs2 { background: #e7bb1c; }.cs3 { background: #db7c2f; }.cs4 { background: #a93935; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { border: 1px solid var(--navy); background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 4px; font-weight: 750; min-height: 40px; }
.btn:hover { background: var(--navy-deep); }
.btn.secondary { background: #fff; color: var(--navy); }
.btn.secondary:hover { background: var(--soft-blue); }
.btn.yellow { background: var(--yellow); color: #1f2a37; border-color: #d6aa00; }
.scenario-layout { display: grid; grid-template-columns: minmax(300px,.8fr) minmax(500px,1.6fr); gap: 18px; align-items: start; }
.treatment-list { display: grid; gap: 10px; }
.treatment { border: 1px solid var(--line); padding: 13px; display: grid; grid-template-columns: 24px 1fr; gap: 10px; border-radius: 5px; }
.treatment.active { border-color: var(--blue); background: #f1f7fb; }
.treatment input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); }
.treatment-title { font-weight: 750; }
.treatment-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.treatment-controls { grid-column: 2; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 4px; }
.treatment-controls.expanded { grid-template-columns: repeat(2,minmax(0,1fr)); }
.treatment-controls .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.field input, .field select { width: 100%; }
.summary-strip { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); }
.summary-item { padding: 14px 16px; border-right: 1px solid var(--line); }
.summary-item:last-child { border: 0; }
.summary-item span, .summary-item strong { display: block; }
.summary-item span { font-size: 12px; color: var(--muted); }
.summary-item strong { font-size: 19px; color: var(--navy-deep); margin-top: 4px; }
.chart-area { padding: 12px 18px 18px; }
.chart-area svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 8px 44px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 16px; height: 3px; margin-right: 6px; vertical-align: middle; background: currentColor; }
.legend .baseline { color: #7c8793; }.legend .scenario { color: var(--blue); }
.decision-bar { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); background: #fff; }
.decision-step { position: relative; padding: 15px 16px; min-height: 98px; border-right: 1px solid var(--line); }
.decision-step:last-child { border: 0; }
.decision-step::after { content: "›"; position: absolute; right: -9px; top: 34px; width: 18px; height: 28px; background: #fff; color: var(--blue); font-size: 28px; line-height: 25px; z-index: 1; }
.decision-step:last-child::after { display: none; }
.decision-step span { font-size: 11px; color: var(--blue); font-weight: 800; text-transform: uppercase; }
.decision-step strong { display: block; margin: 5px 0; }
.decision-step small { color: var(--muted); line-height: 1.35; }
.source-line { display: grid; grid-template-columns: 200px 1fr 112px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.source-line:last-child { border: 0; }
.source-line p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.timeline { border-left: 3px solid var(--line); margin-left: 9px; padding-left: 22px; }
.timeline-item { position: relative; padding: 0 0 24px; }
.timeline-item::before { content: ""; position: absolute; width: 13px; height: 13px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--blue); left: -31px; top: 3px; }
.timeline-item.pending::before { background: #fff; }
.timeline-item p { margin: 5px 0 0; color: var(--muted); }
#toast { position: fixed; right: 24px; bottom: 24px; background: var(--navy-deep); color: #fff; padding: 12px 16px; border-radius: 5px; box-shadow: var(--shadow); transform: translateY(120px); transition: .2s ease; z-index: 99; }
#toast.show { transform: translateY(0); }
.empty { padding: 38px; text-align: center; color: var(--muted); }
.small { font-size: 12px; color: var(--muted); }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }

.donut-layout { display: grid; grid-template-columns: 145px 1fr; gap: 18px; align-items: center; margin-top: 20px; }
.donut { width: 142px; height: 142px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.donut::after { content: ""; position: absolute; inset: 27px; border-radius: 50%; background: #fff; }
.donut > div { position: relative; z-index: 1; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 28px; color: var(--navy-deep); }
.donut span { font-size: 11px; color: var(--muted); }
.chart-key { display: grid; gap: 9px; }
.chart-key div { display: grid; grid-template-columns: 10px 1fr auto; gap: 7px; align-items: center; font-size: 12px; }
.chart-key i { width: 9px; height: 9px; border-radius: 50%; }
.chart-key strong { color: var(--navy-deep); }
.card-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.mini-legend { display: flex; gap: 10px; font-size: 11px; color: var(--muted); }
.mini-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.mini-legend .good::before { background: var(--green); }
.mini-legend .fair::before { background: var(--yellow); }
.mini-legend .poor::before { background: var(--red); }
.section-label { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stack-row { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; align-items: center; margin-top: 14px; }
.stack-label strong, .stack-label span { display: block; }
.stack-label span { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stack-track { height: 20px; display: flex; overflow: hidden; background: #e7ecf1; border-radius: 3px; }
.stack-track span { min-width: 0; }
.stack-values { grid-column: 2; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.bar-list { display: grid; gap: 14px; margin-top: 20px; }
.bar-list-row > div:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.bar-list-row span { color: var(--muted); }
.hbar { height: 9px; background: #e7ecf1; margin-top: 5px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--blue); }

.filter-card { padding: 18px 20px; }
.filter-grid { display: grid; grid-template-columns: repeat(6,minmax(120px,1fr)); gap: 12px; align-items: end; }
.filter-grid .span-two { grid-column: span 2; }
.filter-reset { align-self: end; }
.selection-summary { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 12px 16px; background: var(--soft-blue); border: 1px solid #cadce9; }
.selection-summary > div:nth-child(2) { text-align: center; color: var(--muted); }
.portfolio-table { max-height: 630px; }
.portfolio-table thead { position: sticky; top: 0; z-index: 2; }
.portfolio-view-tools { display:flex; justify-content:space-between; align-items:center; gap:18px; padding:12px 16px; background:#eef5fa; border:1px solid #cadce9; }
.group-builder { display:grid; grid-template-columns:minmax(240px,.8fr) minmax(280px,1fr) auto; gap:16px; align-items:end; }
.program-scenario-select { min-width:220px; }
.horizon-flag { display:block; margin-top:6px; color:#9b3d24; font-size:12px; font-weight:700; }
.portfolio-view-tools > div:first-child { display:grid; gap:3px; }
.portfolio-view-tools span { color:var(--muted); font-size:12px; }
.portfolio-expanded #app { max-width:none; padding:16px 20px 24px; }
.portfolio-expanded .page-head { display:none; }
.portfolio-expanded .topbar { position:relative; }
.portfolio-expanded .portfolio-table { max-height:calc(100vh - 310px); }
.portfolio-expanded .compact-filters { padding:10px 14px; }
.portfolio-expanded .compact-filters .field label { font-size:11px; }
.portfolio-expanded .compact-filters select,.portfolio-expanded .compact-filters input { min-height:34px; padding:6px 8px; }
.program-bridge-check { width:18px; height:18px; accent-color:var(--blue); }
.condition-state-editor.locked strong { display:block; padding:5px 7px; background:#fff; border:1px solid var(--line); border-radius:3px; min-width:55px; text-align:center; }
.sort-header { width:100%; display:flex; justify-content:space-between; align-items:center; gap:7px; padding:0; border:0; background:transparent; color:inherit; font:inherit; font-weight:800; text-align:left; white-space:nowrap; }
.sort-header span { color:#8190a0; font-size:10px; }
.sort-header.active { color:var(--navy-deep); }
.sort-header.active span { color:var(--blue); }
.hi-score { display:inline-flex; min-width:48px; justify-content:center; padding:5px 9px; border-radius:99px; font-weight:800; border:1px solid transparent; }
.hi-score.good { color:#235e3c; background:#e6f3eb; border-color:#b9ddc7; }
.hi-score.fair { color:#715b00; background:#fff4bf; border-color:#e8d47d; }
.hi-score.poor { color:#8a2f2a; background:#f9e4e2; border-color:#e1b3af; }

.workflow-flow { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); }
.workflow-flow > div { padding: 13px; border-right: 1px solid var(--line); min-height: 92px; }
.workflow-flow > div:last-child { border: 0; }
.workflow-flow span, .workflow-flow strong, .workflow-flow small { display: block; }
.workflow-flow span { color: var(--blue); font-size: 11px; font-weight: 800; }
.workflow-flow strong { margin: 5px 0; }
.workflow-flow small { color: var(--muted); line-height: 1.35; }
.definition-cell { min-width: 260px; line-height: 1.45; }
.definitions-filter { grid-template-columns: 2fr 1fr auto; }
.value-input { display: grid; grid-template-columns: auto minmax(95px,130px); align-items: center; gap: 4px; }
.value-input input { width: 100%; }
.value-input small { grid-column: 1 / -1; color: var(--muted); }

.rate-profile-card { overflow: hidden; box-shadow: none; }
.rate-profile-card > .card-head { background: linear-gradient(90deg,#eef5fa,#fff); border-bottom: 1px solid var(--line); }
.rate-profile-card > .card-head p { max-width: 920px; }
.rate-profile-toolbar { display: grid; grid-template-columns: minmax(190px,.7fr) minmax(280px,1fr) auto; gap: 14px; align-items: end; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.rate-profile-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.danger-btn { color: var(--red) !important; border-color: #dbb1ad !important; }
.rate-grid { display: grid; grid-template-columns: repeat(4,minmax(145px,1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.rate-grid > label { display: block; padding: 14px 16px; background: #fff; }
.rate-grid span, .rate-grid em { display: block; }
.rate-grid span { min-height: 34px; color: var(--navy-deep); font-size: 12px; font-weight: 800; }
.rate-grid > label > div { display: flex; align-items: center; gap: 7px; }
.rate-grid input { width: 84px; min-height: 36px; }
.rate-grid small { color: var(--muted); font-size: 11px; }
.rate-grid em { margin-top: 7px; color: var(--muted); font-size: 10px; font-style: normal; line-height: 1.35; }
.rate-formula { margin: 16px 18px 18px; }

.scenario-steps { display: grid; grid-template-columns: repeat(4,1fr); background: #fff; border: 1px solid var(--line); }
.scenario-steps > div { padding: 13px 16px; display: flex; gap: 9px; align-items: center; border-right: 1px solid var(--line); color: var(--muted); }
.scenario-steps > div:last-child { border: 0; }
.scenario-steps span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #e5ebf0; font-size: 12px; font-weight: 800; }
.scenario-steps .active { color: var(--navy-deep); }
.scenario-steps .active span { background: var(--yellow); }
.scenario-settings { display: grid; grid-template-columns: 1.5fr 1.2fr repeat(3,.65fr); gap: 12px; align-items: end; }
.scenario-settings .wide { min-width: 220px; }
.scenario-panel { background:#fff; border:1px solid var(--line); box-shadow:var(--shadow); }
.scenario-panel > summary { list-style:none; display:flex; justify-content:space-between; align-items:center; gap:18px; padding:17px 20px; cursor:pointer; border-left:5px solid var(--blue); }
.scenario-panel > summary::-webkit-details-marker { display:none; }
.scenario-panel > summary::after { content:'＋'; color:var(--blue); font-size:20px; font-weight:700; }
.scenario-panel[open] > summary::after { content:'−'; }
.scenario-panel > summary > span:first-child { display:grid; gap:3px; }
.scenario-panel > summary b { color:var(--navy-deep); font-size:18px; }
.scenario-panel > summary small { color:var(--muted); font-size:13px; }
.summary-state { margin-left:auto; padding:5px 9px; border-radius:99px; background:var(--soft-blue); color:var(--navy); font-size:12px; font-weight:750; white-space:nowrap; }
.scenario-panel-body { padding:18px 20px 20px; border-top:1px solid var(--line); }
.scenario-panel-body > .rate-profile-card { margin-bottom:0 !important; border:0; }
.assumption-link-card { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:15px 18px; background:#eef5fa; border:1px solid #cbdde9; border-left:5px solid var(--blue); }
.assumption-link-card > div { display:grid; gap:3px; }
.assumption-link-card strong { color:var(--navy-deep); font-size:18px; }
.assumption-link-card small { color:var(--muted); }
.rate-element-groups { display:grid; gap:12px; }
.rate-element-group { border:1px solid var(--line); background:#fff; }
.rate-element-group > summary { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 16px; cursor:pointer; background:#f7f9fb; }
.rate-element-group > summary > span:first-child { display:grid; gap:2px; }
.rate-element-group > summary small { color:var(--muted); }
.rate-element-group > summary > span:last-child { color:var(--blue); font-size:12px; font-weight:750; }
.rate-element-group table { min-width:760px; }
.override-rate-control { display:flex; align-items:center; gap:8px; }
.override-rate-control input { width:130px; }
.override-rate-control button:disabled { opacity:.4; cursor:default; }
.four-items { grid-template-columns: repeat(4,1fr); }
.scenario-overview { box-shadow: none; }
.compact-forecast { display: grid; grid-template-columns: minmax(0,1fr) 230px; border-top: 1px solid var(--line); }
.compact-forecast .chart-area { padding: 8px 18px 10px; }
.compact-forecast .chart-area svg { max-height: 210px; }
.compact-forecast .summary-strip { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line); }
.compact-forecast .summary-item { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
.compact-forecast .summary-item:last-child { border-bottom: 0; }
.compact-forecast .summary-item strong { font-size: 17px; }
.threshold-explainer { display: grid; grid-template-columns: 125px 1fr; gap: 14px; padding: 13px 18px; border-top: 1px solid #ead889; background: var(--soft-yellow); font-size: 13px; line-height: 1.45; }
.threshold-explainer strong { color: var(--navy-deep); }
.threshold-explainer span { color: #5e5737; }
.builder-section { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.builder-section h2 { margin-top: 1px; }
.builder-section p { margin: 4px 0 0; color: var(--muted); max-width: 900px; }
.section-number { width: 32px; height: 32px; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 800; }
.element-action-list { display: grid; gap: 16px; }
.element-action-block { overflow: hidden; box-shadow: none; }
.element-action-header { padding: 16px 18px; background: #eaf2f8; display: grid; grid-template-columns: minmax(250px,1fr) minmax(520px,1.6fr) auto; gap: 16px; align-items: center; }
.element-heading strong, .element-heading small { display: block; }
.element-heading strong { margin-top: 7px; }
.element-heading small { color: var(--muted); margin-top: 4px; }
.element-action-block table { min-width: 880px; }
.element-action-block .table-wrap { border-top: 1px solid var(--line); }
.element-action-table { min-width: 1120px; }
.element-section-row td { background: #eaf2f8; padding: 12px 14px; }
.element-section-row td > div { display: flex; align-items: center; gap: 10px; }
.element-section-row td { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.element-heading { min-width: 270px; }
.element-section-row small { color: var(--muted); }
.condition-state-editor { display: flex; align-items: end !important; gap: 7px !important; flex: 1 1 520px; flex-wrap: wrap; }
.condition-editor-label { align-self: center; color: var(--navy-deep); font-size: 12px; font-weight: 750; margin-right: 3px; }
.condition-state-editor label { display: grid; gap: 2px; color: var(--muted); font-size: 10px; font-weight: 750; }
.condition-state-editor input { width: 62px; min-height: 32px; padding: 5px 6px; }
.condition-total { align-self: center; min-width: 76px; color: var(--green); font-size: 11px; font-weight: 800; }
.condition-total.warning { color: var(--red); }
.text-btn { border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 750; padding: 7px 3px; text-decoration: underline; }
.element-action-row td { background: #fff; }
.element-action-row:nth-child(odd) td { background: #fbfcfd; }
.element-action-row select, .element-action-row input { min-height: 36px; padding: 7px 8px; }
.element-action-row select { min-width: 190px; }
.action-connector { color: var(--blue); font-weight: 800; margin-right: 7px; }
.inline-unit { display: flex; align-items: center; gap: 6px; }
.inline-unit span { color: var(--muted); font-size: 12px; }
.narrow-input { width: 82px; }
.cost-input { width: 118px; }
.small-btn { min-height: 34px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.icon-btn { width: 32px; height: 32px; border: 1px solid #c8d1da; background: #fff; color: var(--red); font-size: 20px; line-height: 1; }
.icon-btn:hover { background: #fff1ef; }
.empty-action td { color: var(--muted); font-style: italic; padding-left: 26px; }
.inherited-action td { background: #f4f7fa !important; color: #536273; }
.package-badge { display: inline-flex; padding: 3px 6px; border-radius: 3px; background: #dceaf4; color: var(--navy); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.lock-mark { color: var(--blue); font-size: 11px; }
.group-treatment-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.group-treatment { box-shadow: none; overflow: hidden; }
.group-treatment.active { border-color: var(--blue); box-shadow: inset 0 4px var(--blue); }
.group-treatment-head { padding: 18px; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.group-treatment-head > label { display: flex; gap: 10px; align-items: flex-start; }
.group-treatment-head input { width: 19px; height: 19px; accent-color: var(--blue); flex: none; }
.group-treatment-head strong, .group-treatment-head small { display: block; }
.group-treatment-head small { color: var(--muted); margin-top: 5px; line-height: 1.4; }
.group-controls { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; padding: 14px 18px; background: #f7f9fb; border-bottom: 1px solid var(--line); }
.group-controls input, .group-controls select { width: 100%; min-width: 0; }
.group-checklist { display: grid; padding: 14px 18px 18px; max-height: 340px; overflow: auto; }
.checklist-title { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; padding-bottom: 8px; }
.group-checklist > label { display: flex; gap: 9px; padding: 9px 0; border-top: 1px solid var(--line); }
.group-checklist input { width: 17px; height: 17px; accent-color: var(--blue); flex: none; }
.group-checklist strong, .group-checklist small { display: inline; }
.group-checklist small { display: block; color: var(--muted); margin-top: 3px; }
.confidence { padding: 6px 9px; font-size: 11px; font-weight: 750; border-radius: 3px; white-space: nowrap; }
.confidence.low { background: #fff1e2; color: #8a4d12; border: 1px solid #efc89f; }
.analysis-grid { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 16px; border: 1px solid var(--line); }
.analysis-grid > div { padding: 13px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.analysis-grid > div:nth-child(3n) { border-right: 0; }
.analysis-grid > div:nth-last-child(-n+3) { border-bottom: 0; }
.analysis-grid span, .analysis-grid strong { display: block; }
.analysis-grid span { color: var(--muted); font-size: 11px; }
.analysis-grid strong { color: var(--navy-deep); font-size: 17px; margin-top: 5px; }
.gridlines line { stroke: #dce3e9; stroke-width: 1; }
.gridlines text, .chart-area svg text { fill: #667687; font-size: 11px; }
.baseline-path { fill: none; stroke: #7c8793; stroke-width: 3; stroke-dasharray: 6 5; }
.scenario-path { fill: none; stroke: var(--blue); stroke-width: 4; }
.band-path { fill: rgba(45,108,162,.12); stroke: none; }
.threshold-line { stroke: var(--orange); stroke-width: 1.5; stroke-dasharray: 4 4; }
.threshold-label { fill: var(--orange) !important; font-weight: 700; }
.legend .uncertainty { color: #88aeca; }
.legend .uncertainty::before { height: 8px; opacity: .5; }

.cost-bars { display: grid; gap: 17px; margin-top: 20px; }
.cost-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; margin-bottom: 5px; }
.cost-row > div:first-child span { color: var(--muted); }
.cost-track { min-width: 8%; height: 18px; display: flex; background: #e8edf2; overflow: hidden; }
.cost-track i { display: block; height: 100%; }
.model-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 7px; align-items: center; margin-top: 22px; }
.model-flow > div { border: 1px solid var(--line); padding: 11px; min-height: 83px; }
.model-flow strong, .model-flow span { display: block; }
.model-flow span { color: var(--muted); font-size: 11px; margin-top: 5px; line-height: 1.35; }
.model-flow b { color: var(--blue); }
.analysis-result-row { transition: background .15s ease; }
.analysis-result-row.selected td { background: #eaf2f8; }
.explain-btn { min-width: 74px; border: 1px solid var(--blue); background: #fff; color: var(--blue); border-radius: 4px; padding: 7px 9px; font-size: 12px; font-weight: 750; }
.analysis-result-row.selected .explain-btn { background: var(--blue); color: #fff; }
.explanation-card { overflow: hidden; }
.explanation-card > .card-head { background: linear-gradient(90deg,#eef5fa,#fff); border-bottom: 1px solid var(--line); padding-top: 22px; padding-bottom: 20px; }
.explanation-card > .card-head p { max-width: 1030px; font-size: 14px; line-height: 1.55; }
.explanation-metrics { margin: 0; border-width: 0 0 1px; }
.explanation-metrics { grid-template-columns: repeat(4,1fr); }
.explanation-metrics > div:nth-child(3n) { border-right: 1px solid var(--line); }
.explanation-metrics > div:nth-child(4n) { border-right: 0; }
.explanation-metrics > div:nth-last-child(-n+4) { border-bottom: 0; }
.explanation-section { padding: 20px; border-top: 1px solid var(--line); }
.explanation-section:first-of-type { border-top: 0; }
.explanation-section > p { margin: 5px 0 14px; }
.explanation-section table { min-width: 900px; }
.impact-meter { width: 120px; height: 8px; background: #e3e9ee; margin-bottom: 5px; overflow: hidden; }
.impact-meter i { height: 100%; display: block; background: var(--teal); }
.action-chip { display: block; width: max-content; max-width: 260px; margin: 3px 0; padding: 4px 7px; border-radius: 3px; background: #eef3f7; color: var(--navy); font-size: 11px; }
.compact-empty { padding: 20px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.export-choices { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: 10px; margin: 16px 0; }
.export-choices label { display: flex; align-items: flex-start; gap: 10px; padding: 12px; background: #f1f5f9; border: 1px solid var(--line); }
.export-choices input { width: 18px; min-height: 18px; accent-color: var(--blue); }
.export-choices small { display: block; margin-top: 5px; color: var(--muted); }
.analysis-print-active { overflow: hidden; }
.analysis-print-overlay { position: fixed; inset: 0; z-index: 1000; overflow: auto; background: #dce4ed; }
.print-toolbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 20px; background: #fff; box-shadow: 0 2px 7px #0002; }
.print-toolbar span { flex: 1; font-size: 12px; color: var(--muted); }
.analysis-print-document { max-width: 1080px; margin: 24px auto; padding: 40px; background: white; color: #172b42; }
.analysis-print-document h1 { font-size: 30px; margin: 5px 0 10px; }
.analysis-print-document h2 { margin: 24px 0 10px; font-size: 21px; }
.analysis-print-document h3 { margin: 20px 0 9px; font-size: 16px; }
.analysis-print-document p { font-size: 13px; line-height: 1.5; }
.analysis-print-document table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
.analysis-print-document td, .analysis-print-document th { padding: 7px 6px; border: 1px solid #cad4df; font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
.analysis-print-document th { background: #e8eef5; color: #173b5c; }
.analysis-print-document svg { width: 100%; height: auto; }
.analysis-print-document .report-note, .analysis-print-document .report-legend { font-size: 11px; color: #47576b; }
.report-result { margin-top: 32px; border-top: 3px solid #235f93; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body.analysis-print-active { overflow: visible; background: #fff; }
  body.analysis-print-active > :not(#analysisPrintOverlay) { display: none !important; }
  .analysis-print-overlay { position: static; overflow: visible; background: #fff; }
  .print-toolbar { display: none !important; }
  .analysis-print-document { max-width: none; margin: 0; padding: 0; }
  .analysis-print-document h2, .analysis-print-document h3 { break-after: avoid; }
  .analysis-print-document table { break-inside: auto; }
  .analysis-print-document tr, .analysis-print-document svg { break-inside: avoid; }
  .analysis-print-document thead { display: table-header-group; }
  .analysis-print-document th, .analysis-print-document td { font-size: 9pt; padding: 5px; }
  .report-result { break-before: page; margin-top: 0; }
}

.module-roadmap { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.module-card { background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--blue); padding: 17px; box-shadow: var(--shadow); }
.module-card.active { border-top-color: var(--yellow); }
.module-card > span { color: var(--blue); font-weight: 800; font-size: 12px; }
.module-card h2 { margin-top: 8px; }
.module-card p { color: var(--muted); font-size: 13px; min-height: 76px; }
.module-card small { display: block; border-top: 1px solid var(--line); padding-top: 10px; color: var(--navy); font-weight: 700; }
.control-list { display: grid; margin-top: 14px; }
.control-list > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.control-list > div:last-child { border: 0; }
.control-list strong, .control-list span { display: block; }
.control-list span { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.45; }
@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr 150px 1.5fr; }
  .selection-lock, .user-chip { display: none; }
  .grid.four { grid-template-columns: repeat(2,1fr); }
  .scenario-layout { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2,1fr); }
  .fact:nth-child(2n) { border-right: 0; }
  .decision-bar { grid-template-columns: repeat(2,1fr); }
  .decision-step:nth-child(2) { border-right: 0; }
  .filter-grid { grid-template-columns: repeat(3,1fr); }
  .scenario-settings { grid-template-columns: repeat(3,1fr); }
  .rate-profile-toolbar { grid-template-columns: 1fr 1fr; }
  .rate-profile-actions { grid-column: 1 / -1; }
  .rate-grid { grid-template-columns: repeat(2,minmax(145px,1fr)); }
  .module-roadmap { grid-template-columns: repeat(2,1fr); }
  .donut-layout { grid-template-columns: 120px 1fr; }
  .donut { width: 118px; height: 118px; }
  .group-treatment-grid { grid-template-columns: 1fr; }
  .profile-hero-grid { grid-template-columns: 1fr; }
  .element-action-header { grid-template-columns: 1fr; align-items: start; }
}
@media (min-width: 1800px) {
  .topbar { grid-template-columns:minmax(260px,.75fr) 160px minmax(420px,1.35fr) auto auto; padding-left:34px; padding-right:34px; }
  #app { padding-left:42px; padding-right:42px; }
  .portfolio-table { max-height:720px; }
}
@media (max-width: 760px) {
  .group-builder { grid-template-columns:1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .app-shell.nav-collapsed { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .sidebar-toggle { display: none; }
  .nav-collapsed .brand-copy, .nav-collapsed .nav-btn span:last-child { display: block; }
  .nav-collapsed .nav-btn { grid-template-columns: 1fr; }
  #navList { grid-template-columns: repeat(3,1fr); }
  .nav-btn { grid-template-columns: 1fr; text-align: center; gap: 3px; padding: 9px 4px; font-size: 12px; }
  .sidebar-foot { display: none; }
  .topbar { position: static; padding: 12px 16px; display: block; }
  .scope-selector { display: block; margin-bottom: 10px; }
  .scope-selector label { display: block; margin-bottom: 5px; }
  .scope-selector select { min-width: 0; width: 100%; }
  .year-selector { display: block; margin-bottom: 10px; }
  .year-selector label { display: block; margin-bottom: 5px; }
  .year-selector select { min-width: 0; width: 100%; }
  .bridge-selector { display: block; }
  .bridge-selector label { display: block; margin-bottom: 5px; }
  .bridge-selector select { min-width: 0; width: 100%; }
  .selection-lock { margin-top: 10px; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  #app { padding: 20px 14px; }
  .grid.four, .grid.three, .grid.two { grid-template-columns: 1fr; }
  .page-head { display: block; }
  .page-head .status-pill { margin-top: 12px; }
  .facts { grid-template-columns: 1fr; }
  .fact { border-right: 0; }
  .decision-bar { grid-template-columns: 1fr; }
  .decision-step { border-right: 0; border-bottom: 1px solid var(--line); }
  .decision-step::after { display: none; }
  .source-line { grid-template-columns: 1fr; gap: 5px; }
  .nav-group-label { display: none; }
  .filter-grid, .definitions-filter, .scenario-settings { grid-template-columns: 1fr; }
  .rate-profile-toolbar, .rate-grid { grid-template-columns: 1fr; }
  .rate-profile-actions { grid-column: auto; }
  .filter-grid .span-two { grid-column: auto; }
  .selection-summary { grid-template-columns: 1fr; }
  .selection-summary > div:nth-child(2) { text-align: left; }
  .scenario-steps, .module-roadmap, .workflow-flow { grid-template-columns: 1fr; }
  .scenario-steps > div, .workflow-flow > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .four-items, .analysis-grid { grid-template-columns: 1fr; }
  .compact-forecast { grid-template-columns: 1fr; }
  .compact-forecast .summary-strip { grid-template-columns: repeat(2,1fr); border-left: 0; border-top: 1px solid var(--line); }
  .compact-forecast .summary-item { border-right: 1px solid var(--line); }
  .threshold-explainer { grid-template-columns: 1fr; gap: 4px; }
  .group-controls { grid-template-columns: 1fr; }
  .element-section-row td { align-items: flex-start; }
  .element-section-row td > div { align-items: flex-start; flex-wrap: wrap; }
  .analysis-grid > div { border-right: 0; }
  .analysis-grid > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .analysis-grid > div:last-child { border-bottom: 0; }
  .explanation-metrics { grid-template-columns: 1fr; }
  .explanation-metrics > div:nth-child(3n), .explanation-metrics > div:nth-child(4n) { border-right: 0; }
  .explanation-metrics > div:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  .explanation-metrics > div:last-child { border-bottom: 0; }
  .model-flow { grid-template-columns: 1fr; }
  .model-flow b { transform: rotate(90deg); text-align: center; }
  .donut-layout { grid-template-columns: 1fr; justify-items: center; }
  .cs-weight-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* City of Seattle digital style guide alignment: compact working-surface density */
:root {
  --navy: #0046ad;
  --navy-deep: #002f6c;
  --blue: #0046ad;
  --teal: #007749;
  --yellow: #cd7b32;
  --orange: #cd7b32;
  --red: #e4002b;
  --green: #007749;
  --ink: #333333;
  --muted: #515151;
  --line: #d6d9dc;
  --wash: #f1f1f1;
  --soft-blue: #e1f5fb;
  --soft-yellow: #fff8e1;
  --shadow: 0 1px 3px rgba(0,0,0,.09);
}
body { line-height: 1.4; }
.app-shell { grid-template-columns: 224px minmax(0,1fr); }
.sidebar { padding: 18px 14px; gap: 16px; background: #002f6c; }
.brand-block { padding: 0 6px; }
.logo-mark { width: 38px; height: 38px; border-color: #fff; }
.nav-btn { padding: 9px 10px; border-radius: 2px; min-height: 40px; }
.nav-btn.active { box-shadow: inset 4px 0 #cd7b32; }
.sidebar-toggle { min-height: 34px; border-radius: 2px; }
.sidebar-foot { padding-top: 12px; }
.topbar { min-height: 68px; padding: 8px 20px; gap: 12px; grid-template-columns: minmax(190px,.8fr) 132px minmax(280px,1.35fr) auto auto; }
.scope-selector, .year-selector, .bridge-selector { grid-template-rows: 15px 36px; gap: 4px; }
.scope-selector label, .year-selector label, .bridge-selector label { min-height: 15px; font-size: 12px; color: #515151; letter-spacing: .02em; }
select, input[type="number"], input[type="text"], input[type="search"] { min-height: 36px; padding: 7px 9px; border-color: #8d969e; border-radius: 2px; }
.selection-lock { padding-left: 14px; }
.user-chip { padding-left: 12px; }
#app { padding: 20px 24px 28px; }
.page-head { gap: 16px; margin-bottom: 14px; }
.eyebrow { font-size: 11px; margin-bottom: 3px; color: #0046ad; letter-spacing: .07em; }
h1 { font-size: clamp(25px,2.2vw,32px); line-height: 1.12; color: #000; letter-spacing: -.015em; }
h2 { font-size: 18px; line-height: 1.25; color: #000; }
h3 { font-size: 16px; color: #000; }
.subtitle { margin-top: 5px; max-width: 900px; font-size: 14px; line-height: 1.4; color: #515151; }
.grid { gap: 14px; }
.card { border-radius: 2px; box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card-head { padding: 14px 16px 10px; }
.card-head p { font-size: 13px; line-height: 1.4; }
.metric { border-top-width: 3px; padding: 12px 15px 14px; min-height: 102px; }
.metric-value { font-size: 29px; margin: 9px 0 5px; }
.metric-value.compact { font-size: 25px; }
.metric-label { font-size: 12px; }
.metric-note { font-size: 12px; }
.notice { padding: 11px 13px; border-left-width: 4px; font-size: 13px; line-height: 1.4; }
.status-pill { min-height: 26px; padding: 3px 8px; border-radius: 2px; }
.btn { min-height: 36px; padding: 7px 12px; border-radius: 2px; }
.btn:focus-visible, .nav-btn:focus-visible, .sidebar-toggle:focus-visible, select:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid #199bc8; outline-offset: 2px; }
.btn.secondary:hover { background: #e1f5fb; }
th, td { padding: 9px 10px; }
.detail-band { padding: 15px 18px; border-radius: 2px 2px 0 0; }
.detail-band h2 { font-size: 22px; }
.score-disc { width: 68px; height: 68px; border-width: 6px; font-size: 24px; }
.fact { padding: 12px 15px; }
.tabs { padding: 0 16px; }
.tab { padding: 10px 10px 8px; }
.chart-area { padding: 8px 14px 14px; }
.donut-layout { grid-template-columns: 122px 1fr; gap: 14px; margin-top: 14px; }
.donut { width: 118px; height: 118px; }
.donut::after { inset: 23px; }
.donut strong { font-size: 24px; }
.summary-item { padding: 11px 13px; }
.summary-item strong { font-size: 17px; }
.portfolio-view-tools { padding: 9px 12px; }
.selection-summary { padding: 10px 12px; }
.filter-card { padding: 14px; }
.formula { padding: 14px 16px; }
.empty { padding: 28px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

@media (min-width: 1800px) {
  #app { padding-left: 28px; padding-right: 28px; }
  h1 { font-size: 32px; }
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 210px minmax(0,1fr); }
  #app { padding: 18px; }
}
/* Defined sections and compact inspection dashboard. */
.sidebar {overflow-y:auto;gap:16px;}
.nav-group-label {font-size:14px;letter-spacing:.04em;color:#bed1e6;}
.nav-group {margin-bottom:14px;}
.nav-btn {padding:9px 12px;font-size:14px;}
#bridgeHistory {scroll-margin-top:140px;}
.history-rating {background:var(--wash);border:1px solid var(--line);border-radius:8px;padding:16px;display:grid;gap:8px;}
.history-rating span,.history-rating small {font-size:14px;color:var(--muted);}
.history-rating strong {font-size:24px;}
.history-details {border:1px solid var(--line);border-radius:8px;padding:14px;}
.history-details summary {cursor:pointer;font-weight:600;}
.history-timeline {max-height:360px;overflow:auto;margin-top:12px;}
.history-timeline table {min-width:0;width:100%;}
.history-timeline th {position:sticky;top:0;background:var(--wash);}
.history-facts {display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;}
.history-facts div {min-width:0;border-bottom:1px solid var(--line);padding-bottom:8px;}
.history-facts dt {font-size:14px;color:var(--muted);overflow-wrap:anywhere;}
.history-facts dd {margin:6px 0 0;overflow-wrap:anywhere;}
.history-elements {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));gap:16px;}
.history-element {border:1px solid var(--line);border-radius:8px;padding:16px;}
.history-element h3 {overflow-wrap:anywhere;margin-top:0;}
.history-cs {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.history-cs div {display:grid;gap:6px;overflow-wrap:anywhere;}
.history-cs span {font-size:14px;color:var(--muted);}
.history-cs strong {font-size:16px;}
.history-cs-bar {display:flex;height:10px;border-radius:4px;overflow:hidden;margin-top:14px;}
#profileInspection {max-width:100%;width:100%;}
.card-title-row {flex-wrap:wrap;gap:16px;}
.year-selector {min-width:210px;}
@media(max-width:700px){.history-timeline th,.history-timeline td{padding:8px 5px;font-size:14px}.history-rating strong{font-size:20px}}
/* Consistent top controls; the year selector no longer overflows its grid track. */
.topbar {grid-template-columns:minmax(190px,1fr) minmax(155px,.65fr) minmax(250px,1.5fr);gap:16px;}
.topbar .selection-lock,.topbar .user-chip {display:none;}
.scope-selector,.year-selector,.bridge-selector {min-width:0;width:100%;}
.year-selector {min-width:0;}
.topbar select {width:100%;height:42px;text-overflow:ellipsis;padding-right:32px;}
.topbar label {font-size:14px;}
.nav-group {display:block;}
.nav-group summary {cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;min-height:36px;border-radius:4px;}
.nav-group summary::-webkit-details-marker {display:none;}
.nav-group summary::after {content:'⌄';font-size:18px;transform:rotate(-90deg);}
.nav-group[open] summary::after {transform:none;}
.nav-section-items {display:grid;gap:4px;}
.nav-group summary:focus-visible {outline:2px solid white;outline-offset:2px;}
.nav-collapsed .nav-group summary {display:flex;font-size:0;padding:4px;justify-content:center;}
.nav-collapsed .nav-group summary::after {font-size:20px;}
.bridge-trend-chart {width:100%;height:auto;min-height:170px;display:block;}
.bridge-trend-chart text {fill:var(--muted);font-size:14px;}
.bridge-trend-chart a:focus circle {stroke:var(--ink);stroke-width:3px;}
.trend-legend {display:flex;gap:20px;flex-wrap:wrap;font-size:14px;}
.trend-legend span {display:flex;gap:8px;align-items:center;}
.trend-legend i {width:16px;height:4px;display:inline-block;}
.historical-element-table table {min-width:780px;}
.historical-element-table td:first-child {max-width:280px;white-space:normal;}
.historical-element-table .cs-bar {min-width:140px;}
.card>summary {cursor:pointer;}
@media(max-width:1100px){.topbar{grid-template-columns:minmax(0,1fr) minmax(150px,.7fr)}.bridge-selector{grid-column:1/-1}}
@media(max-width:650px){.topbar{display:grid;grid-template-columns:1fr;position:static}.bridge-selector{grid-column:auto}.scope-selector,.year-selector,.bridge-selector{display:grid;margin:0}.bridge-trend-chart{min-height:140px}}
/* Compact historical charts with legible year ticks. */
.bridge-trend-chart {max-width:800px;max-height:200px;min-height:0;margin:0 auto;}
.trend-legend {max-width:800px;margin:0 auto;}
@media(max-width:650px){.bridge-trend-chart{max-height:170px;min-height:0}}
