
/* ============================================================
   USFinanceCalculators - Simple Interest Calculator
   Brand Palette & Titanium Mobile Lock
   ============================================================ */
:root {
  /* Brand Global Palette */
  --p1: #002868; /* Old Glory Blue */
  --p2: #00183F; /* Dark Navy */
  --p3: #1D1D1F; /* Headings (Charcoal) */
  --p4: #5F6368; /* Body text (Muted Gray) */
  --p5: #E0E4E8; /* Borders */
  --p6: #F7F9FC; /* Backgrounds */
  --p7: #FFFFFF; /* Cards */
  --p8: #BF0A30; /* Red / Alert / Negative */
  --p9: #00875A; /* Green / Action / Positive */

  /* Chart Variable Mapping for JS */
  --color-primary: var(--p1);
  --color-success: var(--p9);
  --color-warning: var(--p8);
  --color-blue: #006494;
  --color-gold: #d19900;
  --color-text: var(--p3);
  --color-text-muted: var(--p4);
  --color-divider: var(--p5);
  --color-surface-offset: var(--p6);

  /* Typography */
  --f-body: 'Inter', sans-serif;
  --f-head: 'Montserrat', sans-serif;

  /* Spacing */
  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px; --space-5: 32px;
  
  /* Shadows & Radii */
  --shadow-sm: 0 1px 4px rgba(0,40,104,0.08);
  --shadow-md: 0 4px 20px rgba(0,40,104,0.12);
  --rad: 12px;
}

/* Base Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--f-body);
  font-size: 16px;
  color: var(--p4);
  background: var(--p6);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: var(--p1); }

/* =========================================
   HERO SECTION
   ========================================= */
