:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --navy: #0f172a;
  --navy-light: #1e293b;
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --success: #059669;
  --success-bg: #ecfdf5;
  --warn-bg: #fffbeb;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --max-w: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-badge {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}
.nav-links a { color: #cbd5e1; font-weight: 500; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-cta {
  background: var(--accent);
  color: #0f172a !important;
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 700 !important;
}
.nav-cta:hover { background: #fbbf24; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #0c4a6e 100%);
  color: #fff;
  padding: 52px 0 46px;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 3.6vw, 2.75rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
}
.hero p.lead {
  margin: 0 0 24px;
  max-width: 720px;
  color: #cbd5e1;
  font-size: 1.08rem;
}
.hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(125, 211, 252, 0.25);
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 14px 0 4px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { margin: 0 6px; color: #94a3b8; }

/* Layout */
.page-section { padding: 30px 0; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .calc-layout, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; letter-spacing: -0.015em; }
.tool-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}
.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #e0f2fe;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 12px;
}
.tool-card p { color: var(--muted); font-size: 0.94rem; margin: 6px 0 16px; }

/* Forms & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy-light);
  margin-bottom: 5px;
}
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.96rem;
  background: #fff;
  color: var(--text);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.field .hint { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-accent { background: var(--accent); color: #0f172a; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; border: 1px solid #cbd5e1; color: var(--navy); }
.btn-outline:hover { background: var(--surface-alt); text-decoration: none; }

/* Results Panel */
.result-panel {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.result-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7dd3fc;
  font-weight: 700;
}
.result-hero {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  font-weight: 900;
  margin: 6px 0 4px;
  color: #fff;
}
.result-sub { color: #cbd5e1; font-size: 0.92rem; margin: 0 0 18px; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.kpi-box {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
}
.kpi-label { font-size: 0.75rem; color: #94a3b8; }
.kpi-val { font-size: 1.05rem; font-weight: 800; color: #fff; margin-top: 2px; }

/* Affiliate / Equipment Box */
.equip-box {
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
}
.equip-box h4 { margin: 0 0 6px; font-size: 0.95rem; color: #bae6fd; }
.equip-box p { margin: 0 0 10px; font-size: 0.85rem; color: #e2e8f0; }

/* Quick Answer Featured Snippet Box */
.answer-box {
  background: var(--success-bg);
  border-left: 4px solid var(--success);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 24px;
}
.answer-box strong { color: #065f46; }

/* Pro Template Promo Banner */
.promo-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.promo-banner h3 { margin: 0 0 6px; color: #78350f; }
.promo-banner p { margin: 0; color: #92400e; font-size: 0.93rem; max-width: 650px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 16px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: #fff;
}
th, td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
th {
  background: var(--surface-alt);
  color: var(--navy);
  font-weight: 700;
}
tr:hover td { background: #f8fafc; }

/* Link Pills Matrix */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.link-chip {
  display: block;
  padding: 10px 13px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}
.link-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

/* FAQ */
details.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
  margin-bottom: 10px;
}
details.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--navy);
}
details.faq-item p { margin: 10px 0 0; color: var(--muted); font-size: 0.94rem; }

/* Ad Placeholder (clean, zero CLS) */
.ad-slot {
  min-height: 90px;
  margin: 20px 0;
  display: none; /* Enabled automatically when AdSense pub-id is active */
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: #94a3b8;
  padding: 40px 0 28px;
  margin-top: 48px;
  font-size: 0.88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { color: #fff; margin: 0 0 10px; font-size: 0.95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: #cbd5e1; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
}

@media print {
  .site-header, .site-footer, .promo-banner, .equip-box, .no-print { display: none !important; }
  body { background: #fff; }
  .result-panel { background: #fff; color: #000; border: 2px solid #000; }
  .result-hero, .kpi-val { color: #000; }
}
