/* ═══════════════════════════════════════════════════════════════
   CalcPro — Professional SaaS Design System
   Matches homepage UX/UI: light theme, Inter font, blue brand
   Applied to all calculator, blog, hub, and misc pages
   Note: Inter font is loaded via <link rel="preconnect"> in each
   page's <head> for optimal performance — no @import needed here.
═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg:           #FAFAFA;
  --surface:      #FFFFFF;
  --surface-2:    #F5F7FA;
  --brand:        #2563EB;
  --brand-light:  #EFF6FF;
  --brand-dim:    #DBEAFE;
  --accent:       #14B8A6;
  --accent-light: #F0FDFA;
  --text-1:       #0F172A;
  --text-2:       #475569;
  --text-3:       #5B6B85;
  --border:       #E5E7EB;
  --border-focus: #2563EB;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;
  --radius-xl:    20px;
  --shadow-sm:    0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md:    0 4px 16px rgba(15,23,42,0.06), 0 2px 6px rgba(15,23,42,0.04);
  --shadow-lg:    0 8px 32px rgba(15,23,42,0.08), 0 4px 12px rgba(15,23,42,0.04);
  --transition:   0.2s ease;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Skip Link ─────────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--brand); color: #fff;
  padding: 8px 16px; border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600; text-decoration: none; z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* ── Header / Nav ──────────────────────────────────────────── */
header[role="banner"] {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  padding: 0 24px;
}
header nav {
  max-width: 1160px; margin: 0 auto;
  display: flex; align-items: center; gap: 32px;
  height: 60px;
}
header nav a[aria-label] { flex-shrink: 0; }
header nav img { display: block; height: 36px; width: auto; }
header nav ul {
  display: flex; list-style: none; gap: 2px;
  margin-left: auto;
}
header nav ul a {
  color: var(--text-2); text-decoration: none;
  font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
header nav ul a:hover,
header nav ul a[aria-current="page"] {
  color: var(--brand); background: var(--brand-light);
}

/* ── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
}
.breadcrumb ol {
  max-width: 1160px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  list-style: none; font-size: 13px;
}
.breadcrumb a { color: var(--brand); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text-2); }
.breadcrumb [aria-hidden] { color: var(--text-3); }

/* ── Main Layout ───────────────────────────────────────────── */
main { max-width: 900px; margin: 0 auto; padding: 32px 24px 64px; }

/* ── Ad Slots ──────────────────────────────────────────────── */
.ad-slot {
  margin: 24px 0;
  min-height: 90px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
}

/* ── Page Header ───────────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 6px;
}
.last-updated { font-size: 13px; color: var(--text-3); }

/* ── Calculator Card ───────────────────────────────────────── */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.calc-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.calc-notice { color: var(--text-2); font-size: 14px; margin-bottom: 20px; }
.calc-inputs { display: flex; flex-direction: column; gap: 16px; }

/* Input Grid */
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.input-group { display: flex; flex-direction: column; }

/* Inputs */
input, select {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 15px;
  padding: 11px 14px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
input::placeholder { color: var(--text-3); }
label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  border: none; border-radius: var(--radius-md);
  cursor: pointer; font-family: var(--font);
  font-size: 14px; font-weight: 600;
  padding: 11px 28px;
  transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}
.btn--primary:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
  transform: translateY(-1px);
}
.btn--secondary {
  background: var(--surface);
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn--secondary:hover {
  border-color: var(--brand-dim);
  color: var(--brand);
  background: var(--brand-light);
}
.btn + .btn { margin-left: 10px; }

/* ── Result Box ────────────────────────────────────────────── */
.result-box {
  margin-top: 20px;
  background: var(--brand-light);
  border: 1.5px solid var(--brand-dim);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  animation: fadeIn 0.3s ease;
}
.result-box[hidden] { display: none; }
.result-box h3 {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 10px;
}
.result-primary {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800; color: var(--text-1);
  letter-spacing: -0.02em;
}
.result-secondary { font-size: 14px; color: var(--text-2); margin-top: 6px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SEO Content ───────────────────────────────────────────── */
.seo-content h2 {
  font-size: 1.15rem; font-weight: 700;
  color: var(--text-1); letter-spacing: -0.015em;
  margin: 36px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.seo-content h2:first-child { margin-top: 0; }
.seo-content p { color: var(--text-2); margin-bottom: 14px; }
.seo-content ul, .seo-content ol {
  padding-left: 20px; margin-bottom: 14px;
}
.seo-content li { color: var(--text-2); margin-bottom: 6px; }
.seo-content strong { color: var(--text-1); font-weight: 600; }
.seo-content code {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 8px;
  font-family: 'Courier New', monospace; font-size: 13px;
  color: var(--brand);
}
.seo-content a { color: var(--brand); text-decoration: none; }
.seo-content a:hover { text-decoration: underline; }

/* Formula table */
.formula-table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-size: 14px;
}
.formula-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.formula-table tr:first-child td {
  background: var(--surface-2);
  font-weight: 600; color: var(--text-1);
}

/* ── FAQ (details/summary) ─────────────────────────────────── */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--transition);
}
details[open] { border-color: var(--brand-dim); }
summary {
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  font-size: 14.5px; font-weight: 600;
  color: var(--text-1);
  transition: background var(--transition), color var(--transition);
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: '+ ';
  color: var(--brand);
  font-weight: 700;
}
details[open] summary::before { content: '− '; }
details[open] summary {
  background: var(--brand-light);
  color: var(--brand);
}
summary:hover { background: var(--brand-light); }
details p {
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--text-2);
  margin: 0;
  border-top: 1px solid var(--brand-dim);
  background: var(--brand-light);
  padding-top: 14px;
}

