:root {
  --bg: #05080c;
  --panel: #0d1722;
  --panel-2: #09111a;
  --panel-3: #15283a;
  --line: #33506a;
  --line-soft: #23394d;
  --text: #eef6ff;
  --muted: #9aaec2;
  --hot: #ffd447;
  --blue: #00a8ff;
  --green: #00e08a;
  --red: #ff4d57;
  --cyan: #00e5ff;
  --font-body: "IBM Plex Sans", "Aptos", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  --space-2xs: 3px;
  --space-xs: 5px;
  --space-sm: 8px;
  --space-md: 11px;
  --space-lg: 14px;
  --space-xl: 18px;
  --radius-control: 3px;
  --radius-card: 5px;
  --shadow-card: 0 10px 26px rgba(0, 0, 0, 0.16);
  --page-pad-x: 16px;
  --card-pad: 11px;
  --card-pad-tight: 8px;
  --section-gap: 12px;
  --heading-page: 17px;
  --heading-section: 14px;
  --heading-card: 12.5px;
  --font-body-size: 12px;
  --font-caption-size: 11px;
  --button-height: 34px;
  --nav-icon-size: 13px;
  --nav-tab-pad-y: 8px;
  --nav-tab-pad-x: 12px;
  --mobile-nav-height: 44px;
  --mobile-nav-icon-size: 14px;
  --mobile-secondary-width: 56px;
  --kpi-card-height: 82px;
  --table-pad-y: 4px;
  --table-pad-x: 7px;
  --status-success-border: rgba(0, 224, 138, 0.38);
  --status-warning-border: rgba(255, 212, 71, 0.48);
  --status-danger-border: rgba(255, 77, 87, 0.58);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  width: 100%;
}

