/* ============================================
   fincalcs.co — Main Stylesheet
   Design: UtilityEmpire v2 aesthetic (cream, doodles, Playfair Display)
   Adapted with finance-themed doodle patterns
   ============================================ */

:root {
  --cream: #f9f8f4;
  --cream-dark: #f0efe8;
  --navy: #1b2a4a;
  --navy-light: #2a3d66;
  --teal: #2a9d8f;
  --teal-light: #3ab8a8;
  --gold: #c9a84c;
  --gold-light: #e0c36a;
  --coral: #e76f51;
  --green: #2d6a4f;
  --purple: #7b5ea7;
  --blue: #4a7fc4;
  --orange: #e6953a;
  --text: #2c2c2c;
  --text-light: #666;
  --text-muted: #999;
  --border: #ddd;
  --shadow: rgba(27,42,74,0.08);
  --shadow-hover: rgba(27,42,74,0.15);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --max-width: 1200px;
  --content-width: 800px;
}

/* Finance-themed doodle SVG background */
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Cg stroke='%231b2a4a' fill='none' opacity='0.06' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3C!-- MORTGAGE: House with price tag --%3E%3Cpath d='M60 100 L95 65 L130 100'/%3E%3Crect x='68' y='100' width='54' height='40' rx='2'/%3E%3Crect x='80' y='112' width='18' height='28'/%3E%3Cpath d='M110 80 L110 68 L120 68 L120 90'/%3E%3Cpath d='M135 85 L155 85 L155 100 L140 100' stroke-dasharray='3,3'/%3E%3Ctext x='143' y='96' font-size='10' fill='%231b2a4a' opacity='0.06' font-family='sans-serif' stroke='none'>$</text>%3E%3C!-- AFFORDABILITY: Scale/balance --%3E%3Cline x1='280' y1='60' x2='280' y2='100'/%3E%3Cline x1='250' y1='72' x2='310' y2='72'/%3E%3Cpath d='M250 72 L240 92 L260 92 Z'/%3E%3Cpath d='M310 72 L300 92 L320 92 Z'/%3E%3Ccircle cx='250' cy='86' r='2' fill='%231b2a4a' opacity='0.06'/%3E%3C!-- DEBT PAYOFF: Snowball rolling downhill --%3E%3Cpath d='M440 55 Q470 65 490 95 Q500 115 510 120'/%3E%3Ccircle cx='448' cy='58' r='6'/%3E%3Ccircle cx='472' cy='75' r='10'/%3E%3Ccircle cx='502' cy='105' r='16'/%3E%3Cpath d='M435 120 L520 120' stroke-dasharray='4,4'/%3E%3C!-- EMERGENCY FUND: Shield with dollar --%3E%3Cpath d='M660 55 L685 45 L710 55 L710 85 Q685 110 660 85 Z'/%3E%3Cpath d='M682 65 C678 62,672 64,672 68 C672 72,682 72,682 76 C682 80,674 82,670 79'/%3E%3Cline x1='678' y1='60' x2='678' y2='85'/%3E%3C!-- SAVINGS GOAL: Mountain peak with flag --%3E%3Cpath d='M45 280 L85 210 L125 280'/%3E%3Cline x1='85' y1='210' x2='85' y2='195'/%3E%3Cpath d='M85 195 L100 200 L85 205'/%3E%3Cpath d='M55 265 Q70 250 80 250' stroke-dasharray='3,3'/%3E%3C!-- COMPOUND INTEREST: Exponential growth curve with coins --%3E%3Cpath d='M220 280 Q250 278 280 270 Q320 250 350 200 Q370 170 380 140'/%3E%3Cline x1='215' y1='285' x2='385' y2='285'/%3E%3Cline x1='215' y1='135' x2='215' y2='285'/%3E%3Ccircle cx='380' cy='140' r='8'/%3E%3Cpath d='M376 138 C374 136,370 137,370 140 C370 143,376 143,376 145' stroke-width='1'/%3E%3Ccircle cx='350' cy='200' r='5'/%3E%3Ccircle cx='320' cy='248' r='4'/%3E%3C!-- RETIREMENT: Sunset with rocking chair --%3E%3Ccircle cx='530' cy='230' r='30'/%3E%3Cline x1='470' y1='260' x2='590' y2='260'/%3E%3Cpath d='M500 260 L505 240 L525 240 L530 255'/%3E%3Cpath d='M505 240 Q510 230 515 240'/%3E%3Cpath d='M497 260 Q495 270 500 275'/%3E%3Cpath d='M533 260 Q535 270 530 275'/%3E%3C!-- NET WORTH: Trophy/cup --%3E%3Cpath d='M700 210 L700 240 Q700 260 720 265 Q740 260 740 240 L740 210'/%3E%3Cline x1='700' y1='210' x2='740' y2='210'/%3E%3Cpath d='M700 218 Q685 218 685 230 Q685 240 700 240'/%3E%3Cpath d='M740 218 Q755 218 755 230 Q755 240 740 240'/%3E%3Cline x1='710' y1='265' x2='730' y2='265'/%3E%3Crect x='708' y='265' width='24' height='6' rx='2'/%3E%3C!-- TRUE HOURLY WAGE: Clock with dollar sign --%3E%3Ccircle cx='80' cy='440' r='28'/%3E%3Cline x1='80' y1='440' x2='80' y2='420'/%3E%3Cline x1='80' y1='440' x2='95' y2='445'/%3E%3Ccircle cx='80' cy='440' r='2' fill='%231b2a4a' opacity='0.06'/%3E%3Cpath d='M115 430 L125 425 L125 455 L115 450' stroke-dasharray='2,2'/%3E%3Ctext x='118' y='443' font-size='10' fill='%231b2a4a' opacity='0.06' font-family='sans-serif' stroke='none'>$</text>%3E%3C!-- FREELANCE: Laptop with rate --%3E%3Crect x='240' y='425' width='55' height='35' rx='3'/%3E%3Cpath d='M233 460 L302 460 L297 467 L238 467 Z'/%3E%3Cline x1='255' y1='438' x2='280' y2='438' stroke-width='1'/%3E%3Cline x1='255' y1='445' x2='273' y2='445' stroke-width='1'/%3E%3Cpath d='M300 430 L320 425'/%3E%3Ctext x='305' y='425' font-size='9' fill='%231b2a4a' opacity='0.06' font-family='sans-serif' stroke='none'>$/hr</text>%3E%3C!-- SIDE HUSTLE: Light bulb with coins --%3E%3Cpath d='M460 420 Q440 430 440 450 Q440 460 450 465 L470 465 Q480 460 480 450 Q480 430 460 420'/%3E%3Cline x1='452' y1='465' x2='452' y2='472'/%3E%3Cline x1='468' y1='465' x2='468' y2='472'/%3E%3Cline x1='450' y1='472' x2='470' y2='472'/%3E%3Cpath d='M460 435 L460 450 M453 443 L467 443'/%3E%3Cellipse cx='495' cy='460' rx='8' ry='3'/%3E%3Cellipse cx='495' cy='457' rx='8' ry='3'/%3E%3C!-- RENT VS BUY: Two houses with vs --%3E%3Cpath d='M620 430 L640 415 L660 430'/%3E%3Crect x='625' y='430' width='30' height='20'/%3E%3Cpath d='M700 430 L720 415 L740 430'/%3E%3Crect x='705' y='430' width='30' height='20'/%3E%3Ctext x='675' y='435' font-size='11' fill='%231b2a4a' opacity='0.06' font-family='sans-serif' stroke='none'>vs</text>%3E%3C!-- REFINANCE: Downward arrow with percent --%3E%3Cpath d='M80 600 L80 640'/%3E%3Cpolygon points='70,635 90,635 80,648' fill='%231b2a4a' opacity='0.06'/%3E%3Ccircle cx='95' cy='610' r='4'/%3E%3Ccircle cx='107' cy='625' r='4'/%3E%3Cline x1='110' y1='607' x2='92' y2='628'/%3E%3C!-- PIE CHART with segments --%3E%3Ccircle cx='270' cy='620' r='25'/%3E%3Cline x1='270' y1='620' x2='270' y2='595'/%3E%3Cline x1='270' y1='620' x2='292' y2='630'/%3E%3Cline x1='270' y1='620' x2='250' y2='635'/%3E%3C!-- RISING STEPS (wealth building) --%3E%3Cpath d='M430 650 L430 640 L450 640 L450 625 L470 625 L470 608 L490 608 L490 590 L510 590'/%3E%3Cpath d='M510 590 L505 595 M510 590 L515 595'/%3E%3C!-- CALCULATOR with equals sign --%3E%3Crect x='630' y='590' width='50' height='65' rx='6'/%3E%3Crect x='638' y='598' width='34' height='14' rx='2'/%3E%3Ccircle cx='645' cy='622' r='3'/%3E%3Ccircle cx='660' cy='622' r='3'/%3E%3Ccircle cx='645' cy='636' r='3'/%3E%3Ccircle cx='660' cy='636' r='3'/%3E%3Crect x='670' y='620' width='3' height='20' rx='1' fill='%231b2a4a' opacity='0.06'/%3E%3Cline x1='680' y1='627' x2='692' y2='627' stroke-width='1.5'/%3E%3Cline x1='680' y1='633' x2='692' y2='633' stroke-width='1.5'/%3E%3C!-- Scattered hand-drawn dots and marks --%3E%3Ccircle cx='180' cy='140' r='2' fill='%231b2a4a' opacity='0.04'/%3E%3Ccircle cx='195' cy='155' r='2' fill='%231b2a4a' opacity='0.04'/%3E%3Ccircle cx='560' cy='140' r='2' fill='%231b2a4a' opacity='0.04'/%3E%3Cpath d='M380 350 Q390 340 400 350 Q410 360 420 350' opacity='0.04'/%3E%3Cpath d='M170 510 Q180 500 190 510' opacity='0.04'/%3E%3Cpath d='M560 500 L570 490 L580 500' opacity='0.04'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
}

