:root {
  color-scheme: light;
  --bg: #e8ebe6;
  --surface: #ffffff;
  --surface-soft: #e8ebe6;
  --primary-pale: #e2f6d5;
  --ink: #0e0f0c;
  --muted: #454745;
  --soft-muted: #868685;
  --line: #cfd6cc;
  --green: #9fe870;
  --green-dark: #054d28;
  --blue: #38c8ff;
  --yellow: #ffd11a;
  --red: #d03238;
  --shadow: 0 18px 42px rgba(14, 15, 12, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family:
    "Wise Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

.site-top {
  width: min(1180px, calc(100% - 32px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.ghost-button,
.secondary-button,
.secondary-link,
.primary-button,
.primary-link,
.debt-form button,
.upload-grid button,
.bank-card,
.debt-row button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0 18px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
}

.primary-button,
.primary-link,
.debt-form button {
  border-color: var(--green);
  background: var(--green);
}

.secondary-link,
.secondary-button,
.ghost-button {
  background: var(--surface-soft);
}

.disabled,
[aria-disabled="true"],
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
}

.lede {
  max-width: 780px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.home-page,
.flow-page,
.results-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 42px;
}

.home-hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  overflow: hidden;
  border-radius: 24px;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.home-hero img {
  width: 100%;
  height: 100%;
  min-height: 620px;
  object-fit: cover;
}

.home-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 48px;
  color: #fff;
}

.home-copy .eyebrow,
.home-copy h1 {
  color: var(--green);
}

.home-copy h1,
.page-card h1,
.results-header h1 {
  margin: 0;
  max-width: 12ch;
  font-size: 4.9rem;
  font-weight: 900;
  line-height: 0.86;
}

.home-copy p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.14rem;
  line-height: 1.5;
}

.demo-note {
  margin: 16px 0 0;
  color: var(--soft-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  min-height: 132px;
  margin: 28px auto 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.site-footer p {
  max-width: 440px;
  margin: 8px 0 0;
  line-height: 1.45;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 18px;
  font-weight: 650;
}

.site-footer a {
  color: var(--ink);
}

.page-card,
.summary-grid article,
.person-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.progress span {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--green);
  color: var(--ink);
  font-weight: 900;
}

.summary-grid small {
  color: var(--muted);
  line-height: 1.35;
}

.progress {
  display: flex;
  gap: 8px;
  margin: 8px -4px 14px;
  padding: 4px;
  overflow-x: auto;
}

.progress a {
  flex: 0 0 auto;
  min-width: 128px;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 650;
}

.progress a.complete {
  border-color: rgba(61, 122, 93, 0.4);
  background: rgba(222, 241, 230, 0.7);
  color: var(--ink);
}

.progress a.complete span {
  background: var(--green);
  color: var(--ink);
}

.progress a.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--green);
}

.progress a.active span {
  background: var(--green);
  color: var(--ink);
}

.progress a.pending {
  background: rgba(255, 255, 255, 0.55);
  color: var(--soft-muted);
}

.progress a.pending span {
  background: var(--surface-soft);
  color: var(--muted);
}

.page-card {
  min-height: 520px;
  padding: 34px;
}

.page-card h1,
.results-header h1 {
  color: var(--ink);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.bank-grid,
.upload-grid,
.summary-grid,
.people-grid,
.result-layout,
.scenario-grid {
  display: grid;
  gap: 12px;
}

.bank-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.bank-card {
  min-height: 112px;
  align-content: center;
  align-items: center;
  justify-items: start;
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 16px;
}

.bank-card span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.bank-card.selected {
  border-color: var(--ink);
  background: var(--green);
}

.import-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}

.akahu-flow {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-soft);
}

.akahu-flow .panel-heading {
  flex-wrap: wrap;
  align-items: center;
}

.akahu-flow h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.65rem;
  line-height: 1.05;
}

.connection-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.connection-status.loading {
  background: var(--yellow);
  color: var(--ink);
}

.connection-status.complete {
  background: var(--green);
  color: var(--ink);
}

.akahu-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.akahu-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.akahu-fields input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 16px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.import-feed {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.import-feed div {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.import-feed span {
  width: 26px;
  height: 26px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.import-feed .active {
  color: var(--ink);
}

.import-feed .active span {
  background: var(--yellow);
  color: var(--ink);
}

.import-feed .complete {
  color: var(--green-dark);
}

.import-feed .complete span {
  background: var(--green);
  color: var(--ink);
}

.import-list li,
.summary-grid article {
  min-height: 86px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 16px;
  border-radius: 24px;
  background: var(--surface-soft);
}

.import-list span,
.summary-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.import-list strong,
.summary-grid strong {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 0.95;
}

.upload-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.upload-grid button {
  min-height: 92px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  text-align: left;
  padding: 16px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.chip-list span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--primary-pale);
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 650;
}

.debt-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 150px 170px;
  gap: 10px;
  margin-top: 24px;
}

.debt-form label,
.control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.debt-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

.debt-form button {
  grid-column: 1 / -1;
}

.debt-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.debt-row {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 24px;
  background: var(--surface-soft);
}

.debt-row div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.debt-row span {
  color: var(--muted);
}

.debt-row button {
  min-height: 34px;
  color: var(--red);
}

.people-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.partner-callout {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  padding: 0 22px;
  border: 1px solid var(--green);
  border-radius: 24px;
  background: var(--green);
  color: var(--ink);
  font-weight: 800;
  cursor: not-allowed;
}

.partner-callout:disabled {
  opacity: 0.72;
}

.person-card {
  min-height: 250px;
  padding: 18px;
}

.person-card > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.person-card h2 {
  margin: 8px 0 12px;
  font-size: 2rem;
  font-weight: 900;
  line-height: 0.98;
}

.person-card ul {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
}

.results-header {
  padding: 34px 0 10px;
}

.result-layout {
  grid-template-columns: 1fr;
  margin-top: 14px;
}

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

.panel-heading h2,
.scenario-grid h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 0.98;
}