.page-hero {
  background: linear-gradient(135deg, var(--p2) 0%, var(--p1) 100%);
  padding: 40px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px; pointer-events: none;
}
.page-hero-inner {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.breadcrumb {
  font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 16px; font-weight: 500;
}
.breadcrumb a { color: #4ade80; }
.breadcrumb a:hover { text-decoration: underline; }
.page-hero h1 {
  font-family: var(--f-head); font-size: clamp(26px, 4vw, 36px);
  font-weight: 800; color: #fff; margin-bottom: 12px; letter-spacing: -0.5px;
}
.page-hero p {
  color: rgba(255,255,255,0.85); font-size: 15px; line-height: 1.65; max-width: 650px; margin: 0 auto;
}

/* =========================================
   MODULE TABS (TOP NAVIGATION)
   ========================================= */
.module-tabs-wrap {
  max-width: 1200px; margin: -24px auto 24px; padding: 0 24px; position: relative; z-index: 10;
}
.module-tabs {
  display: flex; gap: 8px; background: var(--p7); border: 1px solid var(--p5);
  padding: 8px; border-radius: var(--rad); box-shadow: var(--shadow-sm);
  overflow-x: auto; scrollbar-width: none;
}
.module-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1; min-width: max-content; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border: none; background: transparent; border-radius: 8px;
  font-family: var(--f-head); font-size: 13px; font-weight: 700; color: var(--p4);
  cursor: pointer; transition: all 0.2s;
}
.tab-btn:hover { background: var(--p6); color: var(--p1); }
.tab-btn.active { background: var(--p1); color: #fff; box-shadow: var(--shadow-sm); }
.tab-number {
  display: flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  background: rgba(0,0,0,0.1); border-radius: 50%; font-size: 11px;
}
.tab-btn.active .tab-number { background: rgba(255,255,255,0.2); }

/* =========================================
   MAIN LAYOUT & CARDS
   ========================================= */
#main-content {
  max-width: 1200px; margin: 0 auto 60px; padding: 0 24px;
}
.module-panel { display: none; }
.module-panel.active { display: block; animation: fade 0.3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.calc-card {
  background: var(--p7); border: 1px solid var(--p5); border-radius: var(--rad);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.calc-card-header {
  padding: 24px 32px 20px; border-bottom: 1px solid var(--p5);
}
.calc-card-header h2 {
  font-family: var(--f-head); font-size: 20px; font-weight: 800; color: var(--p1); margin-bottom: 8px;
}
.calc-card-header p { font-size: 14px; color: var(--p4); }

.calc-card-body {
  display: grid; grid-template-columns: 380px 1fr; gap: 32px; padding: 32px;
}

/* =========================================
   FORM CONTROLS (LEFT PANEL)
   ========================================= */
.form-grid, .form-grid-3 { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; }
.form-label {
  font-size: 12.5px; font-weight: 600; color: var(--p3);
  margin-bottom: 6px; font-family: var(--f-head); letter-spacing: 0.2px;
}
.form-hint { font-size: 11px; color: var(--p4); margin-top: 6px; line-height: 1.4; }

.input-wrap {
  display: flex; align-items: center; border: 1.5px solid var(--p5);
  border-radius: 8px; background: var(--p6); overflow: hidden; transition: all 0.2s;
}
.input-wrap:focus-within { border-color: var(--p1); box-shadow: 0 0 0 3px rgba(0,40,104,0.1); background: var(--p7); }
.input-prefix, .input-suffix {
  padding: 0 12px; font-weight: 700; color: var(--p4); background: var(--p5); height: 100%; display: flex; align-items: center;
}
.form-input, .form-select {
  width: 100%; border: none; background: transparent; padding: 10px 12px;
  font-family: var(--f-body); font-size: 14px; color: var(--p3); font-weight: 500; outline: none;
}
select.form-select { border: 1.5px solid var(--p5); border-radius: 8px; background: var(--p6); }
select.form-select:focus { border-color: var(--p1); background: var(--p7); }

/* Toggle Group */
.toggle-group { display: flex; background: var(--p6); border: 1px solid var(--p5); border-radius: 8px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.toggle-group input[type="radio"] { display: none; }
.toggle-group label {
  flex: 1; text-align: center; padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font-family: var(--f-head); font-size: 11.5px; font-weight: 700; color: var(--p4); transition: all 0.2s;
}
.toggle-group label:hover { color: var(--p1); }
.toggle-group input[type="radio"]:checked + label {
  background: var(--p1); color: #fff; box-shadow: var(--shadow-sm);
}

/* Actions */
.calc-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--p5);
}
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 8px; font-family: var(--f-head); font-size: 13.5px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; border: none; outline: none;
}
.btn-primary { background: var(--p9); color: #fff; box-shadow: 0 4px 14px rgba(0,135,90,0.25); flex: 1; min-width: 140px; }
.btn-primary:hover { background: #006b47; transform: translateY(-1px); }
.btn-secondary { background: var(--p7); border: 1.5px solid var(--p5); color: var(--p1); }
.btn-secondary:hover { border-color: var(--p1); background: var(--p6); }
.btn-ghost { background: transparent; color: var(--p1); border: 1.5px dashed var(--p1); }
.btn-ghost:hover { background: rgba(0,40,104,0.05); }
.btn-sm { padding: 8px 12px; font-size: 12px; }

/* =========================================
   RESULTS PANEL (RIGHT PANEL)
   ========================================= */
.results-panel { display: flex; flex-direction: column; }
.result-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; height: 100%; min-height: 300px; color: var(--p4);
  background: var(--p6); border: 1.5px dashed var(--p5); border-radius: 12px;
}
.result-empty svg { color: var(--p1); margin-bottom: 12px; opacity: 0.5; }
.result-empty p { font-size: 14px; font-weight: 500; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--p6); border: 1px solid var(--p5); border-radius: 10px; padding: 16px; }
.kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--p4); letter-spacing: 0.5px; margin-bottom: 6px; }
.kpi-value { font-family: var(--f-head); font-size: 22px; font-weight: 800; color: var(--p3); margin-bottom: 4px; line-height: 1; }
.kpi-value.positive { color: var(--p9); }
.kpi-value.negative { color: var(--p8); }
.kpi-value.accent { color: var(--p1); }
.kpi-sub { font-size: 11px; color: var(--p4); }

