:root {
  --ink: #17211d;
  --muted: #647069;
  --line: #dfe5df;
  --paper: #f4f1e9;
  --surface: #fffef9;
  --surface-2: #f8f7f1;
  --green: #146b4c;
  --green-dark: #0d5039;
  --green-soft: #dcece4;
  --teal: #4d9d83;
  --gold: #c78c35;
  --gold-soft: #f4e7d2;
  --red: #ac4f3d;
  --blue: #476b92;
  --shadow: 0 16px 40px rgba(32, 48, 39, 0.08);
  --radius: 18px;
  --page-gutter: clamp(18px, 3vw, 48px);
  --page-max-width: 1880px;
  --page-shell-margin: max(var(--page-gutter), calc((100vw - var(--page-max-width)) / 2));
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,.8), transparent 28rem),
    var(--paper);
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.startup-loading {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, .94), transparent 30rem),
    rgba(244, 241, 233, .92);
  backdrop-filter: blur(10px);
  opacity: 1;
  visibility: visible;
  transition: opacity .22s ease, visibility .22s ease;
}

.startup-loading-card {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(20, 107, 76, .18);
  border-radius: 22px;
  background: rgba(255, 254, 249, .96);
  box-shadow: var(--shadow);
}

.startup-loading-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.startup-loading h1 {
  margin: 6px 0 8px;
  font-family: "DM Serif Display", serif;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1;
}

.startup-loading p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

body.app-loading .app-shell,
body.app-load-failed .app-shell {
  pointer-events: none;
  user-select: none;
  filter: saturate(.75);
}

body.app-ready .startup-loading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.app-load-failed .startup-loading {
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, .94), transparent 30rem),
    rgba(244, 241, 233, .96);
}

body.app-load-failed #startupRetryButton {
  display: inline-flex;
}

.topbar {
  height: 58px;
  padding: 0 var(--page-shell-margin);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(23, 33, 29, .11);
  background: rgba(255, 254, 249, .86);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  width: max-content;
}

.brand strong, .brand small { display: block; line-height: 1.15; }
.brand strong { font-size: 14px; }
.brand strong span { display: block; }
.brand > .brand-mark { width: 44px; height: 44px; flex-shrink: 0; padding: 9px; }
.brand > .brand-mark span:nth-child(1) { height: 14px; }
.brand > .brand-mark span:nth-child(2) { height: 26px; }
.brand > .brand-mark span:nth-child(3) { height: 20px; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-top: 1px; }

.brand-mark {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--green);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 7px;
}

.brand-mark span {
  width: 4px;
  background: #fff;
  border-radius: 3px 3px 1px 1px;
}
.brand-mark span:nth-child(1) { height: 9px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 13px; opacity: .82; }

.main-nav {
  display: flex;
  align-self: stretch;
  gap: 26px;
}

.nav-item {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 3px 2px 0;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}

.nav-item:hover, .nav-item.active { color: var(--ink); }
.nav-item.active { border-bottom-color: var(--green); }

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.profile-state {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font: inherit;
  font-weight: 700;
  padding: 6px 9px;
  white-space: nowrap;
}
.profile-state:hover {
  border-color: var(--line);
  color: var(--green-dark);
  background: rgba(255,255,255,.74);
}
.profile-state { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; padding: 9px; }
.account-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 721px) and (max-width: 1100px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 12px; }
  .topbar .main-nav { gap: 12px; justify-content: center; font-size: 12px; }
  .topbar .save-state { display: none; }
  .topbar .top-actions { gap: 6px; }
}
@media (max-width: 480px) {
  .topbar .brand { gap: 8px; }
  .topbar .top-actions { gap: 6px; }
  .topbar .feedback-top-button { padding-left: 10px; padding-right: 10px; }
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.save-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; }
.save-state.saving .save-dot { background: var(--gold); }

.icon-button, .avatar, .more-button, .close-button, .drawer-close {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.icon-button:hover { background: var(--surface-2); }
.reset-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.reset-button:hover { background: var(--surface-2); color: var(--ink); }

.feedback-top-button { padding: 8px 12px; font-size: 12px; }

.prototype-badge {
  min-width: 42px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.icon-button svg, .button svg, .data-callout svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

main {
  width: auto;
  max-width: var(--page-max-width);
  margin: 0 var(--page-shell-margin);
  padding: 20px 0 64px;
}

.app-view { display: none; }
.app-view.active { display: block; }
#dataView {
  padding-left: 0;
  padding-right: 0;
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  margin-bottom: 12px;
}

.eyebrow {
  color: var(--green);
  font-size: 11px;
  letter-spacing: .14em;
  font-weight: 700;
  margin-bottom: 4px;
}

.title-row { display: flex; align-items: center; gap: 14px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: "DM Serif Display", serif; font-weight: 400; }
h1 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.025em; margin-bottom: 4px; }
h2 { font-size: 25px; line-height: 1.15; margin-bottom: 0; }
h3 { font-size: 16px; margin-bottom: 5px; }
.workspace-head p { color: var(--muted); margin: 0; font-size: 13px; }

.selection-header {
  background: var(--paper);
  padding-bottom: 12px;
  position: relative;
  z-index: 10;
}
.selection-header .selection-panel { margin-bottom: 0; }
.selection-header > .panel.selection-panel { padding: 16px; }
.selection-panel > .compare-controls,
.selection-panel > .compare-concept-row { margin-bottom: 0; }
.selection-panel > .compare-concept-row { margin-top: 12px; }
.selection-panel > .data-view-switch { margin-bottom: 12px; }
@media (min-width: 1024px) and (min-height: 700px) {
  .selection-header.selection-header-fits {
    position: sticky;
    top: var(--selection-top, 58px);
  }
}

.draft-pill, .type-tag {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #855f27;
  font-size: 10px;
  letter-spacing: .06em;
  font-weight: 700;
  text-transform: uppercase;
}

.workspace-actions { display: grid; gap: 7px; justify-items: end; }
.workspace-action-buttons { display: flex; gap: 10px; }
.scenario-save-status {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}
.scenario-save-status strong {
  color: var(--ink);
  font-weight: 800;
}
.button {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
}
.button.primary { background: var(--green); border-color: var(--green); color: white; }
.button.primary:hover { background: var(--green-dark); }
.button.danger { background: var(--red); border-color: var(--red); color: white; }
.button.danger:hover { filter: brightness(.92); }
.button.ghost { background: var(--surface); }
.button.ghost:hover { border-color: #b7c0b9; background: #fff; }
.button.full { width: 100%; margin-top: 8px; }

.context-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: .75fr .85fr 1fr 1fr .8fr .62fr .68fr 1.75fr auto;
  gap: 10px;
  margin-bottom: 12px;
  box-shadow: 0 6px 20px rgba(32, 48, 39, .035);
}

.context-bar label, .form-grid label, .notes-field, .full-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.context-bar label.disabled-context {
  opacity: .55;
}

.context-bar label.disabled-context select {
  cursor: not-allowed;
  background: #f3f3ef;
}

label > span, .context-bar label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

select, input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  min-height: 35px;
  padding: 0 10px;
  outline: none;
}

select:focus, input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,107,76,.1); }

#feedbackText { min-height: 150px; padding: 11px; resize: vertical; line-height: 1.5; }
.feedback-status { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }

