/* HELOC Calculator Styles - Matching Reference Image Exactly */

:root {
  --calc-navy: #1b365d;
  --calc-blue: #2b6cb0;
  --calc-blue-dark: #1e4b7a;
  --calc-green-header: #4c8a2b;
  --calc-green-btn: #3e7b23;
  --calc-green-hover: #33671c;
  --calc-gray-btn: #808080;
  --calc-gray-hover: #6c6c6c;
  --calc-border: #cccccc;
  --calc-border-light: #e2e8f0;
  --calc-bg-light: #f7f9fa;
  --calc-text: #2d3748;
  --calc-text-dark: #1a202c;
  --calc-link: #0056b3;
}

/* Base resets & layout */
body {
  font-family: Arial, Helvetica, sans-serif;
  color: #333333;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.heloc-page-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

/* Breadcrumbs Row */
.heloc-breadcrumbs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
}

.heloc-breadcrumbs {
  font-size: 13px;
  color: #0844a4;
}
.heloc-breadcrumbs a {
  color: #0844a4;
  text-decoration: none;
}
.heloc-breadcrumbs a:hover {
  text-decoration: underline;
}
.heloc-breadcrumbs span {
  color: #777777;
  margin: 0 4px;
}
.heloc-breadcrumbs .crumb-current {
  color: #333333;
}

/* Quick Action Links */
.heloc-top-links {
  display: flex;
  align-items: center;
  gap: 12px;
}
.heloc-top-link-btn {
  background: none;
  border: none;
  color: #0844a4;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.heloc-top-link-btn:hover {
  color: #002277;
}

/* Main Heading */
.heloc-main-title {
  font-size: 24px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 4px 0;
  line-height: 1.25;
}

/* Main 2-Column Content Layout (Ensures Sidebar is firmly on the Right Side) */
.heloc-content-grid {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.heloc-main-column {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.heloc-sidebar {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Top Calculator Section */
.heloc-calculator-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
}

/* Left Form Box (Matches Reference Image Exactly) */
.heloc-form-panel {
  width: 275px;
  flex-shrink: 0;
  background-color: #f2f2f2;
  border: 1px solid #cccccc;
  border-radius: 3px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-sizing: border-box;
}

.heloc-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.heloc-form-label {
  font-size: 13px;
  color: #333333;
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.heloc-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: #cbd5e1;
  color: #334155;
  font-size: 10px;
  font-weight: bold;
  cursor: help;
  position: relative;
}
.heloc-tooltip-trigger:hover .heloc-tooltip-bubble {
  visibility: visible;
  opacity: 1;
}

.heloc-tooltip-bubble {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background-color: #1e293b;
  color: #ffffff;
  text-align: left;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.4;
  z-index: 100;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.heloc-tooltip-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

.heloc-input-group {
  display: flex;
  align-items: center;
  width: 140px;
  border: 1px solid #a0aec0;
  background-color: #ffffff;
  border-radius: 2px;
  overflow: hidden;
}
.heloc-input-prefix {
  padding: 4px 6px;
  font-size: 13px;
  color: #4a5568;
  background-color: #edf2f7;
  border-right: 1px solid #cbd5e0;
  user-select: none;
}
.heloc-input-suffix {
  padding: 4px 6px;
  font-size: 12px;
  color: #4a5568;
  background-color: #edf2f7;
  border-left: 1px solid #cbd5e0;
  user-select: none;
  white-space: nowrap;
}
.heloc-input {
  width: 100%;
  padding: 5px 6px;
  font-size: 13px;
  border: none;
  outline: none;
  color: #1a202c;
  text-align: right;
  font-family: inherit;
  box-sizing: border-box;
}
.heloc-input:focus {
  background-color: #fffde7;
}

/* Checkbox Row */
.heloc-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: #2d3748;
}
.heloc-checkbox-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Expandable Closing Costs */
.heloc-closing-costs-expander {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background-color: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  margin-top: 4px;
}
.heloc-closing-costs-expander.open {
  display: flex;
}

/* Form Buttons */
.heloc-btn-group {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.heloc-btn-calc {
  flex: 1;
  background-color: #3e7b23;
  color: #ffffff;
  border: 1px solid #2d5a19;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.15s ease;
}
.heloc-btn-calc:hover {
  background-color: #33671c;
}
.heloc-btn-clear {
  background-color: #94a3b8;
  color: #ffffff;
  border: 1px solid #64748b;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.heloc-btn-clear:hover {
  background-color: #64748b;
}

/* Right Results Box */
.heloc-results-panel {
  border: 1px solid #c6e1b0;
  border-radius: 4px;
  overflow: hidden;
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.heloc-results-header {
  background-color: #4c8a2b;
  color: #ffffff;
  padding: 8px 14px;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.heloc-save-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: normal;
  opacity: 0.9;
  padding: 2px 6px;
  border-radius: 3px;
}
.heloc-save-btn:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.2);
}
.heloc-save-btn svg {
  width: 14px;
  height: 14px;
}

.heloc-results-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.heloc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: #1a202c;
}
.heloc-result-row.main-metric {
  font-weight: bold;
}
.heloc-result-label {
  color: #333333;
}
.heloc-result-value {
  font-weight: bold;
  color: #1a202c;
  font-size: 15px;
}

/* Donut Chart Block */
.heloc-donut-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf2f7;
}
.heloc-donut-svg-wrap {
  width: 140px;
  height: 140px;
  position: relative;
}
.heloc-donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.heloc-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #333333;
}
.heloc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.heloc-legend-color-box {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}
.heloc-color-principal {
  background-color: #2b6cb0;
}
.heloc-color-interest {
  background-color: #84cc16;
}

