:root {
  --teal: #2a9d8f; --teal-dark: #228478; --teal-light: #34b8a8;
  --teal-100: #d4efec; --teal-50: #edf8f7;
  --yellow: #ffd600; --yellow-light: #ffe033;
  --navy: #1a2b3c; --navy-dark: #0f1c2a;
  --text-primary: #1a2b3c; --text-secondary: #4a5d72; --text-muted: #7b8e9e;
  --text-on-dark: #e0e8f0; --text-on-dark-muted: #8fa3b8;
  --bg-page: #ffffff; --bg-light: #f7f9fb;
  --border: #dde4eb; --border-light: #eaeff4;
  --shadow-sm: 0 1px 3px rgba(26,43,60,0.05);
  --shadow-md: 0 4px 16px rgba(26,43,60,0.08);
  --shadow-lg: 0 8px 32px rgba(26,43,60,0.1);
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --font-heading: 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --max-w: 1100px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.analyzer-seo main.flex-shrink-0 { padding-top: 60px !important; }
body.analyzer-seo main .analyzer-seo-tool {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-light);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.analyzer-seo main .analyzer-seo-tool a { color: inherit; text-decoration: none; }
body.analyzer-seo main .analyzer-seo-tool .container { max-width: var(--max-w); margin: 0 auto; padding: 0 32px; }
.btn-primary {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  background: var(--yellow); padding: 10px 22px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; font-family: var(--font-heading);
  text-transform: uppercase; letter-spacing: 0.3px;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { background: var(--yellow-light); color: var(--text-primary); transform: translateY(-1px); }
.btn-primary:focus,
.btn-primary:active { color: var(--text-primary); }
.btn-primary:focus { outline: none; box-shadow: 0 0 0 3px rgba(42,157,143,0.18); }
body.analyzer-seo main .analyzer-seo-tool .btn-primary,
body.analyzer-seo main .analyzer-seo-tool .btn-primary:visited,
body.analyzer-seo main .analyzer-seo-tool .btn-primary:hover,
body.analyzer-seo main .analyzer-seo-tool .btn-primary:focus,
body.analyzer-seo main .analyzer-seo-tool .btn-primary:active,
body.analyzer-seo main .analyzer-seo-tool .btn-primary:not(:disabled):not(.disabled):active,
body.analyzer-seo main .analyzer-seo-tool .btn-primary:not(:disabled):not(.disabled).active,
body.analyzer-seo main .analyzer-seo-tool .show > .btn-primary.dropdown-toggle {
  background-color: var(--yellow) !important;
  border-color: var(--yellow) !important;
  color: var(--text-primary) !important;
}
body.analyzer-seo main .analyzer-seo-tool .btn-primary:hover {
  background-color: var(--yellow-light) !important;
  border-color: var(--yellow-light) !important;
}
body.analyzer-seo main .analyzer-seo-tool .btn-primary:focus,
body.analyzer-seo main .analyzer-seo-tool .btn-primary:active:focus,
body.analyzer-seo main .analyzer-seo-tool .btn-primary:not(:disabled):not(.disabled):active:focus {
  box-shadow: 0 0 0 3px rgba(42,157,143,0.18) !important;
}
/* Link-buttons: global `a { color: inherit }` + dark banners otherwise pull white text on hover */
body.analyzer-seo main .analyzer-seo-tool a.btn-primary,
body.analyzer-seo main .analyzer-seo-tool a.btn-primary:visited,
body.analyzer-seo main .analyzer-seo-tool a.btn-primary:hover,
body.analyzer-seo main .analyzer-seo-tool a.btn-primary:focus,
body.analyzer-seo main .analyzer-seo-tool a.btn-primary:active {
  color: var(--text-primary) !important;
}
.btn-lg { font-size: 15px; padding: 14px 28px; }

/* Page header */
.page-header {
  background: var(--bg-page); border-bottom: 1px solid var(--border-light);
  padding: 32px 0;
}
.page-header-inner {
  display: flex; align-items: center; justify-content: space-between;
}
.page-header h1 {
  font-family: var(--font-heading); font-size: 24px; font-weight: 800;
  letter-spacing: -0.5px;
}
.page-header h1 .url { color: var(--teal); }
.page-header .back-link {
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}
.page-header .back-link:hover { color: var(--teal); }

/* Context bar */
.context-bar {
  background: var(--teal-50); border-bottom: 1px solid var(--teal-100);
  padding: 12px 0;
}
.context-bar-inner {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-secondary);
}
.context-bar-inner strong { color: var(--text-primary); }
.context-location {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600;
}
.context-help {
  color: var(--teal); font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}
.context-help:hover { text-decoration: underline; }

/* Help tooltip */
.help-tooltip {
  display: none; background: var(--bg-page); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px 24px;
  box-shadow: var(--shadow-lg); max-width: 500px;
  margin: 0 auto; font-size: 14px; color: var(--text-secondary); line-height: 1.7;
}
.help-tooltip.visible { display: block; margin-top: 12px; }
.help-tooltip p { margin-bottom: 8px; }
.help-tooltip p:last-child { margin-bottom: 0; }

/* Main layout */
.results-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 32px;
  padding: 32px 0 80px;
  align-items: start;
}

