/* ============================================================
   GuruCalc — Design System v2.0
   Built from scratch. Modern, clean, premium.
   ============================================================ */

/* ─── 1. TOKENS ─────────────────────────────────────────────── */
:root {
  /* Brand */
  --navy:        #1A237E;
  --navy-dark:   #0D1654;
  --navy-mid:    #283593;
  --purple:      #7C4DFF;
  --purple-dark: #5E35B1;
  --purple-soft: #EDE9FE;

  /* Semantic */
  --primary:     var(--navy);
  --accent:      var(--purple);
  --accent-light:var(--purple-soft);

  /* Surface */
  --bg:          #F0F4FF;
  --surface:     #FFFFFF;
  --surface-2:   #F8FAFF;
  --border:      #E4E8F5;

  /* Text */
  --text:        #0D1654;
  --text-2:      #3D4A7A;
  --text-muted:  #7B8BBD;

  /* Status */
  --green:       #00897B;
  --green-soft:  #E0F7F4;
  --red:         #C62828;
  --red-soft:    #FFEBEE;
  --orange:      #E65100;

  /* Shadows */
  --sh-xs: 0 1px 4px rgba(26,35,126,.06);
  --sh-sm: 0 2px 12px rgba(26,35,126,.08);
  --sh-md: 0 6px 28px rgba(26,35,126,.10);
  --sh-lg: 0 16px 48px rgba(26,35,126,.12);

  /* Shape */
  --r-xs: 6px;
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
  --t:    0.18s;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  /* Layout */
  --max-w: 1200px;
  --gap:   24px;
}

/* ─── 2. RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); font-size: 16px; }

/* ─── 3. LAYOUT ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* ─── 4. HEADER ──────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--sh-xs);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 60px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo img { height: 36px; width: auto; display: block; }
.logo-icon { font-size: 1.6rem; }
.logo-text  { font-size: 1.2rem; font-weight: 800; color: var(--navy); letter-spacing: -.5px; }

/* Nav */
.main-nav { display: none; }
.main-nav ul { display: flex; gap: 4px; }
.main-nav a {
  display: block;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-2);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.main-nav a:hover,
.main-nav a.active { background: var(--accent-light); color: var(--accent); text-decoration: none; }

/* Search */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0 14px;
  height: 38px;
  flex: 1;
  max-width: 280px;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,77,255,.12);
  background: var(--surface);
}
.search-box input {
  background: none;
  border: none;
  outline: none;
  font-size: .875rem;
  color: var(--text);
  width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 1rem; flex-shrink: 0; }

/* ── Header Right ── */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Dropdown (More menu) ── */
.main-nav .dropdown { position: relative; }
.dropdown-btn {
  display: block;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.dropdown-btn:hover { background: var(--accent-light); color: var(--accent); }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-md);
  min-width: 160px;
  z-index: 300;
  padding: 6px;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu li { list-style: none; }
.dropdown-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background var(--t);
}
.dropdown-menu a:hover { background: var(--accent-light); color: var(--accent); }

/* ── Language Switcher ── */
.lang-switcher { position: relative; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--t);
}
.lang-btn:hover { border-color: var(--accent); }
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-md);
  min-width: 170px;
  z-index: 300;
  padding: 6px;
}
.lang-switcher.open .lang-menu { display: block; }
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: .875rem;
  color: var(--text);
  text-decoration: none;
  transition: background var(--t);
}
.lang-menu a:hover,
.lang-menu a.active { background: var(--accent-light); color: var(--accent); text-decoration: none; }

/* ── Search Dropdown ── */
.search-box { position: relative; }
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-md);
  z-index: 400;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}
.search-dropdown.open { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  font-size: .875rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item:focus { background: var(--accent-light); outline: none; }
.search-result-cat {
  font-size: .75rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ── Hero Search Results ── */
.hero-search-wrap .search-dropdown {
  left: 0; right: 0;
  top: calc(100% + 8px);
  border-radius: var(--r);
  max-width: 520px;
  margin: 0 auto;
}

/* ── Hamburger ── */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all var(--t) var(--ease);
}

/* ── Mobile Header: prevent overflow on small screens ── */
.header-inner { flex-wrap: nowrap; overflow: hidden; }
.logo img { max-width: 120px; }
@media (max-width: 639px) {
  /* Hide search input text box on mobile — search is in the drawer */
  .search-box:not(.search-box-mobile) { display: none; }
}

/* Mobile nav drawer */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 195;
}
.mobile-nav {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0;
  max-height: calc(100vh - 60px);
  background: var(--surface);
  z-index: 200;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.mobile-nav-open .mobile-nav,
.mobile-nav-open .mobile-nav-overlay { display: block; }
.mobile-nav-list { list-style: none; padding: 8px 0; margin: 0; }
.mobile-nav-list li { border-bottom: 1px solid var(--border); }
.mobile-nav-list li:last-child { border-bottom: none; }
.mobile-nav a {
  display: block;
  padding: 14px 20px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.mobile-nav a:hover,
.mobile-nav a.active { background: var(--accent-light); color: var(--accent); text-decoration: none; }
.mobile-nav-search {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.search-box-mobile { max-width: 100%; position: relative; }

/* ─── 5. BREADCRUMB ──────────────────────────────────────────── */
.breadcrumb { padding: 12px 0; font-size: .8rem; color: var(--text-muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--text-muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.bc-sep { color: var(--border); }
.breadcrumb li:last-child { color: var(--text-2); font-weight: 600; }

/* ─── 6. TOOL HERO ───────────────────────────────────────────── */
.tool-hero {
  background: var(--surface);
  text-align: center;
  padding: 40px 20px 32px;
  border-bottom: 1px solid var(--border);
}
.tool-h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -.5px;
  margin-bottom: 10px;
}
.tool-intro {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── 7. TOOL PAGE GRID ──────────────────────────────────────── */
.tool-page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  padding: 24px 0 56px;
  align-items: start;
}
.tool-sidebar { display: none; }
.related-tools-mobile { display: block; }
.related-tools-desktop { display: none; }

/* ─── 8. CALCULATOR WIDGET ───────────────────────────────────── */
.calc-widget {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.calc-widget-title {
  padding: 18px 24px 16px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.calc-form {
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 0;
}
/* Slider widget: form has no padding — inner columns handle it */
.slider-calc-widget .calc-form { padding: 0; }
.slider-calc-widget .mode-toggle { margin: 16px 24px 0; }

/* ─── 9. MODE TOGGLE ─────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 4px;
  margin-bottom: 24px;
  gap: 3px;
}
.mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t) var(--ease);
  white-space: nowrap;
}
.mode-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--sh-xs);
}

/* ─── 10. SLIDER FIELD GROUP ─────────────────────────────────── */
.slider-group {
  margin-bottom: 28px;
}
.slider-group:last-of-type { margin-bottom: 20px; }

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.slider-header label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-2);
  flex: 1;
}

/* Value input box */
.slider-value-display {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.slider-value-display:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,77,255,.12);
}
.val-prefix,
.val-suffix {
  padding: 7px 10px;
  font-size: .8rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
}
.val-prefix { border-right: 1px solid var(--border); }
.val-suffix { border-left:  1px solid var(--border); }
.slider-num {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
  padding: 7px 8px;
  width: 80px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  text-align: right;
  height: auto;
}
.slider-num::-webkit-inner-spin-button,
.slider-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Select inside slider widget */
.slider-select {
  height: 38px;
  min-width: 130px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 32px 0 12px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237B8BBD'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--t) var(--ease);
}
.slider-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,77,255,.12);
}

/* ─── 11. RANGE SLIDER ───────────────────────────────────────── */
.slider-range-wrap { position: relative; }
.range-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, var(--accent) var(--pct, 40%), var(--border) var(--pct, 40%));
  border-radius: 99px;
  cursor: pointer;
  outline: none;
  transition: background .12s var(--ease);
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  background: var(--surface);
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(124,77,255,.25);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(124,77,255,.40);
}
.range-slider::-moz-range-thumb {
  width: 20px; height: 20px;
  background: var(--surface);
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(124,77,255,.25);
}
/* Min / Max labels below slider */
.slider-minmax {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── 12. SLIDER LAYOUT (2-col: inputs left, result panel right) */
.slider-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}
@media (min-width: 640px) {
  .slider-layout {
    grid-template-columns: 1fr 260px;
    gap: 0;
  }
}
@media (min-width: 900px) {
  .slider-layout { grid-template-columns: 1fr 300px; }
}