.source-status {
  display: grid;
  grid-template-columns: auto;
  gap: 8px;
  align-items: center;
  padding: 0 2px 0 10px;
  border-left: 1px solid var(--line);
}
.source-collection-field select {
  min-height: 44px;
  line-height: 1.25;
  white-space: normal;
}
.source-status button, .link-button {
  border: 0;
  background: none;
  color: var(--green);
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
}
.source-actions {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.headline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.metric-card {
  min-height: 54px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 13px;
  box-shadow: 0 6px 20px rgba(32, 48, 39, .03);
  display: grid;
  grid-template-columns: minmax(135px, 1fr) auto;
  grid-template-areas: "label value";
  align-items: center;
  column-gap: 10px;
}
.metric-label { grid-area: label; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.metric-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 3px; }
.revenue .metric-dot { background: var(--green); }
.spending .metric-dot { background: var(--gold); }
.balance .metric-dot { background: var(--muted); }
.balance.balance-positive .metric-dot { background: var(--green); }
.balance.balance-negative .metric-dot { background: var(--red); }
.metric-card > strong { grid-area: value; display: block; font-family: "DM Serif Display", serif; font-size: 24px; font-weight: 400; margin: 0; text-align: right; white-space: nowrap; }
.metric-baseline { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.metric-card strong.change-positive { color: #116b46; }
.metric-card strong.change-negative { color: #8f2638; }
.metric-card strong.change-neutral { color: var(--muted); }

.studio-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(380px, .85fr); gap: 14px; margin-bottom: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.explorer-panel, .scenario-panel, .outlook-panel { padding: 18px; }
.explorer-panel { grid-column: 1 / -1; }
.scenario-panel { grid-column: 1 / -1; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.panel-intro { color: var(--muted); margin: 4px 0 0; font-size: 12px; }
.fiscal-explorer-head { align-items: center; }
.fiscal-explorer-head-actions { display: flex; align-items: center; gap: 18px; }
.explorer-reset-button { flex: 0 0 auto; }

.compare-panel { padding: 18px; }
.data-library-panel { padding: 22px 24px 24px; }
.data-library-title-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.compare-controls {
  display: grid;
  grid-template-columns: 1fr .85fr 1fr 1.1fr .7fr .85fr .75fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
.compare-controls label, .compare-concept-row label, .mapping-editor label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.compare-controls select, .compare-concept-row select, .mapping-editor textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}
.compare-concept-row {
  display: flex;
  align-items: end;
  margin-bottom: 12px;
}
.compare-concept-row label {
  width: min(620px, 100%);
}
.concept-select-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 7px;
  align-items: center;
  margin-top: 7px;
}
.concept-select-row select {
  margin-top: 0;
  min-width: 0;
}
.compare-tools-row,
.concept-action-row {
  display: flex;
  gap: 7px;
}
.concept-select-row .button {
  min-height: 38px;
  padding: 8px 10px;
  white-space: nowrap;
}
.compare-tools-row {
  align-items: end;
  justify-content: flex-end;
}
.add-concept-button {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.compare-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.mapping-editor {
  border: 1px solid #d6e3dc;
  border-radius: 14px;
  background: rgba(248,247,241,.7);
  padding: 13px 15px 14px;
  position: sticky;
  top: 76px;
}
.mapping-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.mapping-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.mapping-editor p, .mapping-note { color: var(--muted); font-size: 12px; line-height: 1.45; }
.mapping-editor > p {
  margin: 0 0 10px;
}
#resetMappingButton {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
  white-space: nowrap;
}
.mapping-editor textarea {
  min-height: 190px;
  resize: vertical;
  font-family: "DM Sans", sans-serif;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.unmapped-terms-list {
  display: grid;
  max-height: 250px;
  overflow: auto;
  gap: 6px;
  margin-top: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.unmapped-terms-list[hidden] { display: none; }
.unmapped-terms-list p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}
.unmapped-term-chip {
  border: 1px solid #dce9e2;
  border-radius: 9px;
  background: #f8fbf8;
  color: var(--ink);
  cursor: context-menu;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.25;
  padding: 8px 9px;
  text-align: left;
  text-transform: none;
}
.unmapped-term-chip:hover {
  border-color: rgba(20, 107, 76, .35);
  background: var(--green-soft);
}
.mapping-note { margin-top: 12px; }
.comparison-results { min-width: 0; }
.compare-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 240px));
  gap: 10px;
  margin-bottom: 10px;
}
.compare-summary-grid article {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 9px 12px;
  background: white;
}
.compare-summary-grid span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.compare-summary-grid strong { display: block; font-family: "DM Serif Display", serif; font-size: 23px; font-weight: 400; line-height: 1; }
.compare-chart-summary {
  grid-template-columns: repeat(2, minmax(150px, auto));
  margin: 0;
}
.compare-scope-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; font-weight: 500; }
.compare-chart {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefb;
  padding: 10px 12px;
  max-height: 620px;
  overflow: auto;
}
.compare-bar-detail {
  border-bottom: 1px solid #eef1ed;
}
.compare-bar-detail:last-child { border-bottom: 0; }
.compare-chart-title {
  position: sticky;
  top: -10px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 18px;
  padding: 6px 0 8px;
  background: #fffefb;
  border-bottom: 1px solid #edf1ee;
}
.compare-chart-title > div:first-child {
  flex: 1 1 420px;
  min-width: 0;
}
.compare-chart-title strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}
.compare-chart-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.compare-bar-header {
  position: sticky;
  top: 62px;
  z-index: 2;
  display: grid;
  grid-template-columns: 22px minmax(170px, 230px) 76px 82px minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 6px 0 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid #e5ece7;
  background: #fffefb;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.15;
  text-transform: uppercase;
}
.compare-sort-button {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: left;
  text-transform: inherit;
  padding: 0 0 4px;
  cursor: pointer;
}
.compare-sort-button:hover {
  color: var(--green-dark);
}
.compare-sort-button.active {
  border-bottom-color: rgba(20, 107, 76, .45);
  color: var(--ink);
}
.compare-sort-button i {
  align-self: flex-start;
  border-radius: 999px;
  background: #edf5ef;
  color: var(--green-dark);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .01em;
  line-height: 1;
  padding: 3px 6px;
  text-transform: none;
  white-space: nowrap;
}
.spending-compare .compare-sort-button.active {
  border-bottom-color: rgba(172, 79, 61, .45);
}
.spending-compare .compare-sort-button i {
  background: #fbefe2;
  color: var(--red);
}
.compare-bar-header .compare-sort-button:nth-child(3) {
  font-size: 10px;
}
.compare-bar-header .compare-sort-button:nth-child(3),
.compare-bar-header .compare-sort-button:nth-child(4) {
  text-align: right;
  align-items: flex-end;
}
.compare-bar-header .compare-sort-button:nth-child(3) i,
.compare-bar-header .compare-sort-button:nth-child(4) i {
  align-self: flex-end;
}
.compare-bar-row {
  display: grid;
  grid-template-columns: 22px minmax(170px, 230px) 76px 82px minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 30px;
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}
.compare-bar-row::-webkit-details-marker { display: none; }
.compare-expand-icon {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  display: inline-grid;
  place-items: center;
}
.compare-expand-icon::before { content: "+"; color: var(--green); font-weight: 800; line-height: 1; }
.compare-bar-detail[open] .compare-expand-icon::before { content: "-"; }
.compare-bar-label { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e2eee7;
  overflow: hidden;
}
.compare-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--teal));
}
.spending-compare .compare-bar-track { background: var(--gold-soft); }
.spending-compare .compare-bar-fill { background: linear-gradient(90deg, var(--red), var(--gold)); }
.spending-compare .compare-expand-icon::before { color: var(--red); }
.compare-bar-row strong, .compare-bar-row small { text-align: right; }
.compare-bar-row strong { font-weight: 500; color: var(--muted); }
.compare-bar-row small {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -.01em;
}
.compare-bar-sources {
  margin: 7px 0 10px 32px;
  padding: 10px 12px 9px;
  border: 1px solid #d8e7df;
  border-left: 4px solid var(--green);
  border-radius: 12px;
  background: #fffefb;
  box-shadow: 0 8px 22px rgba(33, 65, 48, .06);
}
.compare-focus-row > .compare-bar-row,
.compare-table tr.compare-focus-row td {
  background: #eef8f2;
}
.spending-compare.compare-focus-row > .compare-bar-row {
  background: #fff5ea;
}
.spending-compare .compare-bar-sources {
  border-color: #efd7c7;
  border-left-color: var(--red);
  background: #fffdf9;
}
.compare-table-wrap {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  background: white;
}
.compare-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}
.compare-table th {
  position: sticky;
  top: 0;
  background: #f8f7f1;
  color: var(--muted);
  text-align: left;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.compare-table td {
  vertical-align: top;
  padding: 10px;
  border-top: 1px solid #edf1ee;
}
.compare-table th:nth-child(1), .compare-table td:nth-child(1) { width: 132px; white-space: normal; overflow-wrap: anywhere; }
.compare-table th:nth-child(2), .compare-table td:nth-child(2) { width: 92px; }
.compare-table th:nth-child(3), .compare-table td:nth-child(3) { width: 76px; }
.compare-table td:nth-child(2), .compare-table td:nth-child(3) { white-space: nowrap; text-align: right; font-weight: 700; }
.compare-source-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.compare-source-item {
  display: grid;
  grid-template-columns: minmax(190px, .85fr) 56px 74px minmax(260px, 1.25fr) 58px;
  gap: 8px;
  align-items: start;
  padding: 5px 0;
  border-bottom: 1px solid #f0f2ef;
}
.compare-source-item:last-child { border-bottom: 0; }
.compare-source-list strong { display: block; font-size: 12px; }
.compare-source-list small { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; }
.compare-source-name { font-weight: 700; line-height: 1.25; }
.compare-source-stack {
  position: relative;
  display: block;
  height: 12px;
  margin-top: 3px;
  border-radius: 999px;
  background: #e2eee7;
  overflow: hidden;
}
.compare-source-stack i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--green);
}
.compare-source-code-wrap {
  display: block;
}
.compare-source-code {
  width: max-content;
  justify-self: start;
  border: 1px solid #dce4df;
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--muted);
  background: #f8faf7;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.compare-source-value, .compare-source-share {
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
}
.compare-source-share { color: var(--muted); }
.compare-bar-sources .compare-source-item {
  align-items: center;
  padding: 7px 0;
}
.compare-bar-sources .compare-source-name {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.compare-bar-sources .compare-source-share,
.compare-bar-sources .compare-source-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.compare-bar-sources .compare-source-stack {
  background: #e2eee7;
}
.compare-bar-sources .compare-source-stack i {
  background: var(--green);
}
.spending-compare .compare-bar-sources .compare-source-stack {
  background: var(--gold-soft);
}
.spending-compare .compare-bar-sources .compare-source-stack i {
  background: linear-gradient(90deg, var(--red), var(--gold));
}

.context-menu {
  position: fixed;
  z-index: 60;
  display: none;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  box-shadow: 0 18px 48px rgba(15, 30, 23, .2);
}
.context-menu.open { display: block; }
.context-menu button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  text-align: left;
  padding: 10px 11px;
}
.context-menu button:hover { background: var(--green-soft); color: var(--green-dark); }
.context-menu button:disabled {
  color: var(--muted);
  cursor: default;
}
.context-menu button:disabled:hover {
  background: transparent;
  color: var(--muted);
}
.context-menu-section {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 6px;
}
.context-menu-section[hidden] { display: none; }
.context-menu-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  padding: 6px 11px 4px;
  text-transform: uppercase;
}

