.budget-board {
  background: #e7ece9;
}

.budget-benchmark {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--ink);
}

.benchmark-item {
  min-height: 9rem;
  padding: 1.2rem;
  border-inline-end: 1px solid var(--ink);
}

.benchmark-item:last-child {
  border-inline-end: 0;
}

.benchmark-item span,
.benchmark-item strong {
  display: block;
}

.benchmark-item span {
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.benchmark-item strong {
  margin-top: 1rem;
  font-family: var(--display);
  font-size: 2.2rem;
  line-height: 1;
}

.benchmark-caveat {
  grid-column: 1 / -1;
  margin: 0;
  border-top: 1px solid var(--ink);
  padding: 1rem 1.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.budget-form {
  margin-top: 2.5rem;
  border: 1px solid var(--ink);
  background: var(--surface);
}

.budget-form-head,
.budget-line,
.budget-total-row {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(12rem, 0.4fr);
  align-items: center;
}

.budget-form-head {
  background: var(--ink);
  color: var(--surface);
  padding: 0.85rem 1rem;
}

.budget-form-head span {
  justify-self: end;
  color: #d7dce0;
  font-size: 0.72rem;
}

.budget-line {
  min-height: 4.5rem;
  border-bottom: 1px solid var(--divider);
  padding: 0.65rem 1rem;
}

.budget-line label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.84rem;
  font-weight: 650;
}

.required-mark {
  color: var(--stop);
  font-size: 0.7rem;
}

.budget-line-input {
  position: relative;
}

.budget-line-input span {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  color: var(--muted);
}

.budget-line input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  padding: 0.55rem 0.75rem 0.55rem 1.8rem;
}

.budget-line input:invalid:not(:placeholder-shown) {
  border-color: var(--stop);
}

.budget-total-row {
  min-height: 7rem;
  padding: 1rem;
}

.budget-total-row > div span,
.budget-total-row > div strong {
  display: block;
}