/* Keywords table */
.kw-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; background: var(--bg-page);
}
.kw-table thead th {
  font-family: var(--font-heading); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); background: var(--bg-light);
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.kw-table thead th.col-right { text-align: right; }
.kw-table tbody tr { cursor: pointer; transition: background 0.15s; }
.kw-table tbody tr:hover { background: var(--teal-50); }
.kw-table tbody tr.selected { background: var(--teal-50); }
.kw-table tbody td {
  padding: 14px 16px; font-size: 14px;
  border-bottom: 1px solid var(--border-light); vertical-align: middle;
}
.kw-table tbody tr:last-child td { border-bottom: none; }
.kw-table td.col-right { text-align: right; }
.kw-check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 2px solid var(--border); background: var(--bg-page);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s; cursor: pointer;
}
.kw-check.checked { background: var(--teal); border-color: var(--teal); }
.kw-keyword { font-weight: 500; }
.kw-position { font-family: var(--font-heading); font-weight: 700; font-size: 15px; }
.kw-position.page1 { color: var(--teal); }
.kw-position.page2 { color: #d4a017; }
.kw-position.page3 { color: #c0392b; }
.kw-volume { color: var(--text-muted); font-size: 13px; }

/* Locked rows teaser — ghost table rows hint more keywords exist */
.kw-ghost-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--border); border-top: none;
  background: var(--bg-page); margin-top: -1px;
}
.kw-ghost-table tr td {
  padding: 14px 16px; font-size: 14px;
  border-bottom: 1px solid var(--border-light); vertical-align: middle;
  user-select: none;
}
.kw-ghost-table tr:last-child td { border-bottom: none; }
.kw-ghost-table tr:nth-child(1) { opacity: 0.9; }
.kw-ghost-table tr:nth-child(2) { opacity: 0.7; }
.kw-ghost-table tr:nth-child(3) { opacity: 0.5; }
.kw-ghost-check {
  display: inline-block; width: 18px; height: 18px;
  border-radius: 4px; border: 2px solid var(--border);
  background: var(--bg-page); vertical-align: middle;
}
.kw-ghost-text {
  display: inline-block; font-weight: 500;
  filter: blur(4px); letter-spacing: 0.4px;
}
.kw-ghost-pos {
  font-family: var(--font-heading); font-weight: 700; font-size: 15px;
  color: #d4a017; filter: blur(4px); letter-spacing: 0.3px;
}
.kw-ghost-num {
  color: var(--text-muted); font-size: 13px;
  filter: blur(4px); letter-spacing: 0.3px;
}