/* ===== NAVIGATION ===== */
.nav {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px var(--shadow);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.nav-brand span { color: var(--teal); }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  transition: all 0.2s;
  position: relative;
}
.nav-links a:hover { background: var(--cream); }
.nav-links a.active { color: var(--navy); font-weight: 600; }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 14px; right: 14px;
  height: 2px;
  border-radius: 2px;
}
/* Cluster-specific nav colors */
.nav-links a[data-cluster="mortgage"]:hover, .nav-links a[data-cluster="mortgage"].active { color: var(--green); }
.nav-links a[data-cluster="mortgage"].active::after { background: var(--green); }
.nav-links a[data-cluster="debt"]:hover, .nav-links a[data-cluster="debt"].active { color: var(--orange); }
.nav-links a[data-cluster="debt"].active::after { background: var(--orange); }
.nav-links a[data-cluster="income"]:hover, .nav-links a[data-cluster="income"].active { color: var(--blue); }
.nav-links a[data-cluster="income"].active::after { background: var(--blue); }
.nav-links a[data-cluster="investing"]:hover, .nav-links a[data-cluster="investing"].active { color: var(--purple); }
.nav-links a[data-cluster="investing"].active::after { background: var(--purple); }
.nav-links a[data-cluster="about"]:hover, .nav-links a[data-cluster="about"].active { color: var(--text-muted); }

.nav-hamburger { display: none; cursor: pointer; font-size: 24px; background: none; border: none; color: var(--navy); }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw + 1rem, 3.5rem);
  color: var(--navy);
  margin: 0 0 16px;
  line-height: 1.15;
  letter-spacing: -1px;
}
.hero h1 span { color: var(--teal); }
.hero .subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* ===== TOOL GRID ===== */
.tools-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 60px;
}
.tools-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2rem);
  color: var(--navy);
  text-align: center;
  margin: 0 0 12px;
}
.tools-section .section-desc {
  text-align: center;
  color: var(--text-light);
  margin: 0 0 40px;
  font-size: 1.05rem;
}
.cluster-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 48px 0 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.cluster-label.mortgage { color: var(--green); border-color: var(--green); }
.cluster-label.debt { color: var(--orange); border-color: var(--orange); }
.cluster-label.income { color: var(--blue); border-color: var(--blue); }
.cluster-label.investing { color: var(--purple); border-color: var(--purple); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.tool-card {
  background: white;
  border-radius: 12px;
  padding: 28px 24px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 12px 12px 0 0;
  transition: height 0.3s;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow-hover);
  border-color: transparent;
}
.tool-card:hover::before { height: 4px; }
.tool-card.mortgage::before { background: var(--green); }
.tool-card.debt::before { background: var(--orange); }
.tool-card.income::before { background: var(--blue); }
.tool-card.investing::before { background: var(--purple); }

.tool-card .tool-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.tool-card.mortgage .tool-icon { background: #e8f5e9; color: var(--green); }
.tool-card.debt .tool-icon { background: #fff3e0; color: var(--orange); }
.tool-card.income .tool-icon { background: #e3f2fd; color: var(--blue); }
.tool-card.investing .tool-icon { background: #f3e5f5; color: var(--purple); }

.tool-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--navy);
  margin: 0 0 8px;
}
.tool-card p {
  font-size: 0.92rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.5;
}
.tool-card .cpc-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 12px;
  font-weight: 500;
}
.tool-card.mortgage .cpc-badge { background: #e8f5e9; color: var(--green); }
.tool-card.debt .cpc-badge { background: #fff3e0; color: var(--orange); }
.tool-card.income .cpc-badge { background: #e3f2fd; color: var(--blue); }
.tool-card.investing .cpc-badge { background: #f3e5f5; color: var(--purple); }

/* ===== CALCULATOR PAGE LAYOUT ===== */
.page-wrapper {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.page-wrapper.wide { max-width: 960px; }
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--teal); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.calc-header h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--navy);
  margin: 0 0 8px;
  line-height: 1.2;
}
.calc-header .calc-desc {
  font-size: 1.05rem;
  color: var(--text-light);
  margin: 0 0 32px;
  line-height: 1.6;
}

/* ===== CALCULATOR FORM ===== */
.calc-box {
  background: white;
  border-radius: 16px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
  margin-bottom: 32px;
}
.calc-box h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--navy);
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--cream);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}
.form-group label .hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.form-group input, .form-group select {
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--cream);
  color: var(--navy);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42,157,143,0.15);
}
.input-prefix {
  position: relative;
}
.input-prefix::before {
  content: '$';
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono);
  color: #bbb;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 1;
}
.input-prefix input { padding-left: 28px; }
.input-suffix {
  position: relative;
}
.input-suffix::after {
  content: attr(data-suffix);
  position: absolute;
  right: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}
.input-suffix input { padding-right: 40px; }