/* ── Disclaimer ────────────────────────────────────────────── */
.disclaimer {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 14px;
}
.disclaimer strong { color: #92400E; }
.disclaimer p { color: #78350F; margin: 0; }

/* ── Author Section ────────────────────────────────────────── */
.author-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 32px 0;
  box-shadow: var(--shadow-sm);
}
.author-section h2 {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 16px;
  border: none; padding: 0;
}
.author-card h3 { font-size: 15px; font-weight: 700; color: var(--text-1); margin-bottom: 8px; }
.author-card p { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.author-card strong { color: var(--text-1); }

/* Blog author bio box */
.author-bio-box {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin: 32px 0;
  box-shadow: var(--shadow-sm);
}
.author-bio-avatar { border-radius: 50%; border: 2px solid var(--brand-dim); flex-shrink: 0; }
.author-bio-box h3 { font-size: 15px; font-weight: 700; color: var(--text-1); margin-bottom: 8px; }
.author-bio-box p { font-size: 14px; color: var(--text-2); margin-bottom: 8px; }
.author-credentials-list { padding-left: 16px; margin-bottom: 8px; }
.author-credentials-list li { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.author-bio-box a { color: var(--brand); text-decoration: none; font-size: 13px; }
.author-bio-box a:hover { text-decoration: underline; }

/* ── Related Calculators ───────────────────────────────────── */
.related-calculators {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px; margin: 32px 0;
  box-shadow: var(--shadow-sm);
}
.related-calculators h2,
.related-posts h2 {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 16px;
  border: none; padding: 0;
}
.related-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.related-list li a {
  display: block; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-2);
  text-decoration: none; font-size: 14px; font-weight: 500;
  transition: all var(--transition);
}
.related-list li a:hover {
  border-color: var(--brand-dim);
  color: var(--brand);
  background: var(--brand-light);
}

/* ── Internal Links Note ───────────────────────────────────── */
.internal-links-note { font-size: 14px; color: var(--text-2); margin-top: 12px; }
.internal-links-note a { color: var(--brand); text-decoration: none; }
.internal-links-note a:hover { text-decoration: underline; }

/* Blog CTA box */
.blog-cta-box, .blog-tool-link {
  background: var(--brand-light);
  border: 1px solid var(--brand-dim);
  border-radius: var(--radius-md); padding: 16px 20px; margin: 24px 0;
  font-size: 15px;
}
.blog-cta-box a, .blog-tool-link a { color: var(--brand); font-weight: 600; text-decoration: none; }
.blog-cta-box a:hover, .blog-tool-link a:hover { text-decoration: underline; }

/* Blog link pill */
.blog-link {
  display: inline-block; margin-bottom: 24px;
  background: var(--brand-light); border: 1px solid var(--brand-dim);
  border-radius: var(--radius-xl); padding: 8px 18px;
  color: var(--brand); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: all var(--transition);
}
.blog-link:hover { background: var(--brand-dim); }

/* ── Blog Header ───────────────────────────────────────────── */
.blog-header { margin-bottom: 32px; }
.blog-category-tag {
  display: inline-block; margin-bottom: 12px;
  background: var(--brand-light); border: 1px solid var(--brand-dim);
  border-radius: var(--radius-sm); padding: 4px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--brand);
}
.blog-header h1 {
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  font-weight: 800; color: var(--text-1);
  line-height: 1.25; margin-bottom: 20px;
  letter-spacing: -0.025em;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  padding: 16px 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.author-meta { display: flex; align-items: center; gap: 12px; }
.author-avatar { border-radius: 50%; border: 2px solid var(--brand-dim); }
.author-name { display: block; font-weight: 600; font-size: 14px; color: var(--text-1); }
.author-name a { color: var(--brand); text-decoration: none; }
.author-credentials { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.article-dates { font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; }

.editorial-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #F0FDF4; border: 1px solid #BBF7D0;
  border-radius: var(--radius-sm); padding: 6px 12px; margin-top: 12px;
  font-size: 12px; color: #15803D; font-weight: 500;
}
.blog-intro p { font-size: 16px; color: var(--text-2); line-height: 1.8; margin-bottom: 24px; }
.blog-body section { margin-bottom: 32px; }
.blog-body h2 {
  font-size: 1.15rem; font-weight: 700;
  color: var(--text-1); letter-spacing: -0.015em;
  margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.blog-body p { color: var(--text-2); margin-bottom: 12px; }
.blog-body code {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 8px;
  font-size: 13px; color: var(--brand);
}

/* Editorial policy box */
.editorial-policy {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 20px; margin: 24px 0;
  font-size: 14px;
}
.editorial-policy h3 { font-size: 13px; color: var(--text-2); margin-bottom: 6px; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600; }
.editorial-policy p { color: var(--text-3); margin: 0; }
.editorial-policy a { color: var(--brand); text-decoration: none; }
.editorial-policy a:hover { text-decoration: underline; }

/* ── Hub Pages ─────────────────────────────────────────────── */
.hub-header { margin-bottom: 40px; text-align: center; padding: 40px 0; }
.hub-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800; color: var(--text-1);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.hub-desc { font-size: 16px; color: var(--text-2); max-width: 600px; margin: 0 auto 12px; }
.hub-count { font-size: 13px; color: var(--text-3); }
.hub-calc-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px; margin-bottom: 48px;
}
.hub-calc-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.hub-calc-item:hover { border-color: var(--brand-dim); box-shadow: var(--shadow-md); }
.hub-calc-link { text-decoration: none; display: flex; justify-content: space-between; align-items: center; }
.hub-calc-name { font-weight: 600; font-size: 15px; color: var(--text-1); }
.hub-calc-tag {
  font-size: 11px; color: var(--brand);
  background: var(--brand-light); padding: 3px 8px;
  border-radius: var(--radius-sm); font-weight: 600;
}
.hub-blog-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  background: var(--brand-light);
  border: 1px solid var(--brand-dim);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  transition: all var(--transition);
}
.hub-blog-link:hover {
  background: var(--brand-dim);
  text-decoration: none;
}

/* EEAT grid */
.hub-eeat { margin: 48px 0; }
.hub-eeat h2 { font-size: 1.1rem; font-weight: 700; color: var(--text-1); margin-bottom: 24px; }
.eeat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.eeat-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.eeat-item h3 { font-size: 14px; color: var(--brand); margin-bottom: 8px; font-weight: 700; }
.eeat-item p { font-size: 13px; color: var(--text-2); margin: 0; }

/* Cross links */
.hub-cross-links { margin: 32px 0; }
.hub-cross-links h2 {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 12px;
}
.hub-cross-links ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.hub-cross-links a {
  color: var(--brand); text-decoration: none; font-size: 14px;
  padding: 6px 14px; border: 1px solid var(--brand-dim);
  border-radius: var(--radius-xl); background: var(--brand-light);
  transition: all var(--transition); font-weight: 500;
}
.hub-cross-links a:hover { background: var(--brand-dim); }

/* ── Related Posts ─────────────────────────────────────────── */
.related-posts { margin: 24px 0; }
.related-posts .related-list li { margin-bottom: 0; }
.related-posts .related-list li a { font-size: 13px; }

/* ── Footer ────────────────────────────────────────────────── */
footer[role="contentinfo"] {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center; padding: 28px 24px;
  margin-top: 48px;
}
footer p { font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
footer nav a {
  color: var(--text-3); text-decoration: none;
  font-size: 13px; margin: 0; padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
footer nav a:hover { color: var(--brand); background: var(--brand-light); }
footer nav span { color: var(--border); padding: 4px 0; }

/* ── Utility ───────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Focus Styles ──────────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 3px;
}
*:focus:not(:focus-visible) { outline: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

/* ── Section Chrome (hub/blog pages) ───────────────────────── */
.section-wrap { padding: 0 0 64px; }
.section-header { margin-bottom: 32px; }
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--brand);
  margin-bottom: 8px;
}
.section-title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700; color: var(--text-1);
  letter-spacing: -0.025em; line-height: 1.25; margin-bottom: 8px;
}
.section-sub { font-size: 14px; color: var(--text-2); line-height: 1.6; }
.section-divider {
  width: 32px; height: 2px;
  background: var(--brand); border-radius: 2px;
  margin: 0 0 14px;
}
.section-header.center .section-divider { margin: 0 auto 16px; }