/* ── Slider inputs column ── */
.slider-inputs-col {
  padding: 24px 24px 20px;
  background: #F5F8FF;
}

/* ── Result Panel (right column) ── */
.result-panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
}
@media (max-width: 639px) {
  .result-panel {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

/* Primary result — highlighted box at top */
.rp-primary {
  background: #E8EEF8;
  border-radius: var(--r);
  padding: 18px 16px 16px;
  text-align: center;
}
.rp-primary-label {
  font-size: .82rem;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 8px;
  opacity: .8;
}
.rp-primary-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.5px;
  line-height: 1.1;
}
.rp-view-details {
  display: inline-block;
  margin-top: 8px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.rp-view-details:hover { text-decoration: underline; }

/* Donut inside result panel */
.rp-donut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.donut-wrap {
  position: relative;
  width: 150px; height: 150px;
  flex-shrink: 0;
}
.donut-ring {
  width: 150px; height: 150px;
  border-radius: 50%;
  background: conic-gradient(#CBD5E1 33%, var(--accent) 0);
  transition: background .3s var(--ease);
}
.donut-hole {
  position: absolute;
  top: 26px; left: 26px;
  width: 98px; height: 98px;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.donut-center-label {
  font-size: .6rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.donut-center-value {
  font-size: .82rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
  text-align: center;
}
.donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--text-2); }
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot.invested { background: #CBD5E1; }
.legend-dot.returns  { background: var(--accent); }

/* Other result values — inline rows (label left, value right) */
.rp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}
.rp-list-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.rp-list-item:last-child { border-bottom: none; }
.rp-list-label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
}
.rp-list-value {
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}

/* ─── 13. RESULT CARDS (kept for compatibility) ───────────────── */
.slider-summary { padding: 20px 24px 24px; background: var(--surface); }
.result-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.rc-count-2 { grid-template-columns: 1fr 1fr; }
.rc-count-3 { grid-template-columns: repeat(3, 1fr); }
.rc-count-4 { grid-template-columns: repeat(4, 1fr); }
.result-card { border-radius: var(--r-sm); padding: 14px 16px; background: var(--surface-2); border: 1.5px solid var(--border); }
.result-card.rc-accent { background: var(--purple-soft); border-color: rgba(124,77,255,.25); }
.result-card.rc-primary { background: var(--navy); border-color: var(--navy); }
.rc-label { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 6px; }
.result-card.rc-primary .rc-label { color: rgba(255,255,255,.65); }
.rc-value { display: block; font-size: 1.15rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.result-card.rc-primary .rc-value { color: #FFFFFF; font-size: 1.3rem; }

/* Invest / Apply Now CTA button */
.btn-invest {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 14px;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  width: 100%;
  text-align: center;
  text-decoration: none;
  transition: background var(--t) var(--ease), transform var(--t);
}
.btn-invest:hover { background: #283593; transform: translateY(-1px); text-decoration: none; color: #fff; }
.btn-invest:hover { background: #00695C; text-decoration: none; color: #fff; }

/* ─── 14. STANDARD FORM ──────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
.form-group label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-2);
}
.gc-input {
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 14px;
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  width: 100%;
  -webkit-appearance: none;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.gc-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,77,255,.12);
}
.gc-input:invalid { border-color: var(--red); }
select.gc-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237B8BBD'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 46px;
  padding: 0 24px;
  border-radius: var(--r-sm);
  font-size: .9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--t) var(--ease);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: .02em;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 10px rgba(26,35,126,.25);
}
.btn-primary:hover {
  background: var(--navy-dark);
  box-shadow: 0 4px 16px rgba(26,35,126,.35);
  text-decoration: none; color: #fff;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-affiliate {
  background: var(--green);
  color: #fff;
}
.btn-affiliate:hover { background: #00695C; text-decoration: none; color: #fff; }
.btn-icon {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xs);
  padding: 6px 10px;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t) var(--ease);
}
.btn-icon:hover { background: var(--bg); border-color: var(--accent); }

.calc-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.btn-calc { flex: 1; min-width: 140px; }
.btn-reset { min-width: 90px; }

.calc-error {
  margin-top: 12px;
  background: var(--red-soft);
  border: 1px solid rgba(198,40,40,.25);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--r-xs);
  font-size: .875rem;
  font-weight: 500;
}

/* Standard calc result box */
.calc-result {
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  padding: 20px;
  margin-top: 16px;
  animation: fadeUp .2s var(--ease);
}
@keyframes fadeUp {
  from { opacity:0; transform: translateY(6px); }
  to   { opacity:1; transform: translateY(0);   }
}
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.result-header h2 {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.result-actions { display: flex; gap: 6px; }
.result-content { display: flex; flex-direction: column; gap: 10px; }
/* Result rows (for complex results > 4 items) */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.result-row:last-child { border-bottom: none; padding-bottom: 0; }
.result-label { font-size: .875rem; color: var(--text-muted); }
.result-value { font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.result-value.primary-result { font-size: 1.5rem; color: var(--navy); }
.result-value.secondary { font-size: .95rem; color: var(--text); font-weight: 600; }

/* ─── 15. CONTENT SECTIONS ───────────────────────────────────── */
.content-section {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-xs);
  padding: 24px;
  margin-bottom: var(--gap);
}
.content-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-light);
  letter-spacing: -.2px;
}

/* Steps */
.steps-list { counter-reset: steps; display: flex; flex-direction: column; gap: 10px; }
.steps-list li {
  counter-increment: steps;
  padding: 12px 14px 12px 50px;
  position: relative;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: .9rem;
  color: var(--text-2);
  line-height: 1.6;
}
.steps-list li::before {
  content: counter(steps);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
}

/* Formula */
.formula-box {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.8;
}
.formula-box p { margin-bottom: 4px; }
.formula-box p:last-child { margin-bottom: 0; }

/* Example table */
.table-wrap { overflow-x: auto; border-radius: var(--r-sm); border: 1px solid var(--border); }
.example-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.example-table th {
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.example-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.example-table tr:last-child td { border-bottom: none; }
.example-table tr:nth-child(even) td { background: var(--surface-2); }

/* ─── 16. FAQ ─────────────────────────────────────────────────── */
.faq-item {
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color var(--t) var(--ease);
}
.faq-item:hover { border-color: rgba(124,77,255,.3); }
.faq-q {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: none;
  padding: 15px 18px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  transition: background var(--t) var(--ease);
}
.faq-q:hover,
.faq-q[aria-expanded="true"] { background: var(--accent-light); }
.faq-arrow {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 400;
  flex-shrink: 0;
  transition: transform var(--t) var(--ease);
}
.faq-q[aria-expanded="true"] .faq-arrow { transform: rotate(45deg); }
.faq-a {
  padding: 0 18px 15px;
  background: var(--surface);
}
.faq-a p { color: var(--text-muted); font-size: .875rem; line-height: 1.75; }

/* ─── 17. SCHEDULE / AMORTIZATION / CHART SECTION ────────────── */
.schedule-wrap {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  margin-bottom: var(--gap);
  animation: fadeUp .25s var(--ease);
}
.schedule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.schedule-head h2 {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0;
  border: none;
  padding: 0;
}
.schedule-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--t) var(--ease);
  letter-spacing: .03em;
}
.btn-pdf:hover { background: var(--navy-dark); }

/* Chart canvas */
.chart-container {
  position: relative;
  width: 100%;
  height: 260px;
  padding: 20px 20px 0;
}
@media (min-width: 640px) { .chart-container { height: 300px; } }

/* Schedule data table */
.schedule-table-wrap {
  overflow-x: auto;
  padding: 0 0 4px;
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  min-width: 460px;
}
.schedule-table thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 10px 16px;
  text-align: right;
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
}
.schedule-table thead th:first-child { text-align: left; }
.schedule-table tbody td {
  padding: 10px 16px;
  text-align: right;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.schedule-table tbody td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--navy);
}
.schedule-table tbody tr:last-child td {
  font-weight: 700;
  color: var(--navy);
  background: var(--surface-2);
}
.schedule-table tbody tr:hover td { background: var(--accent-light); }
.schedule-totals { padding: 12px 24px; font-size: .8rem; color: var(--text-muted); }

/* ─── 18. AFFILIATE CTA ──────────────────────────────────────── */
.affiliate-cta {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--r);
  padding: 24px;
  text-align: center;
  margin-bottom: var(--gap);
  color: #fff;
}
.affiliate-cta p { font-weight: 600; margin-bottom: 14px; opacity: .9; }

/* ─── 19. RELATED TOOLS ──────────────────────────────────────── */
.related-tools { margin-bottom: var(--gap); }
.related-tools h3 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.related-tool-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  transition: all var(--t) var(--ease);
}
.related-tool-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}
.related-tool-link::after { content: '→'; margin-left: auto; opacity: .4; font-size: .8rem; }