.profile-controls { grid-template-columns: repeat(6, minmax(135px, 1fr)); }
.profile-summary-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(2, minmax(180px, .7fr));
  gap: 12px;
  margin: 18px 0;
}
.profile-summary-grid article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  padding: 14px 16px;
}
.profile-summary-grid span,
.profile-summary-grid small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.profile-summary-grid span { text-transform: uppercase; letter-spacing: .06em; }
.profile-summary-grid strong {
  display: block;
  margin: 5px 0 3px;
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  font-size: 28px;
}
.profile-source-card {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(0, 1.4fr) repeat(2, minmax(120px, .45fr));
  gap: 10px;
  align-items: start;
  margin: -4px 0 16px;
  padding: 12px 14px;
  border: 1px solid #dfe9e3;
  border-radius: 14px;
  background: #f8fbf7;
  color: var(--muted);
  font-size: 11px;
}
.profile-source-card span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.profile-source-card strong,
.profile-source-card a {
  color: var(--ink);
  font-weight: 800;
}
.profile-source-card a {
  text-decoration-color: rgba(20, 107, 76, .35);
  text-underline-offset: 3px;
}
.profile-source-card small {
  display: block;
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.45;
}
@media (max-width: 1050px) {
  .profile-source-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .profile-source-card {
    grid-template-columns: 1fr;
  }
}
.profile-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.data-library-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.data-library-controls {
  grid-template-columns:
    minmax(110px, .7fr)
    minmax(180px, 1fr)
    minmax(200px, 1fr)
    minmax(210px, 1.05fr)
    minmax(115px, .65fr)
    minmax(105px, .6fr)
    minmax(145px, .75fr);
  gap: 10px;
  margin-bottom: 16px;
}
.data-library-controls[hidden] {
  display: none;
}
.data-library-controls select {
  padding-left: 9px;
  padding-right: 9px;
}
.data-search-field {
  grid-column: span 2;
}
.data-search-control {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  margin-top: 7px;
}
.data-search-control input {
  margin-top: 0;
  min-width: 0;
}
.data-search-control .button {
  min-height: 39px;
  padding: 0 11px;
}
.data-library-controls input {
  border: 1px solid #d7e3dc;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  background: white;
  color: var(--ink);
}
.data-view-switch {
  display: inline-flex;
  gap: 4px;
  border: 1px solid #d9e4de;
  border-radius: 999px;
  padding: 4px;
  background: #fffdf8;
}
.data-view-switch button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
}
.data-view-switch button.active {
  background: var(--green);
  color: white;
}
.data-source-list {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 92px;
}
.data-source-card {
  appearance: none;
  width: 100%;
  border: 1px solid #dfe9e3;
  border-radius: 16px;
  background: #fffdf8;
  padding: 13px 14px;
  text-align: left;
  cursor: pointer;
}
.data-source-card.active {
  border-color: var(--green);
  background: #f2fbf6;
  box-shadow: inset 4px 0 0 var(--green);
}
.data-source-card span,
.data-source-card small,
.data-source-hero p,
.data-source-links small,
.data-source-notes,
.data-column-list p,
.data-inventory-list p {
  color: var(--muted);
}
.data-source-card span {
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.data-source-card strong {
  display: block;
  margin: 5px 0;
  color: var(--ink);
  font-size: 14px;
}
.data-source-card small {
  display: block;
  font-size: 11px;
  line-height: 1.35;
}
.data-source-card em {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 7px 0;
  font-style: normal;
}
.data-source-card em b {
  border: 1px solid #dfe9e3;
  border-radius: 999px;
  background: white;
  color: #52685f;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}
.data-source-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}
.data-source-hero,
.data-library-grid > article,
.data-usage-panel {
  border: 1px solid #dfe9e3;
  border-radius: 18px;
  background: white;
  padding: 16px;
}
.data-source-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .7fr);
  gap: 14px;
}
.data-source-hero h3,
.data-usage-panel h3 {
  margin: 3px 0 6px;
  font-family: "DM Serif Display", serif;
  font-size: 26px;
  font-weight: 400;
}
.data-source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.data-source-meta span:not(.data-status) {
  border: 1px solid #dfe9e3;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.data-source-links {
  display: grid;
  gap: 8px;
  align-content: start;
}
.data-source-links small {
  line-height: 1.4;
}
.data-source-notes {
  grid-column: 1 / -1;
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.45;
}
.data-assessment-note {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #dfe9e4;
  border-radius: 12px;
  background: #f7fbf8;
  color: #42584f;
  font-size: 12px;
  line-height: 1.4;
}
.data-assessment-note p {
  margin: 0;
}
.data-assessment-note strong {
  color: var(--green);
}
.data-library-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.data-library-grid > article {
  min-width: 0;
}
.data-inventory-list,
.data-column-list {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}
.data-inventory-list article,
.data-column-list article {
  display: grid;
  gap: 7px;
  border: 1px solid #edf2ef;
  border-radius: 14px;
  padding: 11px 12px;
  background: #fffdf8;
}
.data-inventory-list article {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}
.data-inventory-list strong,
.data-column-list strong {
  color: var(--ink);
  font-size: 13px;
}
.data-inventory-list p,
.data-column-list p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
}
.data-column-list span:not(.data-status) {
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.data-column-list .data-column-artifact {
  display: block;
  margin-bottom: 6px;
  color: #52685f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}
.data-column-list .data-column-artifact strong {
  font-size: inherit;
}
.data-column-list .data-column-artifact.unresolved {
  color: #98641d;
}
.data-hierarchy-view {
  display: grid;
  gap: 14px;
}
.data-hierarchy-view[hidden] {
  display: none;
}
.data-status-path-view {
  display: grid;
  gap: 16px;
}
.data-status-path-view[hidden] {
  display: none;
}
.data-hierarchy-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  border: 1px solid #dfe9e3;
  border-radius: 18px;
  background: white;
  padding: 16px;
}
.data-hierarchy-head h3 {
  margin: 3px 0 0;
  font-family: "DM Serif Display", serif;
  font-size: 26px;
  font-weight: 400;
}
.data-hierarchy-head p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.data-status-path-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  border: 1px solid #dfe9e3;
  border-radius: 18px;
  background: white;
  padding: 16px;
}
.data-status-path-head h3,
.data-status-overlap-card h4,
.data-status-lane h4 {
  margin: 3px 0 0;
  font-family: "DM Serif Display", serif;
  font-size: 26px;
  font-weight: 400;
}
.data-status-lane h4 {
  font-size: 22px;
}
.data-status-path-head p,
.data-status-overlap-card p,
.data-status-lane p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.studio-data-status {
  padding: 16px 20px;
  margin: 12px 0;
  border: 1px solid var(--green);
  border-radius: 12px;
  background: #f0f8f4;
  color: #145b45;
}
.studio-data-status[hidden] { display: none; }
.studio-data-status button { margin-left: 12px; }
#studioView.is-loading-data .headline-grid,
#studioView.is-loading-data .explorer-balance,
#studioView.is-loading-data .studio-grid,
#studioView.is-loading-data .outlook-panel { visibility: hidden; }

.data-status-path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 14px;
}
.data-status-level-headings,
.data-status-stage-row {
  display: grid;
  grid-template-columns: 130px repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.data-status-level-headings {
  align-items: stretch;
}
.data-status-path-source {
  border: 1px solid #dfe9e3;
  border-radius: 999px;
  width: fit-content;
  background: #f7fbf8;
  color: var(--muted);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
}
.data-status-lane,
.data-status-lane-head,
.data-status-overlap-card {
  border: 1px solid #dfe9e3;
  border-radius: 18px;
  background: white;
  padding: 16px;
}
.data-status-lane,
.data-status-lane-head {
  display: grid;
  gap: 14px;
  align-content: start;
}
.data-status-stage-map {
  display: grid;
  gap: 14px;
}
.data-status-steps {
  display: grid;
  gap: 10px;
}
.data-status-stage {
  display: grid;
  gap: 9px;
}
.data-status-stage h5,
.data-status-stage-row > h5 {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.data-status-stage-row > h5 {
  align-self: start;
  border-top: 1px solid #dfe9e3;
  padding-top: 13px;
}
.data-status-step {
  border: 1px solid #edf2ef;
  border-radius: 15px;
  background: #fffdf8;
  padding: 12px;
}
.data-status-step.terminal {
  background: #f8fbf7;
  border-color: #cfe3d8;
}
.data-status-step-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.data-status-step-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e5f1eb;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}
.data-status-step-head strong {
  color: var(--ink);
  font-size: 12px;
}
.data-status-step > p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.data-status-step > em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.data-status-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.data-status-count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}
.data-status-count-row small,
.data-status-transition-list small {
  border: 1px solid #e3ece7;
  border-radius: 999px;
  background: white;
  color: var(--muted);
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 900;
}
.data-status-transition-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.data-status-transition-list span {
  border: 1px solid #dfe9e3;
  border-radius: 999px;
  background: #eef8f2;
  color: var(--green);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 900;
}
.data-status-pill-list,
.data-status-overlap-list {
  display: grid;
  gap: 9px;
}
.data-status-pill-list > div,
.data-status-overlap-list > div {
  display: grid;
  gap: 4px;
}
.data-status-pill-list small,
.data-status-pill-list em,
.data-status-overlap-list small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
.data-status-pill-list em {
  font-style: normal;
  overflow-wrap: anywhere;
}
.data-status-overlap-card {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.data-hierarchy-table-wrap {
  overflow: auto;
  border: 1px solid #dfe9e3;
  border-radius: 18px;
  background: white;
}
.data-hierarchy-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 12px;
}
.data-hierarchy-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8f7f1;
  color: #52685f;
  text-align: left;
  padding: 11px 12px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid #e4ebe6;
}
.data-hierarchy-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #eef2ef;
  vertical-align: top;
}
.data-hierarchy-table tr.not-loaded {
  background: #faf9f3;
  color: #738078;
}
.data-hierarchy-name {
  min-width: 280px;
}
.data-hierarchy-name-content {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding-left: calc(var(--depth, 0) * 22px);
}
.data-hierarchy-name strong {
  display: block;
  line-height: 1.25;
}
.data-hierarchy-continuation small {
  color: #7a8a82;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.data-expand-button,
.data-expand-spacer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 6px;
}
.data-expand-button {
  border: 1px solid #cfded6;
  background: white;
  color: var(--green);
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}
.data-expand-button:hover {
  border-color: var(--green);
  background: #eef8f2;
}
.data-expand-spacer {
  border: 1px solid transparent;
}
.data-artifact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.data-artifact-chip {
  border: 1px solid #dfe9e3;
  border-radius: 12px;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  padding: 7px 9px;
  text-align: left;
}
.data-artifact-chip:hover {
  border-color: var(--green);
  background: #f2fbf6;
}
.data-artifact-chip strong,
.data-artifact-chip small {
  display: block;
}
.data-artifact-chip strong {
  font-size: 11px;
}
.data-artifact-chip small,
.data-muted {
  color: var(--muted);
  font-size: 10px;
}
.data-artifact-extra-row td {
  border-top: 0;
  padding-top: 7px;
  background: #fcfbf6;
}
.data-artifact-extra-row .data-hierarchy-name strong {
  color: #52685f;
  font-weight: 700;
}
.data-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid #dfe9e3;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f7fbf8;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: help;
}
.data-status.not-yet-used,
.data-status.not-yet-inventoried,
.data-status.not-assessed-yet,
.data-status.source-package-only,
.data-status.reference-only {
  background: #fbf8f1;
  color: #8a5b21;
}
.data-status.partially-used,
.data-status.inspected-not-yet-exposed,
.data-status.inspected-preserved,
.data-status.candidate-metadata,
.data-status.assessed-not-modelled-yet {
  background: #fff7e7;
  color: #98641d;
}
.data-file-list {
  display: grid;
  gap: 10px;
}
.data-file-list article {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  border: 1px solid #e4ebe6;
  border-radius: 14px;
  background: #fffdf8;
  padding: 12px;
}
.data-file-list article.active {
  border-color: var(--green);
  background: #eef8f2;
  box-shadow: inset 4px 0 0 var(--green);
}
.data-file-select {
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}
.data-file-select:hover strong {
  color: var(--green);
}
.data-file-list strong,
.data-file-list small {
  display: block;
}
.data-file-list strong {
  font-size: 13px;
  line-height: 1.25;
}
.data-file-list small {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.data-file-list p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.data-file-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  flex: 0 0 auto;
}
.data-file-download {
  padding: 7px 10px;
  font-size: 11px;
}
.data-usage-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 10px;
}
.data-usage-head span {
  border: 1px solid #dfe9e3;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.data-usage-table td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.data-usage-table {
  min-width: 1360px;
}
.data-usage-panel .compare-table-wrap {
  max-height: min(60vh, 32rem);
}
.data-usage-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
}
.data-usage-table th,
.data-usage-table td {
  vertical-align: top;
}
.data-usage-table th:nth-child(1),
.data-usage-table td:nth-child(1) {
  width: 150px;
  white-space: normal;
}
.data-usage-table th:nth-child(2),
.data-usage-table td:nth-child(2) {
  width: 70px;
  white-space: nowrap;
  text-align: left;
  font-weight: 700;
}
.data-usage-table th:nth-child(3),
.data-usage-table td:nth-child(3) {
  width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  font-weight: 700;
}
.data-usage-table th:nth-child(4),
.data-usage-table td:nth-child(4) {
  width: 150px;
  white-space: normal;
  text-align: left;
  font-weight: 400;
}
.data-usage-table th:nth-child(5),
.data-usage-table td:nth-child(5) {
  width: 210px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  font-weight: 400;
}
.data-usage-table th:nth-child(6),
.data-usage-table td:nth-child(6) {
  width: 210px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  font-weight: 400;
}
.data-usage-table th:nth-child(7),
.data-usage-table td:nth-child(7) {
  width: 230px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  font-weight: 400;
}
.data-usage-table th:nth-child(8),
.data-usage-table td:nth-child(8) {
  width: 90px;
  white-space: nowrap;
  text-align: right;
  font-weight: 800;
}
.data-empty-card {
  border: 1px dashed #cfdcd4;
  border-radius: 16px;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  background: #fffdf8;
}
.profile-concept-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffefb;
  padding: 16px;
}
.profile-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.profile-section-head h3 {
  margin: 3px 0 0;
  font-family: "DM Serif Display", serif;
  font-size: 22px;
  font-weight: 400;
}
.profile-concept-graph {
  border: 1px solid #e4ebe6;
  border-radius: 14px;
  background: white;
  padding: 12px;
  margin-bottom: 12px;
}
.profile-graph-legend {
  display: grid;
  grid-template-columns: minmax(130px, .95fr) 54px 58px 48px minmax(150px, 1.2fr) 70px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 10px;
}
.profile-graph-legend-keys {
  grid-column: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}