.formula-box {
  background: rgba(0,40,104,0.04); border: 1px solid rgba(0,40,104,0.1);
  padding: 14px 16px; border-radius: 8px; text-align: center; margin-bottom: 24px;
}
.formula-box p { font-family: 'Courier New', Courier, monospace; font-size: 13px; font-weight: 600; color: var(--p1); }
.formula-box strong { font-size: 15px; }

/* Insight / Alerts */
.insight-box {
  display: flex; gap: 12px; padding: 16px; border-radius: 8px; margin-bottom: 24px; font-size: 13px; line-height: 1.6; border: 1px solid;
}
.insight-box.success { background: rgba(0,135,90,0.06); border-color: rgba(0,135,90,0.2); color: #065f46; }
.insight-box.warning { background: rgba(191,10,48,0.06); border-color: rgba(191,10,48,0.2); color: #7f1d1d; }
.insight-box.info { background: rgba(0,40,104,0.06); border-color: rgba(0,40,104,0.2); color: #1e3a5f; }
.insight-box strong { font-family: var(--f-head); }

/* Comparisons */
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.compare-card { background: var(--p7); border: 1px solid var(--p5); border-radius: 10px; padding: 16px; box-shadow: var(--shadow-sm); }
.compare-card.winner { border-color: var(--p9); box-shadow: 0 0 0 1px var(--p9); }
.compare-card h4 { font-family: var(--f-head); font-size: 14px; font-weight: 800; color: var(--p1); margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.badge-green { background: rgba(0,135,90,0.1); color: var(--p9); }
.badge-teal { background: rgba(1,105,111,0.1); color: #01696f; }
.compare-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--p6); font-size: 13px; font-weight: 600; color: var(--p3); }
.compare-row:last-child { border-bottom: none; }
.compare-row span:first-child { color: var(--p4); font-weight: 500; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--p5); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 500px; text-align: left; }
.data-table th { background: var(--p6); padding: 12px 14px; font-family: var(--f-head); color: var(--p1); font-size: 11px; text-transform: uppercase; border-bottom: 2px solid var(--p5); }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--p5); color: var(--p3); font-weight: 500; font-variant-numeric: tabular-nums; }
.highlight-row { background: rgba(0,135,90,0.05); }

/* Charts */
.chart-wrap { border: 1px solid var(--p5); border-radius: 10px; padding: 16px; background: var(--p7); }
.chart-title { font-family: var(--f-head); font-size: 13px; font-weight: 700; color: var(--p3); margin-bottom: 16px; text-align: center; }
.chart-canvas-wrap { position: relative; width: 100%; height: 260px; }

/* Footer */
.site-footer { background: var(--p6); border-top: 1px solid var(--p5); padding: 32px 24px; text-align: center; margin-top: 40px; }
.site-footer-inner p { font-size: 12px; color: var(--p4); margin-bottom: 8px; }

/* =========================================================
   ABSOLUTE TITANIUM MOBILE LOCK
   ========================================================= */