/* ── Print Styles ──────────────────────────────────────────── */
@media print {
  body { background: #fff !important; color: #000 !important; font-family: Georgia, serif; font-size: 12pt; }
  header, footer, nav, .ad-slot, ins.adsbygoogle, .btn, .skip-link, [aria-hidden="true"] { display: none !important; }
  main { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
  h1, h2, h3 { color: #000 !important; font-family: Georgia, serif; page-break-after: avoid; }
  .calc-card, .result-box { background: #fff !important; border: 1px solid #ccc !important; box-shadow: none !important; page-break-inside: avoid; }
  a { color: #000 !important; text-decoration: underline; }
  @page { margin: 2cm; }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  main { padding: 20px 16px 48px; }
  /* Nav — horizontal scroll strip on mobile */
  header[role="banner"] { padding: 0 12px; }
  header nav { gap: 12px; height: auto; min-height: 52px; flex-wrap: nowrap; padding: 6px 0; }
  header nav ul {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    margin-left: 0;
    padding-bottom: 2px;
  }
  header nav ul::-webkit-scrollbar { display: none; }
  header nav ul a {
    white-space: nowrap;
    font-size: 12px;
    padding: 5px 10px;
  }
  header nav img { height: 28px; }
  .author-bio-box { flex-direction: column; }
  .eeat-grid { grid-template-columns: 1fr 1fr; }
  .article-meta { flex-direction: column; align-items: flex-start; }
  .input-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .eeat-grid { grid-template-columns: 1fr; }
  .related-list { grid-template-columns: 1fr; }
  .input-grid { grid-template-columns: 1fr; }
}

/* ── Read Guide Banner ─────────────────────────────────────── */
.read-guide-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--accent-light) 100%);
  border: 1.5px solid var(--brand-dim);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin: 20px 0 24px;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.read-guide-banner:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.read-guide-banner__icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: var(--brand);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.read-guide-banner__text {
  flex: 1;
  display: flex; flex-direction: column; gap: 3px;
}
.read-guide-banner__label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brand);
}
.read-guide-banner__title {
  font-size: 14px; font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
}
.read-guide-banner__cta {
  flex-shrink: 0;
  font-size: 13px; font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
}
@media (max-width: 560px) {
  .read-guide-banner { flex-wrap: wrap; }
  .read-guide-banner__cta { width: 100%; text-align: right; }
}

/* ── Mobile Touch Targets & UX ──────────────────────────────── */
@media (max-width: 768px) {
  /* Ensure all interactive elements meet 44px minimum touch target */
  .btn {
    min-height: 44px;
    padding: 12px 24px;
    font-size: 15px;
  }
  input[type="number"],
  input[type="text"],
  input[type="email"],
  select,
  textarea {
    min-height: 44px;
    font-size: 16px; /* prevents iOS auto-zoom */
  }
  .input-group label {
    font-size: 14px;
    margin-bottom: 6px;
  }
  /* Breadcrumb wrapping on mobile */
  .breadcrumb ol {
    flex-wrap: wrap;
    gap: 4px;
  }
  /* Calculator card padding on mobile */
  .calc-card {
    padding: 20px 16px;
  }
  .seo-content {
    padding: 20px 16px;
  }
}
@media (max-width: 480px) {
  .btn + .btn {
    margin-left: 0;
    margin-top: 8px;
  }
  .result-box {
    padding: 16px;
  }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
}

/* ── Focus States (Keyboard Navigation) ─────────────────────── */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL CURRENCY SWITCHER
═══════════════════════════════════════════════════════════════ */
.currency-switcher-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.currency-switcher-bar label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
  white-space: nowrap;
}
.currency-switcher-select {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 32px 6px 10px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--transition);
  width: auto;
}
.currency-switcher-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.currency-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-light);
  border: 1px solid var(--brand-dim);
  border-radius: var(--radius-xl);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
}
.currency-active-badge .currency-flag-sm { font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════
   HOMEPAGE — TABBED CALCULATOR SLIDER
═══════════════════════════════════════════════════════════════ */

/* Tab buttons */
.hp-calc-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
}
.hp-calc-tab {
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-2);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.01em;
}
.hp-calc-tab.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.hp-calc-tab:hover:not(.active) {
  color: var(--text-1);
  background: var(--surface);
}