/* Prominent unlock banner */
.kw-locked {
  position: relative; z-index: 2;
  margin-top: -36px;
  display: flex; align-items: center; gap: 20px;
  padding: 22px 26px;
  background: linear-gradient(135deg, var(--navy) 0%, #253b51 100%);
  border: 2px solid var(--teal);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 36px -12px rgba(26,43,60,0.35);
  color: #fff;
}
.kw-locked-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal); border-radius: 50%; color: #fff;
}
.kw-locked-body { flex: 1; min-width: 0; }
.kw-locked-headline {
  font-family: var(--font-heading); font-size: 18px; font-weight: 700;
  color: #fff; line-height: 1.3; margin-bottom: 4px;
}
.kw-locked-headline .count { color: var(--yellow); }
.kw-locked-sub {
  font-size: 13px; color: rgba(255,255,255,0.78);
  line-height: 1.5; margin: 0;
}
.kw-locked .btn-primary {
  flex-shrink: 0; white-space: nowrap;
  padding: 12px 20px; font-size: 14px;
}
@media (max-width: 640px) {
  .kw-locked { flex-direction: column; text-align: center; gap: 14px; }
  .kw-locked .btn-primary { width: 100%; justify-content: center; }
  /* Keep the 5-column rankings table inside the viewport on phones */
  .kw-table thead th,
  .kw-table tbody td,
  .kw-ghost-table tr td { padding-left: 8px; padding-right: 8px; }
  .kw-table thead th { letter-spacing: 0; font-size: 10px; }
}

/* Summary panel */
.summary-panel {
  background: var(--bg-page); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  position: sticky; top: 80px;
  transition: border-color 0.3s;
}
.summary-panel.has-selections { border-color: var(--teal); }
.summary-panel h3 {
  font-family: var(--font-heading); font-size: 18px; font-weight: 700;
  margin-bottom: 20px;
}
.summary-stat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.summary-stat:last-of-type { border-bottom: none; }
.summary-stat-label { color: var(--text-secondary); }
.summary-stat-value { font-family: var(--font-heading); font-weight: 700; color: var(--text-primary); }
.summary-stat-value.highlight { color: var(--teal); font-size: 18px; }
.summary-plan {
  margin-top: 20px; padding: 16px;
  background: var(--teal-50); border-radius: var(--radius-sm);
  text-align: center;
}
.summary-plan-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--teal); margin-bottom: 4px; }
.summary-plan-price { font-family: var(--font-heading); font-size: 24px; font-weight: 800; color: var(--text-primary); }
.summary-plan-detail { font-size: 13px; color: var(--text-secondary); }
.summary-cta { margin-top: 20px; }
.summary-cta .btn-primary { width: 100%; justify-content: center; padding: 14px 24px; font-size: 15px; }
.summary-empty {
  text-align: center; padding: 12px 0;
  font-size: 14px; color: var(--text-muted); line-height: 1.7;
}
.summary-fine-print {
  font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 8px;
}
.summary-divider {
  height: 1px; background: var(--border-light); margin: 16px 0;
}
.summary-plan-note {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
}
.summary-plan-note p { margin-bottom: 8px; }
.summary-plan-note p:last-child { margin-bottom: 0; }
.summary-plan-note strong { color: var(--text-primary); }
.summary-plan-note a { color: var(--teal); font-weight: 600; }
.summary-plan-note a:hover { text-decoration: underline; }
.plan-range { font-size: 12px; color: var(--text-muted); }
.plan-alt { font-size: 12px; color: var(--text-muted); }