body:has(._dash-loading-callback),
body:has(._dash-loading-callback) *,
body:has(#run-scenarios-btn:disabled),
body:has(#run-scenarios-btn:disabled) *,
body:has(#run-mc-btn:disabled),
body:has(#run-mc-btn:disabled) *,
body:has(#refresh-prices-btn:disabled),
body:has(#refresh-prices-btn:disabled) *,
body:has(#safe-withdrawal-btn:disabled),
body:has(#safe-withdrawal-btn:disabled) *,
body:has(#goal-seek-btn:disabled),
body:has(#goal-seek-btn:disabled) * {
  cursor: progress !important;
}

.terminal-shell {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  padding: 0 var(--page-pad-x) 28px;
  background:
    linear-gradient(180deg, rgba(25, 50, 75, 0.95) 0, rgba(5, 8, 12, 0) 230px),
    radial-gradient(circle at 15% 0%, rgba(0, 168, 255, 0.2), transparent 30%),
    radial-gradient(circle at 82% 4%, rgba(255, 212, 71, 0.12), transparent 24%),
    var(--bg);
}

.terminal-shell.light-mode {
  --bg: #f2f5f7;
  --panel: #ffffff;
  --panel-2: #edf2f6;
  --panel-3: #e6edf3;
  --line: #c8d3dc;
  --line-soft: #d9e2e9;
  --text: #172331;
  --muted: #52677d;
  --hot: #9b6500;
  --blue: #0f75bc;
  --green: #0d8a57;
  --red: #c43b3b;
  --cyan: #087d86;
  background:
    linear-gradient(180deg, rgba(219, 230, 239, 0.95) 0, rgba(242, 245, 247, 0) 220px),
    radial-gradient(circle at 15% 0%, rgba(15, 117, 188, 0.14), transparent 28%),
    var(--bg);
}

.light-mode .topbar {
  background: rgba(242, 245, 247, 0.94);
}

.light-mode .brand-mark,
.light-mode .login-input,
.light-mode .setting-input,
.light-mode .setting-switch,
.light-mode .dash-graph,
.light-mode .metric-tile {
  background-color: var(--panel);
}

.light-mode .dash-graph {
  background: #ffffff;
}

.theme-toggle {
  min-width: 88px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 10px 0 8px;
  background: rgba(7, 11, 16, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.brand-text {
  min-width: 0;
}

.brand-mark {
  width: 50px;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.brand-fern {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 48% 28%;
}

.app-title {
  color: #ffffff;
  font-size: var(--heading-page);
  font-weight: 750;
  line-height: 1.1;
}

.app-subtitle {
  color: var(--muted);
  font-size: var(--font-body-size);
  margin-top: 2px;
}

.app-mobile-owner {
  display: none;
}

.login-zone {
  min-width: 280px;
}

.login-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.login-input {
  height: var(--button-height);
  min-width: 180px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 4px var(--space-sm);
  border-radius: var(--radius-control);
}

.login-msg {
  color: var(--muted);
  font-size: var(--font-body-size);
}

.login-setup-label {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--font-body-size);
  font-weight: 800;
}

.auth-identity {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.auth-badge {
  display: inline-block;
  padding: 3px 7px;
  color: var(--green);
  border: 1px solid rgba(71, 209, 140, 0.45);
  background: rgba(71, 209, 140, 0.08);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.host-badge {
  display: inline-block;
  color: var(--hot);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-right: 1ch;
}

.workspace {
  padding-top: var(--section-gap);
}

.terminal-tabs-wrap {
  position: sticky;
  top: 64px;
  z-index: 8;
  background: rgba(5, 8, 12, 0.94);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-top: 4px;
  padding-bottom: 1px;
  backdrop-filter: blur(8px);
}

.light-mode .terminal-tabs-wrap {
  background: rgba(242, 245, 247, 0.94);
}

.terminal-tabs {
  min-width: max-content;
}

.terminal-tabs .tab {
  background: var(--panel-2) !important;
  color: color-mix(in srgb, var(--text) 72%, var(--muted)) !important;
  border: 1px solid var(--line-soft) !important;
  border-bottom: 1px solid var(--line) !important;
  padding: var(--nav-tab-pad-y) var(--nav-tab-pad-x) !important;
  font-size: var(--heading-section);
  font-weight: 650;
  line-height: 1.18;
}

.terminal-tabs .tab::before {
  content: "";
  width: var(--nav-icon-size);
  height: var(--nav-icon-size);
  display: inline-block;
  margin-right: 5px;
  vertical-align: -2px;
  background: currentColor;
  opacity: 0.82;
  -webkit-mask: var(--nav-icon) center / contain no-repeat;
  mask: var(--nav-icon) center / contain no-repeat;
}

.terminal-tabs .tab--selected {
  background: var(--panel-3) !important;
  color: #ffffff !important;
  border-top: 2px solid var(--hot) !important;
  border-bottom: 1px solid var(--panel-3) !important;
}

.secondary-tabs-wrap {
  position: static;
  top: auto;
  z-index: 1;
  margin: 0 0 var(--section-gap);
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

.secondary-tabs {
  min-width: 0;
}

.secondary-tabs .tab {
  font-size: var(--heading-card);
  padding: 7px 10px !important;
}

.mobile-only-advanced-tab {
  display: none !important;
}

.nav-tab {
  --nav-icon: none;
}

.nav-dashboard {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 2 8h1v6.5A1.5 1.5 0 0 0 4.5 16h2A1.5 1.5 0 0 0 8 14.5v-3a.5.5 0 0 1 1 0v3A1.5 1.5 0 0 0 10.5 16h2a1.5 1.5 0 0 0 1.5-1.5V8h1a.5.5 0 0 0 .354-.854z'/%3E%3C/svg%3E");
}

.nav-tax-year {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.585h1.969c.115.465.186.939.186 1.426 0 .938-.387 1.597-.809 2.165H4.5a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1H6.507c.314-.582.593-1.226.593-2.165 0-.489-.06-.953-.165-1.426H9.5a.5.5 0 0 0 0-1H6.731c-.246-.906-.563-1.827-.563-2.794 0-.944.563-1.743 1.854-1.743 1.003 0 1.593.502 1.778 1.284a.5.5 0 1 0 .974-.23C10.488 4.013 9.434 3.5 8.022 3.5c-1.822 0-2.854 1.069-2.854 2.743 0 1.053.317 2.008.57 2.794H4a.5.5 0 0 0 0 1z'/%3E%3C/svg%3E");
}

.nav-projections {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M0 0h1v15h15v1H0zm14.817 3.113a.5.5 0 0 1 .07.704l-4.5 5.5a.5.5 0 0 1-.74.037L7.06 6.767l-3.656 5.027a.5.5 0 0 1-.808-.588l4-5.5a.5.5 0 0 1 .758-.06l2.609 2.61 4.15-5.073a.5.5 0 0 1 .704-.07'/%3E%3C/svg%3E");
}

.nav-monte-carlo {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2zm-6.5 3a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0m6 8a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M5 9.5A1.5 1.5 0 1 0 5 12a1.5 1.5 0 0 0 0-2.5m6-6A1.5 1.5 0 1 0 11 6a1.5 1.5 0 0 0 0-2.5'/%3E%3C/svg%3E");
}

.nav-advanced {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M11.5 2a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3M9.05 3a2.5 2.5 0 0 1 4.9 0H16v1h-2.05a2.5 2.5 0 0 1-4.9 0H0V3zM4.5 7a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3M2.05 8a2.5 2.5 0 0 1 4.9 0H16v1H6.95a2.5 2.5 0 0 1-4.9 0H0V8zm9.45 4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m-2.45 1a2.5 2.5 0 0 1 4.9 0H16v1h-2.05a2.5 2.5 0 0 1-4.9 0H0v-1z'/%3E%3C/svg%3E");
}

.nav-settings {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492M5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0'/%3E%3Cpath d='M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.902 3.433 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.892 3.433-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.892-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52z'/%3E%3C/svg%3E");
}

.nav-help {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16'/%3E%3Cpath d='M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.462 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.29m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94'/%3E%3C/svg%3E");
}

.nav-baseline-pack {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M12.643 15C13.979 15 15 13.845 15 12.5V5H1v7.5C1 13.845 2.021 15 3.357 15zM5.5 7h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1M.8 1a.8.8 0 0 0-.8.8V3a.8.8 0 0 0 .8.8h14.4A.8.8 0 0 0 16 3V1.8a.8.8 0 0 0-.8-.8z'/%3E%3C/svg%3E");
}

.nav-goal-seek {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16'/%3E%3Cpath d='M8 13A5 5 0 1 0 8 3a5 5 0 0 0 0 10m0 1A6 6 0 1 1 8 2a6 6 0 0 1 0 12'/%3E%3Cpath d='M8 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6m0 1A4 4 0 1 1 8 4a4 4 0 0 1 0 8'/%3E%3Cpath d='M9.5 8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0'/%3E%3C/svg%3E");
}

.nav-estate-survivor,
.nav-estate,
.nav-survivor {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 1a1 1 0 0 0-1 1v1H1.5a.5.5 0 0 0 0 1h.538l-1.995 4.65A.5.5 0 0 0 0 8.85C0 10.183 1.12 11 2.5 11S5 10.183 5 8.85a.5.5 0 0 0-.043-.2L2.962 4H5v8H2.5a.5.5 0 0 0 0 1h11a.5.5 0 0 0 0-1H11V4h2.038l-1.995 4.65a.5.5 0 0 0-.043.2c0 1.333 1.12 2.15 2.5 2.15S16 10.183 16 8.85a.5.5 0 0 0-.043-.2L13.962 4h.538a.5.5 0 0 0 0-1H11V2a1 1 0 0 0-1-1zm-2.236 7h-2.53L2.5 5.047zm10.999 0h-2.527L13.5 5.047zM10 2v10H6V2z'/%3E%3C/svg%3E");
}

.metric-strip {
  margin: 0 0 var(--section-gap);
}

.metric-tile {
  min-height: var(--kpi-card-height);
  padding: 11px 13px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(0, 168, 255, 0.08), rgba(255, 212, 71, 0.015)),
    var(--panel);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.metric-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-caption-size);
  font-weight: 700;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 5px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: clamp(17px, 1.8vw, 26px);
  font-weight: 800;
  line-height: 1.05;
}

.metric-good .metric-value {
  color: var(--green);
}

.metric-warn .metric-value {
  color: var(--hot);
}

h5,
h6 {
  color: #ffffff;
  font-weight: 750;
  margin: var(--section-gap) 0 var(--space-sm);
}

.dash-graph {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: var(--section-gap);
  overflow: hidden;
  border-radius: var(--radius-card);
}

.planner-graph .gtitle {
  font-size: 13px !important;
}

.planner-graph .legend text {
  font-size: 8.5px !important;
}

.planner-graph .xtick text,
.planner-graph .ytick text {
  font-size: 9.5px !important;
}

.allocation-panel {
  margin-bottom: var(--section-gap);
}

.allocation-grid {
  row-gap: var(--section-gap);
  align-items: stretch;
}

.allocation-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0 0 var(--space-sm);
  border-radius: var(--radius-card);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.allocation-card .dash-graph {
  border: 0;
  margin-bottom: var(--space-xs);
  flex: 0 0 auto;
}

.allocation-table {
  width: calc(100% - 20px);
  margin: 0 10px;
  color: var(--text);
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 10.5px;
  table-layout: fixed;
}

.allocation-table th,
.allocation-table td {
  border-top: 1px solid var(--line-soft);
  padding: var(--table-pad-y) var(--table-pad-x);
  text-align: right;
  white-space: nowrap;
}

.allocation-table th {
  color: var(--muted);
  background: var(--panel-2);
  font-weight: 800;
  text-transform: uppercase;
}

.allocation-table .allocation-name {
  text-align: left;
  overflow-wrap: anywhere;
  white-space: normal;
}

.allocation-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 1px;
}

.allocation-total td {
  color: var(--hot);
  font-weight: 800;
}

.allocation-headline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-sm) 0 var(--section-gap);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--font-body-size);
}

.allocation-headline span {
  border: 1px solid var(--line);
  background: rgba(0, 168, 255, 0.07);
  padding: 6px 8px;
  border-radius: var(--radius-control);
}

.allocation-headline strong {
  color: var(--muted);
}

.current-policy-panel {
  margin: var(--section-gap) 0 var(--space-lg);
  border: 1px solid var(--line);
  background: rgba(0, 168, 255, 0.025);
  padding: var(--space-sm) var(--card-pad) 10px;
  border-radius: var(--radius-card);
}

.current-policy-panel summary {
  margin-bottom: 0;
  min-height: 32px;
}

.current-policy-panel[open] summary {
  margin-bottom: var(--space-sm);
}

.current-policy-summary-title {
  color: var(--text);
  font-size: var(--heading-section);
  font-weight: 850;
}

.current-policy-summary-subtitle {
  color: var(--muted);
  font-size: var(--font-body-size);
  font-weight: 600;
}

.current-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}

.current-policy-card {
  min-width: 0;
  padding: var(--card-pad-tight) 10px;
  border: 1px solid var(--line-soft);
  background: rgba(9, 17, 26, 0.64);
  border-radius: var(--radius-card);
}

.current-policy-card-ok {
  border-color: var(--status-success-border);
}

.current-policy-card-warning {
  border-color: var(--status-warning-border);
}

.current-policy-card-danger {
  border-color: var(--status-danger-border);
}

.current-policy-card-title {
  color: var(--text);
  font-size: var(--heading-card);
  font-weight: 850;
  margin-bottom: var(--space-sm);
}

.current-policy-card-body {
  display: grid;
  gap: 5px;
}

.current-policy-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(154, 174, 194, 0.12);
  padding-bottom: 5px;
}

.current-policy-label {
  color: var(--muted);
  font-size: var(--font-caption-size);
  min-width: 0;
}

.current-policy-value {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--font-body-size);
  font-weight: 750;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.current-policy-status {
  display: inline-block;
}

.current-policy-ok {
  color: var(--green);
}

.current-policy-warning {
  color: var(--hot);
}

.current-policy-danger {
  color: var(--red);
}

.current-policy-note {
  margin-top: var(--space-sm);
  color: var(--muted);
  font-size: var(--font-caption-size);
  line-height: 1.35;
}

.projection-policy-check {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--panel), var(--panel-2));
  margin: var(--space-lg) 0 var(--space-xl);
  padding: var(--space-lg);
  border-radius: var(--radius-card);
}

.projection-policy-check h6 {
  margin-bottom: var(--section-gap);
}

.projection-summary-panel {
  margin: var(--space-lg) 0 var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid rgba(0, 224, 138, 0.36);
  background:
    linear-gradient(135deg, rgba(0, 224, 138, 0.11), rgba(0, 168, 255, 0.06)),
    var(--panel);
  border-radius: var(--radius-card);
}

.projection-summary-header {
  margin-bottom: var(--section-gap);
}

.projection-summary-header h5 {
  margin: 0 0 6px;
}

.projection-headline-strip {
  display: none;
}

.projection-headline-item {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line-soft);
  background: rgba(9, 17, 26, 0.72);
  border-radius: var(--radius-control);
}

.projection-headline-label,
.projection-headline-value {
  display: block;
}

.projection-headline-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.projection-headline-value {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--heading-card);
  font-weight: 900;
  line-height: 1.12;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.projection-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: var(--space-md);
}

.projection-summary-card {
  min-width: 0;
  padding: var(--card-pad);
  border: 1px solid var(--line-soft);
  background: rgba(9, 17, 26, 0.76);
  border-radius: var(--radius-card);
}

.projection-summary-card summary {
  list-style: none;
}

.projection-summary-card summary::-webkit-details-marker {
  display: none;
}

.projection-summary-mobile-details {
  display: none;
}

.projection-summary-card-title {
  color: var(--text);
  font-size: var(--heading-card);
  font-weight: 850;
  margin-bottom: var(--space-sm);
}

.projection-summary-card-body {
  display: grid;
  gap: 6px;
}

.projection-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  border-bottom: 1px solid rgba(154, 174, 194, 0.14);
  padding-bottom: 5px;
}

.projection-summary-label {
  color: var(--muted);
  font-size: var(--font-body-size);
}

.projection-summary-value {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--font-body-size);
  text-align: right;
}

