/* ============================================ */
/* CHART LAYOUT + HEADER BAR + GOLD STANDARD    */
/* ============================================ */
#resultsBody td:nth-child(2){
  border-top: 2.5px solid #000 !important;
  border-bottom: 2.5px solid #000 !important;
}


/* === Jagged black border around Summary Chart === */
#resultsCard{
  position: relative;
  border: 4px solid #000 !important;
  border-radius: 18px !important;
}
#resultsCard::before{
  content: "";
  position: absolute;
  inset: -6px;
  border: 3px dashed #000;
  border-radius: 22px;
  pointer-events: none;
}


/* === Emphasize RIGHT NOW in gold box === */
.share-box .right-now-highlight{
  color: #ffeb3b !important;
  font-weight: 900;
}


/* === Yellow fill around Summary Chart frame === */
#resultsCard{
  background: #ffeb3b !important; /* yellow behind table wrapper */
}
#resultsCard .table-wrapper{
  background: #ffffff !important; /* keep table area white for readability */
}


/* === Fine-Tune tab hover: darker shade + font color rules === */
.annuity-tab{
  transition: filter 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}
/* Default: darken + white text */
.annuity-tab:hover{
  filter: brightness(0.85);
  color: #ffffff !important;
}
/* Exception: Annuity 1 hover text should be black */
.annuity-tab.tab-ann1:hover{
  color: #000000 !important;
}


/* === Center align age picker title + radio rows === */
.age-picker-header{
  text-align: center !important;
}
.age-list{
  display: flex;
  flex-direction: column;
  align-items: center; /* center the whole list */
}
.age-list label{
  width: 100%;
  max-width: 180px;         /* keeps it tidy */
  justify-content: center !important;
  gap: 10px !important;
}


/* === 1) Cumulative Net conditional formatting (match salary logic) === */
#resultsBody td:nth-child(7).surplus{
  background: #15803d !important;
  color: #ffffff !important;
  font-weight: 900 !important;
}
#resultsBody td:nth-child(7).shortfall,
#resultsBody td:nth-child(7).zero-benefit{
  background: #b91c1c !important;
  color: #ffffff !important;
  font-weight: 900 !important;
}

/* === 2) Fine-tune sliders: green track instead of grey === */
.sidecar input[type="range"]{
  background: #15803d !important;
}
.sidecar input[type="range"]::-webkit-slider-runnable-track{
  background: #15803d !important;
  height: 8px !important;
  border-radius: 8px !important;
}
.sidecar input[type="range"]::-moz-range-track{
  background: #15803d !important;
  height: 8px !important;
  border-radius: 8px !important;
}

/* === 3) Hover font for all 4 fine tune buttons -> BLACK === */
.annuity-tab:hover{
  color: #000000 !important;
}

/* === 4) Tip text wording + GREEN word colored green === */
.annuity-meta{
  font-size: 0.85rem;
}
.annuity-meta .word-green{
  color: #15803d;
  font-weight: 900;
}

/* === 5) Spouse 1 / Spouse 2 divider thickness === */
#resultsCard table thead th:nth-child(1),
#resultsBody td:nth-child(1){
  border-right: 3px solid #000000 !important;
}
#resultsCard table thead th:nth-child(2),
#resultsBody td:nth-child(2){
  border-left: 3px solid #000000 !important;
}


/* =========================
   PRINT OVERRIDES (Grayscale + Clean Pagination)
   ========================= */
@media print{
  /* Remove the on-screen fine-tune UI */
  .sidecar, .annuity-tabs, .annuity-folder, .sidecar-detail-btn-wrap{ display:none !important; }
  .-grid{ display:block !important; }
  .-main{ width:100% !important; }
  #resultsCard{ width:100% !important; }

  /* Grayscale override for all conditional fills in summary table */
  #resultsBody td.surplus{
    background: #e5e7eb !important; /* light gray */
    color: #000 !important;
  }
  #resultsBody td.shortfall,
  #resultsBody td.zero-benefit{
    background: #d1d5db !important; /* darker gray */
    color: #000 !important;
  }
  /* Ensure white-text overrides don't persist in print */
  #resultsBody td{ color:#000 !important; }

  /* Don't print the on-page "Last Calculated" badge (it was causing layout breaks) */
  #lastCalculatedUnder, #lastCalculatedTop, #lastCalculated{ display:none !important; }

  /* Put "Last Calculated" on the cover */
  #printLastCalculatedLine{ display:block !important; }

  /* Ensure summary card fits on one page when possible */
  #resultsCard{
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin: 0 auto !important;
  }
  #resultsCard .table-wrapper{
    max-height: none !important;
    overflow: visible !important;
  }
  #resultsCard table{
    font-size: 0.62rem !important;
  }
  #resultsCard th, #resultsCard td{
    padding: 2px 3px !important;
  }

  /* Remove any forced page breaks that would create blank pages */
  .-card{ page-break-after: auto !important; break-after: auto !important; }

  /* Page 2: print-only centered gold contact box */
  .print-contact-page{
    display:block !important;
    page-break-after: always !important;
    break-after: page !important;
  }
}