/* How It Works */
.how-section {
  padding: 60px 0; background: var(--bg-page);
  border-top: 1px solid var(--border-light);
}
.how-section h2 {
  font-family: var(--font-heading); font-size: 28px; font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 8px;
}
.how-section .how-subtitle {
  font-size: 15px; color: var(--text-secondary); margin-bottom: 36px; max-width: 600px;
}
.how-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 32px;
}
.how-step {
  background: var(--bg-page); border: 1px solid var(--border);
  border-top: 3px solid var(--teal); border-radius: var(--radius-md); padding: 28px 24px;
}
.how-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: 14px; font-weight: 800; margin-bottom: 14px;
}
.how-step h3 { font-family: var(--font-heading); font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.how-step p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.how-note {
  background: var(--teal-50); border: 1px solid var(--teal-100);
  border-radius: var(--radius-md); padding: 20px 24px;
  font-size: 14px; color: var(--text-secondary); line-height: 1.7;
}
.how-note strong { color: var(--text-primary); }

/* Email gate */
.email-gate {
  max-width: 480px; margin: 80px auto;
  background: var(--bg-page); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  text-align: center;
}
.email-gate h2 {
  font-family: var(--font-heading); font-size: 24px; font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 8px;
}
.email-gate .gate-url {
  font-size: 16px; color: var(--teal); font-weight: 600;
  font-family: var(--font-body); margin-bottom: 16px;
  word-break: break-all;
}
.email-gate p {
  font-size: 15px; color: var(--text-secondary); line-height: 1.6;
  margin-bottom: 24px;
}
.email-gate .gate-form {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px;
}
.email-gate .gate-form input {
  width: 100%; padding: 14px 16px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 16px; outline: none;
  transition: border-color 0.2s;
}
.email-gate .gate-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42,157,143,0.12);
}
.email-gate .gate-form button {
  padding: 14px 24px; white-space: nowrap;
}
.email-gate .gate-fine-print {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
}
/* Gate wrap: blurred rankings preview behind the gate card */
.gate-wrap { position: relative; max-width: 760px; margin: 32px auto 64px; }
.gate-wrap .email-gate {
  position: relative; z-index: 2; margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
.gate-preview {
  filter: blur(5px); opacity: 0.55; pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  max-height: 300px; overflow: hidden; margin-bottom: -260px;
}
.gate-preview .kw-table { pointer-events: none; }
.gate-proof {
  text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.gate-proof strong { color: var(--text-secondary); font-weight: 700; }
.gate-proof .stars { color: #f5a623; letter-spacing: 1px; }

/* Results intro band (orient -> diagnose -> direct) */
.results-intro-band {
  background: var(--bg-page); border-bottom: 1px solid var(--border-light);
  padding: 28px 0 24px;
}
.results-intro-band .ri-welcome {
  font-family: var(--font-heading); font-size: 24px; font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 6px; line-height: 1.25;
}
.results-intro-band .ri-welcome .url { color: var(--teal); }
.results-intro-band .ri-finding {
  font-size: 15px; color: var(--text-secondary); line-height: 1.6;
  margin-bottom: 16px; max-width: 760px;
}
.results-intro-band .ri-finding strong { color: var(--text-primary); }
.ri-opportunity {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--teal-50); border: 1px solid var(--teal-100);
  border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 18px;
  max-width: 760px;
}
.ri-opportunity svg { flex-shrink: 0; margin-top: 2px; color: var(--teal); }
.ri-opportunity .ri-opp-text { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
.ri-opportunity .ri-opp-text strong { color: var(--text-primary); }
.ri-steps {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  font-size: 13px; color: var(--text-muted); margin-bottom: 12px;
}
.ri-steps .ri-step { display: inline-flex; align-items: center; gap: 6px; }
.ri-steps .ri-step .ri-step-num { color: var(--teal); font-weight: 700; font-family: var(--font-heading); }
.ri-steps .ri-arrow { color: var(--border); }
.ri-pointer {
  font-size: 14px; font-weight: 600; color: var(--teal);
  display: inline-flex; align-items: center; gap: 6px;
}

@media (max-width: 640px) {
  .email-gate { padding: 28px 20px; margin: 48px auto; }
  .email-gate .gate-form { flex-direction: column; }
  .email-gate .gate-form input { max-width: none; width: 100%; }
  .email-gate .gate-form button { width: 100%; justify-content: center; }
}
/* Loading */
.loading { text-align: center; padding: 80px 0; display: none; }
.loading-text { font-size: 16px; color: var(--text-muted); margin-top: 12px; }

.analyzer-loading-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 560px;
  margin: 0 auto;
}
.analyzer-loading-main .spinner { margin: 0 auto; }
.analyzer-loading-warning[hidden] { display: none !important; }
.analyzer-loading-warning { width: 100%; }
.analyzer-warning-card {
  background: var(--bg-page);
  border: 2px solid #f0d68a;
  border-radius: 12px;
  padding: 20px 22px;
  text-align: left;
}
.analyzer-warning-card h2 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}
.analyzer-warning-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 16px;
}
.analyzer-warning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-outline:hover {
  border-color: var(--teal);
  background: rgba(42, 157, 143, 0.06);
}
.analyzer-error-flow { text-align: center; padding: 20px 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--teal); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto;
}