/* Local Rates CTA Button */
.heloc-cta-rates-container {
  display: flex;
  justify-content: center;
  margin: 6px 0;
}
.heloc-cta-rates-btn {
  background-color: #2b6cb0;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 24px;
  border-radius: 3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #1e4b7a;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.heloc-cta-rates-btn:hover {
  background-color: #1e4b7a;
}

/* Amortization Schedule & Chart Section */
.heloc-amortization-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.heloc-section-title {
  font-size: 18px;
  font-weight: bold;
  color: #1a365d;
  margin: 0;
}

.heloc-schedule-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 4px;
  font-size: 14px;
}
.heloc-tab-btn {
  background: none;
  border: none;
  color: #2b6cb0;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 2px;
  font-weight: 500;
  position: relative;
}
.heloc-tab-btn:hover {
  text-decoration: underline;
}
.heloc-tab-btn.active {
  font-weight: bold;
  color: #0f172a;
  text-decoration: none;
  border-bottom: 2px solid #2b6cb0;
  margin-bottom: -5px;
}

.heloc-schedule-grid {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
}

/* Amortization Table */
.heloc-table-container {
  width: 295px;
  flex-shrink: 0;
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
}
.heloc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: right;
}
.heloc-table thead th {
  background-color: #1b365d;
  color: #ffffff;
  padding: 6px 8px;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 10;
  border: 1px solid #132644;
}
.heloc-table th:first-child,
.heloc-table td:first-child {
  text-align: center;
  width: 45px;
}
.heloc-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}
.heloc-table tbody tr:hover {
  background-color: #e2e8f0;
}
.heloc-table td {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  color: #334155;
  white-space: nowrap;
}

/* Line Chart Visual */
.heloc-chart-card {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background-color: #ffffff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.heloc-chart-header {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  font-size: 12px;
  color: #334155;
}
.heloc-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.heloc-legend-line {
  width: 16px;
  height: 3px;
  border-radius: 1px;
}
.heloc-line-balance {
  background-color: #2b6cb0;
}
.heloc-line-interest {
  background-color: #84cc16;
}
.heloc-line-payment {
  background-color: #dc2626;
}
.heloc-svg-chart-wrapper {
  width: 100%;
  height: 320px;
  position: relative;
}
.heloc-svg-chart {
  width: 100%;
  height: 100%;
}