/* Print-only elements default hidden on screen */
.print-contact-page{ display:none; }
#printLastCalculatedLine{ display:none; }


/* ===== Re-applied improvements (from post "LAST GOOD ONE") — sidecar + pickers + highlights ===== */
.-grid{ display:flex; gap:16px; align-items:flex-start; }
.-main{ flex:1 1 auto; min-width:0; }
.sidecar{ flex:0 0 220px; max-width:220px; background:#ffeb3b; border:3px solid #166534; border-radius:14px; padding:16px 12px 12px; box-shadow:0 10px 26px rgba(0,0,0,0.10); }
@media (max-width: 640px){ .-grid{ display:block; } .sidecar{ max-width:none; width:auto; } }

.sidecar h3{ margin:0 0 8px; font-size:1.15rem; font-weight:900; text-align:center; }
.sidecar-sub{ margin:0 0 8px; text-align:center; font-weight:800; }
.sidecar-sub-note{ display:block; margin-top:4px; font-weight:900; letter-spacing:0.06em; text-transform:uppercase; }

.annuity-tabs{ display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin: 14px 0 20px; }
.annuity-tab{ border:2px solid #000; border-radius:999px; padding:6px 10px; min-width:84px; font-weight:900; cursor:pointer; box-shadow:0 3px 10px rgba(0,0,0,0.18); transition:filter .12s ease, color .12s ease; }
.annuity-tab.tab-ann1{ background:#fde68a; }
.annuity-tab.tab-ann2{ background:#bfdbfe; }
.annuity-tab.tab-ann3{ background:#bbf7d0; }
.annuity-tab.tab-ann4{ background:#fecaca; }
.annuity-tab:hover{ filter:brightness(0.85); color:#000 !important; }
.annuity-tab[aria-selected="true"]{ box-shadow:0 5px 14px rgba(0,0,0,0.24); }

.annuity-folder .annuity-block{ display:none; border-radius:14px; border:3px solid #000; padding:10px; background:#e5e7eb; }
.annuity-folder .annuity-block.is-active{ display:block; }
.annuity-title{ display:flex; justify-content:space-between; font-weight:900; }
.annuity-value{ text-align:center; font-size:1.25rem; font-weight:900; margin:6px 0; }
.annuity-meta{ text-align:center; font-weight:800; margin-top:8px; }
.word-green{ color:#15803d; font-weight:900; }

.age-picker{ margin-top:10px; border:2px solid #000; border-radius:10px; background:#fff7d6; padding:6px; }
.age-picker-header{ text-align:center; font-weight:900; margin-bottom:4px; }
.age-list{ max-height:140px; overflow:auto; display:flex; flex-direction:column; align-items:center; font-size:0.78rem; }
.age-list label{ display:flex; justify-content:center; gap:10px; width:100%; max-width:180px; padding:2px 4px; border-radius:6px; cursor:pointer; }
.age-list label:hover{ background:#fff3b0; }

.sidecar-detail-btn-wrap{ display:flex; justify-content:center; margin-top:12px; }
.sidecar-detail-btn{ background:#166534; color:#fff; border:2px solid #0f3d24; border-radius:12px; padding:8px 14px; font-weight:900; cursor:pointer; }
.sidecar-detail-btn:hover{ background:#ffeb3b; color:#000; border-color:#000; }

.sidecar-quick-actions{ display:flex; justify-content:space-between; gap:8px; margin-top:14px; padding-top:10px; border-top:2px solid rgba(0,0,0,0.18); }
.sidecar-save-link{ font-weight:900; text-decoration:underline; white-space:nowrap; color:#15803d; }
.sidecar-quick-actions .link-report{ font-weight:900; white-space:nowrap; text-decoration:underline; }

input[type="range"]::-webkit-slider-thumb{ -webkit-appearance:none; appearance:none; background:#ffeb3b !important; border:2px solid #000 !important; width:20px; height:20px; border-radius:50%; cursor:pointer; }
input[type="range"]::-moz-range-thumb{ background:#ffeb3b !important; border:2px solid #000 !important; width:20px; height:20px; border-radius:50%; cursor:pointer; }

#resultsBody.slider-dragging tr.row-selected td,
#resultsBody.slider-dragging tr.row-selected-ann2 td,
#resultsBody.slider-dragging tr.row-selected-ann3 td,
#resultsBody.slider-dragging tr.row-selected-ann4 td{
  background:#ffeb3b !important;
  color:#000 !important;
  font-weight:900 !important;
}
#resultsBody.slider-dragging tr.row-selected td *,
#resultsBody.slider-dragging tr.row-selected-ann2 td *,
#resultsBody.slider-dragging tr.row-selected-ann3 td *,
#resultsBody.slider-dragging tr.row-selected-ann4 td *{
  color:#000 !important;
}

@media print{
  .sidecar{ display:none !important; }
  .-grid{ display:block !important; }
  /* Colors preserved — no grayscale override */
}


/* === Sidecar sliders: force yellow thumb === */
.sidecar input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none !important;
  appearance: none !important;
  background: #ffeb3b !important;
  border: 2px solid #000 !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
}
.sidecar input[type="range"]::-moz-range-thumb{
  background: #ffeb3b !important;
  border: 2px solid #000 !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
}


/* === Kill any unintended dashed overlay lines on screen === */
.share-box::before,
#resultsCard::before,
.print-gold-box::before,
.print-share-box::before{
  display: none !important;
  content: none !important;
  border: none !important;
}

hr{
  border-style: solid !important;
}


/* === Sidecar quick actions (in yellow space under the slider panel) === */
.sidecar-quick-actions{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 2px solid rgba(0,0,0,0.18);
}
.sidecar-save-link,
.sidecar-report-link{
  font-weight: 900;
  text-decoration: underline;
  white-space: nowrap;
  color: #000;
}
.sidecar-report-link{
  text-align:right;
}
.sidecar-save-link:hover,
.sidecar-report-link:hover{
  filter: brightness(0.95);
}


/* === Household card: add a bit more breathing room between title and quick links === */
.card.household .house-quick-links{
  top: 56px !important;   /* was tighter; move down slightly */
}


/* === Sidecar: actions under Show Detail View button === */
.sidecar-detail-actions{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px solid rgba(0,0,0,0.18);
}
.sidecar-detail-actions a{
  font-weight: 900;
  text-decoration: underline;
  white-space: nowrap;
  color: #000;
}
.sidecar-detail-actions a:hover{
  filter: brightness(0.95);
}


/* === Top button: keep mid-screen so it never covers sidecar links === */
#backToTopBtn{
  bottom: 540px !important;
  transform: none !important;
}

/* === Sidecar detail actions: smaller + colored === */
.sidecar-detail-actions{
  gap: 6px !important;
}
.sidecar-detail-actions a{
  font-size: 0.82rem !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}
.sidecar-detail-actions a.sidecarSaveScenario2{ color:#15803d !important; } /* green */
.sidecar-detail-actions a.sidecarGetReport2{ color:#b91c1c !important; }    /* red */

.sidecar-quick-actions a{
  font-size: 0.82rem !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}
#sidecarSaveScenario{ color:#15803d !important; }
#sidecarReportLink{ color:#b91c1c !important; }

/* === Prevent 'page feels locked': don't let the summary table capture the whole viewport === */
#resultsCard .table-wrapper{
  max-height: 460px !important; /* smaller so user can scroll past */
  overscroll-behavior: auto !important; /* allow scroll chaining */
}


/* === Restore Summary table viewport so the chart fills the card again === */
@media (min-width: 981px){
  #resultsCard .table-wrapper{ max-height: 610px !important; }
}


/* === Fine-Tune sidecar: force slider thumb to yellow (high specificity) === */
.sidecar input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none !important;
  appearance: none !important;
  background: #ffeb3b !important;
  border: 2px solid #000 !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
}
.sidecar input[type="range"]::-moz-range-thumb{
  background: #ffeb3b !important;
  border: 2px solid #000 !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
}


/* === Fine-Tune sliders: force yellow thumb (Chrome/Safari need appearance reset on the input) === */
.sidecar input[type="range"]{
  -webkit-appearance: none !important;
  appearance: none !important;
  background: transparent !important; /* track handled separately */
  outline: none !important;
}
.sidecar input[type="range"]::-webkit-slider-runnable-track{
  background: #15803d !important; /* keep green bar */
  height: 8px !important;
  border-radius: 8px !important;
}
.sidecar input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none !important;
  appearance: none !important;
  background: #ffeb3b !important;
  border: 2px solid #000 !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  margin-top: -7px !important; /* center thumb on 8px track */
}
.sidecar input[type="range"]::-moz-range-track{
  background: #15803d !important;
  height: 8px !important;
  border-radius: 8px !important;
}
.sidecar input[type="range"]::-moz-range-thumb{
  background: #ffeb3b !important;
  border: 2px solid #000 !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
}


/* === Full infill color for each Annuity slider box (panel + ages + radios) === */

/* Common */
.annuity-folder .annuity-block.is-active{
  border-radius: 14px !important;
}
.annuity-folder .annuity-block.is-active .age-picker,
.annuity-folder .annuity-block.is-active .age-list,
.annuity-folder .annuity-block.is-active .age-list label{
  border-color: #000 !important;
}

/* Annuity 1 (amber/gold) */
#sidecar_ann1.is-active{
  background: #fde68a !important;
}
#sidecar_ann1.is-active .age-picker,
#sidecar_ann1.is-active .age-list{
  background: #fff7cc !important;
}
#sidecar_ann1.is-active input[type="radio"]{ accent-color:#b45309; }

/* Annuity 2 (blue) */
#sidecar_ann2.is-active{
  background: #bfdbfe !important;
}
#sidecar_ann2.is-active .age-picker,
#sidecar_ann2.is-active .age-list{
  background: #eff6ff !important;
}
#sidecar_ann2.is-active input[type="radio"]{ accent-color:#1d4ed8; }

/* Annuity 3 (green) */
#sidecar_ann3.is-active{
  background: #bbf7d0 !important;
}
#sidecar_ann3.is-active .age-picker,
#sidecar_ann3.is-active .age-list{
  background: #f0fdf4 !important;
}
#sidecar_ann3.is-active input[type="radio"]{ accent-color:#15803d; }

/* Annuity 4 (red) */
#sidecar_ann4.is-active{
  background: #fecaca !important;
}
#sidecar_ann4.is-active .age-picker,
#sidecar_ann4.is-active .age-list{
  background: #fef2f2 !important;
}
#sidecar_ann4.is-active input[type="radio"]{ accent-color:#991b1b; }


/* === Fine Tune: shadow around the active annuity slider panel === */
.annuity-folder .annuity-block.is-active{
  box-shadow: 0 10px 22px rgba(0,0,0,0.20) !important;
}


/* =========================
   PRINT BOOKLET (Chrome-safe)
   Builds a 7-page print-only booklet via JS (beforeprint)
   ========================= */
@media print{
  /* Hide everything by default */
  body > *:not(#printBooklet){ display:none !important; }
  #printBooklet{ display:block !important; }

  @page{ size: landscape; margin: 8mm; }

  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }

  #printBooklet{ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #000; }
  #printBooklet .pb-page{
    page-break-after: always;
    break-after: page;
  }
  #printBooklet .pb-page:last-child{
    page-break-after: auto;
    break-after: auto;
  }

  /* Centered page content */
  #printBooklet .pb-center{
    height: 100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
  }

  /* Cover */
  #printBooklet .pb-cover-title{ font-size: 36pt; font-weight: 900; margin: 0 0 8mm 0; color: #000; }
  #printBooklet .pb-cover-sub{ font-size: 18pt; font-weight: 800; margin: 0 0 12mm 0; color: #000; }
  #printBooklet .pb-cover-meta{ font-size: 13pt; display:grid; gap: 6mm; justify-content:center; color: #000; }

  /* Gold box page */
  #printBooklet .pb-gold{
    width: 70%;
    max-width: 800px;
    background: #d4af37;
    border: 4px solid #000;
    border-radius: 18px;
    padding: 30px 36px 26px;
  }
  #printBooklet .pb-gold-title{
    margin: 0 0 16px;
    font-size: 18pt;
    font-weight: 900;
    line-height: 1.3;
    color:#000;
  }
  #printBooklet .pb-right-now{ color:#ffeb3b; font-weight: 950; }
  #printBooklet .pb-white-knuckle{ color:#fff; font-weight: 950; }
  #printBooklet .pb-gold-cta{
    margin: 12px auto 14px;
    display:inline-block;
    background: rgba(255,255,255,0.55);
    border: 3px solid #000;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14pt;
    font-weight: 950;
    letter-spacing: 0.06em;
    color:#14532d;
  }
  #printBooklet .pb-pill{
    display:inline-block;
    border: 3px solid #000;
    border-radius: 999px;
    padding: 8px 14px;
    background:#fff;
    margin: 6px 8px 0;
    font-size: 12pt;
    font-weight: 900;
  }

  /* Card pages - all 3 cards identical size in landscape */
  #printBooklet .pb-cards-row {
    display: flex !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  #printBooklet .pb-card-uniform {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 33.33% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #printBooklet .pb-card-uniform .card {
    box-shadow: none !important;
    border-radius: 8px !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    padding: 6px 8px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  #printBooklet .pb-card-uniform .card h2 {
    font-size: 10pt !important;
    font-weight: 900 !important;
    margin: 2px 0 4px !important;
    text-align: center !important;
  }
  #printBooklet .pb-card-uniform .card .field-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
    margin-bottom: 2px !important;
  }
  #printBooklet .pb-card-uniform .card input,
  #printBooklet .pb-card-uniform .card select {
    padding: 1px 3px !important;
    font-size: 8.5pt !important;
    font-weight: 700 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: 0 !important;
  }
  #printBooklet .pb-card-uniform .card label {
    font-size: 7.5pt !important;
    font-weight: 600 !important;
    line-height: 1.15 !important;
    margin-bottom: 0 !important;
  }
  #printBooklet .pb-card-uniform .card > div:last-child {
    margin-bottom: 0 !important;
  }
  #printBooklet .pb-card-uniform .tooltip-icon,
  #printBooklet .pb-card-uniform input[type="range"],
  #printBooklet .pb-card-uniform .slider-row,
  #printBooklet .pb-card-uniform .fine-tune-toggle,
  #printBooklet .pb-card-uniform .fine-tune-controls {
    display: none !important;
  }

  /* Summary + detail pages — fit portrait with margins */
  #printBooklet .pb-h2{ font-size: 14pt; font-weight: 900; margin: 0 0 2mm 0; text-align:center; }
  
