/*
Theme Name: True Value Calc
Theme URI: https://truevaluecalc.local
Author: True Value Calc
Author URI: https://truevaluecalc.local
Description: A minimalist, professional calculator hub with dark navy aesthetics and full financial, health, math, and utility calculators.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: truevaluecalc
Tags: minimalist, calculators, dark, professional
*/

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
  --navy:       #0D1B3E;
  --navy-dark:  #080F24;
  --navy-mid:   #142247;
  --blue:       #1A3A6B;
  --accent:     #F5A623;
  --accent2:    #4FC3F7;
  --white:      #FFFFFF;
  --off-white:  #F4F6FA;
  --text:       #1E293B;
  --text-muted: #64748B;
  --border:     #E2E8F0;
  --card-bg:    #FFFFFF;
  --success:    #10B981;
  --danger:     #EF4444;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.14);
  --radius:     12px;
  --radius-sm:  8px;
  --font-head:  'Playfair Display', Georgia, serif;
  --font-body:  'DM Sans', 'Segoe UI', sans-serif;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-scroll-behavior: smooth; font-size: 16px; color-scheme: light; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--off-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
/* Override WordPress block-library/global-styles which force text-decoration:underline */
.site-header a,
.site-nav a,
.nav-dropdown a,
.dropdown-menu a,
.nav-cta,
.site-footer a,
.footer-brand a,
.footer-col a,
.footer-bottom a,
.footer-logo-link { text-decoration: none !important; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1,h2,h3,h4,h5 { font-family: var(--font-head); line-height: 1.2; }
h1 { font-size: clamp(2rem,5vw,3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem,3vw,2.25rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p  { line-height: 1.7; color: var(--text-muted); }

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section   { padding: 36px 0 64px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-32 { margin-bottom: 32px; }

/* ========================================
   SITE HEADER — Clean White Minimalist
   ======================================== */
.site-header {
  background: #FFFFFF;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #EEF1F6;
  box-shadow: 0 2px 16px rgba(13,27,62,0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  max-width: 1260px;
  margin: 0 auto;
}

/* ── LOGO ──────────────────────────────── */
.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(245,166,35,0.35));
  transition: filter var(--transition), transform var(--transition);
}
.site-logo:hover .logo-mark {
  filter: drop-shadow(0 6px 16px rgba(245,166,35,0.55));
  transform: translateY(-1px);
}
.logo-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 3px;
}
.logo-name {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.3px;
  line-height: 1;
}
.logo-name span { color: var(--accent); }
.logo-tag {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #94A3B8;
  line-height: 1;
}

/* ── NAV ───────────────────────────────── */
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav > a, .nav-dropdown > a {
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 13px;
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}
.site-nav > a:hover, .nav-dropdown > a:hover {
  color: var(--navy);
  background: #F1F5F9;
}
.nav-dropdown { position: relative; }
.nav-dropdown > a::after { content: ' ▾'; font-size: 0.68em; opacity: 0.55; }

/* Invisible bridge — fills the gap so mouse doesn't lose hover */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: -10px;
  right: -10px;
  height: 16px; /* covers any gap between trigger and menu */
  background: transparent;
  z-index: 199;
}

/* Dropdown menu — top: 100% with padding-top for visual gap, zero dead zone */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;          /* flush — no gap, bridge above covers it */
  left: 0;
  background: #FFFFFF;
  border: 1px solid #E8EDF4;
  border-radius: 12px;
  padding: 8px;
  padding-top: 16px;  /* visual breathing room — gap is inside, not outside */
  min-width: 210px;
  box-shadow: 0 12px 40px rgba(13,27,62,0.12), 0 2px 8px rgba(13,27,62,0.06);
  z-index: 200;
  /* Smooth open/close animation */
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
/* JS-controlled open state — avoids CSS :hover gap problem entirely */
.nav-dropdown.open .dropdown-menu,
.nav-dropdown:hover .dropdown-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: #374151;
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
}
.dropdown-menu a:hover {
  background: #F8FAFF;
  color: var(--navy);
  padding-left: 16px;
}