.profile-graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #dce7e0;
  border-radius: 999px;
  background: #f8fbf8;
  color: var(--ink);
  white-space: nowrap;
}
.profile-graph-legend strong {
  grid-column: 6;
  justify-self: end;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}
.profile-graph-legend i {
  display: inline-block;
  border-radius: 999px;
}
.selected-key { width: 24px; height: 8px; background: var(--green); }
.median-key { width: 24px; height: 4px; background: var(--ink); }
.spending-profile .selected-key { background: var(--red); }
.profile-graph-header,
.profile-graph-axis {
  display: grid;
  grid-template-columns: minmax(130px, .95fr) 54px 58px 48px minmax(150px, 1.2fr) 70px;
  gap: 8px;
  align-items: end;
}
.profile-graph-header {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
  line-height: 1.15;
  text-transform: uppercase;
}
.profile-graph-header span:nth-child(2),
.profile-graph-header span:nth-child(3),
.profile-graph-header span:nth-child(4),
.profile-graph-header span:nth-child(6) {
  text-align: right;
}
.profile-graph-axis {
  margin: 0 0 10px;
  min-height: 18px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}
.profile-graph-axis-track {
  position: relative;
  height: 18px;
  border-bottom: 1px solid #dfe8e2;
}
.profile-graph-axis-track i {
  position: absolute;
  bottom: -2px;
  transform: translateX(-50%);
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}
.profile-graph-list { display: grid; gap: 8px; }
.profile-graph-detail {
  border-radius: 10px;
}
.profile-graph-detail[open] {
  margin: 2px 0 4px;
  padding: 8px;
  border: 1px solid rgba(20,107,76,.18);
  background: #f4faf6;
}
.spending-profile .profile-graph-detail[open] {
  border-color: rgba(172,79,61,.18);
  background: #fff8ef;
}
.profile-graph-row {
  display: grid;
  grid-template-columns: minmax(130px, .95fr) 54px 58px 48px minmax(150px, 1.2fr) 70px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  list-style: none;
  cursor: pointer;
}
.profile-graph-row::-webkit-details-marker { display: none; }
.profile-graph-label {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  font-weight: 800;
  line-height: 1.2;
}
.profile-graph-label::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--green);
  font-size: 11px;
  line-height: 1;
}
.profile-graph-detail[open] .profile-graph-label::before {
  content: "-";
}
.profile-graph-value,
.profile-graph-rank,
.profile-graph-money,
.profile-graph-delta {
  text-align: right;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.profile-graph-rank,
.profile-graph-money {
  color: var(--ink);
}
.profile-graph-track {
  position: relative;
  height: 13px;
  border-radius: 999px;
  background: #e2eee7;
  overflow: hidden;
}
.profile-graph-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--teal));
}
.profile-graph-median {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 0 0 2px rgba(255,255,255,.75);
}
.spending-profile .profile-graph-track { background: var(--gold-soft); }
.spending-profile .profile-graph-fill { background: linear-gradient(90deg, var(--red), var(--gold)); }
.profile-graph-source-panel {
  margin: 9px 0 0;
  padding: 11px 12px 9px;
  border: 1px solid #d8e7df;
  border-left: 4px solid var(--green);
  border-radius: 12px;
  background: #fffefb;
  box-shadow: 0 8px 22px rgba(33, 65, 48, .06);
}
.spending-profile .profile-graph-source-panel {
  border-color: #efd7c7;
  border-left-color: var(--red);
  background: #fffdf9;
}
.profile-graph-source-panel p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.profile-graph-source-panel .profile-peer-sentence {
  color: var(--muted);
  font-weight: 400;
}
.profile-graph-source-panel .compare-source-name {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.compare-source-name-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  min-width: 0;
  align-items: center;
  gap: 10px;
}
.compare-source-name-wrap .compare-source-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.compare-source-name-wrap > .line-provenance-button {
  justify-self: end;
}
.spending-profile .line-provenance-button,
.spending-compare .line-provenance-button {
  border-color: #ead9bb;
  background: #fff8eb;
  color: #94631b;
}
.profile-graph-source-panel .compare-source-share,
.profile-graph-source-panel .compare-source-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.profile-graph-source-panel .compare-source-stack {
  background: #e2eee7;
}
.profile-graph-source-panel .compare-source-stack i {
  background: var(--green);
}
.spending-profile .profile-graph-source-panel .compare-source-stack {
  background: var(--gold-soft);
}
.spending-profile .profile-graph-source-panel .compare-source-stack i {
  background: linear-gradient(90deg, var(--red), var(--gold));
}
.profile-concept-list { display: grid; gap: 9px; }
.profile-concept-card {
  border: 1px solid #e4ebe6;
  border-radius: 13px;
  background: white;
  overflow: hidden;
}
.profile-concept-card summary {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 86px 82px 88px minmax(120px, .9fr) 120px;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  list-style: none;
  cursor: pointer;
  font-size: 12px;
}
.profile-concept-card summary::-webkit-details-marker { display: none; }
.profile-concept-name { font-weight: 900; }
.profile-concept-rank,
.profile-concept-value,
.profile-concept-share,
.profile-concept-delta {
  text-align: right;
  color: var(--muted);
  font-size: 11px;
}
.profile-concept-rank strong,
.profile-concept-share strong { color: var(--ink); }
.profile-concept-value { color: var(--ink); font-weight: 800; }
.profile-concept-track {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: #e2eee7;
  overflow: hidden;
}
.profile-concept-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--teal));
}
.spending-profile .profile-concept-track { background: var(--gold-soft); }
.spending-profile .profile-concept-track i { background: linear-gradient(90deg, var(--red), var(--gold)); }
.profile-concept-detail {
  border-top: 1px solid #edf1ee;
  padding: 12px;
  background: rgba(248,247,241,.55);
}
.profile-concept-detail p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.profile-concept-detail .compare-source-name {
  font-size: 12px;
  line-height: 1.25;
}
.profile-peer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.profile-peer-stats span {
  border: 1px solid #dce4df;
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 11px;
  padding: 6px 9px;
}
.profile-peer-stats strong { color: var(--ink); }
.profile-empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
  font-size: 12px;
}

.matrix-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.matrix-summary-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.matrix-summary-row span:first-child {
  flex: 1 1 420px;
  line-height: 1.45;
}
.matrix-summary-row i {
  width: 17px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}