.pb-meta{font-size:9px;font-weight:600;margin:1px 0 4px;text-align:center;}
#printBooklet .pb-table-wrap{ width: 100%; }
  #printBooklet table{ width:100% !important; border-collapse: collapse !important; }
  #printBooklet .pb-summary{ padding: 6mm 5mm !important; }
  #printBooklet .pb-summary table{ font-size: 7.5pt !important; line-height: 1.1 !important; }
  #printBooklet .pb-summary th, #printBooklet .pb-summary td{ padding: 1.5px 3px !important; white-space: nowrap !important; }
  #printBooklet .pb-detail{ padding: 6mm 5mm !important; }
  #printBooklet .pb-detail table{ font-size: 6pt !important; line-height: 1.05 !important; }
  #printBooklet .pb-detail th, #printBooklet .pb-detail td{ padding: 1px 2px !important; white-space: nowrap !important; }

  /* Prevent rows from splitting across pages */
  #printBooklet table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Colors preserved in print — keep original green/red */
  #printBooklet .salary-badge{ border:1px solid #000 !important; }
}


/* =========================
   HELP / INSTRUCTIONS (Modal + Guided Tour)
   ========================= */
.help-fab{
  position: fixed;
  left: auto;
  top: auto;
  right: 18px;
  bottom: 18px;
z-index: 2000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 3px solid #000;
  background: #ffeb3b;
  color: #000;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,0.20);
}
.help-fab:hover{ filter: brightness(0.98); }
.help-fab:focus{ outline:none; box-shadow: 0 0 0 4px rgba(248,113,113,0.7), 0 10px 22px rgba(0,0,0,0.20); }