/* CTA button */
.nav-cta {
  background: linear-gradient(135deg, var(--accent) 0%, #F97316 100%) !important;
  color: white !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  padding: 9px 18px !important;
  border-radius: 50px !important;
  letter-spacing: 0.2px !important;
  box-shadow: 0 4px 14px rgba(245,166,35,0.35) !important;
  transition: var(--transition) !important;
  margin-left: 8px !important;
}
.nav-cta:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(245,166,35,0.5) !important;
  background: linear-gradient(135deg, #F5A623 0%, #EA6D0A 100%) !important;
}

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; padding: 11px; cursor: pointer; border-radius: 8px; transition: background var(--transition); touch-action: manipulation; }
.hamburger:hover { background: #F1F5F9; }
.hamburger span { display: block; width: 22px; height: 2px; background: #374151; border-radius: 2px; transition: var(--transition); }

/* Mobile nav */
@media (max-width: 900px) {
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .site-nav.open {
    position: fixed;
    top: 70px; left: 0; right: 0; bottom: 0;
    background: white;
    padding: 20px;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow-y: auto;
    border-top: 1px solid #EEF1F6;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  }
  .site-nav.open > a,
  .site-nav.open .nav-dropdown > a { color: #1E293B; font-size: 1rem; padding: 12px 16px; }
  .site-nav.open .dropdown-menu { display: block; position: static; box-shadow: none; border: none; background: #F8FAFF; margin-top: 4px; padding: 4px; width: 100%; min-width: 0; opacity: 1; transform: none; pointer-events: auto; }
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, #1A3A6B 100%);
  padding: 52px 24px 48px;       /* much shorter — calculators appear on first view */
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(245,166,35,0.08) 0%, transparent 60%),
              radial-gradient(circle at 70% 30%, rgba(79,195,247,0.08) 0%, transparent 50%);
}
.hero::after {
  display: none;                  /* remove the curved wave — straight edge */
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,166,35,0.15);
  border: 1px solid rgba(245,166,35,0.3);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 50px;
  margin-bottom: 18px;
}
.hero h1 { color: var(--white); margin-bottom: 14px; position: relative; }
.hero h1 span { color: var(--accent); }
.hero p { color: rgba(255,255,255,0.7); max-width: 560px; margin: 0 auto 28px; font-size: 1rem; position: relative; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; }
.btn-primary {
  background: var(--accent);
  color: var(--navy-dark);
  font-weight: 700;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 20px rgba(245,166,35,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(245,166,35,0.5); }
.btn-outline {
  background: transparent;
  color: white;
  font-weight: 600;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: var(--transition);
  border: 1.5px solid rgba(255,255,255,0.3);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); }
.hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin-top: 36px;              /* tighter gap above stats */
  position: relative;
  flex-wrap: wrap;
  padding-bottom: 4px;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; color: white; }
.hero-stat .label { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; margin-top: 3px; }

/* ========================================
   CATEGORY SECTION
   ======================================== */
.category-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.category-label::before { content: ''; display: block; width: 24px; height: 2px; background: var(--accent); }
.section-title { color: var(--text); margin-bottom: 8px; }
.section-subtitle { color: var(--text-muted); margin-bottom: 28px; font-size: 1.05rem; }

/* ========================================
   CALCULATOR CATEGORY BLOCKS
   ======================================== */
.calc-category { margin-bottom: 48px; }
.calc-category-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.cat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.cat-icon.financial { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }
.cat-icon.health    { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); }
.cat-icon.math      { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); }
.cat-icon.other     { background: linear-gradient(135deg, #F3E8FF, #E9D5FF); }
.cat-title-group { flex: 1; }
.cat-name { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: var(--text); }
.cat-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.cat-count { font-size: 0.8rem; color: var(--text-muted); background: var(--border); padding: 3px 10px; border-radius: 50px; text-decoration: none; transition: var(--transition); }
a.cat-count:hover { background: var(--accent); color: #fff; }

/* ========================================
   CALCULATOR CARDS
   ======================================== */
.calc-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
.calc-card {
  background: var(--card-bg);
  border: 1.5px solid #B8C9DC;
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(13,27,62,0.07), 0 0 0 0.5px rgba(13,27,62,0.04);
}
.calc-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--card-accent, var(--accent)), transparent);
  opacity: 0;
  transition: var(--transition);
}
.calc-card:hover {
  border-color: #8FAABF;
  box-shadow: 0 8px 28px rgba(13,27,62,0.13), 0 0 0 1px rgba(13,27,62,0.06);
  transform: translateY(-4px);
}
.calc-card:hover::before { opacity: 1; }
.card-emoji {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 16px;
  position: relative;
}
.card-emoji.fin  { background: linear-gradient(135deg, #FEF9EE, #FEF3C7); }
.card-emoji.hlth { background: linear-gradient(135deg, #F0FDF4, #D1FAE5); }
.card-emoji.math { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); }
.card-emoji.misc { background: linear-gradient(135deg, #FDF4FF, #F3E8FF); }
.card-title { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.card-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 20px; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.tag.fin  { background: #FEF3C7; color: #92400E; }
.tag.hlth { background: #D1FAE5; color: #065F46; }
.tag.math { background: #DBEAFE; color: #1E40AF; }
.tag.misc { background: #F3E8FF; color: #6B21A8; }
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  transition: var(--transition);
}
.card-cta .arrow { transition: var(--transition); }
.calc-card:hover .card-cta .arrow { transform: translateX(4px); }
a.calc-card-link { display: flex; flex-direction: column; color: inherit; }
a.calc-card-link .calc-card { flex: 1; display: flex; flex-direction: column; }
a.calc-card-link .card-cta { margin-top: auto; }

/* ========================================
   CALCULATOR PAGE STYLES
   ======================================== */
.calc-page-hero {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  padding: 60px 24px 80px;
  text-align: center;
  position: relative;
}
.calc-page-hero h1 { color: white; margin-bottom: 12px; }
.calc-page-hero p { color: rgba(255,255,255,0.7); max-width: 500px; margin: 0 auto; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}
.breadcrumb a { color: var(--accent); }
.breadcrumb span { color: rgba(255,255,255,0.3); }
.calc-wrapper {
  max-width: 1000px;
  margin: -40px auto 60px;
  padding: 0 24px;
  position: relative;
}
.calc-panel {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.calc-panel-header {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.calc-panel-header .icon { font-size: 1.8rem; }
.calc-panel-header h2 { color: white; font-size: 1.3rem; margin: 0; }
.calc-panel-header p { color: rgba(255,255,255,0.6); font-size: 0.85rem; margin: 4px 0 0; }
.calc-body { display: grid; grid-template-columns: 1fr 1fr; }
.calc-inputs { padding: 32px; border-right: 1px solid var(--border); }
.calc-results { padding: 32px; background: var(--off-white); }
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}
.form-label span { color: #94a3b8; font-weight: 400; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-prefix, .input-suffix {
  position: absolute;
  font-size: 0.88rem;
  color: #64748b;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
.input-prefix { left: 14px; }
.input-suffix { right: 14px; }
.form-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #dde3ed;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #1e293b;
  background: #ffffff;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  outline: none;
  min-height: 48px;
}
.form-input::placeholder { color: #a8b5c8; }
.form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
  background: #ffffff;
}
.form-input.has-prefix { padding-left: 34px; }
.form-input.has-suffix { padding-right: 42px; }

/* Remove native number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* Override browser autofill green/yellow tint */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 60px #ffffff inset !important;
  -webkit-text-fill-color: #1e293b !important;
  transition: background-color 9999s ease-in-out 0s;
}

.form-select {
  width: 100%;
  padding: 13px 44px 13px 16px;
  border: 1.5px solid #dde3ed;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #1e293b;
  background: #ffffff;
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232563eb' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  min-height: 48px;
  cursor: pointer;
}
.form-select:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.10); }
.form-range {
  width: 100%;
  accent-color: var(--navy);
  margin-top: 8px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #E2E8F0;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.form-range::-webkit-slider-runnable-track {
  height: 4px;
  background: #E2E8F0;
  border-radius: 2px;
}
.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--navy);
  cursor: pointer;
  margin-top: -8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.form-range::-moz-range-track {
  height: 4px;
  background: #E2E8F0;
  border-radius: 2px;
}
.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--navy);
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.range-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.btn-calc {
  width: 100%;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.btn-calc:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(13,27,62,0.3); }

/* ─────────────────────────────────────────────────────────────────────────
   CALCULATE-BUTTON VISUAL FEEDBACK — premium 4-layer effect
   1) Ripple expands from click point on the button (Material-style)
   2) Button taps (scale + brightness flash)
   3) Result panel: warm multi-layer glow + diagonal shimmer sweep
   4) Result value: elastic overshoot bounce + brief accent glow
   ───────────────────────────────────────────────────────────────────────── */

/* The button needs to clip the ripple span */
.btn-calc { position: relative; overflow: hidden; }

/* The ripple — a span injected by JS at the click point */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, rgba(245,166,35,0.35) 60%, transparent 100%);
  transform: scale(0);
  opacity: 0.85;
  pointer-events: none;
  animation: btnRippleExpand 0.75s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
  will-change: transform, opacity;
}
@keyframes btnRippleExpand {
  to { transform: scale(18); opacity: 0; }
}

/* Button tap — quick scale-in + brightness flash */
@keyframes btnTap {
  0%   { transform: scale(1);     filter: brightness(1); }
  35%  { transform: scale(0.965); filter: brightness(1.18) saturate(1.1); }
  100% { transform: scale(1);     filter: brightness(1); }
}
.btn-calc.btn-tapped { animation: btnTap 0.4s ease; }
.btn-calc.btn-tapped:hover { transform: scale(0.965); }

/* Result panel — clip the shimmer */
.calc-results { position: relative; overflow: hidden; }

/* Chart.js canvases must never exceed their container on any viewport */
.calc-results canvas { display: block; max-width: 100%; }

/* Diagonal shimmer sweep (a moving light gradient) */
.calc-results::before {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 80%; height: 100%;
  background: linear-gradient(115deg,
    transparent 0%,
    rgba(255,255,255,0.04) 20%,
    rgba(255,255,255,0.22) 50%,
    rgba(255,255,255,0.04) 80%,
    transparent 100%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transform: skewX(-12deg);
}
.calc-results.result-flash::before {
  animation: shimmerSweep 1.05s cubic-bezier(0.3, 0.6, 0.4, 1);
}
@keyframes shimmerSweep {
  0%   { left: -120%; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { left: 120%;  opacity: 0; }
}

/* Warm multi-layer glow on the panel */
@keyframes resultGlow {
  0%   { box-shadow: 0 0 0 0 rgba(245,166,35,0),
                     0 0 0 0 rgba(245,166,35,0); }
  40%  { box-shadow: 0 0 0 14px rgba(245,166,35,0.18),
                     0 18px 60px -10px rgba(245,166,35,0.45); }
  100% { box-shadow: 0 0 0 0 rgba(245,166,35,0),
                     0 0 0 0 rgba(245,166,35,0); }
}
.calc-results.result-flash {
  animation: resultGlow 1.1s ease-out;
  border-radius: 12px;
}

/* Result value — elastic overshoot bounce with accent text-shadow glow */
@keyframes resultValueBounce {
  0%   { transform: scale(1);    text-shadow: 0 0 0 rgba(245,166,35,0); }
  30%  { transform: scale(1.14); text-shadow: 0 0 22px rgba(245,166,35,0.75),
                                              0 0 8px rgba(255,255,255,0.6); }
  55%  { transform: scale(0.96); }
  75%  { transform: scale(1.03); }
  100% { transform: scale(1);    text-shadow: 0 0 0 rgba(245,166,35,0); }
}
.calc-results.result-flash .result-value {
  display: inline-block; /* required for transform to apply */
  animation: resultValueBounce 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--accent);
  transition: color 0.5s ease 0.3s; /* color fades back after bounce */
}

/* Respect reduced-motion users — skip animations entirely */
@media (prefers-reduced-motion: reduce) {
  .btn-calc.btn-tapped,
  .calc-results.result-flash,
  .calc-results.result-flash::before,
  .calc-results.result-flash .result-value,
  .btn-ripple { animation: none !important; }
}
.btn-reset {
  width: 100%;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 12px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  border: 1.5px solid var(--border);
  margin-top: 8px;
  touch-action: manipulation;
}
.btn-reset:hover { border-color: var(--text-muted); color: var(--text); }
.result-main {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin-bottom: 20px;
  color: white;
}
.result-label { font-size: 0.8rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-bottom: 8px; }
.result-value { font-family: var(--font-body); font-size: 2.8rem; font-weight: 700; color: white; }
.result-sub { font-size: 0.85rem; color: rgba(255,255,255,0.5); margin-top: 8px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.result-item {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.result-item-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.result-item-value { font-family: var(--font-body); font-size: 1.2rem; font-weight: 700; color: var(--text); }
.result-item-value.positive { color: var(--success); }
.result-item-value.negative { color: var(--danger); }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-text { color: var(--text-muted); font-size: 0.9rem; }

/* ========================================
   AMORTIZATION TABLE
   ======================================== */
.amort-section { padding: 32px; border-top: 1px solid var(--border); overflow-x: auto; }
.amort-section h3 { font-size: 1rem; margin-bottom: 16px; }
.amort-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 480px; }
.amort-table th {
  background: var(--navy);
  color: white;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}
.amort-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.amort-table tr:last-child td { border-bottom: none; }
.amort-table tr:hover td { background: var(--off-white); }
.amort-table td.positive { color: var(--success); font-weight: 600; }
.amort-table td.muted { color: var(--text-muted); }

/* ========================================
   BMI METER
   ======================================== */
.bmi-meter { margin: 20px 0; }
.bmi-bar {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, #3B82F6 0%, #10B981 35%, #F59E0B 60%, #EF4444 100%);
  position: relative;
  margin-bottom: 8px;
}
.bmi-marker {
  position: absolute;
  top: -5px;
  width: 24px; height: 24px;
  background: white;
  border: 3px solid var(--navy);
  border-radius: 50%;
  transform: translateX(-50%);
  transition: var(--transition);
}
.bmi-scale { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); }
.bmi-category {
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 12px;
}

/* ========================================
   SCIENTIFIC CALCULATOR — minimalist white/blue
   ======================================== */
.sci-panel { overflow: hidden; }
.sci-outer { padding: 20px; background: #f0f4ff; }
.sci-calc  { border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1.5px #93c5fd, 0 0 0 5px rgba(37,99,235,0.08), 0 8px 32px rgba(37,99,235,0.14); border: none; }

/* Display — deep blue gradient for contrast */
.sci-display {
  background: linear-gradient(150deg, #1e40af 0%, #1e293b 100%);
  padding: 16px 20px 20px;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.sci-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.sci-mode-badge {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.sci-mem-badge {
  background: rgba(196,181,253,0.18);
  color: #c4b5fd;
  border: 1px solid rgba(196,181,253,0.3);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.67rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s;
}
.sci-mem-badge.active { opacity: 1; }

/* Calculation history */
.sci-history {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  min-height: 16px;
  margin-bottom: 4px;
}
.sci-hist-item {
  color: rgba(255,255,255,0.3);
  font-size: 0.69rem;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: right;
}
.sci-hist-item:last-child { color: rgba(255,255,255,0.48); }
.sci-hist-item:hover { color: rgba(255,255,255,0.8); }

.sci-expr {
  color: rgba(255,255,255,0.45);
  font-size: 0.88rem;
  min-height: 20px;
  text-align: right;
  margin-bottom: 4px;
  font-family: 'Courier New', monospace;
  word-break: break-all;
}
.sci-val {
  color: #ffffff;
  font-size: 2.6rem;
  font-weight: 300;
  text-align: right;
  font-family: 'Courier New', monospace;
  word-break: break-all;
  line-height: 1.1;
  transition: color 0.15s;
}
.sci-val.error { color: #fca5a5; }

/* Button grid — clean white */
.sci-btns {
  background: #ffffff;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.sci-row-sep {
  grid-column: span 5;
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}
.sci-zero { grid-column: span 2; }

.sci-btn {
  height: 48px;
  padding: 0;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid transparent;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: filter 0.12s, transform 0.08s;
  line-height: 1;
}
.sci-btn:hover  { filter: brightness(0.93); }
.sci-btn:active { transform: scale(0.95); filter: brightness(0.86); }

/* Button color categories */
.sci-btn.num   { background: #f8fafc; color: #1e293b; border-color: #e2e8f0; }
.sci-btn.op    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.sci-btn.fn    { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; font-size: 0.75rem; }
.sci-btn.const { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; font-size: 0.8rem; }
.sci-btn.eq    { background: #2563eb; color: #ffffff; border-color: #2563eb; font-size: 1.1rem; font-weight: 700; }
.sci-btn.clear { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.sci-btn.del   { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.sci-btn.mem   { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; font-size: 0.8rem; }

/* Keyboard hints */
.sci-hints {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 0.73rem;
  color: #64748b;
}
.sci-hints kbd {
  display: inline-block;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.69rem;
  font-family: 'Courier New', monospace;
  color: #334155;
  margin-right: 3px;
  box-shadow: 0 1px 0 #cbd5e1;
}
.sci-deg-note { color: #0369a1; font-weight: 600; }

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.6);
  padding: 60px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand .logo { font-family: var(--font-head); font-size: 1.4rem; color: white; margin-bottom: 12px; }
.footer-brand p { font-size: 0.875rem; line-height: 1.7; margin-bottom: 20px; }
.footer-col h4 { color: white; font-size: 0.9rem; font-weight: 600; letter-spacing: 0.5px; margin-bottom: 16px; }
.footer-col a { display: block; color: rgba(255,255,255,0.55); font-size: 0.875rem; padding: 4px 0; transition: var(--transition); }
.footer-col a:hover { color: var(--accent); padding-left: 4px; }
.footer-col .footer-view-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: rgba(255,255,255,0.85) !important;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 0 !important;
  border-bottom: none;
  transition: color var(--transition);
}
.footer-col .footer-view-all:hover {
  color: #fff !important;
  padding-left: 0 !important;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: rgba(255,255,255,0.45); }
.footer-bottom-links a:hover { color: white; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
  .calc-body { grid-template-columns: 1fr; }
  .calc-inputs { border-right: none; border-bottom: 1px solid var(--border); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .site-nav.open {
    display: flex; flex-direction: column;
    align-items: stretch;
    position: fixed; top: 68px; left: 0; right: 0; bottom: 0;
    background: var(--navy-dark);
    padding: 16px 20px 32px;
    gap: 0;
    z-index: 99;
    overflow-y: auto;
  }
  /* Top-level nav links — white on dark */
  .site-nav.open > a,
  .site-nav.open .nav-dropdown > a {
    color: rgba(255,255,255,0.92) !important;
    font-size: 1rem;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
  }
  .site-nav.open > a:hover,
  .site-nav.open .nav-dropdown > a:hover {
    background: rgba(255,255,255,0.07);
    color: #fff !important;
    border-radius: 8px;
  }
  /* Dropdown sub-menu items */
  .site-nav.open .dropdown-menu {
    display: block;
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin: 2px 0 10px;
    padding: 4px 0;
    width: 100%;
    min-width: 0;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .site-nav.open .dropdown-menu a {
    color: rgba(255,255,255,0.72) !important;
    padding: 9px 16px;
    width: 100%;
    font-size: 0.88rem;
  }
  .site-nav.open .dropdown-menu a:hover {
    background: rgba(255,255,255,0.09);
    color: #fff !important;
  }
  /* "All 52 Calculators" CTA button */
  .site-nav.open .nav-cta {
    color: white !important;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    margin-top: 12px;
    margin-left: 0 !important;
  }
  .hero { padding: 60px 24px 80px; }
  .section { padding: 48px 0; }
  .result-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 28px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .sci-btns { gap: 5px; }
  .sci-btn { height: 44px; font-size: 0.8rem; }
  .sci-btn.fn { font-size: 0.68rem; }
  .sci-outer { padding: 14px; }
  /* Debt consolidation: collapse 3-col input grid to single column */
  .dco-row-grid { grid-template-columns: 1fr !important; gap: 6px !important; }
}

/* ========================================
   ADSENSE AD SLOTS
   All slots use fixed pixel dimensions and overflow:hidden so live
   AdSense iframes can never exceed the reserved box (zero CLS / no
   content displacement when ads go live).
   ======================================== */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 32px auto;
  max-width: 100%;
  overflow: hidden;
}
.ad-slot ins.adsbygoogle,
.ad-slot .ad-placeholder { display: block; max-width: 100%; }
.ad-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-weight: 500;
}
.ad-placeholder {
  border: 1.5px dashed #CBD5E1;
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-placeholder-inner {
  text-align: center;
  color: #94A3B8;
  padding: 16px;
}
.ad-placeholder-inner svg { margin: 0 auto 8px; display: block; color: #94A3B8; }
.ad-placeholder-inner strong { display: block; font-size: 0.8rem; color: #64748B; margin-bottom: 4px; }
.ad-placeholder-inner small  { font-size: 0.72rem; line-height: 1.5; }
.ad-slot--leaderboard { width: 100%; }
.ad-slot--rectangle   { width: auto; }
.ad-slot--square      { width: auto; }

/* ========================================
   SEO CONTENT SECTIONS
   ======================================== */
.seo-section { padding: 48px 0; border-top: 1px solid var(--border); }
.seo-section h2 { font-size: 1.5rem; margin-bottom: 16px; color: var(--text); }
.seo-section h3 { font-size: 1.1rem; margin: 24px 0 10px; color: var(--text); }
.seo-section p  { color: var(--text-muted); font-size: 0.95rem; line-height: 1.8; margin-bottom: 12px; }
.seo-section ul { margin: 12px 0 16px 20px; }
.seo-section ul li { color: var(--text-muted); font-size: 0.95rem; line-height: 1.8; list-style: disc; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; margin: 24px 0; }
.info-card { background: white; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 20px; }
.info-card .icon { font-size: 1.5rem; margin-bottom: 10px; }
.info-card h4  { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.info-card p   { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.faq-section   { padding: 48px 0; border-top: 1px solid var(--border); }
.faq-section h2 { font-size: 1.5rem; margin-bottom: 28px; color: var(--text); }
.faq-item   { border: 1.5px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: white; border: none; cursor: pointer;
  padding: 18px 20px; font-size: 0.95rem; font-weight: 600; color: var(--text);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  transition: background var(--transition);
}
.faq-q:hover { background: var(--off-white); }
.faq-q .chevron { font-size: 1rem; transition: transform var(--transition); flex-shrink:0; color: var(--text-muted); }
.faq-q.open .chevron { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 20px 18px; font-size: 0.9rem; color: var(--text-muted); line-height: 1.8; border-top: 1px solid var(--border); padding-top: 14px; }
.faq-a.open { display: block; }

@media(max-width:680px){
  .ad-slot--leaderboard ins, .ad-slot--leaderboard .ad-placeholder { width: 320px !important; height: 50px !important; }
}

/* ========================================
   SIDEBAR AD LAYOUT — 3 column
   ======================================== */
.calc-page-wrap {
  display: grid;
  grid-template-columns: 170px 1fr 170px;
  gap: 0;
  align-items: start;
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 8px 80px; /* 80px bottom clearance — sticky sidebar never touches footer */
}
.calc-sidebar {
  padding-top: 20px;
  position: sticky;
  top: 80px;
  align-self: start;       /* don't auto-stretch — keep sticky math clean */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  /* Cap so very tall ad columns can never overlap the footer on short viewports */
  max-height: calc(100vh - 100px);
  overflow: hidden;
}
.calc-sidebar .ad-slot {
  margin: 0;
  width: 160px;
  height: 600px;            /* reserve exact AdSense 160×600 footprint */
  overflow: hidden;         /* hard guard against live ad overflow */
}
.calc-sidebar .ad-label {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.calc-sidebar .ad-placeholder {
  width: 160px !important;
  height: 600px !important;
  min-height: 0 !important;
  border: 1.5px dashed #CBD5E1;
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calc-sidebar .ad-placeholder-inner {
  text-align: center;
  padding: 12px 8px;
  color: #94A3B8;
}
.calc-sidebar .ad-placeholder-inner strong {
  display: block;
  font-size: 0.72rem;
  color: #64748B;
  margin-bottom: 4px;
}
.calc-sidebar .ad-placeholder-inner small {
  font-size: 0.65rem;
  line-height: 1.5;
  display: block;
}
.calc-sidebar ins.adsbygoogle {
  display: inline-block !important;
  width: 160px !important;
  height: 600px !important;
  min-height: 0 !important;
  max-width: 160px !important;
  max-height: 600px !important;
}
.calc-main { min-width: 0; padding-bottom: 64px; }

@media (max-width: 1100px) {
  /* Below this width the 160px ad won't fit comfortably — drop the rails */
  .calc-page-wrap { grid-template-columns: 1fr; padding-bottom: 48px; }
  .calc-sidebar { display: none; }
}

/* ========================================
   VALIDATION STATES
   ======================================== */
.field-error {
  border-color: #ef4444 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.10) !important;
}
.field-ok {
  border-color: #dde3ed !important;
  background: #ffffff !important;
}
.v-err {
  color: #DC2626;
  font-size: 0.775rem;
  margin-top: 5px;
  display: none;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.v-err.show { display: flex; }
.calc-alert {
  background: #FEF2F2;
  border: 1.5px solid #FECACA;
  border-radius: 8px;
  padding: 12px 16px;
  color: #DC2626;
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.calc-alert.show { display: flex; }
.calc-alert-ok {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #065F46;
}

/* ========================================
   DATE OF BIRTH DROPDOWN PICKER
   ======================================== */
.dob-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #94A3B8;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.dob-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1.5fr;
  gap: 10px;
  margin-bottom: 4px;
}
.dob-col { display: flex; flex-direction: column; gap: 6px; }
.dob-col-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #94A3B8;
  text-transform: uppercase;
}
.dob-select {
  appearance: none;
  -webkit-appearance: none;
  background: #F1F5FB;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  width: 100%;
}
.dob-select:focus {
  border-color: var(--navy);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(13,27,62,0.08);
}
.dob-select option[value=""] { color: #94A3B8; }
.dob-select.has-value { background-color: #fff; border-color: #CBD5E1; }

.dob-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 10px;
}
.dob-reset-btn {
  font-size: 0.85rem;
  color: #64748B;
  background: none;
  border: 1.5px solid #E2E8F0;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dob-reset-btn:hover { border-color: #94A3B8; color: var(--text); background: #F8FAFF; }
.dob-today-btn {
  font-size: 0.85rem;
  color: var(--accent);
  background: rgba(245,166,35,0.08);
  border: 1.5px solid rgba(245,166,35,0.3);
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dob-today-btn:hover { background: rgba(245,166,35,0.15); border-color: var(--accent); }

/* ========================================
   UNIVERSAL TOOLTIP SYSTEM
   ======================================== */
.tvc-tip {
  position: fixed;
  background: #0D1B3E;
  color: #fff;
  font-size: 0.76rem;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  padding: 7px 11px;
  border-radius: 7px;
  max-width: 220px;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
  white-space: normal;
  text-align: left;
}
.tvc-tip.visible {
  opacity: 1;
  transform: translateY(0);
}
.tvc-tip-arrow {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #0D1B3E;
  transform: rotate(45deg);
  bottom: -4px;
  left: 50%;
  margin-left: -4px;
}
.tvc-tip.tip-above .tvc-tip-arrow { bottom: -4px; top: auto; }
.tvc-tip.tip-below .tvc-tip-arrow { top: -4px; bottom: auto; }

/* ── Custom Time Picker ───────────────────────────────────────── */
.tpick { display: flex; align-items: center; gap: 8px; }
.tpick-h, .tpick-m {
  appearance: none;
  -webkit-appearance: none;
  background: #F1F5FB url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230D1B3E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 11px 32px 11px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  width: auto;
  min-width: 68px;
}
.tpick-h:focus, .tpick-m:focus {
  outline: none;
  border-color: var(--navy);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(13,27,62,0.08);
}
.tpick-h:hover, .tpick-m:hover { border-color: #94A3B8; }
.tpick-sep {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  flex-shrink: 0;
  margin: 0 2px;
}
.tpick-ampm {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.tpick-ap {
  padding: 11px 13px;
  background: white;
  border: none;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  letter-spacing: 0.03em;
}
.tpick-ap:first-child { border-right: 1px solid var(--border); }
.tpick-ap.active { background: var(--navy); color: #fff; }
.tpick-ap:hover:not(.active) { background: var(--off-white); color: var(--navy); }

/* Highlight interactive elements on hover */
.form-input:hover, .form-select:hover, .dob-select:hover {
  border-color: #94a3b8;
}
.form-input:focus:hover, .form-select:focus:hover { border-color: #2563eb; }
.btn-calc:hover, .btn-reset:hover,
.dob-today-btn:hover, .dob-reset-btn:hover {
  opacity: 0.92;
}

/* ── Sitemap Page ────────────────────────────────────────────── */
.sitemap-wrap {
  padding: 48px 24px 72px;
  max-width: 1000px;
}
.sitemap-section {
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.sitemap-section:last-child { border-bottom: none; }
.sitemap-cat-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  color: var(--navy);
  margin-bottom: 6px;
}
.sitemap-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1rem;
  flex-shrink: 0;
}
.sitemap-cat-icon.fin  { background: #FEF3C7; }
.sitemap-cat-icon.hlth { background: #D1FAE5; }
.sitemap-cat-icon.math { background: #DBEAFE; }
.sitemap-cat-icon.misc { background: #EDE9FE; }
.sitemap-cat-icon.cat  { background: #F1F5F9; }
.sitemap-cat-icon.comp { background: #F0F9FF; }
.sitemap-cat-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.sitemap-cat-desc a { color: var(--navy); font-weight: 600; text-decoration: underline; }
.sitemap-cat-desc a:hover { color: var(--accent); }
.sitemap-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px 24px;
}
.sitemap-links li a {
  display: block;
  padding: 7px 0 7px 16px;
  color: #374151;
  font-size: 0.9rem;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, padding-left 0.15s;
  position: relative;
}
.sitemap-links li a::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
  transition: color 0.15s;
}
.sitemap-links li a:hover {
  color: var(--navy);
  border-left-color: var(--accent);
  padding-left: 20px;
}
.sitemap-links li a:hover::before { color: var(--accent); }
@media (max-width: 680px) {
  .sitemap-links { grid-template-columns: 1fr 1fr; }
  .sitemap-wrap { padding: 32px 16px 56px; }
}
@media (max-width: 440px) {
  .sitemap-links { grid-template-columns: 1fr; }
}

/* ── Footer SVG Logo ─────────────────────────────────────────── */
.footer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.footer-logo-name {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.footer-logo-name span { color: #F5A623; }
.footer-logo-sub {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.32);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
  font-family: var(--font-body);
}

/* ========================================
   CALCULATOR CARD ICONS — High Contrast
   ======================================== */
.card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.card-icon-wrap i { font-size: 20px; line-height: 1; }

/* Category colour variants */
.i-amber  { background: #BA7517; color: #FAEEDA; }
.i-amber2 { background: #854F0B; color: #FAC775; }
.i-green  { background: #3B6D11; color: #EAF3DE; }
.i-teal   { background: #0F6E56; color: #E1F5EE; }
.i-blue   { background: #185FA5; color: #E6F1FB; }
.i-purple { background: #534AB7; color: #EEEDFE; }
.i-coral  { background: #993C1D; color: #FAECE7; }

/* Category header badge */
.cat-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cat-badge i { font-size: 18px; line-height: 1; }

/* Card tag pills */
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0 10px; }
.tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.t-amber  { background: #FAEEDA; color: #633806; }
.t-green  { background: #EAF3DE; color: #27500A; }
.t-teal   { background: #E1F5EE; color: #085041; }
.t-blue   { background: #E6F1FB; color: #0C447C; }
.t-purple { background: #EEEDFE; color: #3C3489; }
.t-coral  { background: #FAECE7; color: #712B13; }



/* ── Calculator cards — responsive breakpoints ── */
@media (max-width: 900px)  { .calc-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 540px)  { .calc-cards { grid-template-columns: 1fr; } }

/* ── Footer logo — same classes as header, colors overridden for dark bg ── */
.footer-logo-link { margin-bottom: 16px; }
.footer-logo-link .logo-name { color: #ffffff; }
.footer-logo-link .logo-tag  { color: rgba(255,255,255,0.4); }
.footer-logo-link:hover .logo-mark {
  filter: drop-shadow(0 6px 16px rgba(245,166,35,0.6));
  transform: translateY(-1px);
}

/* ========================================
   TABLET & MOBILE BREAKPOINTS
   ======================================== */

/* iPad landscape (1024px) */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}
/* grid-3 stays 3 columns above 680px (related calc tiles).
   Below 680px it collapses to 1 column via the 680px block above. */

/* iPad portrait (768px) */
@media (max-width: 768px) {
  .info-grid { grid-template-columns: 1fr; }
  .amort-section { padding: 20px 16px; }
}

/* Small phones (375px) */
@media (max-width: 420px) {
  .container { padding: 0 16px; }
  .calc-panel { border-radius: var(--radius-sm); }
  .calc-panel-header { padding: 16px 20px; }
  .calc-inputs, .calc-results { padding: 16px 20px; }
  .result-grid { grid-template-columns: 1fr; }
  .result-value { font-size: 2.2rem; }
  .sci-btns { gap: 4px; padding: 10px; }
  .sci-btn { height: 38px; font-size: 0.72rem; border-radius: 6px; }
  .sci-btn.fn { font-size: 0.6rem; }
  .sci-outer { padding: 10px; }
  .sci-hints { gap: 8px; font-size: 0.68rem; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Ensure mobile nav has smooth slide transition */
@media (max-width: 900px) {
  .site-nav {
    transition: opacity 0.2s ease;
  }
  .site-nav.open {
    animation: navSlideIn 0.2s ease forwards;
  }
}
@keyframes navSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Safe area insets for iPhone notch / Dynamic Island */
@supports (padding: max(0px)) {
  .site-header { padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); }
  .site-footer { padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); }
}

/* ========================================
   SEARCH BAR
   ======================================== */
.calc-search-wrap {
  position: relative;
  max-width: 620px;
  margin: 0 auto 48px;
}
.calc-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
  opacity: 0.5;
}
.calc-search-input {
  width: 100%;
  padding: 15px 50px 15px 48px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.calc-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245,166,35,0.12);
}
.calc-search-input::placeholder { color: var(--text-muted); }
.calc-search-input::-webkit-search-cancel-button { display: none; }
.calc-search-clear {
  display: none;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  border: none;
  transition: background var(--transition), color var(--transition);
}
.calc-search-clear:hover { background: #cbd5e1; color: var(--text); }
.search-no-results {
  display: none;
  text-align: center;
  padding: 56px 24px;
}
.search-no-results .nri { font-size: 2.8rem; margin-bottom: 16px; }
.search-no-results h3 { margin-bottom: 8px; font-size: 1.3rem; color: var(--text); }
.search-no-results p  { color: var(--text-muted); max-width: 360px; margin: 0 auto; }

/* ========================================
   CATEGORY — hidden extra cards & view-all
   ======================================== */
.cat-extra { display: none; }

.cat-view-all {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 20px;
  gap: 12px;
}
.cat-view-all a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1.5px solid var(--accent);
  padding: 8px 20px;
  border-radius: 50px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.cat-view-all a:hover {
  background: var(--accent);
  color: #fff;
}

/* ========================================
   DROPDOWN — divider & view-all item
   ======================================== */
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 8px;
}
.dropdown-view-all {
  color: var(--accent) !important;
  font-weight: 600 !important;
}
.dropdown-view-all:hover {
  background: #fff8ed !important;
  color: #c97f00 !important;
  padding-left: 16px !important;
}

/* ========================================
   CATEGORY LISTING PAGE
   ======================================== */
.cat-page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  padding: 56px 0 48px;
  color: #fff;
}
.cat-page-hero h1 { color: #fff; margin-bottom: 12px; }
.cat-page-hero p  { color: rgba(255,255,255,0.75); max-width: 560px; }
.cat-page-hero .breadcrumb a { color: rgba(255,255,255,0.6); }
.cat-page-hero .breadcrumb span { color: rgba(255,255,255,0.4); }
.cat-page-hero .breadcrumb > span:last-child { color: rgba(255,255,255,0.9); }

/* Search inside hero (dark bg) */
.hero-search {
  margin: 40px auto 0;
  max-width: 660px;
}
.hero-search .calc-search-input {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.85);
  border-radius: 50px;
  color: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18), 0 0 0 0px rgba(245,166,35,0);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.hero-search .calc-search-input::placeholder {
  color: rgba(255,255,255,0.60);
}
.hero-search .calc-search-input:focus {
  background: rgba(255,255,255,0.14);
  border-color: #fff;
  box-shadow: 0 4px 24px rgba(0,0,0,0.22), 0 0 0 4px rgba(245,166,35,0.28);
  outline: none;
}
.hero-search .calc-search-icon { color: rgba(255,255,255,0.75); }
.hero-search .calc-search-clear {
  background: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.35);
}
.hero-search .calc-search-clear:hover {
  background: rgba(255,255,255,0.38);
  color: #fff;
}

@media (max-width: 680px) {
  .calc-search-wrap { margin-bottom: 32px; }
  .calc-search-input { font-size: 0.95rem; padding: 13px 44px 13px 44px; }
  .calc-search-input::placeholder { font-size: 0.9rem; }
  .cat-view-all { justify-content: center; }
  .hero-search { margin-top: 28px; }
}

/* ========================================
   LEGAL / INFO PAGES — minimalist typography
   (About, Privacy Policy, Terms of Use)
   ======================================== */
.legal-page {
  max-width: 760px;
  margin: 32px auto 64px;
  padding: 0 24px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}
.legal-page p,
.legal-page li {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}
.legal-page h2 {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 28px 0 10px;
  color: var(--navy, var(--text));
}
.legal-page ul {
  padding-left: 20px;
  margin: 8px 0 14px;
}
.legal-page li { margin-bottom: 6px; }
.legal-page strong { font-weight: 600; color: var(--text); }
.legal-page a {
  color: var(--navy, #0D1B3E);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-page a:hover { color: var(--accent, #F5A623); }
.legal-page .legal-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.legal-page .legal-footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}
@media (max-width: 680px) {
  .legal-page { font-size: 0.88rem; }
  .legal-page p, .legal-page li { font-size: 0.88rem; }
  .legal-page h2 { font-size: 1rem; }
}

/* ========================================
   DEVICE & PERFORMANCE OPTIMIZATION
   All breakpoints tuned for:
     Desktop  1200px+
     iPad L   1024px
     iPad P    768–820px
     Phone L   568–768px
     Phone P   320–430px
   ======================================== */

/* ── Touch targets: 44px min (Apple HIG / WCAG 2.5.8) ── */
.form-input,
.form-select {
  min-height: 44px;
  touch-action: manipulation; /* eliminates 300ms tap delay + disables double-tap-zoom */
}

/* ── iOS Safari zoom fix: font-size < 16px triggers auto-zoom on focus ──
   Applies to every iPad and phone (≤ 1024px).
   Using !important because theme's base rule uses 0.95rem = 15.2px.      ── */
@media (max-width: 1024px) {
  .form-input,
  .form-select,
  .dob-select,
  .tpick-h,
  .tpick-m { font-size: 16px !important; }
}

/* ── Chart canvas: hard overflow guard on every device ── */
canvas { max-width: 100% !important; }
.calc-results canvas { display: block; max-width: 100%; }
[id$="-chart-wrap"],
[id$="-charts"] { overflow: hidden; }

/* ── Horizontal-scroll tables: smooth momentum on iOS ── */
.amort-section { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

/* ── Long result values: never overflow their card ── */
.result-value     { word-break: break-word; overflow-wrap: break-word; }
.result-item-value{ word-break: break-word; overflow-wrap: break-word; }

/* ── iPad portrait + tablet (≤ 860px): tighten calc layout ── */
@media (max-width: 860px) {
  .calc-page-hero       { padding: 36px 16px 56px; }
  .calc-wrapper         { padding: 0 12px; }
  .calc-inputs          { padding: 24px 20px; }
  .calc-results         { padding: 24px 20px; }
  .calc-panel-header    { padding: 18px 20px; }
  .result-value         { font-size: 2.2rem; }
  .result-main          { padding: 24px 20px; }
}

/* ── Phone landscape + small tablet (≤ 640px) ── */
@media (max-width: 640px) {
  .calc-inputs          { padding: 20px 16px; }
  .calc-results         { padding: 20px 16px; }
  .result-value         { font-size: 2rem; }
}

/* ── Phone portrait (≤ 480px): maximum space efficiency ── */
@media (max-width: 480px) {
  .calc-page-hero       { padding: 26px 12px 50px; }
  .calc-wrapper         { padding: 0 6px; margin-bottom: 40px; }
  .calc-inputs          { padding: 16px 14px; }
  .calc-results         { padding: 16px 14px; }
  .calc-panel-header    { padding: 14px 16px; gap: 10px; }
  .calc-panel-header .icon { font-size: 1.4rem; }
  .calc-panel-header h2 { font-size: 1.05rem; }
  .calc-panel-header p  { font-size: 0.78rem; }
  .result-value         { font-size: 1.8rem; }
  .result-main          { padding: 18px 14px; }
  .result-item          { padding: 12px 10px; }
  .result-item-value    { font-size: 1rem; }
  .result-item-label    { font-size: 0.7rem; }
  .form-group           { margin-bottom: 14px; }
  .btn-calc, .btn-reset { font-size: 0.92rem; }
  .seo-section          { padding: 32px 0; }
  .faq-section          { padding: 32px 0; }
  .faq-q                { padding: 14px 16px; font-size: 0.88rem; }
  .info-grid            { grid-template-columns: 1fr; }
  .grid-3               { grid-template-columns: 1fr; }
}