.projection-summary-ok {
  border-color: var(--status-success-border);
}

.projection-summary-warning {
  border-color: var(--status-warning-border);
}

.projection-summary-danger {
  border-color: var(--status-danger-border);
}

.policy-chart-grid {
  row-gap: 12px;
}

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

.policy-metric-group {
  border: 1px solid var(--line);
  background: rgba(0, 168, 255, 0.04);
  padding: 10px;
}

.policy-group-title {
  color: var(--text);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.policy-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 8px;
}

.tax-action-summary {
  margin: var(--space-sm) 0 var(--space-md);
  padding: var(--card-pad);
  border: 1px solid rgba(0, 168, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(0, 168, 255, 0.12), rgba(0, 224, 138, 0.05)),
    var(--panel);
  border-radius: var(--radius-card);
}

.tax-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.tax-action-header h5,
.tax-action-card h6 {
  margin: 0 0 5px;
}

.tax-action-header h5 {
  font-size: var(--heading-section);
}

.tax-action-card h6 {
  font-size: var(--heading-card);
  line-height: 1.2;
}

.tax-action-month-badge {
  flex: 0 0 auto;
  display: grid;
  gap: 1px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  background: rgba(255, 212, 71, 0.08);
  color: var(--hot);
  font-family: var(--font-mono);
  font-size: var(--font-caption-size);
  font-weight: 800;
}