/* Testimonials */
.testimonials-section {
  padding: 60px 0; background: var(--bg-light);
  border-top: 1px solid var(--border-light);
  display: none;
}
.testimonials-section h2 {
  font-family: var(--font-heading); font-size: 24px; font-weight: 800;
  letter-spacing: -0.5px; text-align: center; margin-bottom: 8px;
}
.testimonials-section .section-sub {
  font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 36px;
}
.testimonial-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.testimonial-card {
  background: var(--bg-page); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 24px;
}
.testimonial-card::before {
  content: '\201C';
  font-family: Georgia, serif;
  font-size: 48px;
  line-height: 1;
  color: var(--teal-100);
  display: block;
  margin-bottom: -8px;
}
.testimonial-stars { color: #f5a623; font-size: 16px; margin-bottom: 12px; letter-spacing: 2px; }
.testimonial-quote {
  font-size: 14px; color: var(--text-secondary); line-height: 1.7;
  margin-bottom: 16px; font-style: italic;
}
.testimonial-author { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.testimonial-role { font-size: 12px; color: var(--text-muted); }

/* FAQ */
.faq-section {
  padding: 60px 0; background: var(--bg-page);
  border-top: 1px solid var(--border-light);
  display: none;
}
.faq-section h2 {
  font-family: var(--font-heading); font-size: 24px; font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 32px;
}
.faq-list { max-width: 720px; }
.faq-item {
  border-bottom: 1px solid var(--border-light);
}
.faq-question {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  font-family: var(--font-heading);
}
.faq-question:hover { color: var(--teal); }
.faq-toggle {
  font-size: 18px; color: var(--text-muted); transition: transform 0.2s;
  flex-shrink: 0; margin-left: 16px;
}
.faq-item.open .faq-toggle { transform: rotate(45deg); }
.faq-answer {
  display: none; padding: 0 0 18px;
  font-size: 14px; color: var(--text-secondary); line-height: 1.7;
}
.faq-item.open .faq-answer { display: block; }

/* Final CTA */
.final-cta {
  padding: 60px 0; text-align: center;
  background: linear-gradient(170deg, #edf8f7 0%, #f0faf6 50%, #fef9ed 100%);
  border-top: 1px solid var(--border-light);
  display: none;
}
.final-cta h2 {
  font-family: var(--font-heading); font-size: 24px; font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 8px;
}
.final-cta p {
  font-size: 15px; color: var(--text-secondary); margin-bottom: 24px;
}
.final-cta .btn-primary { font-size: 15px; padding: 14px 28px; }
.final-cta .fine-print {
  font-size: 12px; color: var(--text-muted); margin-top: 10px;
}

@media (max-width: 768px) {
  .testimonial-grid { grid-template-columns: 1fr; }
}

/* API Panel */
#apiPanel {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--navy); border-top: 2px solid var(--teal);
  padding: 12px 24px; display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-on-dark-muted);
}
#apiPanel .label { font-weight: 600; color: var(--text-on-dark); white-space: nowrap; }
#apiPanel input, #apiPanel select {
  flex: 1; max-width: 200px; padding: 6px 10px;
  border: 1px solid #2d4356; border-radius: 6px;
  background: #0f1c2a; color: var(--text-on-dark); font-size: 13px; font-family: inherit;
}
#apiPanel .api-status { margin-left: auto; white-space: nowrap; }

/* Responsive */
@media (max-width: 768px) {
  .results-layout { grid-template-columns: 1fr; }
  .summary-panel { position: static; }
  .how-steps { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 20px; }
  .page-header-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .context-bar-inner { flex-direction: column; gap: 8px; }
}

