*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-light: #EFF6FF;
  --blue-mid: #DBEAFE;
  --text-dark: #111827;
  --text-mid: #374151;
  --text-light: #6B7280;
  --border: #E5E7EB;
  --white: #FFFFFF;
  --off-white: #F9FAFB;
  --green: #10B981;
  --green-light: #ECFDF5;
  --red: #EF4444;
  --red-light: #FEF2F2;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
}
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: var(--text-dark); background: var(--off-white); line-height: 1.6; }

/* NAV */
nav { background: var(--white); border-bottom: 1px solid var(--border); padding: 0 5%; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.nav-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo-icon { width: 36px; height: 36px; background: var(--blue); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.nav-logo-icon i { font-size: 20px; color: white; }
.nav-logo-text { font-size: 20px; font-weight: 700; color: var(--text-dark); }
.nav-logo-text span { color: var(--blue); }
.nav-links { display: flex; gap: 8px; }
.nav-link { padding: 8px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--text-mid); text-decoration: none; cursor: pointer; transition: all 0.2s; border: none; background: none; font-family: 'Inter', sans-serif; }
.nav-link:hover { background: var(--blue-light); color: var(--blue); }
.nav-link.active { background: var(--blue); color: white; }

/* UNIT TOGGLE */
.unit-toggle { display: flex; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--white); flex-shrink: 0; }
.unit-btn { padding: 6px 14px; font-size: 13px; font-weight: 600; border: none; background: transparent; cursor: pointer; color: var(--text-mid); font-family: 'Inter', sans-serif; transition: all 0.15s; white-space: nowrap; }
.unit-btn:hover { color: var(--blue); }
.unit-btn.active { background: var(--blue); color: white; }