.cashflow-bars,
.controls {
  display: grid;
  gap: 10px;
}

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

.cash-row span,
.cash-row strong {
  font-size: 0.88rem;
}

.cash-row div {
  height: 12px;
  border-radius: 999px;
  background: var(--primary-pale);
  overflow: hidden;
}

.cash-row i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--blue);
}

.cash-row.cost i {
  background: var(--red);
}

.cash-row.surplus i {
  background: var(--green);
}

.scenario-card {
  margin-top: 14px;
}

.scenario-tabs {
  display: flex;
  gap: 10px;
  margin: 8px -4px 16px;
  padding: 4px;
  overflow-x: auto;
}

.tab-button {
  flex: 0 0 auto;
  width: min(300px, 75vw);
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
}

.tab-button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--green);
}

.tab-title {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
}

.tab-button.active .tab-title {
  color: var(--green);
}

.tab-desc {
  overflow: hidden;
  color: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenario-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 14px;
}

.scenario-detail,
.control-panel,
.scenario-grid section,
.forecast-panel {
  min-width: 0;
}

.control-panel {
  border-radius: 24px;
  background: var(--surface-soft);
  padding: 18px;
}

.control input {
  width: 100%;
  accent-color: var(--green);
}

.scenario-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, auto);
  gap: 18px;
  align-items: end;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 8px solid var(--green);
  border-radius: 24px;
  background: var(--surface);
}

.scenario-mode {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-pale);
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scenario-hero h3 {
  margin: 0;
  font-size: 2.9rem;
  font-weight: 900;
  line-height: 0.9;
  overflow-wrap: anywhere;
}

#scenario-line {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.5;
}

.hero-number {
  display: grid;
  gap: 6px;
  text-align: right;
}

.hero-number span {
  color: var(--muted);
}

.hero-number strong {
  font-size: 3.8rem;
  font-weight: 900;
  line-height: 0.86;
}

.scenario-grid {
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.scenario-grid section {
  padding: 18px;
  border-radius: 24px;
  background: var(--surface-soft);
}

.line-chart {
  width: 100%;
  min-height: 270px;
}

.target-line {
  stroke: var(--red);
  stroke-width: 2;
  stroke-dasharray: 7 7;
}

.chart-path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--green);
  stroke: var(--ink);
  stroke-width: 4;
}

.chart-label,
.chart-tick,
.chart-value {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.chart-value {
  text-anchor: middle;
  fill: var(--ink);
}

.chart-tick {
  text-anchor: middle;
}

.forecast-panel {
  margin-top: 14px;
  padding: 18px;
  border-radius: 24px;
  background: var(--surface-soft);
}

.year-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 10px;
}

.year-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.year-card.ready {
  border-color: rgba(5, 77, 40, 0.28);
  background: var(--primary-pale);
}

.year-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.42rem;
  font-weight: 900;
  line-height: 0.95;
}

.year-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 5px;
  padding: 3px 7px;
  background: var(--surface-soft);
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .home-hero,
  .result-layout,
  .scenario-workspace,
  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .home-hero img {
    min-height: 320px;
  }

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

@media (max-width: 680px) {
  .site-top {
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 12px;
  }

  .site-top .ghost-button {
    padding: 0 14px;
  }

  .home-copy {
    padding: 26px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 24px;
    padding: 22px 0;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .page-card h1,
  .results-header h1 {
    max-width: 8ch;
    font-size: 2.65rem;
    line-height: 0.95;
  }

  .home-copy h1 {
    max-width: 8ch;
    font-size: 2.75rem;
    line-height: 0.94;
  }

  .home-copy p:not(.eyebrow) {
    max-width: 28ch;
    font-size: 1rem;
  }

  .page-card {
    min-height: auto;
    padding: 24px;
  }

  .flow-page .lede {
    max-width: 30ch;
    font-size: 1rem;
  }

  .bank-grid,
  .upload-grid,
  .summary-grid,
  .people-grid,
  .year-cards {
    grid-template-columns: 1fr;
  }

  .debt-form {
    grid-template-columns: 1fr;
  }

  .akahu-fields {
    grid-template-columns: 1fr;
  }

  .akahu-flow .panel-heading {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: start;
  }

  .akahu-flow h2 {
    font-size: 1.45rem;
  }

  .connection-status {
    justify-self: start;
  }

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

  .hero-number {
    text-align: left;
  }

  .hero-number strong,
  .scenario-hero h3 {
    font-size: 2.35rem;
  }

  .cash-row {
    grid-template-columns: 86px minmax(0, 1fr) max-content;
  }

  .cash-row strong {
    font-size: 0.78rem;
  }
}