/* ─── 20. INCOME TAX COMPARISON ──────────────────────────────── */
.tax-compare-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}
.tax-compare-col {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 16px;
  border: 2px solid var(--border);
}
.tax-compare-col.recommended {
  border-color: var(--green);
  background: var(--green-soft);
}
.tax-col-title {
  font-weight: 700;
  font-size: .85rem;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.better-badge {
  background: var(--green);
  color: #fff;
  font-size: .65rem;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tax-row {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  padding: 5px 0;
  color: var(--text-2);
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.tax-row:last-child { border-bottom: none; font-weight: 700; font-size: .875rem; color: var(--text); }
.tax-better-msg {
  margin-top: 12px;
  background: var(--green-soft);
  border: 1px solid rgba(0,137,123,.2);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: .875rem;
  color: var(--green);
  font-weight: 600;
}

/* ─── 21. HOMEPAGE ───────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #4527A0 100%);
  color: #fff;
  padding: 56px 0 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1' fill='rgba(255,255,255,.06)'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: .78rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}
.hero-title {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.5px;
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,.75);
  max-width: 520px;
  margin: 0 auto 28px;
  line-height: 1.7;
}
.hero-search-wrap {
  max-width: 520px;
  margin: 0 auto 20px;
  position: relative;
}
.hero-search-icon {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}
.hero-search-wrap input {
  width: 100%;
  height: 52px;
  border-radius: 99px;
  border: none;
  padding: 0 120px 0 46px;
  font-size: 1rem;
  color: var(--text);
  box-shadow: var(--sh-lg);
  outline: none;
}
.hero-search-wrap input:focus { box-shadow: 0 0 0 3px rgba(124,77,255,.3), var(--sh-lg); }
.hero-search-btn {
  position: absolute;
  right: 6px; top: 6px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 0 20px;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t);
}
.hero-search-btn:hover { background: #6A3DE8; }
.hero-trust {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.hero-trust span {
  font-size: .8rem;
  color: rgba(255,255,255,.65);
  font-weight: 500;
}
.hero-trust span::before { content: '✓  '; color: rgba(255,255,255,.5); }

/* ─── HOMEPAGE SECTIONS ──────────────────────────────────────── */
.hp-section { padding: 32px 0; }
.hp-section-alt { background: var(--bg); }

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 20px;
  letter-spacing: -.3px;
}
.section-title span { color: var(--accent); }

/* ── Category Cards ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}
.category-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-left: 3px solid var(--cat-color, var(--accent));
  border-radius: var(--r);
  padding: 14px 16px;
  text-decoration: none;
  transition: all var(--t) var(--ease);
  display: flex;
  align-items: center;
  gap: 12px;
}
.category-card:hover {
  border-color: var(--cat-color, var(--accent));
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.cat-icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.cat-body { flex: 1; min-width: 0; }
.cat-name { display: block; font-weight: 700; font-size: .9rem; color: var(--text); }
.cat-desc { display: none; font-size: .75rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-count {
  flex-shrink: 0;
  background: var(--bg);
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
}

/* ── Popular Tool Cards ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}
.tool-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  text-decoration: none;
  transition: all var(--t) var(--ease);
  display: flex;
  align-items: center;
  gap: 10px;
}
.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
  text-decoration: none;
}
.tool-card-icon { font-size: 1.4rem; flex-shrink: 0; }
.tool-card-body { flex: 1; min-width: 0; }
.tool-card-name { display: block; font-size: .875rem; font-weight: 700; color: var(--text); }
.tool-card-cat  { display: block; font-size: .72rem; color: var(--text-muted); margin-top: 1px; }
.tool-card-arrow { color: var(--text-muted); font-size: .85rem; flex-shrink: 0; transition: color var(--t), transform var(--t); }
.tool-card:hover .tool-card-arrow { color: var(--accent); transform: translateX(3px); }

/* ── All Calculators list ── */
.cat-group { margin-bottom: 28px; }
.cat-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--cat-color, var(--border));
}
.cat-group-head h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.cat-view-all {
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.cat-view-all:hover { text-decoration: underline; }

.tools-list-grid { display: grid; grid-template-columns: 1fr; gap: 4px; }
.tool-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all var(--t) var(--ease);
  gap: 8px;
}
.tool-list-item:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  text-decoration: none;
}
.tli-name { font-size: .85rem; font-weight: 500; color: var(--text); }
.tli-arrow { font-size: .8rem; color: var(--text-muted); transition: color var(--t); }
.tool-list-item:hover .tli-arrow { color: var(--accent); }