/* Slider wrapper — clips overflow */
.hp-calc-slider-wrap {
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Slider track — holds both panes side by side */
.hp-calc-slider {
  display: flex;
  width: 200%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-calc-slider.show-sci {
  transform: translateX(-50%);
}

/* Each pane takes exactly half the slider (= 100% of panel) */
.hp-calc-pane {
  width: 50%;
  flex-shrink: 0;
}

/* Scientific display expression line */
.sci-expr-display {
  font-size: 11px;
  color: var(--text-3);
  text-align: right;
  padding: 0 2px 6px;
  min-height: 16px;
  font-family: 'Courier New', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   PHASE 3 — Dark Theme
   Applied via [data-theme="dark"] on <html>
   All original light values preserved in :root above
═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --surface-2:    #1e293b;
  --brand:        #3b82f6;
  --brand-light:  #172554;
  --brand-dim:    #1e3a5f;
  --accent:       #2dd4bf;
  --accent-light: #0d3330;
  --text-1:       #f1f5f9;
  --text-2:       #94a3b8;
  --text-3:       #94A3B8;
  --border:       #334155;
  --border-focus: #3b82f6;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.3);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.3);
}

/* Dark theme body + transitions */
body {
  transition: background var(--transition), color var(--transition);
}

[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text-1);
}

/* Header dark */
[data-theme="dark"] header[role="banner"] {
  background: rgba(30,41,59,0.95);
  border-bottom-color: var(--border);
}

/* Cards / surfaces dark */
[data-theme="dark"] .calc-card,
[data-theme="dark"] .seo-content,
[data-theme="dark"] .result-box,
[data-theme="dark"] .ad-slot,
[data-theme="dark"] details,
[data-theme="dark"] .author-card,
[data-theme="dark"] .related-calculators {
  background: var(--surface);
  border-color: var(--border);
}

/* Inputs dark */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #0f172a;
  color: var(--text-1);
  border-color: var(--border);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}