.range-group { margin-top: 4px; }
.range-group input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(to right, #2a9d8f, #c9a84c, #e76f51);
  outline: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.range-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 3px solid var(--navy);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.range-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}
.range-group input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.05);
  border-color: var(--teal);
}
.range-group input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 3px solid var(--navy);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.range-group input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(to right, #2a9d8f, #c9a84c, #e76f51);
  border: none;
}
.range-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--teal);
  font-weight: 600;
  text-align: right;
  margin-top: 4px;
}

.btn-calculate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 36px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}
.btn-calculate.green { background: var(--green); color: white; }
.btn-calculate.green:hover { background: #245a42; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(45,106,79,0.3); }
.btn-calculate.orange { background: var(--orange); color: white; }
.btn-calculate.orange:hover { background: #d4842e; }
.btn-calculate.blue { background: var(--blue); color: white; }
.btn-calculate.blue:hover { background: #3d6fad; }
.btn-calculate.purple { background: var(--purple); color: white; }
.btn-calculate.purple:hover { background: #6a4e94; }
.btn-calculate.teal { background: var(--teal); color: white; }
.btn-calculate.teal:hover { background: #228b7e; }

/* ===== RESULTS ===== */
.results-box {
  background: white;
  border-radius: 16px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
  margin-bottom: 32px;
  display: none;
}
.results-box.visible { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.result-highlight {
  text-align: center;
  padding: 24px;
  background: var(--cream);
  border-radius: 12px;
  margin-bottom: 24px;
}
.result-highlight .big-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.result-highlight .big-label {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 4px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.result-item {
  text-align: center;
  padding: 16px;
  background: var(--cream);
  border-radius: 10px;
}
.result-item .value {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
}
.result-item .label {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* Amortization table */
.amort-table-wrap {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 16px;
}
.amort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.amort-table th {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
  background: var(--navy);
  padding: 10px 12px;
  position: sticky;
  top: 0;
  text-align: right;
}
.amort-table th:first-child { text-align: center; }
.amort-table td {
  font-family: var(--font-mono);
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  text-align: right;
  font-size: 0.82rem;
}
.amort-table td:first-child { text-align: center; color: var(--text-muted); }
.amort-table tr:nth-child(even) { background: var(--cream); }

/* Chart container */
.chart-container {
  margin: 24px 0;
  padding: 16px;
  background: var(--cream);
  border-radius: 12px;
}
.chart-container canvas { max-height: 350px; }

/* ===== SUPPORTING CONTENT ===== */
.content-section {
  background: white;
  border-radius: 16px;
  padding: 40px 36px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.content-section h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--navy);
  margin: 0 0 16px;
}
.content-section h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--navy);
  margin: 24px 0 8px;
}
.content-section p {
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.75;
}
.content-section ul {
  padding-left: 20px;
  margin: 0 0 14px;
}
.content-section li {
  margin-bottom: 6px;
  line-height: 1.6;
  color: var(--text);
}

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-q::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--teal);
  font-weight: 300;
  transition: transform 0.3s;
}
.faq-item.open .faq-q::after { content: '\2212'; }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s;
  color: var(--text-light);
  line-height: 1.7;
}
.faq-item.open .faq-a { max-height: 500px; padding-top: 12px; }

/* Related tools */
.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.related-card {
  padding: 20px;
  background: var(--cream);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.related-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}
.related-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--navy);
  margin: 0 0 4px;
}
.related-card p { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

/* ===== AD PLACEHOLDERS ===== */
.ad-unit {
  background: var(--cream-dark);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 24px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-unit.leaderboard { min-height: 90px; }
.ad-unit.in-article { min-height: 250px; }
.ad-unit.sidebar { min-height: 600px; }

/* ===== FOOTER ===== */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 48px 24px 32px;
  margin-top: 60px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer h4 {
  font-family: var(--font-display);
  color: white;
  font-size: 1rem;
  margin: 0 0 16px;
}
.footer p { font-size: 0.88rem; line-height: 1.6; margin: 0 0 8px; }
.footer a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.88rem; display: block; margin-bottom: 8px; transition: color 0.2s; }
.footer a:hover { color: var(--gold-light); }
.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom a { display: inline; margin: 0 0 0 16px; }

/* ===== FLUID TYPOGRAPHY (scales smoothly between mobile and desktop) ===== */
html {
  /* Base font scales from 16px at 320px viewport to 18px at 1200px */
  font-size: clamp(16px, 14.5px + 0.5vw, 19px);
}

/* ===== RESPONSIVE: TABLET (768px and below) ===== */
/* [original 768px block replaced — see fluid mobile below] */


/* [original 480px block replaced] */




/* ===== FIX: Mobile debt row layout ===== */
@media(max-width:768px){
  .debt-row{
    grid-template-columns:1fr 1fr !important;
    gap:10px !important;
    margin-bottom:14px !important;
  }
  .debt-row > div:first-child{
    grid-column:1 / -1 !important;
  }
  .debt-row > div{
    width:100% !important;
  }
  .debt-row > div > input{
    width:100% !important;
    min-height:48px !important;
    font-size:1rem !important;
    box-sizing:border-box !important;
  }
  .debt-row > button{
    grid-column:1 / -1 !important;
    width:100% !important;
    height:44px !important;
    font-size:1rem !important;
    margin-top:4px !important;
  }
}
@media(max-width:420px){
  .debt-row{
    grid-template-columns:1fr !important;
  }
}

/* ===== FIX: Dollar sign input readability ===== */
.input-prefix input{
  text-indent:0;
}
@media(max-width:768px){
  .input-prefix::before{
    font-size:0.9rem;
    left:12px;
    color:#aaa;
    font-weight:500;
  }
  .input-prefix input{
    padding-left:32px !important;
    font-size:1rem !important;
    text-indent:0 !important;
  }
}
@media(max-width:480px){
  .input-prefix::before{
    font-size:0.95rem;
    left:14px;
  }
  .input-prefix input{
    padding-left:36px !important;
    font-size:1.05rem !important;
  }
}

/* ===== FIX: Chart container mobile optimization ===== */
@media(max-width:768px){
  .chart-container{
    padding:12px 8px;
    margin:16px 0;
    border-radius:10px;
  }
  .chart-container canvas{
    max-height:300px !important;
    width:100% !important;
    aspect-ratio: 4/3;
  }
}
@media(max-width:480px){
  .chart-container canvas{
    max-height:260px !important;
    aspect-ratio: 1/1;
  }
}

/* Share sidebar removed — using mobile FAB + results share only */

/* ===== FIX: Results share bar — only visible when parent results are shown ===== */
.results-share{
  display:flex;
  opacity:1;
  visibility:visible;
}

/* ===== FIX: Range slider value display ===== */
.range-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--navy);
  font-weight: 700;
  text-align: center;
  margin-top: 8px;
  background: var(--cream);
  padding: 4px 12px;
  border-radius: 6px;
  display: inline-block;
}

/* ===== FIX: Mobile share - horizontal bar at bottom of results ===== */
@media(max-width:768px){
  .results-share{
    flex-wrap:wrap;
    justify-content:center;
    gap:10px;
    padding:16px 0;
  }
  .results-share a,
  .results-share button{
    width:42px !important;
    height:42px !important;
  }
  .results-share svg{
    width:18px !important;
    height:18px !important;
  }
}