/* ── Trust Section ── */
.trust-section {
  background: linear-gradient(135deg, var(--navy) 0%, #311B92 100%);
  padding: 40px 0;
  margin-top: 8px;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.trust-item {
  text-align: center;
  padding: 16px;
}
.trust-icon { font-size: 1.8rem; margin-bottom: 6px; }
.trust-num { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1.1; }
.trust-label { font-size: .78rem; color: rgba(255,255,255,.65); margin-top: 4px; font-weight: 500; }

/* ── Category Page ── */
.cat-page-hero {
  background: var(--cat-color, var(--navy));
  color: #fff;
  padding: 32px 0 36px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.cat-page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,.0) 0%, rgba(0,0,0,.35) 100%);
  pointer-events: none;
}
.cat-hero-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
}
.cat-hero-icon { font-size: 3rem; flex-shrink: 0; }
.cat-page-hero h1 { font-size: 1.8rem; font-weight: 800; color: #fff; margin-bottom: 6px; }
.cat-page-hero p  { font-size: .9rem; color: rgba(255,255,255,.8); max-width: 500px; line-height: 1.6; }
.cat-tools-container { margin-bottom: 32px; }
.cat-tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
.cat-tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  text-decoration: none;
  transition: all var(--t) var(--ease);
}
.cat-tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.ctc-icon { font-size: 1.8rem; flex-shrink: 0; }
.ctc-body { flex: 1; min-width: 0; }
.ctc-body h2 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ctc-body p  { font-size: .82rem; color: var(--text-muted); line-height: 1.5;
               overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ctc-arrow { color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0; transition: all var(--t); }
.cat-tool-card:hover .ctc-arrow { color: var(--accent); transform: translateX(4px); }

/* Breadcrumb inside cat-page-hero (white on color bg) */
.cat-page-hero .breadcrumb,
.cat-page-hero .breadcrumb a,
.cat-page-hero .breadcrumb li:last-child { color: rgba(255,255,255,.75); }
.cat-page-hero .breadcrumb a:hover { color: #fff; }
.cat-page-hero .breadcrumb-sep { color: rgba(255,255,255,.4); }

/* ─── 22. FOOTER ─────────────────────────────────────────────── */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.7);
  padding: 40px 0 24px;
  margin-top: auto;
}
.footer-cols { display: grid; grid-template-columns: 1fr; gap: 28px; margin-bottom: 32px; }
.footer-brand .logo-text { color: #fff; }
.footer-brand p { font-size: .85rem; margin-top: 8px; line-height: 1.6; opacity: .7; }
.footer-col h3, .footer-col h4 { font-size: .8rem; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 12px; }
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: .85rem; color: rgba(255,255,255,.6); transition: color var(--t); }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
}
.footer-bottom a { color: rgba(255,255,255,.5); }
.footer-bottom a:hover { color: #fff; text-decoration: none; }

/* ─── 23. AD UNIT ────────────────────────────────────────────── */
.ad-unit { background: var(--surface); border-radius: var(--r-sm); border: 1px dashed var(--border); min-height: 90px; display: flex; align-items: center; justify-content: center; margin-bottom: var(--gap); }

/* ─── 24. UTILITIES ──────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px;  } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.no-print { }

/* Badge */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .7rem; font-weight: 700; letter-spacing: .03em; }
.badge-active   { background: var(--green-soft); color: var(--green); }
.badge-inactive { background: #FFF3E0; color: var(--orange); }

/* ─── 25. ADMIN (basic, kept minimal) ───────────────────────── */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th { background: var(--bg); padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--border); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); }