/* Labels + text dark */
[data-theme="dark"] label,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
  color: var(--text-1);
}

[data-theme="dark"] p,
[data-theme="dark"] li,
[data-theme="dark"] td,
[data-theme="dark"] .text-secondary {
  color: var(--text-2);
}

/* Result box dark */
[data-theme="dark"] .result-box {
  background: var(--brand-dim);
  border-color: var(--brand);
}
[data-theme="dark"] #result-primary,
[data-theme="dark"] .result-primary {
  color: #bfdbfe;
}

/* Disclaimer dark */
[data-theme="dark"] .disclaimer,
[data-theme="dark"] aside.disclaimer {
  background: #2d1e06;
  border-left-color: #b45309;
  color: #fde68a;
}

/* Tables dark */
[data-theme="dark"] table {
  border-color: var(--border);
}
[data-theme="dark"] th {
  background: #1e3a5f;
  color: #bfdbfe;
}
[data-theme="dark"] td {
  border-color: var(--border);
  color: var(--text-2);
}
[data-theme="dark"] tr:nth-child(even) td {
  background: rgba(255,255,255,.03);
}

/* Details/FAQ dark */
[data-theme="dark"] summary {
  color: var(--text-1);
}
[data-theme="dark"] details[open] summary {
  color: var(--brand);
}
[data-theme="dark"] details p {
  color: var(--text-2);
}