.help-modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.help-modal{
  width: min(860px, 96vw);
  max-height: min(84vh, 780px);
  overflow: auto;
  background: #ffffff;
  border: 4px solid #000;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}
.help-modal-header{
  position: sticky;
  top: 0;
  background: #ffffff;
  border-bottom: 3px solid #000;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.help-modal-title{
  margin: 0;
  font-size: 1.2rem;
  font-weight: 950;
  letter-spacing: 0.02em;
}
.help-modal-close{
  border: 2px solid #000;
  background: #ffeb3b;
  color: #000;
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 900;
  min-width: unset;
}
.help-modal-body{
  padding: 14px 16px 18px;
}
.help-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 820px){
  .help-grid{ grid-template-columns: 1fr; }
}
.help-card{
  border: 2px solid #111;
  border-radius: 14px;
  padding: 12px 12px 10px;
  background: #f9fafb;
}
.help-card h4{
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 950;
}
.help-card p{
  margin: 0;
  line-height: 1.35;
}
.help-actions{
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.help-action-btn{
  border: 3px solid #000;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 950;
  cursor: pointer;
  background: #166534;
  color: #fff;
  min-width: 200px;
}
.help-action-btn:hover{ filter: brightness(1.02); }
.help-action-btn.secondary{
  background: #ffffff;
  color: #166534;
  border-color: #166534;
}

/* Tour highlighting */
.tour-highlight{
  outline: 3px solid #dc2626 !important;
  outline-offset: 3px !important;
  box-shadow: none !important;
  border-radius: 10px !important;
}
/* Step 3 special target cell glow (Net Cumulative cell at S1 age 73) */
/* Cell background stays neutral for Step 3 */
.tour-cell-glow{
  position: relative;
  z-index: 2601;
  background-color: transparent !important; /* no background tint */
}

/* Pulsing red oval around the number value */
.tour-cell-glow .tour-cell-value{
  display: inline-block;
  padding: 4px 10px;
  border: 3px solid #dc2626;
  border-radius: 50px; /* oval shape */
  background: transparent;
  animation: pulse-red-oval 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(220,38,38,0.3);
}

@keyframes pulse-red-oval {
  0%, 100% {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220,38,38,0.3), 0 0 8px rgba(220,38,38,0.4);
    transform: scale(1);
  }
  50% {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(220,38,38,0.4), 0 0 16px rgba(220,38,38,0.6);
    transform: scale(1.05);
  }
}



