:root {
  --revenue-canvas: var(--cl-paper, #fbfaf7);
  --revenue-surface: var(--cl-white, #ffffff);
  --revenue-document: var(--cl-white, #ffffff);
  --revenue-ink: var(--cl-navy-ink, #0a1826);
  --revenue-body: var(--ms-text-2, #2b3d52);
  --revenue-muted: var(--ms-muted, #5a6b7f);
  --revenue-hairline: var(--ms-border-2, #bcb5a4);
  --revenue-hairline-soft: var(--ms-border, #ded9cd);
  --revenue-action: var(--cl-navy, #0d1f33);
  --revenue-focus: #2563eb;
  --revenue-blue-soft: #dcecf8;
  --revenue-green-soft: #dff2df;
  --revenue-red-soft: #f8d8d5;
  --revenue-purple-soft: #eadff3;
}

html {
  background: var(--revenue-canvas);
}

body {
  background: var(--revenue-canvas) !important;
  color: var(--revenue-body);
  font-family: var(--ms-serif, Charter, "Bitstream Charter", Cambria, "Palatino Linotype", Georgia, serif);
}

body .container {
  width: min(100% - 40px, 1280px);
  max-width: 1280px;
}

body h1,
body h2,
body h3,
body h4,
body strong {
  color: var(--revenue-ink);
}

.revenue-hero {
  padding: 72px 0 24px;
  text-align: left;
}

.revenue-hero h1 {
  max-width: 820px;
  margin: 4px 0 8px;
  color: var(--revenue-ink);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.04;
}

.revenue-hero > p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--revenue-body);
  font-size: 1.05rem;
}

.revenue-eyebrow {
  margin: 0;
  color: var(--revenue-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.revenue-local-nav {
  display: flex;
  gap: 4px;
  margin: 0 0 34px;
  padding: 8px;
  border: 1px solid var(--revenue-hairline);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.24);
}

.revenue-local-nav a {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--revenue-body);
  font-weight: 600;
  text-decoration: none;
}

.revenue-local-nav a[aria-current="page"] {
  background: var(--revenue-surface);
  color: var(--revenue-ink);
}

.revenue-workspace {
  margin: 0 0 64px;
}

.revenue-workspace-heading {
  max-width: 820px;
  margin-bottom: 20px;
}

.revenue-workspace-heading h2 {
  margin: 5px 0 6px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.revenue-workspace-heading p:last-child {
  margin: 0;
}

.revenue-step-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.revenue-step-tabs button,
.revenue-result-tabs button,
.revenue-primary-action,
.revenue-override-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--revenue-hairline);
  border-radius: 999px;
  background: var(--revenue-surface);
  color: var(--revenue-body);
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.revenue-step-tabs button {
  gap: 4px;
}

.revenue-step-tabs button[aria-selected="true"],
.revenue-result-tabs button[aria-selected="true"] {
  border-color: var(--revenue-ink);
  background: var(--revenue-ink);
  color: #fff;
}

.revenue-step-tabs button[aria-selected="true"]::first-letter {
  color: var(--cl-gold, #c9a962);
}

.revenue-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 18px;
  align-items: start;
}

.revenue-workspace-main,
.revenue-step-panel,
.revenue-result-panel {
  min-width: 0;
}

.revenue-step-intro,
.revenue-flat-card {
  margin-bottom: 10px;
  padding: 20px 22px;
  border: 1px solid var(--revenue-hairline);
  border-radius: 6px;
  background: var(--revenue-surface);
}

.revenue-step-intro h3 {
  margin: 5px 0;
  font-size: 1.35rem;
}

.revenue-step-intro p:last-child {
  margin: 0;
}

.revenue-step-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 0;
  border-top: 1px solid var(--revenue-hairline-soft);
  color: var(--revenue-muted);
  font-size: 0.9rem;
}

.revenue-primary-action {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-color: var(--cl-navy-4, #1e4470);
  background: var(--revenue-action);
  color: var(--cl-white, #ffffff);
  font-weight: 700;
}

.revenue-readiness-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.revenue-readiness-strip span {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--revenue-hairline);
  border-radius: 999px;
  background: var(--revenue-red-soft);
  color: var(--revenue-ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.revenue-readiness-strip span[data-ready="true"] {
  background: var(--revenue-green-soft);
}

.revenue-result-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.revenue-result-tabs button {
  flex: 0 0 auto;
  padding: 9px 14px;
}

.revenue-review-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.revenue-review-summary > div {
  padding: 16px;
  border: 1px solid var(--revenue-hairline);
  border-radius: 6px;
  background: var(--revenue-surface);
}

.revenue-review-summary span,
.revenue-live-metric span {
  display: block;
  color: var(--revenue-muted);
  font-size: 0.78rem;
}

.revenue-review-summary strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1rem, 2vw, 1.4rem);
}

.revenue-live-summary {
  position: sticky;
  top: 76px;
  align-self: start;
  padding: 20px;
  border: 1px solid var(--revenue-ink);
  border-radius: 6px;
  background: var(--revenue-ink);
  color: #fff;
  box-shadow: none;
}

.revenue-live-summary h3,
.revenue-live-summary strong {
  color: #fff;
}

.revenue-live-summary h3 {
  margin: 5px 0 16px;
}

.revenue-live-summary .revenue-eyebrow {
  color: var(--ms-border-2, #bcb5a4);
}

.revenue-live-metric {
  padding: 12px 0;
  border-bottom: 1px solid var(--ms-text-2, #2b3d52);
}

.revenue-live-metric span {
  color: var(--ms-border, #ded9cd);
}

.revenue-live-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 1.55rem;
}

.revenue-live-metric #revenue-live-rs2 {
  font-size: 1rem;
  line-height: 1.35;
}

.revenue-live-coverage {
  margin-top: 14px;
  padding: 12px;
  border-radius: 5px;
  background: var(--revenue-red-soft);
  color: var(--revenue-ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.revenue-workspace .calculator-section,
.revenue-flat-card {
  margin: 0 0 14px !important;
  padding: 22px !important;
  border: 1px solid var(--revenue-hairline) !important;
  border-radius: 6px !important;
  background: var(--revenue-surface) !important;
  color: var(--revenue-body) !important;
  box-shadow: none !important;
  animation: none !important;
  transform: none !important;
}

.revenue-workspace .calculator-section:hover {
  border-color: var(--revenue-hairline) !important;
  box-shadow: none !important;
  transform: none !important;
}

.revenue-workspace .calculator-section h2,
.revenue-workspace .calculator-section h3,
.revenue-workspace .calculator-section h4 {
  color: var(--revenue-ink) !important;
  text-shadow: none !important;
}

.revenue-workspace .step-indicator {
  display: none !important;
}

.revenue-workspace .steps-guide,
.revenue-workspace .info-box,
.revenue-workspace .info-highlight,
.revenue-workspace .example-box,
.revenue-workspace .data-source-note,
.revenue-workspace .formula-step,
.revenue-workspace .results,
.revenue-workspace [style*="background"] {
  border-color: var(--revenue-hairline-soft) !important;
  background: var(--revenue-document) !important;
  color: var(--revenue-body) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.revenue-workspace .steps-guide,
.revenue-workspace .info-box {
  display: none;
}

.revenue-workspace .form-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

.revenue-workspace .calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(240px, 1fr) minmax(220px, 0.8fr);
  gap: 16px;
}

.revenue-workspace .calc-description > .info-box {
  display: none;
}

.revenue-workspace input {
  min-height: 42px;
  border: 1px solid var(--revenue-hairline) !important;
  border-radius: 5px !important;
  background: var(--revenue-surface) !important;
  color: var(--revenue-ink) !important;
  box-shadow: none !important;
}

.revenue-workspace input[readonly] {
  background: var(--cl-paper-2, #f3f1ec) !important;
}

.revenue-workspace input[aria-invalid="true"] {
  border-color: #b42318 !important;
}

.revenue-override-button {
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 5px;
  background: var(--cl-paper-2, #f3f1ec);
  color: var(--revenue-ink);
  font-size: 0.82rem;
}

.revenue-override-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--revenue-purple-soft);
  color: var(--revenue-ink);
  font-size: 0.72rem;
  font-weight: 600;
}

.revenue-override-badge[hidden],
.revenue-field-error[hidden] {
  display: none;
}

.revenue-field-error {
  display: block;
  margin-top: 5px;
  color: #8f1d14;
  font-size: 0.78rem;
  font-weight: 600;
}

.revenue-workspace .btn {
  min-height: 42px;
  border: 1px solid var(--cl-navy-4, #1e4470) !important;
  border-radius: 5px !important;
  background: var(--revenue-action) !important;
  color: var(--cl-white, #ffffff) !important;
  box-shadow: none !important;
  font-weight: 700;
}

.revenue-workspace .results.hidden {
  display: none;
}

.revenue-workspace .results:not(.hidden) {
  display: block;
}

.revenue-workspace .result-item {
  border-color: var(--revenue-hairline-soft) !important;
}

.revenue-workspace .result-value,
.revenue-workspace .result-value.highlight {
  color: var(--revenue-ink) !important;
  text-shadow: none !important;
}

.revenue-workspace #total-section {
  display: block;
}

.revenue-workspace #total-section .info-highlight {
  background: var(--revenue-blue-soft) !important;
}

.revenue-workspace #actual-rs-table-wrap {
  overflow-x: auto;
}

.revenue-workspace .rs-history-table {
  min-width: 620px;
}

.revenue-workspace .rs-history-table thead {
  background: var(--revenue-ink) !important;
}

.revenue-workspace .rs-history-table tr.rs-latest-year {
  background: var(--revenue-blue-soft) !important;
}

.revenue-workspace .rs-bar-fill,
.revenue-workspace .rs-bar-fill.rs-bar-latest,
.revenue-workspace .rs-bar-fill.rs-bar-partial {
  background: var(--revenue-ink) !important;
}

.revenue-workspace .rs-bar-fill.rs-bar-partial {
  background: var(--revenue-action) !important;
}

.revenue-growth-planner {
  margin-top: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--revenue-hairline);
}

.revenue-growth-planner-heading {
  margin-bottom: 18px;
}

.revenue-growth-planner-heading h3 {
  margin: 4px 0 6px;
  color: var(--revenue-ink);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.revenue-growth-planner-heading p:last-child {
  max-width: 70ch;
  margin: 0;
  color: var(--revenue-muted);
}

.revenue-workspace .rsp {
  max-width: none;
  margin: 0;
  padding: 0;
}

.revenue-workspace .rsp-hd {
  padding: 16px 18px 0;
  border: 1px solid var(--revenue-hairline);
  border-bottom: 0;
  background: var(--revenue-panel);
}

.revenue-workspace .rsp-hd h2 {
  color: var(--revenue-ink);
  font-size: 1.25rem;
}

.revenue-workspace .rsp-badge {
  border: 1px solid var(--cl-navy-4, #1e4470);
  border-radius: 999px;
  background: var(--revenue-yellow-soft);
  color: var(--revenue-ink);
}

.revenue-workspace .rsp-sub {
  max-width: none;
  margin: 0 0 18px;
  padding: 8px 18px 16px;
  border: 1px solid var(--revenue-hairline);
  border-top: 0;
  background: var(--revenue-panel);
  color: var(--revenue-muted);
}

.revenue-workspace .rsp-card {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--revenue-hairline);
  border-radius: 6px;
  background: var(--revenue-panel);
  box-shadow: none;
}

.revenue-workspace .rsp-card h3,
.revenue-workspace .rsp-field label {
  color: var(--revenue-ink);
}

.revenue-workspace .rsp-card .rsp-note,
.revenue-workspace .rsp-field .hint,
.revenue-workspace .rsp-foot {
  color: var(--revenue-muted);
}

.revenue-workspace .rsp-metric {
  border: 1px solid var(--revenue-hairline-soft);
  border-radius: 5px;
  background: var(--revenue-canvas);
}

.revenue-workspace .rsp-metric .v,
.revenue-workspace .rsp-rangeval {
  color: var(--revenue-ink);
}

.revenue-workspace .rsp-metric .l,
.revenue-workspace .rsp-metric .s {
  color: var(--revenue-muted);
}

.revenue-workspace .rsp-rankline {
  border-left: 3px solid var(--cl-gold, #c9a962);
  border-radius: 0 5px 5px 0;
  background: var(--revenue-yellow-soft);
  color: var(--revenue-ink);
}

.revenue-workspace .rsp-field input[type="number"],
.revenue-workspace .rsp-field select,
.revenue-workspace .rsp-addrow select {
  border: 1px solid var(--revenue-hairline);
  border-radius: 5px;
  background: var(--cl-white, #ffffff);
  color: var(--revenue-ink);
}

.revenue-workspace .rsp-out {
  border: 1px solid var(--revenue-ink);
  border-radius: 5px;
  background: var(--revenue-ink);
  color: var(--cl-white, #ffffff);
  box-shadow: none;
}

.revenue-workspace .rsp-bar,
.revenue-workspace .rsp-bar.is-proj {
  border-radius: 3px 3px 0 0;
  background: var(--revenue-ink);
}

.revenue-workspace .rsp-bar.is-proj {
  background: var(--cl-gold, #c9a962);
}

.revenue-workspace .rsp-tbl th,
.revenue-workspace .rsp-tbl td {
  border-color: var(--revenue-hairline-soft);
}

.revenue-workspace .rsp-tbl th {
  color: var(--revenue-muted);
}

.revenue-workspace .rsp-tbl tr.is-me td {
  background: var(--revenue-blue-soft);
}

.revenue-workspace .rsp-btn {
  border: 1px solid var(--cl-navy-4, #1e4470);
  border-radius: 5px;
  background: var(--revenue-action);
  color: var(--cl-white, #ffffff);
  box-shadow: none;
}

.revenue-workspace .rsp-btn.ghost {
  border-color: var(--revenue-hairline);
  background: transparent;
  color: var(--revenue-ink);
}

.revenue-workspace .rsp-x {
  color: var(--revenue-muted);
}

.revenue-step-tabs button:focus-visible,
.revenue-result-tabs button:focus-visible,
.revenue-primary-action:focus-visible,
.revenue-override-button:focus-visible,
.revenue-local-nav a:focus-visible,
.revenue-workspace input:focus-visible,
.revenue-workspace button:focus-visible {
  outline: 3px solid var(--revenue-focus);
  outline-offset: 2px;
}

body footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--revenue-hairline);
  background: transparent !important;
  color: var(--revenue-muted) !important;
}

@media (max-width: 1000px) {
  .revenue-workspace .calc-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .revenue-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .revenue-live-summary {
    position: static;
  }
}

@media (max-width: 768px) {
  body .container {
    width: min(100% - 24px, 1280px);
  }

  .revenue-hero {
    padding-top: 56px;
  }

  .revenue-workspace .form-grid,
  .revenue-review-summary {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .revenue-step-action {
    align-items: stretch;
    flex-direction: column;
  }

  .revenue-primary-action {
    width: 100%;
  }

  .revenue-workspace .calculator-section {
    padding: 16px !important;
  }
}

@media (max-width: 480px) {
  .revenue-hero h1 {
    font-size: 1.85rem;
  }

  .revenue-step-tabs {
    gap: 6px;
  }

  .revenue-step-tabs button {
    min-width: 0;
    padding: 10px 4px;
    flex-direction: column;
    gap: 2px;
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .revenue-step-intro,
  .revenue-flat-card,
  .revenue-live-summary {
    padding: 16px;
  }

  .user-profile-container {
    right: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