/* ===== FIX: Range slider on mobile ===== */
@media(max-width:768px){
  .range-group input[type="range"]{
    height:12px !important;
    border-radius:6px !important;
  }
  .range-group input[type="range"]::-webkit-slider-thumb{
    width:30px !important;
    height:30px !important;
    border-width:3px !important;
  }
  .range-value{
    font-size:1.2rem !important;
    padding:6px 16px !important;
  }
}

/* ===== FIX: Mobile share — collapsible FAB button ===== */
@media(max-width:768px){
  #mobileShareBar{
    display:none !important;
  }
  .mobile-bottom-nav{
    bottom:0 !important;
  }
}
@media(min-width:769px){
  #mobileShareBar{
    display:none !important;
  }
  .mobile-share-fab{
    display:none !important;
  }
}

/* Mobile Share FAB (Floating Action Button) */
.mobile-share-fab{
  display:none;
  position:fixed;
  bottom:72px;
  left:16px;
  z-index:9996;
}
@media(max-width:768px){
  .mobile-share-fab{
    display:block;
  }
}
.mobile-share-fab .share-fab-btn{
  width:46px;height:46px;border-radius:50%;background:#2a9d8f;color:#fff;border:none;
  cursor:pointer;box-shadow:0 3px 14px rgba(0,0,0,0.2);display:flex;align-items:center;
  justify-content:center;transition:all .25s;position:relative;z-index:2;
}
.mobile-share-fab .share-fab-btn:active{transform:scale(0.92);}
.mobile-share-fab .share-fab-btn svg{width:20px;height:20px;}
.mobile-share-fab .share-fab-menu{
  position:absolute;bottom:54px;left:0;display:flex;flex-direction:column;gap:8px;
  opacity:0;visibility:hidden;transform:translateY(10px);transition:all .25s ease;
}
.mobile-share-fab.open .share-fab-menu{
  opacity:1;visibility:visible;transform:translateY(0);
}
.mobile-share-fab .share-fab-menu a,
.mobile-share-fab .share-fab-menu button{
  width:42px;height:42px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;text-decoration:none;border:none;cursor:pointer;
  box-shadow:0 2px 10px rgba(0,0,0,0.15);padding:0;transition:transform .2s;
}
.mobile-share-fab .share-fab-menu a:active,
.mobile-share-fab .share-fab-menu button:active{transform:scale(0.9);}
.mobile-share-fab .share-fab-menu svg{width:16px;height:16px;}

/* ===== FIX: Remove any stray text from favicon injection ===== */
body > svg:first-child,
body > img[src*="money"],
body > [style*="money"] {
  display: none !important;
}

/* ===== FORMULA DISPLAY — Scientific/Academic Style ===== */
.formula-block {
  background: linear-gradient(135deg, var(--cream) 0%, #f4f3ee 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: 0 12px 12px 0;
  padding: 24px 28px;
  margin: 20px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
@media(prefers-color-scheme:dark){
  .formula-block{background:linear-gradient(135deg,#2a2a48 0%,#222240 100%);border-color:#444;border-left-color:var(--teal);}
}
.formula-block .formula-label {
  position: absolute;
  top: 8px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.formula-block .formula-math {
  font-family: 'Cambria Math', 'STIX Two Math', 'Latin Modern Math', Georgia, 'Times New Roman', serif;
  font-size: 1.35rem;
  color: var(--navy);
  line-height: 2.2;
  letter-spacing: 0.5px;
}
@media(prefers-color-scheme:dark){.formula-block .formula-math{color:#e8e8f0;}}
.formula-block .formula-math .var {
  font-style: italic;
  font-weight: 400;
}
.formula-block .formula-math .fn {
  font-style: normal;
  font-weight: 400;
}
.formula-block .formula-math sub {
  font-size: 0.7em;
  vertical-align: sub;
}
.formula-block .formula-math sup {
  font-size: 0.7em;
  vertical-align: super;
}
.formula-block .formula-math .frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin: 0 4px;
}
.formula-block .formula-math .frac-num,
.formula-block .formula-math .frac-den {
  display: block;
  padding: 2px 8px;
  line-height: 1.4;
  font-size: 0.95em;
}
.formula-block .formula-math .frac-num {
  border-bottom: 2px solid var(--navy);
}
@media(prefers-color-scheme:dark){.formula-block .formula-math .frac-num{border-color:#aaa;}}
.formula-block .formula-where {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.8;
}
.formula-block .formula-where strong {
  font-family: 'Cambria Math', Georgia, serif;
  font-style: italic;
  color: var(--navy);
  font-weight: 400;
}
@media(prefers-color-scheme:dark){.formula-block .formula-where strong{color:#c0c0d0;}}
@media(max-width:480px){
  .formula-block{padding:18px 16px;}
  .formula-block .formula-math{font-size:1.1rem;line-height:2;}
  .formula-block .formula-where{font-size:0.82rem;}
}

/* Footer h3 styled like old h4 */
.footer .footer-heading {
  font-family: var(--font-display);
  color: white;
  font-size: 1rem;
  margin: 0 0 16px;
  font-weight: 700;
}

/* Better ad unit contrast */
.ad-unit {
  color: #888;
}

/* Better footer link touch targets */
.footer-bottom a {
  padding: 4px 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.footer-bottom {
  gap: 8px;
}

/* Remove share sidebar completely */
.share-sidebar { display: none !important; }

/* ===========================================================
   MOBILE RESPONSIVE — Single Source of Truth
   Fluid typography: scales from 320px to 768px viewport
   Minimum font: 14px body text, never smaller
   =========================================================== */

@media (max-width: 768px) {
  /* Root font: 15.5px at 320px → 18px at 768px */
  html { font-size: clamp(15.5px, 14px + 0.6vw, 18px) !important; }

  /* --- NAV --- */
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: white; padding: 12px 16px; border-bottom: 1px solid var(--border);
    flex-direction: column; box-shadow: 0 8px 24px var(--shadow); gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 16px; font-size: 1rem; border-radius: 8px; }
  .nav-hamburger { display: block; }
  .nav-brand { font-size: clamp(20px, 18px + 0.8vw, 26px); }

  /* --- HERO --- */
  .hero { padding: clamp(28px, 5vw, 48px) 16px clamp(20px, 4vw, 36px); }
  .hero h1 { font-size: clamp(1.6rem, 1.3rem + 1.5vw, 2.6rem); }
  .hero .subtitle { font-size: clamp(1rem, 0.9rem + 0.4vw, 1.2rem); }

  /* --- TOOL GRID / CARDS --- */
  .tool-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tool-card { padding: clamp(16px, 3vw, 22px); border-radius: 10px; }
  .tool-card h3 { font-size: clamp(1rem, 0.9rem + 0.4vw, 1.15rem); }
  .tool-card p { font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1rem); line-height: 1.5; }
  .tools-section { padding: 0 14px 30px; }
  .tools-section h2 { font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.7rem); }
  .tools-section .section-desc { font-size: clamp(0.95rem, 0.88rem + 0.3vw, 1.1rem); }
  .cluster-label { font-size: clamp(0.78rem, 0.72rem + 0.25vw, 0.88rem); margin: 28px 0 14px; }

  /* --- PAGE WRAPPER --- */
  .page-wrapper { padding: 20px 14px 60px; }
  .page-wrapper.wide { max-width: 100%; }
  .breadcrumb { font-size: clamp(0.8rem, 0.75rem + 0.2vw, 0.9rem); margin-bottom: 12px; }

  /* --- CALCULATOR HEADER --- */
  .calc-header h1 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 2rem); line-height: 1.25; }
  .calc-header .calc-desc { font-size: clamp(0.95rem, 0.88rem + 0.3vw, 1.1rem); margin-bottom: 16px; }

  /* --- FORM / INPUTS --- */
  .calc-box, .results-box, .content-section { padding: 20px 16px; border-radius: 12px; }
  .calc-box { margin-bottom: 18px; }
  .calc-box h2 { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem); margin-bottom: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .form-group label { font-size: clamp(0.88rem, 0.82rem + 0.25vw, 1rem); margin-bottom: 5px; }
  .form-group input, .form-group select {
    font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.1rem);
    padding: 12px 14px;
    min-height: 48px;
  }
  .input-prefix input { padding-left: 32px; }

  /* --- BUTTON --- */
  .btn-calculate {
    width: 100%; padding: 16px 24px;
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.15rem);
    border-radius: 10px; justify-content: center;
    position: relative; z-index: 10;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(42,157,143,0.3);
  }

  /* --- RESULTS --- */
  .results-box { margin-bottom: 18px; }
  .result-highlight { padding: 18px 14px; border-radius: 10px; margin-bottom: 16px; }
  .result-highlight .big-number { font-size: clamp(2rem, 1.6rem + 1.5vw, 3rem); }
  .result-highlight .big-label { font-size: clamp(0.88rem, 0.82rem + 0.25vw, 1rem); }
  .result-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .result-item { padding: 12px 10px; border-radius: 8px; }
  .result-item .value { font-size: clamp(1rem, 0.92rem + 0.3vw, 1.2rem); }
  .result-item .label { font-size: clamp(0.8rem, 0.75rem + 0.2vw, 0.9rem); }

  /* --- CONTENT SECTIONS --- */
  .content-section { margin-bottom: 16px; }
  .content-section h2 { font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.5rem); }
  .content-section h3 { font-size: clamp(1.05rem, 0.95rem + 0.35vw, 1.2rem); }
  .content-section p { font-size: clamp(0.92rem, 0.88rem + 0.2vw, 1.05rem); line-height: 1.7; }
  .content-section li { font-size: clamp(0.92rem, 0.88rem + 0.2vw, 1.02rem); }

  /* --- FAQ --- */
  .faq-q { font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.1rem); padding: 4px 0; }
  .faq-a { font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1rem); }

  /* --- RELATED --- */
  .related-tools { grid-template-columns: 1fr 1fr; gap: 10px; }
  .related-card { padding: 14px; border-radius: 8px; }
  .related-card h4 { font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1rem); }
  .related-card p { font-size: clamp(0.82rem, 0.78rem + 0.2vw, 0.92rem); }

  /* --- TABLES --- */
  .amort-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .amort-table { min-width: 420px; }
  .amort-table th { font-size: clamp(0.7rem, 0.65rem + 0.2vw, 0.82rem); padding: 7px 5px; }
  .amort-table td { font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.85rem); padding: 6px 5px; }

  /* --- CHARTS --- */
  .chart-container { padding: 10px 4px; margin: 14px 0; border-radius: 10px; }
  .chart-container canvas { max-height: 280px; }

  /* --- FORMULA --- */
  .formula-block { padding: 16px 14px; margin: 14px 0; }
  .formula-block .formula-math { font-size: clamp(1rem, 0.92rem + 0.35vw, 1.25rem); }
  .formula-block .formula-where { font-size: clamp(0.82rem, 0.78rem + 0.2vw, 0.92rem); }

  /* --- ADS --- */
  .ad-unit { min-height: 50px; margin: 12px 0; font-size: 0.75rem; }
  .ad-unit.in-article { min-height: 100px; }

  /* --- FOOTER --- */
  .footer { padding: 28px 16px 20px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer .footer-heading { font-size: clamp(0.92rem, 0.88rem + 0.2vw, 1.05rem); margin-bottom: 10px; }
  .footer a { font-size: clamp(0.85rem, 0.82rem + 0.15vw, 0.95rem); margin-bottom: 5px; min-height: 38px; display: flex; align-items: center; }
  .footer p { font-size: clamp(0.85rem, 0.82rem + 0.15vw, 0.95rem); }
  .footer-bottom { font-size: clamp(0.78rem, 0.74rem + 0.15vw, 0.85rem); }
  .footer-bottom a { min-height: 38px; padding: 2px 6px; }

  /* --- CHAT FAB --- */
  #fc-toggle { width: 44px; height: 44px; bottom: 14px; right: 14px; }
  #fc-toggle svg { width: 20px; height: 20px; }
  #fc-toggle::after { width: 8px; height: 8px; top: 4px; right: 4px; }
  #fc-chat { width: calc(100vw - 16px); height: calc(100vh - 80px); right: 8px; bottom: 68px; border-radius: 12px; }

  /* --- BODY PADDING --- */
  body { padding-bottom: 0 !important; }
}