.tour-toast{
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2600;
  width: min(720px, 94vw);
  background: #ffffff;
  border: 3px solid #000;
  border-radius: 16px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.28);
  padding: 12px 12px 10px;
  display: none;
}
.tour-toast h4{
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 950;
}
.tour-toast p{
  margin: 0 0 10px;
  line-height: 1.35;
}
.tour-nav{
  display: flex;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.tour-btn{
  border: 2px solid #000;
  background: #ffeb3b;
  color: #000;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 950;
  min-width: 120px;
}
.tour-btn.primary{
  background: #166534;
  color: #fff;
}


/* === Instructions Modal: Colored Quote Cards === */
.help-card.card-household{
  background:#eff6ff; /* blue */
  border-color:#2563eb;
}
.help-card.card-calc{
  background:#fef3c7; /* yellow */
  border-color:#f59e0b;
}
.help-card.card-finetune{
  background:#ecfdf5; /* green */
  border-color:#15803d;
}
.help-card.card-actions{
  background:#fdf2f8; /* pink */
  border-color:#be185d;
}


/* === Instructions Modal: subtle icons + staggered card entrance === */
.help-icon{
  display:inline-block;
  margin-right: 6px;
  opacity: 0.75;
  transform: translateY(1px);
}

@keyframes helpCardIn{
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Cards animate when modal opens */
.help-modal.help-modal-open .help-card{
  opacity: 0;
  animation: helpCardIn 0.35s ease-out forwards;
}
.help-modal.help-modal-open .help-card:nth-child(1){ animation-delay: 0.05s; }
.help-modal.help-modal-open .help-card:nth-child(2){ animation-delay: 0.12s; }
.help-modal.help-modal-open .help-card:nth-child(3){ animation-delay: 0.19s; }
.help-modal.help-modal-open .help-card:nth-child(4){ animation-delay: 0.26s; }


/* === Sidecar: Move (amount + slider + 'Adjust to keep...') UNDER the age picker for ALL annuities === */
.annuity-folder .annuity-block{
  display: flex !important;
  flex-direction: column !important;
}

/* Order within each annuity panel */
.annuity-folder .annuity-block .annuity-title{ order: 1 !important; }
.annuity-folder .annuity-block .age-picker{ order: 2 !important; }

/* Put value, slider, meta UNDER the age picker */
.annuity-folder .annuity-block .annuity-value{ order: 3 !important; }
.annuity-folder .annuity-block input[type="range"]{ order: 4 !important; }
.annuity-folder .annuity-block .annuity-meta{ order: 5 !important; }

/* Then the detail controls */
.annuity-folder .annuity-block .sidecar-detail-btn-wrap{ order: 6 !important; }
.annuity-folder .annuity-block .sidecar-detail-actions{ order: 7 !important; }

/* Spacing tune */
.annuity-title{ margin-bottom: 8px !important; }
.age-picker{ margin-top: 8px !important; margin-bottom: 12px !important; }
.annuity-value{ margin-top: 6px !important; margin-bottom: 8px !important; }
.annuity-folder .annuity-block input[type="range"]{ margin-top: 4px !important; margin-bottom: 8px !important; }
.annuity-meta{ margin-top: 2px !important; margin-bottom: 8px !important; }


/* === Sidecar FIX: Restore tabbed panels (only one annuity visible at a time) === */
.annuity-folder .annuity-block{
  display: none !important;            /* hide all by default */
}
.annuity-folder .annuity-block.is-active{
  display: flex !important;            /* show only active */
  flex-direction: column !important;
}

/* Keep the requested internal ordering for the ACTIVE panel */
.annuity-folder .annuity-block.is-active .annuity-title{ order: 1 !important; }
.annuity-folder .annuity-block.is-active .age-picker{ order: 2 !important; }
.annuity-folder .annuity-block.is-active .annuity-value{ order: 3 !important; }
.annuity-folder .annuity-block.is-active input[type="range"]{ order: 4 !important; }
.annuity-folder .annuity-block.is-active .annuity-meta{ order: 5 !important; }
.annuity-folder .annuity-block.is-active .sidecar-detail-btn-wrap{ order: 6 !important; }
.annuity-folder .annuity-block.is-active .sidecar-detail-actions{ order: 7 !important; }

/* Ensure each annuity panel is color-coded when active */
#sidecar_ann1.is-active{ background:#fde68a !important; } /* light amber */
#sidecar_ann2.is-active{ background:#bfdbfe !important; } /* light blue */
#sidecar_ann3.is-active{ background:#bbf7d0 !important; } /* light green */
#sidecar_ann4.is-active{ background:#fecaca !important; } /* light red */


/* === HELP FAB CLICKABILITY HARDENING === */
#helpFab{ z-index: 99999 !important; pointer-events: auto !important; }
#helpModalBackdrop{ z-index: 100000 !important; }


/* Guided tour arrow */
.tour-arrow {
  width: 0;
  height: 0;
  border-style: solid;
  position: absolute;
  z-index: 9999;
}

/* Right-pointing arrow */
.tour-arrow.right {
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #000;
}

/* Left-pointing arrow */
.tour-arrow.left {
  border-width: 6px 10px 6px 0;
  border-color: transparent #000 transparent transparent;
}

/* Up arrow */
.tour-arrow.up {
  border-width: 0 6px 10px 6px;
  border-color: transparent transparent #000 transparent;
}

/* Down arrow */
.tour-arrow.down {
  border-width: 10px 6px 0 6px;
  border-color: #000 transparent transparent transparent;
}


/* === TOUR TOAST POSITION OVERRIDE (keeps Step 4 controls visible) === */
#tourToast, .tour-toast, #tourDialog, .tour-dialog, #tourWalkthrough, .tour-walkthrough {
  left: 20px !important;
  right: auto !important;
}

#tourToast, .tour-toast, #tourDialog, .tour-dialog, #tourWalkthrough, .tour-walkthrough {
  max-width: min(560px, calc(100vw - 40px)) !important;
}

