:root {
  color-scheme: light;
  --bg: #eef4fb;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.16);
  --green: #047857;
  --green-soft: #ecfdf5;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --text-on-dark: #ffffff;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --data-text-size: 0.9rem;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 34rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(238, 244, 251, 0) 28rem),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 20px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.brand {
  display: grid;
  gap: 8px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-title {
  margin: 0;
  font-size: 1.72rem;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.auth-shell {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(100%, 430px);
  padding: 30px;
  display: grid;
  gap: 20px;
}

.auth-heading {
  display: grid;
  gap: 8px;
  text-align: center;
}

.auth-heading h1,
.auth-heading p {
  margin: 0;
}

.auth-heading h1 {
  font-size: 1.8rem;
  letter-spacing: -0.025em;
}

.auth-heading > p:not(.eyebrow),
.auth-security {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
}

.auth-switch {
  padding: 0;
  background: transparent;
  color: var(--green);
  font-weight: 850;
  text-align: center;
}

.auth-recovery {
  margin-top: -10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-message {
  min-height: 20px;
  margin: -4px 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.45;
  text-align: center;
}

.auth-message[data-tone="good"] {
  color: var(--green);
}

.auth-message[data-tone="bad"] {
  color: var(--red);
}

.auth-message[data-tone="working"] {
  color: var(--blue);
}

.auth-loading {
  min-height: 44px;
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.86rem;
  font-weight: 800;
}

.auth-loading-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
}

.auth-security {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.sidebar-session {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.sidebar-session-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.sidebar-session-copy > span {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-session .text-button {
  width: 100%;
}

.sync-status {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.sync-status[data-tone="good"] {
  color: var(--green);
}

.sync-status[data-tone="working"] {
  color: var(--blue);
}

.sync-status[data-tone="bad"] {
  color: var(--red);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 76px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45, 111, 79, 0.14);
}

:where(button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.input-prefix:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.input-prefix input:focus-visible {
  outline: 0;
}

.input-prefix {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.input-prefix span {
  padding-left: 10px;
  color: var(--muted);
  font-weight: 850;
}

.input-prefix input {
  border: 0;
  box-shadow: none;
}

.nav-list {
  display: grid;
  gap: 14px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group-label {
  margin: 0;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group-buttons {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  text-align: left;
  font-weight: 850;
}

.nav-button:hover,
.nav-button.is-active {
  background: #111827;
  color: var(--text-on-dark);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
}

.nav-button svg,
.icon-button svg,
.text-button svg,
.primary-button svg {
  width: 18px;
  height: 18px;
}

main {
  min-width: 0;
  padding: 24px;
}

.tab-panel {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 18px;
}

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

.panel-heading h2 {
  margin: 3px 0 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.panel-heading .eyebrow {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
}

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

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.page-intro {
  width: min(100%, 980px);
  justify-self: center;
  display: grid;
  gap: 10px;
  padding: 22px 24px;
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.page-intro p:not(.eyebrow) {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 650;
}

.page-intro-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.page-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  padding: 10px 13px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  text-align: right;
}

.page-pill span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.page-pill strong {
  font-size: 1rem;
}

.flow-stack {
  width: min(100%, 1120px);
  justify-self: center;
  display: grid;
  gap: 18px;
}

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

.plan-row.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-row.single {
  grid-template-columns: 1fr;
}

.metric-strip {
  width: min(100%, 1120px);
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-tile {
  min-height: 104px;
  padding: 15px 16px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(15, 23, 42, 0.05);
}

.metric-tile span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-tile strong {
  font-size: 1.58rem;
  line-height: 1;
}

.step-divider {
  width: min(100%, 760px);
  justify-self: center;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.step-divider::before,
.step-divider::after {
  content: "";
  height: 1px;
  background: var(--line-strong);
}

.output-panel {
  color: #475569;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.92));
}

.capital-output {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(100, 116, 139, 0.16);
  background: rgba(226, 232, 240, 0.5);
}

.capital-output span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.capital-output strong {
  font-size: 2rem;
  line-height: 1;
}

.rule-summary {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.rule-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.rule-line strong {
  color: var(--ink);
  font-size: 1rem;
  text-align: right;
  white-space: nowrap;
}

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

.compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 160px) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.compact-row.debt-row {
  grid-template-columns: minmax(0, 1fr) minmax(110px, 160px) auto;
}

.money-map-source-readout,
.money-map-source-card {
  min-height: 112px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.92)),
    var(--panel-soft);
  display: grid;
  align-content: center;
  gap: 10px;
}

.money-map-source-readout span,
.money-map-source-card span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.money-map-source-readout strong,
.money-map-source-card strong {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 0.95;
}

.money-map-source-readout p,
.money-map-source-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.money-map-table {
  min-width: 0;
  table-layout: fixed;
}

.money-map-table-wrap {
  overflow-x: auto;
}

.money-map-table th,
.money-map-table td {
  padding: 8px;
}

.money-map-cascade {
  display: grid;
  gap: 20px;
}

.money-map-runoff {
  height: 20px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.25), transparent),
    var(--line);
  position: relative;
}

.money-map-runoff::after {
  content: "";
  position: absolute;
  right: 14%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--blue);
  border-right: 2px solid var(--blue);
  transform: translateY(-50%) rotate(45deg);
}

.money-map-bucket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}

.money-map-bucket {
  display: grid;
  align-items: end;
}

.money-map-bucket-vessel {
  min-height: var(--bucket-height, 190px);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
  position: relative;
  display: grid;
  align-items: end;
}

.money-map-bucket-fill {
  position: absolute;
  inset: auto 0 0;
  height: var(--bucket-fill, 40%);
  background: rgba(37, 99, 235, 0.18);
}

.money-map-bucket[data-tone="buffer"] .money-map-bucket-fill,
.money-map-bucket[data-tone="reserve"] .money-map-bucket-fill {
  background: rgba(4, 120, 87, 0.2);
}

.money-map-bucket[data-tone="growth"] .money-map-bucket-fill {
  background: rgba(37, 99, 235, 0.22);
}

.money-map-bucket[data-tone="optional"] .money-map-bucket-fill {
  background: rgba(180, 83, 9, 0.2);
}

.money-map-bucket[data-tone="overflow"] .money-map-bucket-fill {
  background: rgba(220, 38, 38, 0.18);
}

.money-map-bucket-content {
  position: relative;
  z-index: 1;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.money-map-bucket-name {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.money-map-bucket strong {
  font-size: 1.35rem;
}

.tab-flow {
  display: grid;
  gap: 18px;
}

/* Income Timing and Paycheck Plan use a compact, centered workbench. */
.focused-flow {
  gap: 12px;
}

.focused-flow > .panel,
.focused-flow > .flow-stack,
.focused-flow .flow-stack > .panel,
.focused-flow .flow-stack > .plan-row {
  width: min(100%, 700px);
  justify-self: center;
}

.focused-flow .flow-stack {
  gap: 12px;
}

.focused-flow .plan-row {
  grid-template-columns: 1fr;
  gap: 12px;
}

.focused-flow .panel {
  padding: 16px;
}

.focused-flow .flow-stack > .compact-tile,
.focused-flow .plan-row > .compact-tile {
  width: min(100%, 400px);
  justify-self: center;
}

.focused-flow .page-intro {
  width: min(100%, 520px);
  padding: 4px 8px;
  gap: 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.focused-flow .page-intro p:not(.eyebrow) {
  max-width: none;
  line-height: 1.4;
}

.focused-flow .page-intro-row {
  justify-content: center;
  text-align: center;
}

.focused-flow .panel-heading {
  display: grid;
  justify-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
  margin-bottom: 12px;
}

.focused-flow .panel-actions {
  justify-content: center;
}

.home-flow .flow-stack > .home-tile {
  width: min(100%, 620px);
  justify-self: center;
}

.home-as-of {
  margin: -3px 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-align: center;
}

.home-metrics .mini-stat {
  min-height: 0;
  padding: 11px 12px;
  text-align: center;
}

.home-metrics .mini-stat strong {
  font-size: 1.08rem;
}

.home-link {
  margin: 10px auto 0;
}

.home-primary-row {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.home-primary-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.home-primary-row > strong {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.home-plan-summary {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.home-plan-summary .rule-line strong {
  max-width: 62%;
  white-space: normal;
}

.focused-flow .compact-tile .field,
.focused-flow .compact-tile .rule-summary {
  width: 100%;
}

.focused-flow .compact-tile .field {
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: center;
  gap: 12px;
}

.focused-flow .compact-tile .field label {
  line-height: 1.25;
}

.focused-flow .compact-tile .field > input,
.focused-flow .compact-tile .field > select,
.focused-flow .compact-tile .field > .input-prefix {
  width: 140px;
  justify-self: end;
}

.focused-flow .capital-output,
.focused-flow > .panel > .note {
  text-align: center;
}

.focused-flow .compact-tile .capital-output {
  width: 190px;
  margin-inline: auto;
  padding: 12px;
}

.focused-flow .compact-tile input,
.focused-flow .compact-tile select,
.focused-flow .compact-tile .input-prefix {
  min-height: 40px;
}

.focused-flow .compact-tile input,
.focused-flow .compact-tile select {
  padding: 7px 9px;
}

.focused-flow .compact-tile .rule-summary {
  margin-top: 10px;
  padding-top: 9px;
  gap: 5px;
}

.paycheck-funding-summary .rule-line {
  font-size: 0.74rem;
}

.paycheck-funding-total {
  margin-top: 2px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.focused-flow .table-wrap {
  width: 100%;
}

.focused-flow table {
  min-width: 680px;
}

.focused-flow th,
.focused-flow td {
  padding: 6px;
}

.focused-flow td input,
.focused-flow td select {
  min-height: 34px;
  padding-block: 6px;
}

.focused-flow .icon-button {
  width: 34px;
  height: 34px;
}

.focused-flow .table-tile {
  padding: 0;
  overflow: hidden;
}

.focused-flow .table-tile .panel-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: stretch;
  text-align: center;
  margin: 0;
  padding: 12px 14px 10px;
  gap: 12px;
}

.focused-flow .table-tile .panel-actions,
.focused-flow .table-tile .panel-heading > .text-button {
  position: static;
  justify-self: end;
}

.focused-flow .table-tile .table-wrap {
  width: calc(100% - 24px);
  margin: 0 12px 12px;
  border-radius: 10px;
}

.focused-flow .table-tile th,
.focused-flow .table-tile td {
  padding: 5px 6px;
}

.focused-flow .table-tile td input,
.focused-flow .table-tile td select {
  min-height: 32px;
  padding: 4px 7px;
}

.focused-flow .table-tile .input-prefix {
  min-height: 32px;
}

.focused-flow .table-tile .input-prefix span {
  padding-left: 8px;
}

.focused-flow .table-tile .input-prefix input {
  padding-left: 6px;
}

.focused-flow .table-tile .icon-button {
  width: 32px;
  height: 32px;
}

.focused-flow .table-tile > .note {
  margin: -4px 12px 10px;
  padding: 0;
}

.focused-flow .flow-stack > .expense-table-tile {
  width: min(100%, 700px);
}

.focused-flow > .income-table-tile {
  width: min(100%, 700px);
}

.focused-flow > .income-table-tile {
  position: relative;
}

.focused-flow > .income-table-tile .panel-heading {
  grid-template-columns: 1fr;
  min-height: 58px;
}

.focused-flow > .income-table-tile .panel-heading > .text-button {
  position: absolute;
  top: 10px;
  right: 14px;
}

.focused-flow .table-tile table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.expense-table .expense-name-column {
  width: auto;
}

.expense-table .expense-amount-column {
  width: 104px;
}

.expense-table .expense-day-column {
  width: 62px;
}

.expense-table .expense-type-column {
  width: 82px;
}

.expense-table .expense-statement-column {
  width: 72px;
}

.expense-table .expense-status-column {
  width: 104px;
}

.expense-table .expense-manual-column {
  width: 52px;
}

.expense-table .row-action-column,
.income-table .row-action-column {
  width: 42px;
}

.income-table .income-name-column {
  width: auto;
}

.income-table .income-amount-column {
  width: 130px;
}

.income-table .income-timing-column {
  width: 116px;
}

.income-table .income-day-column {
  width: 64px;
}

.income-table .income-date-column {
  width: 90px;
}

/* Money Map and Current Cash share the same compact step system. */
.map-flow .flow-stack > .plan-row > .map-source-tile,
.current-flow .flow-stack > .plan-row > .entry-tile {
  width: min(100%, 400px);
  justify-self: center;
}

.map-flow .flow-stack > .plan-row > .map-source-tile {
  width: min(100%, 320px);
}

.map-flow .map-source-tile .money-map-source-readout {
  min-height: 0;
  padding: 0;
  gap: 6px;
  border: 0;
  background: transparent;
  text-align: center;
}

.map-flow .map-source-tile .money-map-source-readout strong {
  font-size: 2rem;
}

.map-flow .map-source-tile .money-map-source-readout p {
  font-size: 0.82rem;
  line-height: 1.35;
}

.focused-flow .flow-stack > .plan-row > .map-table-tile {
  width: min(100%, 860px);
  justify-self: center;
}

.map-flow .flow-stack,
.map-flow .flow-stack > .plan-row,
.map-flow .flow-stack > .map-sequence-tile {
  width: min(100%, 860px);
}

.money-map-phase-tile[data-phase="1"] {
  border-color: rgba(37, 99, 235, 0.18);
}

.money-map-phase-tile[data-phase="2"] {
  border-color: rgba(4, 120, 87, 0.2);
}

.money-map-phase-tile[data-phase="3"] {
  border-color: rgba(180, 83, 9, 0.2);
}

.map-flow .money-map-table .map-channel-column {
  width: auto;
}

.map-flow .money-map-table .map-percent-column {
  width: 76px;
}

.map-flow .money-map-table .map-amount-column {
  width: 82px;
}

.map-flow .money-map-table .map-saved-column,
.map-flow .money-map-table .map-goal-column {
  width: 104px;
}

.map-flow .money-map-table .map-time-column {
  width: 106px;
}

.map-flow .money-map-table .map-income-column {
  width: 84px;
}

.map-flow .money-map-table .map-actions-column {
  width: 42px;
}

.map-flow .money-map-table th,
.map-flow .money-map-table td {
  padding: 5px 6px;
}

.map-flow .money-map-table input,
.map-flow .money-map-table .input-prefix {
  min-height: 34px;
}

.map-flow .money-map-table input {
  padding: 5px 7px;
}

.map-goal-input span,
.map-saved-input span {
  padding-left: 7px;
}

.map-goal-input input,
.map-saved-input input {
  padding-left: 5px !important;
}

.map-time-cell {
  color: var(--green);
  white-space: nowrap;
}

.map-empty-row {
  height: 54px;
  color: var(--muted);
  text-align: center;
  font-weight: 750;
}

.map-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.map-row-actions .icon-button {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.money-map-channel-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.money-map-card-fields {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 72px 104px 104px 34px;
  align-items: end;
  gap: 6px;
}

.money-map-card-fields input,
.money-map-card-fields .input-prefix {
  min-height: 34px;
}

.money-map-card-fields input {
  padding: 5px 7px;
}

.money-map-card-fields .map-row-actions {
  align-self: end;
  min-height: 34px;
}

.money-map-card-results {
  padding-top: 9px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.money-map-card-results span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.money-map-card-results small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.money-map-card-results strong {
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-phase-empty {
  min-height: 72px;
}

.money-map-phase-sequence {
  display: grid;
  gap: 12px;
}

.money-map-phase-visual {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.money-map-phase-visual-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.money-map-phase-visual-heading span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.money-map-phase-visual-heading strong {
  color: var(--muted);
  font-size: 0.78rem;
}

.money-map-phase-transition {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--green);
  font-size: 0.8rem;
}

.money-map-phase-transition[data-tone="warn"] {
  color: var(--amber);
}

.money-map-phase-transition svg {
  width: 17px;
  height: 17px;
}

.map-flow .money-map-source-card {
  width: min(100%, 360px);
  min-height: 0;
  margin-inline: auto;
  padding: 12px 14px;
  gap: 6px;
  text-align: center;
}

.map-flow .money-map-source-card strong {
  font-size: 2rem;
}

.map-flow .money-map-source-card p {
  font-size: 0.82rem;
  line-height: 1.35;
}

.map-flow .money-map-cascade {
  gap: 12px;
}

.map-flow .money-map-runoff {
  height: 12px;
}

.map-flow .money-map-bucket-grid {
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 10px;
}

.map-flow .money-map-bucket-vessel {
  border-radius: 12px;
}

.map-flow .money-map-bucket-content {
  padding: 10px;
  gap: 5px;
}

.map-flow .money-map-bucket strong {
  font-size: 1.15rem;
}

.accounts-flow .flow-stack,
.accounts-flow .flow-stack > .account-directory-tile {
  width: min(100%, 860px);
}

.accounts-flow .account-directory-tile {
  justify-self: center;
}

.accounts-flow .account-directory-tile .panel-heading {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.accounts-table .account-name-column {
  width: 165px;
}

.accounts-table .account-type-column {
  width: 125px;
}

.accounts-table .account-purpose-column {
  width: auto;
}

.accounts-table .account-balance-column,
.accounts-table .account-minimum-column {
  width: 108px;
}

.accounts-table .account-primary-column {
  width: 104px;
}

.accounts-table .row-action-column {
  width: 42px;
}

.accounts-table th,
.accounts-table td {
  padding: 5px 6px;
}

.accounts-table input,
.accounts-table select,
.accounts-table .input-prefix {
  min-height: 34px;
}

.accounts-table input,
.accounts-table select {
  padding: 5px 7px;
}

.accounts-table .input-prefix span {
  padding-left: 7px;
}

.accounts-table .input-prefix input {
  padding-left: 5px;
}

.account-row[data-primary="true"] td {
  background: rgba(22, 163, 74, 0.055);
}

.account-primary-cell {
  text-align: center;
}

.account-primary-button {
  min-height: 28px;
  padding: 0 5px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 850;
  white-space: nowrap;
}

.account-primary-button:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.account-primary-button[data-tone="primary"] {
  color: var(--green);
}

.account-primary-button[data-tone="primary"] svg {
  fill: currentColor;
}

.account-primary-button svg {
  width: 13px;
  height: 13px;
}

.account-not-applicable {
  min-height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.account-empty-row {
  height: 62px;
  color: var(--muted);
  text-align: center;
  font-weight: 750;
}

.account-directory-footer {
  padding: 2px 12px 8px;
  display: flex;
  justify-content: flex-end;
}

.account-add-button {
  min-height: 28px;
  padding: 0 4px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 800;
}

.account-add-button:hover {
  color: var(--ink);
  background: var(--panel-soft);
}

.account-add-button svg {
  width: 14px;
  height: 14px;
}

.accounts-flow .account-directory-tile .table-wrap {
  margin-bottom: 0;
}

.account-mobile-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  display: grid;
  gap: 9px;
  font-size: var(--data-text-size);
}

.account-mobile-card[data-primary="true"] {
  border-color: rgba(22, 163, 74, 0.2);
  background: rgba(22, 163, 74, 0.055);
}

.account-mobile-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: end;
  gap: 7px;
}

.account-mobile-heading .icon-button {
  width: 34px;
  height: 34px;
}

.account-mobile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.account-mobile-purpose {
  grid-column: 1 / -1;
}

.account-mobile-card input,
.account-mobile-card select,
.account-mobile-card .input-prefix {
  min-height: 34px;
}

.account-mobile-card input,
.account-mobile-card select {
  padding: 5px 7px;
}

.account-mobile-card .input-prefix span {
  padding-left: 8px;
}

.account-mobile-card .input-prefix input {
  padding-left: 5px;
}

.account-mobile-footer {
  padding-top: 7px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

.account-mobile-empty {
  min-height: 72px;
}

.current-flow .entry-tile {
  position: relative;
}

.current-flow .entry-tile .panel-heading {
  min-height: 40px;
  margin-bottom: 8px;
}

.current-flow .entry-tile .panel-heading > .text-button {
  position: absolute;
  top: 14px;
  right: 14px;
}

.current-flow .compact-list {
  gap: 7px;
}

.current-flow .compact-row,
.current-flow .compact-row.debt-row {
  grid-template-columns: minmax(0, 1fr) 125px 32px;
  gap: 6px;
  padding: 6px;
  font-size: var(--data-text-size);
}

.current-flow .compact-row input,
.current-flow .compact-row .input-prefix {
  min-height: 36px;
}

.current-flow .compact-row input {
  padding: 6px 8px;
}

.current-flow .compact-row .input-prefix span {
  padding-left: 8px;
}

.current-flow .compact-row .input-prefix input {
  padding-left: 6px;
}

.current-flow .compact-row .icon-button {
  width: 32px;
  height: 32px;
}

.focused-flow .flow-stack > .current-reserve-table {
  width: min(100%, 620px);
}

.current-reserve-grid .reserve-amount-column {
  width: 128px;
}

.current-reserve-grid .reserve-date-column {
  width: 94px;
}

.current-reserve-grid .reserve-now-column {
  width: 112px;
}

.current-reserve-type {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
}

.focused-flow .flow-stack > .plan-row > .cash-summary-tile {
  width: min(100%, 600px);
  justify-self: center;
}

.current-flow .cash-summary-tile .mini-stat {
  min-height: 0;
  padding: 10px 12px;
}

.current-flow .cash-summary-tile .mini-stat strong {
  font-size: 1.08rem;
}

.current-flow .cash-summary-tile .rule-summary {
  margin-top: 10px;
  padding-top: 9px;
  gap: 5px;
}

.current-flow .cash-summary-tile > .note {
  margin: 10px 0 0;
  text-align: center;
}

.net-worth-flow .flow-stack > .net-worth-accounts-tile {
  width: min(100%, 440px);
  justify-self: center;
}

.net-worth-flow .compact-list {
  gap: 7px;
}

.net-worth-row {
  grid-template-columns: minmax(0, 1fr) 140px 32px;
  gap: 6px;
  padding: 6px;
  font-size: var(--data-text-size);
}

.net-worth-row input,
.net-worth-row .input-prefix {
  min-height: 36px;
}

.net-worth-row input {
  padding: 6px 8px;
}

.net-worth-row .input-prefix span {
  padding-left: 8px;
}

.net-worth-row .input-prefix input {
  padding-left: 6px;
}

.net-worth-row .icon-button {
  width: 32px;
  height: 32px;
}

.net-worth-account-footer {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.net-worth-flow .flow-stack > .net-worth-visual-tile {
  width: min(100%, 520px);
  justify-self: center;
}

.net-worth-bars {
  display: grid;
  gap: 10px;
}

.net-worth-bar {
  display: grid;
  gap: 5px;
}

.net-worth-bar-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
}

.net-worth-bar-heading span {
  min-width: 0;
  color: var(--muted);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.net-worth-bar-heading strong {
  white-space: nowrap;
}

.net-worth-track {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.net-worth-fill {
  width: var(--net-worth-width, 0%);
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--green);
}

.net-worth-fill[data-tone="negative"] {
  background: var(--red);
}

.net-worth-fill[data-tone="zero"] {
  background: var(--line-strong);
}

.net-worth-flow .flow-stack > .net-worth-total-tile {
  width: min(100%, 320px);
  justify-self: center;
}

.net-worth-total-tile .capital-output {
  width: 190px;
  margin-inline: auto;
  padding: 12px;
  text-align: center;
}

.net-worth-total-tile[data-tone="positive"] .capital-output strong {
  color: var(--green);
}

.net-worth-total-tile[data-tone="negative"] .capital-output strong {
  color: var(--red);
}

.focused-flow .expense-table-tile .panel-heading {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.expense-heading-copy {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  text-align: center;
}

.expense-heading-copy .eyebrow {
  text-align: center;
}

.expense-row[data-tone="required"] td {
  background: rgba(22, 163, 74, 0.07);
}

.expense-row[data-tone="optional"] td {
  background: rgba(220, 38, 38, 0.065);
}

.expense-row[data-tone="required"] input,
.expense-row[data-tone="required"] .input-prefix {
  background: rgba(255, 255, 255, 0.78);
}

.expense-row[data-tone="optional"] input,
.expense-row[data-tone="optional"] .input-prefix {
  background: rgba(255, 255, 255, 0.76);
}

.expense-row input:disabled,
.expense-row select:disabled,
.expense-manual-toggle input:disabled {
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.expense-status-toggle {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.expense-status-toggle input {
  position: absolute;
  width: 1px !important;
  height: 1px;
  min-height: 0 !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.expense-status-switch {
  width: 28px;
  height: 16px;
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 999px;
  background: var(--red);
  transition: background 160ms ease;
}

.expense-status-switch span {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transform: translateX(0);
  transition: transform 160ms ease;
}

.expense-status-toggle input:checked + .expense-status-switch {
  background: var(--green);
}

.expense-status-toggle input:checked + .expense-status-switch span {
  transform: translateX(12px);
}

.expense-status-toggle:focus-within .expense-status-switch {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

.expense-status-toggle strong {
  color: var(--red);
  font-size: 0.72rem;
  line-height: 1;
}

.expense-status-toggle[data-tone="required"] strong {
  color: var(--green);
}

.expense-manual-cell {
  text-align: center;
}

.expense-manual-toggle {
  min-height: 28px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.expense-manual-toggle input {
  width: 14px !important;
  height: 14px;
  min-height: 14px !important;
  margin: 0;
  padding: 0 !important;
  accent-color: var(--muted);
  opacity: 0.72;
}

.expense-manual-toggle:hover input,
.expense-manual-toggle:focus-within input,
.expense-manual-toggle input:checked {
  opacity: 1;
}

.expense-mobile-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 9px;
  font-size: var(--data-text-size);
}

.expense-mobile-card[data-tone="required"] {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(22, 163, 74, 0.07);
}

.expense-mobile-card[data-tone="optional"] {
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.065);
}

.expense-mobile-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.expense-mobile-card-flags {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
}

.expense-mobile-card-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 7px;
}

.expense-mobile-name {
  grid-column: 1 / -1;
}

.expense-mobile-card input,
.expense-mobile-card select,
.expense-mobile-card .input-prefix {
  min-height: 34px;
}

.expense-mobile-card input {
  padding: 5px 7px;
}

.expense-mobile-card .input-prefix span {
  padding-left: 8px;
}

.expense-mobile-card .input-prefix input {
  padding-left: 5px;
}

.expense-table-footer,
.map-table-footer {
  padding: 0 12px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.map-table-footer {
  justify-content: space-between;
  padding: 2px 12px 8px;
}

.map-add-channel-button {
  min-height: 28px;
  padding: 0 4px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 800;
}

.map-add-channel-button:hover {
  color: var(--ink);
  background: var(--panel-soft);
}

.map-add-channel-button svg {
  width: 14px;
  height: 14px;
}

.focused-flow .expense-table-tile .table-wrap {
  margin-bottom: 8px;
}

.focused-flow .map-table-tile .table-wrap {
  margin-bottom: 0;
}

.compact-results {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compact-results.single-result {
  grid-template-columns: 1fr;
}

.compact-result {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  display: grid;
  gap: 3px;
  text-align: center;
}

.compact-result span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.compact-result strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.15;
}

.single-result .compact-result {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  text-align: left;
}

.purpose-card {
  display: grid;
  gap: 12px;
}

.purpose-copy {
  margin: 0;
  max-width: 72ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 0.78rem;
  font-weight: 900;
}

td {
  font-size: var(--data-text-size);
}

tr:last-child td {
  border-bottom: 0;
}

td input,
td select {
  min-height: 36px;
}

.number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.text-button,
.primary-button,
.danger-button {
  min-height: 38px;
  padding: 0 11px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 850;
  white-space: nowrap;
}

.text-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.text-button:hover {
  background: var(--panel-soft);
}

.primary-button {
  background: var(--green);
  color: #fff;
}

.danger-button {
  background: var(--red-soft);
  color: var(--red);
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
}

.icon-button:hover {
  color: var(--red);
  border-color: rgba(178, 59, 59, 0.32);
  background: var(--red-soft);
}

.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.status-pill[data-tone="good"],
.chip[data-tone="good"] {
  border-color: rgba(45, 111, 79, 0.28);
  color: var(--green);
  background: var(--green-soft);
}

.status-pill[data-tone="warn"],
.chip[data-tone="warn"] {
  border-color: rgba(169, 104, 30, 0.32);
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill[data-tone="bad"],
.chip[data-tone="bad"] {
  border-color: rgba(178, 59, 59, 0.32);
  color: var(--red);
  background: var(--red-soft);
}

.deployment-flow .flow-stack,
.deployment-flow .flow-stack > .panel {
  width: min(100%, 700px);
}

.deployment-flow .flow-stack > .panel {
  justify-self: center;
}

.deployment-run-tile,
.deployment-step-tile,
.deployment-finish-tile {
  position: relative;
}

.deployment-flow .deployment-run-tile .panel-heading,
.deployment-flow .deployment-step-tile .panel-heading,
.deployment-flow .deployment-finish-tile .panel-heading {
  grid-template-columns: 1fr auto;
  align-items: center;
  justify-items: stretch;
  text-align: center;
}

.deployment-flow .panel-heading > div {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.deployment-empty-state {
  min-height: 54px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 750;
}

.deployment-guardrail-list {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.deployment-guardrail {
  min-height: 38px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 118px 118px 86px;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
}

.deployment-guardrail:last-child {
  border-bottom: 0;
}

.deployment-guardrail > span {
  color: var(--muted);
  font-weight: 750;
}

.deployment-guardrail > strong:last-child {
  justify-self: end;
  color: var(--green);
  font-size: 0.72rem;
}

.deployment-guardrail[data-tone="bad"] > strong:last-child {
  color: var(--red);
}

.deployment-protection-results {
  margin-top: 8px;
}

.deployment-protection-results .compact-result,
.deployment-finish-results .compact-result {
  min-height: 0;
  padding: 8px 9px;
}

.deployment-subsection {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 7px;
}

.deployment-subsection h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.deployment-reserve-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.deployment-reserve-list > div {
  min-height: 36px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.76rem;
}

.deployment-reserve-list > div:last-child {
  border-bottom: 0;
}

.deployment-reserve-list span {
  color: var(--muted);
  font-weight: 750;
}

.deployment-reserve-list strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.deployment-payment-groups,
.deployment-payment-group {
  display: grid;
  gap: 7px;
}

.deployment-payment-groups {
  gap: 10px;
}

.deployment-payment-group + .deployment-payment-group {
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.deployment-payment-group h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.deployment-action-list {
  display: grid;
  gap: 6px;
}

.deployment-action {
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 82px;
  align-items: center;
  gap: 8px;
}

.deployment-action.has-route {
  grid-template-columns: 18px minmax(120px, 1fr) minmax(150px, 190px) 82px;
}

.deployment-action > input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--green);
}

.deployment-action[data-checked="true"] {
  opacity: 0.58;
}

.deployment-action[data-blocked="true"] {
  border-color: rgba(220, 38, 38, 0.16);
  background: rgba(220, 38, 38, 0.035);
}

.deployment-action-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.deployment-action-copy > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.deployment-action-copy span,
.deployment-action-copy small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.deployment-action-copy small {
  color: var(--amber);
}

.deployment-route-field {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.deployment-route-field span {
  max-width: 72px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deployment-route-field select {
  min-width: 0;
  min-height: 32px;
  padding: 4px 6px;
  font-size: 0.76rem;
}

.deployment-action-amount {
  justify-self: end;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.deployment-warning {
  margin: 9px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(220, 38, 38, 0.16);
  border-radius: 9px;
  background: rgba(220, 38, 38, 0.045);
  color: var(--red);
  font-size: 0.74rem;
  font-weight: 750;
  text-align: center;
}

.deployment-flow .flow-stack > .deployment-finish-tile {
  width: min(100%, 520px);
}

.deployment-finish-results {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.deployment-note-field {
  margin-top: 10px;
}

.deployment-note-field label span {
  font-weight: 650;
}

.deployment-note-field textarea {
  min-height: 64px;
}

.deployment-finalize-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.deployment-finalize-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
}

.deployment-finalize-row .primary-button {
  flex: 0 0 auto;
}

.deployment-flow .flow-stack > .deployment-history-tile {
  width: min(100%, 700px);
}

.deployment-history-list {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.deployment-history-entry + .deployment-history-entry {
  border-top: 1px solid var(--line);
}

.deployment-history-entry summary {
  min-height: 54px;
  padding: 9px 12px;
  background: var(--panel-soft);
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  list-style-position: inside;
}

.deployment-history-entry summary > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.deployment-history-entry summary > span:last-child {
  justify-items: end;
}

.deployment-history-entry summary strong {
  font-size: 0.8rem;
}

.deployment-history-entry summary small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.deployment-history-detail {
  padding: 10px 12px 12px;
  display: grid;
  gap: 9px;
}

.deployment-history-actions {
  display: grid;
  gap: 6px;
}

.deployment-history-actions > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
}

.deployment-history-actions span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.deployment-history-actions small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deployment-history-detail > p {
  margin: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.bar-list,
.wizard-list,
.card-list {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 2fr) 92px;
  align-items: center;
  gap: 10px;
}

.bar-row strong {
  overflow-wrap: anywhere;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  min-width: 2px;
}

.bar-fill[data-tone="blue"] {
  background: var(--blue);
}

.bar-fill[data-tone="amber"] {
  background: var(--amber);
}

.bar-fill[data-tone="red"] {
  background: var(--red);
}

.split-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-stat {
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  display: grid;
  gap: 6px;
}

.mini-stat span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.mini-stat strong {
  font-size: 1.18rem;
  line-height: 1;
}

.wizard-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.wizard-card input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
}

.wizard-card strong,
.wizard-card span {
  display: block;
}

.wizard-card span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.empty-state {
  min-height: 120px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 18px;
  font-weight: 800;
}

.checkbox-cell {
  text-align: center;
}

.checkbox-cell input,
.checkbox-field input {
  width: 18px;
  min-height: 18px;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.note {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.mobile-cards {
  display: none;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    padding: 16px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
  }

  .nav-group-label {
    padding-inline: 7px;
  }

  .nav-button {
    min-height: 42px;
    padding: 0 7px;
    gap: 5px;
    font-size: 0.82rem;
  }

  .sidebar-session {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    margin-top: 0;
    padding-top: 10px;
  }

  .sidebar-session .text-button {
    width: auto;
  }

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

  .metric-strip,
  .plan-row,
  .plan-row.three-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .current-flow .cash-summary-tile .grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .accounts-flow .accounts-table-wrap {
    display: none;
  }

  .accounts-flow .accounts-mobile-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 10px 8px;
  }
}

@media (max-width: 760px) {
  main,
  .sidebar {
    padding: 12px;
  }

  .auth-shell {
    padding: 12px;
  }

  .auth-panel {
    padding: 22px 18px;
  }

  .sidebar-session {
    grid-template-columns: 1fr;
  }

  .sidebar-session .text-button {
    width: 100%;
  }

  .panel-heading {
    display: grid;
  }

  .sidebar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .nav-group-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-two,
  .grid-three,
  .metric-strip,
  .plan-row,
  .plan-row.three-up,
  .form-grid,
  .split-row {
    grid-template-columns: 1fr;
  }

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

  .compact-row,
  .compact-row.debt-row {
    grid-template-columns: 1fr;
  }

  .compact-row .icon-button {
    justify-self: end;
  }

  .panel {
    padding: 12px;
  }

  .page-intro-row {
    display: grid;
  }

  .page-pill {
    text-align: left;
  }

  .focused-flow .table-tile .panel-heading {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 10px;
  }

  .focused-flow .table-tile .panel-actions,
  .focused-flow .table-tile .panel-heading > .text-button {
    position: static;
    justify-self: center;
  }

  .expense-heading-copy {
    justify-items: center;
    text-align: center;
  }

  .expense-heading-copy .eyebrow {
    text-align: center;
  }

  .expense-table-tile .desktop-table {
    display: none;
  }

  .expense-table-tile .expense-mobile-cards {
    display: grid;
    gap: 8px;
    padding: 0 10px 8px;
  }

  .accounts-flow .accounts-table-wrap {
    display: none;
  }

  .accounts-flow .accounts-mobile-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 10px 8px;
  }

  .focused-flow .income-table {
    min-width: 650px;
  }

  .map-flow .money-map-table-wrap {
    display: none;
  }

  .map-flow .mobile-cards {
    display: grid;
    gap: 8px;
  }

  .map-flow .money-map-card-fields {
    grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr);
  }

  .map-flow .money-map-card-name {
    grid-column: 1 / -1;
  }

  .map-flow .money-map-card-fields .map-row-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .map-flow .money-map-bucket-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deployment-flow .deployment-run-tile .panel-heading,
  .deployment-flow .deployment-step-tile .panel-heading,
  .deployment-flow .deployment-finish-tile .panel-heading {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .deployment-guardrail {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
  }

  .deployment-guardrail > strong:first-child {
    grid-column: 1;
  }

  .deployment-guardrail > strong:last-child {
    grid-column: 2;
    grid-row: 1;
  }

  .deployment-action,
  .deployment-action.has-route {
    grid-template-columns: 18px minmax(0, 1fr) auto;
  }

  .deployment-route-field {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .deployment-finish-results {
    grid-template-columns: 1fr;
  }

  .deployment-finalize-row {
    align-items: stretch;
    flex-direction: column;
  }

  .deployment-finalize-row .primary-button {
    width: 100%;
  }

  .deployment-history-entry summary {
    gap: 8px;
  }

  .current-flow .cash-summary-tile .grid-three {
    grid-template-columns: 1fr;
  }

  .home-primary-row {
    align-items: start;
    flex-direction: column;
  }

  .home-plan-summary .rule-line strong {
    max-width: 55%;
  }
}