.tax-action-month-badge span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  text-transform: uppercase;
}

.tax-action-month-badge strong {
  color: var(--hot);
  font-size: var(--font-caption-size);
  line-height: 1.1;
}

.tax-action-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.tax-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-sm);
}

.tax-action-card {
  min-width: 0;
  padding: var(--card-pad-tight) 10px;
  border: 1px solid var(--line-soft);
  background: rgba(9, 17, 26, 0.72);
  border-radius: var(--radius-card);
}

.tax-action-card:first-child {
  border-color: rgba(0, 168, 255, 0.46);
  background:
    linear-gradient(135deg, rgba(0, 168, 255, 0.11), rgba(0, 224, 138, 0.035)),
    rgba(9, 17, 26, 0.78);
}

.tax-action-card summary {
  list-style: none;
}

.tax-action-card summary::-webkit-details-marker {
  display: none;
}

.tax-action-secondary summary {
  cursor: default;
}

.tax-action-secondary:not([open]) > .tax-action-card-body {
  display: block;
}

.tax-action-list {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tax-action-list li,
.tax-action-metrics > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  border-bottom: 1px solid rgba(154, 174, 194, 0.14);
  padding-bottom: 4px;
  font-size: var(--font-body-size);
  line-height: 1.25;
}

.tax-action-list strong,
.tax-action-metrics strong {
  color: var(--text);
  white-space: nowrap;
}

.tax-action-current {
  display: grid;
  gap: var(--space-xs);
}

.tax-action-row {
  border-bottom: 1px solid rgba(154, 174, 194, 0.14);
  padding-bottom: 5px;
}

.tax-action-row-title {
  color: var(--text);
  font-weight: 750;
  font-size: var(--font-body-size);
  line-height: 1.25;
}

.tax-action-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: var(--font-caption-size);
  line-height: 1.25;
}

.empty-note,
.section-note,
.filter-status {
  color: var(--muted);
}

.section-note {
  font-size: var(--font-caption-size);
  line-height: 1.3;
  margin: 2px 0 6px;
}

.tax-action-summary .section-note {
  color: var(--muted);
  font-size: var(--font-caption-size);
  line-height: 1.25;
  margin: 1px 0 0;
}

.tax-action-card .section-note {
  color: color-mix(in srgb, var(--muted) 82%, transparent);
  font-size: 10.5px;
  line-height: 1.28;
  margin: 7px 0 0;
}

.filter-status {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
}

.tax-warning-panel {
  margin: var(--space-xs) 0 var(--space-sm);
  padding: var(--space-sm) 10px;
  border: 1px solid var(--status-danger-border);
  background: rgba(255, 77, 87, 0.08);
  border-radius: var(--radius-card);
}

.tax-warning-panel:empty {
  display: none;
}

.warning-list li {
  color: var(--hot);
}

.policy-metric {
  border: 1px solid var(--line);
  background: rgba(0, 168, 255, 0.06);
  padding: 8px 9px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.policy-metric-label {
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.policy-metric-value {
  color: var(--text);
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 800;
  line-height: 1.25;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .current-policy-grid {
    grid-template-columns: 1fr;
  }

  .policy-metric-groups {
    grid-template-columns: 1fr;
  }
}

.btn,
.terminal-button {
  min-height: var(--button-height);
  padding: 5px 11px !important;
  border-radius: var(--radius-control) !important;
  font-weight: 700 !important;
  border: 1px solid var(--line) !important;
  line-height: 1.2 !important;
}

.btn-primary {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #06101b !important;
}

.btn-secondary {
  background: #17283a !important;
  border-color: #446580 !important;
  color: var(--text) !important;
}

.btn-warning {
  background: var(--hot) !important;
  border-color: var(--hot) !important;
  color: #111111 !important;
}

.btn-danger {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #160808 !important;
}

.terminal-table {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
}

.terminal-table th {
  color: #ffffff;
  background: var(--panel-3);
  border-color: var(--line) !important;
  padding: var(--table-pad-y) var(--table-pad-x);
}

.terminal-table td {
  color: var(--text);
  background: var(--panel);
  border-color: var(--line-soft) !important;
  padding: var(--table-pad-y) var(--table-pad-x);
}

.settings-grid {
  row-gap: 12px;
  margin-bottom: 10px;
  max-width: 1320px;
}

.settings-subsection-card {
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  padding: 12px 14px;
  margin: 10px 0 14px;
  box-sizing: border-box;
}

.settings-subsection-title {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dash-table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td {
  font-size: var(--font-body-size) !important;
  line-height: 1.25 !important;
  padding: var(--table-pad-y) var(--table-pad-x) !important;
}

/* The holdings owner selector uses Dash's embedded legacy React-Select.
 * Keep it visually inside the table rather than as a separate form control. */
#portfolio-table .Select {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--font-body-size);
}

#portfolio-table .Select-control {
  min-height: 22px !important;
  height: 22px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#portfolio-table .Select-value,
#portfolio-table .Select-placeholder,
#portfolio-table .Select--single > .Select-control .Select-value {
  line-height: 22px !important;
  padding-left: 0 !important;
}

#portfolio-table .Select-value-label,
#portfolio-table .Select-placeholder {
  color: var(--text) !important;
}

#portfolio-table .Select-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px !important;
  height: 22px;
  opacity: 0;
  overflow: hidden;
}

#portfolio-table .Select-input > input {
  width: 1px !important;
  min-height: 22px;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  caret-color: transparent;
}

#portfolio-table .Select-arrow-zone {
  width: 18px;
  padding-right: 4px;
}

#portfolio-table .Select-arrow {
  border-color: var(--muted) transparent transparent;
  border-width: 4px 4px 2px;
}

#portfolio-table .Select.is-open .Select-arrow {
  border-color: transparent transparent var(--muted);
  border-width: 0 4px 4px;
}

#portfolio-table .Select-menu-outer,
#portfolio-table .Select-menu {
  z-index: 2000;
  margin-top: 2px;
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  border-radius: 2px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

/* Dash leaves an inline display:none on DataTable's embedded Select menu.
 * Restore it only while the control is in its open state. */