/* Second Calculator: Borrowing Power */
.heloc-borrowing-section {
  border-top: 2px solid #e2e8f0;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.heloc-borrowing-desc {
  font-size: 13px;
  color: #4a5568;
  line-height: 1.5;
  margin: 0;
}

.heloc-borrowing-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
}

.heloc-borrowing-card .heloc-form-panel {
  width: 275px;
  flex-shrink: 0;
}

.heloc-borrow-results-panel {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid #c6e1b0;
  border-radius: 4px;
  overflow: hidden;
  background-color: #ffffff;
}
.heloc-borrow-header {
  background-color: #4c8a2b;
  color: #ffffff;
  padding: 6px 14px;
  font-size: 15px;
  font-weight: bold;
}
.heloc-borrow-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.heloc-borrow-limit-text {
  font-size: 15px;
  font-weight: bold;
  color: #1a202c;
}
.heloc-borrow-ltv-text {
  font-size: 13px;
  color: #2d3748;
}
.heloc-borrow-disclaimer {
  font-size: 11px;
  color: #4a5568;
  line-height: 1.45;
  margin-top: 6px;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
}

/* Fraction Arithmetic & Equity Share Calculator (Requirements 1 & 5) */
.heloc-fraction-section {
  border-top: 2px solid #e2e8f0;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.heloc-fraction-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
}
.heloc-fraction-form {
  width: 275px;
  flex-shrink: 0;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}
.heloc-fraction-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.heloc-frac-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.heloc-frac-num,
.heloc-frac-den {
  width: 55px;
  padding: 4px 6px;
  font-size: 13px;
  text-align: center;
  border: 1px solid #a0aec0;
  border-radius: 2px;
}
.heloc-frac-bar {
  width: 100%;
  height: 1px;
  background-color: #4a5568;
}
.heloc-frac-whole {
  width: 48px;
  padding: 4px 6px;
  font-size: 13px;
  text-align: center;
  border: 1px solid #a0aec0;
  border-radius: 2px;
}
.heloc-frac-op-select {
  padding: 5px 8px;
  font-size: 14px;
  font-weight: bold;
  border: 1px solid #a0aec0;
  border-radius: 3px;
  background-color: #ffffff;
  cursor: pointer;
}

.heloc-fraction-results-panel {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background-color: #ffffff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.heloc-fraction-results-header {
  font-size: 15px;
  font-weight: bold;
  color: #1a365d;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}
.heloc-fraction-output-display {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 18px;
  font-weight: bold;
  color: #1e293b;
}
.heloc-fraction-decimal-tag {
  font-size: 13px;
  font-weight: normal;
  color: #475569;
  background-color: #f1f5f9;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
}
.heloc-fraction-steps-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 12px;
  color: #334155;
  line-height: 1.5;
}
.heloc-fraction-visuals-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.heloc-frac-pie-container {
  width: 110px;
  height: 110px;
}
.heloc-numline-container {
  flex: 1;
  min-width: 220px;
  height: 60px;
}

/* Right Sidebar */
.heloc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.heloc-search-box-wrap {
  display: flex;
  gap: 4px;
  position: relative;
}
.heloc-search-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #1a365d;
  border-radius: 2px;
  outline: none;
}
.heloc-search-input:focus {
  border-color: #2b6cb0;
  box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.2);
}
.heloc-search-btn {
  background-color: #1b365d;
  color: #ffffff;
  border: 1px solid #1b365d;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.15s ease;
}
.heloc-search-btn:hover {
  background-color: #132644;
}

