:root {
  --bg-page: #fff4d8;
  --bg-surface: #fffbe9;
  --bg-subtle: #f7f1df;
  --ink-primary: #111111;
  --ink-secondary: #2a261d;
  --ink-muted: #625a48;
  --border-subtle: #111111;
  --border-strong: #111111;
  --brand-navy-900: #111111;
  --brand-navy-800: #111111;
  --brand-navy-700: #2a261d;
  --action-blue: #007c89;
  --action-blue-hover: #111111;
  --teal: #4dd7ff;
  --purple: #bfa7ff;
  --amber: #4dd7ff;
  --red: #ff6257;
  --green: #82df51;
  --source-official: #4dd7ff;
  --source-derived: #bfa7ff;
  --source-revised: #ffb02e;
  --source-review: #ff6257;
  --neo-ink: #111111;
  --neo-paper: #fff4d8;
  --neo-surface: #fffbe9;
  --neo-primary: #4dd7ff;
  --neo-focus: #007c89;
  --neo-cyan: #4dd7ff;
  --neo-pink: #ff8fc8;
  --neo-green: #8ee6c9;
  --neo-red: #ff6257;
  --neo-blue: #007c89;
  --neo-muted: #d8d0b8;
  --radius: 6px;
  --shadow-soft: 7px 7px 0 #111111;
  --motion-fast: 140ms;
  --motion-drawer: 200ms;
  --motion-chart: 320ms;
  --motion-flow: 340ms;
  --ease-civic: cubic-bezier(0.2, 0, 0, 1);
  --home-columns: minmax(0, 1.08fr) minmax(340px, 0.72fr);
  --home-gap: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg-page);
  color: var(--ink-primary);
  font-family: Inter, "Source Sans 3", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

button,
select {
  font: inherit;
}

button,
.budget-card,
.search-result,
.source-button,
.detail-drill,
.detail-source,
.compare-chip,
.mode-button {
  transition:
    border-color var(--motion-fast) var(--ease-civic),
    background-color var(--motion-fast) var(--ease-civic),
    color var(--motion-fast) var(--ease-civic),
    transform var(--motion-fast) var(--ease-civic),
    box-shadow var(--motion-fast) var(--ease-civic);
}

button:hover,
.budget-card:hover,
.search-result:hover,
.source-button:hover,
.detail-drill:hover,
.detail-source:hover {
  transform: translateY(-1px);
}

button:focus-visible,
select:focus-visible,
.note-segment:focus-visible,
.ranked-segment:focus-visible,
.stacked-segment:focus-visible,
.stacked-ring-callout:focus-visible,
.stacked-rect-callout:focus-visible,
.snake-segment:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--action-blue) 70%, white);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(20px, 4vw, 48px);
  background: rgba(246, 248, 251, 0.94);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  color: inherit;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  font-weight: 780;
  line-height: 1.15;
}

.brand small {
  margin-top: 3px;
  color: var(--ink-secondary);
  font-size: 12px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #f6f8fb;
  background: var(--brand-navy-900);
  border-radius: var(--radius);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.7;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: min(1180px, 100%);
  padding: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.mode-button {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 50px;
  padding: 7px 10px;
  color: var(--ink-secondary);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}

.mode-button span {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.1;
}

.mode-button small {
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.1;
}

.home-grid,
.signature-grid {
  display: grid;
  grid-template-columns: var(--home-columns);
  gap: var(--home-gap);
  margin-bottom: 16px;
}

body[data-mode="home"] .home-grid {
  grid-template-columns: minmax(0, 1fr);
}

.policy-summary-grid,
.policy-layout {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.policy-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.policy-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr);
}

.policy-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(220px, 1fr);
  gap: 14px 18px;
  align-content: start;
  min-height: 0;
  padding: 18px 20px 18px 24px;
  background: linear-gradient(90deg, var(--policy-card-color, var(--neo-primary)) 0 12px, #ffffff 12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(6, 27, 43, 0.05);
}

.policy-card span,
.policy-card div,
#policy-measures-table span {
  color: var(--ink-secondary);
}

.policy-card-head {
  display: grid;
  gap: 8px;
  align-content: start;
}

.policy-card-title {
  color: var(--ink-primary);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
}

.policy-card-head small {
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.3;
}

.policy-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.policy-metric {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-left: 12px;
  border-left: 3px solid var(--ink-primary);
}

.policy-metric strong {
  color: var(--brand-navy-900);
  font-size: clamp(24px, 3vw, 34px);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1;
}

.policy-metric small {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.policy-card-breakdown {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 8px;
}

.policy-card-breakdown span {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  padding: 6px 8px;
  color: var(--ink-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.15;
}

.policy-card-breakdown strong {
  color: inherit;
  font-size: 1em;
  line-height: inherit;
}

.policy-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(5, minmax(130px, 1fr));
  gap: 12px;
}

.filter-preview {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.filter-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-preview-list {
  display: grid;
  gap: 8px;
}

.filter-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.filter-preview-row:hover,
.filter-preview-row:focus-visible {
  border-color: var(--brand-blue-600);
  box-shadow: 0 0 0 3px rgba(0, 124, 137, 0.12);
  outline: none;
}

.filter-preview-row strong,
.filter-preview-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-preview-row strong {
  color: var(--brand-navy-900);
  font-size: 14px;
}

.filter-preview-row span {
  color: var(--text-muted);
  font-size: 12px;
}

.filter-preview-row em {
  color: var(--brand-navy-900);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.policy-search-control input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  font: inherit;
  text-transform: none;
}

.policy-table-wrap table td {
  vertical-align: top;
}

.measure-top-list,
.measure-detail,
.measure-year-bars,
.measure-tags,
.measure-components,
.continuation-reason,
.entity-breakdown {
  display: grid;
  gap: 10px;
}

.measure-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  animation: nesting-slide 260ms var(--ease-civic) both;
  animation-delay: calc(var(--i) * 36ms);
}

.measure-top-row:hover {
  border-color: var(--action-blue);
  background: #f8fbff;
}

.measure-top-row span,
.measure-top-row small,
.measure-detail span,
.measure-detail p {
  color: var(--ink-secondary);
}

.measure-top-row span,
.measure-top-row small {
  grid-column: 1 / -1;
  font-size: 12px;
  line-height: 1.35;
}

.measure-top-row strong,
.measure-detail > strong {
  color: var(--brand-navy-900);
  font-size: 15px;
  line-height: 1.25;
}

.measure-top-row em {
  color: var(--brand-navy-900);
  font-style: normal;
  font-weight: 820;
}

.measure-detail p {
  margin: 0;
  line-height: 1.45;
}

.measure-tags {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));
}

.measure-tags span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.18;
  text-align: center;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.measure-components,
.continuation-reason,
.entity-breakdown {
  padding: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.measure-components summary,
.entity-breakdown summary {
  cursor: pointer;
  color: var(--brand-navy-900);
  font-size: 13px;
  font-weight: 780;
}

.measure-components ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink-secondary);
  line-height: 1.4;
}

.continuation-reason strong,
.continuation-reason span {
  display: block;
}

.continuation-reason span {
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.measure-year-bars > div {
  display: grid;
  grid-template-columns: 68px minmax(80px, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.measure-year-bars i {
  display: block;
  width: var(--w);
  max-width: 100%;
  height: 10px;
  background: var(--teal);
  border-radius: 999px;
}

.measure-year-bars i.positive {
  background: #9f1239;
}

.measure-year-bars i.negative {
  background: #007c89;
}

.measure-year-bars i.neutral {
  background: #728092;
}

.measure-year-bars em {
  color: var(--brand-navy-900);
  font-style: normal;
  font-weight: 780;
}

#policy-measures-table .source-button + .source-button {
  margin-left: 6px;
}

.measures-stage {
  margin-bottom: 16px;
}

.policy-note {
  aspect-ratio: 1280 / 680;
}

.policy-map-row {
  cursor: pointer;
  outline: none;
  animation: chart-bar-in 260ms var(--ease-civic) both;
  animation-delay: calc(var(--i) * 26ms);
}

.policy-map-row .policy-map-track {
  fill: #dce4ec;
}

.policy-map-row .policy-map-fill {
  opacity: 0.92;
}

.policy-map-row.is-selected .policy-map-track,
.policy-map-row:hover .policy-map-track,
.policy-map-row:focus .policy-map-track {
  fill: #cbd9e5;
}

.policy-map-row.is-selected .policy-map-fill,
.policy-map-row:hover .policy-map-fill,
.policy-map-row:focus .policy-map-fill {
  opacity: 1;
}

.policy-map-row.is-selected .policy-map-label,
.policy-map-row:hover .policy-map-label,
.policy-map-row:focus .policy-map-label {
  fill: var(--brand-navy-900);
  font-weight: 820;
}

.policy-map-label {
  fill: var(--brand-navy-900);
  font-size: 13px;
  font-weight: 720;
}

.policy-map-count {
  fill: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 820;
}

.policy-map-value {
  fill: var(--brand-navy-900);
  font-size: 14px;
  font-weight: 820;
}

.policy-map-gross {
  fill: var(--ink-secondary);
  font-size: 12px;
  font-weight: 720;
}

.policy-map-row.negative .policy-map-value,
.policy-rail-value.negative,
.policy-mini-fill.negative {
  fill: #007c89;
}

.policy-map-row.positive .policy-map-value,
.policy-rail-value.positive,
.policy-mini-fill.positive {
  fill: #9f1239;
}

.policy-map-row.neutral .policy-map-value,
.policy-rail-value.neutral,
.policy-mini-fill.neutral {
  fill: #728092;
}

.policy-rail-card {
  fill: #f8fbff;
  stroke: var(--border-subtle);
  stroke-width: 1;
}

.policy-rail-kicker {
  fill: var(--ink-muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.08em;
}

.policy-rail-title {
  fill: var(--brand-navy-900);
  font-size: 18px;
  font-weight: 820;
}

.policy-rail-value {
  font-size: 26px;
  font-weight: 860;
  font-variant-numeric: tabular-nums lining-nums;
}

.policy-rail-copy,
.policy-rail-meta {
  fill: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.policy-rail-meta {
  font-weight: 760;
}

.policy-mini-year,
.policy-mini-value {
  fill: var(--ink-secondary);
  font-size: 10px;
  font-weight: 740;
}

.policy-mini-track {
  fill: #d8e1ea;
}

.policy-mini-fill {
  fill: var(--teal);
}

.policy-source-action {
  cursor: pointer;
  outline: none;
}

.policy-source-action rect {
  fill: var(--brand-navy-900);
}

.policy-source-action text {
  fill: #f6f8fb;
  font-size: 11px;
  font-weight: 780;
}

.policy-source-action:hover rect,
.policy-source-action:focus rect {
  fill: var(--action-blue);
}

.find-measures-panel {
  display: grid;
  gap: 14px;
}

.selected-measure-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.policy-layout .selected-measure-panel {
  align-self: start;
  margin-bottom: 0;
}

.policy-layout .selected-measure-detail {
  grid-template-columns: minmax(0, 1fr);
}

.policy-layout .selected-measure-detail .measure-year-bars {
  grid-column: 1;
  grid-row: auto;
}

.selected-measure-detail {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  align-items: start;
  padding: 10px 12px 12px;
}

.selected-measure-detail > strong,
.selected-measure-detail > span,
.selected-measure-detail > p,
.selected-measure-detail .measure-tags,
.selected-measure-detail .detail-actions,
.selected-measure-detail .measure-components {
  grid-column: 1;
}

.selected-measure-detail .measure-year-bars {
  grid-column: 2;
  grid-row: 1 / span 5;
  padding: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.policy-find-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, 1fr));
  gap: 12px;
  align-items: end;
}

.policy-find-filters .policy-search-control {
  min-width: 0;
}

.measure-find-list {
  display: grid;
  gap: 10px;
}

.measure-find-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
}

.measure-find-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  width: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
}

.measure-find-main strong,
.measure-find-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.measure-find-main strong {
  color: var(--brand-navy-900);
  font-size: 14px;
  font-weight: 820;
  white-space: nowrap;
}

