:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #63706c;
  --line: #d7dfd9;
  --surface: #f5f8f7;
  --panel: #ffffff;
  --mint: #2f8f75;
  --teal: #0e6472;
  --gold: #c48b25;
  --rose: #b95d4d;
  --danger: #b95d4d;
  --blue: #4267ac;
  --shadow: 0 18px 42px rgba(35, 46, 41, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Final responsive shell fixes */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body :where(.app-shell, .workspace, .planner-form, .panel, .session-panel, .session-management, .dialog-card, .product-menu) {
  min-width: 0;
  max-width: 100%;
}

body .product-header {
  grid-template-columns: minmax(0, 1fr) auto !important;
}

body .account-actions {
  justify-content: flex-end;
}

body .menu-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

body .product-menu[hidden] {
  display: none !important;
}

body .product-menu {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  right: max(12px, calc((100vw - 1640px) / 2 + 24px));
  display: grid;
  width: min(360px, calc(100vw - 24px));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--dashboard-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 48px rgba(16, 33, 63, 0.16);
  backdrop-filter: blur(16px);
}

body .product-menu .product-nav,
body .product-menu .menu-actions {
  position: static;
  display: grid;
  width: 100%;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body .product-menu .product-nav a,
body .product-menu .product-nav .nav-link {
  justify-content: start;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  text-align: left;
}

body .product-menu .product-nav .is-active::after {
  display: none;
}

body .product-menu .language-picker {
  display: grid;
  gap: 6px;
}

body .product-menu .language-picker span {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

body .product-menu .language-picker select,
body .product-menu .outline-action,
body .product-menu .app-primary-action {
  width: 100%;
  max-width: none;
  justify-content: center;
}

.file-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.file-picker-row input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 9px;
  cursor: pointer;
}

.file-picker-button {
  display: none;
}

.chart-panel canvas {
  aspect-ratio: 760 / 360;
}

body[data-app-view="dashboard"] .chart-panel {
  min-height: 0;
}

body[data-app-view="dashboard"] .chart-panel canvas {
  max-height: 420px;
}

.chart-tooltip,
.chart-quick-tooltip {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.profile-spectrum-track {
  min-height: 66px;
}

.profile-spectrum-track span {
  padding: 24px 3px 8px;
  overflow: hidden;
  font-size: clamp(0.54rem, 0.72vw, 0.68rem);
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
}

body .session-panel {
  flex-wrap: wrap;
  gap: 14px;
}

body .saved-plan-summary,
body .saved-plan-actions {
  min-width: 0;
}

body .saved-plan-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

body .session-management {
  right: 12px;
  left: 12px;
  overflow-x: hidden;
}

body .session-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  align-items: end;
}

body[data-app-view="plans"] :where(.input-grid, .balance-sheet-grid, .custom-item-row, .cash-flow-row, .allocation-range-row, .allocation-row, .shortfall-row, .liability-repayment-row) {
  min-width: 0;
  max-width: 100%;
}

body[data-app-view="plans"] :where(.custom-item-row, .cash-flow-row, .allocation-range-row, .allocation-row, .shortfall-row, .liability-repayment-row) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

body[data-app-view="plans"] :where(input, select, textarea, label, .suffix-input, .risk-level-field, .sale-summary, .real-property-sale-fields) {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1120px) {
  body[data-app-view="plans"] .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-app-view="plans"] .side-nav {
    position: static;
    display: grid;
    grid-column: 1;
    grid-row: auto;
    min-height: 0;
    margin-bottom: 14px;
  }

  body[data-app-view="plans"] .side-nav-group:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
  }

  body[data-app-view="plans"] .side-nav-toggle {
    width: max-content;
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  body[data-app-view="dashboard"] .planner-form {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-app-view="dashboard"] .chart-panel:first-child,
  body[data-app-view="dashboard"] .outside-chart-panel,
  body[data-app-view="dashboard"] .profile-panel {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  body .product-header {
    min-height: 62px;
    padding: 0 12px;
  }

  body .product-menu {
    right: 12px;
  }

  body .product-brand small {
    display: none;
  }

  body .session-panel {
    align-items: stretch;
    flex-direction: column;
  }

  body .saved-plan-actions {
    justify-content: stretch;
  }

  body .saved-plan-actions .text-button,
  body .saved-plan-actions .primary-action {
    width: 100%;
  }
}

@media (hover: none), (pointer: coarse) {
  body :where(.app-shell, .workspace, .planner-form, .panel, .site-footer, label, .section-head, .example-note, .field-help) {
    cursor: default;
  }
}

/* Final mobile/plans overrides. Keep this block last so older responsive rules do not win. */
body .chart-quick-tooltip {
  display: none !important;
}

body .chart-note-summary {
  display: block;
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  line-height: 1.45;
}

body[data-app-view="plans"] .custom-item-list .custom-item-row {
  display: grid !important;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--range-accent, #0e6472) 22%, #d7e4df);
  border-left: 8px solid var(--range-accent, #0e6472);
  border-radius: 12px;
  background: linear-gradient(90deg, var(--range-bg, #f5fbfa), #ffffff 46%);
}

body[data-app-view="plans"] #assetItemList .custom-item-row {
  --range-accent: #0e6472;
  --range-bg: #edf8f6;
}

body[data-app-view="plans"] #liabilityItemList .custom-item-row {
  --range-accent: #b95d4d;
  --range-bg: #fff3ef;
}

body[data-app-view="plans"] .allocation-row {
  grid-template-columns: minmax(230px, 0.95fr) minmax(270px, 1fr) minmax(320px, 1.25fr) minmax(38px, auto) !important;
  align-items: start;
}

body[data-app-view="plans"] .allocation-row .priority-note {
  max-width: 68ch;
  align-self: center;
}

body[data-app-view="plans"] .allocation-row .fixed-priority-spacer {
  width: 1px;
  min-width: 1px;
}

body[data-app-view="plans"] .cash-flow-subhead {
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--range-accent, #0e6472) 20%, #d7e4df);
  border-left: 6px solid var(--range-accent, #0e6472);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

body[data-app-view="plans"] .cash-flow-income-section-head {
  --range-accent: #0e6472;
  margin-top: 4px;
}

body[data-app-view="plans"] .cash-flow-expense-section-head {
  --range-accent: #b95d4d;
}

body[data-app-view="plans"] .cash-flow-subhead h3 {
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

@media (hover: none), (pointer: coarse) {
  body .note-trigger {
    width: 28px;
    height: 28px;
    min-height: 28px;
    font-size: 0.82rem;
    touch-action: manipulation;
  }

  body .note-trigger::before {
    display: none !important;
  }

  body .note-trigger::after,
  body .note-trigger.note-align-left::after,
  body .note-trigger.note-align-right::after,
  body[data-app-view="dashboard"] .summary-panel .note-trigger::after {
    position: fixed !important;
    z-index: 9999 !important;
    top: var(--note-fixed-top, 76px) !important;
    right: auto !important;
    bottom: auto !important;
    left: var(--note-fixed-left, 12px) !important;
    width: var(--note-width, min(300px, calc(100vw - 24px))) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: min(62vh, 420px);
    overflow: auto;
    transform: var(--note-fixed-transform, translateY(0)) !important;
  }

  body .note-trigger:hover::after,
  body .note-trigger:focus::after,
  body .note-trigger:focus-visible::after {
    opacity: 0;
  }

  body .note-trigger.is-visible::after {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  body[data-app-view="plans"] .cash-flow-card-head {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    overflow-x: visible !important;
  }

  body[data-app-view="plans"] .cash-flow-card-head > :nth-child(n + 3) {
    grid-column: 1 / -1;
  }

  body[data-app-view="plans"] .allocation-row,
  body[data-app-view="plans"] .allocation-row.has-schedule {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
  }

  body[data-app-view="plans"] .allocation-row .priority-note {
    max-width: none;
  }

  body[data-app-view="plans"] .dual-limit-field {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-app-view="plans"] .custom-item-list .custom-item-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-app-view="plans"] .cash-flow-subhead {
    display: grid;
    align-items: start;
  }
}

/* Final mobile/plans overrides. Keep this block last so older responsive rules do not win. */
body .chart-quick-tooltip {
  display: none !important;
}

body .chart-note-summary {
  display: block;
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  line-height: 1.45;
}

body[data-app-view="plans"] .custom-item-list .custom-item-row {
  display: grid !important;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--range-accent, #0e6472) 22%, #d7e4df);
  border-left: 8px solid var(--range-accent, #0e6472);
  border-radius: 12px;
  background: linear-gradient(90deg, var(--range-bg, #f5fbfa), #ffffff 46%);
}

body[data-app-view="plans"] #assetItemList .custom-item-row {
  --range-accent: #0e6472;
  --range-bg: #edf8f6;
}

body[data-app-view="plans"] #liabilityItemList .custom-item-row {
  --range-accent: #b95d4d;
  --range-bg: #fff3ef;
}

body[data-app-view="plans"] .allocation-row {
  grid-template-columns: minmax(230px, 0.95fr) minmax(270px, 1fr) minmax(320px, 1.25fr) minmax(38px, auto) !important;
  align-items: start;
}

body[data-app-view="plans"] .allocation-row .priority-note {
  max-width: 68ch;
  align-self: center;
}

body[data-app-view="plans"] .allocation-row .fixed-priority-spacer {
  width: 1px;
  min-width: 1px;
}

body[data-app-view="plans"] .cash-flow-subhead {
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--range-accent, #0e6472) 20%, #d7e4df);
  border-left: 6px solid var(--range-accent, #0e6472);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

body[data-app-view="plans"] .cash-flow-income-section-head {
  --range-accent: #0e6472;
  margin-top: 4px;
}

body[data-app-view="plans"] .cash-flow-expense-section-head {
  --range-accent: #b95d4d;
}

body[data-app-view="plans"] .cash-flow-subhead h3 {
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

@media (hover: none), (pointer: coarse) {
  body .note-trigger {
    width: 28px;
    height: 28px;
    min-height: 28px;
    font-size: 0.82rem;
    touch-action: manipulation;
  }

  body .note-trigger::before {
    display: none !important;
  }

  body .note-trigger::after,
  body .note-trigger.note-align-left::after,
  body .note-trigger.note-align-right::after,
  body[data-app-view="dashboard"] .summary-panel .note-trigger::after {
    position: fixed !important;
    z-index: 9999 !important;
    top: var(--note-fixed-top, 76px) !important;
    right: auto !important;
    bottom: auto !important;
    left: var(--note-fixed-left, 12px) !important;
    width: var(--note-width, min(300px, calc(100vw - 24px))) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: min(62vh, 420px);
    overflow: auto;
    transform: var(--note-fixed-transform, translateY(0)) !important;
  }

  body .note-trigger:hover::after,
  body .note-trigger:focus::after,
  body .note-trigger:focus-visible::after {
    opacity: 0;
  }

  body .note-trigger.is-visible::after {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  body[data-app-view="plans"] .cash-flow-card-head {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    overflow-x: visible !important;
  }

  body[data-app-view="plans"] .cash-flow-card-head > :nth-child(n + 3) {
    grid-column: 1 / -1;
  }

  body[data-app-view="plans"] .allocation-row,
  body[data-app-view="plans"] .allocation-row.has-schedule {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
  }

  body[data-app-view="plans"] .allocation-row .priority-note {
    max-width: none;
  }

  body[data-app-view="plans"] .dual-limit-field {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-app-view="plans"] .custom-item-list .custom-item-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-app-view="plans"] .cash-flow-subhead {
    display: grid;
    align-items: start;
  }
}

body .chart-quick-tooltip {
  display: none !important;
}

body .chart-note-summary {
  display: block;
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  line-height: 1.45;
}

body[data-app-view="plans"] .custom-item-list .custom-item-row {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--range-accent, #0e6472) 22%, #d7e4df);
  border-left: 8px solid var(--range-accent, #0e6472);
  border-radius: 12px;
  background: linear-gradient(90deg, var(--range-bg, #f5fbfa), #ffffff 46%);
}

body[data-app-view="plans"] #assetItemList .custom-item-row {
  --range-accent: #0e6472;
  --range-bg: #edf8f6;
}

body[data-app-view="plans"] #liabilityItemList .custom-item-row {
  --range-accent: #b95d4d;
  --range-bg: #fff3ef;
}

body[data-app-view="plans"] .allocation-row {
  grid-template-columns: minmax(230px, 0.95fr) minmax(270px, 1fr) minmax(320px, 1.25fr) minmax(38px, auto);
  align-items: start;
}

body[data-app-view="plans"] .allocation-row .priority-note {
  max-width: 68ch;
  align-self: center;
}

body[data-app-view="plans"] .allocation-row .fixed-priority-spacer {
  width: 1px;
  min-width: 1px;
}

body[data-app-view="plans"] .cash-flow-subhead {
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--range-accent, #0e6472) 20%, #d7e4df);
  border-left: 6px solid var(--range-accent, #0e6472);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

body[data-app-view="plans"] .cash-flow-income-section-head {
  --range-accent: #0e6472;
  margin-top: 4px;
}

body[data-app-view="plans"] .cash-flow-expense-section-head {
  --range-accent: #b95d4d;
}

body[data-app-view="plans"] .cash-flow-subhead h3 {
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

@media (hover: none), (pointer: coarse) {
  body .note-trigger {
    width: 28px;
    height: 28px;
    min-height: 28px;
    font-size: 0.82rem;
    touch-action: manipulation;
  }

  body .note-trigger::before {
    display: none !important;
  }

  body .note-trigger::after,
  body .note-trigger.note-align-left::after,
  body .note-trigger.note-align-right::after,
  body[data-app-view="dashboard"] .summary-panel .note-trigger::after {
    position: fixed !important;
    z-index: 9999 !important;
    top: var(--note-fixed-top, 76px) !important;
    right: auto !important;
    bottom: auto !important;
    left: var(--note-fixed-left, 12px) !important;
    width: var(--note-width, min(300px, calc(100vw - 24px))) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: min(62vh, 420px);
    overflow: auto;
    transform: var(--note-fixed-transform, translateY(0)) !important;
  }

  body .note-trigger:hover::after,
  body .note-trigger:focus::after,
  body .note-trigger:focus-visible::after {
    opacity: 0;
  }

  body .note-trigger.is-visible::after {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  body[data-app-view="plans"] .cash-flow-card-head {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    overflow-x: visible !important;
  }

  body[data-app-view="plans"] .cash-flow-card-head > :nth-child(n + 3) {
    grid-column: 1 / -1;
  }

  body[data-app-view="plans"] .allocation-row,
  body[data-app-view="plans"] .allocation-row.has-schedule {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
  }

  body[data-app-view="plans"] .allocation-row .priority-note {
    max-width: none;
  }

  body[data-app-view="plans"] .dual-limit-field {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-app-view="plans"] .custom-item-list .custom-item-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-app-view="plans"] .cash-flow-subhead {
    display: grid;
    align-items: start;
  }
}

.jump-bottom-button {
  justify-self: center;
  width: max-content;
  max-width: 100%;
  min-height: 42px;
  margin: 12px auto 4px;
  padding: 0 18px;
  border: 1px solid rgba(7, 85, 65, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: #075541;
  cursor: pointer;
  font-weight: 900;
}

.jump-bottom-button:hover,
.jump-bottom-button:focus-visible {
  border-color: #075541;
  background: #edf7f3;
}

body:not([data-app-view="dashboard"]) #resultsSummary .jump-bottom-button,
body:not([data-app-view="plans"]) .plans-jump-bottom,
body:not([data-app-view="plans"]) .completion-actions .jump-bottom-button {
  display: none;
}

.jump-top-button {
  justify-self: center;
  width: max-content;
  max-width: 100%;
  min-height: 42px;
  margin: 12px auto 4px;
  padding: 0 18px;
  border: 1px solid rgba(7, 85, 65, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: #075541;
  cursor: pointer;
  font-weight: 900;
}

.jump-top-button:hover,
.jump-top-button:focus-visible {
  border-color: #075541;
  background: #edf7f3;
}

body:not([data-app-view="dashboard"]) .dashboard-share-panel .jump-top-button,
body:not([data-app-view="plans"]) .completion-actions .jump-top-button {
  display: none;
}

.scroll-anchor {
  display: block;
  min-height: 1px;
  scroll-margin-top: 92px;
}

.scroll-anchor.focus-highlight {
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(7, 85, 65, 0.12);
}

.risk-auto-note {
  display: none;
}

body[data-app-view="plans"] :where(.asset-panel, .liability-panel) > .input-grid > label {
  padding: 16px;
  border: 1px solid rgba(7, 85, 65, 0.18);
  border-left: 5px solid #0b715f;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(239, 249, 245, 0.92), rgba(255, 255, 255, 0.98));
  box-shadow: 0 8px 22px rgba(16, 31, 28, 0.04);
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 950;
}

body[data-app-view="plans"] .liability-panel > .input-grid > label {
  border-left-color: #a45a48;
  background: linear-gradient(180deg, rgba(255, 248, 246, 0.94), rgba(255, 255, 255, 0.98));
}

body[data-app-view="plans"] :where(.asset-panel, .liability-panel) > .input-grid > label > input:first-of-type {
  margin-top: 10px;
}

body[data-app-view="plans"] :where(.asset-panel, .liability-panel) > .input-grid > label :where(span, small, .inline-check, .risk-level-field, .sale-summary) {
  font-size: 0.82rem;
  font-weight: 800;
}

/* June 23 responsive correction layer: this intentionally comes last. */
body {
  -webkit-user-select: none;
  user-select: none;
}

body :where(input, textarea) {
  -webkit-user-select: text;
  user-select: text;
}

body :where(button, a, select, input, textarea, .inline-check, [role="button"], [role="checkbox"], .note-trigger) {
  pointer-events: auto;
}

body :where(.product-header, .app-shell, .workspace, .planner-form, .panel, .dialog-card, .session-management, .dashboard-share-panel) {
  min-width: 0;
  max-width: 100%;
}

body :where(.chart-tooltip, .chart-quick-tooltip, .note-trigger::after) {
  max-width: min(380px, calc(100vw - 28px));
  overflow-wrap: anywhere;
  white-space: normal;
}

body :where(.site-footer, .site-footer *, .app-shell, .workspace, .planner-form, .panel, .section-head, .field-help, .example-note, .summary-panel, .session-panel, .dashboard-share-panel) {
  cursor: url("assets/no-entry-cursor.svg") 10 10, not-allowed;
}

body :where(button, a, select, input, textarea, .inline-check, .inline-check *, [role="button"], [role="checkbox"], .note-trigger, .chart-wrap, .chart-wrap canvas, .chart-tooltip, .chart-tooltip *) {
  cursor: pointer;
}

body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea) {
  cursor: text;
}

body :where(.chart-wrap, .chart-wrap canvas) {
  cursor: crosshair;
}

@media (min-width: 901px) {
  body .product-header {
    grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr) !important;
    gap: clamp(10px, 1.4vw, 24px);
  }

  body .account-actions,
  body .menu-button {
    display: none !important;
  }

  body .product-menu,
  body .product-menu[aria-hidden="true"] {
    position: static !important;
    display: contents !important;
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  body .product-menu .product-nav {
    grid-column: 2;
    position: static;
    display: flex;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 0.8vw, 16px);
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body .product-menu .menu-actions {
    grid-column: 3;
    position: static;
    display: flex;
    align-self: center;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body .product-menu .product-nav a,
  body .product-menu .product-nav .nav-link {
    position: relative;
    justify-content: center;
    min-height: 76px;
    padding: 0 clamp(7px, 0.8vw, 16px);
    border-radius: 0;
    text-align: center;
    white-space: nowrap;
  }

  body .product-menu .product-nav .is-active::after {
    display: block;
  }

  body .product-menu .language-picker {
    display: block;
    min-width: 0;
  }

  body .product-menu .language-picker span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  body .product-menu .language-picker select {
    width: clamp(118px, 9.5vw, 150px);
    min-height: 44px;
    padding: 0 12px;
    white-space: nowrap;
  }

  body .product-menu .outline-action,
  body .product-menu .app-primary-action {
    width: auto;
    min-height: 44px;
    padding: 0 16px;
    white-space: nowrap;
  }

  body[data-app-view="plans"] .side-nav {
    position: sticky;
    top: 96px;
    display: grid !important;
    align-self: start;
    grid-column: 1;
    grid-row: 1 / span 4;
    max-height: calc(100vh - 112px);
    overflow: auto;
  }

  body[data-app-view="plans"] .side-nav-group:not([hidden]) {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-app-view="plans"] .custom-item-row {
    grid-template-columns: minmax(210px, 1fr) minmax(130px, 0.45fr);
  }

  body[data-app-view="plans"] .custom-item-row.has-include {
    grid-template-columns: minmax(210px, 1fr) minmax(130px, 0.45fr) minmax(160px, auto);
  }

  body[data-app-view="plans"] .custom-item-row.has-return {
    grid-template-columns: minmax(210px, 1fr) minmax(130px, 0.45fr) minmax(130px, 0.45fr);
  }

  body[data-app-view="plans"] .custom-item-row.has-risk {
    grid-template-columns: minmax(210px, 1fr) minmax(130px, 0.45fr) minmax(190px, 0.65fr);
  }

  body[data-app-view="plans"] .custom-item-row.has-liability-interest {
    grid-template-columns: minmax(210px, 1fr) minmax(130px, 0.45fr) minmax(120px, 0.4fr) minmax(170px, 0.55fr) minmax(160px, auto);
  }

  body[data-app-view="plans"] .cash-flow-row,
  body[data-app-view="plans"] .allocation-range-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-app-view="plans"] .allocation-row {
    grid-template-columns: minmax(160px, 0.8fr) minmax(120px, 0.45fr) minmax(120px, 0.45fr) minmax(260px, 1.6fr) auto;
  }

  body[data-app-view="plans"] .allocation-row.has-schedule {
    grid-template-columns: minmax(160px, 0.8fr) minmax(120px, 0.45fr) minmax(120px, 0.45fr) minmax(190px, 0.9fr) minmax(260px, 1.35fr) auto;
  }

  body[data-app-view="dashboard"] .chart-panel canvas {
    aspect-ratio: 760 / 360;
    max-height: 420px;
  }
}

@media (max-width: 900px) {
  body .product-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: 64px;
    padding: 0 12px;
  }

  body .account-actions {
    display: flex;
    justify-content: flex-end;
  }

  body .menu-button {
    display: inline-flex !important;
  }

  body .product-brand small {
    display: none;
  }

  body .product-menu,
  body .product-menu[aria-hidden="true"] {
    position: absolute;
    z-index: 80;
    top: calc(100% + 8px);
    right: 12px;
    display: none;
    width: min(360px, calc(100vw - 24px));
    padding: 14px;
    border: 1px solid var(--dashboard-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 48px rgba(16, 33, 63, 0.16);
  }

  body .product-menu.is-open {
    display: grid !important;
    gap: 12px;
  }

  body .product-menu .product-nav,
  body .product-menu .menu-actions {
    display: grid;
    width: 100%;
    gap: 8px;
  }

  body .product-menu .product-nav a,
  body .product-menu .product-nav .nav-link,
  body .product-menu .outline-action,
  body .product-menu .app-primary-action,
  body .product-menu .language-picker select {
    width: 100%;
    max-width: none;
    min-height: 44px;
    justify-content: center;
  }

  body .product-menu .language-picker span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  body .app-shell,
  body[data-app-view="plans"] .app-shell {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
  }

  body[data-app-view="plans"] .side-nav {
    display: none !important;
  }

  body[data-app-view="dashboard"] .planner-form,
  body[data-app-view="plans"] .planner-form {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-app-view="plans"] :where(.assumptions-panel, .balance-sheet-grid, .cash-flow-panel, .allocation-plan-panel, .input-grid, .custom-item-row, .cash-flow-row, .allocation-range-row, .allocation-row, .shortfall-row, .liability-repayment-row, .real-property-sale-fields) {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-app-view="plans"] :where(input, select, textarea, label, .suffix-input, .risk-level-field, .sale-summary, .balance-share) {
    min-width: 0;
    max-width: 100%;
  }

  body .note-trigger::before {
    display: none !important;
  }

  body .note-trigger::after,
  body .note-trigger.note-align-left::after,
  body .note-trigger.note-align-right::after,
  body[data-app-view="dashboard"] .summary-panel .note-trigger::after {
    position: fixed !important;
    z-index: 9999;
    top: 76px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    transform: none !important;
  }

  body :where(.chart-tooltip, .chart-quick-tooltip) {
    max-width: calc(100vw - 24px);
  }
}

body .note-trigger::after {
  max-width: calc(100vw - 32px);
  overflow-wrap: anywhere;
}

body .note-trigger.note-align-left::after {
  left: 0;
  transform: translate(0, 6px);
}

body .note-trigger.note-align-left:hover::after,
body .note-trigger.note-align-left:focus::after,
body .note-trigger.note-align-left.is-visible::after {
  transform: translate(0, 0);
}

body .note-trigger.note-align-right::after {
  right: 0;
  left: auto;
  transform: translate(0, 6px);
}

body .note-trigger.note-align-right:hover::after,
body .note-trigger.note-align-right:focus::after,
body .note-trigger.note-align-right.is-visible::after {
  transform: translate(0, 0);
}

/* June 23 responsive correction layer */
body {
  -webkit-user-select: none;
  user-select: none;
}

body :where(input, textarea) {
  -webkit-user-select: text;
  user-select: text;
}

body :where(select, button, a, input, textarea, .inline-check, [role="button"], [role="checkbox"]) {
  pointer-events: auto;
}

@media (min-width: 901px) {
  body .product-header {
    grid-template-columns: minmax(270px, 1fr) auto minmax(280px, 1fr) !important;
  }

  body .account-actions {
    display: none;
  }

  body .menu-button {
    display: none !important;
  }

  body .product-menu,
  body .product-menu[aria-hidden="true"] {
    position: static;
    display: contents;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  body .product-menu .product-nav {
    display: flex;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1vw, 18px);
  }

  body .product-menu .menu-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
  }

  body .product-menu .product-nav a,
  body .product-menu .product-nav .nav-link {
    min-height: 76px;
    padding: 0 10px;
    border-radius: 0;
  }

  body .product-menu .product-nav .is-active::after {
    display: block;
  }

  body .product-menu .language-picker {
    display: inline-flex;
    align-items: center;
  }

  body .product-menu .language-picker span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  body .product-menu .language-picker select {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
  }

  body .product-menu .outline-action,
  body .product-menu .app-primary-action {
    width: auto;
    white-space: nowrap;
  }

  body[data-app-view="plans"] .side-nav {
    position: sticky;
    top: 100px;
    display: grid;
  }

  body[data-app-view="plans"] .custom-item-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 40px;
  }

  body[data-app-view="plans"] .custom-item-row.has-include {
    grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.8fr) minmax(180px, 1fr) 40px;
  }

  body[data-app-view="plans"] .custom-item-row.has-return {
    grid-template-columns: minmax(170px, 1.15fr) minmax(120px, 0.7fr) minmax(100px, 0.5fr) minmax(150px, 0.8fr) minmax(165px, 0.9fr) 40px;
  }

  body[data-app-view="plans"] .custom-item-row.has-risk {
    grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.75fr) minmax(170px, 0.9fr) minmax(180px, 1fr) 40px;
  }

  body[data-app-view="plans"] .custom-item-row.has-liability-interest {
    grid-template-columns:
      minmax(170px, 1.1fr) minmax(120px, 0.7fr) minmax(105px, 0.55fr)
      minmax(145px, 0.8fr) minmax(120px, 0.7fr) minmax(180px, 1fr) 40px;
  }

  body[data-app-view="plans"] .allocation-range-row,
  body[data-app-view="plans"] .cash-flow-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-app-view="plans"] .allocation-row {
    grid-template-columns: minmax(220px, 0.9fr) minmax(180px, 0.8fr) minmax(320px, 1.4fr) 40px;
  }

  body[data-app-view="plans"] .allocation-row.has-schedule {
    grid-template-columns:
      minmax(84px, 0.5fr) minmax(100px, 0.6fr) minmax(190px, 1.2fr)
      minmax(170px, 0.9fr) minmax(220px, 1fr) 40px;
  }
}

@media (max-width: 900px) {
  body .product-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  body .account-actions {
    display: flex;
  }

  body .menu-button {
    display: inline-flex !important;
  }

  body .product-menu {
    position: absolute;
    z-index: 70;
    top: calc(100% + 8px);
    right: 12px;
    display: none;
    width: min(360px, calc(100vw - 24px));
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--dashboard-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 48px rgba(16, 33, 63, 0.16);
    backdrop-filter: blur(16px);
  }

  body .product-menu.is-open {
    display: grid;
  }

  body .product-menu .product-nav,
  body .product-menu .menu-actions {
    display: grid;
    width: 100%;
    gap: 8px;
  }

  body .product-menu .product-nav a,
  body .product-menu .product-nav .nav-link {
    justify-content: start;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    text-align: left;
  }

  body .product-menu .product-nav .is-active::after {
    display: none;
  }

  body .product-menu .language-picker {
    display: grid;
    gap: 6px;
  }

  body .product-menu .language-picker span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  body .product-menu .language-picker select,
  body .product-menu .outline-action,
  body .product-menu .app-primary-action {
    width: 100%;
    max-width: none;
  }

  body[data-app-view="plans"] .side-nav {
    display: none !important;
  }

  body[data-app-view="plans"] .app-shell,
  body[data-app-view="plans"] .planner-form,
  body[data-app-view="plans"] .panel,
  body[data-app-view="plans"] .balance-sheet-grid,
  body[data-app-view="plans"] .input-grid,
  body[data-app-view="plans"] .custom-item-list,
  body[data-app-view="plans"] .custom-item-row,
  body[data-app-view="plans"] .cash-flow-row,
  body[data-app-view="plans"] .allocation-range-row,
  body[data-app-view="plans"] .allocation-row,
  body[data-app-view="plans"] .shortfall-row,
  body[data-app-view="plans"] .liability-repayment-row {
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-app-view="plans"] .balance-sheet-grid .input-grid,
  body[data-app-view="plans"] .input-grid,
  body[data-app-view="plans"] .input-grid.compact,
  body[data-app-view="plans"] .input-grid.compact.cash-flow-income-grid,
  body[data-app-view="plans"] .custom-item-row,
  body[data-app-view="plans"] .custom-item-row.has-include,
  body[data-app-view="plans"] .custom-item-row.has-return,
  body[data-app-view="plans"] .custom-item-row.has-risk,
  body[data-app-view="plans"] .custom-item-row.has-liability-interest,
  body[data-app-view="plans"] .allocation-row,
  body[data-app-view="plans"] .allocation-row.has-schedule,
  body[data-app-view="plans"] .shortfall-row,
  body[data-app-view="plans"] .cash-flow-card-head {
    grid-template-columns: minmax(0, 1fr);
  }

  body .note-trigger::after {
    position: fixed;
    top: 72px;
    right: 12px;
    bottom: auto;
    left: 12px;
    width: auto;
    max-width: none;
    transform: none !important;
  }

  body .note-trigger::before {
    display: none;
  }
}

@media (hover: none), (pointer: coarse) {
  body :where(
    .app-shell,
    .workspace,
    .planner-form,
    .panel,
    .site-footer,
    label,
    .section-head,
    .example-note,
    .field-help,
    .balance-sheet-grid,
    .cash-flow-row,
    .allocation-range-row,
    .allocation-row,
    .shortfall-row,
    .liability-repayment-row
  ) {
    cursor: url("assets/no-entry-cursor.svg") 10 10, not-allowed;
  }
}

body[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef7f3;
  --muted: #b6c6c0;
  --line: #29443c;
  --surface: #071310;
  --panel: #10211c;
  --dashboard-line: #29443c;
  --dashboard-navy: #eef7f3;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

body[data-theme="dark"] :where(.product-header, .panel, .metric, .session-panel, .dialog-card, .profile-card, .profile-target-card, .profile-suggestions, .next-action-card, .support-option) {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

body[data-theme="dark"] :where(input, select, textarea, .dialog-card input, .dialog-card select, .dialog-card textarea) {
  border-color: #3a5a50;
  background: #0b1a16;
  color: var(--ink);
}

body[data-theme="dark"] :where(.product-nav a:hover, .product-nav a:focus-visible, .nav-link:hover, .nav-link:focus-visible, .product-nav .is-active) {
  background: #123329;
  color: #bfe8db;
}

body[data-theme="dark"] :where(.outline-action, .menu-button) {
  border-color: #4f7569;
  background: #0b1a16;
  color: #bfe8db;
}

body[data-theme="dark"] .chart-panel canvas {
  border-color: #29443c;
  background: #0b1a16;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--surface);
  color: var(--ink);
  overflow-anchor: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: flex;
  flex-direction: column;
  width: min(1640px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.summary-panel {
  min-height: 330px;
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding: 28px;
  border: 1px solid rgba(23, 33, 31, 0.08);
  background: #073f35;
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(5, 62, 52, 0.16);
  color: #fff;
}

.brand-row,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.currency-picker {
  min-width: 148px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.currency-picker select {
  max-width: none;
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.13);
  color: white;
}

.currency-picker option {
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 6px;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.72;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.16rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  cursor: pointer;
}

.header-button {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: white;
  cursor: pointer;
  font-weight: 800;
}

.header-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

.metric {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(16px);
}

.metric.primary {
  background: rgba(255, 255, 255, 0.2);
}

.metric span,
.metric small {
  color: inherit;
  font-size: 0.82rem;
  opacity: 0.76;
}

.label-with-note {
  display: inline-flex;
  position: relative;
  align-items: center;
  gap: 6px;
}

.note-trigger {
  position: relative;
  display: inline-grid;
  width: 20px;
  height: 20px;
  min-height: 20px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  cursor: help;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0.95;
}

.note-trigger.light-note {
  background: #eef5f1;
  color: var(--teal);
}

.note-trigger::after {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(100% + 10px);
  width: min(380px, 86vw);
  padding: 12px;
  border: 1px solid rgba(23, 33, 31, 0.14);
  border-radius: 8px;
  background: #17211f;
  color: white;
  box-shadow: 0 14px 34px rgba(23, 33, 31, 0.22);
  content: attr(data-note);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  text-transform: none;
  transform: translate(-50%, 6px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
  white-space: pre-line;
}

.note-trigger::before {
  position: absolute;
  z-index: 21;
  left: 50%;
  bottom: calc(100% + 4px);
  width: 10px;
  height: 10px;
  background: #17211f;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px) rotate(45deg);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.note-trigger:hover::after,
.note-trigger:focus::after,
.note-trigger:focus-visible::after,
.note-trigger.is-visible::after,
.note-trigger:hover::before,
.note-trigger:focus::before,
.note-trigger:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.note-trigger.is-visible::before {
  opacity: 1;
  transform: translate(-50%, 0) rotate(45deg);
}

.metric strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 2.8vw, 2.1rem);
  line-height: 1.06;
}

.progress-metric {
  gap: 10px;
}

.fire-progress-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.fire-progress-track div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #b7e4c9;
  transition: width 0.18s ease;
}

.warning-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.warning-badge {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 3px;
  max-width: 280px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.warning-level {
  grid-column: 2;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
}

.warning-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.warning-badge strong {
  grid-column: 2;
  font-size: 0.8rem;
  line-height: 1.2;
}

.warning-badge small {
  grid-column: 2;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.3;
}

.warning-badge.action {
  order: -1;
  min-width: min(340px, 100%);
  border: 2px solid #ffd0c5;
  background: #a83f34;
  box-shadow: 0 0 0 3px rgba(255, 208, 197, 0.18), 0 8px 18px rgba(78, 18, 13, 0.28);
}

.warning-badge.action .warning-icon {
  background: white;
  border-color: white;
  color: #a83f34;
}

.warning-badge.action .warning-level {
  color: #ffe1da;
}

.warning-badge.action strong {
  font-size: 0.9rem;
}

.warning-badge.action small {
  color: white;
  font-weight: 750;
}

.warning-badge.attention {
  border-color: rgba(255, 221, 154, 0.72);
  background: rgba(196, 139, 37, 0.34);
}

.warning-badge.info {
  border-color: rgba(190, 230, 226, 0.6);
  background: rgba(66, 103, 172, 0.26);
}

.warning-badge.is-clear {
  display: grid;
  grid-template-columns: 1fr;
  background: rgba(183, 228, 201, 0.18);
}

.warning-badge.is-clear strong,
.warning-badge.is-clear small {
  grid-column: 1;
}

.workspace {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.side-nav {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbe2dd;
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.92);
  box-shadow: 0 16px 36px rgba(23, 33, 31, 0.08);
}

.side-nav span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.side-nav-group + .side-nav-group {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #dbe2dd;
}

.side-nav-group strong {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.side-nav button {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.side-nav button:hover,
.side-nav button:focus-visible {
  border-color: color-mix(in srgb, var(--teal) 34%, #dbe2dd);
  outline: none;
  background: #eef8f7;
}

.planner-form {
  display: grid;
  gap: 20px;
}

.planner-form > section,
#resultsSummary {
  scroll-margin-top: 16px;
}

.projection-assumption-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.session-panel {
  margin-bottom: 20px;
}

.session-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) auto auto auto minmax(180px, 1fr) auto auto auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.session-autosave {
  min-height: 36px;
  align-content: center;
  padding-bottom: 8px;
}

.session-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.session-status.warning {
  color: var(--rose);
}

.balance-sheet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.panel {
  --panel-accent: var(--teal);
  --panel-tint: #f4faf8;
  padding: 26px;
  border: 1px solid color-mix(in srgb, var(--panel-accent) 18%, var(--line));
  border-top: 6px solid var(--panel-accent);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-tint), rgba(255, 255, 255, 0.9) 112px);
  box-shadow: 0 8px 26px rgba(35, 46, 41, 0.06);
}

.panel .section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--panel-accent) 20%, #e6ece8);
}

.minimize-panel {
  flex: 0 0 auto;
  width: 34px;
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--panel-accent) 34%, #cbd7d1);
  border-radius: 999px;
  background: #fbfcfa;
  color: var(--panel-accent);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

.panel.is-collapsed > :not(.section-head) {
  display: none !important;
}

.panel.is-collapsed .section-head {
  padding-bottom: 0;
  border-bottom: 0;
}

.panel .eyebrow {
  color: var(--panel-accent);
  opacity: 0.92;
}

.session-panel {
  --panel-accent: #6d6678;
  --panel-tint: #f7f5fa;
}

.chart-panel {
  --panel-accent: var(--teal);
  --panel-tint: #eef8f7;
}

.outside-chart-panel {
  --panel-accent: #4267ac;
  --panel-tint: #f0f5ff;
}

.assumptions-panel {
  --panel-accent: var(--gold);
  --panel-tint: #fff8e8;
  grid-column: 1 / -1;
}

.profile-panel {
  --panel-accent: #6d6678;
  --panel-tint: #f7f5fa;
  grid-column: 1 / -1;
}

.decision-panel {
  --panel-accent: var(--mint);
  --panel-tint: #eef9f4;
  grid-column: 1 / -1;
}

.asset-panel {
  --panel-accent: var(--mint);
  --panel-tint: #eef9f4;
}

.liability-panel {
  --panel-accent: var(--rose);
  --panel-tint: #fff3ef;
}

.cash-flow-panel {
  --panel-accent: var(--blue);
  --panel-tint: #f0f5ff;
}

.example-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.section-total-card,
.asset-return-summary {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #dbe2dd;
  border-radius: 8px;
  background: #fbfcfa;
}

.section-total-card span,
.asset-return-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.section-total-card strong,
.asset-return-summary strong {
  color: var(--teal);
  font-size: 1.3rem;
}

.liability-total-card strong {
  color: var(--rose);
}

.asset-return-summary small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.profile-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid #dbe2dd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.profile-card span,
.profile-suggestions h3 {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-card strong {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.profile-card small {
  color: var(--muted);
  line-height: 1.35;
}

.profile-spectrum-card {
  min-height: 0;
}

.profile-spectrum {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.profile-spectrum-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 58px;
  overflow: hidden;
  border: 1px solid #dbe2dd;
  border-radius: 8px;
  background: linear-gradient(90deg, #dfe8e1 0 20%, #edf0dc 20% 40%, #f4ecd7 40% 60%, #f2dfcc 60% 80%, #efd7d3 80% 100%);
}

.profile-spectrum-track span {
  display: grid;
  place-items: center;
  padding: 20px 6px 8px;
  border-right: 1px solid rgba(43, 64, 58, 0.12);
  color: #273833;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.profile-spectrum-track span:last-of-type {
  border-right: 0;
}

.profile-spectrum-track i {
  position: absolute;
  top: 8px;
  left: var(--profile-position, 50%);
  width: 16px;
  height: 16px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 4px 12px rgba(20, 35, 31, 0.24);
  transform: translateX(-50%);
}

.profile-spectrum-track i::after {
  position: absolute;
  top: 13px;
  left: 50%;
  width: 2px;
  height: 32px;
  background: var(--teal);
  content: "";
  transform: translateX(-50%);
}

.profile-spectrum-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.profile-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.profile-review-card {
  padding: 14px 16px;
  border: 1px solid #dbe2dd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.profile-review-card h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-review-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.profile-review-card li {
  line-height: 1.45;
}

.profile-strength-card {
  border-left: 5px solid var(--mint);
}

.profile-weak-card {
  border-left: 5px solid var(--rose);
}

.profile-suggestions {
  margin-top: 16px;
}

.profile-suggestions h3 {
  margin-bottom: 8px;
}

.profile-suggestions ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.profile-suggestions li {
  line-height: 1.45;
}

.next-action-card {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--teal) 24%, #dbe2dd);
  border-radius: 8px;
  background: #fbfcfa;
}

.next-action-card span,
.decision-panel h3 {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.next-action-card strong {
  font-size: 1.1rem;
}

.next-action-card small {
  color: var(--muted);
  line-height: 1.4;
}

.decision-grid {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.scenario-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 10px 0 12px;
}

.scenario-table-wrap {
  overflow-x: auto;
}

.scenario-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: rgba(255, 255, 255, 0.72);
}

.scenario-table th,
.scenario-table td {
  padding: 10px;
  border-bottom: 1px solid #dbe2dd;
  text-align: left;
}

.scenario-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.scenario-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scenario-name-cell span {
  min-width: 0;
}

.scenario-refresh {
  border: 1px solid rgba(0, 91, 101, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--teal);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 6px 9px;
}

.scenario-refresh:hover {
  background: rgba(0, 91, 101, 0.08);
}

.scenario-remove {
  border: 0;
  background: transparent;
  color: var(--rose);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
}

.timeline-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.timeline-summary > span,
.timeline-chip {
  display: block;
  position: relative;
  min-width: 220px;
  padding: 12px 38px 12px 14px;
  border: 1px solid #dbe2dd;
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 0.82rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.timeline-summary strong,
.timeline-chip strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.timeline-chip:hover,
.timeline-chip:focus-visible {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(18, 121, 134, 0.12);
}

.timeline-remove {
  position: absolute;
  top: 12px;
  right: 14px;
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--danger);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.timeline-remove:hover,
.timeline-remove:focus-visible {
  outline: none;
  color: #9f3325;
}

.custom-items {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e0e7e2;
}

.custom-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.custom-items-head h3 {
  margin: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.profile-target-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dbe5df;
  border-radius: 8px;
  background: #fbfcfa;
}

.profile-target-card h3 {
  margin: 0;
}

.profile-target-card strong {
  color: var(--teal);
  font-size: 1.15rem;
}

.text-button {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid #cad5cf;
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--teal);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.primary-action {
  border-color: rgba(14, 100, 114, 0.3);
  background: var(--teal);
  color: white;
}

.primary-action.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: wait;
  opacity: 0.88;
}

.primary-action.is-loading::before {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: refresh-button-spin 0.75s linear infinite;
}

@keyframes refresh-button-spin {
  to {
    transform: rotate(360deg);
  }
}

.danger-action {
  border-color: rgba(185, 93, 77, 0.32);
  background: #fff8f6;
  color: var(--rose);
}

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

.custom-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: end;
}

.custom-item-row.has-include {
  grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.8fr) minmax(180px, 1fr) 40px;
}

.custom-item-row.has-return {
  grid-template-columns: minmax(170px, 1.15fr) minmax(120px, 0.7fr) minmax(100px, 0.5fr) minmax(150px, 0.8fr) minmax(165px, 0.9fr) 40px;
}

.custom-item-row.has-risk {
  grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.75fr) minmax(170px, 0.9fr) minmax(180px, 1fr) 40px;
}

.custom-item-row.has-liability-interest {
  grid-template-columns:
    minmax(170px, 1.1fr) minmax(120px, 0.7fr) minmax(105px, 0.55fr)
    minmax(145px, 0.8fr) minmax(120px, 0.7fr) minmax(180px, 1fr) 40px;
}

.custom-return-input {
  grid-template-columns: 1fr 34px;
}

.risk-level-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.risk-level-field select {
  max-width: none;
  min-height: 40px;
  color: var(--ink);
  font-size: 0.9rem;
}

.risk-auto-note {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
}

.asset-return-toggle {
  justify-self: end;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.custom-liability-interest-input {
  grid-template-columns: 1fr 34px;
}

.remove-item {
  display: grid;
  width: 40px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid rgba(185, 93, 77, 0.28);
  border-radius: 8px;
  background: #fff8f6;
  color: var(--rose);
  cursor: pointer;
  font-weight: 900;
}

.fixed-priority-spacer {
  display: grid;
  min-height: 44px;
  place-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.input-grid > label {
  align-content: start;
}

.balance-sheet-grid .input-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 20px;
}

.balance-sheet-grid .input-grid > label {
  gap: 10px;
  min-width: 0;
}

.allocation-status {
  margin: 0 0 20px;
  padding: 0 4px;
}

.completion-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 6px;
}

.results-refresh-note {
  color: var(--rose);
  font-weight: 800;
  text-align: center;
}

.results-refresh-note.is-current {
  color: var(--muted);
}

.allocation-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-top: 8px;
}

.allocation-plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

.allocation-range-list {
  display: grid;
  gap: 18px;
}

.allocation-range-row {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid #d7e4df;
  border-radius: 8px;
  background: #fbfcfa;
}

.limit-warning {
  display: block;
  color: var(--rose) !important;
  font-weight: 800;
}

.limit-enforce-wrap {
  margin-top: 8px;
  color: var(--teal);
  font-weight: 800;
  line-height: 1.35;
}

.input-warning {
  border-color: var(--rose);
  background: #fff8f6;
}

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

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

.dual-limit-field .limit-enforce-wrap {
  grid-column: 1 / -1;
}

.allocation-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(180px, 0.8fr) minmax(320px, 1.4fr) 40px;
  gap: 14px;
  align-items: end;
}

.allocation-row.has-schedule {
  grid-template-columns:
    minmax(84px, 0.5fr) minmax(100px, 0.6fr) minmax(190px, 1.2fr)
    minmax(170px, 0.9fr) minmax(220px, 1fr) 40px;
}

.priority-note {
  align-self: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.priority-note.warning {
  color: var(--rose);
}

.allocation-range-list.needs-next-priority .add-range-allocation {
  border-color: rgba(185, 93, 77, 0.65);
  background: rgba(185, 93, 77, 0.1);
  color: var(--rose);
}

.allocation-range-list.needs-next-priority .allocation-status,
.allocation-range-list.needs-next-priority + .allocation-status {
  color: var(--rose);
}

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

.cash-flow-add-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.cash-flow-add-controls label {
  min-width: 150px;
}

.cash-flow-add-controls .inline-check {
  min-height: 40px;
  padding-bottom: 8px;
}

.range-add-controls-inline {
  justify-content: center;
  padding: 2px 0 8px;
}

.range-add-title {
  color: var(--teal);
  font-weight: 900;
  align-self: center;
}

.cash-flow-row {
  --range-accent: #0e6472;
  --range-bg: #f5fbfa;
  display: grid;
  gap: 18px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--range-accent) 24%, #e0e7e2);
  border-left: 8px solid var(--range-accent);
  border-radius: 8px;
  background: linear-gradient(90deg, var(--range-bg), #fbfcfa 42%);
}

.cash-flow-row:nth-child(6n + 1) {
  --range-accent: #0e6472;
  --range-bg: #edf8f6;
}

.cash-flow-row:nth-child(6n + 2) {
  --range-accent: #b95d4d;
  --range-bg: #fff3ef;
}

.cash-flow-row:nth-child(6n + 3) {
  --range-accent: #4267ac;
  --range-bg: #f0f5ff;
}

.cash-flow-row:nth-child(6n + 4) {
  --range-accent: #c48b25;
  --range-bg: #fff8e8;
}

.cash-flow-row:nth-child(6n + 5) {
  --range-accent: #2f8f75;
  --range-bg: #eef9f4;
}

.cash-flow-row:nth-child(6n) {
  --range-accent: #6d6678;
  --range-bg: #f5f3f8;
}

.cash-flow-row.focus-highlight {
  box-shadow: 0 0 0 4px rgba(18, 121, 134, 0.16);
}

.allocation-range-row.focus-highlight,
.panel.focus-highlight,
.projection-assumption-grid.focus-highlight {
  box-shadow: 0 0 0 4px rgba(18, 121, 134, 0.16);
}

.cash-flow-card-head {
  display: grid;
  grid-template-columns: minmax(95px, 0.5fr) minmax(120px, 0.6fr) repeat(3, minmax(165px, 1fr)) 40px;
  gap: 10px;
  align-items: end;
}

.cash-flow-card-head > label:first-child {
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--range-accent) 12%, white);
  color: #21302c;
}

.cash-flow-card-head > label:first-child input {
  border-color: color-mix(in srgb, var(--range-accent) 40%, #cbd7d1);
}

.cash-flow-saving {
  display: grid;
  min-height: 44px;
  align-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #dbe2dd;
  border-radius: 8px;
  background: white;
}

.cash-flow-saving span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cash-flow-saving strong {
  color: var(--ink);
}

.cash-flow-fire-target.is-not-used {
  background: #1f2724;
  border-color: #1f2724;
  color: rgba(255, 255, 255, 0.7);
}

.cash-flow-fire-target.is-not-used strong,
.cash-flow-fire-target.is-not-used span,
.cash-flow-fire-target.is-not-used small,
.cash-flow-fire-target.is-not-used label {
  color: rgba(255, 255, 255, 0.72);
}

.cash-flow-fire-target.is-not-used input,
.cash-flow-fire-target.is-not-used select {
  opacity: 0.6;
}

.cash-flow-saving small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.manual-fire-target {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.manual-fire-target[hidden] {
  display: none;
}

.cash-flow-subhead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.cash-flow-subhead h3 {
  margin: 0 0 8px;
}

.cash-flow-subhead .cash-flow-saving {
  min-width: 210px;
}

.cash-flow-allocation {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #e0e7e2;
}

.cash-flow-positive-allocation {
  display: grid;
  gap: 10px;
}

.cash-flow-positive-allocation[hidden] {
  display: none;
}

.cash-flow-shortfall {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid #e0e7e2;
}

.cash-flow-shortfall[hidden] {
  display: none;
}

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

.shortfall-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(180px, 0.8fr) minmax(320px, 1.4fr) 40px;
  gap: 14px;
  align-items: end;
}

.shortfall-target {
  max-width: none;
}

.shortfall-row small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.shortfall-targets {
  display: contents;
}

.shortfall-limit-field input {
  max-width: none;
  min-height: 40px;
}

.liability-repayment-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.75fr) minmax(240px, 1.1fr) 40px;
  gap: 10px;
  align-items: end;
}

.repayment-status {
  color: #5f6f6b;
  font-weight: 700;
  line-height: 1.35;
}

.repayment-status.warning {
  color: #b95d4d;
}

.cash-flow-custom-expenses {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e0e7e2;
}

.cash-flow-custom-expenses h4 {
  margin: 0;
  font-size: 0.95rem;
}

.allocation-control {
  display: grid;
  gap: 7px;
}

.allocation-control > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.allocation-control > div {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) minmax(74px, 0.7fr);
  gap: 8px;
}

.balance-sheet-grid .allocation-control > div {
  grid-template-columns: minmax(150px, 1fr) minmax(96px, 0.6fr);
}

.liability-panel .input-grid > label select {
  max-width: none;
}

.liability-starting-debt-field[hidden] {
  display: none;
}

.interest-method-help {
  margin-top: 2px;
}

.allocation-control select,
.allocation-control input,
.allocation-limit-field input {
  max-width: none;
  min-height: 40px;
}

.custom-allocation-control > div {
  grid-template-columns: minmax(145px, 1fr) minmax(88px, 0.6fr);
}

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

.input-grid.compact.cash-flow-income-grid {
  grid-template-columns: minmax(250px, 1.25fr) minmax(150px, 0.75fr) repeat(2, minmax(160px, 1fr));
  align-items: start;
}

.salary-field {
  align-content: start;
}

.salary-increment-check,
.salary-carry-check {
  margin-top: 2px;
}

.retirement-rate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.retirement-rate-grid > div {
  display: grid;
  gap: 6px;
}

.retirement-rate-grid > div > span,
.retirement-contribution-note {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.retirement-contribution-note {
  line-height: 1.35;
}

input.is-calculated {
  background: #eef3f0;
  color: #60706a;
  cursor: not-allowed;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  user-select: none;
}

.inline-check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--teal);
  cursor: pointer;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cad5cf;
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  outline: none;
}

input[type="checkbox"] {
  appearance: auto;
  width: 18px !important;
  min-width: 18px;
  height: 18px !important;
  min-height: 18px !important;
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--teal);
  cursor: pointer;
}

input {
  padding: 10px 12px;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 100, 114, 0.14);
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}

.start-after-fire-note.is-review-warning {
  color: var(--rose);
  font-weight: 850;
}

.real-property-sale-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dbe2dd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.real-property-sale-fields[hidden] {
  display: none;
}

.custom-real-property-sale-toggle,
.custom-real-property-sale-fields {
  grid-column: 1 / -1;
}

.sale-summary {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 14px;
  padding-top: 8px;
  border-top: 1px solid #dbe2dd;
}

.sale-summary span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sale-summary strong {
  color: var(--teal);
}

.suffix-input {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) 42px;
  overflow: hidden;
  border: 1px solid #cad5cf;
  border-radius: 8px;
  background: #fbfcfa;
}

.suffix-input:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 100, 114, 0.14);
}