@media screen and (max-width: 860px) {
  html, body { max-width: 100% !important; overflow-x: hidden !important; }
  
  /* Hero & Tabs Restraint */
  .page-hero { padding: 32px 16px !important; }
  .page-hero h1 { font-size: 26px !important; }
  .module-tabs-wrap { padding: 0 16px !important; margin-top: -16px !important; }

  /* Break Side-by-Side Card Layout */
  #main-content { padding: 0 16px !important; width: 100% !important; box-sizing: border-box !important; }
  .calc-card-body { 
    grid-template-columns: 1fr !important; padding: 16px !important; gap: 24px !important;
  }
  .calc-card-header { padding: 20px 16px 16px !important; }
  
  /* Restrain Grids */
  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid-3 { display: flex !important; flex-direction: column !important; }
  .kpi-grid, .comparison-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  
  /* Force Inputs inside view */
  .input-wrap, input, select { max-width: 100% !important; box-sizing: border-box !important; }
  
  /* Buttons */
  .calc-actions { flex-direction: column !important; }
  .btn { width: 100% !important; }
  .btn-sm { padding: 12px !important; font-size: 13.5px !important; }
  
  /* Tables */
  .table-wrap { display: block !important; width: 100% !important; max-width: 100% !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
  
  /* Charts */
  .chart-canvas-wrap { height: 220px !important; }
}


/* ============================================================
   SECTION SHARED COMPONENTS
   ============================================================ */
.section-wrap {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
}
.section-card {
  background: var(--p7);
  border: 1px solid var(--p5);
  border-radius: var(--rad);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--p5);
  background: var(--p7);
}
.section-head svg {
  width: 18px; height: 18px;
  color: var(--p1);
  flex-shrink: 0;
}
.section-head h2 {
  font-family: var(--f-head);
  font-size: 17px;
  font-weight: 800;
  color: var(--p1);
  margin: 0;
}
.section-body {
  padding: 28px;
}


/* ============================================================
   SECTION 1 — HOW IT WORKS (3-col steps)
   ============================================================ */
.hiw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.hiw-step {
  background: var(--p6);
  border: 1px solid var(--p5);
  border-radius: 10px;
  padding: 20px;
  position: relative;
}
.hiw-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--p1);
  color: #fff;
  border-radius: 50%;
  font-family: var(--f-head);
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.hiw-step h3 {
  font-family: var(--f-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--p3);
  margin-bottom: 8px;
}
.hiw-step p {
  font-size: 13px;
  color: var(--p4);
  line-height: 1.65;
  margin: 0;
}
.hiw-step .hiw-icon {
  font-size: 22px;
  margin-bottom: 10px;
  display: block;
}

/* Formula strip */
.formula-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0,40,104,0.04);
  border: 1px solid rgba(0,40,104,0.12);
  border-radius: 10px;
  padding: 18px 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.formula-var {
  text-align: center;
}
.formula-var .fv-sym {
  font-family: 'Courier New', monospace;
  font-size: 22px;
  font-weight: 800;
  color: var(--p1);
  display: block;
  line-height: 1.1;
}
.formula-var .fv-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--p4);
  font-family: var(--f-head);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.formula-op {
  font-family: 'Courier New', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--p4);
  margin-bottom: 10px;
}

/* Module summary cards */
.module-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.module-summary-card {
  background: var(--p6);
  border: 1px solid var(--p5);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ms-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--p1);
  color: #fff;
  font-family: var(--f-head);
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ms-text h4 {
  font-family: var(--f-head);
  font-size: 12px;
  font-weight: 700;
  color: var(--p3);
  margin-bottom: 3px;
}
.ms-text p {
  font-size: 11.5px;
  color: var(--p4);
  line-height: 1.5;
  margin: 0;
}


/* ============================================================
   SECTION 2 — REAL-WORLD EXAMPLES (tabbed)
   ============================================================ */