.measure-find-main span {
  grid-column: 1;
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.measure-find-main em {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--brand-navy-900);
  font-style: normal;
  font-weight: 840;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.measure-find-row:hover,
.measure-find-row:focus,
.measure-find-row:focus-visible,
.measure-find-row:focus-within {
  border-color: var(--action-blue);
  background: #f8fbff;
}

.measure-find-row.is-selected {
  border-color: var(--action-blue);
  box-shadow: inset 3px 0 0 var(--action-blue);
}

.measure-find-tags {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1;
  gap: 6px;
}

.measure-find-tags span {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  color: var(--ink-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.15;
}

.measure-find-actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 2;
  grid-row: 1 / span 2;
  gap: 6px;
  justify-content: flex-end;
}

.home-summary p,
.panel-note {
  color: var(--ink-secondary);
  line-height: 1.45;
}

.hero-total {
  margin: 12px 0 10px;
  color: var(--brand-navy-900);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: clamp(48px, 8vw, 78px);
  font-weight: 820;
  line-height: 1;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mobile-graphic-shell {
  display: none;
}

.budget-card-list,
.search-results,
.check-list,
.method-list,
.compare-picker,
.compare-bars,
.faq-grid,
.glossary-grid,
.explain-grid,
.method-grid {
  display: grid;
  gap: 10px;
}

.budget-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 14px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  color: inherit;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--item-color, var(--teal)) 10%, transparent), transparent 72%),
    var(--bg-surface);
  border: 1px solid color-mix(in srgb, var(--item-color, var(--teal)) 28%, var(--border-subtle));
  border-left: 5px solid var(--item-color, var(--teal));
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}

.budget-card:hover,
.search-result:hover,
.compare-picker button:hover {
  border-color: color-mix(in srgb, var(--item-color, var(--action-blue)) 62%, var(--action-blue));
  background: #f8fbff;
}

.budget-card strong,
.search-result strong {
  color: var(--brand-navy-900);
  font-size: 15px;
}

.budget-card em {
  color: var(--brand-navy-900);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 22px;
  font-style: normal;
  font-weight: 820;
  white-space: nowrap;
}

.budget-card small,
.budget-card b,
.search-result span,
.compare-picker span,
.check-row span {
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.budget-card b {
  grid-column: 1;
  color: var(--action-blue);
  font-weight: 780;
}

.budget-row-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.budget-row-main strong,
.budget-row-main small {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.search-box {
  display: grid;
  gap: 8px;
}

.search-box span {
  color: var(--ink-secondary);
  font-size: 13px;
}

.search-box input {
  min-height: 44px;
  padding: 0 13px;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  font: inherit;
}

.home-hero-search {
  display: grid;
  gap: 12px;
  align-self: start;
  max-width: none;
  margin-top: 74px;
  padding: 18px;
  background: rgba(251, 253, 255, 0.92);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(6, 27, 43, 0.06);
}

.home-hero-search .search-box span {
  color: var(--brand-navy-900);
  font-size: 14px;
  font-weight: 820;
}

.hero-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.hero-search-row input {
  min-height: 54px;
  padding-inline: 16px;
  background: #fff;
  font-size: 16px;
}

.hero-search-row .detail-drill {
  min-height: 54px;
  padding-inline: 18px;
  white-space: nowrap;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-suggestions button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--brand-navy-900);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
}

.search-suggestions button:hover {
  border-color: var(--action-blue);
  background: #f8fbff;
}

.search-results {
  margin-top: 12px;
}

.search-result,
.compare-picker button {
  display: grid;
  gap: 6px;
  padding: 12px;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}

.compare-picker button em {
  justify-self: start;
  padding: 3px 8px;
  color: var(--action-blue);
  background: #f8fbff;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.compare-picker button.is-selected {
  border-color: var(--action-blue);
  background: #f1f7fd;
}

.compare-picker button.is-selected em {
  color: #f6f8fb;
  background: var(--action-blue);
  border-color: var(--action-blue);
}

.compare-picker button:focus-visible,
.budget-card:focus-visible,
.search-result:focus-visible,
.reset-view:focus-visible,
.detail-source:focus-visible,
.source-button:focus-visible,
.detail-drill:focus-visible,
.detail-back:focus-visible,
.detail-top:focus-visible,
.compare-chip:focus-visible {
  outline: 3px solid rgba(0, 94, 168, 0.28);
  outline-offset: 2px;
}

.mini-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.flow-column {
  display: grid;
  gap: 8px;
}

.flow-column button {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px;
  color: inherit;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--item-color, var(--teal)) 12%, transparent), transparent 76%),
    var(--bg-subtle);
  border: 1px solid color-mix(in srgb, var(--item-color, var(--teal)) 26%, var(--border-subtle));
  border-left: 4px solid var(--item-color, var(--teal));
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  animation: flow-card-in var(--motion-flow) var(--ease-civic) both;
  animation-delay: calc(var(--i) * 42ms);
}

.flow-column span {
  color: var(--ink-secondary);
  font-size: 12px;
}

.flow-column i {
  display: block;
  width: var(--w);
  height: 5px;
  background: var(--item-color, var(--teal));
  border-radius: 999px;
  transform-origin: left center;
  animation: flow-meter-in 360ms var(--ease-civic) both;
  animation-delay: calc((var(--i) * 42ms) + 70ms);
}

.flow-column:last-child i {
  background: var(--item-color, var(--action-blue));
}

.flow-bridge {
  display: grid;
  grid-template-rows: auto 1fr;
  place-items: center;
  color: var(--purple);
  font-size: 11px;
  font-weight: 780;
  text-align: center;
  text-transform: uppercase;
}

.flow-bridge svg {
  width: 100%;
  height: 100%;
  min-height: 150px;
}

.flow-band {
  stroke-dashoffset: 60;
  animation: flow-band-in 380ms var(--ease-civic) both;
  animation-delay: calc(var(--i) * 52ms + 80ms);
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.result-count {
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 760;
}

.theme-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}

.theme-row:hover,
.theme-row:focus-visible {
  border-color: var(--action-blue);
  background: #f8fbff;
}

.theme-row strong {
  color: var(--brand-navy-900);
  font-size: 13px;
}

.theme-row span {
  color: var(--ink-secondary);
  font-size: 12px;
}

.theme-row em {
  color: var(--brand-navy-900);
  font-style: normal;
  font-weight: 800;
}

#policy-audit-panel .check-row {
  grid-template-columns: 1fr;
  align-items: start;
}

#policy-audit-panel .source-status-badge {
  width: fit-content;
}

.nesting-map,
.waterfall {
  display: grid;
  gap: 9px;
}

.nest-row,
.waterfall-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.55fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 11px;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  text-align: left;
}

.nest-row {
  cursor: pointer;
  animation: nesting-slide 260ms var(--ease-civic) both;
  animation-delay: calc(var(--i) * 42ms);
}

.nest-row:hover {
  border-color: var(--action-blue);
  background: #f8fbff;
}

.nest-row span,
.waterfall-step span {
  display: block;
  color: var(--ink-secondary);
  font-size: 12px;
}

.nest-row strong,
.waterfall-step strong {
  display: block;
  color: var(--brand-navy-900);
  font-size: 14px;
  line-height: 1.25;
}

.nest-row em,
.waterfall-step em {
  color: var(--brand-navy-900);
  font-style: normal;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 780;
}

.nest-row i,
.waterfall-step i {
  display: block;
  width: var(--w);
  max-width: 100%;
  height: 12px;
  background: var(--action-blue);
  border-radius: 999px;
  transform-origin: left center;
}

.nest-row.depth-1 {
  margin-left: 18px;
  width: calc(100% - 18px);
}

.nest-row.depth-2 {
  margin-left: 36px;
  width: calc(100% - 36px);
}

.nest-row.depth-3 {
  margin-left: 54px;
  width: calc(100% - 54px);
}

.nest-row.depth-2 i {
  background: var(--teal);
}

.nest-row.depth-3 i {
  background: var(--purple);
}

.waterfall-step > div {
  display: grid;
  gap: 4px;
}

.waterfall-step {
  animation: waterfall-step-in 320ms var(--ease-civic) both;
  animation-delay: calc(var(--i) * 70ms);
}

.waterfall-step i {
  animation: waterfall-bar-in 360ms var(--ease-civic) both;
  animation-delay: calc(var(--i) * 70ms + 80ms);
}

.waterfall-step.official-total i {
  background: var(--source-official);
}

.waterfall-step.revised i {
  background: var(--source-revised);
}

.waterfall-step.review i {
  background: var(--source-review);
}

