:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --nav-bg: #0f172a;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --emerald: #059669;
  --emerald-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --rose: #e11d48;
  --rose-soft: #fff1f2;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -6px rgba(15, 23, 42, 0.04);
}

*, *::before, *::after {
  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-color: 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: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  background: var(--nav-bg);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 16px;
}

.brand {
  display: inline-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 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #10b981);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 56px 0 64px;
}

.hero-compact {
  padding: 40px 0 44px;
}

.hero-tag {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: #c7d2fe;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.hero p {
  margin: 0;
  color: #cbd5e1;
  font-size: 1.08rem;
  max-width: 720px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none !important;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

.btn-emerald {
  background: var(--emerald);
  color: #fff;
}

.btn-emerald:hover {
  background: #047857;
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--surface-alt);
}

.btn-ghost-light {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* Cards & Grids */
.section {
  padding: 44px 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.tool-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 24px;
  margin-top: -28px;
  position: relative;
  z-index: 10;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-elevated {
  box-shadow: var(--shadow-md);
}

.card h2, .card h3 {
  margin-top: 0;
  letter-spacing: -0.015em;
}

/* Form Inputs & Sliders */
.form-group {
  margin-bottom: 18px;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
  gap: 8px;
}

.form-label-row label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.val-pill {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 2px 10px;
  border-radius: 999px;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* KPI & Output Boxes */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}

.kpi-box.highlight {
  background: var(--primary-soft);
  border-color: #c7d2fe;
}

.kpi-box.success {
  background: var(--emerald-soft);
  border-color: #a7f3d0;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 4px;
}

.kpi-box.highlight .kpi-value {
  color: var(--primary);
}

.kpi-box.success .kpi-value {
  color: var(--emerald);
}

/* Affiliate CTA Card */
.aff-banner {
  background: linear-gradient(135deg, #eef2ff 0%, #ecfdf5 100%);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.aff-banner-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--emerald);
  background: #d1fae5;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.aff-banner h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.aff-banner p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Comparison Bars */
.bar-row {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.bar-row.best {
  border-color: #10b981;
  background: #f0fdf4;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.bar-track {
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.bar-row.best .bar-fill {
  background: var(--emerald);
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Generated Output List */
.gen-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
}

.gen-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.gen-meta {
  font-size: 0.78rem;
  color: var(--text-subtle);
  margin-top: 3px;
}

.badge-warn {
  background: var(--amber-soft);
  color: var(--amber);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
}

.badge-ok {
  background: var(--emerald-soft);
  color: var(--emerald);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
}

/* SEO Content & FAQ */
.prose {
  max-width: 820px;
}

.prose h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.prose h3 {
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.prose p, .prose li {
  color: var(--text-muted);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-q {
  width: 100%;
  text-align: left;
  background: #fff;
  border: none;
  padding: 16px 18px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-a {
  padding: 0 18px 16px;
  color: var(--text-muted);
  font-size: 0.94rem;
  display: none;
}

.faq-item.open .faq-a {
  display: block;
}

/* Chart Box */
.chart-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 36px 0;
  margin-top: 48px;
  font-size: 0.88rem;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #cbd5e1;
}

.disclosure {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
  color: #64748b;
}

@media (max-width: 900px) {
  .tool-shell,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: inline-block;
  }

  .nav-links {
    display: none;
    width: 100%;
    padding-bottom: 14px;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-inner {
    flex-wrap: wrap;
  }
}