.examples-tabs {
  display: flex;
  gap: 6px;
  background: var(--p6);
  border: 1px solid var(--p5);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.examples-tabs::-webkit-scrollbar { display: none; }
.ex-tab-btn {
  flex: 1;
  min-width: max-content;
  padding: 8px 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: var(--f-head);
  font-size: 12px;
  font-weight: 700;
  color: var(--p4);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.ex-tab-btn:hover { color: var(--p1); }
.ex-tab-btn.active { background: var(--p1); color: #fff; }

.ex-panel { display: none; }
.ex-panel.active { display: block; animation: fade 0.25s ease; }

.example-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.example-scenario {
  background: var(--p6);
  border: 1px solid var(--p5);
  border-radius: 10px;
  padding: 20px;
}
.example-scenario h3 {
  font-family: var(--f-head);
  font-size: 14px;
  font-weight: 800;
  color: var(--p1);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.example-scenario h3 span { font-size: 18px; }
.example-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--p5);
  font-size: 13px;
}
.example-row:last-child { border-bottom: none; }
.example-row .er-label { color: var(--p4); font-weight: 500; }
.example-row .er-value { font-weight: 700; color: var(--p3); font-family: var(--f-head); font-size: 13px; }
.example-row .er-value.green { color: var(--p9); }
.example-row .er-value.blue { color: var(--p1); }
.example-row .er-value.red { color: var(--p8); }

.example-insight {
  background: rgba(0,40,104,0.04);
  border: 1px solid rgba(0,40,104,0.12);
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  color: var(--p3);
  line-height: 1.65;
}
.example-insight strong { color: var(--p1); font-family: var(--f-head); }


/* ============================================================
   SECTION 3 — PRO TIPS (accordion)
   ============================================================ */
.tips-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--p5);
  border-radius: 10px;
  overflow: hidden;
}
.tip-item {}
.tip-toggle {
  width: 100%;
  background: var(--p7);
  border: none;
  border-bottom: 1px solid var(--p5);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.tip-item:last-child .tip-toggle { border-bottom: none; }
.tip-toggle:hover { background: var(--p6); }
.tip-toggle.open { background: rgba(0,40,104,0.03); }
.tip-icon-wrap {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}
.tip-toggle-text {
  flex: 1;
  font-family: var(--f-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--p3);
  line-height: 1.3;
}
.tip-toggle-arrow {
  width: 18px; height: 18px;
  color: var(--p4);
  transition: transform 0.25s;
  flex-shrink: 0;
}
.tip-toggle.open .tip-toggle-arrow { transform: rotate(180deg); }

.tip-body {
  display: none;
  padding: 0 20px 16px 62px;
  background: rgba(0,40,104,0.02);
  border-bottom: 1px solid var(--p5);
  animation: fade 0.2s ease;
}
.tip-item:last-child .tip-body { border-bottom: none; }
.tip-body.open { display: block; }
.tip-body p {
  font-size: 13px;
  color: var(--p4);
  line-height: 1.75;
  margin-bottom: 10px;
}
.tip-body p:last-child { margin-bottom: 0; }
.tip-body strong { color: var(--p3); font-weight: 600; }
.tip-body a { color: var(--p1); font-weight: 600; text-decoration: none; }
.tip-body a:hover { text-decoration: underline; }

/* Tip category badges */
.tip-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--f-head);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 8px;
}
.badge-navy   { background: rgba(0,40,104,0.1);  color: var(--p1); }
.badge-green  { background: rgba(0,135,90,0.1);  color: var(--p9); }
.badge-red    { background: rgba(191,10,48,0.1); color: var(--p8); }
.badge-gold   { background: rgba(209,153,0,0.12); color: #a37900; }


/* ============================================================
   SECTION 4 — FAQ (accordion, 2-col layout)
   ============================================================ */
.faq-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  align-items: start;
}
.faq-col {}
.faq-item {
  border-bottom: 1px solid var(--p5);
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 15px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  font-family: var(--f-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--p3);
  line-height: 1.4;
  transition: color 0.15s;
}
.faq-q:hover { color: var(--p1); }
.faq-q.open { color: var(--p1); }
.faq-q-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--p6);
  border: 1px solid var(--p5);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--p1);
  transition: all 0.2s;
  margin-top: 1px;
}
.faq-q.open .faq-q-icon {
  background: var(--p1);
  color: #fff;
  border-color: var(--p1);
}
.faq-a {
  display: none;
  padding: 0 0 15px 30px;
  font-size: 13px;
  color: var(--p4);
  line-height: 1.75;
  animation: fade 0.2s ease;
}
.faq-a.open { display: block; }
.faq-a strong { color: var(--p3); font-weight: 600; }
.faq-a a { color: var(--p1); font-weight: 600; text-decoration: none; }
.faq-a a:hover { text-decoration: underline; }