.heloc-search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-radius: 0 0 4px 4px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}
.heloc-search-results-dropdown.open {
  display: block;
}
.heloc-search-item {
  padding: 8px 12px;
  font-size: 13px;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.heloc-search-item:hover,
.heloc-search-item.selected {
  background-color: #f1f5f9;
  color: #0056b3;
}
.heloc-search-item-cat {
  font-size: 11px;
  color: #64748b;
  background-color: #e2e8f0;
  padding: 1px 6px;
  border-radius: 2px;
}

/* Financial Calculators Links Box */
.heloc-links-card {
  border: 1px solid #1b365d;
  border-radius: 3px;
  overflow: hidden;
  background-color: #ffffff;
}
.heloc-links-header {
  background-color: #1b365d;
  color: #ffffff;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: bold;
}
.heloc-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 10px 12px;
  gap: 6px 12px;
  font-size: 12px;
}
.heloc-links-grid a {
  color: #0056b3;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heloc-links-grid a:hover {
  text-decoration: underline;
}
.heloc-more-links-row {
  grid-column: span 2;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
}
.heloc-links-footer {
  background-color: #edf2f7;
  border-top: 1px solid #cbd5e1;
  padding: 8px 10px;
  font-size: 11px;
  color: #4a5568;
  display: flex;
  justify-content: space-between;
}
.heloc-links-footer a {
  color: #0056b3;
  text-decoration: none;
}
.heloc-links-footer a:hover {
  text-decoration: underline;
}

/* Modals */
.heloc-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.heloc-modal-overlay.open {
  display: flex;
}
.heloc-modal-card {
  background-color: #ffffff;
  border-radius: 4px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: helocModalFadeIn 0.2s ease-out;
}
@keyframes helocModalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Instant Tool Modal (Image 1) */
.heloc-instant-header {
  background-color: #1b365d;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.heloc-instant-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
}
.heloc-modal-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.heloc-instant-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.heloc-instant-subtitle {
  font-size: 13px;
  color: #4a5568;
  margin: 0;
}
.heloc-instant-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.heloc-instant-label {
  font-size: 13px;
  font-weight: bold;
  color: #2d3748;
}
.heloc-instant-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  outline: none;
  box-sizing: border-box;
}
.heloc-instant-input:focus {
  border-color: #2b6cb0;
}
.heloc-instant-btn {
  background-color: #1b365d;
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
  align-self: flex-start;
  transition: background-color 0.15s ease;
}
.heloc-instant-btn:hover {
  background-color: #132644;
}
.heloc-instant-result-box {
  display: none;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
}

/* History Modal */
.heloc-history-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
}
.heloc-history-item {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.heloc-history-item:last-child {
  border-bottom: none;
}
.heloc-history-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.heloc-history-actions {
  display: flex;
  gap: 6px;
}

/* Toast */
.heloc-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #1e293b;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
  z-index: 3000;
}
.heloc-toast.show {
  display: block;
  animation: helocToastIn 0.2s ease;
}
@keyframes helocToastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* SEO Content Section */
.heloc-seo-section {
  border-top: 2px solid #e2e8f0;
  padding-top: 28px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #334155;
  line-height: 1.65;
  font-size: 14px;
}
.heloc-seo-section h2 {
  font-size: 20px;
  color: #1a365d;
  margin: 0 0 6px;
}
.heloc-seo-section h3 {
  font-size: 16px;
  color: #1e4b7a;
  margin: 16px 0 6px;
}
.heloc-seo-section p {
  margin: 0 0 10px;
}
.heloc-faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.heloc-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}
.heloc-faq-question {
  background-color: #f8fafc;
  padding: 10px 14px;
  font-weight: bold;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.heloc-faq-question:hover {
  background-color: #f1f5f9;
}
.heloc-faq-answer {
  padding: 12px 14px;
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
  border-top: 1px solid #e2e8f0;
  background-color: #ffffff;
  display: none;
}
.heloc-faq-item.open .heloc-faq-answer {
  display: block;
}

/* Responsive Breakpoints */
@media (max-width: 720px) {
  .heloc-content-grid {
    flex-direction: column;
  }
  .heloc-sidebar {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .heloc-calculator-card,
  .heloc-schedule-grid,
  .heloc-borrowing-card,
  .heloc-fraction-card {
    flex-direction: column;
  }
  .heloc-form-panel,
  .heloc-borrowing-card .heloc-form-panel,
  .heloc-table-container,
  .heloc-fraction-form {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 600px) {
  .heloc-page-container {
    padding: 12px;
  }
  .heloc-form-panel {
    padding: 12px;
  }
  .heloc-results-body {
    padding: 12px;
  }
  .heloc-input-group {
    width: 120px;
  }
  .heloc-donut-block {
    flex-direction: column;
  }
}

/* Site Footer */
.site-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e2e8f0;
  padding: 24px 0 30px 0;
  width: 100%;
  margin-top: 24px;
}
.site-footer .footer-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}
.site-footer .footer-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 12px;
  text-align: left;
}
.site-footer .footer-links-row {
  text-align: center;
  margin-top: 18px;
  font-size: 12px;
  color: #64748b;
}
.site-footer .footer-link {
  color: #0844a4;
  text-decoration: none;
  margin: 0 4px;
}
.site-footer .footer-link:hover {
  text-decoration: underline;
}
.site-footer .footer-copyright {
  margin-left: 12px;
}