/* If the toast was being centered with translateX(-50%), neutralize it */
#tourToast, .tour-toast, #tourDialog, .tour-dialog, #tourWalkthrough, .tour-walkthrough {
  transform: none !important;
}


/* === TOUR STEP 6 ATTENTION (red border + glow on "Show Detail View" button) === */
.step6-attn{
  border: 6px solid #dc2626 !important;
  box-shadow: 0 0 0 6px rgba(220,38,38,0.25), 0 0 24px rgba(220,38,38,0.65) !important;
  animation: step6Pulse 0.75s ease-in-out infinite;
}
@keyframes step6Pulse{
  0%   { transform: scale(1);   filter: brightness(1); }
  50%  { transform: scale(1.03); filter: brightness(1.06); }
  100% { transform: scale(1);   filter: brightness(1); }
}


/* =========================
   PDF / PRINT REPORT CLEANUP
   (Targets the summary chart/table)
   ========================= */
@page {
  size: letter landscape;
  margin: 8mm;
}

@media print {
  /* Remove any yellow "frame"/page background look */
  html, body {
    background: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Let the summary table render fully (no scroll box) */
  .table-wrapper {
    max-height: none !important;
    overflow: visible !important;
    border-radius: 0 !important;
    border: none !important;
  }

  /* Keep the chart clean and centered in portrait */
  #resultsCard, #detailResultsCard {
    background: #ffffff !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  #resultsCard table {
    width: 100% !important;
    table-layout: fixed !important;
    font-size: 7.5pt !important;
  }

  #resultsCard table th,
  #resultsCard table td {
    padding: 1.5px 3px !important;
  }

  /* Remove the thick yellow divider for print; keep a clean black divider instead */
  #resultsCard table tbody td:nth-child(6){
    border-right: 6px solid #000000 !important;
  }
  #resultsCard table thead th:nth-child(7),
  #resultsCard table tbody td:nth-child(7){
    border-left: 6px solid #000000 !important;
  }

  /* Clean up neutral column artifacts but preserve conditional colors */
  #resultsCard table tbody td:nth-child(3),
  #resultsCard table tbody td:nth-child(6){
    background-image: none !important;
  }

  /* Ensure header bands stay crisp */
  #resultsCard table thead th {
    background-image: none !important;
  }
}