#portfolio-table .Select.is-open .Select-menu-outer {
  display: block !important;
}

#portfolio-table .Select-option,
#portfolio-table .VirtualizedSelectOption {
  min-height: 27px;
  padding: 5px 8px;
  background: var(--panel) !important;
  color: var(--text) !important;
  line-height: 1.2;
}

#portfolio-table .VirtualizedSelectFocusedOption,
#portfolio-table .VirtualizedSelectSelectedOption,
#portfolio-table .Select-option.is-focused,
#portfolio-table .Select-option.is-selected {
  background: var(--panel-3) !important;
  color: var(--text) !important;
}

.other-income-section {
  max-width: 100%;
  margin-bottom: 10px;
}

.other-income-section-empty {
  margin: 0 0 6px;
}

.other-income-card-list {
  display: grid;
  gap: 10px;
  max-width: 1120px;
}

.other-income-card {
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
}

.other-income-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.other-income-card-heading {
  min-width: 0;
}

.other-income-card-title {
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.other-income-card-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-xs);
}

.other-income-card-summary span {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: var(--font-caption-size);
  line-height: 1.2;
  padding: var(--space-2xs) 6px;
  white-space: nowrap;
}

.other-income-delete-btn {
  flex: 0 0 auto;
  color: var(--hot);
  font-weight: 800;
  padding: 0 2px;
  text-decoration: none;
}

.other-income-card-grid {
  row-gap: var(--space-sm);
}

.other-income-notes-input {
  min-height: 34px;
  resize: vertical;
}

.other-income-modelling-note {
  max-width: 760px;
  min-height: 0;
  margin-top: 0;
}

.capital-event-edit-panel summary {
  display: none;
}

.capital-event-edit-panel:not([open]) > .other-income-card-grid,
.capital-event-edit-panel:not([open]) > .settings-grid {
  display: flex;
}

.other-income-empty-help {
  min-height: 0;
  max-width: none;
  margin: 0;
}

.other-income-tax-year-card {
  max-width: 1120px;
}

.other-income-readonly-note {
  min-height: 34px;
  overflow-wrap: anywhere;
}

.other-income-empty {
  display: inline-block;
  margin: 1px 0 0;
  color: var(--muted);
  font-size: var(--font-body-size);
  line-height: 1.25;
}

.other-income-audit-empty {
  margin: 8px 0 2px;
}

.policy-mini-card {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.tax-year-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-xs);
}

.tax-year-context-grid .policy-mini-card {
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid var(--line-soft);
  background: rgba(9, 17, 26, 0.55);
  font-size: var(--font-body-size);
  line-height: 1.2;
}

.tax-year-context-grid .policy-mini-card span {
  color: var(--muted);
}

.tax-year-context-grid .policy-mini-card strong {
  color: var(--text);
  white-space: nowrap;
}

.tax-year-intro-note {
  margin-top: 0;
}

.compact-audit-panel {
  margin-top: 4px;
  padding: 8px 10px;
}

.details-summary-inline {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.setting-label {
  display: block;
  margin: 0 0 5px;
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.setting-input {
  width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
}

.projection-growth-bar {
  align-items: flex-start;
  margin-bottom: 12px;
}

.compact-setting-input {
  width: 92px;
  max-width: 100%;
}

.setting-output {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  background: rgba(15, 23, 32, 0.62);
  color: var(--green);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  font-weight: 800;
}

.compact-setting-output {
  width: 92px;
  max-width: 100%;
}

.projection-growth-msg {
  min-height: 34px;
  display: block;
  color: var(--green);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.safe-withdrawal-result {
  width: 100%;
  max-width: 100%;
  margin: 8px 0 12px;
  white-space: normal;
}

.safe-withdrawal-result-title {
  margin-bottom: 4px;
  font-weight: 800;
}

.safe-withdrawal-result-note,
.safe-withdrawal-result-meta {
  margin-top: 4px;
  opacity: 0.9;
}

.goal-seek-decision-stack {
  display: grid;
  gap: 12px;
  margin: 14px 0 16px;
}

.goal-seek-caveat {
  padding: 10px 12px;
  border: 1px solid rgba(255, 212, 71, 0.45);
  background: rgba(255, 212, 71, 0.08);
  color: var(--hot);
  font-size: 12px;
  font-weight: 750;
}

.decision-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(0, 168, 255, 0.10), rgba(255, 212, 71, 0.03)),
    var(--panel);
  border-radius: 4px;
}

.recommendation-card {
  border-color: rgba(0, 224, 138, 0.48);
}

.secondary-decision-card {
  padding: 12px 14px;
  background:
    linear-gradient(135deg, rgba(0, 168, 255, 0.06), rgba(255, 212, 71, 0.02)),
    var(--panel);
}

.decision-card-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 850;
  margin-bottom: 10px;
}

.compact-title {
  font-size: 15px;
  margin-bottom: 8px;
}

.decision-card-copy {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  max-width: 980px;
}

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

.goal-card-metric {
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  background: rgba(5, 8, 12, 0.24);
}

.goal-card-label {
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.goal-card-value {
  margin-top: 7px;
  color: var(--text);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.1;
}

.runner-up-comparison-card {
  max-width: 980px;
}

.goal-comparison-table-wrap {
  overflow-x: auto;
}

.goal-comparison-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
}

.goal-comparison-table th,
.goal-comparison-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