/* Print Underwriting Sheet Styles */
.heloc-print-sheet {
  background: #ffffff;
  color: #1e293b;
  font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  font-size: 13px;
}
.heloc-print-sheet-header {
  border-bottom: 2px solid #1b365d;
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.heloc-print-title {
  font-size: 18px;
  font-weight: bold;
  color: #1b365d;
  margin: 0 0 4px 0;
}
.heloc-print-meta {
  font-size: 12px;
  color: #64748b;
}
.heloc-print-section {
  margin-bottom: 14px;
}
.heloc-print-section-title {
  font-size: 14px;
  font-weight: bold;
  color: #1b365d;
  margin-bottom: 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid #cbd5e1;
}
.heloc-print-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  font-size: 12.5px;
}
.heloc-print-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dashed #e2e8f0;
}
.heloc-print-label {
  color: #475569;
}
.heloc-print-val {
  font-weight: 600;
  color: #0f172a;
}
.heloc-print-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 11.5px;
}
.heloc-print-table th,
.heloc-print-table td {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  text-align: right;
}
.heloc-print-table th:first-child,
.heloc-print-table td:first-child,
.heloc-print-table th:nth-child(2),
.heloc-print-table td:nth-child(2) {
  text-align: left;
}
.heloc-print-table th {
  background-color: #f1f5f9;
  font-weight: 600;
  color: #1e293b;
}
.heloc-print-disclaimer {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.4;
}

/* Print Stylesheet */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .site-header,
  .heloc-sidebar,
  .heloc-action-bar,
  .heloc-cta-rates-container,
  .heloc-btn-group,
  .heloc-toast,
  .site-footer,
  .heloc-instant-header,
  #heloc-trigger-print-btn,
  #heloc-print-new-tab-btn,
  #heloc-copy-summary-btn,
  #heloc-download-txt-btn {
    display: none !important;
  }
  body.heloc-printing-modal .heloc-page-container {
    display: none !important;
  }
  body.heloc-printing-modal .heloc-modal-overlay#heloc-print-modal {
    display: block !important;
    position: static !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 9999 !important;
  }
  body.heloc-printing-modal .heloc-modal-overlay#heloc-print-modal .heloc-modal-card {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body.heloc-printing-modal .heloc-modal-overlay#heloc-print-modal button,
  body.heloc-printing-modal .heloc-modal-overlay#heloc-print-modal .heloc-modal-close-btn {
    display: none !important;
  }
  body.heloc-printing-modal .heloc-print-sheet {
    max-height: none !important;
    border: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  .heloc-page-container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .heloc-content-grid {
    display: block !important;
  }
  .heloc-table-container {
    max-height: none !important;
    overflow: visible !important;
  }
  .heloc-results-panel,
  .heloc-chart-card,
  .heloc-borrow-results-panel {
    border: 1px solid #000000 !important;
    page-break-inside: avoid;
  }
}