/* FAQ search */
.faq-search-wrap {
  position: relative;
  margin-bottom: 20px;
}
.faq-search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--p4);
  pointer-events: none;
}
.faq-search {
  width: 100%;
  border: 1.5px solid var(--p5);
  border-radius: 8px;
  padding: 10px 12px 10px 36px;
  font-family: var(--f-body);
  font-size: 13.5px;
  color: var(--p3);
  background: var(--p6);
  outline: none;
  transition: all 0.2s;
}
.faq-search:focus {
  border-color: var(--p1);
  background: var(--p7);
  box-shadow: 0 0 0 3px rgba(0,40,104,0.1);
}
.faq-count-bar {
  font-size: 12px;
  color: var(--p4);
  margin-bottom: 16px;
  font-weight: 500;
}
.faq-count-bar strong { color: var(--p1); }


/* ============================================================
   TITANIUM MOBILE LOCK — All New Sections
   ============================================================ */
@media screen and (max-width: 860px) {
  .section-wrap      { padding: 0 16px !important; }
  .section-body      { padding: 16px !important; }
  .section-head      { padding: 16px !important; }
  .hiw-grid          { grid-template-columns: 1fr !important; gap: 12px !important; }
  .module-summary-grid { grid-template-columns: 1fr 1fr !important; }
  .example-layout    { grid-template-columns: 1fr !important; gap: 14px !important; }
  .faq-layout        { grid-template-columns: 1fr !important; gap: 0 !important; }
  .formula-strip     { gap: 8px !important; padding: 14px 16px !important; }
  .formula-var .fv-sym { font-size: 18px !important; }
  .tip-body          { padding-left: 20px !important; }
  .examples-tabs     { gap: 4px !important; }
  .ex-tab-btn        { padding: 8px 10px !important; font-size: 11px !important; }
}
@media screen and (max-width: 480px) {
  .module-summary-grid { grid-template-columns: 1fr !important; }
  .formula-op        { display: none !important; }
  .formula-strip     { gap: 12px !important; justify-content: space-around !important; }
}


/* ============================================================
   RELATED CALCULATORS SECTION
   ============================================================ */
.related-section {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
}
.related-card-outer {
  background: var(--p7);
  border: 1px solid var(--p5);
  border-radius: var(--rad);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Section header — matches .section-head style */
.related-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--p5);
}
.related-head svg {
  width: 18px; height: 18px;
  color: var(--p1);
  flex-shrink: 0;
}
.related-head h2 {
  font-family: var(--f-head);
  font-size: 17px;
  font-weight: 800;
  color: var(--p1);
  margin: 0;
  flex: 1;
}
.related-head-count {
  font-family: var(--f-head);
  font-size: 11px;
  font-weight: 700;
  color: var(--p4);
  background: var(--p6);
  border: 1px solid var(--p5);
  padding: 3px 10px;
  border-radius: 20px;
}

/* Grid: 3 columns × 3 rows */
.rel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--p5);
}

/* Each card is a full anchor */
a.rel-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  background: var(--p7);
  text-decoration: none;
  transition: background 0.15s;
  position: relative;
  overflow: hidden;
}
a.rel-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  transition: width 0.2s;
}
a.rel-card:hover {
  background: var(--p6);
}
a.rel-card:hover::before {
  width: 4px;
}