.goal-comparison-table thead th {
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.goal-comparison-table tbody th {
  color: var(--text);
  font-weight: 750;
  text-align: left;
}

.goal-comparison-table th:not(:first-child),
.goal-comparison-table td {
  text-align: right;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.goal-policy-region-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--hot);
  background: rgba(255, 212, 71, 0.08);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.goal-explanation-list {
  display: grid;
  gap: 6px;
  max-width: 980px;
}

.goal-explanation-row {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.goal-explanation-label {
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.goal-explanation-value {
  min-width: 0;
}

.weight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}

.weight-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  background: rgba(5, 8, 12, 0.20);
  color: var(--text);
  font-size: 12px;
}

.weight-pill strong {
  color: var(--green);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
}

.mc-output-panel {
  display: grid;
  gap: 12px;
  margin: 10px 0 14px;
}

.mc-headline {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.mc-assumption-line {
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  line-height: 1.4;
}

.mc-diagnostic-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.mc-percentile-table {
  margin-bottom: 0;
}

.mc-percentile-table th,
.mc-percentile-table td {
  white-space: nowrap;
}

.details-panel {
  margin: 10px 0 18px;
  color: var(--text);
}

.details-panel summary {
  cursor: pointer;
  color: var(--hot);
  font-weight: 800;
  margin-bottom: 8px;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.details-panel summary::-webkit-details-marker {
  display: none;
}

.details-panel summary::before {
  content: "▶";
  color: var(--accent);
  display: inline-block;
  font-size: 0.9em;
  transform-origin: center;
  transition: transform 120ms ease;
}

.details-panel[open] summary::before {
  transform: rotate(90deg);
}

.assumptions-panel {
  border: 1px solid var(--line);
  background: rgba(0, 168, 255, 0.035);
  padding: 10px 12px;
}

.advanced-settings-panel {
  border: 1px solid var(--line);
  background: rgba(0, 168, 255, 0.025);
  border-radius: 2px;
  padding: 10px 12px;
}

.settings-section {
  max-width: 1320px;
}

.settings-subhead {
  color: var(--text);
  font-weight: 800;
  margin: 14px 0 8px;
}

.settings-warning {
  max-width: 860px;
  margin-bottom: 12px;
}

.mc-setup-summary {
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  line-height: 1.45;
  margin: -2px 0 12px;
}

.mc-assumptions-summary {
  margin-top: 14px;
  margin-bottom: 6px;
}

.assumption-snapshot {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.assumption-section {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.assumption-section-title {
  color: var(--text);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.assumption-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.assumption-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  padding: 7px 8px;
}

.assumption-label {
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.assumption-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.field-help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  min-height: 38px;
  max-width: 220px;
}

.setting-dropdown .Select-control,
.setting-dropdown .Select-menu-outer,
.setting-dropdown .Select-menu,
.setting-dropdown .Select-option,
.setting-dropdown .Select-input,
.setting-dropdown .Select-input > input {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text);
}

.setting-dropdown .Select-value-label,
.setting-dropdown .Select-placeholder,
.setting-dropdown .VirtualizedSelectOption,
.setting-dropdown .Select-option {
  color: var(--text) !important;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
}

.setting-dropdown .VirtualizedSelectFocusedOption,
.setting-dropdown .VirtualizedSelectSelectedOption,
.setting-dropdown .Select-option.is-focused,
.setting-dropdown .Select-option.is-selected {
  background: var(--panel-3);
  color: var(--text) !important;
}

.setting-dropdown .Select-menu-outer {
  z-index: 2000;
}

.setting-dropdown.Select,
.setting-dropdown.is-focused > .Select-control,
.setting-dropdown.is-open > .Select-control,
.setting-dropdown.has-value.Select--single > .Select-control,
.setting-dropdown.has-value.is-focused.Select--single > .Select-control,
.setting-dropdown.has-value.is-open.Select--single > .Select-control,
.tax-year-dropdown.Select,
.tax-year-dropdown .Select-control,
.tax-year-dropdown.is-focused > .Select-control,
.tax-year-dropdown.is-open > .Select-control,
.tax-year-dropdown.has-value.Select--single > .Select-control {
  background: var(--panel) !important;
  background-color: var(--panel) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
  color: var(--text) !important;
}

.setting-dropdown .Select-control,
.tax-year-dropdown .Select-control {
  min-height: 38px;
}

.setting-dropdown .Select-value,
.tax-year-dropdown .Select-value {
  background: transparent !important;
  border: 0 !important;
}

.setting-dropdown .Select-value-label,
.tax-year-dropdown .Select-value-label {
  color: var(--text) !important;
}

.setting-dropdown .Select-input,
.setting-dropdown .Select-input > input,
.tax-year-dropdown .Select-input,
.tax-year-dropdown .Select-input > input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.tax-year-dropdown .Select-input {
  display: none !important;
}

.setting-check {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
}

.setting-switch {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
}

.setting-switch .form-check-input:not(:checked) {
  background-color: #243c52 !important;
  border-color: #6e87a0 !important;
}

.setting-switch .form-check-input:checked {
  background-color: var(--green) !important;
  border-color: var(--green) !important;
}

.setting-switch .form-check-input {
  cursor: pointer;
}

.setting-switch .form-check-label {
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-weight: 700;
}

.guardrails-disabled > div:not(:first-child) {
  opacity: 0.42;
  filter: grayscale(0.8);
}

.guardrails-disabled > div:not(:first-child) input {
  cursor: not-allowed;
}

.settings-review {
  max-width: 1320px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px 18px 14px 28px;
  font-size: 13px;
}

.settings-review li {
  margin-bottom: 7px;
}

.settings-json {
  max-width: 1320px;
  width: 100%;
  height: 420px;
  padding: 10px 12px;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
}

textarea,
input {
  max-width: 100%;
  background: var(--panel) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: 2px !important;
}

.dash-spinner {
  color: var(--hot);
}

@media (max-width: 1200px) {
  .terminal-tabs .tab {
    padding: 8px 11px !important;
    font-size: 13.5px;
  }
}

@media (max-width: 767px) {
  .terminal-shell {
    padding: 0 max(11px, env(safe-area-inset-left)) 20px max(11px, env(safe-area-inset-right));
  }

  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .row > [class*="col-"] {
    padding-left: 3px;
    padding-right: 3px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    flex-direction: unset;
    position: static;
    gap: 2px 6px;
    padding: 4px 0 3px;
  }

  .brand-block {
    display: contents;
  }

  .brand-text {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 0;
  }

  .brand-mark {
    grid-column: 1;
    grid-row: 1;
    width: 30px;
    height: 21px;
    flex: 0 0 auto;
  }

  .app-title {
    font-size: 12.8px;
    line-height: 1.05;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-title-separator,
  .app-title-owner {
    display: none;
  }

  .app-subtitle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 9.5px;
    line-height: 1.1;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-mobile-owner {
    display: inline;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-desktop-subtitle {
    display: none;
  }

  .login-zone {
    grid-column: 3;
    grid-row: 2;
    min-width: 0;
    width: auto;
    margin-left: auto;
  }

  .login-row {
    justify-content: flex-end;
    flex-wrap: wrap;
    width: 100%;
  }

  .auth-identity {
    justify-content: flex-end;
    gap: 3px;
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
  }

  .auth-badge {
    max-width: min(58vw, 210px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 2px 5px;
    font-size: 8.5px;
    line-height: 1.15;
    letter-spacing: 0.01em;
  }

  .host-badge {
    display: inline-block;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8.5px;
    line-height: 1.15;
    margin-right: 0;
  }

  .login-input {
    min-width: 0;
    flex: 1 1 180px;
  }

  .metric-strip {
    --bs-gutter-x: var(--space-sm);
    margin-bottom: var(--space-sm);
  }

  .metric-strip > [class*="col-"] {
    flex: 0 0 50%;
    max-width: 50%;
    margin-bottom: var(--space-sm);
  }

  .allocation-grid > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .metric-tile {
    min-height: 56px;
    padding: 6px 7px;
  }

  .metric-label {
    font-size: 9.5px;
    line-height: 1.15;
  }

  .metric-value {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .goal-card-grid,
  .weight-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .runner-up-comparison-card {
    max-width: none;
  }

  .tax-action-header {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    margin-bottom: 5px;
  }

  .tax-action-grid {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .tax-action-list li,
  .tax-action-metrics > div,
  .projection-summary-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .terminal-tabs-wrap {
    position: sticky;
    top: 0;
    z-index: 11;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-top: max(3px, env(safe-area-inset-top));
    padding-bottom: 3px;
    background: rgba(5, 8, 12, 0.96);
    backdrop-filter: blur(8px);
    scrollbar-width: none;
  }

  .terminal-tabs-wrap::-webkit-scrollbar {
    display: none;
  }

  #main-tabs.terminal-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    flex-direction: row !important;
    gap: 3px;
    width: 100%;
    min-width: 0;
    align-items: stretch;
  }

  #main-tabs.terminal-tabs .tab {
    flex: none;
    width: auto;
    min-width: 0;
    overflow: hidden;
    min-height: var(--mobile-nav-height);
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1px;
    padding: 2px 3px !important;
    border-radius: 6px;
    text-align: center;
    color: color-mix(in srgb, var(--text) 76%, var(--muted)) !important;
    font-size: 8.5px;
    line-height: 1.08;
    white-space: nowrap;
  }

  #main-tabs.terminal-tabs .tab::before,
  #advanced-tabs.secondary-tabs .tab::before,
  #estate-survivor-tabs.tertiary-tabs .tab::before {
    content: "";
    width: var(--mobile-nav-icon-size);
    height: var(--mobile-nav-icon-size);
    display: block;
    flex: 0 0 var(--mobile-nav-icon-size);
    margin-right: 0;
    vertical-align: baseline;
    background: currentColor;
    opacity: 0.88;
    -webkit-mask: var(--nav-icon) center / contain no-repeat;
    mask: var(--nav-icon) center / contain no-repeat;
  }

  #main-tabs.terminal-tabs .tab--selected {
    color: #ffffff !important;
    border-top: 1px solid var(--hot) !important;
    border-bottom: 2px solid var(--hot) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 212, 71, 0.24);
  }

  .secondary-tabs-wrap {
    margin: 0 0 6px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  #advanced-tabs.secondary-tabs,
  #estate-survivor-tabs.tertiary-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex-direction: row !important;
    gap: 4px;
    width: 100%;
    min-width: 0;
    align-items: stretch;
  }

  #advanced-tabs.secondary-tabs .tab,
  #estate-survivor-tabs.tertiary-tabs .tab {
    flex: none;
    width: auto;
    min-width: 0;
    min-height: 40px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    padding: 3px 4px !important;
    border-radius: var(--radius-card);
    font-size: 8px;
    line-height: 1.05;
    white-space: normal;
    text-align: center;
    scroll-snap-align: center;
  }

  #advanced-tabs.secondary-tabs .nav-baseline-pack,
  #advanced-tabs.secondary-tabs .nav-estate-survivor {
    font-size: 8px;
  }

  #advanced-tabs.secondary-tabs .tab--selected,
  #estate-survivor-tabs.tertiary-tabs .tab--selected {
    border-top: 1px solid var(--hot) !important;
    border-bottom: 2px solid var(--hot) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 212, 71, 0.24);
  }

  #main-tabs.terminal-tabs .desktop-monte-carlo-tab {
    display: none !important;
  }

  #advanced-tabs.secondary-tabs .mobile-only-advanced-tab {
    display: block !important;
  }

  .monte-carlo-core-grid > div,
  .advanced-settings-panel .settings-grid > div {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .advanced-settings-panel,
  .assumptions-panel {
    padding: 12px;
  }

  .details-panel summary {
    min-height: 44px;
  }

  .workspace {
    padding-top: 5px;
  }

  .workspace h5,
  .workspace h6 {
    margin-top: 8px;
    margin-bottom: 7px;
  }

  .workspace .tab-content > br:first-child,
  .workspace .tab-content > div > br:first-child {
    display: none;
  }

  .tax-year-intro-grid {
    align-items: end;
    gap: 4px 0;
  }

  .tax-year-context-grid {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .tax-year-context-grid .policy-mini-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 3px 6px;
    font-size: 10.5px;
  }

  .tax-year-intro-note {
    margin-bottom: 4px;
  }

  .tax-action-summary {
    margin: 8px 0 9px;
    padding: 8px;
  }

  .tax-action-header h5 {
    font-size: 14px;
  }

  .tax-action-badges {
    justify-content: flex-start;
    gap: 4px;
  }

  .tax-action-month-badge {
    padding: 3px 5px;
    font-size: 10px;
  }

  .tax-action-month-badge span {
    color: var(--muted);
    font-size: 8.5px;
    line-height: 1;
    text-transform: uppercase;
  }

  .tax-action-month-badge strong {
    color: var(--hot);
    font-size: 10.5px;
    line-height: 1.05;
  }

  .tax-action-card {
    padding: 7px 8px;
  }

  .tax-action-secondary summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
  }

  .tax-action-secondary summary::after {
    content: "+";
    color: var(--hot);
    font-weight: 900;
    margin-left: 8px;
  }

  .tax-action-secondary[open] summary::after {
    content: "-";
  }

  .tax-action-secondary:not([open]) > .tax-action-card-body {
    display: none;
  }

  .capital-event-card,
  .capital-event-tax-year-card {
    padding: 8px;
  }

  .capital-event-card .other-income-card-header,
  .capital-event-tax-year-card .other-income-card-header {
    margin-bottom: 5px;
  }

  .capital-event-edit-panel summary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
  }

  .capital-event-edit-panel:not([open]) > .other-income-card-grid,
  .capital-event-edit-panel:not([open]) > .settings-grid {
    display: none;
  }

  .capital-event-edit-panel[open] > .other-income-card-grid,
  .capital-event-edit-panel[open] > .settings-grid {
    display: flex;
  }

  .settings-grid,
  .projection-growth-bar {
    margin-top: 4px;
    margin-bottom: 7px;
  }

  .projection-quick-assumptions > [class*="col-"] {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .projection-quick-assumptions > [class*="col-"]:last-child {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .projection-quick-assumptions .projection-growth-msg:empty {
    display: none;
  }

  .projection-summary-panel {
    margin: 8px 0 10px;
    padding: 9px;
  }

  .projection-summary-header {
    margin-bottom: 7px;
  }

  .projection-summary-header h5 {
    font-size: 14px;
    margin-bottom: 3px;
  }

  .projection-summary-header .section-note {
    display: none;
  }

  .projection-headline-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 7px;
  }

  .projection-headline-item {
    padding: 6px 7px;
  }

  .projection-headline-label {
    font-size: 8.5px;
  }

  .projection-headline-value {
    font-size: 11.5px;
  }

  .projection-summary-grid {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .projection-summary-card {
    padding: 8px 9px;
  }

  .projection-summary-card-title {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .projection-summary-collapsible > .projection-summary-desktop-title,
  .projection-summary-collapsible > .projection-summary-desktop-body {
    display: none;
  }

  .projection-summary-mobile-details {
    display: block;
  }

  .projection-summary-mobile-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
  }

  .projection-summary-mobile-details summary::after {
    content: "+";
    color: var(--hot);
    font-weight: 900;
    margin-left: 8px;
  }

  .projection-summary-mobile-details[open] summary::after {
    content: "-";
  }

  .section-note,
  .field-help {
    margin-top: 2px;
    margin-bottom: 6px;
  }

  .dash-graph {
    margin-left: 0;
    margin-right: 0;
    border-left: none;
    border-right: none;
    min-height: 330px;
    width: 100%;
    max-width: 100%;
  }

  .dash-graph .modebar {
    display: none !important;
  }

  .planner-graph .gtitle {
    font-size: 12px !important;
  }

  .planner-graph .legend text {
    font-size: 7.5px !important;
  }

  .planner-graph .xtick text,
  .planner-graph .ytick text {
    font-size: 7.5px !important;
  }

  .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th,
  .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td {
    min-width: 78px !important;
    max-width: 160px !important;
    font-size: 11px !important;
    padding: 4px 5px !important;
  }

  .settings-json {
    height: 300px;
  }
}

@media (max-width: 560px) {
  .terminal-shell {
    padding: 0 max(10px, env(safe-area-inset-left)) 18px max(10px, env(safe-area-inset-right));
  }

  .workspace {
    padding-top: 4px;
  }

  .topbar {
    gap: 4px 5px;
    padding-top: 3px;
    padding-bottom: 2px;
  }

  .brand-mark {
    width: 28px;
    height: 20px;
  }

  .brand-fern {
    width: 100%;
    height: 100%;
  }

  .app-title {
    font-size: 12px;
  }

  .app-subtitle {
    display: flex;
    font-size: 9.5px;
  }

  .login-row .btn,
  .login-row .terminal-button {
    width: 100%;
  }

  .login-input {
    flex-basis: 100%;
    height: 42px;
  }

  .metric-tile {
    min-height: 56px;
    padding: 6px 7px;
  }

  .metric-value {
    font-size: 14px;
  }

  .goal-card-grid,
  .weight-grid {
    grid-template-columns: 1fr;
  }

  .goal-card-value {
    font-size: 16px;
  }

  .goal-explanation-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .allocation-table {
    font-size: 10px;
  }

  .allocation-table th,
  .allocation-table td {
    padding: 5px 4px;
  }

  .allocation-headline {
    display: block;
    font-size: 11px;
  }

  .allocation-headline span {
    display: block;
    margin-bottom: 6px;
  }

  h5,
  h6 {
    font-size: 15px;
  }

  .terminal-tabs-wrap {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
  }

  #main-tabs.terminal-tabs .tab {
    flex-basis: auto;
    min-width: 0;
    min-height: 42px;
    padding: 3px 2px !important;
    font-size: 8px;
  }

  #main-tabs.terminal-tabs .tab::before {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }

  #advanced-tabs.secondary-tabs .tab,
  #estate-survivor-tabs.tertiary-tabs .tab {
    width: auto;
    min-width: 0;
    min-height: 38px;
    padding: 3px !important;
    font-size: 7.8px;
  }

  #advanced-tabs.secondary-tabs .tab::before,
  #estate-survivor-tabs.tertiary-tabs .tab::before {
    width: 12px;
    height: 12px;
    flex-basis: 12px;
  }

  .btn {
    width: 100%;
    margin: 0 0 8px !important;
    min-height: 42px;
  }

  .stale-actions .btn,
  .stale-actions .terminal-button {
    width: 100%;
  }

  .setting-label {
    font-size: 10px;
  }

  .settings-grid > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .projection-quick-assumptions > [class*="col-"] {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .projection-quick-assumptions > [class*="col-"]:last-child {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .setting-input,
  .setting-check,
  .setting-switch,
  .setting-dropdown {
    min-height: 42px;
    font-size: 14px;
  }

  .compact-setting-input {
    max-width: 100%;
  }

  .field-help {
    font-size: 11px;
    line-height: 1.35;
  }

  .projection-growth-msg {
    min-height: 22px;
    margin-top: 4px;
  }

  .dash-graph {
    margin-left: 0;
    margin-right: 0;
    border-left: none;
    border-right: none;
    min-height: 330px;
  }

  .dash-graph .modebar {
    display: none !important;
  }

  .planner-graph .gtitle {
    font-size: 12px !important;
  }

  .planner-graph .legend text {
    font-size: 7.5px !important;
  }

  .planner-graph .xtick text,
  .planner-graph .ytick text {
    font-size: 7.5px !important;
  }

  .dash-table-container {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th,
  .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td {
    min-width: 96px !important;
    max-width: 168px !important;
    font-size: 12px !important;
    padding: 7px 8px !important;
  }

  .dash-table-container input {
    min-height: 34px;
    font-size: 13px !important;
  }

.settings-review {
  max-width: 1320px;
  padding: 12px 12px 12px 24px;
}

.settings-json {
  max-width: 1320px;
  height: 240px;
}
}

.stale-alert {
  border: 1px solid rgba(246, 200, 95, 0.45);
  background: rgba(246, 200, 95, 0.1);
  color: var(--text);
}

.stale-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