.empty-state {
  padding: 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.empty-state.compact {
  padding: 12px;
}

.empty-state strong {
  display: block;
  color: var(--brand-navy-900);
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.method-list > div,
.method-grid article,
.faq-grid article,
.glossary-grid article,
.explain-grid article {
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.method-list strong,
.method-list span,
.method-grid strong,
.method-grid p,
.faq-grid h3,
.faq-grid p,
.glossary-grid strong,
.glossary-grid p {
  display: block;
}

.method-list span,
.method-grid p,
.faq-grid p,
.glossary-grid p {
  margin: 6px 0 0;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.method-grid,
.faq-grid,
.glossary-grid,
.explain-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

.faq-grid h3 {
  margin: 0;
  color: var(--brand-navy-900);
  font-size: 16px;
  line-height: 1.25;
}

.explain-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.explain-card-head strong {
  color: var(--brand-navy-900);
}

.explain-card-head span {
  flex: 0 0 auto;
  padding: 3px 8px;
  color: var(--brand-navy-800);
  background: #eef7f8;
  border: 1px solid #c6e6e8;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}

.explain-grid p {
  margin: 8px 0 0;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.explain-grid dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.explain-grid dl div {
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.explain-grid dt {
  color: var(--ink-secondary);
  font-size: 12px;
}

.explain-grid dd {
  margin: 2px 0 0;
  color: var(--brand-navy-900);
  font-weight: 780;
}

.comparison-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.compare-chip,
.empty-chip,
.compare-count {
  min-height: 32px;
  padding: 0 10px;
  color: var(--brand-navy-900);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.compare-chip {
  cursor: pointer;
  animation: chip-in 180ms var(--ease-civic) both;
}

.compare-count {
  display: inline-flex;
  align-items: center;
  color: #f6f8fb;
  background: var(--brand-navy-800);
  border-color: var(--brand-navy-800);
}

.compare-chip span {
  margin-left: 6px;
  color: var(--ink-muted);
  font-weight: 650;
}

.compare-bar {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(120px, 1fr) auto;
  gap: 12px;
  align-items: center;
  animation: compare-row-in 260ms var(--ease-civic) both;
  animation-delay: calc(var(--i) * 42ms);
}

.compare-bar div {
  display: grid;
  gap: 3px;
}

.compare-bar span {
  color: var(--ink-secondary);
  font-size: 12px;
}

.compare-bar i {
  display: block;
  width: 100%;
  height: 14px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.compare-bar i::before {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--teal);
  border-radius: inherit;
  content: "";
  transform-origin: left center;
  animation: compare-meter-in 320ms var(--ease-civic) both;
  animation-delay: calc(var(--i) * 42ms + 60ms);
}

.compare-bar em {
  color: var(--brand-navy-900);
  font-style: normal;
  font-weight: 820;
}

.table-fallback {
  margin-top: 16px;
}

.disclosure-table {
  color: var(--ink-secondary);
}

.disclosure-table summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
}

.source-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.source-summary {
  padding: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.source-summary strong {
  display: block;
  color: var(--brand-navy-900);
  font-size: 28px;
  line-height: 1;
}

.source-summary span {
  display: block;
  margin-top: 6px;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.mode-button.is-active {
  color: var(--brand-navy-900);
  background: var(--bg-surface);
  box-shadow: 0 2px 12px rgba(6, 27, 43, 0.08);
}

main {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 24px clamp(18px, 2.4vw, 40px) 72px;
}

.intro {
  display: grid;
  grid-template-columns: var(--home-columns);
  gap: var(--home-gap);
  align-items: start;
  margin-bottom: 18px;
}

body:not([data-mode="home"]) .intro {
  grid-template-columns: minmax(0, 0.9fr) minmax(480px, 0.82fr);
  align-items: start;
  gap: 18px;
  margin-bottom: 8px;
}

.intro > div:first-child {
  grid-row: 1 / span 2;
}

body[data-mode="home"] .intro > div:first-child {
  grid-row: auto;
}

.prototype-label {
  width: fit-content;
  margin: 0 0 14px;
  padding: 7px 10px;
  color: var(--brand-navy-800);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}

.intro h1 {
  max-width: 100%;
  margin: 0;
  color: var(--brand-navy-900);
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 780;
  line-height: 1.02;
  overflow-wrap: break-word;
}

body[data-mode="home"] .intro h1 {
  white-space: nowrap;
}

body:not([data-mode="home"]) .intro h1 {
  max-width: 700px;
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.03;
}

.intro p {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--ink-secondary);
  font-size: 18px;
  line-height: 1.5;
}

body:not([data-mode="home"]) .intro p {
  max-width: 680px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.35;
}

body:not([data-mode="home"]) .concept-strip {
  display: none;
}

body:not([data-mode="home"]) .home-question-panel,
body:not([data-mode="home"]) .home-hero-search {
  display: none;
}

body:not([data-mode="home"]) .status-strip {
  display: none;
}

body:not([data-mode="home"]) .status-strip > div {
  padding: 12px 14px;
}

body:not([data-mode="home"]) .metric-value {
  font-size: 21px;
}

body:not([data-mode="home"]) #generated-at {
  font-size: 18px;
}

body:not([data-mode="home"]) .trust-legend {
  margin-bottom: 10px;
  padding: 9px 11px;
}

body:not([data-mode="home"]) .trust-legend p {
  font-size: 12px;
}

body:not([data-mode="home"]) .prototype-label {
  margin-bottom: 8px;
}

body[data-mode="home"] #dataset-label {
  display: none;
}

body:not([data-mode="home"]) .select-control {
  gap: 4px;
}

body:not([data-mode="home"]) .select-control select {
  min-height: 38px;
}

.concept-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 820px;
  margin-top: 24px;
}

.concept-strip > div {
  min-width: 0;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.concept-strip strong,
.concept-strip span {
  display: block;
}

.concept-strip strong {
  color: var(--brand-navy-900);
  font-size: 14px;
  font-weight: 780;
}

.concept-strip span {
  margin-top: 5px;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.home-question-panel {
  display: grid;
  gap: 14px;
  align-self: stretch;
  padding: 18px;
  background: rgba(251, 253, 255, 0.92);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(6, 27, 43, 0.06);
}

.home-question-panel h2,
.home-question-panel h3 {
  margin: 0;
  color: var(--brand-navy-900);
  font-size: 22px;
  line-height: 1.18;
}

.home-task-list,
.home-steps {
  display: grid;
  gap: 10px;
}

.home-task {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 12px;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}

.home-task:hover {
  border-color: var(--action-blue);
  background: #f8fbff;
}

.home-task-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  background: var(--action-blue);
  border-radius: var(--radius);
  font-weight: 840;
}

.home-task:nth-child(2) .home-task-icon {
  background: var(--green);
}

.home-task:nth-child(3) .home-task-icon {
  background: var(--amber);
}

.home-task:nth-child(4) .home-task-icon {
  background: var(--purple);
}

.home-task strong,
.home-task small {
  display: block;
  min-width: 0;
}

.home-task strong {
  color: var(--brand-navy-900);
  font-size: 15px;
  line-height: 1.2;
}

.home-task small {
  margin-top: 3px;
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.32;
}

.home-task b {
  color: var(--ink-muted);
  font-size: 24px;
  font-weight: 500;
}

.budget-strip {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.budget-strip-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  justify-content: space-between;
}

.budget-strip-head div:first-child {
  display: grid;
  gap: 3px;
}

.budget-strip-head strong {
  color: var(--brand-navy-900);
  font-size: 15px;
}

.budget-strip-head span,
.budget-strip p {
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.home-graphic-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.home-graphic-tabs button {
  min-height: 34px;
  padding: 0 14px;
  color: var(--ink-secondary);
  background: transparent;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
}

.home-graphic-tabs button.is-active {
  color: var(--neo-ink);
  background: var(--neo-primary);
}

.budget-strip-bar {
  display: block;
  min-height: 42px;
  overflow: hidden;
  background: #dfe7ee;
  border-radius: 6px;
}

.budget-strip-svg {
  display: block;
  width: 100%;
  height: 42px;
  font-family: inherit;
}

.budget-strip-segment {
  cursor: pointer;
  outline: none;
}

.budget-strip-segment rect {
  stroke: var(--neo-ink);
  stroke-width: 0.24;
  transition:
    filter var(--motion-fast) var(--ease-civic),
    stroke-width var(--motion-fast) var(--ease-civic);
}

.budget-strip-segment:hover rect,
.budget-strip-segment:focus-visible rect {
  filter: saturate(1.12) brightness(1.05);
  stroke-width: 0.5;
}

.budget-strip-segment text {
  fill: var(--neo-ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 720;
  letter-spacing: 0;
  pointer-events: none;
  paint-order: normal;
  stroke: none;
}

.budget-strip-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.budget-strip-labels span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 680;
}

.budget-strip-labels svg {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
}

.budget-strip p {
  margin: 0;
}

.home-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: start;
  padding: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.home-step span {
  display: grid;
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: var(--action-blue);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 820;
}

.home-step:nth-child(2) span {
  background: var(--green);
}

.home-step:nth-child(3) span {
  background: var(--amber);
}

.home-step strong {
  color: var(--brand-navy-900);
}

.home-step p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.status-strip {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.is-hidden {
  display: none !important;
}

.source-rows-panel,
.methodology-status-grid {
  margin-top: 16px;
}

.status-strip > div {
  min-width: 0;
  padding: 16px;
  background: var(--bg-surface);
}

.metric-value {
  display: block;
  color: var(--brand-navy-900);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  overflow-wrap: anywhere;
}

#generated-at {
  font-size: 21px;
}

.metric-label {
  display: block;
  margin-top: 7px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 720;
  text-transform: uppercase;
}

.trust-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.trust-legend p {
  flex: 1 1 320px;
  margin: 0 0 0 8px;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.attribution-footer {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr) auto;
  gap: 18px;
  align-items: start;
  max-width: 1280px;
  margin: 18px auto 0;
  padding: 18px 28px 26px;
  color: #d9e4ed;
  background: var(--brand-navy-900);
  border-radius: var(--radius) var(--radius) 0 0;
}

.attribution-footer strong {
  color: #fff;
}

.attribution-footer p {
  margin: 6px 0 0;
  color: #bfd0dd;
  font-size: 13px;
  line-height: 1.42;
}

.attribution-footer ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attribution-footer li {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.attribution-footer li span {
  color: #93a9ba;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.attribution-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.attribution-actions a,
.attribution-actions button {
  min-height: 34px;
  padding: 0 12px;
  color: #f6f8fb;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
  text-decoration: none;
}

.attribution-card-list {
  display: grid;
  gap: 10px;
}

.attribution-card {
  display: grid;
  gap: 5px;
  padding: 0 0 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
}

.attribution-card strong {
  color: var(--brand-navy-900);
}

.attribution-card span {
  color: var(--action-blue);
  font-weight: 780;
}

.attribution-card p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.trust-badge,
.source-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 780;
  line-height: 1;
  white-space: nowrap;
}

.trust-badge.official-total,
.source-status-badge.official-total {
  color: #f6f8fb;
  background: var(--source-official);
}

.trust-badge.official-row,
.source-status-badge.official-row {
  color: var(--source-official);
  background: var(--bg-surface);
  border: 1px solid var(--source-official);
}

.trust-badge.derived,
.source-status-badge.derived {
  color: #f6f8fb;
  background: var(--source-derived);
}

.trust-badge.revised,
.source-status-badge.revised {
  color: #271604;
  background: #f5d79e;
  border: 1px solid var(--source-revised);
}

.trust-badge.review,
.source-status-badge.review {
  color: #fff;
  background: var(--source-review);
}

.mode-view {
  display: none;
}

.mode-view.is-visible {
  display: block;
  animation: surface-in 220ms var(--ease-civic);
}

body.is-switching-lens .mode-view.is-visible {
  animation: lens-shift 340ms var(--ease-civic);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.workbench > * {
  min-width: 0;
}

.breadcrumbs,
.active-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  margin: 0 0 12px;
}

.breadcrumbs {
  color: var(--ink-secondary);
  font-size: 13px;
}

.breadcrumbs button,
.breadcrumb-current,
.breadcrumb-root {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.breadcrumbs button {
  color: var(--action-blue);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-weight: 740;
}

.breadcrumbs button:hover,
.breadcrumbs button:focus-visible {
  border-color: var(--action-blue);
  background: #f8fbff;
}

.breadcrumb-root {
  color: #f6f8fb;
  background: var(--brand-navy-800);
  font-weight: 780;
}

.breadcrumb-current {
  color: var(--brand-navy-900);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-weight: 760;
}

.breadcrumb-separator {
  color: var(--ink-muted);
}

.filter-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(6, 27, 43, 0.04);
  font-size: 12px;
  font-weight: 740;
}

.filter-chip small {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.filter-chip.official {
  color: #f6f8fb;
  background: var(--source-official);
  border-color: var(--source-official);
}

.filter-chip.official small {
  color: rgba(255, 255, 255, 0.78);
}

.filter-chip.path {
  border-color: var(--source-derived);
  border-style: dashed;
}

.reset-view {
  min-height: 32px;
  padding: 0 12px;
  color: var(--action-blue);
  background: #f8fbff;
  border: 1px solid var(--action-blue);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
}

.reset-view:disabled {
  color: var(--ink-muted);
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
  cursor: not-allowed;
  opacity: 0.72;
}

.chart-interaction-hint {
  margin: 10px 2px 0;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.table-scroll-hint {
  display: none;
  margin: 0 0 10px;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 680;
}

.note-stage,
.drilldown-card,
.panel,
.history-head {
  background: rgba(251, 253, 255, 0.92);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(6, 27, 43, 0.06);
}

.note-stage {
  min-width: 0;
  padding: 16px;
}

.note-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.note-toolbar > div {
  min-width: 0;
}

.note-toolbar h2,
.drilldown-card h2,
.panel-title h3 {
  margin: 0;
  color: var(--brand-navy-900);
  font-size: 21px;
  font-weight: 780;
  line-height: 1.2;
}

.note-toolbar p,
.drilldown-card p,
.history-head p {
  margin: 6px 0 0;
  color: var(--ink-secondary);
  line-height: 1.42;
  overflow-wrap: break-word;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
  max-width: 560px;
}

.note-stage .toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  width: min(100%, 920px);
  gap: 8px;
}

.note-chart-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 218px;
  gap: 14px;
  align-items: start;
}

.chart-control-rail {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 6px 0 0 12px;
  border-left: 1px solid var(--border-subtle);
}

.chart-control-rail .toolbar {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: none;
  gap: 8px;
}

.chart-control-rail .select-control {
  gap: 5px;
  min-width: 0;
}

.chart-control-rail .select-control span {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}

.chart-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.chart-action-row .reset-view {
  width: 100%;
}

.spending-controls,
.spending-controls-slot {
  display: contents;
}

.note-stage .toolbar .select-control,
.note-stage .toolbar .select-control:nth-child(2),
.note-stage .toolbar .select-control:last-child {
  width: auto;
  min-width: 0;
  flex: initial;
}

.note-stage .toolbar .select-control select {
  min-height: 38px;
}

.note-stage .toolbar .reset-view {
  align-self: end;
  min-height: 38px;
}

.note-stage .note-toolbar h2 {
  font-size: 19px;
}

.note-stage .note-toolbar p {
  max-width: 620px;
  font-size: 14px;
  line-height: 1.35;
}

.select-control {
  display: grid;
  gap: 6px;
  min-width: 150px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.select-control select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 34px 0 12px;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  text-overflow: ellipsis;
}

.toggle-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
}

.toggle-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--action-blue);
}

.toggle-control span,
.toggle-control strong,
.toggle-control small {
  display: block;
  min-width: 0;
}

.toggle-control strong {
  font-size: 12px;
  font-weight: 820;
  line-height: 1.15;
}

.toggle-control small {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 720;
  line-height: 1.2;
}

.multi-check-control {
  position: relative;
  min-width: 0;
}

.multi-check-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px 0 12px;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-transform: none;
}

.multi-check-button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: translateY(-2px) rotate(45deg);
}

.multi-check-control.is-open .multi-check-button::after {
  transform: translateY(2px) rotate(225deg);
}

.multi-check-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-check-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: none;
  width: min(280px, calc(100vw - 40px));
  padding: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.multi-check-control.is-open .multi-check-menu {
  display: grid;
  gap: 4px;
}

.multi-check-menu label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 5px 6px;
  color: var(--ink-primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.2;
  text-transform: none;
}

.multi-check-menu label:hover {
  background: var(--bg-subtle);
}

.multi-check-menu input {
  width: 16px;
  height: 16px;
  accent-color: var(--action-blue);
}

.toolbar .select-control {
  flex: 1 1 160px;
  width: auto;
  min-width: 0;
}

.banknote-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin-top: 6px;
  overflow: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.banknote-wrap.has-scrollable-graphic {
  max-height: min(78vh, var(--scroll-graphic-height, 9999px));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--neo-ink) var(--neo-surface);
  scrollbar-gutter: stable both-edges;
}

.graphic-switch {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 24px);
  padding: 6px;
  color: var(--neo-ink);
  background: #ffffff;
  border: 3px solid var(--neo-ink);
  border-radius: 5px;
  box-shadow: 4px 4px 0 var(--neo-ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 880;
  line-height: 1.2;
}

.graphic-switch-label {
  white-space: nowrap;
}

.graphic-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.graphic-switch-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  min-width: 186px;
  overflow: hidden;
  background: var(--neo-surface);
  border: 2px solid var(--neo-ink);
  border-radius: 3px;
  isolation: isolate;
}

.graphic-switch-track::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  z-index: -1;
  width: calc((100% - 6px) / 2);
  background: var(--neo-primary);
  border: 2px solid var(--neo-ink);
  border-radius: 2px;
  transform: translateX(0);
  transition: transform 180ms var(--ease-civic);
}