/* --- SMALL MOBILE (480px) --- */
@media (max-width: 480px) {
  .tool-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .related-tools { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
}


/* === Save Icon — small hover icon on result cards === */
.result-highlight,
.result-item {
  position: relative;
}
.save-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: rgba(27,42,74,0.08);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  padding: 0;
  z-index: 5;
}
.save-icon svg {
  width: 13px;
  height: 13px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
.result-highlight:hover .save-icon,
.result-item:hover .save-icon {
  opacity: 1;
}
.save-icon:hover {
  background: rgba(42,157,143,0.15);
}
.save-icon:hover svg {
  stroke: var(--teal);
}
.save-icon:active {
  transform: scale(0.9);
}
/* On mobile: always visible but smaller */
@media (max-width: 768px) {
  .save-icon {
    opacity: 0.6;
    width: 22px;
    height: 22px;
    top: 4px;
    right: 4px;
  }
  .save-icon svg {
    width: 11px;
    height: 11px;
  }
}
/* Saving toast */
.save-toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--navy);
  color: white;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  z-index: 99999;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}
.save-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== CALC SIDEBAR (fincalcs.co pattern) ===== */
.calc-sidebar{width:210px;flex-shrink:0;position:sticky;top:80px;}
.sidebar-cluster{background:white;border:1px solid var(--border);border-radius:10px;padding:16px;margin-bottom:14px;box-shadow:0 2px 8px var(--shadow);}
.sidebar-cluster h4{font-family:var(--font-display);font-size:.88rem;color:var(--navy);margin:0 0 10px;padding-bottom:8px;border-bottom:2px solid var(--teal);}
.sidebar-cluster a{display:block;font-size:.84rem;color:var(--text-light);text-decoration:none;padding:6px 10px;border-radius:6px;margin-bottom:2px;transition:all .15s;line-height:1.35;}
.sidebar-cluster a:hover{background:var(--cream);color:var(--teal);}
.sidebar-cluster a.active{background:var(--teal);color:white;font-weight:600;}
@media(max-width:900px){.calc-sidebar{display:none;}.page-wrapper.wide{display:block!important;}}
@media(prefers-color-scheme:dark){.sidebar-cluster{background:#222240;border-color:#333;}}

/* ===== FORMULA BLOCK ===== */
.formula-block{margin:12px 0;padding:16px 20px;background:var(--cream-dark);border-radius:10px;}
.formula-label{font-family:var(--font-body);font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);margin-bottom:8px;display:block;}
.formula-math{font-family:var(--font-mono);font-size:1rem;color:var(--navy);line-height:1.8;}
.formula-where{font-size:.85rem;color:var(--text-light);margin-top:8px;line-height:1.6;}

/* ===== LIFESTYLE CLUSTER COLOR ===== */
.nav-links a[data-cluster="lifestyle"]:hover,.nav-links a[data-cluster="lifestyle"].active{color:var(--coral);}
.nav-links a[data-cluster="lifestyle"].active::after{background:var(--coral);}
.sidebar-cluster.lifestyle h4{border-color:var(--coral);}

/* ===== DARK MODE SIDEBAR ===== */
@media(prefers-color-scheme:dark){
  .calc-sidebar .sidebar-cluster{background:#222240;border-color:#333;}
  .formula-block{background:#2a2a48;}
}

/* ===== HOMEPAGE CLUSTER LABELS ===== */
.cluster-label.lifestyle{color:var(--coral);border-color:var(--coral);}
.tool-card.lifestyle::before{background:var(--coral);}
.tool-card.lifestyle .tool-icon{background:#fef2f2;color:var(--coral);}
.tool-card.lifestyle .cpc-badge{background:#fef2f2;color:var(--coral);}
/* UtilityEmpire.com — Clean Professional Light Theme 2026 */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg:           #f9f8f4;
  --surface:      #ffffff;
  --card:         #ffffff;
  --border:       #e5e2da;
  --border-dark:  #cac7bd;
  --text:         #18181b;
  --text-2:       #3f3f46;
  --muted:        #71717a;
  --faint:        #f4f2ed;

  --blue:         #2563eb;
  --blue-light:   #eff6ff;
  --blue-border:  #bfdbfe;

  /* Nav per-item hover colors */
  --nav-home:    #2563eb;
  --nav-sub:     #059669;
  --nav-ai:      #7c3aed;
  --nav-stress:  #ea580c;
  --nav-commute: #dc2626;
  --nav-mental:  #0891b2;
  --nav-about:   #64748b;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius:    8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image: url('../images/doodle-bg.svg');
  background-repeat: repeat;
  background-size: 600px 600px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-brand strong { color: var(--blue); }

.nav-links { display: flex; align-items: center; gap: 0; list-style: none; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem; font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  position: relative;
}
/* Per-item colors on hover/active */
.nav-links li:nth-child(1) a:hover,.nav-links li:nth-child(1) a.active{color:var(--nav-home);  background:#eff6ff;}
.nav-links li:nth-child(2) a:hover,.nav-links li:nth-child(2) a.active{color:var(--nav-sub);   background:#ecfdf5;}
.nav-links li:nth-child(3) a:hover,.nav-links li:nth-child(3) a.active{color:var(--nav-ai);    background:#f5f3ff;}
.nav-links li:nth-child(4) a:hover,.nav-links li:nth-child(4) a.active{color:var(--nav-stress);background:#fff7ed;}
.nav-links li:nth-child(5) a:hover,.nav-links li:nth-child(5) a.active{color:var(--nav-commute);background:#fef2f2;}
.nav-links li:nth-child(6) a:hover,.nav-links li:nth-child(6) a.active{color:var(--nav-mental);background:#ecfeff;}
.nav-links li:nth-child(7) a:hover,.nav-links li:nth-child(7) a.active{color:var(--nav-about); background:#f8fafc;}

.nav-links a.active::after {
  content:''; position:absolute; bottom:2px; left:0.8rem; right:0.8rem;
  height:2px; border-radius:2px; background:currentColor;
}

.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; background: none; border: none; padding: 4px;
}
.nav-hamburger span { display:block; width:22px; height:2px; background:var(--text); border-radius:2px; transition:all .3s; }

.nav-mobile {
  display: none; position: fixed; top:68px; left:0; right:0;
  background:#fff; border-bottom:1px solid var(--border);
  padding:.75rem 1rem; z-index:999;
  flex-direction:column; gap:2px;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
}
.nav-mobile.open { display:flex; }
.nav-mobile a {
  color:var(--text-2); text-decoration:none;
  font-size:.95rem; font-weight:600;
  padding:.7rem 1rem; border-radius:var(--radius); transition:all .18s;
}
.nav-mobile a:nth-child(1):hover{color:var(--nav-home);  background:#eff6ff;}
.nav-mobile a:nth-child(2):hover{color:var(--nav-sub);   background:#ecfdf5;}
.nav-mobile a:nth-child(3):hover{color:var(--nav-ai);    background:#f5f3ff;}
.nav-mobile a:nth-child(4):hover{color:var(--nav-stress);background:#fff7ed;}
.nav-mobile a:nth-child(5):hover{color:var(--nav-commute);background:#fef2f2;}
.nav-mobile a:nth-child(6):hover{color:var(--nav-mental);background:#ecfeff;}
.nav-mobile a:nth-child(7):hover{color:var(--nav-about); background:#f8fafc;}

/* ── LAYOUT ──────────────────────────────────────────────────── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.75rem; }
.page-wrap { padding: 3.5rem 0 6rem; }

/* ── HERO ────────────────────────────────────────────────────── */
.hero { padding: 5.5rem 1.75rem 4.5rem; text-align: center; position: relative; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; color: var(--blue); text-transform: uppercase;
  background: var(--blue-light); border: 1px solid var(--blue-border);
  padding: .35rem 1rem; border-radius: 20px; margin-bottom: 1.5rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 900; line-height: 1.06; letter-spacing: -.03em;
  color: var(--text); max-width: 860px; margin: 0 auto 1.5rem;
}
.hero h1 em {
  font-style: italic;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub {
  font-size: 1.2rem; color: var(--muted);
  max-width: 600px; margin: 0 auto 2.5rem; line-height: 1.7;
}
.hero-cta-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.75rem; border-radius: var(--radius);
  font-family: var(--font-body); font-size: .95rem; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: all .2s; border: none;
}
.btn-primary {
  background: var(--blue); color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,.35); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border-dark);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.btn-full { width: 100%; justify-content: center; font-size: 1rem; padding: .9rem; }
.btn-sm { padding: .45rem 1rem; font-size: .83rem; }

/* ── TRUST BAR ───────────────────────────────────────────────── */
.trust-bar { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1.4rem 0; }
.trust-bar-inner { max-width: 1120px; margin: 0 auto; padding: 0 1.75rem; display: flex; justify-content: center; gap: 4rem; flex-wrap: wrap; text-align: center; }
.trust-stat .ts-num { font-family: var(--font-display); font-size: 2.2rem; font-weight: 900; color: var(--blue); line-height: 1.1; }
.trust-stat .ts-label { font-size: .78rem; color: var(--muted); font-weight: 600; margin-top: 2px; letter-spacing: .02em; }

/* ── SECTION HEADERS ─────────────────────────────────────────── */
.section-header { margin-bottom: 2.5rem; }
.section-header .eyebrow {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 600;
  letter-spacing: .14em; color: var(--blue); text-transform: uppercase;
  margin-bottom: .65rem; display: block;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 900;
  letter-spacing: -.025em; line-height: 1.15; color: var(--text);
}
.section-header p { color: var(--muted); margin-top: .75rem; font-size: 1.05rem; max-width: 640px; line-height: 1.7; }

/* ── TOOL CARDS ──────────────────────────────────────────────── */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px,1fr)); gap: 1.5rem; margin-top: 2.5rem; }

.tool-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  text-decoration: none; display: block;
  transition: all .22s; box-shadow: var(--shadow-sm);
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tool-card .tc-number {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: .75rem; display: block;
}
.tool-card .tc-title {
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 700;
  color: var(--text); margin-bottom: .6rem; line-height: 1.3;
}
.tool-card .tc-desc { color: var(--muted); font-size: .92rem; line-height: 1.62; }
.tool-card .tc-badge {
  display: inline-block; margin-top: 1.1rem;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 600;
  padding: .2rem .7rem; border-radius: 20px; letter-spacing: .06em;
}

/* Color themes per card */
.tool-card:nth-child(1){border-top:3px solid var(--nav-sub);}
.tool-card:nth-child(1) .tc-number{color:var(--nav-sub);}
.tool-card:nth-child(1) .tc-badge{color:var(--nav-sub);background:#ecfdf5;border:1px solid #a7f3d0;}
.tool-card:nth-child(1):hover{border-color:var(--nav-sub);}

.tool-card:nth-child(2){border-top:3px solid var(--nav-ai);}
.tool-card:nth-child(2) .tc-number{color:var(--nav-ai);}
.tool-card:nth-child(2) .tc-badge{color:var(--nav-ai);background:#f5f3ff;border:1px solid #ddd6fe;}
.tool-card:nth-child(2):hover{border-color:var(--nav-ai);}

.tool-card:nth-child(3){border-top:3px solid var(--nav-stress);}
.tool-card:nth-child(3) .tc-number{color:var(--nav-stress);}
.tool-card:nth-child(3) .tc-badge{color:var(--nav-stress);background:#fff7ed;border:1px solid #fed7aa;}
.tool-card:nth-child(3):hover{border-color:var(--nav-stress);}

.tool-card:nth-child(4){border-top:3px solid var(--nav-commute);}
.tool-card:nth-child(4) .tc-number{color:var(--nav-commute);}
.tool-card:nth-child(4) .tc-badge{color:var(--nav-commute);background:#fef2f2;border:1px solid #fecaca;}
.tool-card:nth-child(4):hover{border-color:var(--nav-commute);}

.tool-card:nth-child(5){border-top:3px solid var(--nav-mental);}
.tool-card:nth-child(5) .tc-number{color:var(--nav-mental);}
.tool-card:nth-child(5) .tc-badge{color:var(--nav-mental);background:#ecfeff;border:1px solid #a5f3fc;}
.tool-card:nth-child(5):hover{border-color:var(--nav-mental);}

/* ── TOOL PAGE HERO ──────────────────────────────────────────── */
.tool-hero { padding: 3rem 0 2rem; border-bottom: 1px solid var(--border); margin-bottom: 2.5rem; }
.tool-hero .eyebrow {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .14em; color: var(--blue); text-transform: uppercase;
  margin-bottom: .85rem; display: block;
}
.tool-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 900;
  letter-spacing: -.03em; line-height: 1.1; margin-bottom: .85rem;
}
.tool-hero p { color: var(--muted); max-width: 620px; line-height: 1.7; font-size: 1.05rem; }

.tool-layout { display: grid; grid-template-columns: 1fr 390px; gap: 2rem; align-items: start; }

/* ── FORMS ───────────────────────────────────────────────────── */
.form-panel {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}
.form-panel h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--text); }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .88rem; font-weight: 700; color: var(--text-2); margin-bottom: .45rem; }
.form-group .hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.form-control {
  width: 100%; background: var(--faint); border: 1.5px solid var(--border);
  color: var(--text); padding: .65rem .95rem; border-radius: var(--radius);
  font-family: var(--font-body); font-size: .95rem; transition: all .2s; outline: none;
}
.form-control:focus { background: var(--surface); border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-control::placeholder { color: #b0aaa0; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── RESULTS ─────────────────────────────────────────────────── */
.results-panel {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm);
  display: none;
}
.results-panel.visible { display: block; }
.results-panel h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.result-stat { background: var(--faint); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: .75rem; }
.result-stat .rs-label { font-size: .72rem; font-family: var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .25rem; font-weight: 600; }
.result-stat .rs-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 900; color: var(--blue); line-height: 1.15; }
.result-stat .rs-sub { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.results-grid .result-stat { margin-bottom: 0; }

/* ── SCORE RING ──────────────────────────────────────────────── */
.score-ring-wrap { display: flex; flex-direction: column; align-items: center; padding: 1.5rem 0; }
.score-ring { position: relative; width: 150px; height: 150px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .score-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring .score-number { font-family: var(--font-display); font-size: 2.2rem; font-weight: 900; color: var(--text); line-height: 1; }
.score-ring .score-label { font-size: .68rem; font-family: var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; font-weight: 600; }

/* ── RISK BADGES ─────────────────────────────────────────────── */
.risk-badge { display: inline-block; padding: .4rem 1.1rem; border-radius: 20px; font-family: var(--font-mono); font-size: .78rem; font-weight: 700; letter-spacing: .05em; margin-top: .75rem; }
.risk-low    { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.risk-medium { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.risk-high   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── CHART ───────────────────────────────────────────────────── */
.chart-wrap { margin-top: 1.5rem; background: var(--faint); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.chart-wrap canvas { max-height: 260px; }

/* ── SUB LIST ────────────────────────────────────────────────── */
.sub-list { list-style: none; margin: 1rem 0; }
.sub-item { display: flex; align-items: center; gap: .75rem; padding: .65rem .85rem; background: var(--faint); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .5rem; }
.sub-item .si-name { flex: 1; font-size: .9rem; font-weight: 500; }
.sub-item .si-cost { font-family: var(--font-mono); font-size: .88rem; color: var(--nav-sub); font-weight: 600; }
.sub-item .si-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .15rem .3rem; border-radius: 4px; transition: all .2s; }
.sub-item .si-remove:hover { color: var(--nav-commute); background: #fee2e2; }

/* ── PROGRESS BARS ───────────────────────────────────────────── */
.progress-track { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: .4rem; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--blue), #7c3aed); transition: width .8s cubic-bezier(.25,1,.5,1); }
.progress-fill.green { background: linear-gradient(90deg, #059669, #10b981); }
.progress-fill.red   { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* ── AD SLOTS ────────────────────────────────────────────────── */
.ad-slot { background: var(--faint); border: 1.5px dashed var(--border-dark); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-align: center; padding: 1rem; margin-bottom: 1.25rem; }
.ad-slot-banner { height: 90px; }
.ad-slot-rectangle { height: 250px; flex-direction: column; gap: .4rem; }
.ad-slot-leaderboard { height: 100px; width: 100%; }
.sidebar { position: sticky; top: 88px; }

/* ── NOTICES ─────────────────────────────────────────────────── */
.notice { padding: .9rem 1.1rem; border-radius: var(--radius); font-size: .88rem; line-height: 1.55; margin-top: 1rem; }
.notice-blue  { background: var(--blue-light); border: 1px solid var(--blue-border); color: #1e40af; }
.notice-green { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.notice-amber { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── CARDS ───────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow-md); border-color: var(--blue); }
.card h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: .6rem; color: var(--text); }
.card p { color: var(--muted); font-size: .92rem; line-height: 1.65; }

/* ── SHARE ROW ───────────────────────────────────────────────── */
.share-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

/* ── FOOTER ──────────────────────────────────────────────────── */
footer { background: #18181b; color: #94a3b8; padding: 4rem 1.75rem 2rem; margin-top: 5rem; }
.footer-grid { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 3rem; }
.footer-brand .fb-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 900; color: #fff; margin-bottom: .85rem; }
.footer-brand p { font-size: .88rem; line-height: 1.7; }
.footer-col h4 { font-size: .72rem; font-family: var(--font-mono); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; margin-bottom: 1.1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .6rem; }
.footer-col ul a { color: #94a3b8; text-decoration: none; font-size: .88rem; transition: color .2s; }
.footer-col ul a:hover { color: #fff; }
.footer-bottom { max-width: 1120px; margin: 0 auto; padding-top: 2rem; border-top: 1px solid #2d3748; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; font-size: .8rem; color: #64748b; }
.footer-bottom a { color: #64748b; text-decoration: none; transition: color .2s; }
.footer-bottom a:hover { color: #fff; }

/* ── UTILITIES ───────────────────────────────────────────────── */
.text-blue { color: var(--blue); }
.text-muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.mt-1{margin-top:.5rem;} .mt-2{margin-top:1rem;} .mt-3{margin-top:1.5rem;} .mb-2{margin-bottom:1rem;}
.hidden { display: none !important; }
.fade-in { animation: fadeIn .45s ease both; }
@keyframes fadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar{width:7px;} ::-webkit-scrollbar-track{background:var(--bg);}
::-webkit-scrollbar-thumb{background:var(--border-dark);border-radius:4px;}
::-webkit-scrollbar-thumb:hover{background:var(--muted);}

/* ── PWA BANNER ──────────────────────────────────────────────── */
#pwa-banner { display:none; position:fixed; bottom:1rem; left:50%; transform:translateX(-50%); background:var(--surface); border:1.5px solid var(--border-dark); border-radius:var(--radius-lg); padding:1rem 1.5rem; align-items:center; gap:1rem; font-size:.88rem; z-index:500; box-shadow:var(--shadow-lg); max-width:400px; width:calc(100% - 2rem); color:var(--text); }
#pwa-banner.show { display:flex; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media(max-width:960px){ .tool-layout{grid-template-columns:1fr;} .sidebar{position:static;} .footer-grid{grid-template-columns:1fr 1fr;} }
@media(max-width:640px){ body{font-size:16px;} .nav-links{display:none;} .nav-hamburger{display:flex;} .tools-grid{grid-template-columns:1fr;} .results-grid{grid-template-columns:1fr;} .form-row{grid-template-columns:1fr;} .footer-grid{grid-template-columns:1fr;} .hero{padding:3.5rem 1.25rem 3rem;} .footer-bottom{flex-direction:column;text-align:center;} .hero-cta-row{flex-direction:column;align-items:center;} .trust-bar-inner{gap:2rem;} }

/* Old UtilityEmpire CSS appended for lifestyle tool compatibility */

/* ================================================================
   MOBILE OPTIMIZATION — matches fincalcs.co mobile experience
   ================================================================ */

/* Mobile bottom nav for quick access */
@media(max-width:768px){
  .mobile-bottom-nav{position:fixed;bottom:0;left:0;right:0;background:white;border-top:1px solid #e5e5e0;display:flex;justify-content:space-around;padding:6px 0 env(safe-area-inset-bottom,8px);z-index:9998;box-shadow:0 -2px 10px rgba(0,0,0,0.06)}
  .mobile-bottom-nav a{display:flex;flex-direction:column;align-items:center;font-size:.65rem;color:#999;text-decoration:none;padding:4px 8px;transition:color .2s}
  .mobile-bottom-nav a.active{color:var(--teal);font-weight:600}
  .mobile-bottom-nav a svg{width:22px;height:22px;margin-bottom:2px}
  body{padding-bottom:72px}
  
  /* Sidebar becomes horizontal scroll on mobile */  
  .calc-sidebar{display:none;}
  .page-wrapper.wide{display:block!important;}
  
  /* Form grid single column on mobile */
  .form-grid{grid-template-columns:1fr!important;gap:12px!important;}
  .form-group.full-width{grid-column:auto!important;}
  
  /* Results grid 2-col on mobile */
  .result-grid{grid-template-columns:repeat(2,1fr)!important;gap:10px!important;}
  
  /* Bigger touch targets */
  .form-group input,.form-group select{min-height:48px!important;font-size:1rem!important;}
  .btn-calculate{width:100%;padding:16px!important;font-size:1.05rem!important;}
  
  /* Content section padding */
  .content-section{padding:24px 20px!important;}
  .page-wrapper{padding:20px 16px 60px!important;}
  
  /* Related tools single col */
  .related-tools{grid-template-columns:1fr!important;}
  
  /* Hero mobile */
  .hero{padding:40px 16px 30px!important;}
  .hero h1{font-size:1.8rem!important;}
  
  /* Tool grid single col */
  .tool-grid{grid-template-columns:1fr!important;}
  
  /* Footer */
  .footer-inner{grid-template-columns:1fr!important;gap:24px!important;}
  
  /* Dark mode mobile bottom nav */
  @media(prefers-color-scheme:dark){.mobile-bottom-nav{background:#1a1a2e;border-color:#333;}}
}

@media(max-width:480px){
  .result-grid{grid-template-columns:1fr!important;}
  .result-highlight .big-number{font-size:2rem!important;}
  .calc-header h1{font-size:1.5rem!important;}
  .tools-section{padding:0 12px 40px!important;}
}

@media(min-width:769px){.mobile-bottom-nav{display:none}}

/* ================================================================
   SIDEBAR SCROLL ENHANCEMENT — arrows on hover
   ================================================================ */
.calc-sidebar{
  max-height:calc(100vh - 100px);
  overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:var(--teal) transparent;
  position:relative;
}
.calc-sidebar::-webkit-scrollbar{width:5px;}
.calc-sidebar::-webkit-scrollbar-track{background:transparent;}
.calc-sidebar::-webkit-scrollbar-thumb{background:var(--teal);border-radius:10px;}

/* Scroll indicators (fade top/bottom) */
.sidebar-scroll-wrap{position:relative;}
.sidebar-scroll-wrap::before,
.sidebar-scroll-wrap::after{
  content:'';position:absolute;left:0;right:0;height:28px;
  pointer-events:none;z-index:2;opacity:0;transition:opacity .3s;
}
.sidebar-scroll-wrap::before{top:0;background:linear-gradient(to bottom,rgba(249,248,244,1),transparent);}
.sidebar-scroll-wrap::after{bottom:0;background:linear-gradient(to top,rgba(249,248,244,1),transparent);}
.sidebar-scroll-wrap.has-scroll-top::before{opacity:1;}
.sidebar-scroll-wrap.has-scroll-bottom::after{opacity:1;}

/* Scroll arrow buttons */
.sidebar-arrow{
  position:absolute;left:50%;transform:translateX(-50%);
  width:32px;height:32px;border-radius:50%;
  background:white;border:1px solid var(--border);
  cursor:pointer;z-index:3;display:none;
  align-items:center;justify-content:center;
  box-shadow:0 2px 8px var(--shadow);
  font-size:14px;color:var(--teal);transition:all .2s;
}
.sidebar-arrow:hover{background:var(--teal);color:white;border-color:var(--teal);}
.sidebar-arrow.up{top:4px;}
.sidebar-arrow.down{bottom:4px;}
.sidebar-scroll-wrap:hover .sidebar-arrow{display:flex;}

@media(prefers-color-scheme:dark){
  .sidebar-scroll-wrap::before{background:linear-gradient(to bottom,rgba(26,26,46,1),transparent);}
  .sidebar-scroll-wrap::after{background:linear-gradient(to top,rgba(26,26,46,1),transparent);}
  .sidebar-arrow{background:#222240;border-color:#444;}
}