.matrix-revenue-key { background: var(--green); }
.matrix-spending-key { background: var(--red); }
.matrix-state-checks-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}
.matrix-state-checks-field > span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.matrix-state-dropdown-button {
  min-height: 38px;
  border: 1px solid #cfdcd4;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.matrix-state-dropdown-button:hover {
  border-color: rgba(20, 107, 76, .45);
}
.matrix-state-dropdown-button i {
  color: var(--green);
  font-style: normal;
  font-size: 10px;
}
.matrix-state-checks {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: min(260px, 90vw);
  max-height: 340px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px;
  border: 1px solid #cfdcd4;
  border-radius: 14px;
  background: white;
  box-shadow: 0 18px 42px rgba(32, 48, 39, .14);
}
.matrix-state-check {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 6px 8px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.matrix-state-check:hover {
  background: #f5f8f5;
}
.matrix-state-check input {
  accent-color: var(--green);
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}
.matrix-state-check span {
  display: inline-flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.matrix-state-check strong {
  font-size: 11px;
  letter-spacing: .02em;
}
.matrix-state-check small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.matrix-state-check.disabled-context {
  color: var(--muted);
  cursor: default;
  opacity: .7;
}
.matrix-state-check-all {
  background: #f0fbf5;
  color: var(--green-dark);
}
.matrix-table-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  overflow: auto;
  max-height: 72vh;
}
.matrix-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1480px;
  width: max-content;
  font-size: 11px;
}
.matrix-table th,
.matrix-table td {
  border-right: 1px solid #edf1ee;
  border-bottom: 1px solid #edf1ee;
}
.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8f7f1;
}
.matrix-table thead tr:nth-child(2) th { top: 34px; }
.matrix-jurisdiction-head,
.matrix-row-head {
  position: sticky;
  left: 0;
  z-index: 6;
  min-width: 210px;
  max-width: 210px;
  background: #fffefb;
}
.matrix-jurisdiction-head {
  z-index: 8 !important;
  background: #f8f7f1 !important;
}
.matrix-row-head button,
.matrix-jurisdiction-head button,
.matrix-concept-head button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font-weight: 900;
  font-size: 11px;
  padding: 9px 10px;
}
.matrix-row-head button {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.matrix-row-head button:hover,
.matrix-concept-head button:hover,
.matrix-jurisdiction-head button:hover {
  color: var(--green-dark);
  background: rgba(220,236,228,.5);
}
.matrix-group-head {
  text-align: left;
  padding: 9px 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 10px;
}
.matrix-group-head.revenue-head { color: var(--green-dark); }
.matrix-group-head.spending-head { color: #805412; }
.matrix-concept-head {
  min-width: 92px;
  max-width: 92px;
  vertical-align: bottom;
}
.matrix-concept-head button {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 8px 7px;
}
.matrix-concept-head span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 86px;
  line-height: 1.05;
}
.matrix-concept-head small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 8px;
}
.matrix-concept-head i {
  font-style: normal;
  color: var(--ink);
  font-size: 9px;
}
.matrix-jurisdiction-head.active,
.matrix-concept-head.active {
  background: #eef7f2 !important;
  box-shadow: inset 0 0 0 1px rgba(20,107,76,.28), inset 0 -3px 0 rgba(20,107,76,.5);
}
.matrix-concept-head.spending-head.active {
  background: #fff3ee !important;
  box-shadow: inset 0 0 0 1px rgba(172,79,61,.25), inset 0 -3px 0 rgba(172,79,61,.5);
}
.matrix-jurisdiction-head.active button,
.matrix-concept-head.active button {
  color: var(--green-dark);
}
.matrix-concept-head.spending-head.active button {
  color: #7b382d;
}
.matrix-sort-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  border-radius: 999px;
  border: 1px solid rgba(20,107,76,.3);
  background: rgba(255,255,255,.76);
  color: var(--green-dark) !important;
  font-style: normal;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .03em;
  line-height: 1.15;
  padding: 2px 5px;
  white-space: nowrap;
}
.matrix-concept-head.spending-head .matrix-sort-badge {
  border-color: rgba(172,79,61,.28);
  background: rgba(255,255,255,.78);
  color: #7b382d !important;
}
.matrix-table td {
  min-width: 92px;
  max-width: 92px;
  padding: 0;
  text-align: right;
  font-weight: 900;
  cursor: pointer;
}
.matrix-table td span {
  display: block;
  padding: 9px 7px;
}
.matrix-table td:hover {
  outline: 2px solid rgba(23,33,29,.35);
  outline-offset: -2px;
}
.matrix-table td.active-sort-cell {
  box-shadow: inset 2px 0 0 rgba(20,107,76,.22), inset -2px 0 0 rgba(20,107,76,.22);
  outline: 1px solid rgba(20,107,76,.12);
  outline-offset: -1px;
}
.matrix-table td.spending-heat.active-sort-cell {
  box-shadow: inset 2px 0 0 rgba(172,79,61,.24), inset -2px 0 0 rgba(172,79,61,.24);
  outline-color: rgba(172,79,61,.14);
}
.revenue-heat.heat-0 { background: #f7faf7; color: var(--muted); }
.revenue-heat.heat-1 { background: #dcece4; color: #174936; }
.revenue-heat.heat-2 { background: #acd1bf; color: #0d3f2d; }
.revenue-heat.heat-3 { background: #5b9d82; color: white; }
.revenue-heat.heat-4 { background: #146b4c; color: white; }
.spending-heat.heat-0 { background: #fff8ef; color: var(--muted); }
.spending-heat.heat-1 { background: #f4e7d2; color: #6d3a2e; }
.spending-heat.heat-2 { background: #e6c394; color: #613124; }
.spending-heat.heat-3 { background: #c78c35; color: #29180b; }
.spending-heat.heat-4 { background: #ac4f3d; color: white; }

.segmented {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  background: var(--surface-2);
  display: flex;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(20,30,25,.08); }

.legend { display: flex; gap: 15px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.legend i { width: 16px; height: 4px; border-radius: 2px; }
.baseline-key { background: #cbd4cd; }
.scenario-key { background: var(--green); }

.dual-fiscal-explorer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.fiscal-workspace-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.fiscal-column { border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-width: 0; }
.revenue-column { background: linear-gradient(180deg, rgba(220,236,228,.42), rgba(255,255,255,.55) 130px); }
.spending-column { background: linear-gradient(180deg, rgba(244,231,210,.42), rgba(255,255,255,.55) 130px); }
.fiscal-workspace-layout.no-income-analysis { grid-template-columns: minmax(0, 1fr); }
.fiscal-workspace-layout.no-income-analysis .income-tax-panel { display: none; }
.fiscal-column-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.fiscal-column-head h3 { font-family: "DM Serif Display", serif; font-size: 20px; font-weight: 400; margin: 0; }
.fiscal-column-head > strong { font-family: "DM Serif Display", serif; font-size: 23px; font-weight: 400; white-space: nowrap; }
.fiscal-column-summary { display: grid; justify-items: end; gap: 4px; }
.fiscal-column-summary strong { font-family: "DM Serif Display", serif; font-size: 23px; font-weight: 400; line-height: 1; white-space: nowrap; }
.fiscal-column-summary small { font-size: 11px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.fiscal-column-reset { padding: 4px 9px; font-size: 10px; }
.column-kicker { font-size: 20px !important; font-weight: 400 !important; letter-spacing: 0; text-transform: none; }
.revenue-kicker { color: var(--green); }
.spending-kicker { color: #99671d; }
.fiscal-tree { padding-top: 3px; }
.tree-group { border-bottom: 1px solid var(--line); }
.tree-row {
  display: grid;
  grid-template-columns: minmax(165px, 1fr) minmax(150px, .9fr) minmax(92px, auto) 30px;
  grid-template-areas:
    "label lever amount toggle"
    "label control amount toggle"
    "boundary boundary boundary boundary";
  align-items: center;
  column-gap: 11px;
  row-gap: 7px;
  min-height: 82px;
  padding: 7px 0;
}
.tree-row.child {
  min-height: 74px;
  grid-template-areas:
    "label lever amount toggle"
    "label control amount toggle"
    "boundary boundary boundary boundary";
  background: rgba(248,247,241,.75);
  margin: 0 -8px;
  padding: 0 8px;
  border-top: 1px solid #ecefe9;
}
.tree-label {
  grid-area: label;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  column-gap: 10px;
}
.tree-row.child .tree-label { padding-left: 12px; }
.tree-label-title, .tree-label > small { grid-column: 1; min-width: 0; }
.tree-label-title { grid-row: 1; }
.tree-label > .line-provenance-button {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: end;
}
.tree-label strong, .tree-label small { display: block; }
.tree-label-title { display: flex; align-items: center; gap: 6px; }
.tree-label strong { font-size: 13px; overflow-wrap: anywhere; }
.tree-label small { font-size: 10px; color: var(--muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
.line-provenance-button {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border: 1px solid #cfded6;
  border-radius: 999px;
  background: #f5fbf7;
  color: var(--green);
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 0 5px;
}
.line-provenance-button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}
.spending-column .line-provenance-button {
  border-color: #ead9bb;
  background: #fff8eb;
  color: #94631b;
}
.spending-column .line-provenance-button:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}
.bracket-remove-button, .bracket-add-button, .spending-line-remove-button {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}
.bracket-remove-button:hover, .spending-line-remove-button:hover { background: #f6e7e3; }
.spending-line-edit-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  background: var(--gold-soft);
  color: #805412;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 6px;
}
.spending-line-edit-button:hover { background: #f1ddbb; }
.bracket-add-button {
  color: var(--green);
  font-size: 14px;
}
.bracket-add-button:hover { background: var(--green-soft); }
.bar-track { grid-area: lever; height: 8px; background: #e8ece8; border-radius: 8px; position: relative; overflow: hidden; }
.bar-baseline, .bar-scenario { position: absolute; left: 0; border-radius: 8px; }
.bar-baseline { top: 0; height: 8px; background: #cbd4cd; }
.bar-scenario { top: 2px; height: 4px; background: var(--green); }
.contribution-track { overflow: visible; margin-top: 13px; height: 10px; background: var(--green-soft); }
.bar-contribution { position: absolute; top: 0; height: 10px; background: var(--green); }
.spending-contribution-track { background: var(--gold-soft); }
.spending-contribution-track .bar-contribution { background: var(--gold); }
.contribution-label {
  position: absolute;
  bottom: 13px;
  min-width: 34px;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  transform: translateX(0);
}
.spending-column .bar-scenario { background: var(--gold); }
.informational-bar { background: repeating-linear-gradient(90deg, #e4e8e4 0 8px, transparent 8px 13px); }
.tree-amount { grid-area: amount; text-align: right; }
.tree-amount strong, .tree-amount small { display: block; }
.tree-amount strong { font-size: 13px; }
.tree-amount small { font-size: 10px; color: var(--green); margin-top: 2px; }
.tree-amount .rate-readout { font-size: 13px; font-weight: 800; line-height: 1.25; }
.tree-amount .rate-readout span { display: block; white-space: nowrap; }
.tree-amount .change-positive { color: #116b46 !important; font-weight: 800; }
.tree-amount .change-negative { color: #8f2638 !important; font-weight: 800; }
.tree-amount .change-neutral { color: var(--muted) !important; font-weight: 700; }
.spending-column .tree-amount small { color: #94631b; }
.tree-toggle { grid-area: toggle; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); }
.tree-toggle:hover { background: var(--green-soft); color: var(--green); }
.tree-children[hidden] { display: none; }
.lever-control { grid-area: control; display: grid; grid-template-columns: 27px minmax(74px, 1fr) 27px auto; align-items: center; gap: 7px; }
.lever-button { width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; font-size: 16px; line-height: 1; display: grid; place-items: center; }
.lever-button:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.spending-column .lever-button:hover { border-color: var(--gold); color: #805412; background: var(--gold-soft); }
.row-reset-button {
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  padding: 0 7px;
}
.row-reset-button:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.spending-column .row-reset-button:hover { border-color: var(--gold); color: #805412; background: var(--gold-soft); }
.lever-value-wrap {
  min-width: 0;
  height: 27px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}
.lever-value-wrap span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 0 7px;
}
.lever-value-input {
  width: 100%;
  min-height: 0;
  height: 25px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0 6px;
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}
.lever-value-input:focus { outline: 0; box-shadow: inset 0 0 0 2px rgba(20,107,76,.16); }
.lever-value-input::-webkit-outer-spin-button,
.lever-value-input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.boundary-slider {
  grid-area: boundary;
  display: block;
  align-items: center;
  padding: 0 0 7px;
}
.boundary-readouts {
  display: flex;
  align-items: center;
  gap: 10px;
}
.boundary-readout {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.boundary-readout small { text-transform: uppercase; letter-spacing: .06em; }
.boundary-input-wrap {
  display: inline-flex;
  align-items: center;
  width: 84px;
  height: 27px;
  overflow: hidden;
  border: 1px solid #b9c4dd;
  border-radius: 6px;
  background: white;
}
.boundary-input-wrap i { padding-left: 7px; color: var(--muted); font-style: normal; font-size: 11px; }
.boundary-value-input {
  width: 100%;
  min-height: 25px !important;
  height: 25px;
  padding: 1px 4px 1px 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .01em;
  text-align: right;
}
.boundary-arrow {
  width: 18px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  background: #e8ecf7;
  color: #4f608f;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.boundary-arrow:hover { background: #d6ddef; }
.open-ended { color: var(--muted); font-size: 10px; font-weight: 700; }
.custom-line-button { margin-top: 3px; }
.explorer-balance { margin: 0 0 12px; border-radius: 12px; padding: 7px 12px; background: var(--ink); color: white; display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; gap: 14px; align-items: center; }
.explorer-balance > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.explorer-balance span, .explorer-balance small { color: rgba(255,255,255,.68); font-size: 11px; }
.explorer-balance strong { display: block; font-family: "DM Serif Display", serif; font-size: 19px; font-weight: 400; margin-top: 0; }
.explorer-balance strong.change-positive { color: #8ee0b9; }
.explorer-balance strong.change-negative { color: #f0a5ad; }
.explorer-balance strong.change-neutral { color: rgba(255,255,255,.82); }
.balance-track { height: 6px; position: relative; background: linear-gradient(90deg, #a94e3d 0 50%, #25745a 50% 100%); border-radius: 8px; opacity: .9; }
.balance-zero { position: absolute; width: 2px; height: 14px; background: white; left: 50%; top: -4px; }
.balance-marker { position: absolute; width: 12px; height: 12px; border: 2px solid white; background: var(--ink); border-radius: 50%; top: -3px; transform: translateX(-50%); left: 35%; transition: left .2s ease; }

.text-button {
  border: 0;
  background: none;
  padding: 17px 0 0;
  color: var(--green);
  cursor: pointer;
  font-weight: 700;
}
.text-button span:first-child { display: inline-grid; width: 22px; height: 22px; place-items: center; border: 1px solid #a6c5b8; border-radius: 7px; margin-right: 7px; }

.scenario-panel { background: #fbfaf5; }
.scenario-head { margin-bottom: 14px; }
.more-button { letter-spacing: 2px; color: var(--muted); font-weight: 700; padding: 6px; }
.scenario-menu-wrap { position: relative; }
.scenario-menu { position: absolute; right: 0; top: 32px; z-index: 6; width: 210px; background: white; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 14px 36px rgba(20,35,27,.16); padding: 6px; }
.scenario-menu button { width: 100%; border: 0; background: transparent; border-radius: 7px; padding: 9px 10px; text-align: left; cursor: pointer; font-size: 12px; }
.scenario-menu button:hover { background: var(--surface-2); color: var(--green); }
.scenario-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.scenario-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 9px 0 11px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.scenario-tabs button.active { color: var(--ink); border-bottom-color: var(--green); }
.scenario-tabs span { padding: 2px 6px; border-radius: 10px; background: #e6e8e3; font-size: 10px; margin-left: 3px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.policy-card {
  border: 1px solid var(--line);
  background: white;
  border-radius: 13px;
  padding: 16px;
  margin-bottom: 12px;
}
.policy-top { display: flex; justify-content: space-between; gap: 12px; }
.policy-top p { color: var(--muted); font-size: 12px; line-height: 1.45; margin-bottom: 0; }
.type-tag { display: inline-block; margin-bottom: 9px; }
.type-tag.spend { background: var(--gold-soft); color: #855f27; }
.type-tag.tax { background: var(--green-soft); color: var(--green); }
.type-tag.evidence { background: #dfe8f2; color: var(--blue); }
.type-tag.custom { background: #eee5f1; color: #7d5385; }
.policy-cost { text-align: right; white-space: nowrap; }
.policy-cost strong, .policy-cost small { display: block; }
.policy-cost strong { font-size: 15px; }
.policy-cost small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.policy-meta { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.policy-impact { margin-top: 13px; padding: 10px 11px; border-radius: 9px; background: #eef4f0; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: center; }
.policy-impact span { color: var(--muted); font-size: 10px; }
.policy-impact strong { color: var(--green-dark); font-size: 12px; }
.policy-impact .link-button { grid-column: 1 / -1; width: max-content; padding: 2px 0 0; }
.remove-policy { border: 0; background: none; color: var(--red); cursor: pointer; font-weight: 700; font-size: 10px; padding: 0; }
.policy-actions { display: flex; align-items: center; gap: 14px; }
.edit-policy { border: 0; background: none; color: var(--green); cursor: pointer; font-weight: 700; font-size: 10px; padding: 0; }

.add-policy-card {
  width: 100%;
  min-height: 76px;
  border: 1px dashed #b6c4bb;
  border-radius: 13px;
  background: rgba(255,255,255,.55);
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  text-align: left;
  column-gap: 11px;
  align-items: center;
  padding: 13px 16px;
}
.add-policy-card > span { grid-row: 1 / 3; width: 32px; height: 32px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); border-radius: 9px; font-size: 20px; }
.add-policy-card strong { align-self: end; }
.add-policy-card small { align-self: start; color: var(--muted); }
.import-scenario-card { margin-top: 10px; }
.import-scenario-card > span { background: #e8ecf7; color: #53638d; }
.import-filters { display: grid; grid-template-columns: .8fr 1.2fr; gap: 14px; }
.import-help { margin: 14px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.import-scenario-list { display: grid; gap: 10px; max-height: 360px; overflow-y: auto; }
.import-scenario-item { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: white; }
.import-scenario-item h3 { margin: 3px 0; font-size: 16px; }
.import-scenario-item p { margin: 0; color: var(--muted); font-size: 11px; }
.import-scenario-item small { color: var(--green); font-weight: 700; }
.import-empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }

.assumption-card { border: 1px solid var(--line); border-radius: 13px; padding: 16px; margin-bottom: 12px; background: white; }
.assumption-card p { color: var(--muted); font-size: 12px; margin-bottom: 14px; line-height: 1.45; }
.range-label > span { display: block; color: var(--muted); font-size: 11px; text-transform: none; letter-spacing: 0; margin-bottom: 7px; }
.range-label strong { color: var(--ink); }
input[type="range"] { padding: 0; min-height: auto; accent-color: var(--green); border: 0; box-shadow: none; }
.confidence-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); font-size: 10px; }
.custom-impact-head { display: flex; justify-content: space-between; gap: 14px; }
.impact-remove { width: 28px; height: 28px; border: 1px solid #e0c8c2; border-radius: 8px; background: #fff; color: var(--red); cursor: pointer; font-size: 17px; line-height: 1; }
.impact-remove:hover { background: #f7ebe8; }
.impact-adjuster { display: grid; grid-template-columns: 30px 1fr 30px; gap: 8px; align-items: center; }
.impact-adjuster input { min-height: 24px; }
.impact-step { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; font-size: 16px; }
.impact-step:hover { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.impact-add-card { margin-top: 3px; }
#impactNote { min-height: 90px; padding: 12px; resize: vertical; }
.notes-field textarea { min-height: 260px; padding: 12px; resize: vertical; line-height: 1.55; }

.outlook-panel { padding-bottom: 20px; }
.outlook-controls { display: flex; gap: 7px; }
.chip { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 7px 11px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.chip.active { background: var(--green-soft); border-color: #a8c8ba; color: var(--green-dark); }
.chart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; }
.chart-wrap { min-height: 280px; overflow: hidden; }
#outlookChart { width: 100%; height: 280px; overflow: visible; }
.impact-summary { border-left: 1px solid var(--line); padding: 10px 0 0 24px; }
.impact-row { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.impact-row span { color: var(--muted); font-size: 12px; }
.impact-row strong { font-size: 13px; text-align: right; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.path-rationale { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 12px; }
.rationale-intro h3 { font-family: "DM Serif Display", serif; font-size: 20px; font-weight: 400; margin: 0 0 5px; }
.rationale-intro p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
.rationale-card { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: var(--surface-2); }
.rationale-card span, .rationale-card small { display: block; color: var(--muted); font-size: 10px; }
.rationale-card strong { display: block; margin: 5px 0; font-size: 14px; }
.add-bracket-row { width: calc(100% + 16px); margin: 0 -8px; border: 0; border-top: 1px dashed #c8d1ca; background: rgba(255,255,255,.65); color: var(--green); padding: 11px 20px; text-align: left; cursor: pointer; font-size: 11px; font-weight: 700; }
.rate-readout { color: var(--green-dark) !important; }

.modal {
  width: min(620px, calc(100vw - 30px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 35px 90px rgba(13, 26, 20, .3);
  background: var(--surface);
}
.policy-modal { width: min(820px, calc(100vw - 30px)); }
.modal::backdrop { background: rgba(14, 25, 20, .48); backdrop-filter: blur(4px); }
.modal form { padding: 26px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.close-button, .drawer-close { font-size: 28px; color: var(--muted); line-height: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.full-field { grid-column: 1 / -1; }
.nested-form-grid { width: 100%; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.4; }
.policy-type-fields[hidden] { display: none; }
.cost-calculator-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cost-calculator-row .button { padding: 9px 12px; }
.cost-calculator-row small { color: var(--muted); font-size: 11px; line-height: 1.4; flex: 1 1 220px; }
.description-with-tools { position: relative; }
.description-with-tools textarea { min-height: 190px; padding-right: 54px; resize: vertical; line-height: 1.5; }
.dictation-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--green);
  cursor: pointer;
}
.dictation-button:hover,
.dictation-button.listening {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}
.dictation-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.input-prefix, .input-suffix { display: flex; border: 1px solid var(--line); border-radius: 9px; align-items: center; overflow: hidden; background: white; }
.input-prefix input, .input-suffix input { border: 0; border-radius: 0; box-shadow: none; }

.income-tax-panel { min-width: 0; border: 1px solid #cddbd3; border-radius: 13px; background: rgba(255,255,255,.72); padding: 17px; position: static; top: 12px; }
.income-tax-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.income-tax-head h3 { margin: 3px 0 4px; font-family: "DM Serif Display", serif; font-size: 23px; font-weight: 400; }
.income-tax-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.income-tax-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.income-tax-year-field { display: grid; gap: 4px; max-width: 150px; }
.income-tax-year-row { display: flex; align-items: center; gap: 8px; max-width: none; }
.income-tax-year-field span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.income-tax-year-field select { width: auto; min-width: 92px; min-height: 32px; padding: 6px 28px 6px 10px; border: 1px solid var(--line); border-radius: 10px; background-color: var(--surface); font-size: 12px; font-weight: 700; }
.income-tax-note { max-width: 96%; }
.income-chart-legend { display: flex; flex-wrap: wrap; gap: 7px 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.income-chart-toggle { display: flex; align-items: center; gap: 7px; border: 1px solid #d8e3dd; background: rgba(255,255,255,.78); color: var(--muted); border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 800; line-height: 1; cursor: pointer; }
.income-chart-toggle.active { color: var(--ink); border-color: #b8cec3; background: #f6fbf8; }
.income-chart-toggle:not(.active) { opacity: .56; }
.income-chart-toggle i { display: inline-block; width: 18px; height: 7px; border-radius: 6px; }
.tax-amount-key { background: var(--green); }
.tax-baseline-key { background: #8ba79a; }
.income-earned-key { background: #3568a8; }
.population-share-key { background: #bd7b32; }
.income-chart-wrap { width: 100%; overflow: visible; }
#incomeTaxChart { width: 100%; min-width: 0; display: block; }
.chart-footnote { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.chart-footnote a { color: var(--green); font-weight: 700; }
.tax-chart-grid { stroke: #dce4df; stroke-width: 1; }
.tax-chart-band-guide { stroke: #eef3ef; stroke-width: 1; stroke-dasharray: 3 6; }
.tax-chart-axis { fill: var(--muted); font-size: 13px; font-weight: 700; font-family: "DM Sans", sans-serif; }
.tax-chart-axis-title { font-size: 15px; font-weight: 800; }
.tax-chart-band-label { font-size: 13px; }
.tax-chart-baseline-line { fill: none; stroke: #8ba79a; stroke-width: 3; stroke-dasharray: 7 6; }
.tax-chart-baseline-dot { fill: white; stroke: #8ba79a; stroke-width: 3; }
.tax-chart-paid-line { fill: none; stroke: var(--green); stroke-width: 3.5; }
.tax-chart-paid-dot { fill: white; stroke: var(--green); stroke-width: 3.5; }
.tax-chart-income-line { fill: none; stroke: #3568a8; stroke-width: 3.2; stroke-dasharray: 2 5; }
.tax-chart-income-dot { fill: white; stroke: #3568a8; stroke-width: 3.2; }
.tax-chart-population-line { fill: none; stroke: #bd7b32; stroke-width: 3; stroke-dasharray: 6 5; }
.tax-chart-population-dot { fill: white; stroke: #bd7b32; stroke-width: 3; }
.tax-chart-value { fill: var(--ink); font-size: 12px; font-weight: 800; font-family: "DM Sans", sans-serif; text-anchor: middle; }
.tax-chart-population-value { fill: #9b5d1d; font-size: 11px; font-weight: 800; font-family: "DM Sans", sans-serif; text-anchor: middle; }
.tax-chart-placeholder-title { fill: var(--ink); font-size: 21px; font-family: "DM Serif Display", serif; }
.tax-chart-placeholder { fill: var(--muted); font-size: 14px; font-family: "DM Sans", sans-serif; }
.income-band-table-wrap { overflow-x: visible; margin-top: 8px; border-top: 1px solid var(--line); }
.income-band-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
.income-band-table th { color: var(--muted); text-align: right; padding: 9px 4px 7px; white-space: normal; line-height: 1.08; font-size: 9px; text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.income-band-table th:first-child, .income-band-table td:first-child { text-align: left; }
.income-band-table td { text-align: right; padding: 7px 4px; border-top: 1px solid #edf1ee; white-space: normal; overflow-wrap: anywhere; }
.income-band-table td:last-child { font-weight: 700; color: var(--green); }
.income-band-total-row td { border-top: 2px solid #d8e5dd; font-weight: 800; background: rgba(239, 247, 243, .72); }
.income-band-total-row td:last-child { color: var(--green); }
.income-band-table td.missing-tax-data,
.income-band-table td:last-child.missing-tax-data { color: var(--muted); font-weight: 500; }
.income-band-table th:nth-child(1), .income-band-table td:nth-child(1) { width: 15%; }
.income-band-table th:nth-child(2), .income-band-table td:nth-child(2) { width: 12%; }
.income-band-table th:nth-child(3), .income-band-table td:nth-child(3) { width: 10%; }
.income-band-table th:nth-child(4), .income-band-table td:nth-child(4) { width: 12%; }
.income-band-table th:nth-child(5), .income-band-table td:nth-child(5) { width: 12%; }
.income-band-table th:nth-child(6), .income-band-table td:nth-child(6) { width: 14%; }
.income-band-table th:nth-child(7), .income-band-table td:nth-child(7) { width: 11%; }
.income-band-table th:nth-child(8), .income-band-table td:nth-child(8) { width: 14%; }
.empty-tax-table { color: var(--muted); text-align: left !important; line-height: 1.45; padding: 14px 5px !important; }
.input-prefix i, .input-suffix i { font-style: normal; color: var(--muted); font-size: 12px; padding: 0 11px; }
.input-prefix i { border-right: 1px solid var(--line); }
.input-suffix i { border-left: 1px solid var(--line); white-space: nowrap; }
.data-callout { display: flex; gap: 11px; background: #eef4f0; border-radius: 12px; padding: 14px; margin-top: 18px; color: var(--green-dark); }
.data-callout svg { flex: 0 0 auto; margin-top: 1px; }
.data-callout strong { font-size: 12px; }
.data-callout p { color: #557165; font-size: 11px; line-height: 1.45; margin: 4px 0 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.small-modal { width: min(480px, calc(100vw - 30px)); }
.modal-copy { color: var(--muted); line-height: 1.5; margin: 0 0 14px; }
.full-field textarea { min-height: 78px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.confirm-copy { color: var(--muted); line-height: 1.6; margin: 0; }
.auth-option-list { display: grid; gap: 10px; }
.auth-mode-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefb;
  padding: 13px;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, opacity .16s ease;
}
.auth-mode-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
}
.auth-mode-head {
  display: flex;
  align-items: center;
  gap: 11px;
}
.auth-mode-number {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #d9e4dd;
  color: #577064;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}
.auth-mode-card:not(.is-active) .auth-mode-number {
  background: #edf3ef;
  color: #7d9087;
  transform: scale(.9);
}
.auth-mode-current {
  margin-left: auto;
  border-radius: 999px;
  background: #e5f3eb;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 5px 8px;
  text-transform: uppercase;
}
.auth-mode-card.is-focused {
  cursor: default;
  box-shadow: 0 10px 24px rgba(15, 42, 32, .08);
  transform: translateY(-1px);
}
.auth-mode-card.is-compact {
  gap: 4px;
  opacity: .86;
  padding: 10px 13px;
}
.auth-mode-card.is-compact:hover {
  border-color: #b7dac7;
  box-shadow: 0 6px 16px rgba(15, 42, 32, .07);
  opacity: 1;
  transform: translateY(-1px);
}
.auth-mode-card.is-compact p,
.auth-mode-card.is-compact .auth-current-detail,
.auth-mode-card.is-compact .auth-mode-action,
.auth-mode-card.is-compact .anonymous-recovery-details,
.auth-mode-card.is-compact .recover-profile-box,
.auth-mode-card.is-compact #googleLoginStatus {
  display: none;
}
.auth-mode-title {
  display: grid;
  gap: 1px;
}
.auth-mode-title span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-mode-title strong {
  color: var(--ink);
  font-size: 16px;
}
.auth-current-detail {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  margin-left: 49px;
}
.auth-option {
  width: fit-content;
  min-width: 205px;
  border-color: #b8cfc4;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 42, 32, .04);
  color: var(--ink);
  font-weight: 850;
}
.auth-option:hover {
  border-color: var(--green);
  background: #f7fcf9;
  color: var(--green-dark);
}
.auth-mode-action {
  margin-left: 49px;
  padding: 10px 16px;
}
.auth-option span {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}
.auth-anonymous-option {
  display: grid;
  gap: 9px;
}
.credential-preview {
  border: 1px dashed var(--line);
  color: var(--muted);
  background: #fffdf8;
}
.credential-preview small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.auth-mode-card.is-active {
  border-color: #b7dac7;
  background: #f2fbf5;
  box-shadow: inset 0 0 0 1px rgba(18, 111, 80, .08);
}
.auth-mode-card.is-active .auth-mode-number {
  background: var(--green-dark);
  color: #fff;
}
.auth-mode-card.is-active .auth-mode-title span,
.auth-mode-card.is-active .auth-mode-title strong {
  color: var(--green-dark);
}
.anonymous-recovery-details {
  display: grid;
  gap: 7px;
  border: 1px solid #c8dfd2;
  border-radius: 13px;
  background: #f2fbf5;
  color: var(--green-dark);
  padding: 12px;
}
.auth-anonymous-recovery {
  border-color: #b7dac7;
  margin: -1px 0 5px;
}
.anonymous-recovery-details span,
.anonymous-recovery-details code {
  overflow-wrap: anywhere;
}
.anonymous-recovery-details p {
  color: #496a5c;
  font-size: 11px;
  line-height: 1.4;
  margin: 3px 0 0;
}
.recover-profile-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  margin: 3px 0 0;
  padding: 12px;
  background: white;
}
.recover-profile-box legend {
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 0 5px;
  text-transform: uppercase;
}
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0 0;
}
.auth-result { min-height: 18px; color: var(--muted); font-size: 12px; line-height: 1.4; margin: 0; }
.text-button {
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:hover { color: var(--green-dark); }
.privacy-copy {
  display: grid;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.privacy-copy section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.privacy-copy section:first-child {
  border-top: 0;
  padding-top: 0;
}
.privacy-copy h3 {
  color: var(--ink);
  font-size: 14px;
  margin: 0 0 4px;
}
.privacy-copy p { margin: 0; }
.privacy-copy p + p { margin-top: 8px; }

.policy-forum-panel {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
}
.forum-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.forum-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #fff, #f8fbf8);
  color: var(--muted);
  font-size: 12px;
}
.forum-policy-meta,
.forum-policy-details {
  color: var(--muted);
  font-size: 12px;
}
.forum-summary strong {
  margin-right: 4px;
  font-size: 13px;
  color: var(--ink);
}
.policy-forum-list { display: grid; gap: 8px; }
.forum-policy-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 82px;
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 10px;
  background: var(--surface);
}
.forum-policy-rank {
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eef6f2;
  color: var(--green);
  font-weight: 800;
  font-size: 13px;
}
.forum-policy-main { min-width: 0; }
.forum-policy-copy {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(680px, .9fr) 44px;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.forum-policy-text {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}
.forum-policy-text h3 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
}
.forum-policy-text p {
  min-width: 0;
  margin: 0;
  color: #43554d;
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forum-policy-score {
  color: var(--green);
  font-size: 18px;
  line-height: 1;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}
.forum-policy-tags {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  justify-self: end;
  width: min(760px, 100%);
  min-width: 0;
}
.forum-policy-tag-lines {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.forum-policy-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 5px;
  align-items: center;
}
.forum-policy-tags > .type-tag,
.forum-policy-tag-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: #fbfdfb;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.forum-policy-tags > .type-tag {
  margin-bottom: 0;
  min-width: 58px;
  text-align: center;
}
.forum-policy-tags > .type-tag.spend {
  background: var(--gold-soft);
  color: #855f27;
}
.forum-policy-tags > .type-tag.tax {
  background: var(--green-soft);
  color: var(--green);
}
.forum-vote-box {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 5px;
  align-content: center;
  justify-items: center;
  border-left: 1px solid var(--line);
  padding-left: 8px;
}
.forum-vote-box button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--green);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.forum-vote-box button[data-vote-value="-1"] { color: var(--red); }
.forum-vote-box button.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.forum-vote-box button[data-vote-value="-1"].active {
  background: var(--red);
  border-color: var(--red);
}
.forum-vote-box strong {
  justify-self: start;
  align-self: center;
  font-size: 14px;
}
.forum-empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 28px;
  color: var(--muted);
  background: #fbfdfb;
}

.drawer {
  position: fixed;
  z-index: 31;
  top: 0;
  right: 0;
  width: min(480px, 92vw);
  height: 100vh;
  background: var(--surface);
  box-shadow: -20px 0 60px rgba(15, 30, 23, .18);
  transform: translateX(105%);
  transition: transform .28s ease;
  padding: 34px;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-close { position: absolute; right: 24px; top: 22px; }
.drawer h2 { font-size: 32px; margin-bottom: 12px; }
.drawer p { color: var(--muted); line-height: 1.65; }
.drawer-section { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 22px; }
.drawer-section h3 { font-family: "DM Serif Display", serif; font-size: 20px; font-weight: 400; }
.drawer-subhead { margin: 14px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.drawer:has(.line-provenance-panel) {
  width: min(620px, 96vw);
  padding: 24px;
}
.drawer:has(.line-provenance-panel) h2 {
  font-size: 26px;
  line-height: 1.05;
  margin-bottom: 7px;
}
.drawer:has(.line-provenance-panel) p {
  line-height: 1.4;
}
.line-provenance-panel h2 { overflow-wrap: anywhere; }
.line-provenance-panel > p {
  margin: 0 0 10px;
  font-size: 12px;
}
.line-provenance-panel .drawer-section {
  margin-top: 12px;
  padding-top: 12px;
}
.line-provenance-panel .drawer-section h3 {
  font-size: 17px;
  margin-bottom: 5px;
}
.line-provenance-panel .detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
}
.line-provenance-panel .detail-list li {
  gap: 10px;
  padding: 6px 0;
}
.line-provenance-record .detail-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.line-provenance-record {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefb;
  padding: 10px 12px;
  margin-top: 8px;
}
.line-provenance-record header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.line-provenance-record header strong {
  color: var(--ink);
  font-size: 13px;
}
.source-url-link,
.source-artifact-link {
  color: var(--green);
  overflow-wrap: anywhere;
}
.source-artifact-path,
.source-locator {
  margin: 5px 0 7px;
  border: 1px solid #dfe9e4;
  border-radius: 10px;
  background: #f7fbf8;
  color: #42584f !important;
  font-size: 11px;
  line-height: 1.35 !important;
  padding: 7px 9px;
}
.source-locator {
  font-weight: 800;
}
.provenance-quality-pill {
  border: 1px solid #cfe3d8;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .03em;
  padding: 4px 8px;
  text-transform: uppercase;
  white-space: nowrap;
}
.source-links { margin: 0; padding-left: 18px; }
.source-links li { margin: 9px 0; }
.source-links a { color: var(--green); font-weight: 700; }
.detail-list { padding: 0; list-style: none; }
.detail-list li { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 11px 0; font-size: 12px; }
.compact-list li { padding: 6px 0; }
.detail-list span { color: var(--muted); }
.version-list li {
  align-items: flex-start;
}
.version-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.version-scenario {
  color: var(--ink);
  font-size: 13px;
}
.version-checkpoint b {
  color: var(--ink);
}
.version-scope,
.version-description {
  line-height: 1.35;
}
.version-description {
  color: var(--green-dark);
}
.version-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.form-error {
  margin: -4px 0 2px;
  color: var(--maroon);
  font-size: 12px;
  font-weight: 700;
}
.version-list button {
  width: auto;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}
.version-list button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}
.version-list button.danger {
  color: var(--maroon);
}
.version-list button.danger:hover {
  border-color: var(--maroon);
  background: #fff4ef;
}
.scrim { position: fixed; inset: 0; background: rgba(15, 26, 21, .32); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.open { opacity: 1; pointer-events: auto; }

.toast {
  position: fixed;
  z-index: 40;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: white;
  padding: 11px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
  font-size: 12px;
  box-shadow: 0 12px 35px rgba(12, 24, 18, .25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1050px) {
  .context-bar { grid-template-columns: repeat(3, 1fr); }
  .source-status { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; }
  .headline-grid { grid-template-columns: repeat(2, 1fr); }
  .studio-grid { grid-template-columns: 1fr; }
  .compare-controls { grid-template-columns: repeat(2, 1fr); }
  .compare-layout { grid-template-columns: 1fr; }
  .mapping-editor { position: static; }
  .profile-controls { grid-template-columns: repeat(2, 1fr); }
  .profile-summary-grid, .profile-sections { grid-template-columns: 1fr; }
  .data-status-path-grid,
  .data-status-level-headings,
  .data-status-stage-row,
  .data-status-overlap-card {
    grid-template-columns: 1fr;
  }
  .forum-policy-card { grid-template-columns: 44px minmax(0, 1fr); }
  .forum-policy-copy {
    grid-template-columns: 1fr auto;
  }
  .forum-policy-score {
    grid-column: 2;
    grid-row: 1;
  }
  .forum-policy-text {
    display: block;
  }
  .forum-policy-text p {
    margin-top: 4px;
  }
  .forum-policy-tags {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
  }
  .forum-policy-tag-row.detail-tags {
    padding-left: 0;
  }
  .forum-vote-box {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, auto);
    justify-content: start;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }
  .profile-concept-card summary {
    grid-template-columns: minmax(180px, 1fr) 82px 82px 86px;
  }
  .profile-concept-track, .profile-concept-delta { grid-column: 1 / -1; }
  .dual-fiscal-explorer { grid-template-columns: 1fr; }
  .income-tax-panel { position: static; }
  .chart-layout { grid-template-columns: 1fr; }
  .impact-summary { border-left: 0; border-top: 1px solid var(--line); padding: 22px 0 0; }
  .path-rationale { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1280px) {
  .fiscal-workspace-layout:not(.no-income-analysis) {
    grid-template-columns: minmax(500px, 600px) minmax(780px, 1fr);
    gap: 16px;
  }
  .fiscal-workspace-layout:not(.no-income-analysis) .income-tax-panel {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 92px);
    overflow: auto;
  }
}

@media (min-width: 1760px) {
  .fiscal-workspace-layout:not(.no-income-analysis) {
    grid-template-columns: minmax(560px, 680px) minmax(900px, 1fr);
    gap: 18px;
  }
}

@media (max-width: 720px) {
  #dataView { padding-left: 0; padding-right: 0; }
  .topbar { grid-template-columns: 1fr auto; padding: 0 18px; }
  .main-nav, .save-state, .icon-button { display: none; }
  .reset-button { padding: 0 9px; font-size: 11px; }
  main { margin: 0 14px; padding-top: 25px; }
  .workspace-head { align-items: flex-start; flex-direction: column; }
  .workspace-actions { justify-items: stretch; width: 100%; }
  .workspace-action-buttons { width: 100%; }
  .workspace-action-buttons .button { flex: 1; }
  .title-row { align-items: flex-start; flex-direction: column; gap: 5px; }
  .context-bar, .headline-grid { grid-template-columns: 1fr; }
  .compare-controls, .compare-summary-grid { grid-template-columns: 1fr; }
  .forum-policy-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .forum-policy-rank {
    width: max-content;
    padding: 8px 12px;
  }
  .compare-bar-header {
    grid-template-columns: 22px 1fr 72px 72px;
  }
  .compare-bar-header span:nth-child(5) { display: none; }
  .compare-bar-row { grid-template-columns: 22px 1fr 72px 72px; }
  .compare-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .compare-bar-sources { margin-left: 0; }
  .compare-source-item { grid-template-columns: 1fr 56px 74px 58px; }
  .compare-source-stack { grid-column: 1 / -1; }
  .compare-source-code-wrap { grid-column: 1 / -1; }
  .compare-source-value, .compare-source-share { text-align: left; }
  .profile-controls, .profile-summary-grid, .profile-sections { grid-template-columns: 1fr; }
  .profile-concept-card summary { grid-template-columns: 1fr 76px; }
  .profile-concept-value,
  .profile-concept-share,
  .profile-concept-track,
  .profile-concept-delta {
    grid-column: 1 / -1;
    text-align: left;
  }
  .profile-graph-row {
    grid-template-columns: 1fr 44px 54px 48px;
  }
  .profile-graph-header,
  .profile-graph-axis { display: none; }
  .profile-graph-legend {
    display: flex;
    flex-wrap: wrap;
  }
  .profile-graph-legend-keys {
    display: flex;
    grid-column: auto;
  }
  .profile-graph-track,
  .profile-graph-delta {
    grid-column: 1 / -1;
    text-align: left;
  }
  .profile-graph-legend strong {
    margin-left: 0;
    text-align: left;
  }
  .matrix-table { min-width: 1200px; }
  .matrix-jurisdiction-head,
  .matrix-row-head {
    min-width: 160px;
    max-width: 160px;
  }
  .matrix-concept-head,
  .matrix-table td {
    min-width: 78px;
    max-width: 78px;
  }
  .source-status { grid-column: auto; }
  .tree-row {
    grid-template-columns: 1fr 76px 28px;
    grid-template-areas:
      "label amount toggle"
      "lever lever lever"
      "control control control";
    gap: 8px;
  }
  .tree-row.child { grid-template-areas: "label amount toggle" "lever lever lever" "control control control" "boundary boundary boundary"; }
  .boundary-readouts { flex-wrap: wrap; }
  .explorer-balance { grid-template-columns: 1fr; gap: 10px; }
  .panel-head { flex-direction: column; }
  .fiscal-explorer-head-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .segmented, .outlook-controls { width: 100%; }
  .segmented button, .outlook-controls button { flex: 1; }
  .outlook-controls { flex-wrap: wrap; }
  .chart-wrap { overflow-x: auto; }
  #outlookChart { min-width: 650px; }
  .form-grid { grid-template-columns: 1fr; }
  .import-filters { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .path-rationale { grid-template-columns: 1fr; }
}
.maintenance-notice {
  max-width: min(30rem, calc(100vw - 3rem));
  border: 1px solid #c5d9cf;
  border-radius: 1rem;
  padding: 1.5rem;
  color: #19342b;
  background: #fffefa;
}
.maintenance-notice::backdrop { background: rgb(20 40 30 / 55%); }