/* Accent bar colors per category */
a.rel-card.navy::before   { background: var(--p1); }
a.rel-card.red::before    { background: var(--p8); }
a.rel-card.green::before  { background: var(--p9); }
a.rel-card.gold::before   { background: #d19900; }

/* Icon circle */
.rel-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.navy  .rel-icon { background: rgba(0,40,104,0.08); }
.red   .rel-icon { background: rgba(191,10,48,0.07); }
.green .rel-icon { background: rgba(0,135,90,0.08); }
.gold  .rel-icon { background: rgba(209,153,0,0.1); }

/* Text block */
.rel-text { flex: 1; min-width: 0; }
.rel-name {
  font-family: var(--f-head);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.navy  .rel-name { color: var(--p1); }
.red   .rel-name { color: var(--p8); }
.green .rel-name { color: var(--p9); }
.gold  .rel-name { color: #a37900; }

.rel-desc {
  font-size: 12px;
  color: var(--p4);
  line-height: 1.55;
  margin-bottom: 8px;
}
.rel-tag {
  display: inline-block;
  font-family: var(--f-head);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 8px;
  border-radius: 10px;
}
.navy  .rel-tag { background: rgba(0,40,104,0.08);  color: var(--p1); }
.red   .rel-tag { background: rgba(191,10,48,0.08); color: var(--p8); }
.green .rel-tag { background: rgba(0,135,90,0.08);  color: var(--p9); }
.gold  .rel-tag { background: rgba(209,153,0,0.1);  color: #a37900; }

/* Arrow icon in name row */
.rel-arrow {
  width: 14px; height: 14px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  color: var(--p4);
}
a.rel-card:hover .rel-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* View All CTA bar */
.related-cta {
  padding: 16px 28px;
  border-top: 1px solid var(--p5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--p6);
}
.related-cta p {
  font-size: 13px;
  color: var(--p4);
  margin: 0;
}
.related-cta p strong { color: var(--p3); }
.rel-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--p1);
  color: #fff;
  font-family: var(--f-head);
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.18s, transform 0.18s;
  white-space: nowrap;
}
.rel-cta-btn:hover { background: var(--p2); transform: translateY(-1px); }
.rel-cta-btn svg { width: 13px; height: 13px; }

/* ── MOBILE RESPONSIVE ── */
@media screen and (max-width: 860px) {
  .related-section   { padding: 0 16px !important; }
  .related-head      { padding: 16px !important; flex-wrap: wrap; gap: 8px; }
  .rel-grid          { grid-template-columns: 1fr 1fr !important; }
  a.rel-card         { padding: 16px !important; gap: 10px !important; }
  .rel-icon          { width: 34px !important; height: 34px !important; font-size: 16px !important; }
  .rel-name          { font-size: 12px !important; }
  .rel-desc          { font-size: 11.5px !important; }
  .related-cta       { padding: 14px 16px !important; }
}
@media screen and (max-width: 540px) {
  .rel-grid          { grid-template-columns: 1fr !important; }
  .rel-arrow         { opacity: 1 !important; }
}

/* ============================================================
   SIMPLE INTEREST CALCULATOR — LEGAL DISCLAIMER + GOV LINKS
   ============================================================ */
.si-disclaimer-section {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
}
.si-disclaimer-card {
  background: var(--p7);
  border: 1px solid var(--p5);
  border-radius: var(--rad);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Section header */
.si-disc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--p5);
}
.si-disc-head svg {
  width: 18px; height: 18px;
  color: var(--p1);
  flex-shrink: 0;
}
.si-disc-head h2 {
  font-family: var(--f-head);
  font-size: 17px;
  font-weight: 800;
  color: var(--p1);
  margin: 0;
}

/* Two-col grid: left disclaimer, right gov links */
.si-disc-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  padding: 28px;
}

/* ── LEFT: DISCLAIMER ── */
.si-disc-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(191,10,48,0.04);
  border: 1px solid rgba(191,10,48,0.15);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.si-disc-alert-icon { font-size: 19px; flex-shrink: 0; line-height: 1; margin-top: 1px; }
.si-disc-alert-text {
  font-size: 13px;
  color: var(--p3);
  line-height: 1.65;
  font-weight: 500;
}
.si-disc-alert-text strong { color: var(--p8); }