/* =========================
   LETTER-SPECIFIC PRINT LOCK
   ========================= */
@page {
  size: letter landscape;
  margin: 8mm;
}

@media print {

  /* HARD RESET of interactive highlights */
  .highlight-row,
  .selected-row,
  .row-active,
  .row-highlight,
  .annuity-highlight,
  .glow,
  .tour-highlight,
  .blue-outline {
    outline: none !important;
    box-shadow: none !important;
    background: inherit !important;
  }

  /* Ensure no outlines remain on table rows or cells */
  table tr,
  table td {
    outline: none !important;
    box-shadow: none !important;
  }

  /* Landscape gives ample room — no scale needed */
  #resultsCard {
    transform: none;
    transform-origin: top center;
  }

  /* Make sure nothing forces extra width */
  #resultsCard table {
    max-width: 100% !important;
  }
}


/* =========================
   PRINT POLISH (v30)
   - Remove card/frame borders behind table
   - Remove unwanted gray fills in neutral columns
   ========================= */
@media print {

  /* Remove any "frame" border/shadow behind the table */
  #resultsCard,
  .-card,
  .-main,
  .-grid,
  .table-wrapper {
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  /* Remove any before/after decorative blocks that could look like a black border */
  #resultsCard::before,
  #resultsCard::after,
  .-card::before,
  .-card::after,
  .table-wrapper::before,
  .table-wrapper::after {
    content: none !important;
    display: none !important;
  }

  /* Keep table borders clean — remove only background-image/filter artifacts, not class colors */
  #resultsCard table tbody td:nth-child(3),
  #resultsCard table tbody td:nth-child(6) {
    background-image: none !important;
    filter: none !important;
    opacity: 1 !important;
  }

  /* Also ensure the header cells above those columns stay as designed */
  #resultsCard table thead th:nth-child(3),
  #resultsCard table thead th:nth-child(6) {
    background-image: none !important;
    filter: none !important;
    opacity: 1 !important;
  }

  /* Safety: stop any selection/hover striping from printing */
  #resultsCard table tr:hover td,
  #resultsCard table tr:hover th {
    background: inherit !important;
  }
}