.suffix-input input {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.suffix-input span {
  display: grid;
  place-items: center;
  border-left: 1px solid #dbe2dd;
  color: var(--muted);
  font-weight: 800;
}

.compact-suffix {
  grid-template-columns: minmax(0, 1fr) 44px;
  position: relative;
  padding-top: 18px;
}

.compact-suffix::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--muted);
  content: attr(data-inline-label);
  font-size: 0.76rem;
  font-weight: 700;
}

.compact-suffix.no-inline-label {
  padding-top: 0;
}

.compact-suffix.no-inline-label::before {
  content: none;
}

.compact-suffix input {
  min-width: 0;
  padding-right: 8px;
}

.income-expense-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 18px;
}

select {
  max-width: 132px;
  padding: 8px 10px;
}

.projection-years {
  width: 110px;
}

.projection-years select,
.projection-years input {
  max-width: none;
  min-height: 40px;
}

.chart-wrap {
  position: relative;
  margin-top: 16px;
  overflow-anchor: none;
}

.secondary-chart-wrap {
  display: grid;
  gap: 10px;
}

.outside-graph-options {
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.outside-graph-legend {
  display: flex;
  gap: 8px 16px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.outside-graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1.25;
}

.outside-graph-legend i {
  display: inline-block;
  width: 24px;
  height: 4px;
  flex: 0 0 24px;
  border-radius: 999px;
  background: var(--line-color);
}

.outside-graph-choice {
  min-height: 24px;
  gap: 8px;
  align-items: center;
}

.outside-graph-choice select {
  width: auto;
  min-height: 32px;
  padding: 5px 30px 5px 8px;
  font-size: 0.76rem;
}

.chart-panel {
  overflow: hidden;
}

.assumptions-panel {
  align-self: stretch;
}

.assumptions-grid {
  grid-template-columns: 1fr;
}

.assumptions-grid .projection-years {
  width: 100%;
}

.assumptions-grid select {
  max-width: none;
}

.calendar-label-toggle {
  min-height: 44px;
  align-items: center;
}

.calendar-label-control :disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.chart-panel canvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 760 / 300;
  border: 1px solid #dbe2dd;
  border-radius: 8px;
  background: #fbfcfa;
  cursor: pointer;
}

