:root {
  --navy: #202D35;
  --navy2: #293B44;
  --paper: #F5F4F0;
  --white: #FFFFFF;
  --ink: #202D35;
  --muted: #616B6F;
  --teal: #286B68;
  --line: #DCDDD7;
  --bronze: #A17B49;
  --red: #9B3932;
  --gold: #78551B;
  --green: #276246;
  --input-line: #88938F;
  font: 14px/1.55 "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary, [tabindex] { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--teal); }
.rail :focus-visible { outline-color: #FFFFFF; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: var(--paper); border-color: #AEB5B1; }
button.primary, .button.primary { background: var(--teal); color: var(--white); border-color: var(--teal); }
button.primary:hover, .button.primary:hover { background: #205754; border-color: #205754; }
button.danger { color: var(--red); }
button:disabled { background: #F0F0EC; border-color: var(--line); color: #707874; cursor: not-allowed; }
.button.quiet { background: transparent; border-color: transparent; color: var(--teal); }
.button.quiet:hover { background: #E9EEEB; }
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  height: 100dvh;
  padding: 28px 16px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--navy);
  color: #D1D7D9;
}
.brand { padding: 0 12px 24px; border-bottom: 1px solid #48545A; margin-bottom: 14px; }
.brand strong { display: block; color: var(--white); font: 31px/1.3 Georgia, serif; letter-spacing: 5px; }
.brand span { display: block; margin-top: 5px; color: #CBD1D3; font-size: 10px; letter-spacing: 2.4px; text-transform: uppercase; }
.navgroup { padding: 16px 12px 8px; color: #ADB7BB; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; }
.rail nav a { display: flex; align-items: center; gap: 11px; margin: 3px 0; padding: 10px 12px; color: #D1D7D9; font-size: 12px; border-radius: 2px; text-decoration: none; }
.rail nav a:hover { background: var(--navy2); color: var(--white); }
.rail nav a.active { background: var(--teal); color: var(--white); }
.navicon { display: inline-flex; width: 16px; height: 18px; flex-shrink: 0; align-items: center; }
.navicon svg { width: 16px; height: 16px; }
.rail-bottom { margin-top: auto; padding: 18px 12px 0; border-top: 1px solid #48545A; font-size: 11px; line-height: 1.7; }
.rail-bottom strong { display: block; color: var(--white); font-size: 12px; }
.rail-bottom button { display: block; min-height: 32px; margin-top: 12px; padding: 4px 12px; color: var(--white); background: transparent; border-color: #6B777D; }
.rail-bottom button:hover { background: var(--navy2); }
.workspace { grid-column: 2; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 60px; padding: 14px 36px; background: var(--white); border-bottom: 1px solid var(--line); font-size: 11px; }
.crumb { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; color: var(--muted); }
.crumb [aria-current] { color: var(--ink); }
.crumb a { text-decoration: none; }
.topright { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.env { display: inline-block; padding: 3px 7px; color: var(--muted); border: 1px solid var(--line); background: var(--paper); border-radius: 2px; font-size: 9px; font-weight: 600; letter-spacing: 1px; white-space: nowrap; }
.validation { padding: 9px 36px; background: #FBF5E9; color: #72531B; font-size: 11px; border-bottom: 1px solid #E6D8B9; }
.main-content { max-width: 1720px; margin: auto; padding: 29px 36px 60px; }
.eyebrow { color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 600; letter-spacing: 1.5px; }
.heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.heading > div:first-child { min-width: 0; }
.heading > .actions { justify-content: flex-end; max-width: 440px; padding-top: 25px; flex-shrink: 0; }
h1 { margin: 8px 0 9px; font-size: 29px; font-weight: 600; line-height: 1.2; letter-spacing: -.8px; overflow-wrap: anywhere; }
h2 { margin: 0 0 13px; font-size: 16px; line-height: 1.4; font-weight: 600; letter-spacing: -.2px; }
h3 { margin: 0 0 12px; font-size: 14px; line-height: 1.5; font-weight: 600; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
.sub { margin: 8px 0; color: var(--muted); font-size: 12px; }
.heading .sub { margin: 0; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 28px; border-block: 1px solid var(--line); background: var(--white); }
.stat { min-width: 0; padding: 19px 23px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat label { color: var(--muted); font-size: 11px; }
.stat strong { display: block; margin: 5px 0; font-size: 26px; line-height: 1.45; font-weight: 500; letter-spacing: -.6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat small { display: block; color: var(--muted); font-size: 10px; }
.panel { margin-bottom: 24px; border: 1px solid var(--line); border-radius: 2px; background: var(--white); min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 21px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; margin-right: auto; }
.panel-head > .actions { margin-left: auto; justify-content: flex-end; }
.panel-body { padding: 21px; }
.panel-body > .panel:last-child { margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.grid2 > *, .grid-equal > * { min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 21px; }
.toolbar input { max-width: 320px; }
.toolbar .field { min-width: 135px; flex: 1; }
.inspection-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.inspection-card { min-width: 0; border: 1px solid var(--line); border-radius: 2px; padding: 16px; }
.table-wrap { max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; scrollbar-color: #9DA9A3 var(--paper); }
.table-wrap:focus-visible { outline-offset: -3px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
caption { padding: 9px 18px; background: var(--white); border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: left; letter-spacing: .15px; }
th { position: sticky; top: 0; z-index: 1; padding: 12px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .55px; text-align: left; text-transform: uppercase; }
td { padding: 13px 18px; border-bottom: 1px solid #E9E9E3; vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num .sub { text-align: right; }
td .sub { margin: 3px 0 0; font-size: 11px; }
td .linkbutton { max-width: 320px; overflow-wrap: anywhere; white-space: normal; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFAF7; }
td.balance-column { background: #F8F8F4; font-weight: 600; }
th.balance-column, td.balance-column { border-left: 1px solid var(--line); }
.actions-column { text-align: right; }
td.actions-column button { min-height: 30px; padding: 4px 10px; }
.total-row td { border-top: 2px solid var(--ink); background: var(--paper); font-weight: 600; }
.negative { color: var(--red); }
#scenario-details .table-wrap { max-height: 620px; }
.linkbutton { min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--teal); text-align: left; font-size: inherit; font-weight: 600; }
.linkbutton:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 2px; background: #F0F0EC; color: #596367; font-size: 10px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.badge.warn { color: var(--gold); background: #FBF1DC; }
.badge.good { color: var(--green); background: #EAF3EC; }
.badge.bad { color: var(--red); background: #FAEBE8; }
.badge.blue { color: #435C6B; background: #EDF0F2; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--teal); }
.empty { padding: 32px 21px; color: var(--muted); text-align: center; white-space: normal; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.tabs { display: flex; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); overflow: auto; }
.tabs button { display: inline-flex; gap: 7px; flex-shrink: 0; padding: 12px 0 13px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); white-space: nowrap; font-weight: 500; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { border-bottom-color: var(--teal); color: var(--teal); font-weight: 600; }
.tab-number { font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 400; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 21px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 12px; font-weight: 600; }
.field.full { grid-column: 1 / -1; }
input, select, textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--input-line); border-radius: 2px; background: var(--white); color: var(--ink); font-size: 13px; line-height: 1.5; font-weight: 400; }
input:hover, select:hover, textarea:hover { border-color: #657975; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--teal); outline-offset: 1px; }
input[type="number"] { font-variant-numeric: tabular-nums; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[readonly], textarea[readonly], input:disabled, select:disabled, textarea:disabled { background: #F0F0EC; border-color: var(--line); color: var(--muted); }
.field:has(> input[readonly])::after { content: "Calculated · read only"; color: var(--muted); font-size: 10px; font-weight: 400; }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--teal); flex-shrink: 0; }
input[type="file"] { font-size: 12px; background: #FCFCFA; }
input::file-selector-button { margin-right: 10px; border: 0; border-right: 1px solid var(--line); padding: 2px 12px 2px 0; background: transparent; color: var(--teal); font: inherit; font-weight: 600; cursor: pointer; }
.check { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; font-size: 12px; font-weight: 400; }
.check input { margin: 3px 0 0; }
.check + .check { margin-top: 9px; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-section { padding-top: 22px; border-top: 1px solid var(--line); margin-top: 5px; }
.form-section:first-child { padding-top: 0; border-top: 0; margin-top: 0; }
.form-section h3 { margin: 0; font-size: 14px; }
.form-section p { margin: 3px 0 0; color: var(--muted); font-weight: 400; font-size: 12px; }
fieldset { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 2px; min-width: 0; }
legend { padding: 0 6px; font-weight: 600; font-size: 12px; }
form > h3 { margin-top: 26px; padding-top: 21px; border-top: 1px solid var(--line); }
form > h3:first-child { margin-top: 0; padding-top: 0; border: 0; }
form > button, form > .formgrid + button { margin-top: 16px; }
form + form { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.notice { margin-bottom: 20px; padding: 14px 17px; border-left: 2px solid var(--teal); background: #EDF3F2; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.notice.warn { background: #FBF5E9; border-color: #B18120; color: #634D23; }
.error { margin-bottom: 16px; padding: 13px 16px; border-left: 2px solid var(--red); background: #FAEBE8; color: #8B2C26; font-size: 12px; overflow-wrap: anywhere; }
.progress { height: 5px; margin: 9px 0; background: #E8EBE7; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--teal); }
.timeline-item { display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.timeline-item:last-child { border: 0; }
.timeline-item > div { min-width: 0; overflow-wrap: anywhere; }
.timeline-point { width: 6px; height: 6px; margin-top: 7px; background: var(--bronze); flex-shrink: 0; }
.timeline-item p { margin: 0; }
.timeline-item small { color: var(--muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 20px; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 3px; margin: 0 6px 3px 0; }
.chart { display: block; width: 100%; height: 240px; }
.chart text { fill: var(--muted); font: 10px "Segoe UI", sans-serif; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart polyline { fill: none; stroke-width: 2; }
.details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 23px 20px; margin: 0 0 20px; }
.details dt, .facts dt { color: var(--muted); font-size: 11px; }
.details dd { margin: 5px 0 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
dialog { width: calc(100% - 32px); max-width: 820px; max-height: 90dvh; padding: 0; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); box-shadow: 0 12px 48px #202D3526; scroll-padding-block: 90px; }
dialog::backdrop { background: #202D3566; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 3; padding: 20px 26px; border-bottom: 1px solid var(--line); background: var(--white); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head button { padding: 0; min-width: 32px; min-height: 32px; border: 0; font-size: 24px; font-weight: 400; }
#modal-form { padding: 24px 26px 0; }
#modal-form > .form-actions { position: sticky; bottom: 0; z-index: 2; margin: 24px -26px 0; padding: 16px 26px; background: var(--white); }
#modal-error:has(.error) { padding-block: 16px; }
#toast { display: none; position: fixed; bottom: 24px; right: 24px; z-index: 100; max-width: min(400px, calc(100% - 32px)); padding: 13px 20px; background: var(--navy); color: var(--white); border-radius: 2px; font-size: 13px; box-shadow: 0 3px 16px #202D351A; }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px max(25px, calc((100vw - 1100px) / 2)); border-bottom: 1px solid var(--line); background: var(--white); }
.public-brand { font: 29px/1.3 Georgia, serif; letter-spacing: 4px; }
.public-brand small { display: block; margin-top: 3px; color: var(--muted); font: 10px/1.5 "Segoe UI", sans-serif; letter-spacing: 2px; }
.public-main { max-width: 1150px; margin: auto; padding: 40px 25px 72px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 64px; align-items: center; margin: 8px 0 40px; }
.hero h1 { max-width: 580px; margin: 12px 0 18px; font-size: 39px; line-height: 1.18; letter-spacing: -1.1px; }
.hero p { max-width: 540px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.hero p.small { font-size: 12px; }
.hero-art { padding: 24px 28px; border: 1px solid var(--line); border-top: 2px solid var(--ink); background: var(--white); }
.hero-art h2 { margin-bottom: 24px; color: var(--ink); font: 25px/1.3 Georgia, serif; }
.hero-art .step { font-size: 12px; }
.hero-art .step span { margin-right: 13px; color: var(--teal); font-size: 11px; font-variant-numeric: tabular-nums; }
.hero-art .line { height: 26px; margin: 5px 0 5px 7px; border-left: 1px solid var(--line); }
.public-footer { padding: 24px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 11px; }
.securelink { display: block; margin: 15px 0; padding: 15px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink); overflow-wrap: anywhere; font-size: 12px; }
.loading { padding: 50px; color: var(--muted); }
.skip { position: fixed; top: -100px; left: 10px; z-index: 1000; padding: 10px; background: var(--white); }
.skip:focus { top: 10px; }
.docitem { padding: 20px 0; border-bottom: 1px solid var(--line); }
.docitem:first-child { padding-top: 0; }
.docitem:last-child { border: 0; padding-bottom: 0; }
.dochead { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.dochead h3 { margin: 0; }
.files { margin: 10px 0; font-size: 12px; overflow-wrap: anywhere; }
.files a { display: block; }
.code { max-height: 380px; overflow: auto; padding: 16px; background: var(--paper); color: var(--ink); font: 11px/1.6 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.section-tag { color: var(--muted); font-size: 11px; }
.number { font-variant-numeric: tabular-nums; }
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 21px; border-bottom: 1px solid var(--line); }
.report-row > div { min-width: 0; }
.report-row .sub { overflow-wrap: anywhere; }
.report-row:last-child { border: 0; }
.report-document { max-width: 860px; margin: 0 auto; padding: 36px 42px 42px; counter-reset: narrative; }
.report-document .document-label { margin-bottom: 28px; padding-bottom: 15px; border-bottom: 1px solid var(--line); color: var(--muted); font: 10px/1.5 "Segoe UI", sans-serif; letter-spacing: 1.2px; text-transform: uppercase; }
.report-document h3 { margin-top: 28px; font: 20px/1.35 Georgia, serif; color: var(--ink); }
.report-document h3::before { counter-increment: narrative; content: "0" counter(narrative) " / "; color: #795C37; font: 10px/1.5 "Segoe UI", sans-serif; vertical-align: middle; margin-right: 10px; }
.report-document p { font: 14px/1.9 Georgia, serif; white-space: pre-line; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0 0 16px; }
.facts dd { margin: 4px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.facts ul { margin: 0; padding-left: 18px; }
.client-facts h3 { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.client-facts td input { min-width: 90px; }
.cf-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.cf-row[data-cf-row="issue"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.cf-row[data-cf-row="issue"] .field.full { grid-column: 1 / -1; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 18px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; height: 160px; object-fit: cover; border: 1px solid var(--line); border-radius: 2px; }
.photo-grid figcaption { margin-top: 7px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.category-bar { margin: 0 0 14px; font-size: 12px; }
.category-bar strong { float: right; font-variant-numeric: tabular-nums; }
.category-bar meter { display: block; width: 100%; height: 9px; accent-color: var(--teal); }
.category-bar meter::-webkit-meter-bar { background: #E9ECE7; border: 0; border-radius: 0; }
.category-bar meter::-webkit-meter-optimum-value { background: var(--teal); }
.category-bar meter::-moz-meter-bar { background: var(--teal); }
.structured-editor { padding: 22px 0 0; border: 0; border-top: 1px solid var(--line); background: transparent; font-weight: 400; }
.structured-editor h3 { margin: 0; }
.structured-editor .muted { margin: 6px 0 14px; }
.structured-row { padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); border-left: 2px solid #9AADA8; background: #FCFCFA; }
.structured-row-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 12px; }
.structured-row-heading button { min-height: 28px; padding: 3px 9px; font-size: 11px; }
.structured-row .check { align-self: end; padding: 10px 0; }
.structured-row .formgrid { gap: 12px 16px; }
.advanced-data { margin-top: 15px; color: var(--muted); font-size: 11px; }
summary { cursor: pointer; }
.advanced-data label { margin-top: 10px; }
.advanced-data textarea { min-height: 150px; font: 11px/1.5 Consolas, monospace; }
.add-row { align-self: flex-start; }
.pricing-breakdown ul { margin: 12px 0; padding-left: 18px; }
.pricing-breakdown p { padding-top: 12px; border-top: 1px solid #CCD9D5; font-variant-numeric: tabular-nums; line-height: 1.9; }
.pricing-breakdown p strong { display: inline-block; margin-top: 5px; font-size: 16px; }
.pricing-breakdown small { color: #465F59; }
#extract-config:not(:empty), #financial-proposal-list:not(:empty) { margin-top: 24px; }
#extract-config > .actions { margin-top: 18px; }
#financial-proposal-list .timeline-item { flex-wrap: wrap; }
#financial-proposal-list .timeline-item > .notice, #financial-proposal-list .timeline-item > .table-wrap { flex-basis: 100%; }
@media (max-width: 1250px) {
  .heading { flex-wrap: wrap; gap: 15px; }
  .heading > .actions { max-width: none; padding-top: 0; }
  .stats .stat { padding-inline: 18px; }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .rail { width: 200px; padding: 24px 12px; }
  .rail nav a { gap: 9px; padding-inline: 10px; font-size: 11px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .grid2, .grid-equal { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .main-content { padding: 25px; }
  .topbar, .validation { padding-left: 25px; padding-right: 25px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .hero { gap: 30px; }
}
@media (max-width: 740px) {
  .shell { display: block; }
  .rail { position: static; width: auto; height: auto; padding: 16px 17px 12px; overflow: visible; }
  .brand { padding: 0 0 12px; margin: 0; }
  .brand strong { font-size: 25px; }
  .brand span { font-size: 9px; margin-top: 2px; }
  .rail nav { display: flex; overflow: auto; padding: 8px 0; gap: 8px; }
  .rail nav a { flex-shrink: 0; padding: 8px 10px; margin: 0; font-size: 12px; white-space: nowrap; }
  .navgroup, .navicon { display: none; }
  .rail-bottom { display: flex; align-items: center; justify-content: space-between; padding: 9px 0 0; margin: 0; }
  .rail-bottom strong { font-size: 11px; }
  .rail-bottom .staff-meta { display: none; }
  .rail-bottom button { min-height: 30px; margin: 0; padding: 3px 10px; font-size: 11px; }
  .workspace { display: block; }
  .topbar { padding: 12px 17px; gap: 10px; }
  .crumb { flex-basis: 100%; gap: 6px; font-size: 10px; }
  .topright { gap: 12px; width: 100%; justify-content: space-between; }
  .main-content { padding: 22px 17px 40px; }
  .validation { padding: 9px 17px; font-size: 10px; }
  .heading { flex-direction: column; gap: 15px; }
  .heading > .actions { justify-content: flex-start; }
  h1 { font-size: 25px; letter-spacing: -.5px; }
  .stats { margin-bottom: 22px; }
  .stats .stat { padding: 15px; }
  .stat strong { font-size: 23px !important; }
  .formgrid { grid-template-columns: minmax(0, 1fr); }
  .field.full { grid-column: 1 / -1; }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .panel-head, .panel-body { padding: 17px; }
  .panel-head { align-items: flex-start; }
  .panel-head > .actions { margin-left: 0; justify-content: flex-start; }
  .panel-head h2 { flex-basis: 100%; }
  .toolbar { padding: 14px 17px; }
  .toolbar input { max-width: none; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 0; }
  .hero h1 { font-size: 32px; }
  .hero-art { padding: 22px; }
  .hero-art h2 { font-size: 23px; }
  .public-main { padding: 28px 17px 40px; }
  .public-header { padding: 17px; gap: 12px; align-items: flex-start; }
  .public-header .actions { flex-direction: column; gap: 8px; align-items: flex-end; font-size: 11px; }
  .public-brand { font-size: 25px; }
  .tabs { gap: 22px; margin-bottom: 22px; }
  .tabs button { padding-block: 10px; }
  .chart { height: 210px; }
  dialog { width: calc(100% - 20px); max-height: 94dvh; }
  .modal-head { padding: 16px 18px; }
  .modal-head h2 { font-size: 16px; }
  #modal-form { padding: 20px 18px 0; }
  #modal-form > .form-actions { margin-inline: -18px; padding: 14px 18px; }
  .facts, .cf-row, .cf-row[data-cf-row="issue"] { grid-template-columns: minmax(0, 1fr); }
  .cf-row > button { justify-self: start; }
  .report-row { flex-direction: column; align-items: flex-start; padding: 17px; gap: 12px; }
  .report-document { padding: 24px 20px; }
  .report-document h3 { font-size: 18px; }
  .notice, .error { padding: 13px 14px; }
  .dochead { flex-wrap: wrap; }
  .timeline-item { gap: 10px; }
  #toast { bottom: 16px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .rail nav a.active, .tabs button.active { outline: 2px solid Highlight; outline-offset: -2px; }
  .badge { border: 1px solid currentColor; }
}
@media print {
  .rail, .topbar, .validation, button, .tabs, .skip, #toast, .heading > .actions { display: none !important; }
  :root, body { background: white; color: black; }
  .shell, .workspace { display: block; }
  .main-content, .public-main { padding: 0; max-width: none; }
  .panel { border-radius: 0; overflow: visible; break-inside: auto; }
  .table-wrap, #scenario-details .table-wrap { max-height: none; overflow: visible; }
  table { white-space: normal; font-size: 9px; }
  th { position: static; }
  th, td { padding: 7px 8px; }
  thead { display: table-header-group; }
  tr, .report-document h3 { break-inside: avoid; }
  .report-document { padding: 24px; }
}