.graphic-switch input:checked + .graphic-switch-track::before {
  transform: translateX(100%);
}

.graphic-switch-track span {
  padding: 7px 10px;
  color: var(--neo-ink);
  font-size: 11px;
  font-weight: 820;
  line-height: 1.1;
  text-align: center;
  text-transform: none;
  white-space: nowrap;
}

.graphic-switch input:not(:checked) + .graphic-switch-track span:first-child,
.graphic-switch input:checked + .graphic-switch-track span:last-child {
  font-weight: 950;
}

.graphic-switch input:focus-visible + .graphic-switch-track {
  outline: 3px solid var(--action-blue);
  outline-offset: 3px;
}

.banknote-wrap.is-loading::after {
  content: attr(data-loading);
  position: absolute;
  right: 22px;
  top: 22px;
  z-index: 2;
  padding: 8px 10px;
  color: #f6f8fb;
  background: rgba(6, 27, 43, 0.92);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
  animation: loading-chip 420ms var(--ease-civic);
}

.banknote {
  display: block;
  width: 100%;
  aspect-ratio: 1120 / 520;
  height: auto;
  min-height: 0;
  max-height: none;
  filter: none;
}

.banknote.is-path-chart {
  width: var(--scroll-graphic-width, 100%);
  min-width: var(--scroll-graphic-width, 100%);
  height: var(--scroll-graphic-height, auto);
  min-height: var(--scroll-graphic-height, 0);
  max-height: none;
  aspect-ratio: auto;
}

.policy-note {
  margin-top: 58px;
}

.banknote.is-chart-refreshing {
  animation: chart-refresh 320ms var(--ease-civic);
}

.note-title {
  fill: var(--brand-navy-900);
  font-size: 24px;
  font-weight: 800;
}

.note-small,
.note-micro {
  fill: rgba(16, 32, 51, 0.75);
  font-size: 12px;
  font-weight: 740;
  text-transform: uppercase;
}

.note-denom {
  fill: rgba(16, 32, 51, 0.9);
  font-size: 46px;
  font-weight: 850;
}

.note-denom.long {
  font-size: 36px;
}

.note-window {
  fill: rgba(16, 32, 51, 0.76);
  font-size: 26px;
  font-weight: 850;
}

.bar-label,
.bar-value {
  fill: var(--ink-primary);
  font-size: 12px;
  font-weight: 720;
  dominant-baseline: middle;
}

.bar-label {
  fill: var(--ink-secondary);
}

.ranked-title {
  fill: var(--brand-navy-900);
  font-size: 26px;
  font-weight: 820;
}

.chart-kicker,
.ranked-subtitle,
.ranked-footer,
.chart-limit-note {
  fill: var(--ink-secondary);
  font-size: 12px;
  font-weight: 720;
  text-transform: uppercase;
}

.chart-limit-note {
  fill: var(--action-blue);
  font-weight: 800;
}

.ranked-total {
  fill: var(--brand-navy-900);
  font-size: 36px;
  font-weight: 850;
}

.ranked-total.long {
  font-size: 30px;
}

.ranked-segment {
  cursor: pointer;
  animation: bar-enter var(--motion-chart) var(--ease-civic) both;
  animation-delay: calc(var(--i) * 18ms);
}

.ranked-segment:hover rect,
.ranked-segment:focus rect {
  filter: brightness(0.96);
}

.stacked-segment {
  cursor: pointer;
  animation: bar-enter var(--motion-chart) var(--ease-civic) both;
  animation-delay: calc(var(--i) * 16ms);
}

.stacked-ring-track {
  fill: #d8e0e8;
}

.stacked-segment path,
.stacked-segment rect {
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 1.5;
  transition:
    filter var(--motion-fast) var(--ease-civic),
    stroke-width var(--motion-fast) var(--ease-civic),
    transform var(--motion-fast) var(--ease-civic);
}

.stacked-segment:hover path,
.stacked-segment:focus path,
.stacked-segment:hover rect,
.stacked-segment:focus rect {
  filter: brightness(0.96) saturate(1.06);
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3;
}

.stacked-ring-label,
.stacked-ring-value,
.stacked-rank {
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.28);
  stroke-width: 2.5px;
  pointer-events: none;
}

.stacked-ring-label {
  font-size: 12px;
  font-weight: 820;
}

.stacked-ring-value {
  font-size: 13px;
  font-weight: 850;
}

.stacked-rank {
  font-size: 12px;
  font-weight: 850;
}

.stacked-ring-center {
  fill: var(--brand-navy-900);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums lining-nums;
}

.stacked-ring-center.long {
  font-size: 28px;
}