.chart-quick-tooltip {
  position: absolute;
  z-index: 9;
  display: none;
  min-width: 210px;
  max-width: min(360px, calc(100vw - 24px), calc(100% - 16px));
  max-height: 210px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid rgba(23, 33, 31, 0.14);
  border-radius: 8px;
  background: rgba(23, 33, 31, 0.94);
  color: white;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 12px 24px rgba(23, 33, 31, 0.18);
}

.chart-quick-tooltip.is-visible {
  display: grid;
  gap: 3px;
}

.chart-quick-tooltip strong,
.chart-quick-tooltip span {
  display: block;
}

.chart-tooltip {
  display: block;
  width: 100%;
  min-height: 86px;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 33, 31, 0.14);
  border-radius: 8px;
  background: rgba(23, 33, 31, 0.94);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  pointer-events: auto;
  overflow-anchor: none;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.86rem;
}

.chart-tooltip .unpin-chart-note,
.chart-tooltip .unpin-outside-chart-note {
  min-height: 30px;
  margin: 0;
  padding: 5px 9px;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.chart-tooltip .chart-note-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.site-footer .site-footer-metric {
  color: var(--dashboard-accent);
  font-weight: 800;
}

.chart-tooltip span {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.expense-share {
  display: grid;
  gap: 4px;
}

.expense-share-track {
  position: relative;
  min-height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ede9;
}

.expense-share-track div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 160ms ease;
}

.expense-share-track span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 900;
}

