/* LoonieFi/Retirement Optimizer — visual refinement, November 2026.
   Presentation only. No calculation, storage, API, or form logic is changed.
   Loaded last to harmonize the previously accumulated stylesheets. */
:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #182230;
  --muted: #58677a;
  --line: #e1e6ed;
  --brand: #ae2842;
  --brand-2: #8e1e35;
  --accent: #187569;
  --gold: #976b24;
  --blue: #356a9c;
  --purple: #6957a6;
  --shadow: 0 1px 3px rgba(16, 24, 40, .045);
  --radius: 14px;
  --radius-sm: 9px;
  --focus: 0 0 0 3px rgba(174, 40, 66, .16);
  --ui-ease: cubic-bezier(.2,.8,.2,1);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101820;
  --surface: #17212b;
  --surface-2: #1d2a36;
  --text: #f3f6fa;
  --muted: #b4c1cf;
  --line: #344353;
  --brand: #ed7890;
  --brand-2: #f19aaa;
  --accent: #56c7b2;
  --gold: #e3b46a;
  --blue: #89b6e1;
  --purple: #b4a0ee;
  --shadow: 0 1px 4px rgba(0,0,0,.15);
  --focus: 0 0 0 3px rgba(237, 120, 144, .22);
}
html { scroll-padding-top: 140px; }
body {
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -.006em;
  text-rendering: optimizeLegibility;
}
.container { width: min(calc(100% - 64px), 1320px); }
:where(input,textarea,select,button) { font-family: inherit; }
:where(h1,h2,h3,h4,h5) { color: var(--text); font-weight: 680; letter-spacing: -.027em; }
:where(p,small) { overflow-wrap: break-word; }
:where(.metric,.quick-asset-summary,.benefit-estimate-grid,.report-table,.asset-table,.tax-optimizer-result) { font-variant-numeric: tabular-nums; }
:where(a,button,summary,input,select,textarea):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* Global header: quiet branding, crisp tools and clearly recognizable menus. */
.site-header {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: none;
}
.header-inner { height: 66px; gap: 14px; }
.brand { gap: 10px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; box-shadow: none; }
.brand-mark img { filter: none; }
.brand strong { font-size: 14px; font-weight: 730; letter-spacing: -.02em; }
.brand small { font-size: 11px; margin-top: 1px; }
.header-actions { gap: 7px; }
.btn {
  border-radius: 9px;
  font-size: 13px;
  font-weight: 680;
  padding: 10px 15px;
  line-height: 1.4;
  transition: background-color .15s var(--ui-ease), border-color .15s var(--ui-ease), box-shadow .15s var(--ui-ease);
}
.btn:hover { transform: none; }
.btn.primary {
  background: #ae2842;
  border-color: #ae2842;
  color: #fff;
  box-shadow: none;
}
.btn.primary:hover { background: #8e1e35; border-color: #8e1e35; }
.btn.primary:active { background: #76162b; }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 22%,var(--line)); }
.btn.compact { padding: 8px 11px; font-size: 12px; }
.icon-btn { border-radius: 9px; background: var(--surface); }
.icon-btn:hover { background: var(--surface-2); border-color: var(--brand); }
:where(.planner-tools-menu, .planner-help-menu) > summary,
.header-actions .planner-tools-menu > summary {
  border-radius: 9px;
  font-size: 12px;
  font-weight: 670;
  min-height: 37px;
  box-shadow: none;
}
.planner-tools-list { border-radius: 10px; box-shadow: 0 12px 28px rgba(10,20,30,.11); padding: 7px; gap: 2px; }
.header-actions .planner-menu-link { font-weight: 580; border-radius: 7px; }
#openReportChat { box-shadow: none; font-weight: 680; }

/* Intro: keep useful trust messaging, reduce marketing-style visual weight. */
.hero {
  background: var(--surface);
  padding: 38px 0 28px;
  border-bottom: 1px solid var(--line);
}
.hero-grid { grid-template-columns: minmax(0,1.45fr) minmax(280px,.65fr); gap: 50px; }
.eyebrow, .section-kicker { font-size: 10.5px; font-weight: 750; letter-spacing: .095em; }
.hero h1 { font-size: clamp(31px,3.6vw,48px); line-height: 1.09; letter-spacing: -.043em; max-width: 780px; margin-bottom: 14px; }
.hero-copy { font-size: 15px; line-height: 1.65; max-width: 770px; }
.trust-row { font-size: 11px; font-weight: 600; gap: 9px 16px; margin-top: 19px; }
.privacy-card { padding: 19px 20px; border-radius: 12px; box-shadow: none; }
.privacy-card p { font-size: 12px; line-height: 1.65; }
.privacy-icon { width: 36px; height: 36px; border-radius: 9px; margin-bottom: 11px; }
.hero-help-link { margin-bottom: 0; }
.hero-help-link a { color: var(--brand); font-weight: 630; }

/* Planner structure: less framing, more whitespace, consistent rhythm. */
.planner-shell { margin-top: 25px; margin-bottom: 56px; }
body.account-signed-in .planner-shell { margin-top: 18px; }
.planner-mode-bar { border: 1px solid var(--line); border-radius: 13px; box-shadow: none; background: var(--surface); }
.planner-mode-intro strong { letter-spacing: -.024em; font-size: 16px; }
.mode-choice { border-radius: 8px; font-weight: 660; }
.mode-choice small { font-weight: 500; }
.planner-guide { border-radius: 10px; box-shadow: none; padding: 12px 17px; }
.planner-guide-copy strong { font-weight: 650; }
.planner-guide .save-state { border-radius: 8px; }
.planner-guide-account { border-radius: 8px; font-weight: 620; }
.step-nav { top: 77px; padding: 5px; gap: 4px; border-radius: 12px; box-shadow: none; }
.step { border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 650; padding: 10px 11px; transition: background-color .15s ease; }
.step span { background: transparent; color: var(--muted); border: 1px solid var(--line); width: 23px; height: 23px; font-size: 11px; }
.step.active { border-color: color-mix(in srgb,var(--brand) 18%,var(--line)); background: color-mix(in srgb,var(--brand) 6%,var(--surface)); color: var(--brand); }
.step.active span { background: var(--brand); border-color: var(--brand); }
.step:not(.active):hover { background: var(--surface-2); color: var(--text); }
.panel-stack { margin-top: 13px; }
.planner-panel { border-radius: 14px; padding: 26px 28px; box-shadow: none; }
.panel-heading { align-items: center; padding-bottom: 19px; margin-bottom: 22px; }
.panel-heading h2 { font-size: 25px; line-height: 1.24; }
.panel-heading .section-kicker { margin-bottom: 4px; }
.save-state { font-size: 11px; padding: 5px 8px; border-radius: 7px; font-weight: 640; }
.form-grid { gap: 15px; }
label { font-size: 12px; font-weight: 620; }
label>input,label>select,label>.money,label>.suffix { margin-top: 6px; }
input, select, textarea { background: var(--surface); border: 1px solid #ced6e0; border-radius: 8px; color: var(--text); }
[data-theme="dark"] input,[data-theme="dark"] select,[data-theme="dark"] textarea { border-color: var(--line); background: var(--surface-2); }
input:focus,select:focus,textarea:focus { border-color: var(--brand); }
.money,.suffix { background: var(--surface); border-color: #ced6e0; border-radius: 8px; }
[data-theme="dark"] .money,[data-theme="dark"] .suffix { border-color: var(--line); background: var(--surface-2); }
.money input,.suffix input { background: transparent; }
.money span,.suffix span { font-weight: 570; }
.people-grid, .stage-grid { gap: 14px; }
.person-card,.stage-card,.benefit-subcard { background: var(--surface); border-color: var(--line); border-radius: 11px; padding: 18px; }
.card-title h3,.stage-card h3 { font-size: 16px; font-weight: 690; }
.pill { padding: 4px 8px; border-radius: 6px; font-weight: 620; font-size: 11px; }
.stage-card:before { height: 2px; }
.subsection-heading { margin: 26px 0 13px; }
.subsection-heading h3 { font-size: 18px; }
.expense-row { background: var(--surface); padding: 12px; border-radius: 9px; }
.panel-actions { padding-top: 18px; margin-top: 22px; }
.callout { border-radius: 9px; padding: 13px 15px; }
.callout.info { background: var(--surface-2); border-color: var(--line); }
.callout.warning { background: color-mix(in srgb,var(--gold) 5%,var(--surface)); border-color: color-mix(in srgb,var(--gold) 24%,var(--line)); }

/* Financial report: clear hierarchy, readable figures, dependable tabular rhythm. */
:where(.chart-card,.confidence-section,.readiness-section,.action-center,.housing-planner,.tax-optimizer-assumptions,.tax-optimizer-result,.year-report-disclosure,.quick-results-path) {
  box-shadow: none;
  border-color: var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.action-center { background: var(--surface); }
.action-center-heading h3, .confidence-heading h3, .readiness-heading h3 { font-size: 20px; letter-spacing: -.02em; }
.action-overview-grid article,.confidence-metrics article,.stress-card { background: var(--surface-2); border-color: var(--line); border-radius: 9px; }
.readiness-section { overflow: hidden; }
.metric-grid { gap: 10px; }
.metric { border-radius: 10px; }
.metric strong { letter-spacing: -.025em; }
.asset-table-wrap,.report-table-wrap,.benefit-table-wrap,.article-table-wrap { border-radius: 9px; }
.asset-table th,.report-table th,.benefit-table th { background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 680; letter-spacing: .012em; }
.asset-table td,.report-table td,.benefit-table td { font-size: 12px; border-color: var(--line); }
.asset-table tbody tr:hover,.report-table tbody tr:hover { background: color-mix(in srgb,var(--blue) 4%,var(--surface)); }
.report-table tbody td:first-child { background: var(--surface); font-weight: 680; }
.report-table thead th:first-child { background: var(--surface-2); }
.report-table .report-notes-cell { font-size: 12px; line-height: 1.52; }
.year-report-disclosure { margin: 20px 0 13px; }
.year-report-summary { padding: 15px 17px; min-height: 75px; }
.year-report-summary h3 { font-size: 17px; }
.year-report-hint { font-size: 11px; font-weight: 670; }
.ui-chevron { border-width: 1px; border-radius: 9px; width: 34px; height: 34px; flex-basis: 34px; }
.ui-chevron:after { width: 9px; height: 9px; border-width: 2px; }
#progressMonitor.rpm-monitor-collapsible { border-radius: 11px; box-shadow: none; }
.rpm-monitor-collapsible>.rpm-collapse-summary { border-radius: 11px; min-height: 62px; }
.rpm-collapse-heading strong { font-size: 13px; letter-spacing: -.005em; }

/* Subtle, consistent disclosure states, retaining all accessible controls. */
.planner-shell details>summary { transition: background-color .15s ease; }
.planner-shell details>summary:hover { background: var(--surface-2); }
:where(.ui-status-tooltip,.report-table-tooltip,.tip:hover:after,.tip:focus:after) { background: #152334; color: #fff; border-radius: 8px; }
.ui-explained-status { text-decoration-thickness: 1px; }

/* Chat: professional conversation appearance, not decorative bubbles. */
.report-chat-window { border-radius: 13px; box-shadow: 0 20px 55px rgba(10,20,30,.2); }
.report-chat-heading h2 { font-size: 16px; font-weight: 680; }
.report-chat-bubble { border-radius: 10px; padding: 12px 14px; }
.report-chat-bubble[data-role="assistant"] { background: var(--surface-2); }
.report-chat-bubble[data-role="user"] { background: color-mix(in srgb,var(--brand) 6%,var(--surface)); border-color: var(--line); }
.report-chat-suggestions button { border-radius: 7px; font-size: 11px; }
.report-chat-content h3, .report-chat-content h4 { font-weight: 680; }
.report-chat-form textarea { background: var(--surface); }

/* Editorial materials and help: aligned with the same restrained system. */
.content-page-hero { background: var(--surface); padding: 38px 0 29px; }
.content-page-hero h1 { font-size: clamp(31px,3.5vw,45px); }
.content-page-lead { font-size: 15px; }
.article-content h2 { font-size: 25px; }
.article-content h3 { font-size: 18px; }
.article-callout,.content-page-card,.learning-card { box-shadow: none; border-radius: 11px; }
.learning-card:hover { transform: none; border-color: color-mix(in srgb,var(--brand) 30%,var(--line)); }
.article-cta { background: var(--surface-2); border-color: var(--line); border-radius: 11px; }

/* Narrow displays: preserve form usability, avoid horizontal page scroll. */
@media(max-width: 1050px) {
  .container { width: min(calc(100% - 36px), 1320px); }
  .hero-grid { gap: 22px; }
  .step-nav { top: 76px; }
}
@media(max-width: 900px) {
  .step-nav { position: relative; top: auto; }
  .header-inner { height: auto; min-height: 65px; }
}
@media(max-width: 700px) {
  .container { width: calc(100% - 24px); }
  .hero { padding: 23px 0 19px; }
  .hero h1 { font-size: 31px; line-height: 1.11; }
  .hero-copy { font-size: 13.5px; }
  .planner-shell { margin-top: 15px; }
  .planner-panel { border-radius: 11px; padding: 18px 13px; }
  .panel-heading { margin-bottom: 17px; padding-bottom: 14px; }
  .panel-heading h2 { font-size: 22px; }
  .planner-guide { padding: 10px 12px; }
  .step-nav { padding: 4px; gap: 2px; border-radius: 10px; }
  .step { font-size: 11px; padding: 9px 3px; flex-direction: column; gap: 4px; min-width: 0; line-height: 1.3; }
  .step span { width: 21px; height: 21px; font-size: 10px; }
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid.cols-2 { grid-template-columns: 1fr; }
  .person-card,.stage-card,.benefit-subcard { padding: 14px; }
  .panel-actions .btn { padding: 10px 12px; }
  .year-report-summary { padding: 12px; }
  .report-chat-window { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
}
@media(min-width:701px) and (max-width:900px) {
  .form-grid.cols-3 { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --text: #111; --muted: #444; --line: #ddd; }
  .planner-panel,.chart-card,.year-report-disclosure,.action-center { box-shadow: none !important; }
}

/* Step 5: primary action must remain visible before the first calculation. */
#emptyResults #calculateFromResultsBtn { margin-top: 22px; min-width: 235px; }
@media (max-width: 480px) { #emptyResults #calculateFromResultsBtn { width: 100%; min-width: 0; max-width: 340px; } }

/* Compact at-a-glance readiness component breakdown. */
.readiness-brief-breakdown{margin:12px 0 10px;color:var(--muted,#64748b);font-size:.86rem;line-height:1.5;}