/* ═══════════════════════════════════════════════════════════════════
   AI Visibility add-on — toggle in summary panel + methodology modal
   ═══════════════════════════════════════════════════════════════════ */
.ai-ext-section {
  margin: 16px -4px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 50%, #fdf2f8 100%);
  border: 1px solid #ede9fe;
  border-radius: 12px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.ai-ext-section:has(input:checked) {
  border-color: #8b5cf6;
  box-shadow: 0 4px 12px rgba(139,92,246,0.15);
}
.ai-ext-toggle {
  display: flex; gap: 12px; cursor: pointer; align-items: flex-start;
}
.ai-ext-toggle input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 3px;
  accent-color: #8b5cf6;
  cursor: pointer;
  flex-shrink: 0;
}
.ai-ext-toggle-body { flex: 1; min-width: 0; }
.ai-ext-toggle-head {
  font-family: var(--font-heading);
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; row-gap: 4px;
}
.ai-ext-sparkle { color: #8b5cf6; flex-shrink: 0; }
.ai-ext-toggle-title { white-space: nowrap; }
.ai-ext-pill {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  color: white; font-family: var(--font-heading);
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 7px; border-radius: 100px;
  box-shadow: 0 2px 6px rgba(139,92,246,0.3);
  flex-shrink: 0;
}
.ai-ext-toggle-desc {
  font-size: 12.5px; color: var(--text-secondary);
  line-height: 1.55;
}
.ai-ext-toggle-desc strong {
  color: var(--text-primary); font-weight: 700;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ai-ext-info-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--font-body);
  font-size: 11.5px; font-weight: 600;
  color: #8b5cf6;
  text-decoration: underline; text-underline-offset: 2px;
  flex-shrink: 0;
}
.ai-ext-info-link:hover { color: #6d28d9; }

/* Per-engine dots */
.ai-ext-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}
.ai-ext-dot.bing  { background: #0078d4; }
.ai-ext-dot.brave { background: #fb542b; }

/* Bing/Brave summary stat rows — subtle violet tint */
.summary-stat.ai-ext-row { background: linear-gradient(90deg, rgba(139,92,246,.05), transparent); }

/* ─── Methodology modal ─── */
.ai-method-backdrop {
  position: fixed; inset: 0;
  background: rgba(26,43,60,.5); z-index: 10000;
  align-items: center; justify-content: center; padding: 20px;
  display: flex;
}
.ai-method-backdrop[hidden] { display: none; }
.ai-method-modal {
  background: #fff; border-radius: 14px;
  max-width: 580px; width: 100%; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  padding: 28px;
  font-family: var(--font-body);
}
.ai-method-modal h3 {
  font-family: var(--font-heading);
  font-size: 20px; font-weight: 700; margin: 0 0 6px; color: var(--text-primary);
}
.ai-method-modal .method-eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  color: #8b5cf6; text-transform: uppercase; margin-bottom: 4px;
}
.ai-method-modal .method-sub {
  color: var(--text-secondary); font-size: 13.5px;
  margin-bottom: 18px; line-height: 1.55;
}
.ai-method-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.ai-method-stat {
  background: #f7f9fb; border: 1px solid #eaeff4; border-radius: 8px;
  padding: 12px 10px; text-align: center;
}
.ai-method-stat-num {
  font-family: var(--font-heading); font-size: 24px; font-weight: 800;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.ai-method-stat-text { font-size: 11.5px; color: var(--text-secondary); margin-top: 6px; line-height: 1.4; }
.ai-method-stat-text strong { color: var(--text-primary); }
.ai-method-body { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.ai-method-body ul { padding-left: 18px; margin: 8px 0; }
.ai-method-body li { margin-bottom: 4px; }
.ai-method-close {
  background: var(--text-primary); color: #fff; border: 0;
  padding: 10px 22px; border-radius: 8px;
  font-weight: 600; cursor: pointer; margin-top: 18px;
  font-family: var(--font-body);
}
.ai-method-close:hover { filter: brightness(1.15); }
@media (max-width: 480px) {
  .ai-method-stats { grid-template-columns: 1fr; }
}