.balance-share {
  display: grid;
}

.balance-share-track {
  position: relative;
  min-height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ede9;
}

.balance-share-track div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 160ms ease;
}

.liability-share .balance-share-track div {
  background: var(--rose);
}

.balance-share-track span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 900;
}

@media (max-width: 1120px) {
  .hero-grid,
  .workspace,
  .projection-assumption-grid,
  .balance-sheet-grid,
  .session-controls,
  .income-expense-layout {
    grid-template-columns: 1fr;
  }

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

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

  .input-grid.compact.cash-flow-income-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .decision-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
  }

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

  .side-nav-group strong {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .allocation-plan-grid {
    grid-template-columns: 1fr;
  }

  .custom-item-row.has-include,
  .custom-item-row.has-return,
  .custom-item-row.has-risk {
    grid-template-columns: 1fr;
  }

  .allocation-row,
  .allocation-row.has-schedule,
  .shortfall-row,
  .cash-flow-row,
  .cash-flow-card-head,
  .scenario-controls {
    grid-template-columns: 1fr;
  }

  .shortfall-targets {
    grid-template-columns: 1fr;
  }

  .cash-flow-subhead {
    display: grid;
    align-items: stretch;
  }

  .cash-flow-subhead .cash-flow-saving {
    min-width: 0;
  }

  .profile-review-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .summary-panel,
  .panel {
    padding: 16px;
  }

  .hero-grid,
  .input-grid,
  .input-grid.compact,
  .custom-item-row,
  .custom-item-row.has-include,
  .custom-item-row.has-return,
  .allocation-row,
  .allocation-row.has-schedule,
  .shortfall-row,
  .cash-flow-row,
  .cash-flow-card-head {
    grid-template-columns: 1fr;
  }

  .shortfall-targets {
    grid-template-columns: 1fr;
  }

  .input-grid.compact.cash-flow-income-grid {
    grid-template-columns: 1fr;
  }

  .real-property-sale-fields,
  .sale-summary {
    grid-template-columns: 1fr;
  }

  .brand-row,
  .section-head {
    align-items: flex-start;
  }

  .brand-row,
  .header-actions {
    flex-direction: column;
  }

  .header-actions {
    align-items: stretch;
    width: 100%;
  }

  .section-head {
    flex-direction: column;
  }

  .warning-badge,
  .warning-badge.action {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

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

  .side-nav-group strong {
    grid-column: auto;
  }
}

/* Final app-view layout: keep after legacy product-shell rules. */
.product-header {
  grid-template-columns: minmax(330px, 1fr) auto minmax(270px, 1fr);
  min-height: 76px;
  box-shadow: none;
}

.product-brand {
  color: var(--dashboard-navy);
  font-size: 1.45rem;
}

.product-brand small {
  color: var(--dashboard-muted);
  font-size: 0.82rem;
}

.brand-mark {
  position: relative;
  display: block;
  width: 34px;
  height: 42px;
  border-radius: 0;
  background: transparent;
}

.product-nav {
  gap: 18px;
}

.product-nav a,
.nav-link {
  min-height: 76px;
  border-radius: 0;
  color: var(--dashboard-navy);
}

.product-nav a:hover,
.product-nav a:focus-visible,
.nav-link:hover,
.nav-link:focus-visible,
.product-nav .is-active {
  background: transparent;
  color: var(--dashboard-green-dark);
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 0 26px;
  width: min(1540px, 100%);
  padding: 24px 28px 36px;
}

.app-shell > .session-panel {
  grid-column: 2;
  grid-row: 1;
  order: initial;
  margin: 0 0 18px;
}

.summary-panel {
  grid-column: 2;
  grid-row: 2;
  order: initial;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--dashboard-navy);
}