.si-disc-body p {
  font-size: 13px;
  color: var(--p4);
  line-height: 1.75;
  margin-bottom: 12px;
}
.si-disc-body p:last-child { margin-bottom: 0; }
.si-disc-body strong { color: var(--p3); font-weight: 600; }
.si-disc-body a { color: var(--p1); font-weight: 600; text-decoration: none; }
.si-disc-body a:hover { text-decoration: underline; }

/* Editorial pills */
.si-ed-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--p5);
}
.si-ed-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--p6);
  border: 1px solid var(--p5);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--p3);
  font-family: var(--f-head);
}
.si-ed-pill svg { width: 11px; height: 11px; color: var(--p9); flex-shrink: 0; }

/* Last reviewed badge */
.si-reviewed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,135,90,0.07);
  border: 1px solid rgba(0,135,90,0.2);
  color: var(--p9);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  margin-top: 12px;
  font-family: var(--f-head);
}
.si-reviewed svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ── RIGHT: GOV AUTHORITY LINKS ── */
.si-gov-block {
  background: var(--p6);
  border: 1px solid var(--p5);
  border-radius: 10px;
  overflow: hidden;
  align-self: start;
}
.si-gov-header {
  background: var(--p2);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.si-gov-header svg { width: 14px; height: 14px; color: rgba(255,255,255,0.75); flex-shrink: 0; }
.si-gov-header span {
  font-family: var(--f-head);
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.si-gov-list { padding: 4px 0; }

.si-gov-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--p5);
  text-decoration: none;
  transition: background 0.15s;
}
.si-gov-link:last-child { border-bottom: none; }
.si-gov-link:hover { background: rgba(0,40,104,0.04); }

.si-gov-emoji {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: rgba(0,40,104,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.si-gov-text {}
.si-gov-name {
  font-family: var(--f-head);
  font-size: 12px;
  font-weight: 700;
  color: var(--p1);
  line-height: 1.3;
  margin-bottom: 2px;
}
.si-gov-desc {
  font-size: 11.5px;
  color: var(--p4);
  line-height: 1.45;
}
.si-gov-badge {
  display: inline-block;
  background: rgba(0,40,104,0.1);
  color: var(--p1);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--f-head);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── MOBILE ── */
@media screen and (max-width: 860px) {
  .si-disclaimer-section { padding: 0 16px !important; }
  .si-disc-grid   { grid-template-columns: 1fr !important; gap: 20px !important; padding: 16px !important; }
  .si-disc-head   { padding: 16px !important; }
  .si-disc-body p { font-size: 12.5px !important; }
  .si-ed-pills    { gap: 6px !important; }
  .si-ed-pill     { font-size: 11px !important; }
}

/* =========================================================
   ABSOLUTE CONTAINMENT PATCH (MOBILE OVERFLOW FIX)
   ========================================================= */
@media screen and (max-width: 860px) {
  /* 1. Global Box Sizing Safety */
  *, *::before, *::after {
    box-sizing: border-box !important;
  }
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  /* 2. Lock every major container from blowing out */
  #main-content, .calc-card, .calc-card-body, .results-panel, 
  .comparison-grid, .compare-card, .chart-wrap, .insight-box, 
  .kpi-card, .table-wrap, .form-grid, .form-group, .calc-actions {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important; /* Critical to prevent Grid/Flex blowout */
  }
  
  /* 3. Force Flex Wraps to prevent text pushing the width */
  .compare-card h4 {
    flex-wrap: wrap !important;
    gap: 8px !important;
    line-height: 1.4 !important;
  }
  .compare-row {
    gap: 8px !important;
  }
  
  /* 4. Chart Containment */
  .chart-canvas-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  canvas {
    max-width: 100% !important;
  }
  
  /* 5. Prevent long text strings from breaking the box */
  .insight-box, .insight-box p, .kpi-value, .formula-box p {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }
}