:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #dbe1ea;
  --accent: #1d4ed8;
  --accent-soft: #dbeafe;
  --good: #166534;
  --bad: #991b1b;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin:0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
/* Prevent accidental double-tap zoom on touch devices without blocking pinch zoom. */
button, .buttonish, a.buttonish, .nav button, select { touch-action: manipulation; }
/* Clear keyboard-focus indicator for accessibility. */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
header { background:#0f172a; color:#fff; position:static; z-index:20; box-shadow:0 4px 18px rgba(15,23,42,.18); }
.header-inner {
  max-width:1380px;
  margin:0 auto;
  padding:10px 16px 12px;
  display:grid;
  grid-template-columns:minmax(190px,240px) 1fr auto;
  grid-template-areas:
    "brand nav anon"
    "brand controls controls";
  gap:8px 16px;
  align-items:start;
}
.brand-block { grid-area:brand; min-width:0; max-width:320px; }
.brand-link { display:flex; align-items:center; gap:12px; color:inherit; text-decoration:none; }
.site-logo { width:88px; height:auto; display:block; border-radius:14px; box-shadow:0 4px 14px rgba(0,0,0,.22); background:rgba(255,255,255,.08); }
.brand-text { min-width:0; }
.brand { font-size:1.05rem; font-weight:700; line-height:1.2; }
.subbrand { font-size:.78rem; color:#cbd5e1; margin-top:4px; line-height:1.28; max-width:30ch; }
.nav { grid-area:nav; display:flex; flex-wrap:wrap; gap:6px; align-items:flex-start; }
.nav button, .nav a { background:transparent; border:1px solid rgba(255,255,255,.18); color:#fff; border-radius:999px; padding:5px 10px; cursor:pointer; font-size:.95rem; line-height:1.1; }
.nav button.active, .nav a.active { background:#fff; color:#0f172a; }
.header-controls {
  grid-area:controls;
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:8px 14px;
  align-items:center;
  min-width:0;
}
.scenario-controls, .session-controls { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.scenario-controls { flex:1 1 520px; }
.mode-controls { flex:0 0 auto; }
.session-controls { margin-left:auto; justify-content:flex-end; }
.scenario-controls select { min-width:210px; max-width:260px; }
.subtle-label { color:#cbd5e1; font-size:.82rem; }
.user-email { color:#e5e7eb; font-size:.92rem; }
.status-pill { padding:5px 10px; border-radius:999px; background:rgba(255,255,255,.12); color:#e5e7eb; font-size:.82rem; min-width:84px; text-align:center; }
.status-pill.error { background:#7f1d1d; color:#fff; }
#anon-status { grid-area:anon; justify-self:end; align-self:start; }
.hidden { display:none !important; }
main { max-width:1380px; margin:0 auto; padding:16px; display:grid; gap:18px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:18px; padding:18px; box-shadow:0 8px 20px rgba(15,23,42,.04); }
.cards { display:grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap:16px; }
.metric-label { color:var(--muted); font-size:.9rem; }
.metric-value { font-size:1.65rem; font-weight:700; margin-top:6px; }
.muted { color:var(--muted); }
.pill { display:inline-block; padding:4px 10px; border-radius:999px; background:var(--accent-soft); color:#1e40af; font-size:.82rem; margin-bottom:10px; }
.callout { border-left:4px solid var(--accent); background:#eff6ff; padding:12px 14px; border-radius:0 12px 12px 0; }
.warning-callout { border-left-color:#f59e0b; background:#fffbeb; color:#78350f; }

.glossary-term {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-bottom: 1px dotted var(--accent);
  color: inherit;
  cursor: help;
}
.glossary-term::after {
  content: '?';
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1e40af;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.glossary-popover {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  z-index: 50;
  left: 0;
  bottom: calc(100% + 9px);
  width: min(320px, 82vw);
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
  font-size: .86rem;
  line-height: 1.35;
  font-weight: 400;
  white-space: normal;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  transform: translateY(4px);
}
.glossary-term:hover .glossary-popover,
.glossary-term:focus .glossary-popover,
.glossary-term:focus-within .glossary-popover {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.state-tax-card .base-settings-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.compact-settings-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.section-title { margin:0 0 14px 0; }
.card h1, .card h2, .card h3 { margin:0 0 14px 0; line-height:1.3; }
p, ol { margin-top:0; }
.toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.toolbar button, .toolbar .buttonish, .toolbar label.buttonish, a.buttonish, .action-btn, button, label.buttonish {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration:none;
  display:inline-block;
}
.secondary { background:#fff !important; color:var(--text) !important; border:1px solid var(--line) !important; }
.small-btn { padding:7px 11px; font-size:.9rem; }
.table-wrap { overflow:auto; max-width:100%; max-height:62vh; margin-top:12px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.table-wrap table { min-width:0; }
.table-wrap.wide-table table { min-width:760px; }
table { width:100%; border-collapse:collapse; background:#fff; }
th, td { padding:10px 12px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
th { background:#f8fafc; font-size:.92rem; position:sticky; top:0; z-index:2; box-shadow:inset 0 -1px 0 var(--line); }
input, select, textarea, button { font:inherit; }
input[type='text'], input[type='number'], input[type='date'], input[type='email'], input[type='password'], select, textarea {
  width:100%; padding:8px 10px; border-radius:10px; border:1px solid #cbd5e1; background:#fff;
}
textarea { min-height:80px; }
.grid-2 { display:grid; gap:16px; grid-template-columns: 1.1fr .9fr; }
.auth-grid { display:grid; gap:16px; grid-template-columns: 1.2fr .9fr .9fr; }
.auth-card { min-height: 100%; }
.stack-form { display:grid; gap:12px; }
.stack-form label { display:grid; gap:6px; font-weight:600; }
.section { display:none; gap:18px; }
.section.active { display:grid; }
.small { font-size:.9rem; }
.footer-note { margin-top:12px; color:var(--muted); font-size:.9rem; line-height:1.45; }
.right { text-align:right; }
.positive { color:var(--good); }
.negative { color:var(--bad); }
.spacer { height:6px; }
@media (max-width: 1180px) {
  .site-logo { width:76px; }
  .header-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "anon"
      "nav"
      "controls";
  }
  #anon-status { justify-self:start; }
  .header-controls { justify-content:flex-start; }
  .session-controls { margin-left:0; }
  .auth-grid { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .grid-2 { grid-template-columns: 1fr; }
  .brand-link { align-items:flex-start; }
  .site-logo { width:68px; }
  .table-wrap { max-height:50vh; }
  .header-inner { padding:10px 12px 12px; gap:8px 12px; }
  .nav button { font-size:.9rem; padding:5px 9px; }
  .scenario-controls select { min-width:180px; max-width:none; }
}

.auth-grid-production { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.footer-note a { color: var(--accent); }

.auth-grid-reset { grid-template-columns: minmax(320px, 640px); justify-content: center; }
.reset-page-card { max-width: 640px; width: 100%; justify-self: center; }

.table-toolbar { justify-content: space-between; }
.table-toolbar h2 { margin-bottom: 0; }

.choice-row { display:flex !important; align-items:center; gap:10px; font-weight:600; }
.choice-row input[type="radio"], .choice-row input[type="checkbox"] { width:auto; margin:0; }
.two-col-grid { display:grid; gap:12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
#twofactor-card .toolbar { margin-top: 4px; }

.summary-row td { background:#f8fafc; font-weight:700; position:sticky; bottom:0; z-index:1; box-shadow:inset 0 1px 0 var(--line); }
.summary-label { text-align:right; color:var(--muted); }
.inline-note { margin-top:8px; }
.inline-note.error-text { color:var(--bad); }

.mode-controls { display:flex; align-items:center; gap:8px; }
.segmented { display:inline-flex; background:rgba(255,255,255,.08); border-radius:999px; padding:3px; gap:4px; }
.segmented button { background:transparent; border:0; color:#fff; border-radius:999px; padding:6px 12px; }
.segmented button.active { background:#fff; color:#0f172a; }
.advanced-only.hidden-by-mode { display:none !important; }
.simple-only.hidden-by-mode { display:none !important; }
.helper-text { color:var(--muted); font-size:.88rem; line-height:1.45; margin-top:6px; }
.helper-chip { display:inline-block; font-size:.78rem; background:#eef2ff; color:#3730a3; border-radius:999px; padding:3px 8px; margin-left:8px; }
.warning-list, .action-list, .check-list { margin:0; padding-left:18px; line-height:1.6; }
.warning-list li { color:var(--bad); }
.check-list li.good { color:var(--good); }
.hero-grid { display:grid; gap:16px; grid-template-columns: 1.15fr .85fr; }
.hero-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:12px; }
.section-kicker { text-transform:uppercase; letter-spacing:.08em; font-size:.75rem; color:#475569; margin-bottom:8px; }
.empty-state { border:1px dashed #cbd5e1; border-radius:14px; padding:18px; background:#f8fafc; }
.summary-grid { display:grid; gap:16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.summary-box { border:1px solid var(--line); border-radius:14px; padding:14px; background:#f8fafc; }
.summary-box h3 { margin-bottom:10px; }
.wizard-shell { display:grid; gap:18px; }
.wizard-progress { display:grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap:10px; }
.wizard-step { border:1px solid var(--line); border-radius:14px; padding:12px; background:#fff; color:var(--text); width:100%; text-align:left; }
.wizard-step.active { border-color:var(--accent); box-shadow:0 0 0 2px rgba(29,78,216,.08); }
.wizard-step.done { background:#f0fdf4; border-color:#86efac; }
.wizard-step-title { font-weight:700; margin-bottom:4px; }
.wizard-nav { display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between; align-items:center; }
.kpi-strip { display:grid; gap:12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi-strip .summary-box { background:#fff; }
.table-note-row td { background:#fcfcfd; color:var(--muted); font-size:.85rem; }
.actions-col { white-space:nowrap; width:140px; }
.icon-btn-row { display:flex; gap:6px; }
.icon-btn { min-width:34px; padding:7px 9px; }
.warning-card { border-left:4px solid #f59e0b; }
.good-card { border-left:4px solid #16a34a; }
.bad-card { border-left:4px solid #dc2626; }
.print-only { display:none; }
.subcard-grid { display:grid; gap:12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.info-definition { display:grid; gap:8px; }
.info-definition div { display:flex; justify-content:space-between; gap:16px; border-bottom:1px dashed var(--line); padding-bottom:6px; }
.status-inline { font-weight:700; }
.page-anchor-links { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.page-anchor-links button { background:#fff; color:var(--text); border:1px solid var(--line); }
.first-year-action { font-size:1.05rem; font-weight:700; }
.section-tabs-mini { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.section-tabs-mini button { background:#fff; color:var(--text); border:1px solid var(--line); }
.section-tabs-mini button.active { background:var(--accent-soft); color:#1e40af; }
.warning-pill { display:inline-block; padding:4px 8px; border-radius:999px; background:#fef3c7; color:#92400e; font-size:.82rem; }
.good-pill { display:inline-block; padding:4px 8px; border-radius:999px; background:#dcfce7; color:#166534; font-size:.82rem; }
@media print {
  header, #auth, #reset-page, #wizard, #cashflow, #review, #overrides, #holdings, #projection, #comparison, #account, #settings, .hero-actions, .page-anchor-links, .toolbar, .mode-controls, .scenario-controls, .session-controls, .helper-chip { display:none !important; }
  body { background:#fff; }
  main { max-width:none; padding:0; }
  body[data-active-tab="summary"] #summary { display:block !important; }
  body[data-active-tab="comparison"] #comparison { display:block !important; }
  body[data-active-tab="comparison"] #summary { display:none !important; }
  .card, .summary-box { box-shadow:none; border:1px solid #ddd; break-inside:avoid; }
  .print-only { display:block; }
}

.auth-card .toolbar { margin-top: 10px; }

.login-help-toolbar { margin-top: 8px; }
.reset-inline-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.reset-inline-panel h3 { margin: 0 0 8px; }
.reset-inline-panel .muted { margin-top: 0; }
.auth-logo { display:block; width:min(280px, 100%); height:auto; margin:0 0 14px; border-radius:18px; box-shadow:0 8px 20px rgba(15,23,42,.08); }
.footer-note.success-text { color: var(--good); }
.footer-note.error-text { color: var(--bad); }


.account-scenario-controls { margin-top: 12px; gap: 10px; }
.account-scenario-controls .subtle-label { color: var(--muted); }
.account-scenario-controls select { min-width: 260px; }

.site-footer { max-width:1380px; margin:0 auto 24px; padding:0 20px; color:var(--muted); display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; font-size:.9rem; }
.site-footer a { color:var(--accent); text-decoration:none; }
.footer-build, .app-version-note { color: var(--muted); font-size: .86rem; }
.app-version-note { margin-top: 10px; }


.account-scenario-controls { gap:10px; align-items:flex-end; }
.account-backup-toolbar { margin-top:10px; }
.compact-settings-box .info-definition span { min-width: 0; }
.mobile-form-list { display:grid; gap:12px; margin-top:12px; }
.mobile-edit-card { border:1px solid var(--line); border-radius:14px; padding:14px; background:#fff; }
.mobile-edit-card-header { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px; }
.mobile-edit-grid { display:grid; gap:10px; grid-template-columns:repeat(auto-fit, minmax(min(260px, 100%), 1fr)); align-items:start; }
.mobile-edit-row { display:grid !important; gap:6px; font-weight:600; }
.mobile-edit-label { color:var(--muted); font-size:.85rem; font-weight:600; }
.compact-definition { gap:6px; }
.compact-definition div { padding-bottom:4px; }

.rmd-source-summary { display:grid; gap:6px; margin-top:10px; }
.rmd-source-row { display:grid; grid-template-columns:minmax(150px, max-content) minmax(0, 1fr); justify-content:start; column-gap:14px; row-gap:2px; align-items:start; border-bottom:1px dashed var(--line); padding-bottom:4px; }
.rmd-source-label { white-space:nowrap; }
.rmd-source-detail { min-width:0; text-align:left; }

@media (max-width: 900px) {
  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.45) transparent;
    /* Fade the right edge so it is obvious there are more tabs to scroll to on tablets. */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .nav button { flex: 0 0 auto; }
  .header-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .mode-controls, .session-controls, .scenario-controls { width:100%; }
  .session-controls { justify-content:space-between; }
  .hero-grid { grid-template-columns:1fr; }
  .wizard-nav { justify-content:flex-start; }
}

@media (max-width: 768px) {
  main { padding:12px; gap:14px; }
  .card { padding:14px; border-radius:16px; }
  .cards, .summary-grid, .subcard-grid, .kpi-strip, .wizard-progress, .two-col-grid { grid-template-columns:1fr; }
  .toolbar { align-items:stretch; }
  .toolbar button, .toolbar .buttonish, .toolbar label.buttonish, a.buttonish, .action-btn, button, label.buttonish { width:100%; text-align:center; }
  .icon-btn-row { flex-wrap:wrap; }
  .icon-btn-row .icon-btn, .icon-btn-row .small-btn { width:auto; }
  .table-wrap { max-height:none; }
  .table-wrap:not(.wide-table) { overflow-x:visible; }
  .table-wrap:not(.wide-table) table { min-width:0; }
  .table-wrap.wide-table { overflow-x:auto; }
  .info-definition div { flex-direction:column; gap:4px; }
  .page-anchor-links { flex-direction:column; }
  .page-anchor-links button { width:100%; }
  .metric-value { font-size:1.4rem; }
  .subbrand { max-width:none; }
}


/* Step 4 mobile polish: CSS-only to avoid auth/render regressions */
@media (max-width: 1024px) {
  .header-inner {
    padding: 8px 12px 10px;
    gap: 8px 12px;
  }
  .brand-block { max-width: none; }
  .brand-link { gap: 10px; }
  .site-logo { width: 62px; border-radius: 12px; }
  .subbrand { font-size: .74rem; max-width: none; }
  .nav { gap: 5px; }
  .nav button { padding: 5px 9px; font-size: .88rem; }
  .status-pill { min-width: 72px; }
  .table-wrap.wide-table table { min-width: 680px; }
  th, td { padding: 8px 10px; }
}

@media (max-width: 640px) {
  /* Keep form controls at 16px on phones so iOS Safari does not auto-zoom when
     a field inside a table (which uses a smaller font) receives focus. */
  input[type='text'], input[type='number'], input[type='date'], input[type='email'], input[type='password'], select, textarea { font-size: 16px; }
  .rmd-source-row { grid-template-columns:1fr; }
  .rmd-source-label { white-space:normal; }
  .header-inner { padding: 8px 10px 10px; }
  .site-logo { width: 52px; }
  .brand { font-size: .98rem; }
  .subbrand { display: none; }
  .nav button { padding: 5px 8px; font-size: .84rem; }
  main { padding: 10px; gap: 12px; }
  .card { padding: 12px; }
  .metric-value { font-size: 1.28rem; }
  th, td { padding: 7px 8px; font-size: .88rem; }
  .table-wrap.wide-table table { min-width: 620px; }
  .site-footer { padding: 0 12px; font-size: .82rem; }
}


.mobile-nav-shell, .mobile-nav-panel, .mobile-nav-toggle { display:none; }
.hero-grid > *, .grid-2 > *, .cards > *, .summary-grid > *, .subcard-grid > *, .kpi-strip > *, .wizard-progress > *, .two-col-grid > * { min-width:0; }
.phone-action-stack { display:grid; gap:10px; }
.mobile-split-sections { display:grid; gap:14px; }
.compact-summary-box { margin-top:4px; }
.compact-projection-card .info-definition div { padding-bottom:6px; }

@media (max-width: 640px) {
  body.mobile-nav-open { overflow:hidden; }
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'brand anon'
      'mobile mobile'
      'controls controls';
    align-items:center;
    gap:8px 10px;
  }
  #main-nav { display:none !important; }
  .mobile-nav-shell { grid-area: mobile; display:block; }
  .mobile-nav-toggle { display:block !important; width:100%; text-align:center; }
  .mobile-nav-panel { display:grid; gap:8px; margin-top:8px; padding:10px; border:1px solid rgba(255,255,255,.14); border-radius:14px; background:rgba(2,6,23,.95); }
  .mobile-nav-panel.hidden { display:none !important; }
  .mobile-nav-link { width:100%; text-align:left; background:#fff; color:#0f172a; border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
  .mobile-nav-link.active { background:var(--accent-soft); color:#1e40af; }
  .brand-link { gap:8px; }
  .site-logo { width:44px; }
  .subbrand { display:none; }
  .header-controls { gap:8px; }
  .mode-controls { width:100%; justify-content:flex-start; }
  .session-controls { width:100%; display:grid; grid-template-columns:1fr; gap:8px; }
  .user-email { overflow-wrap:anywhere; }
  .status-pill { width:max-content; max-width:100%; }
  .toolbar, .hero-actions, .page-anchor-links { flex-direction:column; align-items:stretch; }
  .toolbar > *, .hero-actions > *, .page-anchor-links > * { width:100%; }
  .cards, .summary-grid, .subcard-grid, .kpi-strip, .wizard-progress, .two-col-grid, .grid-2, .hero-grid, .mobile-split-sections { grid-template-columns:1fr !important; }
  .summary-box, .mobile-edit-card, .card { width:100%; min-width:0; }
  .table-wrap { overflow-x:auto; }
  .table-wrap.wide-table table { min-width:540px; }
  .table-wrap.wide-table th, .table-wrap.wide-table td { white-space:normal; }
}

/* Release 1 projection charts */
.chart-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap:16px; margin:16px 0; }
.chart-card { overflow:hidden; }
.chart-wrap { width:100%; overflow-x:auto; margin-top:10px; }
.projection-chart { display:block; width:100%; min-width:420px; height:auto; }
.chart-axis { stroke:var(--line); stroke-width:2; }
.chart-line { fill:none; stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.chart-line-1 { stroke:#2563eb; }
.chart-line-2 { stroke:#16a34a; }
.chart-line-3 { stroke:#9333ea; }
.chart-line-4 { stroke:#ea580c; }
.chart-line-5 { stroke:#0891b2; }
.chart-line-6 { stroke:#be123c; }
.chart-bar { opacity:.9; }
.chart-bar-1, .chart-key-1 { background:#2563eb; fill:#2563eb; }
.chart-bar-2, .chart-key-2 { background:#16a34a; fill:#16a34a; }
.chart-bar-3, .chart-key-3 { background:#9333ea; fill:#9333ea; }
.chart-key-4 { background:#ea580c; }
.chart-key-5 { background:#0891b2; }
.chart-key-6 { background:#be123c; }
.chart-label { fill:var(--muted); font-size:14px; }
.chart-legend { display:flex; flex-wrap:wrap; gap:12px; margin-top:8px; color:var(--muted); font-size:.92rem; }
.chart-legend span { display:inline-flex; align-items:center; gap:6px; }
.chart-key { width:12px; height:12px; border-radius:999px; display:inline-block; }

/* Release 6 scenario comparison */
.comparison-selector-card { overflow:hidden; }
.comparison-choice-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap:10px; margin-top:10px; }
.comparison-choice { display:flex; gap:10px; align-items:flex-start; border:1px solid var(--line); border-radius:14px; padding:12px; background:#fff; cursor:pointer; }
.comparison-choice.selected { border-color:var(--accent); background:#eff6ff; }
.comparison-choice input { margin-top:3px; width:auto; }
.mini-pill { font-size:.7rem; padding:2px 7px; margin-bottom:0; vertical-align:middle; }
.comparison-table-wrap table { min-width:900px; }
.comparison-table th:first-child { min-width:210px; }
.comparison-table td, .comparison-table th { vertical-align:top; }
.comparison-standouts .metric-value { font-size:1.35rem; }
.comparison-chart-grid { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.comparison-chart { min-width:520px; }

@media (max-width: 640px) {
  .chart-grid { grid-template-columns:1fr; }
  .projection-chart { min-width:360px; }
}

/* Release 2.1 layout polish: give the Income editor its own full-width row */
.income-editor-card .table-toolbar { align-items:flex-start; justify-content:space-between; }
.income-table-wrap table { min-width:1020px; }
.income-table th:nth-child(1), .income-table td:nth-child(1) { width:11%; }
.income-table th:nth-child(2), .income-table td:nth-child(2) { width:19%; }
.income-table th:nth-child(3), .income-table td:nth-child(3) { width:15%; }
.income-table th:nth-child(4), .income-table td:nth-child(4) { width:14%; }
.income-table th:nth-child(5), .income-table td:nth-child(5) { width:11%; }
.income-table th:nth-child(6), .income-table td:nth-child(6),
.income-table th:nth-child(7), .income-table td:nth-child(7) { width:10%; }
.income-table th:nth-child(8), .income-table td:nth-child(8) { width:10%; }
.base-settings-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap:12px;
  margin:14px 0 12px;
}
.settings-field {
  display:grid;
  gap:6px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fafc;
  font-weight:700;
}
.settings-field span { font-size:.9rem; color:var(--text); }
.settings-field.readonly strong { padding:8px 0; font-size:1.02rem; }
@media (max-width: 768px) {
  .base-settings-grid { grid-template-columns:1fr; }
  .income-table-wrap table { min-width:920px; }
}

/* Release 4.1: glossary tooltip layer lives at body level so it is not clipped by tables, cards, or chart containers. */
.glossary-tooltip-layer {
  position: fixed;
  z-index: 1000000;
  left: 0;
  top: 0;
  max-width: min(340px, calc(100vw - 24px));
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .28);
  font-size: .86rem;
  line-height: 1.35;
  font-weight: 400;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}
.glossary-tooltip-layer.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Release 5 advisor report */
.advisor-report { display:grid; gap:18px; }
.report-hero h1 { margin-bottom:8px; }
.report-disclaimer { margin-top:12px; }
.report-kpi-grid .metric-value { font-size:1.35rem; }
.report-section h3 { margin:18px 0 10px; }
.report-table-wrap { max-height:none; }
.report-table-wrap table { font-size:.92rem; }
.report-definition-block span { text-align:right; max-width:62%; }
.report-observation-list li { color:var(--text); }
.report-nested-grid { margin-top:8px; }
.report-cover { text-align:center; padding:48px 24px 28px; border-bottom:2px solid #ddd; margin-bottom:18px; }
.report-cover h1 { margin:0 0 10px; font-size:2rem; }
.report-cover h2 { margin:0 0 16px; font-weight:500; color:#475569; }

@media print {
  .advisor-report { display:block; }
  .report-section, .report-hero, .summary-box { page-break-inside:avoid; break-inside:avoid; }
  .report-page-break { page-break-before:always; break-before:page; }
  .report-table-wrap { overflow:visible !important; max-height:none !important; border:0; }
  .report-table-wrap table { min-width:0 !important; font-size:9.5pt; page-break-inside:auto; }
  .report-table-wrap tr { page-break-inside:avoid; break-inside:avoid; }
  .report-table-wrap th { position:static; box-shadow:none; }
  .report-definition-block span { max-width:60%; }
  .report-hero { display:none; }
  .chart-wrap { overflow:visible; }
  .projection-chart { min-width:0; max-width:100%; }
  .glossary-term::after { display:none; }
}

/* Release 6.1: post-retirement income scenario builder */
.post-retirement-income-card { border-left:4px solid var(--accent); }
.post-retirement-income-form {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:12px;
  margin-top:12px;
  align-items:end;
}
.post-retirement-income-form label { display:grid; gap:6px; font-weight:700; }
.post-retirement-income-form label span { color:var(--text); font-size:.9rem; }
.post-retirement-income-form .form-actions { display:flex; align-items:end; }
.post-retirement-income-form .form-actions button { width:100%; }
@media (max-width: 640px) {
  .post-retirement-income-form { grid-template-columns:1fr; }
}

/* Release 7 retirement risk review */
.danger-card { border-left:4px solid #dc2626; }
.danger-pill { display:inline-block; padding:4px 8px; border-radius:999px; background:#fee2e2; color:#991b1b; font-size:.82rem; }
.scorecard-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.score-card .metric-value { font-size:1.25rem; }
.risk-hero-cards .metric-value { font-size:1.35rem; }
.risk-table th:first-child { min-width:220px; }
.risk-table td, .risk-table th { vertical-align:top; }
@media print {
  #risk .card, .risk-table tr { page-break-inside:avoid; break-inside:avoid; }
}

/* Release 8 annual contribution planner */
.contribution-table-wrap table { min-width: 1120px; }
.contribution-table th:nth-child(1), .contribution-table td:nth-child(1) { width: 15%; }
.contribution-table th:nth-child(2), .contribution-table td:nth-child(2) { width: 12%; }
.contribution-table th:nth-child(3), .contribution-table td:nth-child(3) { width: 14%; }
.contribution-table th:nth-child(4), .contribution-table td:nth-child(4) { width: 14%; }
.contribution-table th:nth-child(5), .contribution-table td:nth-child(5) { width: 12%; }
.contribution-summary-cards .bad { color: var(--bad); }
.contribution-summary-cards .good { color: var(--good); }
@media print {
  #contributions { display:none !important; }
}

/* Release 9 change log and annual review reminders */
.annual-reminder-card { border-left:4px solid var(--accent); }
.reminder-settings-grid { align-items:end; margin-top:12px; }
.change-log-list { display:grid; gap:16px; }
.change-log-entry { border-left:4px solid #64748b; }
.change-log-header { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:12px; }
.compact-table th, .compact-table td { padding:8px 10px; }
.warning-text { color:#b45309; font-weight:800; }
.success-text { color:var(--good); font-weight:800; }
.error-text { color:var(--bad); font-weight:800; }
@media (max-width: 720px) {
  .change-log-header { display:grid; }
}
@media print {
  #changelog .card, .change-log-entry { page-break-inside:avoid; break-inside:avoid; }
}

/* Release 10 demo/sample-plan polish */
body.demo-mode [data-tab="account"],
body.demo-mode [data-tab="admin"],
body.demo-mode #logout-btn,
body.demo-mode #user-email {
  display: none !important;
}
body.demo-mode main::before {
  content: "Read-only sample plan: fictional data for preview only. Sign in to create or edit a private plan.";
  display: block;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 8px 20px rgba(15,23,42,.04);
  font-size: .95rem;
}
body.demo-mode main .section:not(.active) {
  display: none;
}
body.demo-mode input:disabled,
body.demo-mode select:disabled,
body.demo-mode textarea:disabled {
  background: #f8fafc;
  color: #475569;
  cursor: not-allowed;
}
body.demo-mode main .section button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Legal pages */
.legal-page header { position: static; }
.legal-header-inner { grid-template-areas: "brand nav anon"; align-items: center; }
.legal-nav { justify-content: flex-end; align-items: center; }
.legal-nav a { text-decoration: none; line-height: 1.1; }
.legal-status { align-self: center; }
.legal-main { max-width: 980px; padding: 24px 16px; }
.legal-doc { padding: clamp(18px, 3vw, 32px); }
.legal-hero { border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 12px; }
.legal-hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 8px; }
.legal-doc section { margin-top: 22px; }
.legal-doc h2 { margin-top: 0; color: #111827; }
.legal-doc p, .legal-doc li { line-height: 1.62; }
.legal-doc ul { margin-top: 0; padding-left: 22px; }
.legal-callout { margin: 18px 0 8px; }
.legal-actions { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 1180px) {
  .legal-header-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "anon"
      "nav";
  }
  .legal-status { justify-self: start; }
  .legal-nav { justify-content: flex-start; }
}
@media (max-width: 768px) {
  .legal-main { padding: 14px 12px; }
  .legal-nav { flex-direction: column; align-items: stretch; width: 100%; }
  .legal-nav a { text-align: center; }
  .legal-actions .buttonish { width: 100%; text-align: center; }
}

.wrap-code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}


.totp-setup-grid {
  align-items: stretch;
}

.totp-qr-panel {
  text-align: center;
}

.totp-qr-wrap {
  margin: 0.75rem auto 0;
  padding: 0.75rem;
  display: inline-flex;
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color, #d8dee4);
}

.totp-qr {
  display: block;
  width: min(220px, 70vw);
  height: auto;
  image-rendering: pixelated;
}

.code-textarea {
  width: 100%;
  min-height: 4.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  border: 1px solid var(--border-color);
  border-radius: 0.7rem;
  padding: 0.7rem;
  resize: vertical;
  background: var(--surface-color);
  color: var(--text-color);
}

.gain-loss-cell { white-space:nowrap; font-weight:700; }
.gain-loss-value { white-space:nowrap; }


/* Public About page */
.about-main { max-width: 1120px; }
.about-doc { overflow: hidden; }
.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 22px;
  align-items: stretch;
  padding-bottom: 22px;
}
.about-hero h1 { font-size: clamp(2.25rem, 5vw, 4.25rem); line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 14px; }
.about-lede { font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.58; color: #334155; max-width: 820px; }
.about-snapshot { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: linear-gradient(180deg, #eff6ff, #ffffff); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.about-snapshot h2 { margin-bottom: 12px; font-size: 1.05rem; }
.about-question-list { display: grid; gap: 8px; list-style: none; padding-left: 0; }
.about-question-list li { position: relative; padding-left: 24px; color: #0f172a; font-weight: 700; }
.about-question-list li::before { content: '✓'; position: absolute; left: 0; color: var(--good); }
.about-feature-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.about-feature-card { background: #fff; }
.about-feature-card h3 { font-size: 1.02rem; }
.about-split-grid { align-items: center; }
.about-audience-list { display: grid; gap: 12px; }
.about-audience-item { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #f8fafc; }
.about-audience-item strong { color: #0f172a; }
.about-audience-item span { color: var(--muted); line-height: 1.5; }
.about-cta { margin-top: 28px; background: #f8fafc; border: 1px solid var(--line); box-shadow: none; }
.about-cta h2 { margin-bottom: 8px; }
@media (max-width: 920px) {
  .about-hero { grid-template-columns: 1fr; }
  .about-snapshot { order: 2; }
}
@media (max-width: 768px) {
  .about-hero h1 { font-size: 2.2rem; }
  .about-lede { font-size: 1rem; }
}

/* Build 1.4.4 responsive table polish */
.table-wrap { -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.table-wrap table { table-layout: auto; }
.table-wrap th, .table-wrap td { overflow-wrap: anywhere; }
.table-wrap input, .table-wrap select, .table-wrap textarea { min-width: 0; }
.table-wrap input[type='number'], .table-wrap input[inputmode='decimal'] { text-align: right; }
.actions-col { width: 1%; white-space: nowrap; }
.gain-loss-cell, .summary-row td, td:has(> input[type='number']), td:has(> input[inputmode='decimal']) { white-space: nowrap; }


/* Build 1.15.6: keep year columns readable across wide financial tables. */
.table-wrap th.year-col,
.table-wrap td.year-col {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  min-width: 68px;
}
.table-wrap th.year-col {
  width: 1%;
}
.mobile-form-list { align-items: start; }
.mobile-edit-card { overflow: hidden; }
.mobile-edit-card-header strong { min-width: 0; overflow-wrap: anywhere; }
.mobile-edit-row input, .mobile-edit-row select, .mobile-edit-row textarea { min-height: 42px; }
.small-metric { font-size: 1.05rem; }
@media (min-width: 700px) and (max-width: 1024px) {
  .mobile-form-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-split-sections { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .mobile-split-sections > .card, .mobile-form-list > .mobile-edit-card { min-width: 0; }
  .mobile-edit-card-header { align-items: flex-start; }
}
@media (max-width: 1024px) {
  .table-toolbar { align-items: flex-start; }
  .phone-action-stack { display: flex; flex-wrap: wrap; gap: 10px; }
  .phone-action-stack > * { flex: 1 1 190px; }
  .income-table-wrap table, .contribution-table-wrap table, .comparison-table-wrap table, .risk-table, .report-table-wrap table { min-width: 680px; }
}
@media (max-width: 640px) {
  .mobile-form-list { grid-template-columns: 1fr; }
  .mobile-edit-card-header { display: grid; grid-template-columns: 1fr; }
  .mobile-edit-card-header .icon-btn-row, .mobile-edit-card-header button { width: 100%; }
  .icon-btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .icon-btn-row .icon-btn, .icon-btn-row .small-btn { width: 100%; }
  .table-wrap.wide-table table { min-width: 560px; }
}

/* Build 1.4.7 readable long-range tax estimate */
.tax-estimate-intro { margin-bottom: 10px; }
.year-tax-list {
  display: grid;
  gap: 10px;
  max-height: 62vh;
  overflow: auto;
  padding: 2px 4px 2px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.year-tax-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.year-tax-card > summary {
  display: grid;
  grid-template-columns: minmax(70px, .55fr) repeat(4, minmax(145px, 1fr));
  gap: 10px 14px;
  align-items: center;
  padding: 12px 14px;
  background: #f8fafc;
  cursor: pointer;
  list-style: none;
}
.year-tax-card > summary::-webkit-details-marker { display: none; }
.year-tax-card > summary::after {
  content: 'Open details';
  justify-self: end;
  grid-column: 1 / -1;
  color: var(--accent);
  font-size: .84rem;
  font-weight: 700;
}
.year-tax-card[open] > summary::after { content: 'Hide details'; }
.year-tax-year {
  font-weight: 800;
  font-size: 1.05rem;
}
.year-tax-label {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.2;
  margin-bottom: 3px;
}
.year-tax-card strong {
  display: block;
  white-space: nowrap;
  line-height: 1.2;
}
.year-tax-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px 14px 14px;
}
.year-tax-detail {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
}
.year-tax-detail span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: 4px;
}
@media (max-width: 1180px) {
  .year-tax-card > summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year-tax-year { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .year-tax-list { max-height: none; overflow: visible; padding-right: 0; }
  .year-tax-card > summary { grid-template-columns: 1fr; }
  .year-tax-detail-grid { grid-template-columns: 1fr; }
}

.mini-choice { margin-top: 6px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.mini-choice input[type="checkbox"] { min-height: auto; }

/* Build 1.12.2: tune the holdings editor columns while keeping the table inside the normal site width. */
.holdings-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.holdings-table-wrap .holdings-table {
  width: 1630px;
  min-width: 1630px;
  table-layout: fixed;
}
.holdings-table th,
.holdings-table td {
  overflow-wrap: normal;
  word-break: normal;
  padding: 8px 10px;
}
.holdings-table th {
  white-space: nowrap;
}
.holdings-table input,
.holdings-table select {
  padding: 7px 8px;
}
.holdings-table th:nth-child(1), .holdings-table td:nth-child(1) { width: 90px; }
.holdings-table th:nth-child(2), .holdings-table td:nth-child(2) { width: 120px; }
.holdings-table th:nth-child(3), .holdings-table td:nth-child(3) { width: 150px; }
.holdings-table th:nth-child(4), .holdings-table td:nth-child(4) { width: 88px; }
.holdings-table th:nth-child(5), .holdings-table td:nth-child(5) { width: 82px; }
.holdings-table th:nth-child(6), .holdings-table td:nth-child(6) { width: 110px; }
.holdings-table th:nth-child(7), .holdings-table td:nth-child(7) { width: 82px; }
.holdings-table th:nth-child(8), .holdings-table td:nth-child(8) { width: 130px; }
.holdings-table th:nth-child(9), .holdings-table td:nth-child(9) { width: 180px; }
.holdings-table th:nth-child(10), .holdings-table td:nth-child(10) { width: 170px; }
.holdings-table th:nth-child(11), .holdings-table td:nth-child(11) { width: 165px; }
.holdings-table th:nth-child(12), .holdings-table td:nth-child(12) { width: 145px; }
.holdings-table th:nth-child(13), .holdings-table td:nth-child(13) { width: 88px; }
.holdings-table .helper-text.tight-note {
  max-width: 160px;
  line-height: 1.25;
}

/* Build 1.12.3: keep the holdings table contained and rebalance dense data-entry columns. */
main,
.section,
.section.active,
.card {
  min-width: 0;
}
.holdings-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
}
.holdings-table-wrap .holdings-table {
  width: 100%;
  min-width: 1496px;
  table-layout: fixed;
}
.holdings-table th,
.holdings-table td {
  padding: 8px 9px;
  overflow-wrap: normal;
  word-break: normal;
}
.holdings-table th {
  white-space: nowrap;
}
.holdings-table input,
.holdings-table select {
  padding: 7px 8px;
  min-width: 0;
}
.holdings-table th:nth-child(1), .holdings-table td:nth-child(1) { width: 84px; }
.holdings-table th:nth-child(2), .holdings-table td:nth-child(2) { width: 142px; }
.holdings-table th:nth-child(3), .holdings-table td:nth-child(3) { width: 135px; }
.holdings-table th:nth-child(4), .holdings-table td:nth-child(4) { width: 90px; }
.holdings-table th:nth-child(5), .holdings-table td:nth-child(5) { width: 80px; }
.holdings-table th:nth-child(6), .holdings-table td:nth-child(6) { width: 105px; }
.holdings-table th:nth-child(7), .holdings-table td:nth-child(7) { width: 75px; }
.holdings-table th:nth-child(8), .holdings-table td:nth-child(8) { width: 112px; }
.holdings-table th:nth-child(9), .holdings-table td:nth-child(9) { width: 150px; }
.holdings-table th:nth-child(10), .holdings-table td:nth-child(10) { width: 130px; }
.holdings-table th:nth-child(11), .holdings-table td:nth-child(11) { width: 165px; }
.holdings-table th:nth-child(12), .holdings-table td:nth-child(12) { width: 142px; }
.holdings-table th:nth-child(13), .holdings-table td:nth-child(13) { width: 86px; }
.holdings-table .helper-text.tight-note {
  max-width: 132px;
  line-height: 1.25;
  white-space: normal;
}

/* Build 1.12.4: remove the visible Gain/loss column and tighten the remaining holdings editor columns. */
.holdings-table-wrap .holdings-table {
  min-width: 1331px;
}
.holdings-table th:nth-child(1), .holdings-table td:nth-child(1) { width: 84px; }
.holdings-table th:nth-child(2), .holdings-table td:nth-child(2) { width: 142px; }
.holdings-table th:nth-child(3), .holdings-table td:nth-child(3) { width: 135px; }
.holdings-table th:nth-child(4), .holdings-table td:nth-child(4) { width: 90px; }
.holdings-table th:nth-child(5), .holdings-table td:nth-child(5) { width: 80px; }
.holdings-table th:nth-child(6), .holdings-table td:nth-child(6) { width: 105px; }
.holdings-table th:nth-child(7), .holdings-table td:nth-child(7) { width: 75px; }
.holdings-table th:nth-child(8), .holdings-table td:nth-child(8) { width: 112px; }
.holdings-table th:nth-child(9), .holdings-table td:nth-child(9) { width: 150px; }
.holdings-table th:nth-child(10), .holdings-table td:nth-child(10) { width: 130px; }
.holdings-table th:nth-child(11), .holdings-table td:nth-child(11) { width: 142px; }
.holdings-table th:nth-child(12), .holdings-table td:nth-child(12) { width: 86px; }

/* Build 1.12.5: combine holding account type into the Account column and remove owner/type duplication from the visible table. */
.holdings-table-wrap .holdings-table {
  min-width: 1218px;
}
.holdings-table th:nth-child(1), .holdings-table td:nth-child(1) { width: 78px; }
.holdings-table th:nth-child(2), .holdings-table td:nth-child(2) { width: 182px; }
.holdings-table th:nth-child(3), .holdings-table td:nth-child(3) { width: 82px; }
.holdings-table th:nth-child(4), .holdings-table td:nth-child(4) { width: 74px; }
.holdings-table th:nth-child(5), .holdings-table td:nth-child(5) { width: 102px; }
.holdings-table th:nth-child(6), .holdings-table td:nth-child(6) { width: 72px; }
.holdings-table th:nth-child(7), .holdings-table td:nth-child(7) { width: 106px; }
.holdings-table th:nth-child(8), .holdings-table td:nth-child(8) { width: 142px; }
.holdings-table th:nth-child(9), .holdings-table td:nth-child(9) { width: 126px; }
.holdings-table th:nth-child(10), .holdings-table td:nth-child(10) { width: 132px; }
.holdings-table th:nth-child(11), .holdings-table td:nth-child(11) { width: 76px; }
.holding-account-cell {
  display: grid;
  gap: 5px;
}
.holding-account-cell input,
.holding-account-cell select {
  width: 100%;
}
.holdings-table .account-type-inline {
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 0.82rem;
  color: var(--muted);
  background-color: #f8fafc;
}
.holdings-table td:nth-child(10) {
  white-space: nowrap;
}


/* Build 1.12.9: give the guided setup Savings step enough width for investments. */
.setup-savings-stack {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
.setup-investments-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.setup-investments-table {
  min-width: 1000px;
  table-layout: fixed;
}
.setup-investments-table th,
.setup-investments-table td {
  overflow-wrap: normal;
  word-break: normal;
  padding: 8px 10px;
}
.setup-investments-table th {
  white-space: nowrap;
}
.setup-investments-table input,
.setup-investments-table select {
  min-width: 0;
  padding: 7px 8px;
}
.setup-investments-table th:nth-child(1), .setup-investments-table td:nth-child(1) { width: 170px; }
.setup-investments-table th:nth-child(2), .setup-investments-table td:nth-child(2) { width: 150px; }
.setup-investments-table th:nth-child(3), .setup-investments-table td:nth-child(3) { width: 90px; }
.setup-investments-table th:nth-child(4), .setup-investments-table td:nth-child(4) { width: 88px; }
.setup-investments-table th:nth-child(5), .setup-investments-table td:nth-child(5) { width: 88px; }
.setup-investments-table th:nth-child(6), .setup-investments-table td:nth-child(6) { width: 120px; }
.setup-investments-table th:nth-child(7), .setup-investments-table td:nth-child(7) { width: 170px; }
.setup-investments-table th:nth-child(8), .setup-investments-table td:nth-child(8) { width: 126px; }
.setup-investments-table th:nth-child(9), .setup-investments-table td:nth-child(9) { width: 56px; }
.setup-investments-table .setup-actions-col { text-align: center; }
.setup-investments-table .setup-actions-col .icon-btn { min-width: 34px; }

/* Build 1.12.11: keep the Long-Range Plan Year column on one line without widening the page. */
.projection-withdrawals-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.projection-withdrawals-table-wrap .projection-withdrawals-table {
  min-width: 1120px;
  table-layout: fixed;
}
.projection-withdrawals-table th,
.projection-withdrawals-table td {
  overflow-wrap: normal;
  word-break: normal;
  padding-left: 9px;
  padding-right: 9px;
}
.projection-withdrawals-table td {
  white-space: nowrap;
}
.projection-withdrawals-table th:nth-child(1),
.projection-withdrawals-table td:nth-child(1) {
  width: 72px;
  white-space: nowrap;
}
.projection-withdrawals-table th:nth-child(2),
.projection-withdrawals-table td:nth-child(2) { width: 108px; }
.projection-withdrawals-table th:nth-child(3),
.projection-withdrawals-table td:nth-child(3) { width: 126px; }
.projection-withdrawals-table th:nth-child(4),
.projection-withdrawals-table td:nth-child(4) { width: 112px; }
.projection-withdrawals-table th:nth-child(5),
.projection-withdrawals-table td:nth-child(5) { width: 82px; }
.projection-withdrawals-table th:nth-child(6),
.projection-withdrawals-table td:nth-child(6) { width: 96px; }
.projection-withdrawals-table th:nth-child(7),
.projection-withdrawals-table td:nth-child(7) { width: 122px; }
.projection-withdrawals-table th:nth-child(8),
.projection-withdrawals-table td:nth-child(8) { width: 128px; }
.projection-withdrawals-table th:nth-child(9),
.projection-withdrawals-table td:nth-child(9) { width: 112px; }
.projection-withdrawals-table th:nth-child(10),
.projection-withdrawals-table td:nth-child(10) { width: 120px; }
.projection-withdrawals-table th:nth-child(11),
.projection-withdrawals-table td:nth-child(11) { width: 158px; }

/* Build 1.13.0: make IRMAA warnings actionable by showing affected years and threshold gaps. */
.irmaa-review-card { display: grid; gap: 10px; }
.irmaa-review-table-wrap { max-height: 360px; }
.irmaa-review-table { min-width: 1060px; table-layout: fixed; }
.irmaa-review-table th,
.irmaa-review-table td { white-space: normal; overflow-wrap: normal; word-break: normal; vertical-align: top; }
.irmaa-review-table th:nth-child(1), .irmaa-review-table td:nth-child(1) { width: 110px; }
.irmaa-review-table th:nth-child(2), .irmaa-review-table td:nth-child(2) { width: 105px; }
.irmaa-review-table th:nth-child(3), .irmaa-review-table td:nth-child(3) { width: 135px; }
.irmaa-review-table th:nth-child(4), .irmaa-review-table td:nth-child(4) { width: 165px; }
.irmaa-review-table th:nth-child(5), .irmaa-review-table td:nth-child(5) { width: 120px; }
.irmaa-review-table th:nth-child(6), .irmaa-review-table td:nth-child(6) { width: 80px; }
.irmaa-review-table th:nth-child(7), .irmaa-review-table td:nth-child(7) { width: 145px; }
.irmaa-review-table th:nth-child(8), .irmaa-review-table td:nth-child(8) { width: 300px; }
.irmaa-action-note { margin-top: 4px; }
@media (max-width: 760px) {
  .irmaa-review-table { min-width: 920px; }
}

/* Build 1.13.3: match guided setup investments to the main holdings table and reduce advanced-field clutter. */
.setup-investments-table {
  min-width: 900px;
}
.setup-investments-table .setup-account-col { width: 220px; }
.setup-investments-table .setup-symbol-col { width: 90px; }
.setup-investments-table .setup-units-col { width: 88px; }
.setup-investments-table .setup-price-col { width: 88px; }
.setup-investments-table .setup-manual-value-col { width: 118px; }
.setup-investments-table .setup-rmd-value-col { width: 150px; }
.setup-investments-table .setup-current-value-col { width: 126px; white-space: nowrap; }
.setup-investments-table .setup-actions-col { width: 56px; }
.setup-investments-table .holding-account-cell {
  display: grid;
  gap: 5px;
}
.setup-investments-table .account-type-inline {
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 0.82rem;
  color: var(--muted);
  background-color: #f8fafc;
}
.setup-rmd-not-used {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
}
.setup-rmd-helper {
  margin-top: 8px;
}

/* Build 1.14.0: beginner-first planning path and simple account-balance entry. */
.entry-mode-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
  margin: 10px 0 12px;
}
.entry-mode-toggle {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.segmented-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 7px 10px;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}
.segmented-choice input {
  width: auto;
  margin: 0;
}
.segmented-choice.active {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.simple-holdings-table-wrap,
.setup-simple-holdings-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.simple-holdings-table,
.setup-simple-holdings-table {
  min-width: 780px;
  table-layout: fixed;
}
.simple-holdings-table th,
.simple-holdings-table td,
.setup-simple-holdings-table th,
.setup-simple-holdings-table td {
  overflow-wrap: normal;
  word-break: normal;
  vertical-align: top;
}
.simple-holdings-table th:nth-child(1), .simple-holdings-table td:nth-child(1),
.setup-simple-holdings-table th:nth-child(1), .setup-simple-holdings-table td:nth-child(1) { width: 120px; }
.simple-holdings-table th:nth-child(2), .simple-holdings-table td:nth-child(2),
.setup-simple-holdings-table th:nth-child(2), .setup-simple-holdings-table td:nth-child(2) { width: 230px; }
.simple-holdings-table th:nth-child(3), .simple-holdings-table td:nth-child(3),
.setup-simple-holdings-table th:nth-child(3), .setup-simple-holdings-table td:nth-child(3) { width: 165px; }
.simple-holdings-table th:nth-child(4), .simple-holdings-table td:nth-child(4),
.setup-simple-holdings-table th:nth-child(4), .setup-simple-holdings-table td:nth-child(4) { width: 145px; }
.simple-holdings-table th:nth-child(5), .simple-holdings-table td:nth-child(5),
.setup-simple-holdings-table th:nth-child(5), .setup-simple-holdings-table td:nth-child(5) { width: 150px; white-space: nowrap; }
.simple-holdings-table th:nth-child(6), .simple-holdings-table td:nth-child(6),
.setup-simple-holdings-table th:nth-child(6), .setup-simple-holdings-table td:nth-child(6) { width: 76px; }
.beginner-confidence-card,
.beginner-next-card {
  display: grid;
  gap: 12px;
}
.confidence-buckets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.compact-list {
  margin: 8px 0 0;
  padding-left: 18px;
}
.compact-list li { margin: 5px 0; }
.compact-list li.complete { color: #166534; }
.compact-list li.incomplete { color: #92400e; }
.compact-list li.optional { color: var(--muted); }
.next-step-list {
  display: grid;
  gap: 12px;
}
.next-step-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}
.step-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.next-step-item p { margin: 4px 0 8px; }
@media (max-width: 900px) {
  .entry-mode-card { align-items: stretch; }
  .entry-mode-toggle { width: 100%; }
  .confidence-buckets { grid-template-columns: 1fr; }
}

.admin-users-table-wrap table {
  min-width: 880px;
}
.admin-users-table th,
.admin-users-table td {
  white-space: nowrap;
}
.admin-users-table th:first-child,
.admin-users-table td:first-child {
  white-space: normal;
  min-width: 190px;
}
.admin-users-table th:last-child,
.admin-users-table td:last-child {
  min-width: 260px;
}


/* Build 1.15.8: group RMD schedule rows by owner/account so each person's path is easier to scan. */
.rmd-schedule-table .rmd-owner-section td {
  background: #f1f5f9;
  border-top: 2px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  overflow-wrap: normal;
  padding: 9px 12px;
  white-space: nowrap;
}
.rmd-schedule-table .rmd-owner-name {
  display: inline-block;
}
.rmd-schedule-table .rmd-owner-account {
  color: var(--muted);
  display: inline-block;
  font-weight: 600;
  margin-left: 10px;
}
.rmd-schedule-table .rmd-group-entry td:nth-child(2),
.rmd-schedule-table .rmd-group-entry td:nth-child(3) {
  color: var(--muted);
}
@media (max-width: 560px) {
  .rmd-schedule-table .rmd-owner-section td {
    white-space: normal;
  }
  .rmd-schedule-table .rmd-owner-account {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }
}