.summary-panel .metric,
.summary-panel .metric.primary {
  border-color: var(--dashboard-line);
  background: #fff;
  color: var(--dashboard-navy);
}

.workspace {
  display: contents;
  order: initial;
}

.side-nav {
  position: sticky;
  top: 100px;
  display: grid;
  grid-column: 1;
  grid-row: 1 / span 4;
  align-self: start;
  min-height: calc(100vh - 124px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.planner-form {
  display: grid;
  grid-column: 2;
  grid-row: 3;
  grid-template-columns: minmax(0, 2.35fr) minmax(290px, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.planner-form.is-plans-view {
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

body :where(
  .app-shell,
  .workspace,
  .summary-panel,
  .metric,
  .panel,
  .product-extras,
  .product-extras article,
  .sponsor-slot,
  .about-view,
  .about-hero,
  .about-purpose,
  .about-purpose article,
  .logo-story,
  .logo-story-copy,
  .about-principle,
  .profile-panel,
  .profile-grid,
  .warning-badges,
  .warning-badge,
  .mobile-tab-bar,
  .app-dialog,
  .dialog-card,
  .legal-dialog-content,
  .balance-sheet-grid,
  .input-grid,
  label,
  .section-head,
  .section-total-card,
  .asset-return-summary,
  .example-note,
  .field-help,
  .balance-share,
  .risk-level-field,
  .manual-fire-target,
  .real-property-sale-fields,
  .sale-summary,
  .cash-flow-range-list,
  .cash-flow-row,
  .allocation-range-list,
  .allocation-range-row,
  .allocation-row,
  .shortfall-row,
  .liability-repayment-row,
  .cash-flow-add-controls,
  .allocation-add-controls
) {
  cursor: url("assets/no-entry-cursor.svg") 10 10, not-allowed;
}

body .site-footer,
body .site-footer p,
body .site-footer nav {
  cursor: url("assets/no-entry-cursor.svg") 10 10, not-allowed;
}

body :where(.timeline-chip, .allocation-timeline-chip) {
  cursor: url("assets/no-entry-cursor.svg") 10 10, not-allowed;
}

body :where(.timeline-chip:hover, .timeline-chip:focus-visible) {
  border-color: #dbe2dd;
  box-shadow: none;
  outline: none;
}

body :where(button, a, [role="button"], [role="checkbox"], .inline-check, .inline-check *, .timeline-remove, .allocation-timeline-remove) {
  cursor: pointer;
}

body :where(select, input[type="checkbox"], input[type="radio"], input[type="range"]) {
  cursor: pointer;
}

body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea) {
  cursor: text;
}

body :where(.chart-wrap, .chart-wrap canvas) {
  cursor: crosshair;
}

body :where(.chart-tooltip, .chart-tooltip *) {
  cursor: default;
}

body :where(.chart-tooltip button, .note-trigger) {
  cursor: pointer;
}

body :where(button:disabled, input:disabled, select:disabled, textarea:disabled, [aria-disabled="true"]) {
  cursor: url("assets/no-entry-cursor.svg") 10 10, not-allowed;
}

body :where(.timeline-chip, .allocation-timeline-chip) {
  cursor: url("assets/no-entry-cursor.svg") 10 10, not-allowed;
}

body :where(.timeline-remove, .allocation-timeline-remove) {
  cursor: pointer;
}

.planner-form.is-plans-view .assumptions-panel,
.planner-form.is-plans-view .balance-sheet-grid,
.planner-form.is-plans-view .cash-flow-panel,
.planner-form.is-plans-view .allocation-plan-panel {
  grid-column: 1;
  grid-row: auto;
}

.product-extras {
  grid-column: 2;
  grid-row: 4;
  order: initial;
}

body[data-app-view="resources"] .product-extras {
  grid-column: 1 / -1;
  grid-row: 1;
  margin-top: 8px;
}

.product-extras .resources-heading {
  grid-column: 1 / -1;
}

[data-view-nav][hidden],
.product-extras[hidden] {
  display: none !important;
}

.mobile-tab-bar .is-active {
  color: var(--dashboard-green);
}

@media (max-width: 1120px) {
  .product-header {
    grid-template-columns: 1fr auto;
  }

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

  .app-shell > .session-panel,
  .summary-panel,
  .planner-form,
  .product-extras,
  body[data-app-view="resources"] .product-extras {
    grid-column: 1;
  }

  .side-nav {
    display: none;
  }

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

@media (max-width: 720px) {
  .product-header {
    min-height: 62px;
  }

  .product-nav a,
  .nav-link {
    min-height: 48px;
    border-radius: 8px;
  }

  .app-shell {
    padding: 12px;
  }

  .app-shell > .session-panel {
    margin: 0 0 12px;
  }
}

/* Reference dashboard fidelity pass */
:root {
  --dashboard-navy: #10213f;
  --dashboard-green: #006b50;
  --dashboard-green-dark: #00513d;
  --dashboard-mint: #e6f3ee;
  --dashboard-line: #dce4e7;
  --dashboard-muted: #5f6d82;
}

body {
  background: #f8fafb;
  color: var(--dashboard-navy);
}

.product-header {
  grid-template-columns: minmax(330px, 1fr) auto minmax(270px, 1fr);
  min-height: 76px;
  border-color: var(--dashboard-line);
  box-shadow: none;
}

.product-brand {
  color: var(--dashboard-navy);
  font-size: 1.45rem;
}

.product-brand small {
  color: var(--dashboard-muted);
  font-size: 0.82rem;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 42px;
  border-radius: 0;
  background: transparent;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  left: 50%;
  content: "";
  transform: translateX(-50%);
}

.brand-mark::before {
  top: 1px;
  width: 0;
  height: 0;
  border-right: 15px solid transparent;
  border-bottom: 30px solid var(--dashboard-green);
  border-left: 15px solid transparent;
}

.brand-mark::after {
  bottom: 2px;
  width: 5px;
  height: 13px;
  background: var(--dashboard-green);
}

.product-nav {
  gap: 18px;
}

.product-nav a,
.nav-link {
  position: relative;
  min-height: 76px;
  padding: 0 12px;
  border-radius: 0;
  color: var(--dashboard-navy);
}

.product-nav a:hover,
.product-nav a:focus-visible,
.nav-link:hover,
.nav-link:focus-visible,
.product-nav .is-active {
  background: transparent;
  color: var(--dashboard-green-dark);
}

.product-nav .is-active::after {
  position: absolute;
  right: 6px;
  bottom: 0;
  left: 6px;
  height: 4px;
  background: var(--dashboard-green);
  content: "";
}

.outline-action {
  border-color: var(--dashboard-green);
  color: var(--dashboard-green-dark);
}

.app-primary-action {
  background: var(--dashboard-green);
  border-color: var(--dashboard-green);
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 0 26px;
  width: min(1540px, 100%);
  padding: 24px 28px 36px;
}

.summary-panel {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--dashboard-navy);
}

.summary-panel .brand-row,
.summary-panel .warning-badges {
  display: none;
}

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

.summary-panel .metric,
.summary-panel .metric.primary {
  position: relative;
  min-height: 148px;
  padding: 22px 20px;
  overflow: hidden;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(16, 33, 63, 0.025);
  color: var(--dashboard-navy);
  backdrop-filter: none;
}

.summary-panel .metric::after {
  position: absolute;
  top: 43px;
  right: 18px;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  background: var(--dashboard-mint);
  color: var(--dashboard-green);
  font-size: 1.35rem;
  font-weight: 900;
}

.summary-panel .metric:nth-child(1)::after {
  content: "$";
}

.summary-panel .metric:nth-child(2)::after {
  content: "\2197";
}

.summary-panel .metric:nth-child(3)::after {
  content: "\231A";
}

.summary-panel .metric:nth-child(4)::after {
  display: none;
}

.metric span,
.metric small {
  color: var(--dashboard-muted);
  opacity: 1;
}

.metric > .label-with-note {
  color: var(--dashboard-navy);
  font-size: 0.84rem;
  font-weight: 850;
}

.metric strong {
  max-width: calc(100% - 56px);
  color: var(--dashboard-navy);
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  letter-spacing: -0.035em;
}

.progress-metric strong {
  max-width: none;
}

.summary-panel .note-trigger {
  width: 17px;
  height: 17px;
  min-height: 17px;
  background: #fff;
  color: #718096;
  font-size: 0.62rem;
}

.fire-progress-track {
  height: 10px;
  background: #e8ebef;
}

.fire-progress-track > div {
  background: linear-gradient(90deg, #0c8364, var(--dashboard-green));
}

.workspace {
  display: contents;
}

.side-nav {
  position: sticky;
  z-index: 10;
  top: 100px;
  grid-column: 1;
  grid-row: 1 / span 4;
  align-self: start;
  min-height: calc(100vh - 124px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.side-nav-group {
  gap: 8px;
}

.side-nav-group + .side-nav-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.side-nav button {
  position: relative;
  min-height: 50px;
  padding: 0 14px 0 52px;
  border: 0;
  border-radius: 8px;
  color: var(--dashboard-navy);
  font-size: 0.9rem;
  font-weight: 720;
}

.side-nav button::before {
  position: absolute;
  left: 18px;
  width: 20px;
  color: var(--dashboard-navy);
  content: "\25C7";
  font-size: 1rem;
  text-align: center;
}

.side-nav button:nth-child(2)::before {
  content: "\2197";
}

.side-nav button:nth-child(3)::before {
  content: "\2637";
}

.side-nav button:nth-child(4)::before {
  content: "\25B3";
}

.side-nav button:nth-child(5)::before {
  content: "\25AD";
}

.side-nav button:nth-child(6)::before {
  content: "\2194";
}

.side-nav button:nth-child(7)::before {
  content: "%";
}

.side-nav button:hover,
.side-nav button:focus-visible,
.side-nav button.is-active {
  border: 0;
  background: var(--dashboard-mint);
  color: var(--dashboard-green-dark);
}

.side-nav button.is-active::before {
  color: var(--dashboard-green);
}

.planner-form {
  display: grid;
  grid-column: 2;
  grid-row: 3;
  grid-template-columns: minmax(0, 2.35fr) minmax(290px, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.projection-assumption-grid {
  display: contents;
}

.panel {
  padding: 20px;
  border: 1px solid var(--dashboard-line);
  border-top: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(16, 33, 63, 0.025);
}

.panel .section-head {
  padding-bottom: 14px;
  border-color: #edf0f2;
}

.panel .eyebrow {
  display: none;
}

.panel h2 {
  color: var(--dashboard-navy);
  font-size: 1.06rem;
}

.chart-panel:first-child {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
}

.chart-panel:first-child .chart-wrap {
  min-height: 0;
}

.chart-panel:first-child canvas {
  min-height: 0;
}

.outside-chart-panel {
  grid-column: 1 / -1;
  grid-row: 4;
}

.profile-panel {
  grid-column: 2;
  grid-row: 1;
  min-height: 560px;
  padding: 20px 0 0;
  overflow: hidden;
}

.profile-panel > .section-head,
.profile-panel > .profile-grid,
.profile-panel > .profile-target-card,
.profile-panel > .profile-suggestions,
.profile-panel > .next-action-card,
.profile-panel > .example-note {
  margin-right: 20px;
  margin-left: 20px;
}

.profile-panel > .section-head {
  align-items: center;
}

.health-status,
.current-plan-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 12px;
  border-radius: 7px;
  background: #dcefe7;
  color: var(--dashboard-green-dark);
  font-size: 0.74rem;
  font-weight: 850;
}

.preferred-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.preferred-result-heading h3 {
  margin: 0;
}

.preferred-status-wrap {
  display: grid;
  justify-items: end;
  gap: 6px;
  max-width: 330px;
  text-align: right;
}

.health-status {
  background: #eef1f3;
  color: var(--dashboard-muted);
}

.health-status.is-on-track {
  background: #dcefe7;
  color: var(--dashboard-green-dark);
}

.health-status.is-behind {
  background: #fff0ec;
  color: #a44437;
}

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

.profile-card,
.profile-target-card,
.profile-suggestions,
.next-action-card {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.profile-spectrum-card {
  padding: 0 0 16px;
  border-bottom: 1px solid #edf0f2;
}

.profile-spectrum {
  margin-top: 14px;
}

.profile-target-card {
  padding: 14px 0;
  border-bottom: 1px solid #edf0f2;
}

.profile-suggestions {
  padding: 14px 0;
}

.profile-suggestions ul {
  gap: 0;
}

.profile-suggestions li {
  position: relative;
  padding: 10px 0 10px 28px;
  border-bottom: 1px solid #f0f2f3;
  color: var(--dashboard-muted);
}

.profile-suggestions li::before {
  position: absolute;
  left: 2px;
  color: var(--dashboard-green);
  content: "\2713";
  font-weight: 900;
}

.next-action-card {
  margin: 0 !important;
  padding: 18px 20px 20px;
  border-top: 1px solid var(--dashboard-line);
  border-radius: 0;
  background: #fff;
}

.next-action-card strong {
  color: var(--dashboard-navy);
}

.profile-panel > .example-note {
  display: none;
}

.session-panel {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 2;
  align-items: center;
  justify-content: space-between;
  min-height: 100px;
  margin: 0;
  padding: 18px 20px;
}

.saved-plan-summary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.saved-plan-icon {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dashboard-mint);
}

.saved-plan-icon::before {
  position: absolute;
  top: 13px;
  left: 16px;
  width: 14px;
  height: 19px;
  border: 2px solid var(--dashboard-green);
  border-radius: 2px;
  content: "";
}

.saved-plan-summary small {
  display: block;
  color: var(--dashboard-muted);
  font-size: 0.74rem;
}

.saved-plan-summary strong {
  display: inline-block;
  margin-top: 3px;
  color: var(--dashboard-navy);
}

.saved-plan-summary .current-plan-status {
  min-height: 25px;
  margin-left: 8px;
  padding: 0 9px;
}

.saved-plan-summary .session-status {
  margin-top: 5px;
  color: var(--dashboard-muted);
  font-size: 0.73rem;
}

.saved-plan-actions {
  display: flex;
  gap: 10px;
}

.saved-plan-actions .text-button {
  min-height: 46px;
  padding: 0 20px;
  border-color: var(--dashboard-green);
  color: var(--dashboard-green-dark);
}

.saved-plan-actions .primary-action {
  background: var(--dashboard-green);
  color: #fff;
}

.session-management {
  position: absolute;
  z-index: 15;
  right: 20px;
  left: 20px;
  top: calc(100% + 8px);
  padding: 18px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(16, 33, 63, 0.14);
}

.session-panel {
  position: relative;
}

.app-shell > .session-panel {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 18px;
}

.session-controls {
  grid-template-columns: minmax(170px, 1fr) auto auto minmax(170px, 1fr) auto auto auto;
  margin-top: 0;
}

.assumptions-panel,
.balance-sheet-grid,
.cash-flow-panel,
.allocation-plan-panel {
  grid-column: 1 / -1;
}

.assumptions-panel {
  grid-row: 5;
}

.balance-sheet-grid {
  grid-row: 6;
}

.cash-flow-panel {
  grid-row: 7;
}

.allocation-plan-panel {
  grid-row: 8;
}

.product-extras {
  grid-column: 2;
  grid-row: 4;
}

.product-extras[hidden] {
  display: none;
}

.product-extras .resources-heading {
  grid-column: 1 / -1;
  padding: 8px 2px 10px;
}

.resources-heading > span {
  display: block;
  margin-bottom: 8px;
  color: var(--dashboard-green);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.resources-heading h1 {
  margin: 0 0 10px;
  color: var(--dashboard-navy);
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.04em;
}

.resources-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--dashboard-muted);
  line-height: 1.6;
}

body[data-app-view="resources"] .product-extras {
  grid-column: 1 / -1;
  grid-row: 1;
  margin-top: 8px;
}

.planner-form.is-plans-view {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

.planner-form.is-plans-view .assumptions-panel,
.planner-form.is-plans-view .balance-sheet-grid,
.planner-form.is-plans-view .cash-flow-panel,
.planner-form.is-plans-view .allocation-plan-panel {
  grid-column: 1;
  grid-row: auto;
}

body[data-app-view="plans"] .side-nav {
  grid-row: 1 / span 2;
}

body[data-app-view="plans"] .planner-form {
  grid-row: 1;
}

.site-footer {
  padding-left: 286px;
}

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

  .summary-panel,
  .planner-form,
  .product-extras {
    grid-column: 1;
  }

  .app-shell > .session-panel {
    grid-column: 1;
  }

  .side-nav {
    position: static;
    display: none;
  }

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

  .chart-panel:first-child,
  .profile-panel,
  .session-panel,
  .outside-chart-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .profile-panel {
    min-height: 0;
  }

  .site-footer {
    padding-left: 24px;
  }

  body[data-app-view="resources"] .product-extras {
    grid-column: 1;
  }
}

@media (max-width: 1280px) {
  .product-brand small {
    display: none;
  }
}

@media (max-width: 720px) {
  .product-header {
    grid-template-columns: 1fr auto;
  }

  .app-shell {
    padding: 12px;
  }

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

  .summary-panel .metric {
    min-height: 132px;
    padding: 15px;
  }

  .summary-panel .metric::after {
    top: 48px;
    right: 12px;
    width: 38px;
    height: 38px;
  }

  .metric strong {
    max-width: calc(100% - 36px);
    font-size: clamp(1.05rem, 5.4vw, 1.4rem);
  }

  .chart-panel:first-child {
    min-height: 0;
  }

  .chart-panel:first-child .chart-wrap {
    min-height: 0;
  }

  .session-panel {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .saved-plan-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .session-management {
    position: static;
    padding: 14px 0 0;
    border: 0;
    border-top: 1px solid var(--dashboard-line);
    border-radius: 0;
    box-shadow: none;
  }
}

/* Product shell */
.product-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1640px) / 2 + 24px));
  border-bottom: 1px solid #dce5e1;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 16px rgba(23, 33, 31, 0.04);
  backdrop-filter: blur(18px);
}

.product-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #10243a;
  text-decoration: none;
  font-size: 1.18rem;
  font-weight: 900;
}

.product-brand small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px 12px 12px 4px;
  background: #0a6b56;
  color: #fff;
  font-size: 1rem;
}

.product-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 4px;
}

.product-nav a,
.nav-link {
  display: grid;
  min-height: 44px;
  padding: 0 10px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #30403d;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.product-nav a:hover,
.product-nav a:focus-visible,
.nav-link:hover,
.nav-link:focus-visible,
.product-nav .is-active {
  background: #edf6f2;
  color: #075541;
}

.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 8px;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #4f5f5b;
  font-size: 0.74rem;
  font-weight: 850;
}

.language-picker span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.language-picker select {
  width: auto;
  min-height: 40px;
  min-width: 70px;
  max-width: 78px;
  padding: 7px 30px 7px 10px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 850;
}

.outline-action,
.app-primary-action,
.menu-button {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 850;
}

.outline-action,
.menu-button {
  border: 1px solid #8aa89f;
  background: #fff;
  color: #075541;
}

.app-primary-action {
  border: 1px solid #075541;
  background: #075541;
  color: #fff;
}

.menu-button {
  display: none;
}

.summary-panel {
  order: 1;
}

.session-panel {
  order: 2;
  margin-top: 18px;
}

.workspace {
  order: 3;
}

.product-extras {
  order: 4;
}

.summary-subtitle {
  max-width: 560px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.98rem;
}

.summary-panel .metric {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.summary-panel .metric.primary {
  background: rgba(255, 255, 255, 0.14);
}

.cloud-plan-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cloud-plan-actions span {
  color: var(--muted);
  font-size: 0.78rem;
}

.cloud-plan-actions span[data-kind="success"],
.form-status[data-kind="success"] {
  color: #087054;
}

.cloud-plan-actions span[data-kind="error"],
.form-status[data-kind="error"] {
  color: var(--danger);
}

.product-extras {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(280px, 0.7fr);
  gap: 16px;
  margin-top: 18px;
}

.product-extras article,
.sponsor-slot {
  padding: 22px;
  border: 1px solid #dce5e1;
  border-radius: 12px;
  background: #fff;
}

.product-extras article > span,
.sponsor-slot small,
.dialog-heading span {
  display: block;
  margin-bottom: 7px;
  color: #477068;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-extras p {
  color: var(--muted);
  line-height: 1.55;
}

.product-extras a,
.resource-link {
  color: #075541;
  font-weight: 850;
}

.resource-link {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.resource-link:hover,
.resource-link:focus-visible {
  text-decoration: underline;
}

.sponsor-slot {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-style: dashed;
  background: #f8fbfa;
}

.sponsor-slot span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1640px;
  margin: 0 auto;
  padding: 28px 24px 36px;
  color: var(--muted);
  font-size: 0.76rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  gap: 16px;
}

.site-footer a,
.footer-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #30403d;
  cursor: pointer;
  text-decoration: underline;
}

.mobile-tab-bar {
  display: none;
}

.app-dialog {
  width: min(520px, calc(100% - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(15, 34, 31, 0.28);
}

.app-dialog::backdrop {
  background: rgba(10, 27, 24, 0.55);
  backdrop-filter: blur(3px);
}

.dialog-card {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-card label {
  display: grid;
  gap: 7px;
  color: #30403d;
  font-size: 0.82rem;
  font-weight: 800;
}

.dialog-card .legal-consent {
  padding: 10px;
  border-radius: 9px;
  font-weight: 650;
  line-height: 1.45;
}

.legal-consent-toggle {
  display: grid;
  width: 100%;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #30403d;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  line-height: 1.45;
}

.legal-checkmark {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid #8aa29b;
  border-radius: 4px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #fff;
}

.legal-consent-toggle[aria-checked="true"] .legal-checkmark {
  border-color: #075541;
  background: #075541;
}

.legal-consent-toggle[aria-checked="true"] .legal-checkmark::after {
  content: "";
  display: block;
  width: 9px;
  height: 5px;
  margin: 4px auto 0;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  transform: rotate(-45deg);
}

.dialog-card .legal-consent span {
  display: block;
}

.auth-google-button {
  width: 100%;
  min-height: 46px;
}

.dialog-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dialog-divider::before,
.dialog-divider::after {
  height: 1px;
  flex: 1;
  background: #dbe5df;
  content: "";
}

.share-actions {
  display: grid;
  gap: 10px;
}

.legal-link-button {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: #075f9e;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  text-decoration: underline;
}

.legal-dialog {
  width: min(760px, calc(100% - 24px));
}

.legal-dialog-content {
  display: grid;
  gap: 12px;
  max-height: min(62vh, 620px);
  overflow: auto;
  color: #30403d;
}

.legal-dialog-content h3 {
  margin: 10px 0 0;
  color: var(--ink);
}

.legal-dialog-content p,
.legal-dialog-content ul {
  margin: 0;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 68px;
}

.password-input.is-masked {
  -webkit-text-security: disc;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 34px;
  padding: 5px 8px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #075541;
  cursor: pointer;
  font-weight: 850;
}

.dialog-card input,
.dialog-card select,
.dialog-card textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #b9c8c3;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}

.dialog-card .legal-consent input[type="checkbox"] {
  appearance: auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 2px 10px 0 0;
  padding: 0;
  cursor: pointer;
}

.password-field input::-ms-reveal,
.password-field input::-ms-clear {
  display: none;
}

.password-field input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
}

.dialog-card textarea {
  resize: vertical;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-profile-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #d7dfd9;
  border-radius: 12px;
  background: #f8fbfa;
}

.account-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-profile-card > div:last-child {
  display: grid;
  gap: 2px;
}

.account-profile-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.account-profile-card strong {
  color: var(--ink);
  font-size: 1rem;
}

.account-profile-card small {
  color: var(--muted);
  line-height: 1.45;
}

.account-avatar-preview {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  border-radius: 18px;
  background: #075541;
  color: #fff;
  font-size: 1.18rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.account-avatar-preview.has-photo {
  background-color: #dfece7;
  background-position: center;
  background-size: cover;
  color: transparent;
}

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

.account-profile-actions {
  align-items: center;
  justify-content: space-between;
}

.dashboard-share-panel {
  display: grid;
  gap: 14px;
}

.dashboard-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.danger-action {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #d86c61;
  border-radius: 9px;
  background: #fff6f5;
  color: #9c3028;
  cursor: pointer;
  font-weight: 850;
}

body[data-theme="dark"] .account-profile-panel {
  border-color: var(--line);
  background: #0b1a16;
}

body[data-theme="dark"] .danger-action {
  border-color: #a84b42;
  background: #2b1615;
  color: #ffb7ae;
}

.dialog-close,
.text-link {
  padding: 8px;
  border: 0;
  background: transparent;
  color: #075541;
  cursor: pointer;
  font-weight: 850;
}

.align-left {
  justify-self: start;
}

.form-status {
  min-height: 20px;
  margin: 0;
  font-size: 0.78rem;
}

.feedback-rating-field {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.feedback-stars {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feedback-stars button {
  width: 38px;
  min-height: 38px;
  border: 1px solid #ccd9d4;
  border-radius: 999px;
  background: #fff;
  color: #9b6a12;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 950;
}

.feedback-stars button.is-selected {
  border-color: #d49b2d;
  background: #fff7df;
  color: #7b5413;
}

.pricing-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
  color: #30403d;
}

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

.support-option {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px;
  border: 1px solid #dce5e1;
  border-radius: 14px;
  background: #f8fbfa;
}

.support-option span {
  color: #477068;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.support-option h3,
.support-option p {
  margin: 0;
}

.support-option p {
  color: var(--muted);
  line-height: 1.5;
}

.coffee-amount-field {
  display: grid;
  gap: 6px;
  color: #31443f;
  font-size: 0.88rem;
  font-weight: 850;
}

.coffee-amount-field input {
  width: 100%;
  min-height: 44px;
}

.legal-shell {
  width: min(820px, calc(100% - 32px));
  margin: 48px auto;
  padding: 42px;
  border: 1px solid #dce5e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(23, 33, 31, 0.07);
}

.legal-shell h1 {
  margin-bottom: 12px;
  color: #10243a;
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.legal-shell h2 {
  margin-top: 32px;
}

.legal-shell p,
.legal-shell li {
  color: #4f5f5b;
  line-height: 1.7;
}

@media (max-width: 1050px) {
  .product-header {
    grid-template-columns: 1fr auto;
  }

  .product-brand small {
    display: none;
  }

  .product-nav {
    position: absolute;
    top: 64px;
    right: 12px;
    display: none;
    width: min(280px, calc(100vw - 24px));
    padding: 10px;
    border: 1px solid #dce5e1;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .product-nav.is-open {
    display: grid;
  }

  .menu-button {
    display: inline-block;
  }

  .product-extras {
    grid-template-columns: 1fr 1fr;
  }

  .sponsor-slot {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 68px;
  }

  .product-header {
    min-height: 62px;
    padding: 0 12px;
  }

  .product-brand {
    font-size: 1.02rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .account-actions .outline-action,
  .account-actions .app-primary-action {
    display: none;
  }

  .language-picker span {
    display: none;
  }

  .language-picker select {
    min-height: 38px;
    max-width: 92px;
  }

  .summary-panel {
    min-height: 0;
    gap: 20px;
    border-radius: 12px;
  }

  .summary-panel h1 {
    font-size: 2rem;
  }

  .summary-subtitle {
    font-size: 0.86rem;
  }

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

  .metric {
    min-height: 126px;
    padding: 13px;
  }

  .metric strong {
    overflow-wrap: anywhere;
    font-size: clamp(1.05rem, 6vw, 1.55rem);
  }

  .session-panel {
    margin-top: 12px;
  }

  .cloud-plan-actions,
  .site-footer,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .product-extras {
    grid-template-columns: 1fr;
  }

  .sponsor-slot {
    grid-column: auto;
  }

  .site-footer {
    padding: 24px 16px;
  }

  .mobile-tab-bar {
    position: fixed;
    z-index: 45;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 64px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid #dce5e1;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 24px rgba(23, 33, 31, 0.08);
    backdrop-filter: blur(16px);
  }

  .mobile-tab-bar a,
  .mobile-tab-bar button {
    display: grid;
    min-height: 56px;
    place-items: center;
    border: 0;
    background: transparent;
    color: #30403d;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 850;
  }

  .legal-shell {
    margin: 16px auto;
    padding: 24px 18px;
  }
}

/* App-view precedence overrides */
body .app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 0 26px;
  width: min(1540px, 100%);
}

body .app-shell > .session-panel {
  grid-column: 2;
  grid-row: 1;
  order: initial;
  margin: 0 0 18px;
}

body .app-shell > .summary-panel {
  grid-column: 2;
  grid-row: 2;
  order: initial;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--dashboard-navy);
}

body .summary-panel .metric,
body .summary-panel .metric.primary {
  border-color: var(--dashboard-line);
  background: #fff;
  color: var(--dashboard-navy);
}

body .workspace {
  display: contents;
  order: initial;
}

body .side-nav {
  position: sticky;
  top: 100px;
  display: grid;
  grid-column: 1;
  grid-row: 1 / span 4;
  align-self: start;
  min-height: calc(100vh - 124px);
  padding: 0;
  border: 0;
  background: transparent;
  z-index: 1;
  box-shadow: none;
}

body .planner-form {
  position: relative;
  z-index: 2;
  display: grid;
  grid-column: 2;
  grid-row: 3;
  grid-template-columns: minmax(0, 2.35fr) minmax(290px, 1fr);
  gap: 18px;
  margin-top: 18px;
}

body .planner-form .panel,
body .planner-form .balance-sheet-grid {
  position: relative;
}

body .planner-form .panel:has(.note-trigger:hover),
body .planner-form .panel:has(.note-trigger:focus),
body .planner-form .panel:has(.note-trigger.is-visible) {
  z-index: 40;
}

body .note-trigger::after {
  z-index: 100;
}

body .note-trigger::before {
  z-index: 101;
}

body .label-with-note:has(.note-trigger:hover),
body .label-with-note:has(.note-trigger:focus),
body .label-with-note:has(.note-trigger.is-visible),
body .note-trigger:hover,
body .note-trigger:focus,
body .note-trigger.is-visible {
  z-index: 1000;
}

body .summary-panel .metric > * {
  position: relative;
  z-index: 1;
}

body .summary-panel .metric > .label-with-note:has(.note-trigger:hover),
body .summary-panel .metric > .label-with-note:has(.note-trigger:focus),
body .summary-panel .metric > .label-with-note:has(.note-trigger.is-visible) {
  z-index: 1000;
}

.side-nav-toggle {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  padding: 0 13px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: #fff;
  color: var(--dashboard-green-dark);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.side-nav-toggle span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--dashboard-mint);
  color: var(--dashboard-green-dark);
  font-size: 1.15rem;
  line-height: 1;
  text-transform: none;
}

body .side-nav .side-nav-toggle::before {
  display: none;
}

body .app-shell.is-side-nav-collapsed {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 0 18px;
}

body .side-nav.is-collapsed {
  width: 58px;
}

body .side-nav.is-collapsed .side-nav-toggle {
  justify-content: center;
  padding: 0;
}

body .side-nav.is-collapsed .side-nav-toggle strong,
body .side-nav.is-collapsed .side-nav-group {
  display: none;
}

body .planner-form.is-plans-view {
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

body .planner-form.is-plans-view .assumptions-panel,
body .planner-form.is-plans-view .balance-sheet-grid,
body .planner-form.is-plans-view .cash-flow-panel,
body .planner-form.is-plans-view .allocation-plan-panel {
  grid-column: 1;
  grid-row: auto;
}

body .product-extras {
  grid-column: 2;
  grid-row: 4;
  order: initial;
}

body[data-app-view="resources"] .product-extras {
  grid-column: 1 / -1;
  grid-row: 1;
}

body [data-view-nav][hidden],
body .product-extras[hidden] {
  display: none !important;
}

body .product-extras .resources-heading {
  grid-column: 1 / -1;
}

body .mobile-tab-bar .is-active {
  color: var(--dashboard-green);
}

body .about-view {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 1;
  gap: 24px;
  max-width: 1240px;
  margin: 8px auto 40px;
}

body .about-view[hidden] {
  display: none !important;
}

.about-hero {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  min-height: 360px;
  padding: 52px;
  overflow: hidden;
  border: 1px solid var(--dashboard-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 13% 38%, rgba(155, 207, 189, 0.26), transparent 28%),
    #fff;
}

.about-logo-stage {
  display: grid;
  width: 210px;
  height: 210px;
  place-items: center;
  border-radius: 50%;
  background: var(--dashboard-mint);
}

.about-logo-stage img {
  width: 150px;
  height: 150px;
}

.about-hero span,
.about-purpose article > span,
.logo-story-copy > span,
.about-principle span {
  display: block;
  margin-bottom: 10px;
  color: var(--dashboard-green);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.about-hero h1 {
  max-width: 760px;
  margin-bottom: 18px;
  color: var(--dashboard-navy);
  font-size: clamp(2.4rem, 6vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.about-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--dashboard-muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

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

.about-purpose article {
  padding: 30px;
  border: 1px solid var(--dashboard-line);
  border-radius: 12px;
  background: #fff;
}

.about-purpose h2,
.logo-story-copy h2 {
  margin-bottom: 12px;
  color: var(--dashboard-navy);
  font-size: 1.5rem;
}

.about-purpose p,
.logo-story-copy p,
.logo-story-copy dd {
  color: var(--dashboard-muted);
  line-height: 1.7;
}

.logo-story {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.55fr);
  gap: 48px;
  padding: 48px;
  border-radius: 16px;
  background: #082d27;
  color: #fff;
}

.logo-story-mark {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
}

.logo-story-mark img {
  width: min(70%, 250px);
}

.logo-story-copy h2 {
  color: #fff;
  font-size: 2rem;
}

.logo-story-copy p,
.logo-story-copy dd {
  color: rgba(255, 255, 255, 0.74);
}

.logo-story-copy dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin: 24px 0 0;
}

.logo-story-copy dl > div {
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.logo-story-copy dt {
  margin-bottom: 7px;
  color: #a9ddca;
  font-weight: 850;
}

.logo-story-copy dd {
  margin: 0;
  font-size: 0.9rem;
}

.about-principle {
  padding: 34px;
  border: 1px solid #b9d8cd;
  border-radius: 12px;
  background: var(--dashboard-mint);
  text-align: center;
}

.about-principle strong {
  display: block;
  max-width: 850px;
  margin: 0 auto;
  color: var(--dashboard-green-dark);
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1.3;
}

body .product-brand .brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  color: var(--dashboard-navy);
  font-weight: 900;
  letter-spacing: -0.045em;
}

.brand-wordmark strong {
  color: var(--dashboard-green);
  font: inherit;
}

body[data-app-view="dashboard"] .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body[data-app-view="dashboard"] .app-shell > .session-panel,
body[data-app-view="dashboard"] .app-shell > .summary-panel,
body[data-app-view="dashboard"] .planner-form {
  grid-column: 1;
}

body[data-app-view="dashboard"] .planner-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-app-view="dashboard"] .chart-panel:first-child {
  grid-column: 1;
  grid-row: 1;
}

body[data-app-view="dashboard"] .outside-chart-panel {
  grid-column: 2;
  grid-row: 1;
}

body[data-app-view="dashboard"] .profile-panel {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 0;
}

body[data-app-view="dashboard"] .profile-panel > .profile-grid {
  grid-template-columns: minmax(0, 1.35fr);
}

body[data-app-view="dashboard"] .chart-panel {
  min-width: 0;
  min-height: 400px;
}

body[data-app-view="dashboard"] .chart-panel .chart-wrap {
  min-height: 0;
}

body[data-app-view="dashboard"] .summary-panel {
  gap: 14px;
  scroll-margin-top: 94px;
}

body[data-app-view="dashboard"] .hero-grid {
  position: relative;
  z-index: 2;
}

body[data-app-view="dashboard"] .summary-panel .metric,
body[data-app-view="dashboard"] .summary-panel .metric.primary {
  overflow: visible;
}

body[data-app-view="dashboard"] .summary-panel .metric:has(.note-trigger:hover),
body[data-app-view="dashboard"] .summary-panel .metric:has(.note-trigger:focus),
body[data-app-view="dashboard"] .summary-panel .metric:has(.note-trigger.is-visible) {
  z-index: 120;
}

body[data-app-view="dashboard"] .summary-panel .note-trigger::after {
  top: calc(100% + 10px);
  bottom: auto;
  transform: translate(-50%, -6px);
}

body[data-app-view="dashboard"] .summary-panel .note-trigger::before {
  top: calc(100% + 4px);
  bottom: auto;
  transform: translate(-50%, -6px) rotate(45deg);
}

body[data-app-view="dashboard"] .summary-panel .note-trigger:hover::after,
body[data-app-view="dashboard"] .summary-panel .note-trigger:focus::after,
body[data-app-view="dashboard"] .summary-panel .note-trigger:focus-visible::after,
body[data-app-view="dashboard"] .summary-panel .note-trigger.is-visible::after {
  transform: translate(-50%, 0);
}

body[data-app-view="dashboard"] .summary-panel .note-trigger:hover::before,
body[data-app-view="dashboard"] .summary-panel .note-trigger:focus::before,
body[data-app-view="dashboard"] .summary-panel .note-trigger:focus-visible::before,
body[data-app-view="dashboard"] .summary-panel .note-trigger.is-visible::before {
  transform: translate(-50%, 0) rotate(45deg);
}

body[data-app-view="dashboard"] .summary-panel .warning-badges {
  position: relative;
  z-index: 1;
}

body .planner-form > .brand-row {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 54px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: #fff;
}

body .planner-form > .brand-row > div:first-child {
  display: none;
}

body .planner-form > .brand-row .header-actions {
  width: 100%;
  align-items: center;
  justify-content: flex-end;
}

body .planner-form > .brand-row .currency-picker {
  display: flex;
  min-width: 220px;
  align-items: center;
  gap: 10px;
  color: var(--dashboard-muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

body .planner-form > .brand-row .currency-picker select {
  width: 110px;
  min-height: 38px;
  border-color: var(--dashboard-line);
  background: #fff;
  color: var(--dashboard-navy);
}

body .planner-form > .brand-row .header-button {
  min-height: 38px;
  border-color: var(--dashboard-line);
  border-radius: 7px;
  background: #fff;
  color: var(--dashboard-navy);
}

body .planner-form > .brand-row .header-button:hover,
body .planner-form > .brand-row .header-button:focus-visible {
  border-color: var(--dashboard-green);
  color: var(--dashboard-green-dark);
}

body[data-app-view="dashboard"] .summary-panel .warning-badges {
  display: flex;
  gap: 10px;
  margin-top: 0;
}

body .planner-form.is-dashboard-view > .brand-row {
  display: none;
}

body .planner-form.is-plans-view > .brand-row {
  display: flex;
  grid-row: auto;
  margin-bottom: 0;
}

body[data-app-view="dashboard"] .warning-badge {
  max-width: 360px;
  border-color: #d9e2e5;
  background: #fff;
  color: var(--dashboard-navy);
  box-shadow: 0 2px 5px rgba(16, 33, 63, 0.025);
}

body[data-app-view="dashboard"] .warning-level,
body[data-app-view="dashboard"] .warning-badge small {
  color: var(--dashboard-muted);
}

body[data-app-view="dashboard"] .warning-icon {
  border-color: #d6a63a;
  background: #fff8e8;
  color: #a66b00;
}

body[data-app-view="dashboard"] .warning-badge.action {
  order: -1;
  border: 1px solid #e4cf9d;
  background: #fffaf0;
  color: #73531d;
  box-shadow: none;
}

body[data-app-view="dashboard"] .warning-badge.action .warning-icon {
  border-color: #c99b35;
  background: #fff;
  color: #94660b;
}

body[data-app-view="dashboard"] .warning-badge.action .warning-level,
body[data-app-view="dashboard"] .warning-badge.action small {
  color: #806127;
}

body[data-app-view="dashboard"] .warning-badge.info {
  border-color: #bdd6df;
  background: #f3f9fb;
}

body[data-app-view="dashboard"] .warning-badge.attention {
  border-color: #ead39f;
  background: #fffaf0;
}

body[data-app-view="dashboard"] .warning-badge.required {
  order: -2;
  border: 1px solid #ef9c8d;
  background: #fff2ef;
  color: #8f2f24;
}

body[data-app-view="dashboard"] .warning-badge.required .warning-icon {
  border-color: #c94e40;
  background: #fff;
  color: #ac382c;
}

body[data-app-view="dashboard"] .warning-badge.required .warning-level,
body[data-app-view="dashboard"] .warning-badge.required small {
  color: #983c31;
}

body input.refresh-required-empty,
body select.refresh-required-empty,
body textarea.refresh-required-empty {
  border-color: #d94f43 !important;
  background: #fff3f1 !important;
  box-shadow: 0 0 0 3px rgba(217, 79, 67, 0.12) !important;
}

body label.has-refresh-required-empty {
  color: #a7352c !important;
}

body label.has-refresh-required-empty .field-help {
  color: #b44237;
  font-weight: 800;
}

body .refresh-required-message {
  display: block;
  margin-top: 4px;
  padding: 8px 10px;
  border-left: 3px solid #d94f43;
  border-radius: 4px;
  background: #fff1ef;
  color: #a7352c;
  font-weight: 850;
  line-height: 1.4;
}

body .allocation-plan-panel.refresh-allocation-blocked {
  border-color: #d94f43;
  box-shadow: 0 0 0 3px rgba(217, 79, 67, 0.1);
}

body .allocation-range-row.refresh-allocation-range {
  border-color: #d94f43;
  background: #fff8f7;
  box-shadow: 0 0 0 3px rgba(217, 79, 67, 0.1);
}

body .refresh-allocation-message {
  display: grid;
  gap: 4px;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border: 1px solid #e4786f;
  border-left: 4px solid #d94f43;
  border-radius: 8px;
  background: #fff1ef;
  color: #8f2f27;
  line-height: 1.45;
}

body .refresh-allocation-message strong {
  color: #7f241d;
  font-size: 0.94rem;
}

body .refresh-allocation-message span {
  font-weight: 700;
}

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

  body .app-shell > .session-panel,
  body .app-shell > .summary-panel,
  body .planner-form,
  body .product-extras,
  body[data-app-view="resources"] .product-extras {
    grid-column: 1;
  }

  body .side-nav {
    display: none;
  }

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

  body[data-app-view="dashboard"] .planner-form {
    grid-template-columns: 1fr;
  }

  body[data-app-view="dashboard"] .chart-panel:first-child,
  body[data-app-view="dashboard"] .outside-chart-panel,
  body[data-app-view="dashboard"] .profile-panel {
    grid-column: 1;
    grid-row: auto;
  }

  body[data-app-view="dashboard"] .chart-panel {
    min-height: 0;
  }

  body[data-app-view="dashboard"] .chart-panel .chart-wrap {
    min-height: 0;
  }

  .about-hero {
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 30px;
    padding: 36px;
  }

  .about-logo-stage {
    width: 160px;
    height: 160px;
  }

  .about-logo-stage img {
    width: 115px;
    height: 115px;
  }
}

@media (max-width: 720px) {
  body .app-shell {
    padding: 12px;
  }

  .profile-settings-grid {
    grid-template-columns: 1fr;
  }

  body .app-shell > .session-panel {
    margin-bottom: 12px;
  }

  body .product-brand .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .preferred-result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .preferred-status-wrap {
    justify-items: start;
    max-width: none;
    text-align: left;
  }

  .support-options {
    grid-template-columns: 1fr;
  }

  body .planner-form > .brand-row,
  body .planner-form > .brand-row .header-actions,
  body .planner-form > .brand-row .currency-picker {
    align-items: stretch;
    flex-direction: column;
  }

  body .planner-form > .brand-row .currency-picker {
    width: 100%;
  }

  body .planner-form > .brand-row .currency-picker select {
    width: 100%;
  }

  body[data-app-view="dashboard"] .summary-panel .warning-badges {
    display: grid;
  }

  body[data-app-view="dashboard"] .warning-badge {
    width: 100%;
    max-width: none;
  }

  .about-hero,
  .about-purpose,
  .logo-story {
    grid-template-columns: 1fr;
  }

  .about-hero {
    gap: 26px;
    min-height: 0;
    padding: 28px 22px;
  }

  .about-logo-stage {
    width: 120px;
    height: 120px;
  }

  .about-logo-stage img {
    width: 86px;
    height: 86px;
  }

  .about-hero h1 {
    font-size: 2.45rem;
  }

  .about-purpose article,
  .logo-story {
    padding: 24px;
  }

  .logo-story-mark {
    min-height: 220px;
  }

  .logo-story-copy dl {
    grid-template-columns: 1fr;
  }
}

/* Final override layer: menu, mobile, layout containment */
body :where(.app-shell, .workspace, .planner-form, .panel, .session-panel, .session-management, .dialog-card, .product-menu) {
  min-width: 0;
  max-width: 100%;
}

body .product-header {
  grid-template-columns: minmax(0, 1fr) auto !important;
}

body .account-actions {
  justify-content: flex-end;
}

body .menu-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

body .product-menu[hidden] {
  display: none !important;
}

body .product-menu {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  right: max(12px, calc((100vw - 1640px) / 2 + 24px));
  display: grid;
  width: min(360px, calc(100vw - 24px));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--dashboard-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 48px rgba(16, 33, 63, 0.16);
  backdrop-filter: blur(16px);
}

body .product-menu .product-nav,
body .product-menu .menu-actions {
  position: static;
  display: grid;
  width: 100%;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body .product-menu .product-nav a,
body .product-menu .product-nav .nav-link {
  justify-content: start;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  text-align: left;
}

body .product-menu .product-nav .is-active::after {
  display: none;
}

body .product-menu .language-picker {
  display: grid;
  gap: 6px;
}

body .product-menu .language-picker span {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

body .product-menu .language-picker select,
body .product-menu .outline-action,
body .product-menu .app-primary-action {
  width: 100%;
  max-width: none;
  justify-content: center;
}

body .chart-panel canvas {
  aspect-ratio: 760 / 360;
}

body[data-app-view="dashboard"] .chart-panel {
  min-height: 0;
}

body[data-app-view="dashboard"] .chart-panel canvas {
  max-height: 420px;
}

body .chart-tooltip,
body .chart-quick-tooltip {
  max-width: 100%;
  overflow-wrap: anywhere;
}

body .profile-spectrum-track {
  min-height: 66px;
}

body .profile-spectrum-track span {
  padding: 24px 3px 8px;
  overflow: hidden;
  font-size: clamp(0.54rem, 0.72vw, 0.68rem);
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
}

body .session-panel {
  flex-wrap: wrap;
  gap: 14px;
}

body .saved-plan-summary,
body .saved-plan-actions {
  min-width: 0;
}

body .saved-plan-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

body .session-management {
  right: 12px;
  left: 12px;
  overflow-x: hidden;
}

body .session-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  align-items: end;
}

body[data-app-view="plans"] :where(.input-grid, .balance-sheet-grid, .custom-item-row, .cash-flow-row, .allocation-range-row, .allocation-row, .shortfall-row, .liability-repayment-row) {
  min-width: 0;
  max-width: 100%;
}

body[data-app-view="plans"] :where(.custom-item-row, .cash-flow-row, .allocation-range-row, .allocation-row, .shortfall-row, .liability-repayment-row) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

body[data-app-view="plans"] :where(input, select, textarea, label, .suffix-input, .risk-level-field, .sale-summary, .real-property-sale-fields) {
  min-width: 0;
  max-width: 100%;
}

.file-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.file-picker-row input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 9px;
  cursor: pointer;
}

.file-picker-button {
  display: none;
}

@media (max-width: 1120px) {
  body[data-app-view="plans"] .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-app-view="plans"] .side-nav {
    position: static;
    display: grid;
    grid-column: 1;
    grid-row: auto;
    min-height: 0;
    margin-bottom: 14px;
  }

  body[data-app-view="plans"] .side-nav-group:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
  }

  body[data-app-view="plans"] .side-nav-toggle {
    width: max-content;
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  body[data-app-view="dashboard"] .planner-form {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-app-view="dashboard"] .chart-panel:first-child,
  body[data-app-view="dashboard"] .outside-chart-panel,
  body[data-app-view="dashboard"] .profile-panel {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  body .product-header {
    min-height: 62px;
    padding: 0 12px;
  }

  body .product-menu {
    right: 12px;
  }

  body .product-brand small {
    display: none;
  }

  body .session-panel {
    align-items: stretch;
    flex-direction: column;
  }

  body .saved-plan-actions {
    justify-content: stretch;
  }

  body .saved-plan-actions .text-button,
  body .saved-plan-actions .primary-action {
    width: 100%;
  }
}

@media (hover: none), (pointer: coarse) {
  body :where(.app-shell, .workspace, .planner-form, .panel, .site-footer, label, .section-head, .example-note, .field-help) {
    cursor: default;
  }
}

/* GenFIRE final hardening overrides: keep this block at EOF. */
body .chart-quick-tooltip {
  display: none !important;
}

body .chart-note-summary {
  display: block;
  margin: 0 0 12px;
  color: #f7faf8;
  font-weight: 800;
}

body .chart-panel canvas {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 760 / 360;
  object-fit: contain;
}

body .chart-wrap {
  overflow: hidden;
}

body .note-trigger {
  min-width: 30px;
  min-height: 30px;
  touch-action: manipulation;
}

body .note-trigger::after {
  width: var(--note-width, min(360px, calc(100vw - 24px)));
  max-width: calc(100vw - 24px);
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (hover: none), (pointer: coarse), (max-width: 900px) {
  body .note-trigger.is-visible::after,
  body .note-trigger:focus-visible::after {
    position: fixed !important;
    top: var(--note-fixed-top, 72px) !important;
    left: var(--note-fixed-left, 12px) !important;
    z-index: 120 !important;
    width: var(--note-width, min(320px, calc(100vw - 24px))) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: var(--note-max-height, min(38vh, 240px));
    overflow: auto;
    transform: var(--note-fixed-transform, none) !important;
    white-space: normal;
    box-sizing: border-box;
  }
}

body[data-app-view="plans"] .custom-items-head,
body[data-app-view="plans"] .cash-flow-subhead,
body[data-app-view="plans"] .custom-item-row > label:first-child,
body[data-app-view="plans"] .liability-repayment-row > label:first-child {
  min-width: 0;
}

body[data-app-view="plans"] .cash-flow-card-head {
  grid-template-columns: minmax(118px, 0.55fr) minmax(118px, 0.55fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(220px, 1.1fr) auto;
  align-items: end;
}

body[data-app-view="plans"] .allocation-row {
  grid-template-columns: minmax(220px, 0.9fr) minmax(190px, 0.8fr) minmax(300px, 1fr) auto;
  align-items: end;
}

body[data-app-view="plans"] .allocation-row.has-schedule {
  grid-template-columns:
    minmax(90px, 0.45fr) minmax(120px, 0.55fr) minmax(200px, 0.9fr)
    minmax(190px, 0.75fr) minmax(260px, 1fr) auto;
}

body[data-app-view="plans"] .allocation-row .priority-note {
  min-width: 0;
  max-width: 100%;
  font-size: 0.86rem;
  line-height: 1.35;
}

body[data-app-view="plans"] .fixed-priority-empty {
  display: block;
  width: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

body[data-app-view="plans"] .cash-flow-subhead {
  margin: 20px 0 16px;
  padding: 16px;
  border: 1px solid rgba(0, 104, 82, 0.18);
  border-radius: 16px;
  background: rgba(228, 244, 238, 0.62);
}

body[data-app-view="plans"] .cash-flow-income-section-head {
  border-left: 6px solid #006852;
}

body[data-app-view="plans"] .cash-flow-expense-section-head {
  border-left: 6px solid #b95d4d;
  background: rgba(255, 248, 244, 0.9);
}

body[data-app-view="plans"] .custom-item-row,
body[data-app-view="plans"] .liability-repayment-row {
  padding: 18px;
  border: 1px solid rgba(0, 104, 82, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
}

body[data-app-view="plans"] .custom-item-row::before,
body[data-app-view="plans"] .liability-repayment-row::before {
  content: attr(data-section-title);
  grid-column: 1 / -1;
  color: var(--dashboard-accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-app-view="plans"] .custom-item-row[data-section-title=""],
body[data-app-view="plans"] .custom-item-row:not([data-section-title]),
body[data-app-view="plans"] .liability-repayment-row[data-section-title=""],
body[data-app-view="plans"] .liability-repayment-row:not([data-section-title]) {
  padding-top: 14px;
}

body .jump-top-button {
  width: max-content;
  max-width: 100%;
}

body .panel,
body .cash-flow-row,
body .allocation-range-row,
body .allocation-row,
body .chart-tooltip {
  overflow-anchor: none;
}

body .admin-view {
  display: grid;
  gap: 18px;
  padding: 28px;
  max-width: 1280px;
  width: min(100%, 1280px);
  margin: 0 auto 36px;
}

body .admin-view[hidden] {
  display: none !important;
}

body .admin-hero,
body .admin-metrics-grid article {
  border: 1px solid rgba(0, 104, 82, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(0, 28, 68, 0.07);
}

body .admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
}

body .admin-hero span,
body .admin-metrics-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body .admin-hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.96;
}

body .admin-hero p {
  margin: 0;
  color: var(--muted);
}

body .admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

body .admin-metrics-grid article {
  display: grid;
  gap: 8px;
  padding: 18px;
  min-width: 0;
}

body .admin-metrics-grid strong {
  color: var(--dashboard-accent);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

body .admin-metrics-grid small,
body #adminGeneratedAt {
  color: var(--muted);
}

@media (min-width: 1121px) {
  body[data-app-view="plans"] .app-shell {
    grid-template-columns: minmax(190px, 252px) minmax(0, 1fr);
  }

  body[data-app-view="plans"] .side-nav:not([hidden]) {
    position: sticky !important;
    top: 92px;
    align-self: start;
    display: grid !important;
    max-height: calc(100vh - 110px);
    overflow: auto;
  }

  body[data-app-view="plans"] .app-shell.is-side-nav-collapsed {
    grid-template-columns: 58px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  body[data-app-view="plans"] .side-nav {
    display: none !important;
  }

  body[data-app-view="plans"] .cash-flow-card-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
  }

  body[data-app-view="plans"] .cash-flow-card-head > :nth-child(n + 3) {
    grid-column: 1 / -1;
  }

  body[data-app-view="plans"] .allocation-row,
  body[data-app-view="plans"] .allocation-row.has-schedule {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  body[data-app-view="plans"] .allocation-row .remove-item,
  body[data-app-view="plans"] .shortfall-row .remove-item {
    width: 100%;
  }

  body[data-app-view="plans"] .custom-item-row,
  body[data-app-view="plans"] .liability-repayment-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body .admin-view {
    padding: 16px;
  }

  body .admin-hero {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (min-width: 390px) and (max-width: 900px) {
  body[data-app-view="plans"] .allocation-row,
  body[data-app-view="plans"] .allocation-row.has-schedule {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-app-view="plans"] .allocation-row .allocation-target,
  body[data-app-view="plans"] .allocation-row .priority-note,
  body[data-app-view="plans"] .allocation-row .remove-item,
  body[data-app-view="plans"] .shortfall-row .priority-note,
  body[data-app-view="plans"] .shortfall-row .remove-item {
    grid-column: 1 / -1;
  }

  body[data-app-view="plans"] .custom-item-row,
  body[data-app-view="plans"] .liability-repayment-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-app-view="plans"] .custom-item-row::before,
  body[data-app-view="plans"] .liability-repayment-row::before,
  body[data-app-view="plans"] .custom-item-row > label:first-child,
  body[data-app-view="plans"] .liability-repayment-row > label:first-child,
  body[data-app-view="plans"] .sale-details,
  body[data-app-view="plans"] .sale-summary,
  body[data-app-view="plans"] .liability-repayment-note,
  body[data-app-view="plans"] .risk-override-note {
    grid-column: 1 / -1;
  }
}

body[data-app-view="about"] :is(#resultsSummary, .workspace, #resources, #admin),
body[data-app-view="resources"] :is(#resultsSummary, .workspace, #about, #admin) {
  display: none !important;
}

.about-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.about-primary-action,
.about-secondary-action {
  display: inline-flex;
  width: auto;
  min-width: 150px;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
}

.nav-home-icon {
  min-width: 44px;
  padding: 0 8px !important;
}

.nav-home-icon img {
  width: 24px;
  height: 24px;
  display: block;
}

.seo-faq {
  display: grid;
  gap: 12px;
  padding: 32px;
  border: 1px solid var(--dashboard-line);
  border-radius: 16px;
  background: #fff;
}

.seo-faq > span {
  color: var(--dashboard-green);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.seo-faq h2 {
  margin-bottom: 8px;
  color: var(--dashboard-navy);
  font-size: 1.6rem;
}

.seo-faq details {
  padding: 16px 18px;
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 12px;
  background: #f8fbfa;
}

.seo-faq summary {
  color: var(--dashboard-navy);
  cursor: pointer;
  font-weight: 900;
}

.seo-faq p {
  margin: 10px 0 0;
  color: var(--dashboard-muted);
  line-height: 1.65;
}

@media (max-width: 640px) {
  .about-hero-actions {
    flex-direction: column;
  }

  .about-primary-action,
  .about-secondary-action {
    width: 100%;
  }
}