/* Pulsing red border on CALCULATE button - VERY VISIBLE */
#calcBtn {
  animation: pulse-red-border 1.5s ease-in-out infinite;
  border: 4px solid #dc2626 !important;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.6) !important;
}

@keyframes pulse-red-border {
  0%, 100% {
    border-color: #dc2626 !important;
    border-width: 4px !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.6), 0 0 20px rgba(220, 38, 38, 0.8) !important;
    transform: scale(1);
  }
  50% {
    border-color: #ef4444 !important;
    border-width: 5px !important;
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.7), 0 0 30px rgba(220, 38, 38, 1) !important;
    transform: scale(1.02);
  }
}

/* Floating tour button pulse - only on first page load */
.pulse-on-load {
  animation: pulse-green-button 2s ease-in-out 3;
}

@keyframes pulse-green-button {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.6), 0 0 30px rgba(22, 163, 74, 0.4);
  }
}

/* Square CALCULATE button positioned below the 3 cards, centered */
.calc-square-button {
  width: 180px !important;
  height: 180px !important;
  border-radius: 20px !important;
  background: #2f9e44 !important;
  border: 4px solid #000 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  padding: 20px !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.calc-square-button:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 24px rgba(47, 158, 68, 0.4) !important;
  background: #27853b !important;
}

.calc-square-button:active {
  transform: translateY(-2px) !important;
}

.calc-square-button .calc-main-text {
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  color: #ffeb3b !important;
  text-align: center !important;
  line-height: 1.1 !important;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
}

.calc-square-button .calc-sub-text {
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  text-align: center !important;
  line-height: 1.3 !important;
  max-width: 160px !important;
}