.stacked-ring-center-label {
  fill: var(--ink-secondary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stacked-ring-callout {
  cursor: pointer;
  animation: bar-enter var(--motion-chart) var(--ease-civic) both;
  animation-delay: calc(var(--i) * 14ms);
}

.stacked-ring-callout-line {
  fill: none;
  stroke: rgba(75, 91, 107, 0.62);
  stroke-width: 1.25;
  transition: stroke var(--motion-fast) var(--ease-civic), stroke-width var(--motion-fast) var(--ease-civic);
}

.stacked-ring-callout-dot {
  fill: rgba(75, 91, 107, 0.7);
}

.stacked-ring-callout-bg {
  fill: rgba(255, 255, 255, 0.001);
  stroke: transparent;
  transition:
    fill var(--motion-fast) var(--ease-civic),
    stroke var(--motion-fast) var(--ease-civic),
    filter var(--motion-fast) var(--ease-civic);
}

.stacked-ring-callout:hover .stacked-ring-callout-bg,
.stacked-ring-callout:focus .stacked-ring-callout-bg {
  fill: #fff;
  stroke: var(--border-strong);
  filter: drop-shadow(0 4px 10px rgba(6, 27, 43, 0.08));
}

.stacked-ring-callout:hover .stacked-ring-callout-line,
.stacked-ring-callout:focus .stacked-ring-callout-line {
  stroke: rgba(10, 61, 98, 0.86);
  stroke-width: 1.75;
}

.stacked-ring-callout-label {
  fill: var(--ink-primary);
  font-size: 12px;
  font-weight: 790;
}

.stacked-ring-callout-value,
.stacked-ring-note {
  fill: var(--ink-secondary);
  font-size: 11px;
  font-weight: 820;
  font-variant-numeric: tabular-nums lining-nums;
}

.stacked-ring-note {
  fill: var(--ink-muted);
  font-weight: 760;
}

.stacked-rect-track {
  fill: #d8e0e8;
  stroke: var(--border-subtle);
  stroke-width: 1;
}

.stacked-rect-label,
.stacked-rect-value {
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.28);
  stroke-width: 2.5px;
  pointer-events: none;
}

.stacked-rect-label {
  font-size: 12px;
  font-weight: 820;
}

.stacked-rect-value {
  font-size: 13px;
  font-weight: 850;
}

.stacked-rect-label.compact {
  font-size: 10px;
  font-weight: 800;
}

.stacked-rect-value.compact {
  font-size: 10px;
  font-weight: 850;
}

.stacked-actual-title {
  fill: var(--ink-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stacked-actual-segment {
  cursor: pointer;
  animation: bar-enter var(--motion-chart) var(--ease-civic) both;
  animation-delay: calc(var(--i) * 12ms);
}

.stacked-actual-segment.is-other {
  cursor: default;
}

.stacked-actual-segment rect {
  stroke: var(--neo-ink);
  stroke-width: 3;
  transition: filter var(--motion-fast) var(--ease-civic), stroke-width var(--motion-fast) var(--ease-civic);
}

.stacked-actual-segment:not(.is-other):hover rect,
.stacked-actual-segment:not(.is-other):focus rect {
  filter: brightness(0.96) saturate(1.06);
  stroke-width: 4;
}

.stacked-actual-label {
  fill: #fff;
  font-size: 9px;
  font-weight: 820;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 2px;
}

.stacked-actual-value {
  fill: #fff;
  font-size: 9px;
  font-weight: 900;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(0, 0, 0, 0.28);
  stroke-width: 2px;
}

.stacked-rect-callout {
  cursor: pointer;
  animation: bar-enter var(--motion-chart) var(--ease-civic) both;
  animation-delay: calc(var(--i) * 14ms);
}

.stacked-rect-callout-line {
  fill: none;
  stroke: rgba(75, 91, 107, 0.62);
  stroke-width: 1.25;
  transition: stroke var(--motion-fast) var(--ease-civic), stroke-width var(--motion-fast) var(--ease-civic);
}

.stacked-rect-callout-dot {
  fill: rgba(75, 91, 107, 0.7);
}

.stacked-rect-callout-bg {
  fill: rgba(255, 255, 255, 0.001);
  stroke: transparent;
  transition:
    fill var(--motion-fast) var(--ease-civic),
    stroke var(--motion-fast) var(--ease-civic),
    filter var(--motion-fast) var(--ease-civic);
}

.stacked-rect-callout:hover .stacked-rect-callout-bg,
.stacked-rect-callout:focus .stacked-rect-callout-bg {
  fill: #fff;
  stroke: var(--border-strong);
  filter: drop-shadow(0 4px 10px rgba(6, 27, 43, 0.08));
}

.stacked-rect-callout:hover .stacked-rect-callout-line,
.stacked-rect-callout:focus .stacked-rect-callout-line {
  stroke: rgba(10, 61, 98, 0.86);
  stroke-width: 1.75;
}

.stacked-rect-callout-label {
  fill: var(--ink-primary);
  font-size: 12px;
  font-weight: 790;
}

.stacked-rect-callout-value,
.stacked-rect-note {
  fill: var(--ink-secondary);
  font-size: 11px;
  font-weight: 820;
  font-variant-numeric: tabular-nums lining-nums;
}

.stacked-rect-note {
  fill: var(--ink-muted);
  font-weight: 760;
}

.snake-link {
  fill: none;
  stroke-linecap: round;
  stroke-opacity: 0.28;
  transition: stroke-opacity var(--motion-fast) var(--ease-civic), stroke-width var(--motion-fast) var(--ease-civic);
}

.snake-link.is-active {
  stroke-opacity: 0.58;
}

.snake-link.is-preview {
  stroke-opacity: 0.74;
  stroke-width: 9;
}

.snake-segment {
  cursor: pointer;
  animation: segment-enter var(--motion-chart) var(--ease-civic) both;
  animation-delay: calc(var(--i) * 10ms);
}

.snake-segment rect {
  transition: filter var(--motion-fast) var(--ease-civic), stroke-width var(--motion-fast) var(--ease-civic);
}

.snake-segment:hover rect:first-child,
.snake-segment:focus rect:first-child {
  filter: brightness(0.96) saturate(1.04);
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 3;
}

.snake-segment.is-active rect:first-child {
  filter: brightness(1.02) saturate(1.2);
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 4;
}

.snake-segment.is-preview rect:first-child {
  filter: brightness(1.06) saturate(1.22);
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 4;
}

.snake-segment.is-locked rect:first-child {
  filter: brightness(1.05) saturate(1.28);
  stroke: rgba(255, 255, 255, 0.98);
  stroke-width: 5;
}

.snake-node:not(.is-active) rect:first-child {
  filter: saturate(0.8) brightness(1.02);
}

.snake-node.can-continue rect:first-child {
  stroke-dasharray: 0;
}

.snake-node.is-terminal {
  cursor: pointer;
}

.snake-node.is-other rect:first-child {
  filter: saturate(0.58);
}

.snake-ancestor rect:first-child {
  filter: saturate(0.82);
}

.snake-child rect:first-child {
  filter: saturate(0.92);
}

.snake-column-label {
  fill: var(--ink-secondary);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.snake-rank,
.snake-label,
.snake-value {
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.28);
  stroke-width: 2px;
}

.snake-rank {
  font-size: 10px;
  font-weight: 860;
}

.snake-label {
  font-size: 11px;
  font-weight: 780;
}

.snake-value {
  font-size: 11px;
  font-weight: 860;
}

.snake-action {
  fill: rgba(255, 255, 255, 0.84);
  font-size: 9px;
  font-weight: 880;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.24);
  stroke-width: 2px;
}


.bar-rank {
  fill: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 800;
  dominant-baseline: middle;
}

.bar-value {
  stroke: none;
}

.bar-status {
  fill: var(--ink-secondary);
  font-size: 11px;
  font-weight: 720;
}

.bar-status.official-total,
.bar-status.official-row {
  fill: var(--source-official);
}

.bar-status.derived {
  fill: var(--source-derived);
}

.bar-status.revised {
  fill: var(--source-revised);
}

.bar-status.review {
  fill: var(--source-review);
}

.bar-fill {
  transform-box: fill-box;
  transform-origin: left center;
}

.note-segment {
  cursor: pointer;
  animation: segment-enter 260ms var(--ease-civic) both;
  animation-delay: calc(var(--i) * 14ms);
}

.note-segment rect {
  transition: opacity 140ms ease, stroke-width 140ms ease, stroke 140ms ease;
}

.note-segment:hover rect:first-child,
.note-segment:focus rect:first-child {
  opacity: 1;
  stroke: rgba(255, 255, 255, 0.94);
  stroke-width: 3;
}

.segment-label,
.segment-value {
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 2px;
}

.segment-label {
  font-size: 15px;
  font-weight: 760;
}

.segment-label.index {
  font-size: 11px;
  font-weight: 850;
}

.segment-value {
  font-size: 20px;
  font-weight: 850;
}

.segment-value.small {
  font-size: 13px;
}

.drilldown-card {
  padding: 16px;
  max-height: calc(100vh - 132px);
  overflow: auto;
}

.detail-head {
  display: grid;
  gap: 10px;
}

.detail-value {
  margin: 16px 0;
  padding: 18px;
  color: #f6f8fb;
  background: var(--brand-navy-900);
  border-radius: var(--radius);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: clamp(21px, 2.4vw, 30px);
  font-weight: 820;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.detail-grid {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-row span {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.detail-row strong {
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.hover-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: grid;
  gap: 7px;
  width: min(410px, calc(100vw - 28px));
  padding: 14px 15px;
  color: #f6f8fb;
  background: rgba(6, 27, 43, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(6, 27, 43, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.hover-tooltip.is-visible {
  opacity: 1;
}

.motion-status {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 45;
  max-width: min(520px, calc(100vw - 36px));
  padding: 10px 13px;
  color: #f6f8fb;
  background: rgba(6, 27, 43, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(6, 27, 43, 0.2);
  font-size: 13px;
  font-weight: 720;
  transform: translate(-50%, 14px);
  opacity: 1;
  pointer-events: none;
}

.motion-status.is-visible {
  animation: status-toast 1800ms var(--ease-civic) both;
}

.motion-status[hidden] {
  display: none;
}

.hover-tooltip strong,
.hover-tooltip span {
  display: block;
  overflow-wrap: anywhere;
}

.hover-tooltip strong {
  font-size: 15px;
  line-height: 1.25;
}

.hover-tooltip span {
  color: rgba(246, 248, 251, 0.8);
  font-size: 12px;
  line-height: 1.25;
}

.tooltip-kicker {
  color: #9ad7df !important;
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tooltip-context {
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.tooltip-context small {
  display: block;
  margin-bottom: 3px;
  color: #9ad7df;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.tooltip-value {
  color: #fff !important;
  font-size: 20px !important;
  font-weight: 850;
}

.tooltip-value small {
  margin-left: 8px;
  color: #bfe8ee;
  font-size: 12px;
  font-weight: 750;
}

.tooltip-action {
  color: #ffd58f !important;
  font-weight: 750;
}

.tooltip-fact {
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(246, 248, 251, 0.9) !important;
}

.tooltip-fact small {
  color: #9ad7df;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.tooltip-fact b {
  min-width: 0;
  color: rgba(246, 248, 251, 0.9);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.detail-source,
.source-button,
.detail-drill,
.detail-back,
.detail-top {
  min-height: 36px;
  padding: 0 12px;
  color: var(--action-blue);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 740;
}

.detail-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.detail-drill {
  color: #f6f8fb;
  background: var(--action-blue);
  border-color: var(--action-blue);
}

.detail-drill:hover,
.source-button:hover,
.detail-source:hover {
  border-color: var(--action-blue-hover);
}

.detail-back,
.detail-top {
  color: var(--ink-primary);
  background: var(--bg-subtle);
}

.support-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.chart-frame {
  height: 310px;
}

.chart-frame.compact {
  height: 300px;
}

.chart-frame svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-label,
.axis-label,
.chart-note {
  fill: var(--ink-secondary);
  font-size: 12px;
}

.value-label {
  fill: var(--ink-primary);
  font-size: 12px;
  font-weight: 700;
}

.bar-hit {
  cursor: pointer;
}

.notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  color: #56380d;
  background: #fff5df;
  border: 1px solid #e8c887;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.35;
}

.coverage-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.coverage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
}

.coverage-row:hover {
  background: var(--bg-subtle);
}

.coverage-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  padding: 4px 8px;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.status-pill.ok {
  background: var(--teal);
}

.status-pill.warn {
  background: var(--amber);
}

.table-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

#fiscal-table {
  table-layout: fixed;
}

#fiscal-table th,
#fiscal-table td {
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  font-size: 13px;
  line-height: 1.3;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--ink-muted);
  background: var(--bg-surface);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

td:last-child,
th:last-child {
  text-align: right;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.25;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--bg-subtle);
}

.history-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 16px;
  padding: 22px;
}

.history-head h2 {
  margin: 0;
  color: var(--brand-navy-900);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.04;
}

.history-head p {
  max-width: 760px;
}

.history-grid {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.fiscal-graphic-panel {
  margin-bottom: 16px;
}

.fiscal-trend-grid {
  grid-template-columns: 1fr;
}

.fiscal-trend-grid .chart-frame {
  height: 390px;
}

.fiscal-dashboard-head {
  align-items: stretch;
}

.fiscal-head-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.fiscal-head-actions,
.fiscal-chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fiscal-head-panel {
  display: grid;
  gap: 14px;
  min-width: min(620px, 48vw);
}

.fiscal-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  gap: 10px;
}

.fiscal-summary-card {
  min-width: 0;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.fiscal-summary-card strong,
.fiscal-summary-card span,
.fiscal-summary-card small {
  display: block;
}

.fiscal-summary-card strong {
  color: var(--brand-navy-900);
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.05;
}

.fiscal-summary-card span {
  margin-top: 6px;
  color: var(--ink-primary);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.fiscal-summary-card small {
  margin-top: 4px;
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.3;
}

.fiscal-chart-controls {
  margin: -4px 0 12px;
}

.fiscal-chart-controls .select-control {
  flex: 1 1 180px;
  min-width: 180px;
}

.fiscal-line-point {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 2;
}

.fiscal-line-point:hover,
.fiscal-line-point:focus {
  r: 7;
  outline: none;
}

.fiscal-zero-line {
  stroke: #718096;
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.fiscal-legend-label {
  fill: var(--ink-secondary);
  font-size: 12px;
  font-weight: 760;
}

.fiscal-support-grid {
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
}

.provenance {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  width: min(500px, calc(100vw - 36px));
  max-height: min(700px, calc(100vh - 36px));
  padding: 20px;
  overflow: auto;
  color: #f6f8fb;
  background: var(--brand-navy-900);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 34px));
  transition:
    opacity var(--motion-drawer) var(--ease-civic),
    transform var(--motion-drawer) var(--ease-civic),
    visibility var(--motion-drawer) var(--ease-civic);
  visibility: hidden;
}

.provenance.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.provenance h2 {
  margin: 0 34px 14px 0;
  font-size: 19px;
}

.provenance p,
.provenance dd {
  color: #d6dbe3;
}

.proof-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.proof-summary.proof-pulse {
  animation: proof-pulse 520ms var(--ease-civic);
}

.source-cell-preview {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  color: #f6f8fb;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
}

.source-cell-preview > strong {
  color: #fff;
  font-size: 13px;
}

.source-cell-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.source-cell-preview th,
.source-cell-preview td {
  padding: 8px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  vertical-align: top;
}

.source-cell-preview th {
  width: 92px;
  color: #9ba7b7;
  font-weight: 760;
}

.proof-highlight {
  color: #061b2b;
  background: #f5d79e;
  border-radius: 4px;
  font-weight: 820;
}

.proof-highlight.proof-cell-pulse {
  animation: source-cell-highlight 680ms var(--ease-civic);
}

.proof-value {
  color: #fff;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 26px;
  font-weight: 820;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.provenance dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.provenance dt {
  color: #9ba7b7;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.provenance dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
}

.proof-note {
  margin-top: 14px;
  padding-top: 12px;
  color: #d6dbe3;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
  line-height: 1.45;
}

#close-provenance {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
}

.error {
  max-width: 900px;
  margin: 60px auto;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

/* Civic neo-brutalist global system. Keep data dense and readable while replacing
   the former soft civic surfaces with flat color, black strokes and hard shadows. */
.topbar {
  background: var(--neo-surface);
  border-bottom: 4px solid var(--neo-ink);
  box-shadow: 0 7px 0 var(--neo-ink);
  backdrop-filter: none;
}

.brand {
  min-width: 250px;
}

.brand-mark {
  color: var(--neo-ink);
  background: var(--neo-primary);
  border: 3px solid var(--neo-ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--neo-ink);
}

.brand strong,
.mode-button span,
.prototype-label,
.panel-title h3,
.note-toolbar h2,
.history-head h2 {
  letter-spacing: 0;
}

.brand strong {
  color: var(--neo-ink);
  font-weight: 950;
  text-transform: uppercase;
}

.brand small {
  color: var(--ink-secondary);
  font-weight: 780;
}

.mode-switch {
  background: var(--neo-surface);
  border: 3px solid var(--neo-ink);
  border-radius: 5px;
  box-shadow: 6px 6px 0 var(--neo-ink);
}

.mode-button {
  min-height: 58px;
  color: var(--neo-ink);
  border: 0;
  border-right: 2px solid var(--neo-ink);
  border-radius: 0;
  font-weight: 850;
}

.mode-button:last-child {
  border-right: 0;
}

.mode-button small {
  color: var(--ink-secondary);
  font-weight: 720;
}

.mode-button.is-active {
  color: var(--neo-ink);
  background: var(--neo-primary);
  box-shadow: none;
}

.mode-button:hover {
  background: #b4f0ea;
  transform: translate(-1px, -1px);
}

main {
  background: var(--neo-paper);
}

.intro {
  padding: 18px;
  background: var(--neo-surface);
  border: 4px solid var(--neo-ink);
  border-radius: 6px;
  box-shadow: 8px 8px 0 var(--neo-ink);
}

.prototype-label,
.source-status-badge,
.result-count,
.policy-chip,
.measure-tag,
.filter-chip,
.breadcrumb-root,
.breadcrumb-current,
.breadcrumbs button,
.compare-chip,
.empty-chip,
.compare-count {
  color: var(--neo-ink);
  background: var(--neo-primary);
  border: 3px solid var(--neo-ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--neo-ink);
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
  text-transform: uppercase;
}

.prototype-label,
.result-count,
.policy-chip,
.measure-tag,
.filter-chip,
.breadcrumb-root,
.breadcrumb-current,
.breadcrumbs button,
.compare-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  max-width: 100%;
}

.panel-title .result-count {
  flex: 0 1 auto;
  max-width: min(100%, 34ch);
  white-space: normal;
}

.intro h1 {
  color: var(--neo-ink);
  font-weight: 950;
  line-height: 0.98;
}

.intro p,
.home-summary p,
.note-toolbar p,
.drilldown-card p,
.history-head p,
.chart-interaction-hint,
.faq-item p {
  color: var(--ink-secondary);
  font-weight: 640;
}

.home-hero-search,
.search-results,
.note-stage,
.drilldown-card,
.panel,
.history-head,
.policy-card,
.fiscal-summary-card,
.home-question-panel,
.source-rows-panel,
.attribution-card,
.source-summary,
.disclosure-table,
.table-wrap,
.chart-frame,
.notice,
.error {
  background: var(--neo-surface);
  border: 4px solid var(--neo-ink);
  border-radius: 6px;
  box-shadow: 7px 7px 0 var(--neo-ink);
}

.panel,
.history-head,
.note-stage,
.drilldown-card {
  padding: 18px;
}

.panel-title,
.note-toolbar {
  border-bottom: 3px solid var(--neo-ink);
  padding-bottom: 12px;
}

.panel-title h3,
.note-toolbar h2,
.drilldown-card h2,
.history-head h2,
.home-question-panel h3,
.home-question-panel h2 {
  color: var(--neo-ink);
  font-weight: 950;
  text-transform: uppercase;
}

.measures-stage .note-toolbar h2 {
  text-transform: none;
}

.hero-total,
.detail-value,
.proof-value {
  color: var(--neo-ink);
  background: var(--neo-primary);
  border: 4px solid var(--neo-ink);
  border-radius: 5px;
  box-shadow: 6px 6px 0 var(--neo-ink);
  font-weight: 950;
}

.hero-total {
  padding: clamp(10px, 1.4vw, 16px) clamp(14px, 2vw, 22px);
  font-size: clamp(42px, 6.6vw, 68px);
  line-height: 1.05;
}

.search-box,
.select-control,
.toggle-control,
.multi-check-button,
.hero-search-row input,
.policy-search-control input,
input,
select {
  color: var(--neo-ink);
}

.hero-search-row input,
.policy-search-control input,
.select-control,
.multi-check-button,
.multi-check-menu,
.toggle-control {
  background: #ffffff;
  border: 3px solid var(--neo-ink);
  border-radius: 5px;
  box-shadow: 4px 4px 0 var(--neo-ink);
}

.select-control span,
.toggle-control strong,
.toggle-control small,
.multi-check-button span,
.search-box span {
  color: var(--neo-ink);
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.select-control > span {
  display: block;
  margin: 4px 8px 0;
}

.select-control select,
.policy-search-control input,
.hero-search-row input {
  width: calc(100% - 12px);
  margin: 0 6px 6px;
  min-height: 42px;
  color: var(--neo-ink);
  background: #ffffff;
  border-color: var(--neo-ink);
  border-radius: 3px;
  font-weight: 720;
  line-height: 1.3;
}

.hero-search-row input {
  width: 100%;
  margin: 0;
}

button,
.detail-drill,
.detail-source,
.source-button,
.reset-view,
.detail-back,
.detail-top,
.search-suggestions button,
.home-task,
.search-result,
.budget-card,
.filter-preview-row {
  color: var(--neo-ink);
  background: var(--neo-surface);
  border: 3px solid var(--neo-ink);
  border-radius: 5px;
  box-shadow: 4px 4px 0 var(--neo-ink);
  font-weight: 900;
}

.detail-drill,
.source-button,
.reset-view:not(:disabled),
.home-task-icon,
.search-suggestions button:first-child {
  background: var(--neo-primary);
  border-color: var(--neo-ink);
}

button:hover,
.budget-card:hover,
.search-result:hover,
.source-button:hover,
.detail-drill:hover,
.detail-source:hover,
.home-task:hover,
.filter-preview-row:hover {
  border-color: var(--neo-ink);
  box-shadow: 2px 2px 0 var(--neo-ink);
  transform: translate(2px, 2px);
}

.home-graphic-tabs button {
  color: var(--neo-ink);
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: none;
}

.home-graphic-tabs button:hover,
.home-graphic-tabs button:focus-visible {
  color: var(--neo-ink);
  background: #ffffff;
  border: 0;
  box-shadow: none;
  transform: none;
}

.home-graphic-tabs button.is-active,
.home-graphic-tabs button.is-active:hover,
.home-graphic-tabs button.is-active:focus-visible {
  background: var(--neo-primary);
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
.note-segment:focus-visible,
.ranked-segment:focus-visible,
.stacked-segment:focus-visible,
.stacked-ring-callout:focus-visible,
.stacked-rect-callout:focus-visible,
.snake-segment:focus-visible,
a:focus-visible {
  outline: 4px solid var(--neo-blue);
  outline-offset: 3px;
  box-shadow: 0 0 0 8px var(--neo-primary);
}

.home-graphic-tabs button:focus-visible {
  box-shadow: none;
}

.reset-view:disabled,
button:disabled {
  color: var(--ink-muted);
  background: var(--neo-muted);
  border-color: var(--neo-ink);
  box-shadow: none;
  opacity: 0.82;
}

.budget-card {
  background: #ffffff;
}

.budget-card strong,
.budget-card em,
.budget-card b {
  color: var(--neo-ink);
  font-weight: 950;
}

.budget-card::before,
.budget-strip-segment::after,
.filter-chip i,
.budget-strip-labels i {
  border: 2px solid var(--neo-ink);
}

.home-task-icon {
  color: var(--neo-ink);
  border: 3px solid var(--neo-ink);
  border-radius: 5px;
}

.home-task:nth-child(2) .home-task-icon,
.source-status-badge.official-row,
.source-status-badge.official-total {
  background: var(--neo-cyan);
}

.home-task:nth-child(3) .home-task-icon,
.source-status-badge.derived {
  background: var(--neo-pink);
}

.home-task:nth-child(4) .home-task-icon,
.source-status-badge.revised {
  background: var(--neo-green);
}

.source-status-badge.review,
.notice,
.disclaimer,
.check-row .source-status-badge.review {
  background: var(--neo-red);
}

.note-chart-shell {
  gap: 18px;
}

.chart-control-rail {
  padding: 12px;
  background: var(--neo-surface);
  border: 4px solid var(--neo-ink);
  border-radius: 5px;
  box-shadow: 6px 6px 0 var(--neo-ink);
}

.chart-control-rail::before {
  display: none;
  content: none;
}

.chart-control-rail .toolbar {
  gap: 10px;
}

.chart-control-rail .select-control {
  gap: 7px;
  padding: 8px;
}

.chart-control-rail .select-control span {
  margin: 0;
  font-size: 10px;
  line-height: 1.15;
  letter-spacing: 0;
}

.chart-control-rail .select-control select {
  width: 100%;
  margin: 0;
  min-height: 44px;
  padding-top: 0;
  padding-bottom: 0;
}

.banknote-wrap,
.chart-frame {
  background: #ffffff;
  border: 4px solid var(--neo-ink);
  border-radius: 5px;
  box-shadow: 7px 7px 0 var(--neo-ink);
}

.banknote {
  background: #ffffff;
}

.chart-kicker,
.ranked-subtitle,
.ranked-footer,
.chart-note,
.axis-label,
.chart-label {
  fill: var(--neo-ink);
  font-weight: 900;
}

.chart-kicker {
  font-size: 18px;
  text-transform: uppercase;
}

.ranked-title,
.ranked-total,
.value-label {
  fill: var(--neo-ink);
  font-weight: 950;
}

.bar-track {
  fill: var(--neo-muted);
  stroke: var(--neo-ink);
  stroke-width: 2;
}

.bar-fill,
.bar-hit {
  stroke: var(--neo-ink);
  stroke-width: 2;
}

.note-segment rect:first-child,
.ranked-segment rect,
.snake-node rect,
.stacked-segment rect,
.stacked-actual-segment rect,
.stacked-ring-callout rect,
.stacked-rect-callout rect {
  stroke: var(--neo-ink);
  stroke-width: 3;
}

.segment-label,
.segment-value,
.stacked-rect-label,
.stacked-rect-value,
.stacked-ring-label,
.stacked-ring-value,
.stacked-rank,
.stacked-actual-label,
.stacked-actual-value,
.snake-rank,
.snake-label,
.snake-value,
.snake-action {
  fill: var(--neo-ink) !important;
  paint-order: normal;
  stroke: transparent !important;
  stroke-width: 0 !important;
  font-weight: 950;
}

.stacked-actual-label,
.stacked-actual-value {
  font-size: 10px !important;
}

.stacked-rect-label,
.stacked-rect-value,
.stacked-ring-label,
.stacked-ring-value {
  font-size: 11px !important;
}

.stacked-rect-label.compact,
.stacked-rect-value.compact,
.stacked-rank,
.snake-rank {
  font-size: 10px !important;
}

.segment-label,
.segment-value {
  fill: var(--neo-ink) !important;
}

.table-wrap {
  border-radius: 5px;
}

table {
  background: var(--neo-surface);
}

th {
  color: var(--neo-ink);
  background: var(--neo-primary);
  border-bottom: 4px solid var(--neo-ink);
  font-weight: 950;
}

td {
  color: var(--neo-ink);
  border-bottom: 2px solid var(--neo-ink);
  font-weight: 620;
}

tbody tr:hover {
  background: var(--neo-cyan);
}

.hover-tooltip,
.motion-status,
.provenance {
  color: var(--neo-ink);
  background: var(--neo-surface);
  border: 4px solid var(--neo-ink);
  border-radius: 5px;
  box-shadow: 7px 7px 0 var(--neo-ink);
}

.hover-tooltip strong,
.hover-tooltip span,
.tooltip-value,
.tooltip-fact b,
.provenance p,
.provenance dd,
.proof-note {
  color: var(--neo-ink) !important;
}

.tooltip-kicker,
.tooltip-context small,
.tooltip-fact small,
.provenance dt {
  color: var(--neo-blue) !important;
  font-weight: 950;
}

.tooltip-context,
.tooltip-fact,
.proof-note {
  border-color: var(--neo-ink);
}

.faq-item,
.check-row,
.source-summary,
.fiscal-summary-card,
.policy-card,
.measure-find-row,
.selected-measure-detail,
.compare-bar,
.waterfall-step {
  background: #ffffff;
  border: 3px solid var(--neo-ink);
  border-radius: 5px;
  box-shadow: 5px 5px 0 var(--neo-ink);
}

.faq-item h3,
.policy-card-title,
.fiscal-summary-card strong,
.fiscal-summary-card span,
.selected-measure-detail strong,
.measure-find-main strong {
  color: var(--neo-ink);
  font-weight: 950;
}

.policy-card {
  background: linear-gradient(90deg, var(--policy-card-color, var(--neo-primary)) 0 14px, #ffffff 14px);
}

.policy-card-head small,
.policy-metric small,
.policy-card-breakdown span {
  color: var(--neo-ink);
}

.policy-metric {
  border-left-color: var(--neo-ink);
}

.policy-metric strong {
  color: var(--neo-ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  font-weight: 950;
}

.policy-card-breakdown span {
  background: var(--neo-paper);
  border: 2px solid var(--neo-ink);
  border-radius: 4px;
}

.measure-tags span,
.measure-components {
  background: var(--neo-paper);
  border: 2px solid var(--neo-ink);
  box-shadow: 3px 3px 0 var(--neo-ink);
}

.measure-tags span {
  border-radius: 999px;
  font-weight: 900;
}

.measure-components {
  border-radius: 5px;
}

.measure-components summary {
  color: var(--neo-ink);
  font-weight: 950;
}

.compare-bar i,
.waterfall-step i,
.budget-strip-bar {
  background: var(--neo-muted);
  border: 3px solid var(--neo-ink);
  border-radius: 4px;
}

.compare-bar i::before,
.budget-strip-segment {
  border-right: 2px solid var(--neo-ink);
}

.fiscal-line-point {
  stroke: var(--neo-ink);
  stroke-width: 3;
}

.fiscal-zero-line {
  stroke: var(--neo-ink);
  stroke-width: 3;
}

.fiscal-legend-label {
  fill: var(--neo-ink);
  font-weight: 900;
}

.attribution-footer {
  color: var(--neo-ink);
  background: var(--neo-surface);
  border: 4px solid var(--neo-ink);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  box-shadow: 7px 7px 0 var(--neo-ink);
}

.attribution-footer strong,
.attribution-footer p,
.attribution-footer li span {
  color: var(--neo-ink);
}

.attribution-footer li {
  border-bottom: 2px solid var(--neo-ink);
}

.attribution-actions a,
.attribution-actions button {
  color: var(--neo-ink);
  background: #ffffff;
  border: 3px solid var(--neo-ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--neo-ink);
  font-weight: 900;
}

@media (max-width: 1120px) {
  .topbar,
  .history-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    min-width: 0;
  }

  .fiscal-head-panel {
    min-width: 0;
  }

  .fiscal-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro,
  .workbench,
  .support-grid,
  .history-grid,
  .fiscal-support-grid,
  .home-grid,
  .signature-grid,
  .policy-layout,
  .policy-summary-grid,
  .policy-filters,
  .policy-find-filters {
    grid-template-columns: 1fr;
  }

  .policy-card {
    grid-template-columns: 1fr;
  }

  .intro > div:first-child {
    grid-row: auto;
  }
}

@media (min-width: 1560px) {
  .workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .banknote {
    height: min(74vh, 880px);
  }
}

@media (max-width: 1040px) {
}

@media (max-width: 760px) {
  .table-scroll-hint {
    display: block;
  }

  .mode-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-height: none;
    overflow: visible;
    padding-bottom: 8px;
  }

  .mode-button {
    min-height: 54px;
  }

  .fiscal-summary-cards {
    grid-template-columns: 1fr;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-title h3 {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font-size: 19px;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  .fiscal-chart-controls .select-control,
  .fiscal-head-panel .select-control {
    width: 100%;
    min-width: 0;
  }

  .chart-frame {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .chart-frame svg {
    min-width: 0;
  }

  main {
    width: 100%;
    max-width: 100%;
    padding-top: 20px;
    overflow: hidden;
  }

  .intro h1 {
    max-width: 100%;
    font-size: 34px;
    line-height: 1.04;
    overflow-wrap: normal;
  }

  body[data-mode="home"] .intro h1 {
    white-space: normal;
  }

  body:not([data-mode="home"]) .intro,
  body:not([data-mode="home"]) .intro > div:first-child {
    display: block;
    width: 100%;
    min-width: 0;
  }

  body:not([data-mode="home"]) .intro h1 {
    max-width: min(100%, 360px);
    font-size: 28px;
    line-height: 1.08;
  }

  body:not([data-mode="home"]) .intro p {
    max-width: calc(100vw - 40px);
  }

  .intro p {
    max-width: 100%;
    font-size: 16px;
  }

  .concept-strip,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .hero-search-row {
    grid-template-columns: 1fr;
  }

  .hero-search-row .detail-drill {
    width: 100%;
  }

  .home-task {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    min-height: 68px;
  }

  .budget-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .budget-card .source-status-badge,
  .budget-card b {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .attribution-footer {
    grid-template-columns: 1fr;
    margin-top: 12px;
    padding: 18px 20px 24px;
  }

  .attribution-actions {
    justify-content: flex-start;
  }

  .breadcrumbs,
  .active-controls {
    flex-wrap: nowrap;
    margin-inline: -2px;
    padding-bottom: 4px;
    overflow-x: auto;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .mini-flow,
  .compare-bar,
  .check-row {
    grid-template-columns: 1fr;
  }

  .flow-bridge {
    gap: 8px;
    min-height: 0;
  }

  .flow-bridge svg {
    height: 86px;
    min-height: 86px;
  }

  .note-toolbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .note-stage .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .note-chart-shell {
    grid-template-columns: 1fr;
  }

  .chart-control-rail {
    position: static;
    order: -1;
    padding: 10px;
    border: 4px solid var(--neo-ink);
  }

  .select-control {
    min-width: 100%;
  }

  .note-stage {
    width: 100%;
    max-width: calc(100vw - 40px);
    padding: 12px;
  }

  .banknote-wrap {
    min-height: 0;
    overflow-x: auto;
    overflow-y: visible;
  }

  .banknote {
    width: 900px;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .fiscal-note-wrap {
    overflow-x: visible;
  }

  .fiscal-note-wrap .banknote {
    width: 100%;
  }

  .measure-find-row,
  .measure-find-main,
  .selected-measure-detail {
    grid-template-columns: 1fr;
  }

  .measure-find-main span,
  .measure-find-main em,
  .measure-find-tags,
  .measure-find-actions,
  .selected-measure-detail > strong,
  .selected-measure-detail > span,
  .selected-measure-detail > p,
  .selected-measure-detail .measure-tags,
  .selected-measure-detail .detail-actions,
  .selected-measure-detail .measure-components,
  .selected-measure-detail .measure-year-bars {
    grid-column: 1;
    grid-row: auto;
  }

  .measure-find-main strong {
    white-space: normal;
  }

  .measure-find-actions {
    justify-content: flex-start;
  }

.chart-interaction-hint {
    font-size: 12px;
  }

  .provenance {
    inset: 0;
    width: auto;
    max-height: none;
    padding: 22px 18px 28px;
    border-radius: 0;
    transform: translateY(100%);
  }

  .provenance.is-open {
    transform: translateY(0);
  }

  #close-provenance {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
  }

  .trust-legend p {
    flex-basis: 100%;
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  .intro h1 {
    max-width: 310px;
    font-size: 30px;
  }

  .intro p {
    max-width: 320px;
  }
}

.mobile-graphic-shell,
.mobile-detail-sheet,
.mobile-tabbar,
.mobile-deck-shell {
  display: none;
}

.mobile-deck-scrim {
  display: none;
}

@media (max-width: 820px) {
  html,
  body {
    min-height: 100%;
    background: #f8faf6;
  }

  .topbar,
  main,
  .mobile-graphic-shell,
  .mobile-detail-sheet,
  .mobile-tabbar {
    display: none !important;
  }

  .app-shell {
    min-height: 100svh;
  }

  .mobile-deck-shell {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100%;
    min-height: 100svh;
    overflow: hidden;
    color: var(--neo-ink);
    background: #f8faf6;
  }

  .mobile-deck-topbar {
    position: relative;
    z-index: 90;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 72px;
    padding: calc(10px + env(safe-area-inset-top)) 10px 10px;
    background: rgba(248, 250, 246, 0.96);
    border-bottom: 3px solid var(--neo-ink);
  }

  .mobile-deck-actions {
    display: flex;
    gap: 8px;
  }

  .mobile-deck-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: var(--neo-ink);
    background: #fff;
    border: 3px solid var(--neo-ink);
    border-radius: 6px;
    box-shadow: 3px 3px 0 var(--neo-ink);
  }

  .mobile-deck-icon svg,
  .mobile-nav-tray svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: square;
    stroke-linejoin: miter;
    stroke-width: 2;
  }

  .mobile-deck-title {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .mobile-deck-title span {
    color: var(--action-blue);
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
  }

  .mobile-deck-title strong {
    overflow: hidden;
    font-size: 18px;
    font-weight: 950;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-deck-viewport {
    position: relative;
    min-height: 0;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
  }

  .mobile-deck-track {
    display: flex;
    height: 100%;
    transition: transform 220ms var(--ease-civic);
    will-change: transform;
  }

  .mobile-deck-slide {
    display: grid;
    flex: 0 0 100%;
    min-width: 100%;
    min-height: 0;
    padding: 10px 10px 0;
  }

  .mobile-chart-card {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    padding: 14px;
    overflow: hidden;
    background: #fff;
    border: 4px solid var(--neo-ink);
    border-radius: 7px;
    box-shadow: 6px 6px 0 var(--neo-ink);
  }

  .mobile-chart-copy {
    display: grid;
    gap: 2px;
    margin-bottom: 10px;
  }

  .mobile-chart-copy span {
    color: var(--action-blue);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-chart-copy h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 950;
    line-height: 1;
  }

  .mobile-chart-list {
    display: grid;
    align-content: start;
    gap: 9px;
    min-height: 0;
    overflow-y: auto;
    transform: scale(var(--mobile-zoom));
    transform-origin: top left;
  }

  .mobile-chart-row {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    grid-template-rows: auto 14px;
    gap: 5px 8px;
    align-items: center;
    min-height: 58px;
    padding: 8px;
    color: var(--neo-ink);
    background: #fff;
    border: 3px solid var(--neo-ink);
    border-radius: 6px;
    text-align: left;
  }

  .mobile-chart-row.is-selected {
    background: color-mix(in srgb, var(--row-color) 24%, white);
    box-shadow: inset 0 0 0 3px var(--row-color);
  }

  .mobile-row-rank {
    display: grid;
    grid-row: 1 / 3;
    width: 34px;
    height: 34px;
    place-items: center;
    background: var(--row-color);
    border: 2px solid var(--neo-ink);
    border-radius: 5px;
    font-size: 11px;
    font-weight: 950;
  }

  .mobile-row-label {
    min-width: 0;
    overflow: hidden;
    font-size: 15px;
    font-weight: 950;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-row-value {
    font-size: 13px;
    font-weight: 950;
    font-variant-numeric: tabular-nums lining-nums;
    white-space: nowrap;
  }

  .mobile-chart-row i {
    grid-column: 2 / 4;
    display: block;
    width: 100%;
    height: 14px;
    background:
      linear-gradient(to right, var(--row-color) var(--row-width), transparent var(--row-width)),
      #e7ecef;
    border: 2px solid var(--neo-ink);
    border-radius: 4px;
  }

  .mobile-chart-blocks .mobile-chart-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-chart-blocks .mobile-chart-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 12px;
    min-height: 118px;
    align-content: end;
    background: color-mix(in srgb, var(--row-color) 36%, white);
  }

  .mobile-chart-blocks .mobile-row-rank {
    grid-row: auto;
  }

  .mobile-chart-blocks .mobile-chart-row i {
    grid-column: 1;
  }

  .mobile-chart-path .mobile-chart-row {
    margin-left: calc(min(4, var(--row-width)) * 1px);
  }

  .mobile-touch-tooltip {
    position: absolute;
    right: 14px;
    bottom: 14px;
    left: 14px;
    z-index: 5;
    display: grid;
    gap: 4px;
    padding: 12px;
    color: #fff;
    background: #111;
    border: 3px solid #111;
    border-radius: 7px;
    box-shadow: 0 0 0 3px #fff;
  }

  .mobile-touch-tooltip strong {
    font-size: 18px;
    font-weight: 950;
    line-height: 1.08;
  }

  .mobile-touch-tooltip span {
    color: var(--neo-primary);
    font-size: 20px;
    font-weight: 950;
  }

  .mobile-touch-tooltip small,
  .mobile-touch-tooltip em {
    color: #f8faf6;
    font-size: 13px;
    font-style: normal;
    font-weight: 750;
  }

  .mobile-deck-footer {
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 54px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(248, 250, 246, 0.96);
    border-top: 3px solid var(--neo-ink);
    font-size: 12px;
    font-weight: 950;
  }

  .mobile-deck-dots {
    display: flex;
    gap: 7px;
  }

  .mobile-deck-dots button {
    width: 28px;
    height: 12px;
    padding: 0;
    background: #fff;
    border: 2px solid var(--neo-ink);
    border-radius: 999px;
  }

  .mobile-deck-dots button.is-active {
    background: var(--neo-primary);
  }

  .mobile-deck-scrim {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    background: rgba(17, 17, 17, 0.32);
  }

  .mobile-deck-scrim[hidden] {
    display: none;
  }

  .mobile-nav-tray,
  .mobile-filter-sheet {
    position: fixed;
    z-index: 80;
    color: var(--neo-ink);
    background: #fff;
    border: 4px solid var(--neo-ink);
    box-shadow: 7px 7px 0 var(--neo-ink);
    transition: transform 220ms var(--ease-civic);
  }

  .mobile-nav-tray {
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 340px);
    padding: calc(16px + env(safe-area-inset-top)) 14px 18px;
    overflow-y: auto;
    transform: translateX(calc(-100% - 12px));
  }

  body.mobile-nav-open .mobile-nav-tray {
    transform: translateX(0);
  }

  .mobile-nav-tray > strong,
  .mobile-filter-sheet > strong {
    display: block;
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 950;
    line-height: 1;
  }

  #mobile-nav-list {
    display: grid;
    gap: 9px;
  }

  #mobile-nav-list button {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: 7px;
    color: var(--neo-ink);
    background: #fff;
    border: 3px solid var(--neo-ink);
    border-radius: 6px;
    text-align: left;
  }

  #mobile-nav-list button.is-active {
    background: var(--neo-primary);
  }

  #mobile-nav-list svg {
    width: 38px;
    height: 38px;
    padding: 7px;
    background: #f8faf6;
    border: 2px solid var(--neo-ink);
    border-radius: 5px;
  }

  #mobile-nav-list strong,
  #mobile-nav-list small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #mobile-nav-list strong {
    font-size: 14px;
    font-weight: 950;
  }

  #mobile-nav-list small {
    color: var(--ink-secondary);
    font-size: 11px;
    font-weight: 780;
  }

  .mobile-filter-sheet {
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: grid;
    gap: 12px;
    max-height: min(78svh, 520px);
    padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border-radius: 9px 9px 0 0;
    transform: translateY(calc(100% + 20px));
  }

  body.mobile-filters-open .mobile-filter-sheet {
    transform: translateY(0);
  }

  .mobile-sheet-handle {
    justify-self: center;
    width: 46px;
    height: 5px;
    background: var(--neo-ink);
    border-radius: 999px;
  }

  .mobile-filter-sheet label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-filter-sheet select,
  .mobile-filter-sheet input,
  .mobile-filter-sheet button {
    min-height: 48px;
  }

  .mobile-filter-sheet select,
  .mobile-filter-sheet input[type="range"] {
    width: 100%;
    color: var(--neo-ink);
    background: #fff;
    border: 3px solid var(--neo-ink);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 900;
  }

  .mobile-filter-sheet fieldset {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .mobile-filter-sheet fieldset:has([data-mobile-deck-chart]) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mobile-filter-sheet legend {
    grid-column: 1 / -1;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-filter-sheet button {
    color: var(--neo-ink);
    background: #fff;
    border: 3px solid var(--neo-ink);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-filter-sheet button.is-active,
  #mobile-deck-reset-filters {
    background: var(--neo-primary);
  }
}

@media (max-width: 820px) {
  body {
    background: #f8faf6;
  }

  .topbar,
  .intro {
    display: none !important;
  }

  .mobile-graphic-shell {
    position: sticky;
    top: 0;
    z-index: 45;
    display: block;
    padding: 10px 10px 9px;
    background: rgba(248, 250, 246, 0.96);
    border-bottom: 3px solid var(--neo-ink);
    backdrop-filter: blur(14px);
  }

  .mobile-app-bar,
  .mobile-lens-strip,
  .mobile-action-row,
  .mobile-compare-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--neo-ink);
    text-decoration: none;
    font-size: 13px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-brand-mark {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: var(--neo-ink);
    background: var(--neo-primary);
    border: 3px solid var(--neo-ink);
    border-radius: 4px;
  }

  .mobile-brand-mark svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: square;
    stroke-width: 1.8;
  }

  .mobile-year-control {
    display: grid;
    gap: 2px;
    min-width: 112px;
    color: var(--ink-secondary);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
  }

  .mobile-year-control select {
    min-height: 34px;
    color: var(--neo-ink);
    background: #fff;
    border: 3px solid var(--neo-ink);
    border-radius: 5px;
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-lens-strip {
    margin-top: 9px;
  }

  .mobile-lens-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
  }

  .mobile-lens-copy span {
    color: var(--action-blue);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-lens-copy strong {
    color: var(--neo-ink);
    font-size: 25px;
    font-weight: 950;
    line-height: 1;
  }

  .mobile-lens-copy small {
    color: var(--ink-secondary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.18;
  }

  .mobile-icon-actions {
    display: inline-grid;
    grid-template-columns: repeat(3, 38px);
    gap: 6px;
  }

  .mobile-icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--neo-ink);
    background: #fff;
    border: 3px solid var(--neo-ink);
    border-radius: 5px;
    box-shadow: 3px 3px 0 var(--neo-ink);
  }

  .mobile-icon-button.is-active {
    background: var(--neo-primary);
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--neo-ink);
  }

  .mobile-icon-button svg,
  .mobile-tabbar svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: square;
    stroke-linejoin: miter;
    stroke-width: 2;
  }

  .mobile-chip-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mobile-chip-row::-webkit-scrollbar {
    display: none;
  }

  .mobile-chip-row button {
    display: grid;
    flex: 0 0 auto;
    min-width: 132px;
    max-width: 178px;
    min-height: 48px;
    padding: 7px 9px;
    color: var(--neo-ink);
    background: color-mix(in srgb, var(--chip-color) 32%, white);
    border: 3px solid var(--neo-ink);
    border-radius: 6px;
    text-align: left;
  }

  .mobile-chip-row span {
    overflow: hidden;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-chip-row em {
    margin-top: 3px;
    font-size: 12px;
    font-style: normal;
    font-weight: 820;
  }

  .mobile-action-row {
    margin-top: 9px;
  }

  .mobile-action-button,
  .mobile-value-toggle button,
  .mobile-compare-head button {
    min-height: 34px;
    color: var(--neo-ink);
    background: #fff;
    border: 3px solid var(--neo-ink);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-action-button {
    padding: 4px 9px;
  }

  .mobile-value-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 154px;
    border: 3px solid var(--neo-ink);
    border-radius: 5px;
    overflow: hidden;
  }

  .mobile-value-toggle button {
    min-height: 32px;
    border: 0;
    border-radius: 0;
    font-size: 11px;
  }

  .mobile-value-toggle button + button {
    border-left: 3px solid var(--neo-ink);
  }

  .mobile-value-toggle .is-active {
    background: var(--neo-primary);
  }

  main {
    padding: 10px 10px calc(270px + env(safe-area-inset-bottom));
    background: #f8faf6;
    overflow: visible;
  }

  .mode-view.is-visible {
    animation: none;
  }

  .mode-view.is-visible > .breadcrumbs,
  .mode-view.is-visible > .active-controls {
    margin: 0 0 8px;
    padding: 0 0 4px;
  }

  .workbench,
  .policy-summary-grid,
  .policy-layout,
  .support-grid,
  .fiscal-trend-grid {
    gap: 10px;
  }

  .policy-summary-grid,
  .policy-layout,
  .support-grid,
  .fiscal-trend-grid,
  .history-head .fiscal-head-panel,
  .table-fallback,
  .chart-interaction-hint {
    display: none;
  }

  .note-stage,
  .fiscal-graphic-panel {
    max-width: none;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .note-toolbar,
  .note-stage .chart-control-rail,
  .fiscal-graphic-panel .chart-control-rail {
    display: none;
  }

  .note-chart-shell {
    display: block;
  }

  .banknote-wrap {
    min-height: calc(100svh - 390px);
    max-height: calc(100svh - 310px);
    padding: 0;
    overflow: auto;
    background: #fff;
    border: 4px solid var(--neo-ink);
    border-radius: 6px;
    box-shadow: 6px 6px 0 var(--neo-ink);
  }

  .banknote {
    width: 760px;
    min-width: 760px;
    height: auto;
    max-height: none;
  }

  .banknote.is-path-chart,
  .fiscal-note-wrap .banknote {
    width: 720px;
    min-width: 720px;
  }

  .history-head {
    display: block;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .history-head .fiscal-head-copy {
    display: none;
  }

  .mobile-detail-sheet {
    position: fixed;
    right: 10px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 55;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    max-height: 220px;
    padding: 8px 12px 10px;
    overflow-y: auto;
    color: var(--neo-ink);
    background: rgba(255, 255, 255, 0.97);
    border: 4px solid var(--neo-ink);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -5px 0 var(--neo-ink);
  }

  .mobile-sheet-handle {
    justify-self: center;
    width: 42px;
    height: 4px;
    background: var(--neo-ink);
    border-radius: 999px;
  }

  .mobile-sheet-main {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .mobile-sheet-main span {
    color: var(--action-blue);
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-sheet-main strong {
    overflow: hidden;
    font-size: 17px;
    font-weight: 950;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-sheet-main small {
    overflow: hidden;
    color: var(--ink-secondary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-sheet-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-sheet-metrics span {
    display: grid;
    gap: 1px;
    min-width: 0;
    padding: 7px 9px;
    background: var(--neo-primary);
    border: 3px solid var(--neo-ink);
    border-radius: 5px;
  }

  .mobile-sheet-metrics b {
    overflow: hidden;
    font-size: 18px;
    font-weight: 950;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-sheet-metrics em {
    overflow: hidden;
    font-size: 10px;
    font-style: normal;
    font-weight: 850;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .mobile-compare-drawer {
    display: grid;
    gap: 6px;
    min-height: 19px;
  }

  .mobile-compare-empty {
    color: var(--ink-muted);
    font-size: 11px;
    font-weight: 760;
  }

  .mobile-compare-head strong {
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-compare-head button {
    min-height: 26px;
    padding: 1px 8px;
    font-size: 10px;
  }

  .mobile-compare-bars {
    display: grid;
    gap: 5px;
  }

  .mobile-compare-bar {
    display: grid;
    grid-template-columns: minmax(70px, 0.8fr) minmax(84px, 1fr) auto;
    gap: 7px;
    align-items: center;
    font-size: 11px;
    font-weight: 850;
  }

  .mobile-compare-bar span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-compare-bar i {
    display: block;
    height: 10px;
    background: linear-gradient(to right, var(--bar-color) var(--w), #e6ebef var(--w));
    border: 2px solid var(--neo-ink);
    border-radius: 4px;
  }

  .mobile-compare-bar em {
    font-style: normal;
    font-variant-numeric: tabular-nums lining-nums;
  }

  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 6px 8px calc(7px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 4px solid var(--neo-ink);
  }

  .mobile-tabbar button {
    display: grid;
    min-width: 0;
    min-height: 58px;
    place-items: center;
    gap: 3px;
    color: var(--neo-ink);
    background: transparent;
    border: 0;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-tabbar button.is-active {
    background: var(--neo-primary);
    border: 3px solid var(--neo-ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes surface-in {
  from {
    opacity: 0.98;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lens-shift {
  from {
    opacity: 0.92;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chart-refresh {
  from {
    opacity: 0.9;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loading-chip {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }
  18%,
  78% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-2px);
  }
}

@keyframes bar-enter {
  from {
    opacity: 0.78;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes segment-enter {
  from {
    opacity: 0.82;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


@keyframes flow-card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes flow-meter-in {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes flow-band-in {
  from {
    opacity: 0;
    stroke-dashoffset: 60;
  }
  to {
    opacity: 0.62;
    stroke-dashoffset: 0;
  }
}

@keyframes nesting-slide {
  from {
    opacity: 0;
    transform: translateX(calc((var(--i) + 1) * -6px));
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes waterfall-step-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes waterfall-bar-in {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes compare-row-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes compare-meter-in {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes chip-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes status-toast {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  10%,
  82% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
}

@keyframes proof-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 215, 158, 0.42);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(245, 215, 158, 0);
  }
}

@keyframes source-cell-highlight {
  0%,
  100% {
    background: #f5d79e;
  }
  45% {
    background: #fff2c8;
  }
}