/* Breadcrumb dark */
[data-theme="dark"] .breadcrumb {
  background: var(--bg);
  border-bottom-color: var(--border);
}
[data-theme="dark"] .breadcrumb a { color: var(--text-2); }
[data-theme="dark"] .breadcrumb li[aria-current="page"] { color: var(--text-1); }

/* Footer dark */
[data-theme="dark"] footer[role="contentinfo"] {
  background: #020617;
  color: #64748b;
}
[data-theme="dark"] footer a { color: #475569; }
[data-theme="dark"] footer a:hover { color: #94a3b8; }

/* Links dark */
[data-theme="dark"] a { color: #60a5fa; }
[data-theme="dark"] a:hover { color: #93c5fd; }

/* Buttons dark */
[data-theme="dark"] .btn--secondary,
[data-theme="dark"] button.btn--secondary {
  background: #334155;
  color: var(--text-2);
}
[data-theme="dark"] .btn--secondary:hover {
  background: #475569;
  color: var(--text-1);
}

/* Related list dark */
[data-theme="dark"] .related-list a,
[data-theme="dark"] .related-calculators a {
  background: #0f172a;
  border-color: var(--border);
  color: #60a5fa;
}
[data-theme="dark"] .related-list a:hover,
[data-theme="dark"] .related-calculators a:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Category hub cards dark */
[data-theme="dark"] .hub-card,
[data-theme="dark"] .calc-item,
[data-theme="dark"] .blog-card {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .hub-card:hover,
[data-theme="dark"] .calc-item:hover {
  border-color: var(--brand);
}

/* Code blocks dark */
[data-theme="dark"] code,
[data-theme="dark"] pre {
  background: #0f172a;
  color: #a78bfa;
  border-color: var(--border);
}

/* Tag / badge dark */
[data-theme="dark"] .tag,
[data-theme="dark"] .badge {
  background: var(--brand-dim);
  color: #bfdbfe;
}

/* ── Dark theme toggle button ─────────────────────────────── */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px 5px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  font-family: var(--font);
  transition: background var(--transition), border-color var(--transition),
              color var(--transition);
  white-space: nowrap;
}
.theme-toggle-btn:hover {
  background: var(--surface-2);
  border-color: var(--brand);
  color: var(--text-1);
}
.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.theme-toggle-btn .toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
[data-theme="dark"] .theme-toggle-btn .toggle-track {
  background: var(--brand);
}
.theme-toggle-btn .toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: left var(--transition);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .theme-toggle-btn .toggle-thumb {
  left: calc(36px - 18px);
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Nav right (toggle placement fix) ─────────────────────── */
header nav .nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
header nav ul {
  margin-left: 0 !important;
}

/* ── Blog References Section ─────────────────────────────────── */
.references-section {
  margin: 2rem 0 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.references-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text);
}
.references-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.references-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.references-list a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.references-list a:hover { opacity: 0.8; }