.budget-total-row > div span {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.budget-total-row > div strong {
  margin-top: 0.5rem;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.budget-total-row button {
  justify-self: end;
}

.form-note {
  margin: 0;
  border-top: 1px solid var(--divider);
  padding: 0.8rem 1rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.budget-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.5rem;
  margin-top: 1.25rem;
}

.budget-sources a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.validation-board {
  background: var(--surface);
}

.gate-route {
  position: relative;
}

.gate-route::before {
  content: "";
  position: absolute;
  top: 2.25rem;
  right: 8%;
  left: 8%;
  height: 4px;
  background: var(--rail-blue);
}

.gate-stations {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(10rem, 1fr));
  overflow-x: auto;
}

.gate-station {
  position: relative;
  min-width: 10rem;
  padding: 0 1rem;
}

.gate-code {
  position: relative;
  z-index: 2;
  width: 4.5rem;
  height: 4.5rem;
  display: grid;
  place-items: center;
  margin: 0 auto 1.5rem;
  border: 4px solid var(--rail-blue);
  border-radius: 50%;
  background: var(--surface);
  color: var(--rail-blue);
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
}

.gate-station h3 {
  text-align: center;
}

.gate-station p {
  font-size: 0.76rem;
}

.gate-go strong {
  color: var(--fact);
}

.gate-stop strong {
  color: var(--stop);
}

.gate-note {
  margin-top: 2.5rem;
  border: 1px solid var(--ink);
  padding: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.risk-board {
  background: var(--ink);
  color: var(--surface);
}

.risk-board .section-heading p:not(.route-label) {
  color: #c5cdd2;
}

.risk-register {
  border: 1px solid #69747c;
}

.risk-row {
  display: grid;
  grid-template-columns: 0.55fr 1.2fr 0.75fr 1.5fr;
  border-bottom: 1px solid #485159;
}

.risk-row:last-child {
  border-bottom: 0;
}

.risk-row > * {
  padding: 1rem;
  border-inline-end: 1px solid #485159;
}

.risk-row > *:last-child {
  border-inline-end: 0;
}

.risk-row-head {
  background: #20272d;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.risk-severity {
  color: #f0b0b0;
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
}

.risk-state {
  color: #ffd0a5;
  font-size: 0.72rem;
  font-weight: 700;
}

.risk-row span:last-child {
  color: #d7dce0;
  font-size: 0.8rem;
}

.faq-board {
  background: var(--paper);
}

.faq-list {
  border-top: 2px solid var(--ink);
}

.faq-item {
  border-bottom: 1px solid var(--divider);
}

.faq-item summary {
  min-height: 4.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  font-size: 1.25rem;
}

.faq-item[open] summary::after {
  content: "-";
  background: var(--ink);
  color: var(--surface);
}

.faq-item p {
  max-width: 72ch;
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.faq-evidence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: -0.5rem 0 1.5rem;
}

.faq-evidence > span {
  margin-inline-end: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.faq-evidence button {
  min-width: 4.5rem;
  min-height: 44px;
  border: 1px solid var(--divider);
  border-radius: 2px;
  background: var(--surface);
  color: var(--rail-blue);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
}

.faq-evidence button:hover {
  border-color: var(--rail-blue);
}

.sources-board {
  background: var(--surface);
}

.source-search {
  display: grid;
  gap: 0.45rem;
}

.source-search span {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.source-search input {
  min-height: 48px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  padding: 0.7rem 0.9rem;
}

.source-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.source-filters button {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  padding: 0.45rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.source-filters button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--surface);
}

.source-library {
  border: 1px solid var(--ink);
}

.source-record {
  display: grid;
  grid-template-columns: 0.45fr 0.55fr 1.7fr 0.8fr;
  align-items: start;
  border-bottom: 1px solid var(--divider);
}

.source-record:last-child {
  border-bottom: 0;
}

.source-record > * {
  padding: 0.9rem;
  border-inline-end: 1px solid var(--divider);
}

.source-record > *:last-child {
  border-inline-end: 0;
}

.source-record-id {
  color: var(--rail-blue);
  font-size: 0.72rem;
  font-weight: 750;
}

.source-record-claim {
  font-size: 0.8rem;
}

.source-record-links {
  display: grid;
  gap: 0.4rem;
}

.source-record-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.empty-state {
  border: 1px solid var(--divider);
  padding: 1.5rem;
  color: var(--muted);
}

.decision-close {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 0.65fr);
  gap: 3rem;
  padding: clamp(5rem, 10vw, 9rem) var(--page-padding);
  background: var(--rail-blue);
  color: var(--surface);
}

.decision-close > div:first-child {
  max-width: 70rem;
}

.decision-close .route-label {
  color: #d8e6fa;
}

.decision-close h2 {
  max-width: 16ch;
}

.decision-close p {
  max-width: 72ch;
  color: #e4edfb;
}

.decision-actions {
  align-self: center;
  display: grid;
  gap: 0.8rem;
}

.decision-actions .primary-action {
  background: var(--surface);
  color: var(--rail-blue);
  border-color: var(--surface);
}

.decision-actions .primary-action:hover {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.decision-actions .secondary-action {
  color: var(--surface);
  border-color: var(--surface);
}

.decision-actions .secondary-action:hover {
  background: var(--surface);
  color: var(--rail-blue);
}

#copy-feedback {
  min-height: 1.5rem;
  margin: 0;
  font-size: 0.78rem;
}

.decision-boundary {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid #f3a8a8;
  background: var(--stop);
  padding: 1rem;
}

.decision-boundary strong {
  font-family: var(--display);
  font-size: 2rem;
}

.decision-boundary span {
  font-size: 0.8rem;
}

.evidence-drawer {
  position: fixed;
  z-index: 70;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(34rem, 100%);
  overflow-y: auto;
  border-inline-start: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  padding: 1.5rem;
  box-shadow: -18px 0 40px rgb(20 25 30 / 18%);
  transform: translateX(105%);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.evidence-drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1rem;
}

.drawer-head > span {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.drawer-head button {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  padding: 0 0.8rem;
  cursor: pointer;
}

.drawer-head button:hover {
  background: var(--ink);
  color: var(--surface);
}

#drawer-content {
  padding-top: 1.5rem;
}

#drawer-content h2 {
  max-width: 14ch;
  margin-top: 1rem;
  color: var(--rail-blue);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
}

.drawer-answer {
  margin-top: 2rem;
  border-block: 1px solid var(--divider);
  padding: 1rem 0;
}

.drawer-limit {
  border: 1px solid var(--inference);
  padding: 1rem;
  color: #713900;
}

.drawer-source {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.drawer-source a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
}

.drawer-scrim {
  position: fixed;
  z-index: 60;
  inset: 0;
  background: rgb(20 25 30 / 54%);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid #3e474e;
  background: var(--ink);
  color: #c3cbd0;
  padding: 1.2rem var(--page-padding);
  font-size: 0.7rem;
}