/* ─── 26. TABLET 640px+ ──────────────────────────────────────── */
@media (min-width: 640px) {
  .container { padding: 0 24px; }
  .hero-title { font-size: 2.6rem; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-desc { display: block; }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
  .tools-list-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .tool-hero { padding: 48px 24px 36px; }
  .cat-tools-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── 27. DESKTOP 1024px+ ────────────────────────────────────── */
@media (min-width: 1024px) {
  /* Header */
  .main-nav { display: block; }
  .hamburger { display: none; }
  #site-search { width: 240px; }

  /* Tool page: 2-col */
  .tool-page-layout { grid-template-columns: 1fr 300px; }
  .tool-sidebar { display: block; }
  .related-tools-mobile { display: none; }
  .related-tools-desktop { display: block; }

  /* Hero */
  .hero { padding: 80px 0 88px; }
  .hero-title { font-size: 3.2rem; }

  /* Grids */
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .tools-grid { grid-template-columns: repeat(4, 1fr); }
  .tools-list-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-cols { grid-template-columns: 2fr 1fr 1fr; }
  .cat-tools-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-page-hero h1 { font-size: 2.2rem; }

  .tool-hero { padding: 52px 0 40px; }
}

/* ─── 28. WIDGET OVERFLOW GUARD ──────────────────────────────── */
/* Prevent any widget from causing horizontal scroll on mobile */
.pc-widget, .tip-widget, .bf-widget, .cd-widget, .age-calc-widget {
  max-width: 100%;
  overflow-x: hidden;
}

/* ─── 28b. MOBILE 480px TWEAKS ───────────────────────────────── */
@media (max-width: 480px) {
  .calc-actions { flex-direction: column; }
  .btn-calc, .btn-reset { width: 100%; }
  .tax-compare-wrap { grid-template-columns: 1fr; }
  .schedule-head { flex-direction: column; gap: 10px; }
  .btn-pdf { align-self: flex-start; }
}

/* ─── 29. PERIOD CALCULATOR ─────────────────────────────────── */
.pc-widget { border-radius: var(--r); box-shadow: var(--sh-md); overflow: hidden; overflow-x: hidden; background: var(--surface); }

/* Section heads (full-bleed dividers) */
.pc-section-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 12px 20px; background: var(--surface-2);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: .875rem; font-weight: 700; color: var(--navy);
}
.pc-section-head:first-child { border-top: none; }

/* Inputs */
.pc-inputs { padding: 16px 20px 8px; }
.pc-inputs .cd-field { border-bottom: none; padding: 8px 0 0; }

/* Overview cards */
.pc-overview-section { padding: 16px 20px; }
.pc-overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pc-ov-card {
  border-radius: var(--r-sm); padding: 14px 12px 12px; text-align: center;
  border: 1.5px solid var(--border);
}
.pc-ov-icon { font-size: 1.4rem; margin-bottom: 4px; }
.pc-ov-label { font-size: .68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.pc-ov-val { font-size: .92rem; font-weight: 700; color: var(--navy); line-height: 1.3; }
.pc-ov-val-sm { font-size: .8rem; }
.pc-ov-sub { font-size: .7rem; color: var(--text-muted); margin-top: 3px; }
.pc-ov-period    { background: #FFF0F3; border-color: #FFCCD6; }
.pc-ov-period    .pc-ov-val { color: #C2185B; }
.pc-ov-ovulation { background: #E8F5E9; border-color: #C8E6C9; }
.pc-ov-ovulation .pc-ov-val { color: #2E7D32; }
.pc-ov-fertile   { background: #E3F2FD; border-color: #BBDEFB; }
.pc-ov-fertile   .pc-ov-val { color: #1565C0; }
.pc-ov-pms       { background: #FFF8E1; border-color: #FFE082; }
.pc-ov-pms       .pc-ov-val { color: #E65100; }

/* Cycle phase */
.pc-phase-section { padding: 12px 20px 16px; }
.pc-phase-display { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pc-phase-name { font-size: 1rem; font-weight: 700; }
.pc-phase-desc { font-size: .78rem; color: var(--text-muted); }
.pc-phase-bar-wrap { position: relative; margin-bottom: 8px; }
.pc-phase-bar { display: flex; border-radius: var(--r-sm); overflow: hidden; height: 26px; }
.pc-ph-seg {
  display: flex; align-items: center; justify-content: center;
  font-size: .58rem; font-weight: 700; color: rgba(255,255,255,.9);
  overflow: hidden; white-space: nowrap; letter-spacing: .02em;
}
.pc-ph-menstrual  { background: #E91E63; }
.pc-ph-follicular { background: #42A5F5; }
.pc-ph-ovulation  { background: #26A69A; }
.pc-ph-luteal     { background: #AB47BC; }
.pc-phase-pin {
  position: absolute; bottom: 100%; margin-bottom: 2px; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 9px solid var(--navy);
}
.pc-phase-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.pc-ph-li { display: flex; align-items: center; gap: 5px; font-size: .73rem; color: var(--text-2); }
.pc-ph-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Calendar legend (inline in section head) */
.pc-cal-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: .73rem; font-weight: 500; color: var(--text-2); }
.pc-cal-legend span { display: flex; align-items: center; gap: 4px; }
.pc-leg-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Calendar */
.pc-calendar-section { padding: 16px 20px; }
.pc-calendar { display: flex; flex-wrap: wrap; gap: 20px; }
.pc-month { flex: 1; min-width: 260px; }
.pc-month-name { font-size: .875rem; font-weight: 700; color: var(--navy); text-align: center; margin-bottom: 8px; }
.pc-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.pc-cal-dow { text-align: center; font-size: .62rem; font-weight: 700; color: var(--text-muted); padding: 3px 0; }
.pc-cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: .76rem; font-weight: 500; color: var(--text);
}
.pc-cal-day.pc-today { box-shadow: 0 0 0 2px var(--navy); font-weight: 700; color: var(--navy); }
.pc-cal-day.pc-period    { background: #E91E63; color: #fff; font-weight: 700; }
.pc-cal-day.pc-ovulation { background: #26A69A; color: #fff; font-weight: 700; }
.pc-cal-day.pc-fertile   { background: #BBDEFB; color: #1565C0; font-weight: 600; }
.pc-cal-day.pc-pms       { background: #FFE082; color: #E65100; }
.pc-cal-day.pc-empty     { visibility: hidden; }

/* Upcoming list */
.pc-upcoming-section { padding: 14px 20px 20px; }
.pc-upcoming-list { display: flex; flex-direction: column; gap: 8px; }
.pc-upcoming-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: var(--r-sm); border: 1.5px solid var(--border);
  background: var(--surface-2);
}
.pc-upcoming-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700;
}
.pc-upcoming-info { flex: 1; min-width: 0; }
.pc-upcoming-date { font-size: .875rem; font-weight: 700; color: var(--navy); }
.pc-upcoming-detail { font-size: .73rem; color: var(--text-muted); margin-top: 2px; white-space: normal; }
.pc-upcoming-pill {
  background: #FFF0F3; color: #C2185B; border-radius: 12px;
  padding: 3px 10px; font-size: .73rem; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}

/* ── Period calendar: single-column on all mobile viewports */
@media (max-width: 767px) {
  .pc-calendar { display: block; }
  .pc-month    { margin-bottom: 20px; }
  .pc-month:last-child { margin-bottom: 0; }
}

@media (max-width: 600px) {
  /* Section padding */
  .pc-inputs          { padding: 12px 14px 6px; }
  .pc-overview-section{ padding: 12px 14px; }
  .pc-phase-section   { padding: 10px 14px 14px; }
  .pc-calendar-section{ padding: 12px 14px; }
  .pc-upcoming-section{ padding: 10px 14px 16px; }
  .pc-notif-section   { padding: 14px 14px 12px; }
  .pc-section-head    { padding: 10px 14px; }

  /* Calendar legend stacks */
  .pc-cal-legend { flex-direction: column; gap: 4px; font-size: .7rem; }
  .pc-section-head { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* Phase bar — smaller text */
  .pc-phase-bar { height: 22px; }
  .pc-ph-seg    { font-size: .5rem; }
}

@media (max-width: 480px) {
  /* Calendar */
  .pc-calendar    { display: block; }   /* belt-and-suspenders: block, not flex */
  .pc-cal-day     { font-size: .65rem; }
  .pc-cal-legend  { gap: 4px 8px; font-size: .68rem; }

  /* Overview cards — single column on tiny screens */
  .pc-overview-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pc-ov-card  { padding: 10px 8px; }
  .pc-ov-icon  { font-size: 1.1rem; }
  .pc-ov-val   { font-size: .82rem; }
  .pc-ov-val-sm{ font-size: .72rem; }
  .pc-ov-sub   { font-size: .62rem; }

  /* Upcoming list */
  .pc-upcoming-item   { padding: 10px 10px; gap: 8px; flex-wrap: wrap; }
  .pc-upcoming-info   { min-width: calc(100% - 40px); }
  .pc-upcoming-date   { font-size: .8rem; }
  .pc-upcoming-detail { font-size: .68rem; }
  .pc-upcoming-pill   { order: -1; }

  /* Phase bar */
  .pc-phase-bar { height: 20px; }
  .pc-ph-seg    { font-size: 0; }   /* hide text, keep colour */

  /* Remind checkboxes */
  .pc-remind-checks { gap: 5px; }
  .pc-check-opt     { font-size: .78rem; padding: 5px 10px; }
}

/* ─── 30. TIP CALCULATOR ─────────────────────────────────────── */
.tip-widget { border-radius: var(--r); box-shadow: var(--sh-md); overflow: hidden; overflow-x: hidden; background: var(--surface); }

/* Header */
.tip-widget-head {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  background: var(--navy); color: #fff; font-size: 1rem; font-weight: 700;
}
.tip-head-icon { font-size: 1.3rem; }

/* Body */
.tip-body { padding: 0 20px 4px; }
.tip-field { padding: 16px 0; border-bottom: 1px solid var(--border); }
.tip-field:last-of-type { border-bottom: none; }
.tip-label { font-size: .875rem; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 10px; }
.tip-hint-text { font-size: .75rem; font-weight: 400; color: var(--text-muted); }

/* Bill input */
.tip-bill-wrap {
  display: flex; border: 2px solid var(--border); border-radius: var(--r-sm);
  overflow: hidden; transition: border-color .15s;
}
.tip-bill-wrap:focus-within { border-color: var(--navy); }
.tip-curr-select {
  padding: 0 10px; border: none; border-right: 2px solid var(--border);
  background: var(--bg); font-size: .875rem; font-weight: 600;
  color: var(--text-2); outline: none; cursor: pointer;
}
.tip-bill-input {
  flex: 1; padding: 12px 14px; border: none; background: none;
  font-size: 1.6rem; font-weight: 700; color: var(--navy); outline: none; min-width: 0;
}
.tip-bill-input::placeholder { color: var(--text-muted); font-weight: 400; }

/* Service quality */
.tip-quality-row { display: flex; gap: 6px; }
.tip-qual-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; border-radius: var(--r-sm); border: 2px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: .7rem; font-weight: 600;
  color: var(--text-2); transition: border-color .15s, background .15s, color .15s;
}
.tip-qual-btn:first-child { font-size: 1.1rem; }
.tip-qual-btn span:first-child { font-size: 1.2rem; }
.tip-qual-btn.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.tip-qual-btn:hover:not(.active) { border-color: var(--navy); color: var(--navy); }

/* Tip % quick buttons */
.tip-pct-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tip-pct-btn {
  flex: 1; min-width: 44px; padding: 8px 4px; border-radius: 20px;
  border: 2px solid var(--border); background: var(--surface);
  font-size: .82rem; font-weight: 700; color: var(--text-2); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s; white-space: nowrap;
}
.tip-pct-btn.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.tip-pct-btn:hover:not(.active) { border-color: var(--navy); color: var(--navy); }
.tip-custom-btn { color: var(--purple); border-color: var(--purple-soft); }
.tip-custom-btn.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.tip-pct-hint {
  font-size: .78rem; color: var(--text-muted); text-align: center;
  margin-bottom: 8px; font-weight: 500; min-height: 18px;
}

/* Custom & mini inputs */
.tip-custom-input-wrap, .tip-mini-input-wrap {
  display: flex; align-items: center; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2);
}
.tip-custom-input-wrap:focus-within, .tip-mini-input-wrap:focus-within { border-color: var(--navy); }
.tip-custom-input-wrap .gc-input, .tip-mini-input-wrap .gc-input {
  flex: 1; padding: 9px 12px; border: none; background: none;
  font-size: 1rem; color: var(--text); outline: none; min-width: 0;
}
.tip-unit {
  padding: 0 12px; font-size: .85rem; font-weight: 600; color: var(--text-muted);
  background: var(--bg); border-left: 1.5px solid var(--border);
  align-self: stretch; display: flex; align-items: center;
}
.tip-curr-sym {
  padding: 0 10px; font-size: .9rem; font-weight: 600; color: var(--text-muted);
  background: var(--bg); border-right: 1.5px solid var(--border);
  align-self: stretch; display: flex; align-items: center;
}

/* Extras collapsible */
.tip-extras-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 9px 14px; border-radius: var(--r-sm); border: 1.5px dashed var(--border);
  background: var(--surface-2); font-size: .82rem; font-weight: 600;
  color: var(--text-2); cursor: pointer; transition: border-color .15s, color .15s;
}
.tip-extras-toggle:hover { border-color: var(--navy); color: var(--navy); }
.tip-extras-arrow { font-size: 1rem; }
.tip-extras-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Split card */
.tip-split-card {
  margin: 0 -20px; padding: 16px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.tip-split-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tip-split-title { font-size: .9rem; font-weight: 700; color: var(--navy); }
.tip-split-sub { font-size: .76rem; color: var(--text-muted); margin-top: 2px; }

/* Stepper */
.tip-stepper { display: flex; align-items: center; gap: 10px; }
.tip-step-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--navy); background: var(--surface);
  font-size: 1.1rem; font-weight: 700; color: var(--navy); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s; flex-shrink: 0;
}
.tip-step-btn:hover { background: var(--navy); color: #fff; }
.tip-step-icon { font-size: 1.2rem; }
.tip-step-val { font-size: 1.1rem; font-weight: 800; color: var(--navy); min-width: 28px; text-align: center; }

/* Round-up toggle */
.tip-roundup-row { display: flex; align-items: center; justify-content: space-between; }
.tip-roundup-label { font-size: .875rem; font-weight: 500; color: var(--text-2); }
.tip-toggle-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.tip-toggle-input { display: none; }
.tip-toggle-track {
  position: relative; width: 46px; height: 24px; border-radius: 12px;
  background: var(--border); transition: background .2s;
}
.tip-toggle-input:checked + .tip-toggle-track { background: var(--green); }
.tip-toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s;
}
.tip-toggle-input:checked + .tip-toggle-track .tip-toggle-thumb { transform: translateX(22px); }
.tip-toggle-text { font-size: .78rem; font-weight: 700; color: var(--text-muted); min-width: 24px; }

/* Result panel */
.tip-result { margin: 0 -20px; background: var(--navy-dark); color: #fff; }
.tip-result-top { text-align: center; padding: 22px 20px 14px; }
.tip-per-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  color: rgba(255,255,255,.55); text-transform: uppercase;
}
.tip-per-val { font-size: 2.8rem; font-weight: 800; color: #FF9800; margin: 4px 0 8px; line-height: 1; }
.tip-per-sub { font-size: .8rem; color: rgba(255,255,255,.65); }

/* Breakdown table */
.tip-breakdown { padding: 4px 20px 16px; }
.tip-brow {
  display: grid; grid-template-columns: 1fr auto 1fr auto;
  gap: 0 12px; padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: .8rem; color: rgba(255,255,255,.7);
}
.tip-brow:last-child { border-bottom: none; }
.tip-brow span:nth-child(2),
.tip-brow span:nth-child(4) { font-weight: 600; color: #fff; text-align: right; }
.tip-brow-total { font-weight: 700; padding-top: 10px; margin-top: 2px; border-top: 1px solid rgba(255,255,255,.2); border-bottom: none; }
.tip-brow-total span { color: rgba(255,255,255,.9) !important; }
.tip-brow-total span:nth-child(2),
.tip-brow-total span:nth-child(4) { color: #FF9800 !important; font-size: .9rem; }

/* Actions */
.tip-actions { display: flex; gap: 10px; padding: 16px 0 8px; }
.tip-btn-copy {
  flex: 1; padding: 11px; border-radius: var(--r-sm);
  background: var(--navy); color: #fff; border: none;
  font-size: .875rem; font-weight: 600; cursor: pointer; transition: background .15s;
}
.tip-btn-copy:hover { background: var(--navy-dark); }
.tip-btn-reset {
  padding: 11px 20px; border-radius: var(--r-sm);
  border: 2px solid var(--border); background: var(--surface);
  font-size: .875rem; font-weight: 600; color: var(--text-2); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.tip-btn-reset:hover { border-color: var(--navy); color: var(--navy); }

@media (max-width: 480px) {
  .tip-qual-btn span:not(:first-child) { display: none; }
  .tip-per-val { font-size: 2.2rem; }
  .tip-brow { grid-template-columns: 1fr 1fr; }
  .tip-brow span:nth-child(3), .tip-brow span:nth-child(4) { display: none; }
  .tip-brow-total span:nth-child(3), .tip-brow-total span:nth-child(4) { display: flex; }
  .tip-extras-grid { grid-template-columns: 1fr; }

  /* Tip widget: prevent result panel overflow */
  .tip-result { margin: 0; }
  .tip-result-top { padding: 16px 14px 10px; }
  .tip-breakdown { padding: 4px 14px 12px; }
  .tip-body { padding: 0 14px 4px; }
  .tip-split-card { margin: 0; padding: 14px; }

  /* Tip actions: stack on mobile */
  .tip-actions { flex-direction: column; }
  .tip-btn-copy, .tip-btn-reset { width: 100%; text-align: center; }
}

/* ─── 30. BODY FAT CALCULATOR ───────────────────────────────── */
/* Reuses .cd-* base classes from section 30 */

/* Block-style fields (label on top) */
.bf-block-field { flex-direction: column; align-items: flex-start; gap: 10px; }

/* Body-type selector */
.bf-btype-group { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.bf-btype-opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: var(--r-sm);
  border: 2px solid var(--border); cursor: pointer;
  user-select: none; transition: border-color .15s, background .15s;
}
.bf-btype-opt.active { border-color: var(--navy); background: #E8EEF8; }
.bf-btype-opt input[type="radio"] { display: none; }
.bf-btype-opt::before {
  content: ''; width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); transition: border-color .15s, background .15s;
}
.bf-btype-opt.active::before { border-color: var(--navy); background: var(--navy); }
.bf-btype-body { flex: 1; }
.bf-btype-body strong { display: block; font-size: .875rem; color: var(--text); }
.bf-btype-sub { font-size: .73rem; color: var(--text-muted); }
.bf-btype-badge {
  padding: 3px 10px; border-radius: 12px;
  font-size: .7rem; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.bf-badge-navy { background: #E8EEF8; color: var(--navy); }
.bf-badge-gray { background: var(--bg); color: var(--text-muted); }

/* Select inputs */
.bf-select {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: .875rem; color: var(--text);
  outline: none; cursor: pointer;
}
.bf-select:focus { border-color: var(--navy); }

/* Method selector */
.bf-method-group { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.bf-method-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--r-sm);
  border: 2px solid var(--border); cursor: pointer;
  user-select: none; transition: border-color .15s, background .15s;
}
.bf-method-opt.active { border-color: var(--navy); background: #E8EEF8; }
.bf-method-opt input[type="radio"] { display: none; }
.bf-method-opt::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); transition: border-color .15s, background .15s;
}
.bf-method-opt.active::before { border-color: var(--navy); background: var(--navy); }
.bf-method-inner {
  flex: 1; display: flex; align-items: center; gap: 8px;
  font-size: .875rem; font-weight: 500; color: var(--text); flex-wrap: wrap;
}
.bf-method-tag {
  padding: 2px 8px; border-radius: 10px;
  font-size: .7rem; font-weight: 700; white-space: nowrap;
}
.bf-tag-blue   { background: #E3F0FF; color: #1565C0; }
.bf-tag-green  { background: var(--green-soft); color: var(--green); }
.bf-tag-orange { background: #FFF3E0; color: var(--orange); }
.cd-label-hint { font-size: .75rem; font-weight: 400; color: var(--text-muted); }

/* Category badge in results */
.bf-cat-badge {
  display: inline-block; padding: 4px 14px; border-radius: 14px;
  font-size: .82rem; font-weight: 700;
}
.bf-cat-essential { background: #E3F0FF; color: #1565C0; }
.bf-cat-athletes  { background: var(--green-soft); color: var(--green); }
.bf-cat-fitness   { background: #E8F5E9; color: #388E3C; }
.bf-cat-average   { background: #FFF8E1; color: #F57F17; }
.bf-cat-risk      { background: var(--red-soft); color: var(--red); }

/* Visual range bar */
.bf-range-bar {
  display: flex; border-radius: var(--r-sm); overflow: hidden;
  height: 30px; margin: 12px 0 0;
}
.bf-seg {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: .63rem; font-weight: 600; color: rgba(255,255,255,.92);
  overflow: hidden; white-space: nowrap;
}
.bf-seg:nth-child(1) { background: #1565C0; }
.bf-seg:nth-child(2) { background: #2E7D32; }
.bf-seg:nth-child(3) { background: #558B2F; }
.bf-seg:nth-child(4) { background: #F57F17; }
.bf-seg:nth-child(5) { background: #C62828; }

/* Marker (your position arrow) */
.bf-marker-row { position: relative; height: 26px; margin-bottom: 4px; }
.bf-marker-pin {
  position: absolute; top: 0; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-top: 10px solid var(--navy);
}
.bf-marker-lbl {
  position: absolute; top: 12px; transform: translateX(-50%);
  font-size: .75rem; font-weight: 700; color: var(--navy); white-space: nowrap;
}
.bf-range-legend {
  display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px;
}
.bf-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: .75rem; color: var(--text-2);
}
.bf-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Comparison table */
.bf-compare-note {
  font-size: .825rem; line-height: 1.6; color: var(--text-2);
  background: #FFF8E1; border-left: 3px solid #F57F17;
  border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 14px;
}
#bf-compare-table table { width: 100%; border-collapse: collapse; font-size: .82rem; }
#bf-compare-table th {
  padding: 9px 10px; text-align: left;
  background: var(--navy); color: #fff; font-size: .78rem; font-weight: 700;
}
#bf-compare-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text-2);
}
#bf-compare-table tr:last-child td { border-bottom: none; }
#bf-compare-table tr:nth-child(even) td { background: var(--bg); }
#bf-compare-table .bf-hl { font-weight: 700; color: var(--navy); }

@media (max-width: 600px) {
  .bf-btype-opt { flex-wrap: wrap; }
  .bf-btype-badge { margin-top: 4px; }
  .bf-method-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .bf-seg { font-size: 0; } /* hide text on small screens, keep color */

  /* Compare table: smaller font + scrollable on narrow screens */
  #bf-compare-table { overflow-x: auto; -webkit-overflow-scrolling: touch; display: block; }
  #bf-compare-table table { min-width: 360px; }
  #bf-compare-table { font-size: .72rem; }
  #bf-compare-table th, #bf-compare-table td { padding: 6px 5px; }
}

/* ─── 30. CALORIE DEFICIT CALCULATOR ────────────────────────── */
.cd-widget {
  border-radius: var(--r);
  box-shadow: var(--sh-md);
  overflow: hidden;
  overflow-x: hidden;
  background: var(--surface);
}

/* Section wrapper */
.cd-section { border-bottom: 1px solid var(--border); }
.cd-section:last-of-type { border-bottom: none; }

/* Section header button */
.cd-section-head {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 16px 20px;
  background: var(--surface); border: none; cursor: pointer;
  font-size: .9rem; font-weight: 700; color: var(--navy);
  text-align: left; transition: background .15s;
}
.cd-section-head:hover { background: var(--bg); }
.cd-caret {
  font-size: .85rem; transition: transform .2s; display: inline-block;
}
.cd-section:not(.cd-open) .cd-caret { transform: rotate(180deg); }
.cd-section:not(.cd-open) .cd-section-body { display: none; }

/* Section body */
.cd-section-body { padding: 4px 20px 20px; }

/* Field rows */
.cd-field { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 16px; }
.cd-field:last-child { border-bottom: none; }
.cd-label { font-size: .875rem; color: var(--text-2); font-weight: 500; flex-shrink: 0; }

/* Input wrap */
.cd-input-wrap {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  overflow: hidden; background: var(--surface-2);
  min-width: 140px; max-width: 180px;
}
.cd-input-wrap:focus-within { border-color: var(--navy); }
.cd-input {
  flex: 1; padding: 9px 10px; border: none; background: none;
  font-size: .95rem; color: var(--text); min-width: 0;
  outline: none;
}
.cd-unit-badge {
  padding: 0 10px; font-size: .82rem; font-weight: 600;
  color: var(--text-muted); background: var(--bg);
  border-left: 1.5px solid var(--border); white-space: nowrap;
  align-self: stretch; display: flex; align-items: center;
}
.cd-unit-select {
  padding: 0 6px 0 8px; border: none; border-left: 1.5px solid var(--border);
  background: var(--bg); font-size: .82rem; font-weight: 600;
  color: var(--text-2); cursor: pointer; outline: none;
  align-self: stretch;
}
.cd-date-wrap { position: relative; }
.cd-date-input { padding-right: 32px; }
.cd-date-icon {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: .9rem; pointer-events: none; color: var(--text-muted);
}

/* Radio group */
.cd-radio-group { display: flex; gap: 10px; }
.cd-radio-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 20px;
  border: 2px solid var(--border); cursor: pointer;
  font-size: .875rem; font-weight: 500; color: var(--text-2);
  transition: border-color .15s, color .15s, background .15s;
  user-select: none;
}
.cd-radio-opt input[type="radio"] { display: none; }
.cd-radio-opt.active {
  border-color: var(--navy); background: #E8EEF8; color: var(--navy);
}
/* Radio dot */
.cd-radio-opt::before {
  content: ''; display: inline-block;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.cd-radio-opt.active::before { border-color: var(--navy); background: var(--navy); }

/* Results section */
.cd-results-section {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cd-results-head {
  padding: 14px 20px 0;
  font-size: .95rem; font-weight: 700; color: var(--navy);
}
.cd-results-body { padding: 8px 20px 16px; }
.cd-result-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
}
.cd-result-label { font-size: .875rem; color: var(--text-2); font-weight: 500; }
.cd-result-val-wrap {
  display: flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  padding: 8px 12px; background: var(--surface); min-width: 140px;
  justify-content: flex-end;
}
.cd-result-val { font-size: .95rem; font-weight: 700; color: var(--navy); }
.cd-result-unit { font-size: .8rem; color: var(--text-muted); font-weight: 500; }

/* Plan section */
.cd-plan-placeholder {
  background: #EDE9FE; border-radius: var(--r-sm); padding: 14px 16px;
  font-size: .875rem; color: var(--purple-dark); line-height: 1.5;
}
.cd-plan-details { display: flex; flex-direction: column; gap: 0; }
.cd-plan-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.cd-plan-row:last-child { border-bottom: none; }
.cd-plan-row-label { color: var(--text-2); font-weight: 500; }
.cd-plan-row-value { font-weight: 700; color: var(--navy); }
.cd-plan-row-value.warn { color: var(--orange); }
.cd-plan-row-value.good { color: var(--green); }
.cd-plan-divider {
  font-size: .75rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 14px 0 4px; border-bottom: 1px solid var(--border);
}
.cd-plan-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px;
  font-size: .75rem; font-weight: 700;
}
.cd-plan-badge.safe { background: var(--green-soft); color: var(--green); }
.cd-plan-badge.moderate { background: #FFF8E1; color: #F57F17; }
.cd-plan-badge.aggressive { background: var(--red-soft); color: var(--red); }

/* Actions */
.cd-actions {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--border);
  background: var(--surface);
}
.cd-actions-right { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-btn-share {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 20px;
  background: var(--accent); color: #fff;
  border: none; font-size: .875rem; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.cd-btn-share:hover { background: var(--purple-dark); }
.cd-share-icon { font-size: 1rem; }
.cd-btn-secondary {
  padding: 9px 16px; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: .82rem; font-weight: 600; color: var(--text-2); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.cd-btn-secondary:hover { border-color: var(--navy); color: var(--navy); }
.cd-btn-ghost {
  padding: 9px 16px; border-radius: var(--r-sm);
  border: 1.5px solid transparent; background: none;
  font-size: .82rem; font-weight: 600; color: var(--text-muted); cursor: pointer;
  transition: color .15s;
}
.cd-btn-ghost:hover { color: var(--red); }

/* Feedback */
.cd-feedback {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--border);
  background: var(--surface-2); font-size: .82rem; color: var(--text-muted);
}
.cd-feedback-btn {
  padding: 5px 14px; border-radius: 16px;
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: .78rem; font-weight: 600; color: var(--text-2); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.cd-feedback-btn:hover { border-color: var(--navy); color: var(--navy); }
.cd-feedback-btn.cd-voted { border-color: var(--green); color: var(--green); }

@media (max-width: 600px) {
  .cd-field { flex-direction: column; align-items: flex-start; gap: 8px; }
  .cd-input-wrap { width: 100%; max-width: 100%; }
  .cd-actions { flex-direction: column; align-items: stretch; }
  .cd-actions-right { flex-direction: column; }
  .cd-btn-share, .cd-btn-secondary, .cd-btn-ghost { width: 100%; justify-content: center; }

  /* Plan rows: allow label+value to stack on narrow screens */
  .cd-plan-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cd-result-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .cd-result-val-wrap { width: 100%; min-width: 0; }
}

/* ─── 31. AGE CALCULATOR ─────────────────────────────────────── */
.age-calc-widget {
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--sh-md);
  overflow: hidden;
  overflow-x: hidden;
}

/* Tabs */
.age-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--surface-2);
}
.age-tab {
  flex: 1;
  padding: 14px 10px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.age-tab.active,
.age-tab:hover { color: var(--navy); border-bottom-color: var(--navy); }

/* Tab panes */
.age-tab-pane { padding: 24px 24px 8px; }

/* Input rows */
.age-input-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.age-input-row label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.age-date-input { font-size: 1rem; }

/* Actions row */
.age-tab-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.age-calc-btn { flex: 1; }
.btn-share-age {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: .875rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.btn-share-age:hover { border-color: var(--navy); color: var(--navy); }

/* Result area */
.age-result {
  margin: 0; padding: 24px;
  border-top: 2px solid var(--border);
  background: var(--surface);
}

/* Big age display */
.age-hero-result { text-align: center; padding: 24px 16px 20px; }
.age-big-text {
  font-size: 1.85rem; font-weight: 800; color: var(--navy);
  line-height: 1.15;
}
.age-born-day {
  font-size: .875rem; color: var(--text-muted); margin-top: 6px; font-weight: 500;
}

/* 4 stat boxes */
.age-stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin: 4px 0 20px;
}
.age-stat-box {
  background: var(--bg); border-radius: var(--r-sm); padding: 16px 12px;
  text-align: center; border: 1px solid var(--border);
}
.age-stat-value {
  font-size: 1.4rem; font-weight: 800; color: var(--navy); display: block;
}
.age-stat-label {
  font-size: .76rem; font-weight: 500; color: var(--text-muted);
  margin-top: 4px; text-transform: uppercase; letter-spacing: .03em;
}

/* Next Birthday */
.age-birthday-section {
  background: linear-gradient(135deg, #EDE9FE, #E8EEF8);
  border-radius: var(--r-sm); padding: 16px 20px;
}
.age-birthday-head {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 700; color: var(--navy);
  margin-bottom: 12px;
}
.bday-icon { font-size: 1.2rem; }
.bday-info-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bday-date { font-size: .95rem; font-weight: 700; color: var(--navy); }
.bday-pill {
  background: var(--navy); color: #fff; border-radius: 20px;
  padding: 3px 12px; font-size: .78rem; font-weight: 700;
}
.bday-turning {
  background: var(--purple-soft); color: var(--purple-dark);
  border-radius: 20px; padding: 3px 12px;
  font-size: .78rem; font-weight: 700;
}

@media (max-width: 480px) {
  .age-tab { font-size: .78rem; padding: 12px 6px; }
  .age-big-text { font-size: 1.4rem; }
  .age-stat-value { font-size: 1.15rem; }
  .age-tab-pane { padding: 16px 14px 8px; }
  .age-result { padding: 16px 14px; }
}

@media (max-width: 360px) {
  .age-tab { font-size: .7rem; padding: 10px 4px; }
  .age-tabs { overflow-x: auto; }
}

/* ─── 32. PERIOD REMINDERS / NOTIFICATIONS ──────────────────── */
.pc-section-head { display:flex; align-items:center; gap:8px; }
.pc-bell-icon { font-size:1rem; }

.pc-notif-section {
  background: var(--surface);
  border-radius: 12px;
  border: 1.5px solid var(--border);
  padding: 20px 20px 16px;
  margin-bottom: 16px;
}

.pc-notif-state { }

.pc-notif-intro {
  font-size: .93rem;
  color: var(--text-2);
  margin: 0 0 14px;
}

.pc-notif-msg {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: .9rem;
  line-height: 1.5;
}
.pc-notif-warn {
  background: #FFF3E0;
  border: 1px solid #FFB74D;
  color: #E65100;
}

/* Remind checkboxes */
.pc-remind-opts { margin-bottom: 16px; }
.pc-remind-label { font-size: .85rem; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.pc-remind-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-check-opt {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pc-check-opt:has(input:checked) {
  border-color: #E91E63;
  background: #FCE4EC;
  color: #880E4F;
  font-weight: 600;
}
.pc-check-opt input { accent-color: #E91E63; width: 15px; height: 15px; }

/* Buttons */
.pc-notif-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.pc-notif-btn:active { transform: scale(.97); }
.pc-notif-subscribe {
  background: linear-gradient(135deg, #E91E63, #C2185B);
  color: #fff;
}
.pc-notif-subscribe:hover { opacity: .9; }
.pc-notif-update {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  font-size: .85rem;
}
.pc-notif-update:hover { opacity: .9; }
.pc-notif-disable {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-2);
  font-size: .82rem;
  padding: 8px 14px;
  margin-top: 12px;
}
.pc-notif-disable:hover { border-color: #E91E63; color: #E91E63; }

/* Subscribed active card */
.pc-notif-active {
  display: flex; align-items: flex-start; gap: 12px;
  background: #E8F5E9;
  border: 1.5px solid #A5D6A7;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.pc-notif-active-icon { font-size: 1.3rem; flex-shrink: 0; }
.pc-notif-active-text { font-size: .9rem; line-height: 1.5; color: #1B5E20; }
.pc-notif-active-text strong { display: block; }

/* Update date row */
.pc-update-date-wrap { margin-bottom: 4px; }
.pc-update-label { font-size: .84rem; color: var(--text-2); margin-bottom: 8px; }
.pc-update-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-actual-date-input { max-width: 170px; }
.pc-update-feedback { font-size: .83rem; min-height: 20px; margin-top: 6px; color: #388E3C; }

@media (max-width: 480px) {
  .pc-remind-checks { gap: 6px; }
  .pc-check-opt { font-size: .8rem; padding: 6px 10px; }
  .pc-update-row { flex-direction: column; align-items: flex-start; }
  .pc-actual-date-input { max-width: 100%; width: 100%; }
}

/* ─── 33. PRINT ───────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .main-nav, .hamburger, .breadcrumb,
  .calc-actions, .affiliate-cta, .ad-unit, .related-tools,
  .tool-sidebar, .tool-hero, .content-section, .faq-section,
  .no-print { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }
  .schedule-wrap { box-shadow: none; border: 1px solid #ccc; display: block !important; }
  .btn-pdf { display: none !important; }
  .tool-page-layout { display: block; }
  .result-cards { break-inside: avoid; }
  .schedule-table { font-size: 9pt; }
  .schedule-table thead th {
    background: #1A237E !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .result-card.rc-primary {
    background: #1A237E !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  @page { margin: 1.5cm; size: A4; }
}
