
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}
.container {
  padding: 0 24px;
  box-sizing: border-box;
}
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
}
/* ============================================================
   Sunrise MFD — Financial Calculators (fin-tool.html)
   ============================================================ */

.calc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.calc-hero-badge .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal-dark);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(20,184,166,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(20,184,166,0); }
  100% { box-shadow: 0 0 0 0 rgba(20,184,166,0); }
}

/* ============================================================
   Layout: sidebar tabs + panel
   ============================================================ */

.calc-section { padding: 80px 0 100px; }

.calc-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

.calc-tabs {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
}

.calc-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-body);
  transition: background 0.15s ease, color 0.15s ease;
}

.calc-tab .calc-tab-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--teal-light);
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.calc-tab:hover { background: var(--bg-soft); color: var(--text-heading); }

.calc-tab.active {
  background: var(--navy);
  color: var(--white);
}

.calc-tab.active .calc-tab-icon {
  background: var(--teal);
  color: var(--navy);
}

/* ============================================================
   Panels
   ============================================================ */

.calc-panels { min-width: 0; }

.calc-panel { display: none; }
.calc-panel.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.calc-panel-inner {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calc-form {
  padding: 40px 36px;
}

.calc-form h2 { font-size: 22px; margin-bottom: 6px; }

.calc-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.field-group { margin-bottom: 26px; }

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.field-label-row label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
}

.field-value {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 8px;
  min-width: 74px;
  text-align: center;
}

.field-limits {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Range slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--teal) 0%, var(--teal) var(--fill, 40%), var(--border) var(--fill, 40%), var(--border) 100%);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--navy);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(11,37,69,0.25);
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--navy);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(11,37,69,0.25);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
}

/* ============================================================
   Results side
   ============================================================ */

.calc-results {
  background: var(--bg-soft);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid var(--border);
}

.donut-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-wrap svg circle {
  transition: stroke-dasharray 0.4s ease;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-center-value {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
}

.donut-center-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  max-width: 120px;
}

.result-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-body);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}

.result-row strong {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--text-heading);
}

.result-row .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
}

.dot.invested { background: var(--navy); }
.dot.returns { background: var(--teal); }
.dot.withdrawn { background: #F4A340; }
.dot.balance { background: var(--teal); }
.dot.principal { background: var(--navy); }
.dot.interest { background: #E4572E; }

.result-row.total {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.result-row.total strong { color: var(--white); font-size: 16px; }
.result-row.total span { font-weight: 600; }

.calc-results .btn { width: 100%; }

.calc-note {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
  .calc-layout { grid-template-columns: 1fr; }

  .calc-tabs {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
  }

  .calc-tab { flex: 0 0 auto; white-space: nowrap; }

  .calc-panel-inner { grid-template-columns: 1fr; }

  .calc-results { border-left: none; border-top: 1px solid var(--border); }
}

@media (max-width: 640px) {
  .calc-form, .calc-results { padding: 28px 22px; }
}


@media (max-width: 1024px) {
  .calc-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .calc-layout > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .calc-tabs {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .calc-tab {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 480px) {
  .calc-form, .calc-results {
    padding: 20px 14px !important;
  }
}