/* HERO */
.hero { background: linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #3B82F6 100%); padding: 3rem 5% 4.5rem; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -50%; right: -20%; width: 500px; height: 500px; background: rgba(255,255,255,0.05); border-radius: 50%; }
.hero::after { content: ''; position: absolute; bottom: -30%; left: -10%; width: 400px; height: 400px; background: rgba(255,255,255,0.04); border-radius: 50%; }
.hero-content { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); color: white; font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 20px; margin-bottom: 1.25rem; }
.hero-title { font-size: 42px; font-weight: 700; color: white; line-height: 1.15; margin-bottom: 1rem; }
.hero-title span { color: #93C5FD; }
.hero-sub { font-size: 17px; color: rgba(255,255,255,0.8); margin-bottom: 0; line-height: 1.7; }

/* BREADCRUMB */
.breadcrumb { max-width: 1100px; margin: 0 auto; padding: 14px 5% 0; font-size: 13px; color: var(--text-light); }
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* MAIN */
.main { max-width: 1100px; margin: -2rem auto 0; padding: 0 5% 4rem; position: relative; z-index: 10; }

/* CALC TABS */
.tab-group-label { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 8px 4px; }
.tab-group-label:not(:first-child) { margin-top: 20px; }
.calc-tabs { display: flex; gap: 8px; margin-bottom: 0.5rem; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.calc-tab { flex: 1; min-width: 118px; padding: 12px 8px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; cursor: pointer; border: none; font-family: 'Inter', sans-serif; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text-light); background: transparent; }
.calc-tab:hover { background: var(--blue-light); color: var(--blue); }
.calc-tab.active { background: var(--blue); color: white; box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.calc-tab i { font-size: 16px; }
.tabs-wrap { margin-bottom: 1.5rem; }

/* TOGGLE BUTTONS (mode switch within a panel) */
.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 1.5rem; }
.mode-btn { padding: 10px 8px; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 13px; font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif; text-align: center; transition: all 0.2s; color: var(--text-mid); background: white; }
.mode-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.mode-btn.active { border-color: var(--blue); background: var(--blue); color: white; }

/* CAUTION NOTE */
.caution-note { display: flex; gap: 10px; background: #FFFBEB; border: 1px solid #FDE68A; border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 1.25rem; font-size: 12px; color: #92400E; line-height: 1.6; }
.caution-note i { font-size: 18px; flex-shrink: 0; color: #D97706; }

/* CALC PANELS */
.calc-panel { display: none; }
.calc-panel.active { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* CARD */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow-sm); }
.card-title { font-size: 18px; font-weight: 600; color: var(--text-dark); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px; }
.card-title i { font-size: 22px; color: var(--blue); }

/* FORM */
.form-group { margin-bottom: 1.25rem; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; display: block; }
.form-input-wrap { position: relative; }
.form-prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--text-light); font-weight: 500; pointer-events: none; }
.form-suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--text-light); font-weight: 500; pointer-events: none; }
.form-input { width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px; font-size: 15px; color: var(--text-dark); font-family: 'Inter', sans-serif; outline: none; transition: border-color 0.2s; background: white; }
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-input.has-prefix { padding-left: 28px; }
.form-input.has-suffix { padding-right: 46px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.calc-btn { width: 100%; background: var(--blue); color: white; border: none; padding: 14px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif; transition: background 0.2s; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.calc-btn:hover { background: var(--blue-dark); }
.reset-btn { width: 100%; background: var(--off-white); color: var(--text-mid); border: 1px solid var(--border); padding: 11px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.2s; margin-top: 8px; }
.reset-btn:hover { background: var(--border); }

/* RESULTS */
.results-card { background: var(--blue); border-radius: var(--radius-lg); padding: 1.75rem; color: white; margin-bottom: 16px; }
.results-card.green { background: linear-gradient(135deg, #059669, #10B981); }
.results-card.red { background: linear-gradient(135deg, #DC2626, #EF4444); }
.results-main-label { font-size: 13px; color: rgba(255,255,255,0.7); margin-bottom: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.results-main-value { font-size: 40px; font-weight: 700; color: white; line-height: 1; margin-bottom: 4px; }
.results-main-sub { font-size: 14px; color: rgba(255,255,255,0.7); }
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.result-item { background: rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 12px; }
.result-item-label { font-size: 11px; color: rgba(255,255,255,0.65); margin-bottom: 4px; font-weight: 500; }
.result-item-value { font-size: 18px; font-weight: 700; color: white; }

/* BREAKDOWN */
.breakdown { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.breakdown-title { font-size: 14px; font-weight: 600; color: var(--text-dark); margin-bottom: 12px; }
.breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-label { color: var(--text-mid); }
.breakdown-value { font-weight: 600; color: var(--text-dark); }
.breakdown-value.blue { color: var(--blue); }
.breakdown-value.green { color: var(--green); }
.breakdown-value.red { color: var(--red); }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-light); }
.empty-state i { font-size: 48px; color: var(--blue-mid); margin-bottom: 1rem; display: block; }
.empty-state p { font-size: 15px; }

/* CROSS-LINK */
.crosslink { margin-top: 20px; background: var(--blue-light); border: 1.5px solid var(--blue-mid); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: 14px; text-decoration: none; transition: all 0.2s; }
.crosslink:hover { background: var(--blue-mid); }
.crosslink-icon { width: 40px; height: 40px; background: var(--blue); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.crosslink-icon i { font-size: 20px; color: white; }
.crosslink-body h3 { font-size: 14px; font-weight: 600; color: var(--text-dark); margin-bottom: 2px; }
.crosslink-body p { font-size: 12px; color: var(--text-mid); }

/* SEO CONTENT */
.seo-content { background: var(--white); border-top: 1px solid var(--border); padding: 3rem 5%; }
.seo-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit,minmax(300px,1fr)); gap: 2.5rem; }
.seo-inner h2 { font-size: 20px; font-weight: 700; color: var(--text-dark); margin-bottom: 1rem; }
.seo-inner p { font-size: 14px; color: var(--text-mid); line-height: 1.8; margin-bottom: 0.75rem; }
.formula-box { background: var(--blue-light); border-radius: var(--radius-md); padding: 1rem; margin-bottom: 0.75rem; font-size: 13px; color: var(--blue-dark); font-family: monospace; line-height: 1.8; }

/* FEATURES */
.features { padding: 3.5rem 5%; background: var(--off-white); border-top: 1px solid var(--border); }
.features-inner { max-width: 1100px; margin: 0 auto; }
.features-title { font-size: 26px; font-weight: 700; text-align: center; margin-bottom: 2rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.feature-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; text-align: center; }
.feature-icon { width: 52px; height: 52px; background: var(--blue-light); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.feature-icon i { font-size: 26px; color: var(--blue); }
.feature-card h3 { font-size: 15px; font-weight: 600; color: var(--text-dark); margin-bottom: 6px; }
.feature-card p { font-size: 13px; color: var(--text-light); line-height: 1.6; }

/* AFFILIATE */
.affiliate-section { padding: 3rem 5%; background: var(--white); border-top: 1px solid var(--border); }
.affiliate-inner { max-width: 1100px; margin: 0 auto; }
.affiliate-title { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 0.5rem; }
.affiliate-sub { font-size: 14px; color: var(--text-light); text-align: center; margin-bottom: 2rem; }
.affiliate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.affiliate-card { background: var(--off-white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; display: flex; align-items: flex-start; gap: 14px; transition: all 0.2s; }
.affiliate-card:hover { border-color: var(--blue-mid); box-shadow: var(--shadow-sm); }
.affiliate-logo { width: 46px; height: 46px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 17px; font-weight: 700; color: white; }
.affiliate-body { flex: 1; }
.affiliate-name { font-size: 15px; font-weight: 700; color: var(--text-dark); margin-bottom: 3px; }
.affiliate-desc { font-size: 13px; color: var(--text-mid); line-height: 1.5; margin-bottom: 10px; }
.affiliate-btn { display: inline-block; font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; }
.affiliate-btn:hover { text-decoration: underline; }
.affiliate-disclaimer { font-size: 12px; color: var(--text-light); text-align: center; margin-top: 1.5rem; }

/* FAQ */
.faq-section { padding: 3.5rem 5%; background: var(--white); }
.faq-inner { max-width: 800px; margin: 0 auto; }
.faq-title { font-size: 26px; font-weight: 700; text-align: center; margin-bottom: 2rem; }
.faq-item { background: var(--off-white); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem; margin-bottom: 10px; cursor: pointer; }
.faq-q { font-size: 15px; font-weight: 600; color: var(--text-dark); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-q i { font-size: 18px; color: var(--blue); flex-shrink: 0; transition: transform 0.2s; }
.faq-a { font-size: 14px; color: var(--text-mid); line-height: 1.7; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: none; }
.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-q i { transform: rotate(45deg); }

/* FOOTER */
footer { background: var(--text-dark); padding: 2rem 5%; text-align: center; }
.footer-logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 0.75rem; text-decoration: none; }
.footer-logo-icon { width: 30px; height: 30px; background: var(--blue); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.footer-logo-icon i { font-size: 16px; color: white; }
.footer-logo-text { font-size: 18px; font-weight: 700; color: white; }
.footer-logo-text span { color: #93C5FD; }
.footer-text { font-size: 13px; color: #9CA3AF; }

@media (max-width: 768px) {
  .calc-panel.active { grid-template-columns: 1fr; }
  .hero-title { font-size: 28px; }
  .results-main-value { font-size: 32px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

/* ===== MULTI-PAGE ADDITIONS ===== */
.page-head { max-width: 1100px; margin: 0 auto; padding: 2rem 5% 0.5rem; position: relative; z-index: 1; }
.page-head h1 { font-size: 30px; font-weight: 700; color: var(--text-dark); margin: 8px 0 10px; }
.page-head .intro { font-size: 15px; color: var(--text-mid); line-height: 1.7; max-width: 780px; margin-bottom: 0.5rem; }
/* The hero-overlap look (negative margin + raised z-index on .main) is specific
   to the homepage hero. On tool pages .main follows the page heading (and
   sometimes a disclaimer box), where that pull hides the intro text. Default
   .main to no overlap, then re-apply it only when a .hero directly precedes it. */
.main { margin-top: 1.5rem; z-index: auto; position: static; }
.hero + .main { margin-top: -2rem; z-index: 10; position: relative; }
.breadcrumb { max-width: 1100px; margin: 0 auto; padding: 1.25rem 5% 0; font-size: 13px; color: var(--text-light); }
.breadcrumb a { color: var(--blue); text-decoration: none; }
.tool-content { background: var(--white); border-top: 1px solid var(--border); padding: 3rem 5%; }
.tool-content-inner { max-width: 900px; margin: 0 auto; }
.tool-content-inner h2 { font-size: 20px; font-weight: 700; color: var(--text-dark); margin: 1.75rem 0 0.75rem; }
.tool-content-inner h2:first-child { margin-top: 0; }
.tool-content-inner p { font-size: 14.5px; color: var(--text-mid); line-height: 1.8; margin-bottom: 0.75rem; }
.related-section { padding: 2.5rem 5%; background: var(--off-white); border-top: 1px solid var(--border); }
.related-inner { max-width: 1100px; margin: 0 auto; }
.related-title { font-size: 20px; font-weight: 700; margin-bottom: 1.25rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tool-card { display: flex; gap: 12px; align-items: flex-start; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem 1.2rem; text-decoration: none; transition: all 0.2s; }
.tool-card:hover { border-color: var(--blue-mid); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.tool-card-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--blue-light); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.tool-card-name { font-size: 14.5px; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; }
.tool-card-desc { font-size: 12.5px; color: var(--text-mid); line-height: 1.5; }
.allcalc-strip { padding: 2rem 5%; background: var(--white); border-top: 1px solid var(--border); }
.allcalc-inner { max-width: 1100px; margin: 0 auto; }
.allcalc-title { font-size: 15px; font-weight: 700; color: var(--text-dark); margin-bottom: 0.75rem; }
.allcalc-links { display: flex; flex-wrap: wrap; gap: 8px; }
.allcalc-links a { font-size: 13px; font-weight: 600; color: var(--blue); background: var(--blue-light); border-radius: 999px; padding: 6px 14px; text-decoration: none; transition: all 0.15s; }
.allcalc-links a:hover { background: var(--blue); color: white; }
.allcalc-links a.current { background: var(--blue); color: white; }
.hub-directory { padding: 1rem 5% 3rem; }
.hub-directory-inner { max-width: 1100px; margin: 0 auto; }
.hub-group-label { font-size: 13px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.06em; margin: 1.75rem 0 0.75rem; }

/* ===== GEOTECH ADDITIONS ===== */
.disclaimer-box { max-width: 1100px; margin: 1rem auto 1.5rem; padding: 0.9rem 1.1rem; background: #FFF8E6; border: 1px solid #F0D890; border-radius: var(--radius-lg); font-size: 13px; color: #7A5C00; line-height: 1.6; display: flex; gap: 10px; align-items: flex-start; }
.disclaimer-box i { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
sub { font-size: 0.72em; }
