/* ==========================================================================
   GEO Tool — Design System & Complete Stylesheet
   Version: 2.1 (UI/UX Pro Max refined)
   Last updated: 2026-03-28

   Design system: Analytics Dashboard (Swiss Modernism 2.0 + Data-Dense)
   Palette: Blue data + amber highlights
   Typography: Fira Sans (body) + Fira Code (mono/data)
   Style ref: Linear, Vercel Dashboard, PostHog

   Drop this file into your Replit project and replace the existing CSS.
   All class names are prefixed where needed to avoid collisions.
   No frameworks, no preprocessors — vanilla CSS only.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&display=swap');


/* ==========================================================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ========================================================================== */

:root {
  /* --- Primary palette (Analytics Dashboard — UI/UX Pro Max) --- */
  --color-primary:        #1E3A8A;   /* Deep blue — headers, primary text */
  --color-primary-light:  #1E40AF;   /* Hover state for primary */
  --color-accent:         #2563EB;   /* Blue — buttons, active states, links */
  --color-accent-hover:   #1D4ED8;
  --color-accent-light:   #DBEAFE;   /* Accent tint for backgrounds */

  /* --- Semantic colors --- */
  --color-success:        #059669;   /* Cited / Positive */
  --color-success-bg:     #ecfdf5;
  --color-warning:        #d97706;   /* Mixed / Middle */
  --color-warning-bg:     #fffbeb;
  --color-danger:         #dc2626;   /* Not cited / Negative */
  --color-danger-bg:      #fef2f2;
  --color-info:           #1E40AF;   /* Informational / Web Grounded */
  --color-info-bg:        #DBEAFE;

  /* --- Neutrals --- */
  --gray-50:              #f9fafb;
  --gray-100:             #f3f4f6;
  --gray-200:             #e5e7eb;
  --gray-300:             #d1d5db;
  --gray-400:             #9ca3af;
  --gray-500:             #6b7280;
  --gray-600:             #4b5563;
  --gray-700:             #374151;
  --gray-800:             #1f2937;
  --gray-900:             #111827;

  /* --- Typography (Fira Sans + Fira Code — analytics/dashboard pairing) --- */
  --font-sans:            'Fira Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:            'Fira Code', 'JetBrains Mono', 'Consolas', monospace;

  --text-xs:              0.75rem;     /* 12px */
  --text-sm:              0.8125rem;   /* 13px */
  --text-base:            0.875rem;    /* 14px */
  --text-md:              1rem;        /* 16px */
  --text-lg:              1.125rem;    /* 18px */
  --text-xl:              1.25rem;     /* 20px */
  --text-2xl:             1.5rem;      /* 24px */
  --text-3xl:             1.875rem;    /* 30px */

  --leading-tight:        1.25;
  --leading-normal:       1.5;
  --leading-relaxed:      1.625;

  --weight-normal:        400;
  --weight-medium:        500;
  --weight-semibold:      600;
  --weight-bold:          700;

  /* --- Spacing (4px base) --- */
  --sp-1:   0.25rem;   /*  4px */
  --sp-2:   0.5rem;    /*  8px */
  --sp-3:   0.75rem;   /* 12px */
  --sp-4:   1rem;      /* 16px */
  --sp-5:   1.25rem;   /* 20px */
  --sp-6:   1.5rem;    /* 24px */
  --sp-8:   2rem;      /* 32px */
  --sp-10:  2.5rem;    /* 40px */
  --sp-12:  3rem;      /* 48px */
  --sp-16:  4rem;      /* 64px */

  /* --- Borders & Shadows --- */
  --radius-sm:    4px;
  --radius-md:    6px;
  --radius-lg:    8px;
  --radius-xl:    12px;
  --radius-full:  9999px;

  --shadow-xs:    0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 5px rgba(0, 0, 0, 0.02);
  --shadow-md:    0 2px 4px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-lg:    0 4px 8px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06);
  --shadow-sticky: 0 1px 0 rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.04);

  --border-default: 1px solid var(--gray-200);
  --border-light:   1px solid var(--gray-100);
  --border-subtle:  1px solid rgba(0, 0, 0, 0.06);  /* Sleeker than gray borders */

  /* --- Layout --- */
  --page-max-width: 1200px;
  --card-min-width: 340px;
  --sidebar-width:  0;  /* No sidebar — single page tool */

  /* --- Transitions --- */
  --transition-fast:  120ms ease;
  --transition-base:  200ms ease;
  --transition-slow:  300ms ease;
  --transition-spring: 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--gray-800);
  background-color: #F8FAFC;  /* Analytics Dashboard background */
  min-height: 100vh;
  letter-spacing: -0.011em;   /* Tighter tracking like Linear/Vercel */
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1;  /* Tabular figures for aligned numbers */
}

/* Focus ring for keyboard accessibility (CRITICAL per UI/UX Pro Max) */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

h1, h2, h3, h4 {
  color: var(--color-primary);
  line-height: var(--leading-tight);
  font-weight: var(--weight-semibold);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-md); font-weight: var(--weight-medium); }

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

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ==========================================================================
   3. PAGE LAYOUT
   ========================================================================== */

.geo-page {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 48px 24px;
}

.geo-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  margin-bottom: 16px;
}

.geo-page-header h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.geo-page-header .geo-header-subtitle,
.geo-page-header .geo-page-subtitle {
  color: var(--gray-400);
  font-size: 12px;
  margin-top: var(--sp-1);
  max-width: 500px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ==========================================================================
   4. FORM SECTION (Collapsible)
   ========================================================================== */

.geo-form-section {
    background: #ffffff;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 12px;
    padding: 24px 32px;
    box-shadow: none;
    margin-bottom: 24px;
}

/* Collapsed state — add this class via JS when scan starts */
.geo-form-section.is-collapsed {
  padding: var(--sp-3) var(--sp-6);
  cursor: pointer;
}

.geo-form-section.is-collapsed .geo-form-body,
.geo-form-section.is-collapsed > form,
.geo-form-section.is-collapsed > .geo-tab-header p {
  display: none;
}

.geo-form-section.is-collapsed .geo-form-summary-line {
  display: flex;
}

.geo-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.geo-form-header h2 {
  font-size: var(--text-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.geo-form-toggle-icon {
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  transition: transform 0.15s ease;
}

.geo-form-section.is-collapsed .geo-form-toggle-icon {
  transform: rotate(-90deg);
}

/* One-line summary visible when collapsed */
.geo-form-summary-line {
  display: none;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.geo-form-summary-line strong {
  color: var(--gray-700);
  font-weight: var(--weight-medium);
}

/* Tab header (per-tab title + subtitle) */
.geo-tab-header {
  margin-bottom: 16px;
}
.geo-tab-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900, #0f172a);
  margin: 0 0 4px;
}
.geo-tab-header p {
  font-size: 14px;
  color: var(--gray-500, #64748b);
  margin: 0;
  line-height: 1.4;
}

/* Form body — 2-column grid */
.geo-form-body {
  margin-top: var(--sp-5);
}

.geo-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4) var(--sp-6);
}

.geo-form-grid .field-full-width {
  grid-column: 1 / -1;
}

/* Field group */
.geo-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  position: relative;
}

.geo-field label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--gray-700);
}

.geo-field .field-hint,
.geo-field-hint {
  font-size: 11px;
  color: var(--gray-400);
  display: block;
  margin-top: 2px;
  line-height: 1.3;
}

/* Inputs */
.geo-input {
  height: 38px;
  padding: 0 var(--sp-3);
  border: var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--gray-800);
  background: #fff;
  outline: none;
  width: 100%;
}

.geo-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.geo-input::placeholder {
  color: var(--gray-400);
}

/* Select */
.geo-select {
  height: 38px;
  padding: 0 var(--sp-3);
  border: var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--gray-800);
  background: #fff;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: var(--sp-8);
  width: 100%;
}

.geo-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Toggle / Switch */
.geo-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--gray-700);
}

.geo-toggle input[type="checkbox"] {
  appearance: none;
  width: 36px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--gray-300);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.geo-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease;
}

.geo-toggle input[type="checkbox"]:checked {
  background: var(--color-accent);
}

.geo-toggle input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}

/* Form actions row */
.geo-form-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: var(--border-light);
}


/* ==========================================================================
   5. BUTTONS
   ========================================================================== */

.geo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 38px;
  padding: 0 var(--sp-5);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.geo-btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.3), 0 0 0 1px rgba(37, 99, 235, 0.1);
  transition: all 0.15s ease;
}
.geo-btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35), 0 0 0 1px rgba(37, 99, 235, 0.15);
  transform: translateY(-0.5px);
}
.geo-btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.geo-btn-secondary {
  background: #fff;
  color: var(--gray-700);
  border: var(--border-default);
}
.geo-btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.geo-btn-ghost {
  background: transparent;
  color: var(--gray-600);
}
.geo-btn-ghost:hover {
  background: var(--gray-100);
}
.geo-btn-export {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  background: var(--gray-100, #f1f5f9);
  color: var(--gray-700, #334155);
  border: 1px solid var(--gray-300, #cbd5e1);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}
.geo-btn-export:hover {
  background: var(--gray-200, #e2e8f0);
}

.geo-btn-sm {
  height: 30px;
  padding: 0 var(--sp-3);
  font-size: var(--text-sm);
}

.geo-btn:disabled,
.geo-btn[aria-busy="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Scanning state button */
.geo-btn[aria-busy="true"] .geo-btn-label {
  display: none;
}
.geo-btn .geo-btn-spinner {
  display: none;
}
.geo-btn[aria-busy="true"] .geo-btn-spinner {
  display: inline-block;
}


/* ==========================================================================
   6. SUMMARY BAR (Sticky)
   ========================================================================== */

.geo-summary-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-6);
  box-shadow: var(--shadow-sticky);
  overflow: visible;  /* Tooltips need to escape the bar; canvas is clamped to 48×48px so overflow guard is not needed */
  display: none;  /* Hidden until results load */
  transition: padding 200ms ease, box-shadow 200ms ease;
}

.geo-summary-bar.is-visible {
  display: block;
}

.geo-summary-bar-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  flex-wrap: wrap;         /* Fix 7: prevent overflow at ~1000-1200px */
}

/* ── Compact mode (shrinks when user scrolls down into results) ─────────── */
.geo-summary-bar.is-compact {
  padding: 5px 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}
.geo-summary-bar.is-compact .geo-summary-bar-inner {
  flex-wrap: nowrap;
  gap: var(--sp-6);
}
.geo-summary-bar.is-compact .geo-inline-note { display: none; }
.geo-summary-bar.is-compact .donut-caption { font-size: 0.6875rem; }
.geo-summary-bar.is-compact .donut-meta { display: none; }
.geo-summary-bar.is-compact .geo-donut-group { gap: var(--sp-4); }
.geo-summary-bar.is-compact .geo-donut-item { gap: 8px; }
.geo-summary-bar.is-compact .donut-value { font-size: var(--text-sm); }
.geo-summary-bar.is-compact .geo-bar-stat-label { font-size: 0.5625rem; }
.geo-summary-bar.is-compact .geo-bar-stat-val { font-size: 0.875rem; }
.geo-summary-bar.is-compact .geo-bar-stats { gap: 8px; }
.geo-summary-bar.is-compact .geo-bar-stat-divider { height: 18px; }
.geo-summary-bar.is-compact .geo-bar-middle { gap: 2px; padding: 0 4px; }
.geo-summary-bar.is-compact .geo-cited-hero { padding: 5px 14px; }
.geo-summary-bar.is-compact .geo-cited-hero-big { font-size: 1.25rem; }
.geo-summary-bar.is-compact .geo-cited-hero-total { font-size: 0.875rem; }
.geo-summary-bar.is-compact .geo-cited-hero-label { font-size: 0.625rem; margin-top: 2px; }
.geo-summary-bar.is-compact .geo-cited-hero-divider { margin: 4px 0; }
.geo-summary-bar.is-compact .geo-cited-hero-vs-label { display: none; }
.geo-summary-bar.is-compact .geo-cited-hero-compare { font-size: 0.75rem; }
.geo-summary-bar.is-compact .geo-cited-hero-lead { font-size: 0.75rem; margin-top: 2px; }

html[data-theme="dark"] .geo-summary-bar.is-compact {
  box-shadow: 0 1px 8px rgba(0,0,0,0.3);
}
.scan-diff-bar {
  display: flex;
  justify-content: center;
  margin: 2px 0 0;
}
.scan-diff-btn {
  background: none;
  border: none;
  color: var(--gray-500, #94a3b8);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.01em;
  transition: color 0.15s, background 0.15s;
  line-height: 1.4;
}
.scan-diff-btn:hover {
  color: var(--color-primary, #1e40af);
  background: var(--gray-100, #f1f5f9);
}
html[data-theme="dark"] .scan-diff-btn { color: #64748b; }
html[data-theme="dark"] .scan-diff-btn:hover { color: #93c5fd; background: rgba(255,255,255,0.06); }
.scan-diff-btn:disabled, .scan-diff-btn.geo-btn-disabled { opacity: 0.55; cursor: default; pointer-events: none; }
.geo-summary-bar.is-compact .geo-bar-kw-label { display: none; }
.geo-summary-bar.is-compact .geo-bar-signal-row { flex-direction: row; gap: 5px; }
.geo-summary-bar.is-compact .geo-signal-val { display: none; }
.geo-summary-bar.is-compact .geo-signal-pill { padding: 1px 6px 1px 5px; font-size: 0.6875rem; }

/* ── Center signals section ─────────────────────────────────────────────── */
.geo-bar-signals {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 4px;
  flex-shrink: 0;
  align-self: center;
}
.geo-bar-kw-label {
  font-size: 0.6875rem;
  color: var(--gray-400);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
  letter-spacing: 0.01em;
}
.geo-bar-signal-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}
.geo-signal-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
  line-height: 1.4;
}
.geo-signal-pill.is-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.geo-signal-pill.is-miss {
  background: #fafafa;
  border-color: #e5e7eb;
  color: #6b7280;
}
.geo-signal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}
.geo-signal-name {
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
}
.geo-signal-val {
  font-size: 0.6875rem;
  opacity: 0.8;
}

html[data-theme="dark"] .geo-bar-kw-label { color: #475569; }
html[data-theme="dark"] .geo-signal-pill.is-ok { background: #052e16; border-color: #166534; color: #4ade80; }
html[data-theme="dark"] .geo-signal-pill.is-miss { background: #1e293b; border-color: #334155; color: #64748b; }
html[data-theme="dark"] .geo-bar-stat-val { color: #f1f5f9; }
html[data-theme="dark"] .geo-bar-stat-label { color: #475569; }
html[data-theme="dark"] .geo-bar-stat-divider { background: #334155; }
html[data-theme="dark"] .donut-meta { color: #475569; }
html[data-theme="dark"] .geo-donut-label .donut-caption { color: #94a3b8; }

/* Donut chart containers */
.geo-donut-group {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex: 0 0 auto;
}

.geo-donut-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;          /* Don't stretch — size to content */
  min-width: 0;
  cursor: help;
  position: relative;
}

.geo-donut-canvas {
  width: 36px !important;  /* Force small — Chart.js responsive:false locks this */
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  flex-shrink: 0;
  pointer-events: none;
}
.geo-donut-label .donut-meta { display: none; }

.circle-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  max-width: 320px;
  white-space: normal;
  text-align: center;
  z-index: 9999;
  pointer-events: none;
}
.geo-donut-item:hover .circle-tooltip,
.geo-summary-metric:hover .circle-tooltip {
  display: block;
}

.geo-donut-label {
  display: flex;
  flex-direction: column;
}

.geo-donut-label .donut-value {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  line-height: 1;
}

.geo-donut-label .donut-caption {
  font-size: 0.8125rem;    /* 13px — readable at a glance */
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 2px;
  white-space: nowrap;
}

.geo-donut-label .donut-meta {
  font-size: 0.6875rem;    /* 11px — secondary descriptor */
  color: var(--gray-400);
  margin-top: 1px;
  white-space: nowrap;
  line-height: 1.3;
}

/* ── Bar middle section — fills white space between donuts and hero ────── */
.geo-bar-middle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 0 8px;
}

.geo-bar-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.geo-bar-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 44px;
}

.geo-bar-stat-val {
  font-size: 1.125rem;     /* 18px */
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.01em;
}

.geo-bar-stat-label {
  font-size: 0.625rem;     /* 10px */
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  line-height: 1.2;
}

.geo-bar-stat-divider {
  width: 1px;
  height: 28px;
  background: #e2e8f0;
  flex-shrink: 0;
  align-self: center;
}

/* Summary quick metrics */
.geo-summary-metrics {
  display: flex;
  gap: 24px;               /* Fix 2: breathing room between metric blocks */
  margin-left: auto;
  flex-wrap: wrap;         /* Fix 2: wrap at narrow widths */
}

.geo-summary-metric {
  text-align: center;
  min-width: 70px;         /* Fix 2: prevent crushing */
  position: relative;
  cursor: help;
}

.geo-summary-metric .metric-value {
  font-size: var(--text-xl);   /* match donut-value size for visual consistency */
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  line-height: 1;
}

.geo-summary-metric .metric-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-top: 2px;
  white-space: nowrap;
}


/* ==========================================================================
   7. CARD GRID
   ========================================================================== */

/* ==========================================================================
   Fix 1: Section Dividers — turn a wall of content into a scannable report
   ========================================================================== */

.geo-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 12px;
  grid-column: 1 / -1;
}
.geo-section-divider:first-child,
.geo-results-heading + .geo-section-divider {
  margin-top: 8px;
}
.geo-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200, #e5e7eb);
}
.geo-section-divider h3,
.geo-section-divider h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400, #9ca3af);
  white-space: nowrap;
  margin: 0;
}

/* ==========================================================================
   Fix 2: Consistent spacing + full-width spans for wide elements in grid
   ========================================================================== */

.geo-results-header-row,
.missing-from-card,
.competitor-comparison-table,
.competitor-citations-detail,
.verification-section-wrap,
.not-cited-list,
.geo-fanout-row,
#verify-urls-status,
.geo-section-divider {
  grid-column: 1 / -1;
}

#zone-results > * + * {
  /* handled by grid gap — no extra margin needed */
}

.geo-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;                /* Fix 6: was var(--sp-5)/20px — tighter */
  margin-bottom: var(--sp-8);
}


/* ==========================================================================
   8. SERVICE CARD — Consistent Anatomy
   ========================================================================== */

.geo-card {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 200ms ease, transform 200ms ease;
}

.geo-card:hover {
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

/* Cited: green left border accent */
.geo-card.is-cited {
    border-left: 3px solid #059669;
}

/* Not-cited: muted red left border, slightly dimmed */
.geo-card.not-cited {
    border-left: 3px solid #d4d4d4;
    opacity: 0.85;
}

/* --- Card Header --- */
.geo-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f5f5f5;
    background: transparent;
    gap: 8px;
}

.geo-card-title-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;  /* Allow text truncation */
}

.geo-card-service-name {
    font-size: 15px;
    font-weight: 700;
    color: #0a0a0a;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.geo-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.geo-card-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-1);
  flex-shrink: 0;
}

/* --- Card Body --- */
.geo-card-body {
    padding: 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Citation status row */
.geo-card-citation-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f5f5f5;
}

.geo-card-cited {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.geo-card-cited.is-cited {
  color: var(--color-success);
}

.geo-card-cited.not-cited {
  color: var(--gray-400);
}

.geo-card-position-info {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--gray-600);
}

/* Source type breakdown */
.geo-card-source-breakdown {
  display: flex;
  gap: var(--sp-4);
  font-size: var(--text-sm);
}

.geo-card-source-count {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--gray-600);
}

.geo-card-source-count strong {
  font-weight: var(--weight-semibold);
  color: var(--gray-800);
}

/* Citations list */
.geo-card-citations {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 1;
}

.geo-citation-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
    min-height: 32px;
    transition: background 100ms ease;
}

.geo-citation-row:hover {
    background: #fafafa;
    margin: 0 -20px;
    padding: 8px 20px;
}

.geo-citation-url {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
    flex: 1;
    min-width: 0;
}

.geo-citation-row .badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    gap: 4px;
    line-height: 1;
    white-space: nowrap;
}

/* Verification icon in citation row */
.geo-citation-status {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.geo-citation-status.is-verified { color: var(--color-success); }
.geo-citation-status.is-broken   { color: var(--color-danger); }
.geo-citation-status.is-pending  { color: var(--gray-400); }

/* --- Card Footer --- */
.geo-card-footer {
    padding: 12px 20px;
    background: #fafafa;
    border-top: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #737373;
}

.geo-card-footer .geo-card-total-citations {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.geo-card-footer .geo-card-total-citations strong {
  color: var(--gray-800);
}


/* ==========================================================================
   9. BADGE COMPONENT
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* Source type badges */
.badge-grounded {
    background: #eff6ff;
    color: #2563eb;
}

.badge-memory {
    background: #fefce8;
    color: #a16207;
}

.badge-real-user {
    background: #f0fdf4;
    color: #15803d;
}

/* Model badge */
.badge-model {
  background: var(--gray-100);
  color: var(--gray-600);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: -0.01em;
}

/* Position badges */
.badge-top {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-middle {
    background: #fffbeb;
    color: #a16207;
    border: 1px solid #fde68a;
}

.badge-bottom {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Sentiment badges */
.badge-positive {
    background: #f0fdf4;
    color: #15803d;
}

.badge-mixed {
    background: #fffbeb;
    color: #a16207;
}

.badge-negative {
    background: #fef2f2;
    color: #dc2626;
}

/* Source type tags (in citation rows) */
.badge-brand {
  background: #ede9fe;
  color: #7c3aed;
}

.badge-competitor {
  background: #fef3c7;
  color: #b45309;
}

.badge-other {
  background: var(--gray-100);
  color: var(--gray-600);
}


/* ==========================================================================
   10. LOADING / SCANNING STATE
   ========================================================================== */

.geo-scanning-overlay {
    display: none;
    text-align: center;
    padding: var(--sp-12) var(--sp-4);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
}

.geo-scanning-overlay.is-active {
  display: block;
}

.geo-scanning-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: geo-spin 0.8s linear infinite;
  margin: 0 auto var(--sp-4);
}

@keyframes geo-spin {
  to { transform: rotate(360deg); }
}

.geo-scanning-text {
  font-size: var(--text-md);
  color: var(--gray-600);
  margin-bottom: var(--sp-1);
}

.geo-scanning-subtext {
  font-size: var(--text-sm);
  color: var(--gray-400);
}

/* Progress bar (optional — for timed scans) */
.geo-progress-bar {
  width: 240px;
  height: 4px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  margin: var(--sp-4) auto 0;
  overflow: hidden;
}

.geo-progress-bar-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.3s ease;
}


/* ==========================================================================
   11. KEYWORD SUGGESTIONS PANEL
   ========================================================================== */

.geo-keywords-panel {
  background: #fff;
  border: var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-6);
  box-shadow: var(--shadow-sm);
}

.geo-keywords-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.geo-keywords-panel-header h3 {
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Chip component */
.geo-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.geo-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}

.geo-chip:hover {
  filter: brightness(0.95);
}

/* Chip color variants by stage/category */
.geo-chip-awareness {
  background: #dbeafe;
  color: #1e40af;
}

.geo-chip-consideration {
  background: #e0e7ff;
  color: #3730a3;
}

.geo-chip-decision {
  background: #ede9fe;
  color: #5b21b6;
}

.geo-chip-comparison {
  background: #fef3c7;
  color: #92400e;
}

.geo-chip-default {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* Selected chip */
.geo-chip.is-selected {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}


/* ==========================================================================
   12. SECONDARY SECTIONS
       (Fan-out queries, Top cited domains, URL verification, Citability, AI Overview)
   ========================================================================== */

.geo-section {
  background: #fff;
  border: var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-sm);
}

.geo-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.geo-section-header h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.geo-section-header .geo-section-count {
  font-size: var(--text-sm);
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

/* Fan-out queries list */
.geo-fanout-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.geo-fanout-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  font-size: var(--text-sm);
}

.geo-fanout-item .fanout-index {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}

/* Top cited domains table */
.geo-domains-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.geo-domains-table th {
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 2px solid var(--gray-200);
  font-weight: var(--weight-medium);
  color: var(--gray-500);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.geo-domains-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: var(--border-light);
  color: var(--gray-700);
}

.geo-domains-table tbody tr:hover {
  background: var(--gray-50);
}

.geo-domains-table .domain-bar {
  display: inline-block;
  height: 6px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  min-width: 4px;
}

/* URL Verification list */
.geo-verification-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.geo-verification-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.geo-verification-item:hover {
  background: var(--gray-50);
}

.geo-verification-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.geo-verification-icon.status-200  { color: var(--color-success); }
.geo-verification-icon.status-301  { color: var(--color-warning); }
.geo-verification-icon.status-404  { color: var(--color-danger); }
.geo-verification-icon.status-err  { color: var(--gray-400); }

.geo-verification-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray-700);
}

.geo-verification-status-code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  flex-shrink: 0;
}

/* Citability analyzer section */
.geo-citability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
}

.geo-citability-signal {
  padding: var(--sp-3);
  background: var(--gray-50);
  border-radius: var(--radius-md);
}

.geo-citability-signal-name {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-1);
}

.geo-citability-signal-value {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
}

.geo-citability-signal-delta {
  font-size: var(--text-xs);
  margin-top: 2px;
}

.geo-citability-signal-delta.is-positive { color: var(--color-success); }
.geo-citability-signal-delta.is-negative { color: var(--color-danger); }
.geo-citability-signal-delta.is-neutral  { color: var(--gray-400); }


/* ==========================================================================
   13. UTILITY CLASSES
   ========================================================================== */

.text-muted    { color: var(--gray-500); }
.text-sm       { font-size: var(--text-sm); }
.text-xs       { font-size: var(--text-xs); }
.text-mono     { font-family: var(--font-mono); }
.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }

.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }

.flex         { display: flex; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-1        { gap: var(--sp-1); }
.gap-2        { gap: var(--sp-2); }
.gap-3        { gap: var(--sp-3); }

.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;
}

/* Hidden by default, shown when parent has .is-visible */
.show-on-results { display: none; }
.has-results .show-on-results { display: block; }


/* ==========================================================================
   13b. RESPONSIVE — 1100px breakpoint (Fix 7: summary bar medium-screen overflow)
   ========================================================================== */

@media (max-width: 1100px) {
  .geo-summary-bar-inner {
    justify-content: center;
  }

  .geo-donut-group {
    justify-content: center;
    flex-wrap: wrap;
  }

  .geo-summary-metrics {
    margin-left: 0;
    justify-content: center;
  }
}

/* ==========================================================================
   14. RESPONSIVE — 768px breakpoint
   ========================================================================== */


/* ── GSC Utility Classes (replacing inline styles) ── */

/* Text utilities */
.gsc-text-muted { color: var(--gray-400); font-size: var(--text-sm); }
.gsc-text-secondary { color: var(--gray-500); font-size: var(--text-sm); }
.gsc-text-success { color: var(--color-success); font-weight: 600; }
.gsc-text-danger { color: var(--color-danger); }
.gsc-text-link { color: var(--color-primary); text-decoration: none; cursor: pointer; }
.gsc-text-link:hover { text-decoration: underline; }

/* Section headers */
.gsc-section-header { margin-bottom: var(--sp-3); font-size: var(--text-sm); color: var(--gray-500); }
.gsc-section-title { font-size: var(--text-sm); font-weight: 600; color: var(--gray-500); margin-bottom: var(--sp-2); }

/* Layout utilities */
.gsc-flex-between { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--gray-100); }
.gsc-flex-center { display: flex; align-items: center; gap: var(--sp-2); }
.gsc-mb-3 { margin-bottom: var(--sp-3); }
.gsc-mb-4 { margin-bottom: var(--sp-4); }
.gsc-mt-4 { margin-top: var(--sp-4); }

/* URL truncation (reusable) */
.gsc-url-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsc-url-cell-sm { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); color: var(--gray-500); }

/* Empty state */
.gsc-empty { padding: var(--sp-5); text-align: center; color: var(--gray-400); font-size: var(--text-sm); }

/* Highlight boxes (quick wins) */
.gsc-highlight-green { background: #f0fdf4; border: 1px solid #86efac; border-radius: var(--radius-xl); padding: 14px 18px; margin-bottom: var(--sp-4); }
.gsc-highlight-blue { background: #eff6ff; border: 2px solid #93c5fd; border-radius: var(--radius-xl); padding: 14px 18px; margin-bottom: var(--sp-4); }
.gsc-highlight-yellow { background: #fefce8; border: 1px solid #fde68a; border-radius: var(--radius-xl); padding: 14px 18px; margin-bottom: var(--sp-4); }

/* Overview list row */
.gsc-list-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--gray-100); transition: background var(--transition-fast); }
.gsc-list-row:hover { background: var(--gray-50); }
.gsc-list-row:last-child { border-bottom: none; }

/* Delta display */
.gsc-delta-up { font-size: var(--text-xs); color: var(--color-success); }
.gsc-delta-down { font-size: var(--text-xs); color: var(--color-danger); }
.gsc-delta-neutral { font-size: var(--text-xs); color: var(--gray-400); }

/* Bar chart rows (for position history, traffic trend, keyword history) */
.gsc-bar-row { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: 4px; }
.gsc-bar-label { width: 55px; font-size: var(--text-xs); color: var(--gray-500); text-align: right; }
.gsc-bar-track { flex: 1; background: var(--gray-100); border-radius: var(--radius-sm); height: 20px; overflow: hidden; }
.gsc-bar-fill { height: 100%; border-radius: var(--radius-sm); display: flex; align-items: center; padding-left: 6px; font-size: 10px; font-weight: 600; color: #fff; transition: width var(--transition-base); }
.gsc-bar-count { width: 45px; font-size: 10px; color: var(--gray-500); }

/* Severity badges (cannibalization) */
.gsc-severity-high { background: var(--color-danger-bg); color: #991b1b; padding: 4px 10px; border-radius: var(--radius-md); font-size: var(--text-xs); font-weight: 600; }
.gsc-severity-medium { background: var(--color-warning-bg); color: #854d0e; padding: 4px 10px; border-radius: var(--radius-md); font-size: var(--text-xs); font-weight: 600; }
.gsc-severity-low { background: var(--gray-100); color: var(--gray-500); padding: 4px 10px; border-radius: var(--radius-md); font-size: var(--text-xs); font-weight: 600; }

/* Modal overlay */
.gsc-modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 9999; align-items: center; justify-content: center; }
.gsc-modal-overlay.active { display: flex; }
.gsc-modal-content { background: #fff; border-radius: var(--radius-xl); padding: var(--sp-6); max-width: 700px; width: 90%; max-height: 80vh; overflow-y: auto; position: relative; }
.gsc-modal-close { position: absolute; top: var(--sp-3); right: var(--sp-3); background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-500); transition: color var(--transition-fast); }
.gsc-modal-close:hover { color: var(--gray-900); }

@media (max-width: 768px) {

  .geo-page {
    padding: 0 16px 16px;
  }

  .geo-page-header {
    padding: 16px 0 12px;
  }

  /* Form goes single column */
  .geo-form-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }

  /* Cards go single column */
  .geo-card-grid {
    grid-template-columns: 1fr;
  }

  /* Summary bar: don't stick on mobile — too tall at narrow widths */
  .geo-summary-bar {
    position: static;
    top: auto;
  }

  /* Summary bar stacks */
  .geo-summary-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-4);
  }

  .geo-donut-group {
    flex-wrap: wrap;
    gap: var(--sp-4);
  }

  .geo-summary-metrics {
    margin-left: 0;
    justify-content: space-around;
    padding-top: var(--sp-3);
    border-top: var(--border-light);
  }

  /* Page header stacks */
  .geo-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
    padding: 12px 0 10px;
  }

  /* Form actions stack */
  .geo-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .geo-form-actions .geo-btn {
    width: 100%;
  }

  /* Citability grid goes single column */
  .geo-citability-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Card header wraps better */
  .geo-card-header {
    flex-direction: column;
    gap: var(--sp-2);
  }

  .geo-card-header-right {
    align-items: flex-start;
    flex-direction: row;
    gap: var(--sp-2);
  }

  .geo-card-source-breakdown {
    flex-wrap: wrap;
    gap: var(--sp-2);
  }

  /* Competitor comparison table scrolls horizontally */
  .geo-comparison-table-wrapper {
    margin: 0 calc(-1 * var(--sp-3));
    padding: 0 var(--sp-3);
  }

  /* Export buttons stack */
  .geo-export-group {
    flex-direction: column;
  }

  .geo-export-group .geo-btn-export {
    width: 100%;
  }

  /* Citability controls stack */
  .geo-citability-controls {
    flex-direction: column;
    align-items: stretch;
  }

  /* Feedback icon FAB above floating bar on tablets */
  .geo-feedback-fab {
    bottom: 64px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .geo-citability-grid {
    grid-template-columns: 1fr;
  }

  .geo-donut-group {
    flex-direction: column;
  }

  .geo-summary-metrics {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
  }

  /* Stack prompt input + suggest button on small phones */
  .geo-keywords-panel {
    flex-direction: column;
  }

  /* Feedback icon FAB above floating bar on small phones */
  .geo-feedback-fab {
    bottom: 60px;
    right: 8px;
    width: 34px;
    height: 34px;
  }

  /* Export buttons stack only on real phones */
  .geo-export-group {
    flex-direction: column;
  }
  .geo-export-group .geo-btn-export {
    width: 100%;
  }
}

/* Keep 2-column card grid at tablet widths (681-768px) */
@media (min-width: 681px) and (max-width: 768px) {
  .geo-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Keep export buttons in a row at tablet widths (481-768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .geo-export-group {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .geo-export-group .geo-btn-export {
    width: auto;
    flex: 1 1 auto;
  }
}


/* ==========================================================================
   15. CHIP STAGE VARIANTS (Evaluation + Advice — matching live tool)
   ========================================================================== */

/* Evaluation stage (replaces "consideration") */
.geo-chip-evaluation {
  background: #e0e7ff;
  color: #3730a3;
}

/* Advice stage (replaces "decision") */
.geo-chip-advice {
  background: #ede9fe;
  color: #5b21b6;
}

/* "+N more" toggle chip (#3) */
.geo-chip-more {
  background: var(--gray-100);
  color: var(--color-accent);
  border: 1px dashed var(--gray-300);
  font-weight: var(--weight-semibold);
}

.geo-chip-more:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

/* Progressive chip disclosure: hide chips beyond the initial set when not expanded */
.geo-chip-grid:not(.is-expanded) .geo-chip:nth-child(n+9):not(.geo-chip-more) {
  display: none;
}

.geo-chip-grid.is-expanded .geo-chip-more {
  order: 999;  /* Push to end */
}

/* ── Suggestion chip metrics (volume + CPC + GSC position) ── */
#suggest-chips .geo-chip {
  flex-direction: column;
  align-items: flex-start;
  border-radius: var(--radius-md);
  padding: 8px 12px;
}
.suggest-chip-query { font-weight: 500; }
.suggest-metrics {
  display: flex;
  gap: 6px;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
  flex-wrap: wrap;
}
.suggest-metric {
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(0,0,0,0.05);
  color: #525252;
  white-space: nowrap;
}
.suggest-cpc { color: #059669; }
.suggest-pos-top3 { color: #059669; background: #ecfdf5; }
.suggest-pos-page1 { color: #2563eb; background: #eff6ff; }
.suggest-pos-page2 { color: #d97706; background: #fffbeb; }
.suggest-no-vol { color: #94a3b8; font-style: italic; }
.suggest-gsc-hint {
  font-size: 12px;
  color: #6366f1;
  background: #eef2ff;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
}
html[data-theme="dark"] .suggest-gsc-hint {
  background: #1e1b4b;
  color: #a5b4fc;
}
html[data-theme="dark"] .suggest-metric {
  background: rgba(255,255,255,0.08);
  color: #d4d4d8;
}


/* ==========================================================================
   15b. UNLINKED BRAND MENTIONS (Per-Card — #11)
   ========================================================================== */

.geo-card-unlinked-mentions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--gray-600);
  padding: var(--sp-2) 0;
}

.geo-unlinked-count {
  font-weight: var(--weight-bold);
  color: var(--color-warning);
  background: var(--color-warning-bg);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
}


/* ==========================================================================
   15c. EXPANDABLE CITATION LIST (#12)
   ========================================================================== */

.geo-citations-collapsed .geo-citation-row:nth-child(n+4) {
  display: none;
}

.geo-citations-expanded .geo-citation-row {
  display: flex;
}

.geo-citations-toggle {
  align-self: flex-start;
  color: var(--color-accent);
}

.geo-citations-toggle:hover {
  text-decoration: underline;
}


/* ==========================================================================
   15d. FAN-OUT SOURCE BADGES (#19) + PROGRESSIVE DISCLOSURE (#21)
   ========================================================================== */

/* Source badges */
.badge-fanout-paa {
  background: var(--color-info-bg);
  color: var(--color-info);
  font-size: 10px;
  padding: 2px 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.badge-fanout-gemini {
  background: #f3e8ff;
  color: #7c3aed;
  font-size: 10px;
  padding: 2px 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.badge-fanout-gpt {
  background: #dcfce7;
  color: #15803d;
  font-size: 10px;
  padding: 2px 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Fan-out progressive disclosure (#21) */
.geo-fanout-hidden {
  display: none;
}

.geo-fanout-progressive.is-expanded .geo-fanout-hidden {
  display: flex;
}

.geo-fanout-show-all {
  display: inline-flex;
}


/* ==========================================================================
   15e. YOU / COMPETITOR DOMAIN BADGES (#15-16)
   ========================================================================== */

.badge-you {
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: var(--sp-2);
}

.badge-competitor-domain {
  background: var(--gray-800);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: var(--sp-2);
}


/* ==========================================================================
   15f. COMPETITOR COMPARISON TABLE (#14)
   ========================================================================== */

.geo-comparison-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.geo-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  min-width: 600px;  /* Ensures horizontal scroll on mobile */
}

.geo-comparison-table th {
  text-align: center;
  padding: var(--sp-3) var(--sp-3);
  border-bottom: 2px solid var(--gray-200);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.geo-comparison-table th:first-child {
  text-align: left;
  color: var(--gray-500);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--weight-medium);
}

.geo-comparison-metric-col {
  width: 180px;
  min-width: 150px;
}

.geo-comparison-table td {
  text-align: center;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: var(--border-light);
  color: var(--gray-700);
}

.geo-comparison-table td:first-child {
  text-align: left;
}

.geo-comparison-metric-name {
  font-weight: var(--weight-medium);
  color: var(--gray-600);
  font-size: var(--text-sm);
}

.geo-comparison-table tbody tr:hover {
  background: var(--gray-50);
}

.geo-medal {
  font-size: var(--text-base);
  margin-left: 2px;
}

/* Footer rows (summary) */
.geo-comparison-footer-row {
  background: var(--gray-50);
}

.geo-comparison-footer-row td {
  border-bottom: var(--border-default);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
}

.geo-comparison-footer-row td:first-child {
  font-weight: var(--weight-bold);
  color: var(--gray-700);
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}

.geo-comparison-table tfoot {
  border-top: 2px solid var(--gray-300);
}


/* ==========================================================================
   15g. EXPORT SECTION (#28)
   ========================================================================== */

.geo-export-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.geo-btn-export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 42px;
  padding: 0 var(--sp-5);
  border: var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  background: #fff;
  color: var(--gray-700);
  transition: all 0.15s ease;
}

.geo-btn-export:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.geo-btn-export svg {
  flex-shrink: 0;
}

.geo-btn-export-email {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.geo-btn-export-email:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.geo-btn-export-email svg {
  stroke: #fff;
}


/* ==========================================================================
   15h. FEEDBACK FLOATING BUTTON + MODAL (#29)
   ========================================================================== */

.geo-feedback-fab {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: #fff;
  color: var(--gray-600, #475569);
  border: 1px solid var(--gray-300, #cbd5e1);
  border-radius: 50%;
  font-size: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: all 0.2s ease;
}

.geo-feedback-fab:hover {
  background: var(--gray-50, #f8fafc);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-1px);
  color: var(--color-primary, #1e3a8a);
}

.geo-feedback-fab svg {
  flex-shrink: 0;
  stroke: currentColor;
}

/* Share button — visually distinct from ghost buttons */
.geo-btn-share {
  background: #f0f0ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  font-weight: 600;
}
.geo-btn-share:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

/* Feedback modal overlay */
.geo-feedback-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.geo-feedback-modal-overlay.is-open {
  display: flex;
}

.geo-feedback-modal {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  margin: var(--sp-4);
  overflow: hidden;
}

.geo-feedback-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: var(--border-light);
}

.geo-feedback-modal-header h3 {
  font-size: var(--text-lg);
  margin: 0;
}

.geo-feedback-modal-body {
  padding: var(--sp-5);
}

.geo-textarea {
  height: auto;
  padding: var(--sp-3);
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.geo-feedback-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: var(--border-light);
  background: var(--gray-50);
}


/* ==========================================================================
   15i. GREEN "FIND OPPORTUNITIES" BUTTON (#27) + SUCCESS BUTTON VARIANT
   ========================================================================== */

.geo-btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 38px;
  padding: 0 var(--sp-5);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  background: var(--color-success);
  color: #fff;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.3);
  transition: all 0.15s ease;
}

.geo-btn-success:hover {
  background: #047857;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
  transform: translateY(-0.5px);
}

.geo-btn-success:active {
  transform: scale(0.98);
}


/* ==========================================================================
   15j. CITABILITY CONTROLS (#24-25)
   ========================================================================== */

.geo-citability-controls {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: var(--border-light);
}


/* ==========================================================================
   16. PRINT (basic cleanup)
   ========================================================================== */

@media print {
  .geo-summary-bar {
    position: static;
    box-shadow: none;
  }
  .geo-form-section {
    display: none;
  }
  .geo-card {
    break-inside: avoid;
  }
  .geo-btn {
    display: none;
  }
  .geo-feedback-fab,
  .geo-feedback-modal-overlay {
    display: none !important;
  }
  .geo-export-group {
    display: none;
  }
  .geo-comparison-table {
    break-inside: avoid;
  }
}


/* ==========================================================================
   FINAL GAP FIXES (Priority-1 items from completeness audit)
   ========================================================================== */

/* --- Gap #1: Hallucination Warning Banner --- */
.geo-hallucination-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-warning-bg);
  border: 1px solid #fbbf24;
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--gray-700);
}

.geo-hallucination-banner svg {
  flex-shrink: 0;
  color: var(--color-warning);
}

.geo-hallucination-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-md);
  color: var(--gray-400);
  padding: var(--sp-1);
}

.geo-hallucination-dismiss:hover {
  color: var(--gray-600);
}

/* --- Gap #2: Citation Score Headline --- */
.geo-citation-score-headline {
  font-size: var(--text-lg);
  font-weight: var(--weight-normal);
  color: var(--gray-600);
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-3);
  border-bottom: var(--border-light);
}

.geo-citation-score-headline .score-fraction {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  font-family: var(--font-mono);
}

/* --- Gap #4: Competitor Visibility Bar Chart --- */
.geo-competitor-visibility {
  min-width: 200px;
  padding-left: var(--sp-6);
  border-left: var(--border-light);
}

.geo-competitor-visibility canvas {
  max-height: 200px !important;
  display: block;
}

.geo-competitor-visibility-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
}

.competitor-vis-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
}

.competitor-vis-bars {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.competitor-vis-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.competitor-vis-name {
  font-size: var(--text-xs);
  color: var(--gray-600);
  min-width: 90px;
  text-align: right;
}

.competitor-vis-track {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.competitor-vis-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.competitor-vis-high { background: var(--color-success); }   /* ≥70% */
.competitor-vis-mid  { background: var(--color-warning); }   /* ≥35% */
.competitor-vis-low  { background: var(--color-danger); }    /* <35% */

.competitor-vis-pct {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--gray-700);
  font-family: var(--font-mono);
  min-width: 32px;
}

/* --- Gap #5: Competitor Pills per Card --- */
.geo-card-competitor-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
}

.competitor-pills-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
  font-weight: var(--weight-medium);
}

.competitor-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--weight-semibold);
}

.competitor-pill-cited {
  background: var(--color-warning-bg);
  color: #92400e;
  border: 1px solid #fbbf24;
}

.competitor-pill-cited .pill-position {
  font-family: var(--font-mono);
  font-size: 10px;
}

.competitor-pill-text {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.competitor-pill-text .pill-type {
  font-style: italic;
  font-size: 10px;
}

@media (max-width: 768px) {
  .geo-cited-hero {
    min-width: auto;
    width: 100%;
    margin-left: 0;
    margin-top: 12px;
  }
}

/* =============================================================
   LEGACY COMPATIBILITY — functional classes kept for app logic
   New design classes take precedence above; these fill gaps
   ============================================================= */

/* Config notice box */
.notice {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  padding: 15px;
  margin: 20px 0;
  color: #856404;
}
.notice h3 { margin: 0 0 10px; color: #856404; }
.notice ul { margin: 10px 0; padding-left: 20px; }
.notice li { margin: 5px 0; }

/* Citation status text */
.status-positive { color: #28a745; font-weight: bold; }
.status-negative { color: #dc3545; font-weight: bold; }
.status-error    { color: #dc3545; font-weight: bold; }
.status-memory   { color: #0066cc; font-weight: bold; }
.status-unverified { color: #856404; font-weight: bold; }
.status-mention  { color: #b35a00; font-weight: bold; }

/* Citation link styles */
.domain-citation        { color: #007cba !important; font-weight: bold; }
.domain-citation-memory { color: #555; font-weight: bold; text-decoration: line-through; text-decoration-color: #cc0000; }
.citation-memory        { color: #555; }
.citation-rank {
  display: inline-block;
  background: #f0f0f0; color: #555;
  font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 10px;
  margin-left: 6px; vertical-align: middle; white-space: nowrap;
}

/* AI analysis quote block */
.ai-analysis {
  background: #f8f9fa; padding: 10px; border-radius: 4px;
  border-left: 3px solid #6c757d; margin: 10px 0;
  font-family: Georgia, serif; line-height: 1.5;
}

/* Expandable details/summary */
details { margin: 10px 0; }
summary { cursor: pointer; font-weight: bold; color: #007cba; padding: 5px 0; }
summary:hover { color: #005a87; }
.missing-from-card > summary { list-style: none; }
.missing-from-card > summary::-webkit-details-marker { display: none; }

/* Spinner (used in button + background ops) */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin-right: 8px; vertical-align: middle;
}

/* Fan-out per-card inline queries */
.fanout-per-card {
  margin-top: 10px; padding: 8px 10px;
  background: #f0f4ff; border-left: 3px solid #6c8ebf;
  border-radius: 0 4px 4px 0; font-size: 12px;
}
.fanout-per-card-label { display: block; font-weight: 600; color: #3a5a8a; margin-bottom: 4px; }
.fanout-per-card-list  { margin: 0; padding-left: 18px; color: #444; }
.fanout-per-card-list li { margin: 2px 0; }

/* Query widgets container */
.query-widgets-container { margin: 16px 0; }

/* PAA panel */
.paa-panel {
  background: #f0f8ff; border: 1px solid #bee3f8;
  border-radius: 8px; margin: 20px 0; padding: 14px 16px;
}
.paa-panel > summary { cursor: pointer; font-weight: bold; color: #0073aa; font-size: 14px; list-style: none; }
.paa-panel > summary::-webkit-details-marker { display: none; }
.paa-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Fan-out widget */
.fanout-widget {
  background: #f5f0ff; border: 1px solid #d6c3f5;
  border-radius: 8px; margin: 20px 0; padding: 14px 16px;
}
.fanout-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Query chips (PAA + fan-out) */
.query-chip {
  display: inline-block; background: #fff; border: 1px solid #b0c4de;
  border-radius: 20px; padding: 5px 13px; font-size: 13px;
  color: #0073aa; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: normal; word-break: break-word;
}
.query-chip:hover { background: #0073aa; border-color: #0073aa; color: #fff; }
.fanout-widget .query-chip { border-color: #a78bda; color: #5a3e96; }
.fanout-widget .query-chip:hover { background: #5a3e96; border-color: #5a3e96; color: #fff; }
.fanout-source-badge {
  display: inline-block; font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 8px; margin-left: 5px;
  vertical-align: middle; white-space: nowrap; letter-spacing: .3px;
}
.fanout-badge-paa  { background: #e8f4e8; color: #2e7d32; }
.fanout-badge-ai   { background: #e8f0fb; color: #3b5bdb; }
.fanout-badge-gemini { background: #e6f4ea; color: #1a6e37; }
.fanout-badge-gpt  { background: #f3f0ff; color: #6c4fa3; }
.fanout-loading-msg { color: #888; font-size: 12px; margin: 0 0 8px; font-style: italic; }
.fanout-coverage-bar { display: flex; align-items: center; gap: 10px; margin: 8px 0 6px; flex-wrap: wrap; }
.fanout-coverage-btn {
  font-size: 12px; padding: 4px 10px; border: 1px solid #5a3e96;
  border-radius: 4px; background: #fff; color: #5a3e96; cursor: pointer; white-space: nowrap;
}
.fanout-coverage-btn:hover { background: #f3f0ff; }
.fanout-coverage-btn:disabled { opacity: .55; cursor: default; }
.fanout-coverage-summary { font-size: 12px; color: #555; }
.fanout-coverage-summary .cov-cited { color: #1a6e37; font-weight: 600; }
.fanout-coverage-summary .cov-miss  { color: #b71c1c; font-weight: 600; }
.fanout-chip .cov-tick { display: inline-block; margin-left: 4px; font-size: 11px; font-style: normal; }
.fanout-chip.cov-yes  { border-color: #a5d6a7; background: #f1faf1; }
.fanout-chip.cov-no   { border-color: #ef9a9a; background: #fff5f5; }
.fanout-chip.cov-checking { opacity: .55; }
.fanout-chip .cov-tick.cov-yes-tick { color: #1a6e37; }
.fanout-chip .cov-tick.cov-no-tick  { color: #b71c1c; }

/* Source tags (citation rows) */
.citation-competitor { color: #c05900; }
.source-tag {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 8px; margin-left: 4px; vertical-align: middle;
}
.source-tag-competitor { background: #fff0e0; color: #c05900; border: 1px solid #ffc880; }

/* Opportunity finder table */
.opportunity-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.opportunity-table thead th {
  background: #e8f5e9; color: #1a5c32; font-weight: 700;
  padding: 9px 12px; text-align: left; border-bottom: 2px solid #81c784; white-space: nowrap;
}
.opportunity-table tbody tr { border-bottom: 1px solid #e0f0e3; }
.opportunity-table tbody tr:hover { background: #f4fbf5; }
.opportunity-table td { padding: 8px 12px; vertical-align: middle; }
.opp-keyword { font-weight: 600; color: #222; max-width: 260px; }
.opp-vol { text-align: right; color: #1a5c32; font-weight: 700; white-space: nowrap; }
.opp-pos { text-align: center; color: #555; white-space: nowrap; }
.opp-url { color: #666; font-size: 12px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-scan-btn { background: #28a745; color: #fff; border: none; border-radius: 4px; padding: 5px 12px; font-size: 12px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.opp-scan-btn:hover { background: #1e7e34; }
.opp-sortable:hover { background: #d4edda; }
.opp-sort-icon { font-size: 10px; color: #999; margin-left: 3px; }
.opp-sort-icon.active { color: #1a5c32; }
.opp-controls-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.opp-vol-threshold { display: flex; align-items: center; gap: 6px; }
.opp-vol-select { font-size: 12px; padding: 3px 6px; border: 1px solid #ccc; border-radius: 4px; background: #fff; color: #333; cursor: pointer; }
.opp-section-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.opp-variant-badge { display: inline-block; background: #e8f0fe; color: #1a5c32; border: 1px solid #b6d4c0; border-radius: 10px; font-size: 11px; font-weight: 600; padding: 1px 7px; margin-left: 6px; cursor: pointer; vertical-align: middle; white-space: nowrap; }
.opp-variant-badge:hover { background: #c9e6d5; }
.opp-variant-row td { background: #f9fbf9; font-size: 12px; color: #555; }
.opp-variant-kw { padding-left: 18px !important; font-style: italic; }
.opp-section-filter-label { font-size: 12px; color: #666; font-weight: 600; margin-right: 4px; white-space: nowrap; }
.opp-section-pill { background: #fff; color: #555; border: 1px solid #ccc; border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 500; cursor: pointer; transition: background .15s,color .15s,border-color .15s; white-space: nowrap; font-family: monospace; letter-spacing: -.3px; }
.opp-section-pill.active { background: #1a5c32; color: #fff; border-color: #1a5c32; }
.opp-section-pill:hover:not(.active) { background: #f0f0f0; border-color: #999; }

/* Opportunity Finder — tier chips & section headers */
.opp-tier-summary { font-size: 13px; color: #555; margin-bottom: 10px; }
.opp-tier-count { font-weight: 700; }
.opp-tc-strategic  { color: #8b6914; }
.opp-tc-competitive { color: #8b1a1a; }
.opp-tc-quickwins  { color: #1a5c32; }
.opp-tier-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.opp-tier-chip { background: #fff; color: #555; border: 1px solid #ccc; border-radius: 20px; padding: 5px 14px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .15s,color .15s,border-color .15s; }
.opp-tier-chip.active { background: #1a5c32; color: #fff; border-color: #1a5c32; }
.opp-tier-chip:hover:not(.active) { background: #f0f0f0; border-color: #999; }
.opp-tier-section { margin-bottom: 24px; }
.opp-tier-header { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; padding: 10px 14px; border-radius: 8px 8px 0 0; }
.opp-tier-header-strategic  { background: #fef9e7; border: 1px solid #f0d060; color: #6b4f10; border-bottom: none; }
.opp-tier-header-competitive { background: #fff0f0; border: 1px solid #f0a0a0; color: #7a1a1a; border-bottom: none; }
.opp-tier-header-quickwins  { background: #eaf6ed; border: 1px solid #a0d4b0; color: #1a5c32; border-bottom: none; }
.opp-tier-badge { background: rgba(0,0,0,.08); border-radius: 20px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.opp-tier-header-sub { font-size: 12px; font-weight: 400; opacity: .75; margin-left: 4px; }
.opp-tier-empty { padding: 14px 16px; font-size: 13px; color: #666; background: #fafafa; border: 1px solid #e0e0e0; border-radius: 0 0 8px 8px; }
#opp-tier-strategic  .opportunity-table { border: 1px solid #f0d060; border-radius: 0 0 6px 6px; }
#opp-tier-competitive .opportunity-table { border: 1px solid #f0a0a0; border-radius: 0 0 6px 6px; }
#opp-tier-quickwins  .opportunity-table { border-radius: 0 0 6px 6px; }
.opp-brief-btn { background: #1F4E79; color: #fff; border: none; border-radius: 4px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-weight: 600; white-space: nowrap; margin-left: 4px; }
.opp-brief-btn:hover { background: #16375a; }
.opp-stat-line { color: #666; font-size: 13px; margin-bottom: 12px; }
.opp-warning-box { background: #fef3f0; border: 1px solid #f5b7a0; border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: #8b3a1e; }
.opp-warning-box-yellow { background: #fff8e8; border-color: #f0c040; color: #7a5a00; }

/* Citability Analyzer */
#citability-section {
  background: #eef3ff; border: 2px solid #1F4E79; border-radius: 10px;
  padding: 24px 28px 20px; margin-top: 24px; text-align: center;
  box-shadow: 0 3px 12px rgba(31,78,121,.12);
}
#citability-analyze-btn {
  width: 100%; max-width: 400px; padding: 14px 28px;
  background: #1F4E79; color: #fff; border: none; border-radius: 7px;
  cursor: pointer; font-size: 17px; font-weight: 700; letter-spacing: .3px;
  transition: background .2s, transform .1s; margin-top: 4px;
}
#citability-analyze-btn:hover:not(:disabled) { background: #2E75B6; transform: translateY(-1px); }
#citability-analyze-btn:active:not(:disabled) { transform: translateY(0); }
#citability-analyze-btn:disabled { background: #95a5a6; cursor: wait; }
.citability-loading { display: flex; align-items: center; gap: 10px; padding: 20px; color: #555; font-size: 14px; }
@keyframes citability-spin { to { transform: rotate(360deg); } }
.citability-spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid #ccc; border-top-color: #1F4E79; border-radius: 50%; animation: citability-spin .8s linear infinite; flex-shrink: 0; }
.citability-error { padding: 14px 18px; background: #fff3cd; border: 1px solid #ffc107; border-radius: 6px; color: #7a5a00; font-size: 14px; margin-top: 12px; }
.analysis-panel {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04);
    margin-top: 16px;
    margin-bottom: 16px;
}
.analysis-header { margin-bottom: 20px; border-bottom: 1px solid #f5f5f5; padding-bottom: 14px; }
.analysis-title { margin: 0 0 4px; color: #0a0a0a; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.analysis-subtitle { margin: 0; color: #666; font-size: 13px; }
.citability-table-wrap { overflow-x: auto; margin: 16px 0; background: #fff; border-radius: 12px; box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04); }
.citability-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.citability-table thead th { background: #fafafa; color: #737373; padding: 10px 14px; text-align: left; white-space: nowrap; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #e5e5e5; }
.citability-table tbody td { padding: 10px 14px; border-bottom: 1px solid #f5f5f5; color: #404040; }
.citability-table tbody tr:nth-child(even) { background: #f2f4f6; }
.citability-table tbody tr:hover { background: #e8edf2; }
.gap-negative { color: #c0392b; font-weight: 700; }
.gap-positive { color: #27ae60; font-weight: 700; }
.gap-equal    { color: #888; }
.bool-signals { margin: 16px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bool-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 16px; font-size: 12px; font-weight: 500; }
.bool-chip.yes { background: #ecfdf5; color: #059669; }
.bool-chip.no  { background: #fef2f2; color: #dc2626; }
.bool-chip small { opacity: .8; }
.recommendations { margin-top: 20px; padding: 18px 20px; background: #fff; border: 1px solid #d5d8dc; border-radius: 6px; }
.recommendations h4 { margin: 0 0 14px; color: #1F4E79; font-size: 15px; }
.rec-content { font-size: 14px; line-height: 1.7; color: #333; }
.rec-content p { margin: 0 0 10px; }
.rec-item { display: flex; gap: 12px; margin: 10px 0; padding: 12px 16px; background: #ffffff; border-radius: 8px; border-left: 3px solid #2563eb; box-shadow: 0 0 0 1px rgba(0,0,0,0.04); }
.rec-num { font-weight: 700; color: #1F4E79; font-size: 15px; flex-shrink: 0; min-width: 18px; }
.rec-body { flex: 1; line-height: 1.6; }
.priority-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-left: 4px; }
.priority-high   { background: #fde8e8; color: #c0392b; }
.priority-medium { background: #fef3cd; color: #856404; }
.priority-low    { background: #e8f4e8; color: #27ae60; }
.citability-url-picker { text-align: left; margin: 0 auto 16px; max-width: 560px; }
.citability-picker-label { display: block; font-size: 16px; font-weight: 700; color: #1F4E79; margin-bottom: 6px; }
.citability-picker-hint { font-size: 14px; color: #4a5a7a; margin: 0 0 10px; line-height: 1.5; }
.citability-url-select, .citability-url-input { width: 100%; padding: 10px 12px; font-size: 15px; border: 1.5px solid #aab9e0; border-radius: 6px; background: #fff; color: #333; box-sizing: border-box; }
.citability-url-select:focus, .citability-url-input:focus { outline: none; border-color: #1F4E79; box-shadow: 0 0 0 3px rgba(31,78,121,.12); }
.citability-analyzed-url { background: #f0f5ff; border: 1px solid #c0d0f0; border-radius: 5px; padding: 6px 12px; margin: 6px 0 8px; font-size: 13px; word-break: break-all; }
.citability-url-label { font-weight: 600; color: #555; margin-right: 4px; }
.citability-url-link { color: #1a5c32; text-decoration: none; }
.citability-url-link:hover { text-decoration: underline; }
.citability-low-content-warn { background: #fff8e1; border: 1px solid #f0c040; border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: #6d4c00; line-height: 1.5; }
.rec-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 768px) { .rec-cards { grid-template-columns: 1fr; } }
.rec-card { border-radius: 12px; border: none; border-left: 3px solid #2563eb; padding: 16px 20px; background: #ffffff; box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04); transition: box-shadow 200ms ease; }

.rec-card:hover { box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.06); }
.rec-card-high   { border-left-color: #dc2626; }
.rec-card-medium { border-left-color: #d97706; }
.rec-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.rec-card-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; background: #0a0a0a; color: #fff; border-radius: 50%; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.rec-card-title { font-weight: 600; font-size: 14px; color: #1a1a2e; flex: 1; }
.rec-card-priority { margin-left: auto; flex-shrink: 0; }
.rec-card-gap { font-size: 12px; color: #666; margin-bottom: 5px; font-style: italic; }
.rec-card-detail { font-size: 13px; line-height: 1.6; color: #333; }
.rec-platforms { font-size: 11px; color: #2E75B6; margin-top: 8px; padding-top: 8px; border-top: 1px solid #eee; }
.platform-badges { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badge-found    { background: #d5f5e3; color: #1e8449; padding: 4px 12px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.badge-missing  { background: #fadbd8; color: #922b21; padding: 4px 12px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.signal-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.signal-chip { display: inline-block; padding: 5px 12px; border-radius: 16px; font-size: 12px; font-weight: 500; }
.chip-good { background: #d5f5e3; color: #1e8449; }
.chip-warn { background: #fef9e7; color: #7d6608; border: 1px solid #f9e79f; }
.analyzing-url { background: #f4f6f9; padding: 8px 12px; border-radius: 4px; font-size: 13px; margin-bottom: 12px; }
.analyzing-url code { font-size: 12px; color: #2E75B6; word-break: break-all; }
.fetch-source-note { font-size: 11px; color: #888; font-style: italic; margin-left: 6px; }
.fetch-source-paste { color: #1e8449; font-style: normal; font-weight: 500; }
.citability-paste-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.citability-paste-toggle-btn, .citability-benchmark-btn { padding: 6px 14px; border-radius: 5px; border: none; font-size: 13px; cursor: pointer; font-weight: 500; }
.citability-paste-toggle-btn { background: #2E75B6; color: #fff; }
.citability-paste-toggle-btn:hover { background: #1a5a96; }
.citability-benchmark-btn { background: transparent; color: #2E75B6; border: 1px solid #2E75B6; }
.citability-benchmark-btn:hover { background: #eaf1fb; }
.citability-paste-area { margin-top: 10px; }
.citability-paste-textarea { width: 100%; box-sizing: border-box; border: 1px solid #ccc; border-radius: 5px; padding: 8px 10px; font-size: 13px; font-family: inherit; resize: vertical; margin-bottom: 8px; }
.citability-paste-submit-btn { padding: 7px 18px; background: #28a745; color: #fff; border: none; border-radius: 5px; font-size: 13px; font-weight: 600; cursor: pointer; }
.citability-paste-submit-btn:hover { background: #218838; }
.citability-paste-submit-btn:disabled { opacity: .6; cursor: default; }

/* Feedback status states */
#feedback-status.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; display: block !important; }
#feedback-status.error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; display: block !important; }

/* URL verification results (background check) */
.url-verify-valid    { color: #28a745; }
.url-verify-notfound { color: #dc3545; }
.url-verify-timeout  { color: #ffc107; }
.url-verify-error    { color: #dc3545; }

/* Debug section */
.debug-section { margin-top: 20px; padding: 10px; background: #ffe4e1; border: 1px solid #ffb3b3; border-radius: 4px; }
.debug-section pre { background: #fff; padding: 10px; border-radius: 3px; overflow: auto; font-size: 12px; }

/* Override: results grid should not have old box border */
#sg-aims-results { margin: 0; padding: 0; border: none; background: transparent; }
#sg-aims-results > div { margin: 0; padding: 0; background: transparent; }

/* ==========================================================================
   Feature 1: Results Header Row — Citation Score Card + Top Cited Domains
   ========================================================================== */
.geo-results-header-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
  margin: 8px 0 0;
}
@media (max-width: 900px) {
  .geo-results-header-row { grid-template-columns: 1fr; } /* Fix 4: stack earlier */
}

/* Fix 5: Results heading — padding so it doesn't run to the edge */
#sg-aims-results > h3:first-child,
.geo-results-heading {
  padding: 0 4px;
  margin-bottom: 16px;
  font-size: 1.25rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.geo-citation-score-card {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
}
.geo-score-number {
    font-size: 64px;
    font-weight: 800;
    color: #0a0a0a;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}
.geo-score-total {
    font-size: 24px;
    color: #a3a3a3;
    font-weight: 400;
}
.geo-score-label {
    font-size: 13px;
    font-weight: 600;
    color: #525252;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 8px;
    margin-bottom: 14px;
}
.geo-score-details {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f5f5f5;
    margin-bottom: 12px;
}
.geo-score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    color: #525252;
}
.geo-score-val {
    font-weight: 600;
    color: #0a0a0a;
    font-variant-numeric: tabular-nums;
}
.geo-score-warn { color: #b45309 !important; }
.geo-score-found {
  font-size: 0.8125rem;
  color: #15803d;
  font-weight: 500;
  margin-bottom: 3px;
}
.geo-score-not-found {
  font-size: 0.8125rem;
  color: #b91c1c;
  font-weight: 500;
  margin-bottom: 8px;
}
.geo-score-vs-competitor {
  border-top: 1px solid #c7d2fe;
  padding-top: 10px;
  margin-top: 8px;
}
.geo-score-lead-positive { color: #15803d; font-weight: 600; }
.geo-score-lead-negative { color: #b91c1c; font-weight: 600; }

/* Item 3: Cited services hero row */
.geo-cited-services {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 6px;
}

/* Item 3: Not-cited collapsible */
.geo-not-cited-details {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 10px;
}
.geo-not-cited-details summary {
  cursor: pointer;
  color: #dc2626;
  font-size: 0.8125rem;
  user-select: none;
  list-style: none;
}
.geo-not-cited-details summary::-webkit-details-marker { display: none; }
.geo-not-cited-details summary::before { content: '▶ '; font-size: 0.625rem; }
details[open].geo-not-cited-details summary::before { content: '▼ '; }
.geo-not-cited-details p {
  color: #6b7280;
  margin: 6px 0 0 12px;
  font-size: 0.75rem;
  line-height: 1.5;
}

/* Small badge variant */
.badge-sm {
  font-size: 0.625rem !important;
  padding: 1px 6px !important;
  line-height: 1.5;
}

/* Item 2: Your Cited Pages section */
.geo-cited-urls,
.geo-competitor-cited-urls {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}
.geo-competitor-cited-urls {
  border-top-color: #fecaca;
}
.geo-cited-urls h4,
.geo-competitor-cited-urls h4 {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 0 0 8px;
}
.geo-cited-url-row {
  padding: 5px 0;
  border-bottom: 1px solid #f3f4f6;
}
.geo-cited-url-row:last-child { border-bottom: none; }
.geo-cited-url-row a {
  font-size: 0.8125rem;
  color: #1e40af;
  word-break: break-all;
  display: block;
  text-decoration: none;
}
.geo-cited-url-row a:hover { text-decoration: underline; }
.geo-cited-url-engines {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.geo-gap-tag {
  font-size: 0.6875rem;
  color: #dc2626;
  font-weight: 500;
  margin-left: 4px;
}

/* Item 5: Subtle inline note (replaces amber banner) */
.geo-inline-note {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  padding: 10px 16px 0;
  border-top: 1px solid #f3f4f6;
  margin: 10px 0 0;
  width: 100%;
}

/* Top Cited Domains — redesigned as table */
.top-domains-widget {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;                   /* Fix 3: horizontal scroll if table overflows */
  -webkit-overflow-scrolling: touch;
}
.top-domains-title {
  margin: 0 0 12px 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1f2937;
}
.top-domains-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.top-domains-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 8px 8px 4px;
  border-bottom: 1px solid #f3f4f6;
}
.top-domains-table td {
  padding: 7px 8px 7px 4px;
  border-bottom: 1px solid #f9fafb;
  color: #374151;
  vertical-align: middle;
}
.top-domains-table tr:last-child td { border-bottom: none; }
.top-domains-table .row-you { background: #f0fdf4; }
.top-domains-table .row-competitor { background: #fefce8; }
/* Fix 3: Give domain column enough room — no mid-word breaks */
.top-domains-table th:nth-child(2),
.top-domains-table td:nth-child(2) {
  min-width: 140px;
  word-break: normal;
  overflow-wrap: normal;
}
.domain-link { color: #4f46e5; font-weight: 600; text-decoration: none; word-break: normal; overflow-wrap: anywhere; }
.domain-link:hover { text-decoration: underline; }
.mentions-badge {
  font-size: 0.7rem;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 3px;
}
.influence-cell { min-width: 90px; }
.influence-score {
  font-weight: 700;
  font-size: 0.875rem;
  color: #4f46e5;
  display: block;
  margin-bottom: 3px;
}
.influence-bar-wrap {
  height: 5px;
  background: #e0e7ff;
  border-radius: 3px;
  overflow: hidden;
}
.influence-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ==========================================================================
   Feature 2: Content Gaps card styling (replaces inline styles)
   ========================================================================== */
.missing-from-card {
  background: #fffbeb;
  border: 1px solid #d97706;
  border-radius: 12px;
  margin: 0 0 20px 0;
  padding: 16px 18px;
}
.missing-from-card summary {
  cursor: pointer;
  font-weight: 600;
  color: #b45309;
  font-size: 0.9375rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.missing-from-card summary::-webkit-details-marker { display: none; }

/* ==========================================================================
   Feature 3: Fan-out Action Panel
   ========================================================================== */
.geo-fanout-row {
  display: grid;
  grid-template-columns: 1fr 300px;  /* Fix 7: chips expand, panel is fixed */
  gap: 24px;
  align-items: start;
  margin: 0 0 20px 0;
}
@media (max-width: 768px) {
  .geo-fanout-row { grid-template-columns: 1fr; }
}

/* Fan-out action panel — sticky sidebar */
#fanout-action-panel {
  position: sticky;
  top: 80px;
  align-self: start;
}

.geo-fanout-actions {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
}
.geo-fanout-actions-title {
  margin: 0 0 8px 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1f2937;
}
.geo-fanout-actions-desc {
  margin: 0 0 14px 0;
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.5;
}
.geo-fanout-coverage { display: flex; flex-direction: column; gap: 6px; }
.geo-fanout-coverage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: #374151;
}
.geo-fanout-count {
  font-weight: 700;
  color: #5a3e96;
  background: #f0e9ff;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
}
.geo-fanout-loading { color: #9ca3af; font-style: italic; }
.geo-fanout-title { margin: 0 0 4px 0; color: #5a3e96; font-size: 0.9375rem; font-weight: 600; }
.geo-fanout-desc { margin: 0 0 10px 0; font-size: 0.75rem; color: #9ca3af; }
.fanout-chips-extra { display: none; }
.fanout-show-all-btn {
  margin-top: 8px;
  font-size: var(--text-xs);
  background: transparent;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-sm, 4px);
  color: var(--gray-500, #6b7280);
  cursor: pointer;
  padding: 6px 10px;
  min-height: 32px;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
}
.fanout-show-all-btn:hover {
  border-color: var(--gray-300, #d1d5db);
  color: var(--gray-700, #374151);
  text-decoration: none;
}

/* The fanout-widget card fills its grid column */
.geo-fanout-row .fanout-widget { margin: 0; }

/* ==========================================================================
   Collapsed not-cited cards
   ========================================================================== */
.geo-card-collapsed .geo-card-body,
.geo-card-collapsed .geo-card-footer { display: none; }

.geo-card-collapsed .geo-card-header,
.not-cited .geo-card-header {
  cursor: pointer;
}

.geo-card-collapsed .geo-card-header {
  padding: 10px 16px;
}

.geo-card-collapsed {
  opacity: 0.55;
  border-left: 3px solid #ef4444 !important;
}

.geo-card-not-cited-label {
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: auto;
  flex-shrink: 0;
}

.geo-card-expand-btn {
  background: none;
  border: 1px solid #d1d5db;
  color: #6b7280;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 6px 10px;
  min-height: 32px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.15s;
  margin-left: 6px;
}
.geo-card-expand-btn:hover { background: #f3f4f6; color: #374151; }

/* Sub-group dividers inside card grid */
.geo-section-divider-sub {
  margin: 8px 0 4px;
}
.geo-section-divider-sub h3 {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* ==========================================================================
   Floating actions bar
   ========================================================================== */
.geo-floating-actions {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: none;  /* shown via JS when results load */
  gap: 6px;
  z-index: 200;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 8px 12px;
  border-radius: 100px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.14), 0 0 0 1px rgba(99,102,241,0.16);
  border: 1px solid #c7d2fe;
  align-items: center;
}
.geo-floating-actions.is-visible { display: flex; }
.geo-floating-actions .geo-btn-sm { font-size: 0.75rem; padding: 5px 10px; }

@media (max-width: 768px) {
  .geo-floating-actions {
    bottom: 12px;
    right: 12px;
    left: 12px;
    justify-content: center;
    border-radius: 12px;
  }
}

/* ==========================================================================
   Fix 3: Competitor Comparison Table — CSS-based styling (no inline styles)
   ========================================================================== */
.competitor-comparison-table {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
}
.competitor-comparison-table h4 {
  margin: 0 0 14px 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1f2937;
  padding: 18px 20px 0;
}
.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.comp-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid var(--gray-200);
}
.comp-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  white-space: nowrap;
  border-bottom: 2px solid #e5e7eb;
}
.comp-table th.col-domain-you {
  background: #f0fdf4;
}
.comp-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.comp-table td.col-center { text-align: center; }
.comp-table td.col-you { font-weight: 700; background: #f0fdf4; text-align: center; }
.comp-table td.col-winner { background: #dcfce7; }
.comp-table tr:hover td { background: #f8fafc; }
.comp-table tr:hover td.col-you { background: #e6faf0; }
.comp-table tfoot tr {
  background: var(--gray-50, #f8f9fa);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--gray-600, #4b5563);
}
.comp-table tfoot tr:first-child td {
  border-top: 2px solid var(--gray-300, #d1d5db);
}
.comp-table tfoot tr + tr td {
  border-top: 1px solid var(--gray-200, #e5e7eb);
}
.comp-table tfoot td { padding: 9px 12px; }
.comp-table tfoot .service-name-cell {
  color: var(--gray-500, #6b7280);
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.comp-table .service-name-cell { font-weight: 500; white-space: nowrap; }
.comp-table .comp-table-inner { padding: 0 20px 18px; }

/* ==========================================================================
   Fix 4: URL Verification Section
   ========================================================================== */
#verify-urls-status {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}
#verify-urls-status:empty { display: none; }

/* ==========================================================================
   Fix 5: Missing-From-Card (Content Gaps) — CSS class-based
   ========================================================================== */
.missing-from-card {
  background: #fff8e1;
  border: 1px solid #f9a825;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0;
}
.missing-from-card > summary {
  cursor: pointer;
  font-weight: 700;
  color: #e65100;
  font-size: 0.9375rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.missing-from-card > summary::-webkit-details-marker { display: none; }
.missing-from-card-body { margin-top: 12px; }
.missing-from-card-row {
  padding: 8px 0;
  border-bottom: 1px solid #ffe082;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.missing-from-card-row:last-child { border-bottom: none; }
.missing-from-card-service {
  font-weight: 600;
  min-width: 170px;
  flex-shrink: 0;
  color: #555;
  font-size: 0.875rem;
}
.missing-from-card-detail { color: #e65100; font-size: 0.875rem; }

/* ==========================================================================
   Fix 5: Competitor Citations Detail — CSS class-based
   ========================================================================== */
.competitor-citations-detail {
  background: var(--gray-50, #f8f9fa);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-lg, 8px);
  padding: 10px 16px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}
.competitor-citations-title {
  color: var(--gray-500, #6b7280);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  margin-right: 8px;
  white-space: nowrap;
}
.competitor-link-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}
.competitor-link-row:last-child { border-bottom: none; }
.competitor-link-row + .competitor-link-row::before {
  content: '·';
  color: var(--gray-300, #d1d5db);
  margin-right: 2px;
}
.competitor-link-row a.competitor-link {
  color: var(--color-accent, #2563eb);
  text-decoration: none;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.competitor-link-row a.competitor-link:hover { text-decoration: underline; }

/* ==========================================================================
   Fix 8: Export Section
   ========================================================================== */
#zone-export {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e5e7eb;
  grid-column: 1 / -1;
}
.geo-export-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Fix 10: Kill any remaining amber warning banners (belt-and-suspenders)
   ========================================================================== */
.geo-warning-banner {
  background: transparent !important;
  border: none !important;
  padding: 8px 0 !important;
  font-size: 0.6875rem !important;
  color: #9ca3af !important;
  text-align: center !important;
}

/* === 1D: Citation Consistency === */
.consistency-cell { text-align:center; font-weight:600; font-size:0.875rem; white-space:nowrap; }
.consistency-detail { display:block; font-size:0.6875rem; font-weight:400; color:#9ca3af; }
.consistency-high { color:var(--color-success, #059669); }
.consistency-med { color:var(--color-warning, #d97706); }
.consistency-low { color:var(--color-danger, #dc2626); }
.consistency-new { color:#9ca3af; font-style:italic; font-weight:400; }

/* === View Response Highlights === */
.response-text-panel { margin-top:12px; padding:14px 16px; background:var(--gray-50,#f8f9fa); border:1px solid var(--gray-200,#e5e7eb); border-radius:6px; max-height:400px; overflow-y:auto; }
.response-text-content { font-size:0.875rem; line-height:1.7; color:var(--gray-700,#374151); word-wrap:break-word; max-width:80ch; }
.hl-brand { background:rgba(5,150,105,0.15); color:var(--color-success,#059669); padding:1px 4px; border-radius:3px; font-weight:600; }
.hl-competitor { background:rgba(217,119,6,0.15); color:var(--color-warning,#d97706); padding:1px 4px; border-radius:3px; font-weight:500; }
.hl-cited { background:rgba(37,99,235,0.08); color:var(--color-accent,#2563EB); padding:1px 3px; border-radius:2px; text-decoration:underline dotted; text-underline-offset:2px; }
/* Citation color-coded dots */
.citation-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:4px; vertical-align:middle; flex-shrink:0; }
.citation-dot-brand { background:#059669; }
.citation-dot-competitor { background:#d97706; }
.citation-dot-third { background:#2563eb; }
.citation-legend { display:flex; gap:14px; font-size:11px; color:#64748b; margin:8px 0 4px; padding:6px 10px; background:#f8fafc; border-radius:4px; }
.citation-legend-item { display:flex; align-items:center; gap:4px; }
.view-response-btn { margin-left:4px; }

/* === Scan History Browser === */
.scan-history-controls { display:flex; gap:10px; align-items:center; margin-bottom:16px; flex-wrap:wrap; }
.scan-history-pagination { display:flex; justify-content:center; gap:4px; margin-top:16px; flex-wrap:wrap; }
.scan-history-pagination button { padding:4px 12px; border:1px solid var(--gray-300,#d1d5db); border-radius:4px; cursor:pointer; background:#fff; font-size:0.8125rem; transition:background 0.15s; }
.scan-history-pagination button:hover { background:var(--gray-100,#f3f4f6); }
.scan-history-pagination button.active { background:var(--color-primary,#1E3A8A); color:#fff; border-color:var(--color-primary,#1E3A8A); }
#history-table th:first-child,
#history-table td:first-child { width:40px; text-align:center; padding:6px; }
#history-table td { font-size:0.8125rem; }
#history-table .history-actions { white-space:nowrap; }
#zone-history { padding:0 0 32px; }

/* === Insights Engine === */
.insights-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0;
    grid-column: 1 / -1;
}
.insight-card {
    padding: 14px 16px;
    border-radius: var(--radius-md, 6px);
    border-left: 4px solid;
}
.insight-high {
    background: var(--color-danger-bg, #fef2f2);
    border-left-color: var(--color-danger, #dc2626);
}
.insight-medium {
    background: var(--color-warning-bg, #fffbeb);
    border-left-color: var(--color-warning, #d97706);
}
.insight-low {
    background: var(--color-info-bg, #DBEAFE);
    border-left-color: var(--color-info, #1E40AF);
}
.insight-velocity-up {
    background: #f0fdf4;
    border-left-color: #059669;
}
.insight-velocity-down {
    background: #fffbeb;
    border-left-color: #d97706;
}
.insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.insight-severity {
    font-size: 0.6875rem;
    padding: 2px 8px;
    border-radius: var(--radius-full, 9999px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-high { background: var(--color-danger, #dc2626); color: white; }
.badge-medium { background: var(--color-warning, #d97706); color: white; }
.badge-low { background: var(--color-info, #1E40AF); color: white; }
.sg-badge-sm { font-size: 10px; padding: 1px 6px; }
.insight-category {
    font-weight: var(--weight-semibold, 600);
    font-size: var(--text-sm, 0.875rem);
    color: var(--gray-700, #374151);
}
.insight-service {
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
    background: var(--gray-100, #f3f4f6);
    padding: 2px 8px;
    border-radius: var(--radius-full, 9999px);
}
.insight-message {
    margin: 0 0 6px;
    font-size: var(--text-sm, 0.875rem);
    color: var(--gray-700, #374151);
    line-height: 1.5;
}
.insight-action-details summary {
    font-size: 0.8125rem;
    font-weight: var(--weight-medium, 500);
    color: var(--color-accent, #2563EB);
    cursor: pointer;
}
.insight-action {
    margin: 8px 0 0;
    font-size: 0.8125rem;
    color: var(--gray-600, #4b5563);
    line-height: 1.6;
}
.insight-cta-wrap {
    margin-top: 10px;
}
.citability-cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: #2563EB;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.citability-cta-btn:hover {
    background: #1d4ed8;
}

/* === AI Readability Audit === */
.readability-audit-results {
    margin-top: 16px;
    padding: 20px;
    background: white;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
}
.readability-score-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}
.readability-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gray-50, #f8f9fa);
    border: 3px solid currentColor;
    flex-shrink: 0;
}
.readability-grade {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}
.readability-score-num {
    font-size: 0.6875rem;
    color: var(--gray-500, #6b7280);
}
.readability-score-meta h4 {
    margin: 0 0 4px;
    font-size: var(--text-md, 1rem);
}
.readability-score-meta p {
    margin: 0 0 6px;
    font-size: var(--text-sm, 0.875rem);
    color: var(--gray-500, #6b7280);
}
.readability-score-meta code {
    font-size: 0.75rem;
    color: var(--gray-400, #9ca3af);
    word-break: break-all;
}
.readability-summary {
    font-size: var(--text-sm, 0.875rem);
    color: var(--gray-600, #4b5563);
    margin-bottom: 16px;
    line-height: 1.5;
}
.readability-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.readability-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md, 6px);
    font-size: 0.8125rem;
}
.check-pass {
    background: var(--color-success-bg, #ecfdf5);
}
.check-fail {
    background: var(--color-danger-bg, #fef2f2);
}
.check-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.check-label {
    font-weight: var(--weight-medium, 500);
    color: var(--gray-700, #374151);
}
.check-detail {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
}
@media (max-width: 768px) {
    .readability-score-header { flex-direction: column; align-items: flex-start; }
    .readability-check { flex-wrap: wrap; }
    .check-detail { margin-left: 28px; width: 100%; }
}

/* === Citability Score Header === */
.citability-score-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    padding: 16px;
    background: white;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
}
.citability-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gray-50, #f8f9fa);
    border: 3px solid currentColor;
    flex-shrink: 0;
}
.citability-grade { font-size: 2rem; font-weight: 800; line-height: 1; color: #0a0a0a; }
.citability-score-num { font-size: 0.6875rem; color: var(--gray-500); }
.citability-score-meta { flex: 1; }
.citability-score-meta h4 { margin: 0 0 4px; font-size: 1rem; }
.citability-score-meta p { margin: 0 0 8px; font-size: 0.875rem; color: var(--gray-500); }
.citability-progress-bar {
    height: 8px;
    background: var(--gray-200, #e5e7eb);
    border-radius: 4px;
    overflow: hidden;
}
.citability-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.citability-progress-fill.consistency-high { background: var(--color-success, #059669); }
.citability-progress-fill.consistency-med { background: var(--color-warning, #d97706); }
.citability-progress-fill.consistency-low { background: var(--color-danger, #dc2626); }

/* Score circle color per grade */
.citability-score-circle.consistency-high { color: var(--color-success, #059669); }
.citability-score-circle.consistency-med { color: var(--color-warning, #d97706); }
.citability-score-circle.consistency-low { color: var(--color-danger, #dc2626); }

/* URL and meta */
.citability-url { font-size: 0.8125rem; color: var(--gray-500); margin: 8px 0; word-break: break-all; }
.citability-url a { color: var(--color-accent); }
.citability-meta { font-size: 0.8125rem; color: var(--gray-500); margin: 4px 0 12px; }
.citability-platform-badge { display: inline-block; padding: 4px 12px; border-radius: var(--radius-full, 9999px); font-size: 0.75rem; font-weight: 600; margin: 4px 4px 4px 0; }
.citability-platform-badge.badge-found { background: var(--color-success-bg, #ecfdf5); color: var(--color-success, #059669); }
.citability-platform-badge.badge-missing { background: var(--color-danger-bg, #fef2f2); color: var(--color-danger, #dc2626); }

/* Top Actions */
.citability-top-actions { margin: 16px 0; padding: 12px 16px; background: var(--color-warning-bg, #fffbeb); border: 1px solid var(--color-warning, #d97706); border-radius: var(--radius-md, 6px); }
.citability-top-actions h4 { margin: 0 0 8px; font-size: 0.875rem; color: var(--color-warning, #d97706); }
.citability-action-compact { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(217,119,6,0.15); }
.citability-action-compact:last-child { border-bottom: none; }
.citability-action-num { width: 22px; height: 22px; border-radius: 50%; background: var(--color-warning, #d97706); color: white; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.citability-action-text { flex: 1; font-size: 0.8125rem; font-weight: 500; color: var(--gray-700, #374151); }

/* Signal Table */
.citability-signal-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; margin: 12px 0; }
.citability-signal-table th { text-align: left; padding: 8px; background: var(--gray-50, #f8f9fa); color: var(--gray-500, #6b7280); font-weight: 600; text-transform: uppercase; font-size: 0.6875rem; letter-spacing: 0.04em; border-bottom: 2px solid var(--gray-200, #e5e7eb); }
.citability-signal-table td { padding: 8px; border-bottom: 1px solid var(--gray-100, #f3f4f6); }
.signal-name { font-weight: 500; color: var(--gray-700, #374151); }
.signal-value { text-align: center; color: var(--gray-600, #4b5563); }
.signal-gap { text-align: center; font-weight: 600; }
.gap-behind { color: var(--color-danger, #dc2626); }
.gap-ahead { color: var(--color-success, #059669); }
.gap-even { color: var(--gray-400, #9ca3af); }
.signal-bar-cell { width: 120px; }
.signal-bar-track { position: relative; height: 8px; background: var(--gray-100, #f3f4f6); border-radius: 4px; overflow: hidden; }
.signal-bar-user { position: absolute; top: 0; left: 0; height: 100%; background: var(--color-accent, #2563EB); border-radius: 4px; opacity: 0.8; z-index: 2; }
.signal-bar-cited { position: absolute; top: 0; left: 0; height: 100%; background: var(--gray-300, #d1d5db); border-radius: 4px; z-index: 1; }

/* Health Chips */
.citability-health-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.citability-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--radius-full, 9999px); font-size: 0.75rem; font-weight: 500; }
.chip-good { background: var(--color-success-bg, #ecfdf5); color: var(--color-success, #059669); }
.chip-bad { background: var(--color-danger-bg, #fef2f2); color: var(--color-danger, #dc2626); }
.chip-warn { background: var(--color-warning-bg, #fffbeb); color: var(--color-warning, #d97706); }
.chip-target { font-weight: 400; opacity: 0.7; }

/* Recommendations */
.citability-recs-details { margin-top: 16px; }
.citability-recs-details summary { cursor: pointer; }
.citability-signals-details summary { cursor: pointer; margin: 12px 0 0; }

/* Priority badges */
.priority-badge { padding: 2px 8px; border-radius: var(--radius-full, 9999px); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; }
.priority-high { background: var(--color-danger, #dc2626); color: white; }
.priority-medium { background: var(--color-warning, #d97706); color: white; }
.priority-low { background: var(--color-info, #1E40AF); color: white; }

/* Rec card detail text */
.rec-gap-detail { font-size: 0.8125rem; color: var(--gray-500, #6b7280); font-style: italic; margin: 4px 0 6px; }
.rec-explanation { font-size: 0.8125rem; color: var(--gray-600, #4b5563); line-height: 1.5; margin: 4px 0; }
.rec-platforms { font-size: 0.75rem; color: var(--color-accent, #2563EB); margin: 6px 0 0; }

/* ── Recommendations List (Content Analyzer Redesign) ────────────────── */
.recs-breakout-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.recs-breakout-title { font-size: 16px; font-weight: 600; color: var(--gray-900); margin: 0; }
.recs-breakout-count { font-size: var(--text-xs); font-weight: 500; color: var(--gray-500); background: var(--gray-100); padding: 2px 10px; border-radius: var(--radius-full); }

.recs-list { display: flex; flex-direction: column; gap: 1px; background: var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,0.06); }

.rec-row { background: #ffffff; }
.rec-row:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.rec-row:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.rec-row:only-child { border-radius: var(--radius-lg); }

.rec-row-main { display: flex; align-items: center; gap: 12px; padding: 12px 16px; transition: background 120ms ease; }
.rec-row-expandable .rec-row-main { cursor: pointer; }
.rec-row-main:hover { background: var(--gray-50); }
.rec-row-expanded .rec-row-main { background: var(--gray-50); }

.rec-row-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--radius-full); color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0; }

.rec-row-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rec-row-title { font-size: var(--text-sm); font-weight: 600; color: var(--gray-900); line-height: 1.3; }
.rec-row-gap { font-size: var(--text-xs); color: var(--gray-500); font-style: italic; line-height: 1.3; }

.rec-row-source { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: var(--radius-full); border: 1px solid; flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }

.rec-row-platforms { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; max-width: 200px; justify-content: flex-end; }
.rec-platform-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; color: var(--gray-600); background: var(--gray-50); padding: 2px 7px; border-radius: var(--radius-full); border: 1px solid var(--gray-200); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px; }
.rec-platform-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--platform-color, #6b7280); flex-shrink: 0; }

.rec-row-pri { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); flex-shrink: 0; letter-spacing: 0.5px; white-space: nowrap; }

.rec-row-chevron { color: var(--gray-400); font-size: 14px; flex-shrink: 0; width: 16px; text-align: center; transition: transform 150ms ease; }
.rec-row-expanded .rec-row-chevron { transform: rotate(180deg); }

.rec-row-detail { padding: 0 16px 16px 52px; font-size: var(--text-sm); line-height: 1.6; color: var(--gray-600); border-top: 1px solid var(--gray-100); margin: 0 16px; }
.rec-row-detail p { margin: 12px 0 0; }
.rec-row-detail-platforms { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rec-row-detail-label { font-size: 11px; font-weight: 600; color: var(--gray-500); margin-right: 4px; }

html[data-theme="dark"] .rec-row { background: #1e293b; }
html[data-theme="dark"] .rec-row-main:hover,
html[data-theme="dark"] .rec-row-expanded .rec-row-main { background: #263244; }
html[data-theme="dark"] .recs-list { background: #334155; }
html[data-theme="dark"] .rec-row-title { color: #f1f5f9; }
html[data-theme="dark"] .rec-row-gap { color: #94a3b8; }
html[data-theme="dark"] .rec-row-detail { color: #94a3b8; border-top-color: #334155; }
html[data-theme="dark"] .rec-platform-chip { background: #263244; border-color: #334155; color: #94a3b8; }
html[data-theme="dark"] .recs-breakout-title { color: #f1f5f9; }
html[data-theme="dark"] .recs-breakout-count { background: #263244; color: #94a3b8; }

@media (max-width: 768px) {
    .rec-row-main { flex-wrap: wrap; gap: 8px; }
    .rec-row-platforms { max-width: 100%; order: 10; }
    .rec-row-detail { padding-left: 16px; }
}

@media (max-width: 768px) {
    .citability-score-header { flex-direction: column; align-items: flex-start; }
    .signal-bar-cell { display: none; }
    .citability-signal-table { font-size: 0.75rem; }
}

/* === Historical Trends === */
.trends-controls {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.trends-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.trends-control-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    letter-spacing: 0;
}
.trends-chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.trends-chart-card {
    background: white;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
    padding: 16px;
}
.trends-chart-card.trends-chart-full {
    grid-column: 1 / -1;
}
.trends-chart-card h4 {
    margin: 0 0 2px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-700, #374151);
}
.trends-chart-subtitle {
    margin: 0 0 12px;
    font-size: 0.75rem;
    color: var(--gray-400, #9ca3af);
}
.trends-chart-card canvas {
    height: 220px !important;
}

/* Summary cards — 5-col, above charts */
.trends-summary-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.trends-stat {
    background: var(--gray-50, #f8f9fa);
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    padding: 12px;
    text-align: center;
}
.trends-stat-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gray-500, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.trends-stat-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-700, #374151);
}
.trends-stat-range {
    display: block;
    font-size: 0.6875rem;
    color: var(--gray-400, #9ca3af);
    margin-top: 2px;
}

/* Engine Heatmap */
.trends-heatmap-wrap { overflow-x: auto; }
.heatmap-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 2px;
    min-height: 20px;
}
.heatmap-row.heatmap-header { margin-bottom: 4px; }
.heatmap-label {
    min-width: 130px;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    color: #374151;
    padding-right: 6px;
    flex-shrink: 0;
}
.heatmap-cell {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 2px;
}
.heatmap-cited  { background: #059669; }
.heatmap-missed { background: #e5e7eb; }
.heatmap-na     { background: #f3f4f6; }
.heatmap-col-hdr {
    background: transparent;
    font-size: 8px;
    color: #9ca3af;
    text-align: center;
    overflow: visible;
    white-space: nowrap;
}
.heatmap-rate-hdr {
    margin-left: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    min-width: 34px;
}
.heatmap-rate {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 700;
    min-width: 34px;
}
.heatmap-footer { text-align: center; margin-top: 10px; }

/* Keyword Movement Table */
.trends-kw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.trends-kw-table th {
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
    padding: 5px 8px;
}
.trends-kw-table td { padding: 7px 8px; border-bottom: 1px solid #f3f4f6; }
.trends-kw-row { cursor: pointer; transition: background 0.1s; }
.trends-kw-row:hover { background: #f0f9ff; }
.kw-name  { color: var(--gray-800); font-weight: 500; max-width: 280px; }
.kw-score { font-weight: 600; color: #374151; }
.kw-spark { font-family: monospace; letter-spacing: 1px; color: #6b7280; font-size: 14px; }
.kw-scans { color: #9ca3af; font-size: 12px; }
.kw-table-footer { text-align: center; margin-top: 10px; }

@media (max-width: 768px) {
    .trends-chart-row { grid-template-columns: 1fr; }
    .trends-summary-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
    .trends-summary-cards { grid-template-columns: repeat(2, 1fr); }
    .trends-controls { flex-direction: column; align-items: stretch; }
}

/* === UX Review Fixes === */
.unlinked-mention-alert {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--color-warning-bg, #fffbeb);
    border-left: 3px solid var(--color-warning, #d97706);
    border-radius: var(--radius-md, 6px);
    font-size: 0.8125rem;
    color: var(--gray-600, #4b5563);
}
.history-domain-label {
    font-size: 0.875rem;
    color: var(--gray-600, #4b5563);
    align-self: center;
}

/* === Verification Section === */
.verification-card {
    margin: 14px 0;
    padding: 10px 14px;
    background: var(--gray-50, #f8f9fa);
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    font-size: 0.8125rem;
    color: var(--gray-600, #4b5563);
}
.verification-grounded {
    border-left: 3px solid var(--color-success, #059669);
    color: var(--gray-500, #6b7280);
}
.ver-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.ver-service-row {
    margin: 8px 0;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 4px;
    font-size: 0.8125rem;
}
.ver-count-valid   { color: #046b04; }
.ver-count-notfound{ color: #d63638; }
.ver-count-error   { color: #856404; }
.ver-details summary { cursor: pointer; color: var(--color-accent, #2563eb); margin-top: 6px; font-size: 0.8125rem; }
.ver-url-list { margin: 6px 0; padding-left: 18px; font-size: 0.8125rem; }
.ver-url-list li { margin: 3px 0; }

/* === Verification + Competitor Citations Wrapper === */
.verification-section-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.verification-section-wrap .verification-card {
    margin: 0;
}
.verification-section-wrap .competitor-citations-detail {
    margin: 0;
}

/* === Card Base Types (design system consolidation) === */
.geo-card-primary {
    background: #fff;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.geo-card-accent {
    background: var(--gray-50, #f8f9fa);
    border: 1px solid var(--gray-200, #e5e7eb);
    border-left: 3px solid var(--color-accent, #2563eb);
    border-radius: var(--radius-lg, 8px);
    padding: 14px 16px;
}

/* === Export Section (moved from inline styles) === */
#export-section {
    margin: 0 0 20px;
    padding: 20px;
    background: var(--gray-50, #f8f9fa);
    border-radius: var(--radius-lg, 10px);
    border: 1px solid var(--gray-200, #e5e7eb);
}
.export-section-desc {
    margin: 0 0 14px;
    color: var(--gray-600, #666);
    font-size: var(--text-sm, 0.8125rem);
}

/* === Email Modal (moved from inline styles) === */
.email-modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}
.email-modal-box {
    background: #fff;
    padding: 28px;
    border-radius: var(--radius-lg, 10px);
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18);
}
.email-modal-box h3 { margin: 0 0 16px; color: var(--gray-800, #1f2937); }
.email-modal-box p  { margin: 0 0 14px; color: var(--gray-500, #6b7280); font-size: 0.875rem; }
.email-modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    font-size: 0.9375rem;
    box-sizing: border-box;
    margin-bottom: 12px;
}
.email-modal-input:focus { outline: none; border-color: var(--color-accent, #2563eb); }
.email-modal-status {
    display: none;
    padding: 8px 12px;
    border-radius: var(--radius-md, 6px);
    margin-bottom: 12px;
    font-size: 0.875rem;
}
.email-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* === §14.4 Competitor Citations Detail — inline styles replaced === */
.comp-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
}
.comp-detail-title {
    margin: 0;
    color: var(--gray-800, #1f2937);
    font-size: 0.9375rem;
    font-weight: 600;
}
.comp-detail-actions { display: flex; gap: 8px; align-items: center; }
.comp-detail-close {
    background: transparent;
    border: none;
    color: var(--gray-400, #9ca3af);
    cursor: pointer;
    font-size: 1.125rem;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}
.comp-detail-close:hover { color: var(--gray-700, #374151); }
.comp-detail-services { display: flex; flex-direction: column; gap: 12px; }
.comp-service-row {}
.comp-service-label {
    color: var(--gray-600, #4b5563);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.comp-citation-link {
    display: block;
    padding: 5px 8px;
    color: var(--color-accent, #2563eb);
    text-decoration: none;
    font-size: 0.75rem;
    word-break: break-all;
    margin-left: 8px;
    border-radius: 3px;
    transition: background 0.1s;
}
.comp-citation-link:hover { background: var(--gray-50, #f9fafb); }
.comp-no-citations {
    text-align: center;
    color: var(--gray-400, #9ca3af);
    padding: 18px;
    font-size: 0.8125rem;
}
.comp-unlinked-box {
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--color-info-bg, #eff6ff);
    border-left: 3px solid var(--color-accent, #2563eb);
    border-radius: var(--radius-md, 6px);
}
.comp-unlinked-title {
    font-weight: 600;
    color: var(--color-accent, #2563eb);
    font-size: 0.875rem;
}
.comp-unlinked-sub {
    color: var(--color-accent, #2563eb);
    font-size: 0.75rem;
    margin-top: 2px;
}
.comp-unlinked-details { margin-top: 8px; }
.comp-unlinked-details summary {
    cursor: pointer;
    color: var(--color-accent, #2563eb);
    font-weight: 500;
    font-size: 0.8125rem;
}
.comp-unlinked-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.comp-unlinked-item {
    background: #fff;
    padding: 8px;
    border-radius: 4px;
}
.comp-unlinked-service-name {
    color: var(--gray-600, #4b5563);
    font-size: 0.6875rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.comp-unlinked-context {
    margin: 4px 0;
    padding: 6px;
    background: var(--gray-50, #f9fafb);
    border-radius: 3px;
    color: var(--gray-600, #555);
    line-height: 1.5;
    font-size: 0.75rem;
}

/* === §14.4 Utility inline style replacements === */
.fanout-loading-text {
    font-size: 0.6875rem;
    color: var(--gray-300, #d1d5db);
    margin: 4px 0 0;
}
.geo-error-banner {
    color: #721c24;
    padding: 18px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: var(--radius-lg, 8px);
}
.geo-error-banner-message { margin-top: 10px; }
.geo-cached-notice {
    color: #856404;
    padding: 10px 14px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--radius-md, 6px);
    margin-bottom: 14px;
    font-size: 0.875rem;
}
.citation-memory-note {
    color: var(--gray-500, #6b7280);
    font-size: 0.75rem;
}

/* competitor detail popup variant */
.competitor-citations-detail--popup {
  background: #fff;
  border-radius: var(--radius-lg, 8px);
  border: 1px solid var(--gray-200, #e5e7eb);
  padding: 16px;
  margin: 6px 0 0;
  display: block;
  flex-wrap: initial;
}

/* brand highlight in unlinked mentions */
.hl-brand-mention {
  background: #fef08a;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 600;
}

.citation-unverified-note {
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 500;
}

.comp-table-domain-th {
  text-align: center;
}

/* geo-btn-danger variant */
.geo-btn-danger {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}
.geo-btn-danger:hover {
  background: #c82333;
  border-color: #c82333;
}

/* competitor input row */
.competitor-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}
.competitor-row .geo-input {
  flex: 1;
}

/* === Primary domain mention boxes (Maps / Unlinked / YouTube) === */
.geo-mention-box {
  margin-top: 10px;
  padding: 10px 14px;
  border-left-width: 3px;
  border-left-style: solid;
  border-radius: 0 var(--radius-md, 6px) var(--radius-md, 6px) 0;
}
.geo-mention-box--maps    { background: #fffbeb; border-left-color: #f59e0b; }
.geo-mention-box--unlinked{ background: var(--color-info-bg, #eff6ff); border-left-color: var(--color-accent, #2563eb); }
.geo-mention-box--yt-brand{ background: #fff1f1; border-left-color: #ef4444; }
.geo-mention-box--yt-other{ background: #f5f5f5; border-left-color: #9ca3af; }
.geo-mention-box-title { font-weight: 600; font-size: 0.875rem; }
.geo-mention-box-title--maps     { color: #92400e; }
.geo-mention-box-title--unlinked { color: var(--color-accent, #2563eb); }
.geo-mention-box-title--yt-brand { color: #b91c1c; }
.geo-mention-box-title--yt-other { color: var(--gray-600, #4b5563); }
.geo-mention-box-sub { font-size: 0.75rem; margin-top: 2px; }
.geo-mention-box-sub--maps     { color: #92400e; }
.geo-mention-box-sub--unlinked { color: var(--color-accent, #2563eb); }
.geo-mention-box-sub--yt-brand { color: #b91c1c; }
.geo-mention-box-sub--yt-other { color: var(--gray-500, #6b7280); }
.geo-mention-box details { margin-top: 6px; }
.geo-mention-box details summary { cursor: pointer; font-size: 0.8125rem; font-weight: 500; }
.geo-mention-box ul { list-style: none; padding-left: 0; margin: 4px 0 0; }
.geo-mention-item {
  margin: 6px 0;
  padding: 8px;
  background: #fff;
  border-radius: var(--radius-sm, 4px);
}
.geo-mention-item-text { color: #555; line-height: 1.6; font-size: 0.8125rem; }
.geo-maps-brand-note { color: var(--gray-500, #6b7280); font-size: 0.75rem; }
.geo-yt-item {
  margin: 8px 0;
  padding: 10px;
  background: #fff;
  border-radius: var(--radius-sm, 4px);
  display: flex;
  align-items: center;
  gap: 10px;
}
.geo-yt-thumb { width: 80px; height: 45px; object-fit: cover; border-radius: var(--radius-sm, 4px); }
.geo-yt-info {}
.geo-yt-channel-name { font-weight: 600; color: #b91c1c; font-size: 0.875rem; }
.geo-yt-link { color: #065fd4; font-size: 0.875rem; text-decoration: none; }
.geo-yt-date { color: var(--gray-400, #9ca3af); font-size: 0.8125rem; margin-top: 2px; }
.geo-yt-paa-note { color: var(--gray-500, #6b7280); font-size: 0.8125rem; margin-top: 2px; }

/* ── General modal overlay (shared by schedule modal, etc.) ──────────────── */
.geo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.geo-modal-box {
    background: var(--geo-surface, #fff);
    border-radius: var(--radius-xl, 12px);
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
.geo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--geo-border, #e2e8f0);
    flex-shrink: 0;
}
.geo-modal-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--geo-text, #1e293b);
}
.geo-modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--geo-text-muted, #64748b);
    padding: 2px 6px;
    border-radius: 4px;
    transition: background .15s;
}
.geo-modal-close:hover { background: var(--geo-border, #e2e8f0); }
.geo-modal-body {
    overflow-y: auto;
    flex: 1;
}

/* ── Schedule modal specific ─────────────────────────────────────────────── */
.sched-field-label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 600;
    color: var(--geo-text, #1e293b);
}

/* ── Success banner (shared) ─────────────────────────────────────────────── */
.geo-success-banner {
    color: #065f46;
    padding: 12px 14px;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-md, 6px);
}

/* ── Admin badge classes (reused in schedule list JS) ────────────────────── */
.adm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
}
.adm-badge-active  { background: #d1fae5; color: #065f46; }
.adm-badge-paused  { background: #fee2e2; color: #991b1b; }
.adm-badge-failed  { background: #fef3c7; color: #92400e; }
.adm-action-btn {
    font-size: 12px;
    padding: 3px 10px;
    border: 1px solid var(--geo-border, #e2e8f0);
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}
.adm-action-btn:hover { background: #fee2e2; border-color: #f87171; }

/* ── Generic spinner ──────────────────────────────────────────────────────── */
.geo-spinner {
    border: 3px solid var(--geo-border, #e2e8f0);
    border-top-color: var(--geo-primary, #6366f1);
    border-radius: 50%;
    animation: geo-spin .7s linear infinite;
}
@keyframes geo-spin { to { transform: rotate(360deg); } }

/* ── Main tab switcher ────────────────────────────────────────────────────── */
.geo-main-tabs {
    display: flex;
    gap: 2px;
    background: var(--geo-border, #e2e8f0);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 20px;
    width: fit-content;
}
.geo-main-tab {
    padding: 7px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.1px;
    cursor: pointer;
    background: transparent;
    color: var(--geo-text-muted, #64748b);
    transition: all .15s;
}
.geo-main-tab.active {
    background: #fff;
    color: var(--geo-primary, #6366f1);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.geo-main-tab:hover:not(.active) { color: var(--geo-text, #1e293b); }

/* ── Domain Overview: headline metric cards ───────────────────────────────── */
.ov-metrics-bar {
    display: flex;
    gap: 0;
    background: #ffffff;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 12px;
    padding: 20px 0;
    margin-bottom: 12px;
}
@media (max-width: 640px) {
    .ov-metrics-bar { flex-direction: column; }
    .ov-metric-card { border-right: none !important; border-bottom: 1px solid var(--gray-100, #f1f5f9); padding: 16px 24px !important; }
    .ov-metric-card:last-child { border-bottom: none !important; }
    .ov-two-col     { grid-template-columns: 1fr !important; }
}
.ov-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.ov-metric-card {
    flex: 1;
    text-align: center;
    padding: 0 24px;
    border-right: 1px solid var(--gray-100, #f1f5f9);
    background: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    transition: none;
}
.ov-metric-card:last-child { border-right: none; }
.ov-metric-value {
    font-size: 28px;
    font-weight: 700;
    color: #0a0a0a;
    line-height: 1;
    letter-spacing: -0.5px;
}
.ov-metric-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 4px;
}
.ov-metric-sub {
    font-size: 11px;
    color: var(--gray-400, #94a3b8);
    margin-top: 2px;
}

/* ── Domain Overview: chart wrapper ──────────────────────────────────────── */
.ov-chart-wrap {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 16px;
}

/* ── Domain Overview: section title ──────────────────────────────────────── */
.ov-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #737373;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
}

/* ── Domain Overview: data tables ────────────────────────────────────────── */
.ov-table-wrap {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 400px;
    overflow-y: auto;
}
.ov-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ov-th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #737373;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: none;
    border-bottom: 2px solid var(--gray-200, #e2e8f0);
    position: sticky;
    top: 0;
    z-index: 1;
}
.ov-td {
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    color: #404040;
    vertical-align: middle;
}
.ov-td-num {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    text-align: right;
    color: #0a0a0a;
}
.ov-table tr:last-child .ov-td { border-bottom: none; }
.ov-table tr:hover .ov-td { background: #f8fafc; }
.ov-empty {
    text-align: center;
    padding: 20px;
    color: var(--geo-text-muted, #94a3b8);
    font-size: 13px;
}
.ov-kw-text { color: var(--geo-text, #1e293b); }
.ov-domain-link { color: var(--geo-primary, #6366f1); text-decoration: none; font-size: 12px; }
.ov-domain-link:hover { text-decoration: underline; }

/* ── Domain Overview: Scan keyword button ────────────────────────────────── */
.geo-btn-xs {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--geo-primary, #6366f1);
    border-radius: 4px;
    color: var(--geo-primary, #6366f1);
    background: transparent;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 6px;
    transition: all .12s;
}
.geo-btn-xs:hover { background: var(--geo-primary, #6366f1); color: #fff; }

/* ── Domain Overview: Competitor Comparison Grid ── */
.ov-comp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 768px) {
    .ov-comp-grid { grid-template-columns: 1fr; }
}
.ov-mini-chart-card {
    background: #fff;
    border: 1px solid var(--geo-border, #e2e8f0);
    border-radius: 10px;
    padding: 14px;
}
.ov-mini-chart-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--geo-text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}
.ov-comp-bottom-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 768px) {
    .ov-comp-bottom-grid { grid-template-columns: 1fr; }
}
.ov-sov-card {
    background: #fff;
    border: 1px solid var(--geo-border, #e2e8f0);
    border-radius: 10px;
    padding: 14px;
}
.ov-comp-table-card {
    background: #fff;
    border: 1px solid var(--geo-border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
}
.ov-comp-summary-table td { font-size: 13px; }

/* ── Domain Overview: Intent Pills ── */
.ov-intent-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.ov-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: #f5f5f5;
    color: #525252;
    border: none;
    cursor: pointer;
    transition: all 150ms ease;
}
.ov-pill:hover {
    background: #e5e5e5;
    color: #0a0a0a;
}
.ov-pill.active {
    background: #0a0a0a;
    color: #ffffff;
    border-color: #0a0a0a;
}

/* ── Domain Overview: Intent Badges ── */
.ov-intent-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Domain Overview: Volume Bar (inline) ── */
.ov-vol-cell {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 120px;
}
.ov-vol-bar {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 3px;
    pointer-events: none;
}
.ov-vol-num {
    position: relative;
    z-index: 1;
    font-weight: 600;
    font-size: 13px;
}

/* ── Domain Overview: Insight Callout ── */
.ov-callout {
    background: #f8fafc;
    border: 1px solid var(--geo-border, #e2e8f0);
    border-left: 4px solid #6366f1;
    border-radius: 8px;
    padding: 16px 20px;
}
.ov-callout-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--geo-text, #1e293b);
    margin-bottom: 8px;
}
.ov-callout-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--geo-text, #334155);
    line-height: 1.7;
}
.ov-callout-list li { margin-bottom: 4px; }
.ov-callout-list li:last-child { margin-bottom: 0; }

/* ── Action Cards ── */
.ov-actions {
    background: #fff;
    border: 1px solid var(--geo-border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
}
.ov-actions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--geo-text, #1e293b);
    background: #f8fafc;
    border-bottom: 1px solid var(--geo-border, #e2e8f0);
}
.ov-actions-header:hover { background: #f1f5f9; }
.ov-actions-chevron {
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-500);
    letter-spacing: 0.02em;
}
.ov-actions-body {
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    max-height: 2000px;
    opacity: 1;
}
.ov-actions-collapsed .ov-actions-body {
    max-height: 0;
    opacity: 0;
}
.ov-actions-collapsed .ov-actions-header {
    border-bottom: none;
}
.ov-action-card {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 200ms ease;
}
.ov-action-card:last-child { border-bottom: none; }
.ov-action-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    padding-top: 2px;
}
.ov-action-body { flex: 1; }
.ov-action-priority {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
/* Insight category badges */
.ov-action-category { display:inline-block; font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; padding:2px 8px; border-radius:3px; margin-left:8px; vertical-align:middle; }
.ov-cat-competitive { background:#fef2f2; color:#dc2626; }
.ov-cat-content_gaps { background:#fffbeb; color:#d97706; }
.ov-cat-citation { background:#ecfdf5; color:#059669; }
.ov-cat-content_relevance { background: #7c3aed; color: #fff; }
.ov-cat-platform { background:#eef2ff; color:#6366f1; }
.ov-cat-opportunity { background:#eff6ff; color:#2563eb; }
.ov-cat-competitor_intel { background:#f5f3ff; color:#8b5cf6; }
.ov-action-text {
    font-size: 13px;
    color: var(--geo-text, #334155);
    line-height: 1.5;
    margin-top: 2px;
}
.ov-action-rec {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,0.06);
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
}

/* ── Competitor Suggestion Chips ── */
.ov-suggest-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px dashed #94a3b8;
    border-radius: 20px;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: var(--geo-text, #334155);
    cursor: pointer;
    transition: all 0.15s;
}
.ov-suggest-chip:hover {
    border-color: #059669;
    background: #f0fdf4;
}

/* ── Domain Overview: skeleton loading ────────────────────────────────────── */
@keyframes ov-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.ov-skeleton-card {
    flex: 1;
    height: 90px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: ov-shimmer 1.5s infinite;
    border-radius: 12px;
}
.ov-skeleton-block {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: ov-shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ── Domain Overview: touch targets ──────────────────────────────────────── */
.ov-intent-pill, .ov-filter-btn, .ov-pill {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 13px;
}
.ov-scan-btn {
    min-height: 32px;
    padding: 4px 12px;
}

/* ── Domain Overview: minimum font sizes ─────────────────────────────────── */
.ov-card p, .ov-card-subtitle {
    font-size: 12px;
}

/* ── GEO Scan: skeleton loading cards ────────────────────────────────────── */
.geo-skeleton-bar,
.geo-skeleton-card {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: geo-shimmer 1.5s infinite;
    border-radius: 12px;
    height: 150px;
}
@keyframes geo-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Domain Overview: Scan buttons in keyword table ─────────────────────── */
.ov-scan-kw-btn {
    min-height: 28px;
    padding: 4px 12px;
    font-size: 12px;
}

/* ── Domain Overview: Cited page title spans ─────────────────────────────── */
#ov-own-pages-body span {
    font-size: 12px;
}

/* ── Fan-Out: AI Coverage button ─────────────────────────────────────────── */
.fanout-ai-coverage-btn {
    background: #f0f0ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}
.fanout-ai-coverage-btn:hover {
    background: #e0e0ff;
}

/* ── Fan-Out: Coverage table ──────────────────────────────────────────────── */
.fanout-coverage-panel .fanout-coverage-table th {
    background: #f8fafc;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 10px;
    text-align: left;
    color: var(--gray-500);
    border-bottom: 1px solid #e2e8f0;
}
.fanout-coverage-panel .fanout-coverage-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}
.fanout-coverage-panel .fanout-coverage-table tr:hover td {
    background: #f8fafc;
}

/* ── AI Response Topics ───────────────────────────────────────────────────── */
.ai-topics-panel {
    background: var(--color-surface, #fff);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}
.ai-topics-summary {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.ai-topics-summary span {
    padding: 2px 8px;
    background: #f8fafc;
    border-radius: 4px;
}
.ai-topic-freq {
    font-weight: 700;
    color: #0a0a0a;
}
.ai-topic-hot {
    background: #fefce8 !important;
}
.ai-topic-engine-pill {
    display: inline-block;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    background: #f1f5f9;
    color: #475569;
    margin: 1px 2px;
    font-weight: 500;
}
.ai-topic-engines {
    max-width: 240px;
}
html[data-theme="dark"] .ai-topics-panel {
    background: var(--color-surface-dark, #1a1a2e);
    border-color: rgba(255,255,255,0.06);
}
html[data-theme="dark"] .ai-topic-hot {
    background: rgba(234, 179, 8, 0.1) !important;
}
html[data-theme="dark"] .ai-topic-engine-pill {
    background: rgba(255,255,255,0.08);
    color: #94a3b8;
}

/* ── Scan Queue Card ──────────────────────────────────────────────────────── */
#scan-queue-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.scan-queue-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-primary, #1e3a8a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.scan-queue-body { flex: 1; min-width: 0; }

.scan-queue-msg {
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
    margin-bottom: 8px;
}

.scan-queue-track {
    height: 4px;
    background: #fde68a;
    border-radius: 2px;
    overflow: hidden;
}

.scan-queue-bar {
    height: 100%;
    width: 40%;
    background: #d97706;
    border-radius: 2px;
    animation: scan-queue-pulse 1.6s ease-in-out infinite;
    transform-origin: left center;
}

@keyframes scan-queue-pulse {
    0%, 100% { opacity: 1;   width: 40%; }
    50%       { opacity: 0.5; width: 20%; }
}

/* ── Cross-Scan Accumulated Insights ────────────────────────────────────── */
.cross-scan-insights {
  margin-top: 20px;
  padding: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.cross-scan-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0 0 4px;
}
.cross-scan-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0 0 16px;
}
.cross-scan-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.cross-scan-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cross-scan-bar-label {
  width: 140px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  text-align: right;
  flex-shrink: 0;
}
.cross-scan-bar-track {
  flex: 1;
  height: 14px;
  background: #e2e8f0;
  border-radius: 7px;
  overflow: hidden;
}
.cross-scan-bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.5s ease;
}
.cross-scan-bar-value {
  width: 40px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
  text-align: right;
  flex-shrink: 0;
}
.cross-scan-bar-detail {
  width: 50px;
  font-size: 11px;
  color: var(--gray-400);
  flex-shrink: 0;
}
.cross-scan-callouts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cross-scan-callout {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.callout-positive { background: #ecfdf5; border-left: 3px solid #059669; color: #065f46; }
.callout-warning  { background: #fffbeb; border-left: 3px solid #d97706; color: #92400e; }
.callout-negative { background: #fef2f2; border-left: 3px solid #dc2626; color: #991b1b; }


/* ── Insight readability improvements ────────────────────────────────── */
.insight-card + .insight-card { margin-top: 0; }
.insights-more-wrap {
  margin-top: 2px;
}
.insights-show-more-btn {
  width: 100%;
  padding: 10px 16px;
  background: #f8fafc;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.insights-show-more-btn:hover {
  background: #f1f5f9;
  border-color: #9ca3af;
  color: #1f2937;
}
.insight-message {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.insight-card:has(details[open]) .insight-message {
    -webkit-line-clamp: unset;
    overflow: visible;
}
.ov-action-text { line-height: 1.6; }
.ov-action-text strong { color: var(--gray-900, #111827); font-weight: 600; }

/* ==========================================================================
   Compact Not-Cited List (Fix 1)
   ========================================================================== */
.not-cited-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.not-cited-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  font-size: 13px;
}
.not-cited-service-name {
  font-weight: 600;
  color: #374151;
  min-width: 130px;
  flex-shrink: 0;
}
.not-cited-badges {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}
.not-cited-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.not-cited-error {
  color: #d97706;
  cursor: help;
  font-size: 14px;
  flex-shrink: 0;
}
/* Expandable not-cited items */
.not-cited-list-item.not-cited-expandable {
  display: block;
  padding: 0;
  overflow: hidden;
}
.not-cited-details {
  width: 100%;
}
.not-cited-details[open] .not-cited-expand-hint {
  color: #2563eb;
}
.not-cited-details[open] .not-cited-expand-hint::before {
  content: '▴ ';
}
.not-cited-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.not-cited-summary::-webkit-details-marker { display: none; }
.not-cited-summary:hover { background: #f5f5f5; }
.not-cited-expand-hint {
  margin-left: auto;
  font-size: 11px;
  color: #6b7280;
  flex-shrink: 0;
  white-space: nowrap;
}
.not-cited-expand-hint::before {
  content: '▾ ';
}
.not-cited-expand-body {
  padding: 8px 14px 10px 14px;
  border-top: 1px solid #f0f0f0;
  background: #fff;
  font-size: 13px;
}
.nc-citations-section strong {
  display: block;
  margin-bottom: 5px;
  color: #374151;
}
.nc-citations-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nc-citations-list li {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
}
.nc-no-citations {
  color: #9ca3af;
  font-size: 12px;
  margin: 0 0 6px;
}
.nc-footer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
}

/* Not-cited expandable cards — service-details variant */
.not-cited-service-details {
  width: 100%;
  border: none;
  background: transparent;
}
.not-cited-service-details[open] .not-cited-summary {
  border-bottom: 1px solid #f0f0f0;
}
.not-cited-details-body {
  padding: 10px 14px 12px;
  background: #fff;
  font-size: 13px;
}
.not-cited-citations-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  display: block;
  margin-bottom: 5px;
}
.not-cited-citation-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.not-cited-citation-list li { font-size: 11px; }
.not-cited-citation-link {
  color: var(--geo-primary, #3b82f6);
  text-decoration: none;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  transition: background 0.15s;
}
.not-cited-citation-link:hover {
  background: #e2e8f0;
  text-decoration: underline;
}
.not-cited-no-citations {
  font-size: 11px;
  color: var(--gray-400);
  font-style: italic;
  margin: 0 0 8px;
}
.not-cited-actions {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Insight community table (GEO Scanner) */
.insight-community-table-wrap {
  margin: 10px 0 6px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}
.insight-community-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.insight-community-table th {
  background: #f8fafc;
  text-align: left;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #e5e7eb;
}
.insight-community-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.insight-community-table tr:last-child td { border-bottom: none; }
.insight-community-table tr:hover td { background: #f8fafc; }
.insight-thread-link {
  color: #7c3aed;
  text-decoration: none;
  font-size: 13px;
  word-break: break-all;
}
.insight-thread-link:hover { text-decoration: underline; }
.insight-sub-badge {
  display: inline-block;
  border: 1px solid;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  margin-right: 6px;
  white-space: nowrap;
  vertical-align: middle;
}
.insight-plat-badge {
  display: inline-block;
  border: 1px solid;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  white-space: nowrap;
}
.insight-engine-pill {
  display: inline-block;
  background: #ede9fe;
  color: #6d28d9;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  margin: 1px 2px;
  white-space: nowrap;
}
.insight-comm-link {
  display: inline-block;
  color: #7c3aed;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  margin-top: 4px;
}
.insight-comm-link:hover { text-decoration: underline; }

.geo-community-citations {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-lg, 8px);
  overflow: hidden;
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,0.03));
}
.geo-comm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.geo-comm-th {
  background: var(--gray-50, #f9fafb);
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}
.geo-comm-td {
  padding: 7px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.geo-comm-row:last-child .geo-comm-td { border-bottom: none; }
.geo-comm-alt { background: #fafbfc; }
.geo-comm-row:hover .geo-comm-td { background: #f5f3ff; }
.geo-comm-num { color: var(--gray-400, #9ca3af); font-size: 12px; text-align: center; }
.geo-comm-link {
  color: #7c3aed;
  text-decoration: none;
  font-size: 13px;
  word-break: break-all;
}
.geo-comm-link:hover { text-decoration: underline; }
.geo-comm-sub {
  display: inline-block;
  background: #ff450012;
  color: #ff4500;
  border: 1px solid #ff450030;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  margin-right: 6px;
  white-space: nowrap;
  vertical-align: middle;
}
.geo-comm-plat {
  display: inline-block;
  border: 1px solid;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  white-space: nowrap;
}
.geo-comm-engine {
  display: inline-block;
  background: #ede9fe;
  color: #6d28d9;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  margin: 1px 2px;
  white-space: nowrap;
}

.comm-plat-pill {
  transition: opacity 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.comm-plat-pill:hover {
  opacity: 1 !important;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.12);
}
.comm-plat-pill--active {
  border-color: currentColor !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.14);
}

/* ==========================================================================
   Export Dropdown (Fix 3)
   ========================================================================== */
.geo-export-dropdown {
  position: relative;
}
.geo-export-dropdown-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  list-style: none;
  margin: 0;
  padding: 4px;
  min-width: 130px;
  z-index: 300;
}
.geo-export-dropdown-menu.is-open { display: block; }
.geo-export-dropdown-menu li + li { margin-top: 1px; }
.geo-export-dropdown-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 7px 12px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  border-radius: 5px;
  white-space: nowrap;
}
.geo-export-dropdown-menu button:hover {
  background: #f3f4f6;
  color: #111827;
}

/* ==========================================================================
   Bonus B1: Results container breathing room
   ========================================================================== */
#sg-aims-results,
#zone-results {
  padding-bottom: 80px;
}

/* ==========================================================================
   P2-1: Overview Left Panel — 3 visual groups with dividers
   ========================================================================== */
.overview-group {
  padding: 10px 0;
  border-top: 1px solid #e0e7ff;
}
.overview-group:first-child {
  border-top: none;
  padding-top: 0;
}
.overview-group-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #818cf8;
  margin-bottom: 8px;
}
/* Remove the old standalone border from .geo-score-vs-competitor since it's now inside a group */
.overview-group .geo-score-vs-competitor {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* ==========================================================================
   P2-2: Competitor Cited Pages — highlight missing entries
   ========================================================================== */
.geo-competitor-cited-urls.competitor-cited-missing {
  background: #fef2f2;
  border-left: 3px solid #ef4444;
  border-top: none;
  padding: 10px 12px;
  margin-top: 10px;
  border-radius: 0 6px 6px 0;
}
.geo-competitor-cited-urls.competitor-cited-missing h4 {
  color: #b91c1c;
}

/* ==========================================================================
   P2-3: Competitor Table — KB group toggle row
   ========================================================================== */
.kb-group-toggle-row {
  cursor: pointer;
  background: #f8fafc;
}
.kb-group-toggle-row:hover {
  background: #f1f5f9;
}
.kb-group-toggle-cell {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--gray-500);
  font-style: italic;
}
.kb-toggle-icon {
  font-style: normal;
  margin-right: 4px;
  color: #6366f1;
}
.kb-group-row td {
  opacity: 0.7;
  font-style: italic;
}

/* ==========================================================================
   P2-4: Cited card height alignment — footer always at bottom
   ========================================================================== */
.geo-card-footer {
  margin-top: auto;
}

/* ==========================================================================
   P2-6: Page to Analyze — DEEP DIVE visual separation
   ========================================================================== */
.page-analyze-wrapper {
  border: 2px solid #3b82f6;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 28px 0;
  background: #f8faff;
}
.page-analyze-deep-dive-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3b82f6;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-analyze-deep-dive-label::before,
.page-analyze-deep-dive-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #bfdbfe;
}

/* ==========================================================================
   Services Cited Hero Card
   ========================================================================== */
.geo-cited-hero {
  margin-left: auto;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 2px solid #818cf8;
  border-radius: 10px;
  padding: 12px 20px;
  text-align: center;
  min-width: 160px;
  flex-shrink: 0;
}
.geo-cited-hero--vs {
  min-width: 210px;
}
.geo-cited-hero-big {
  font-size: 2rem;
  font-weight: 800;
  color: #4338ca;
  line-height: 1;
  letter-spacing: -0.02em;
}
.geo-cited-hero-total {
  font-size: 1.5rem;
  font-weight: 600;
  color: #6366f1;
}
.geo-cited-hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.geo-cited-hero-divider {
  height: 1px;
  background: #a5b4fc;
  margin: 10px 0;
}
.geo-cited-hero-vs-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #4338ca;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.geo-cited-hero-compare {
  font-size: 0.8125rem;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.geo-cited-hero-sep {
  color: #a5b4fc;
}
.geo-cited-hero-lead {
  font-size: 0.875rem;
  margin-top: 4px;
}
.geo-vis-lead-pos { color: #15803d; font-weight: 700; }
.geo-vis-lead-neg { color: #b91c1c; font-weight: 700; }
.geo-vis-lead-tie { color: #6b7280; font-weight: 600; }

/* ==========================================================================
   P2-8: Domain Overview — 3-col metrics bar when no competitor (no SOV card)
   ========================================================================== */
.ov-metrics-bar.no-competitor {
  /* flex layout — grid-template-columns unused */
}

/* ==========================================================================
   P2-9: Recommended Actions — expandable detail for medium/low
   ========================================================================== */
.ov-action-details {
  margin-top: 6px;
}
.ov-action-details summary {
  font-size: 0.75rem;
  color: #6366f1;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.ov-action-details summary::-webkit-details-marker { display: none; }
.ov-action-details summary::before { content: '▶ '; font-size: 0.6rem; }
details[open].ov-action-details summary::before { content: '▼ '; }

.ov-analytics-card {
  background: var(--bg-secondary, #f9fafb);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
}
.ov-analytics-card h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.ov-pos-bar-track {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  background: #e5e7eb;
}
.ov-pos-bar-track .seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  transition: width .3s;
}
.seg-top    { background: #22c55e; }
.seg-mid    { background: #f59e0b; }
.seg-bottom { background: #ef4444; }
.ov-pos-legend {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted, #6b7280);
}
.ov-pos-legend span::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.ov-pos-legend .leg-top::before    { background: #22c55e; }
.ov-pos-legend .leg-mid::before    { background: #f59e0b; }
.ov-pos-legend .leg-bottom::before { background: #ef4444; }
.ov-sent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.ov-sent-row .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ov-sent-row .dot.pos { background: #22c55e; }
.ov-sent-row .dot.neu { background: #94a3b8; }
.ov-sent-row .dot.neg { background: #ef4444; }
.ov-sent-row .cnt { margin-left: auto; font-weight: 600; }
.ov-sent-clickable { cursor: pointer; border-radius: 4px; padding: 4px 6px; margin: -4px -6px; transition: background 0.15s; }
.ov-sent-clickable:hover { background: var(--bg-hover, rgba(0,0,0,0.04)); }
.ov-sent-clickable.ov-sent-active { background: var(--bg-hover, rgba(0,0,0,0.06)); }
.ov-pres-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.ov-pres-row .pres-icon { font-size: 14px; flex-shrink: 0; }
.ov-pres-row .cnt { margin-left: auto; font-weight: 600; }
.ov-pres-clickable { cursor: pointer; border-radius: 4px; padding: 4px 6px; margin: -4px -6px; transition: background 0.15s; }
.ov-pres-clickable:hover { background: var(--bg-hover, rgba(0,0,0,0.04)); }
.ov-pres-clickable.ov-pres-active { background: var(--bg-hover, rgba(0,0,0,0.06)); }
.ov-funnel-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.ov-funnel-pill {
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
  color: var(--text-primary);
  transition: all .15s;
}
.ov-funnel-pill.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}
.funnel-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.funnel-tofu { background: #dbeafe; color: #1e40af; }
.funnel-mofu { background: #fef3c7; color: #92400e; }
.funnel-bofu { background: #dcfce7; color: #166534; }

.analyzer-redirect-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.analyzer-redirect-warning code {
  word-break: break-all;
}
.analyzer-redirect-warning + .analyzer-redirect-warning {
  display: none;
}

/* ── Keyword auto-suggestion chip & warning ──────────────────────────── */
.analyzer-kw-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; margin-top: 5px; padding: 3px 8px;
  border-radius: 20px; line-height: 1.4;
}
.analyzer-kw-chip-gsc {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8;
}
.analyzer-kw-chip-title {
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
}
.analyzer-kw-chip-label {
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
}
.analyzer-kw-chip-gsc-link {
  color: inherit; text-decoration: underline; font-weight: 600;
}
.analyzer-kw-chip-clear {
  color: inherit; opacity: .55; font-size: 14px; line-height: 1;
  text-decoration: none; margin-left: 2px;
}
.analyzer-kw-chip-clear:hover { opacity: 1; }
.analyzer-kw-warning {
  font-size: 12px; margin-top: 5px; padding: 5px 10px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px;
  color: #92400e; display: inline-block;
}
.analyzer-kw-chip-selectable {
  cursor: pointer; border: 1px solid transparent;
  transition: box-shadow .15s, transform .1s;
}
.analyzer-kw-chip-selectable:hover { box-shadow: 0 0 0 2px rgba(99,102,241,.25); transform: translateY(-1px); }
.analyzer-kw-chip-active {
  outline: 2px solid #6366f1; outline-offset: 1px; font-weight: 700;
}

/* ── Citability Signal Breakdown enhancements ──────────────────────────── */
.citability-comp-label {
  font-size: 11px; font-weight: 400; color: var(--gray-500, #64748b);
  margin-left: 8px; letter-spacing: .02em;
}
.citability-comp-pages {
  font-size: 12px; color: var(--gray-500, #64748b);
  padding: 6px 0 8px; line-height: 1.6;
}
.citability-comp-pages a {
  color: var(--brand-primary, #6366f1); text-decoration: none;
}
.citability-comp-pages a:hover { text-decoration: underline; }

/* ── Content Analyzer Tab ──────────────────────────────────── */
#tab-panel-analyzer .geo-input { height: 40px; font-size: 14px; }
.analyzer-columns { display: flex; gap: 24px; align-items: flex-start; }
@media (max-width: 768px) { .analyzer-columns { flex-direction: column; } }

/* ── Page Overview Redesign ───────────────────────────────────────────── */
.analyzer-overview-grid { display: block; }
.apo-header { background: var(--bg-secondary, #f8fafc); border: 1px solid var(--border-color, #e2e8f0); border-radius: 10px; padding: 14px 18px; margin-bottom: 12px; }
.apo-header-title { font-size: 14px; font-weight: 600; color: var(--geo-text, #1e293b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.apo-header-desc { font-size: 13px; color: var(--text-muted, #64748b); margin-bottom: 6px; line-height: 1.4; }
.apo-header-chars { font-size: 11px; color: var(--gray-400); font-weight: 400; }
.apo-header-stats { font-size: 12px; color: var(--gray-500); display: flex; flex-wrap: wrap; gap: 4px; }
.apo-header-stats strong { color: var(--geo-text, #334155); }
.apo-metrics { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.apo-metric-card { flex: 1; min-width: 100px; max-width: 25%; background: var(--bg-secondary, #f8fafc); border: 1px solid var(--border-color, #e2e8f0); border-radius: 10px; padding: 12px 16px; text-align: center; }
.apo-metric-value { font-size: 22px; font-weight: 800; color: var(--geo-text, #1e293b); line-height: 1.1; }
.apo-metric-label { font-size: 11px; color: var(--gray-500); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.apo-metric-sub { font-size: 10px; color: #d97706; text-transform: none; letter-spacing: 0; }
.apo-issues { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.apo-issues-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.apo-issues-icon { font-size: 16px; color: #d97706; }
.apo-issues-title { font-size: 13px; font-weight: 700; color: #92400e; }
.apo-issues-list { display: flex; flex-direction: column; gap: 4px; }
.apo-issue { font-size: 12px; line-height: 1.4; padding: 4px 0; color: #78350f; }
.apo-issue-icon { margin-right: 4px; }
.apo-issue-high .apo-issue-icon { color: #dc2626; }
.apo-issue-medium .apo-issue-icon { color: #d97706; }
.apo-issue-low .apo-issue-icon { color: #ca8a04; }
.apo-section { margin-bottom: 12px; }
.apo-section-label { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--gray-400); margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border-color, #f1f5f9); }
.apo-content-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.apo-content-item { display: flex; align-items: baseline; gap: 4px; }
.apo-content-value { font-size: 16px; font-weight: 700; color: var(--geo-text, #1e293b); min-width: 18px; text-align: right; }
.apo-content-label { font-size: 12px; color: var(--gray-500); }
.apo-zero .apo-content-value { color: #cbd5e1; }
.apo-zero .apo-content-label { color: #cbd5e1; }
.apo-zero-critical .apo-content-value { color: #dc2626; font-weight: 800; }
.apo-zero-critical .apo-content-label { color: #dc2626; }
.apo-trust-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.apo-trust-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 6px; white-space: nowrap; }
.apo-trust-pass { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.apo-trust-fail { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.apo-trust-warn { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.apo-content-source { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.apo-content-source-ok { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.apo-content-source-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.apo-metric-discrepancy { font-size: 11px; color: #d97706; margin-top: 2px; }
.apo-schema { font-size: 12px; color: var(--gray-500); }
.apo-schema-more { color: var(--gray-400); font-size: 11px; }
.apo-schema-none { color: #d97706; }
.apo-allpass { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 10px 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.apo-allpass-icon { color: #16a34a; font-size: 16px; font-weight: 700; }
.apo-allpass-text { font-size: 13px; font-weight: 600; color: #16a34a; }

.analyzer-bot-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.analyzer-bot-table th, .analyzer-bot-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-color, #e5e7eb); text-align: left; }
.analyzer-bot-table th { background: var(--bg-secondary, #f9fafb); font-weight: 600; }

.analyzer-heading-outline { padding: 12px 16px; background: var(--bg-secondary, #f9fafb); border-radius: 8px; border: 1px solid var(--border-color, #e5e7eb); margin-bottom: 8px; }

.analyzer-rec-item { padding: 8px 12px; border-bottom: 1px solid var(--border-color, #e5e7eb); font-size: 14px; line-height: 1.5; }
.analyzer-rec-source { display: inline-block; background: var(--bg-secondary, #f3f4f6); color: var(--text-muted, #6b7280); font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; margin-right: 6px; text-transform: uppercase; }

.analyzer-history-chip { display: inline-flex; flex-direction: column; padding: 6px 12px; background: var(--bg-secondary, #f9fafb); border: 1px solid var(--border-color, #e5e7eb); border-radius: 8px; cursor: pointer; font-size: 12px; text-align: left; }
.analyzer-history-chip:hover { border-color: var(--color-primary); }
.ahc-url { font-weight: 600; color: var(--text-primary); }
.ahc-meta { color: var(--text-muted, #6b7280); font-size: 11px; }

/* ── Alert Banner ───────────────────────────────────────────────────────── */
.ov-alert-banner {
    margin: 0 0 16px;
    border: 1px solid #fbbf24;
    border-radius: 10px;
    background: #fffbeb;
    padding: 12px 16px;
    animation: fadeInDown .25s ease;
}
@keyframes fadeInDown {
    from { opacity:0; transform:translateY(-8px); }
    to   { opacity:1; transform:translateY(0); }
}
.ov-alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ov-alert-title {
    font-weight: 600;
    font-size: .93rem;
    color: #92400e;
}
.ov-alert-dismiss {
    font-size: .8rem;
    border: 1px solid #fbbf24;
    background: #fff;
    color: #92400e;
    border-radius: 6px;
    padding: 2px 10px;
    cursor: pointer;
    transition: background .15s;
}
.ov-alert-dismiss:hover { background: #fef3c7; }
.ov-alert-list { display: flex; flex-direction: column; gap: 4px; }
.ov-alert-item {
    font-size: .83rem;
    color: #78350f;
    padding: 3px 0;
    border-bottom: 1px solid #fde68a;
}
.ov-alert-item:last-child { border-bottom: none; }
.ov-alert-label { font-weight: 600; }

/* ── AI Crawler Panel ───────────────────────────────────────────────────── */
.crawler-panel {
    margin-top: 28px;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    background: var(--color-surface, #fff);
    overflow: hidden;
}
.crawler-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    background: var(--color-bg, #f8fafc);
    flex-wrap: wrap;
    gap: 8px;
}
.crawler-panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text, #1e293b);
}
.crawler-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm-outline {
    font-size: .8rem;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 7px;
    background: #fff;
    color: var(--color-text, #1e293b);
    padding: 4px 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.btn-sm-outline:hover { border-color: var(--color-primary, #4f46e5); background: #f0f0ff; }
.btn-crawler-cf:hover  { border-color: #f6821f; background: #fff8f2; }
.btn-crawler-upload:hover { border-color: #0ea5e9; background: #f0f9ff; }
#crawler-panel-body { padding: 16px 20px; }
.crawler-loading { color: var(--gray-500); font-size: .9rem; padding: 8px 0; }
.crawler-empty { color: var(--gray-500); font-size: .9rem; line-height: 1.6; }
.crawler-empty strong { color: var(--color-text, #1e293b); }
.crawler-meta { font-size: .78rem; color: var(--gray-400); margin-bottom: 10px; }
.crawler-table-wrap { overflow-x: auto; }
.crawler-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.crawler-table th {
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid var(--color-border, #e2e8f0);
    padding: 6px 10px;
    white-space: nowrap;
}
.crawler-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}
.crawler-table tr:last-child td { border-bottom: none; }
.crawler-table tr:hover td { background: #f8fafc; }
.crawler-bot-icon { margin-right: 4px; }
.crawler-pages-row td {
    font-size: .78rem;
    color: var(--gray-500);
    padding: 2px 10px 8px;
    background: #fafbff;
}
.crawler-pages-label { font-weight: 600; margin-right: 4px; }
.crawler-pages-row code {
    background: #eef2ff;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: .76rem;
    color: #4338ca;
}
.crawler-status {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: .76rem;
    font-weight: 600;
}
.crawler-status-active  { background: #dcfce7; color: #15803d; }
.crawler-status-blocked { background: #fee2e2; color: #b91c1c; }
.crawler-status-unseen  { background: #f1f5f9; color: var(--gray-500); }

/* Modals */
.crawler-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn .15s ease;
}
.crawler-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
}
.crawler-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.crawler-modal-header h4 { margin: 0; font-size: 1.05rem; color: var(--gray-800); }
.crawler-modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.crawler-modal-close:hover { color: var(--gray-800); }
.crawler-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.crawler-modal-desc { margin: 0; font-size: .85rem; color: var(--gray-500); line-height: 1.5; }
.crawler-modal-body label {
    font-size: .83rem;
    font-weight: 600;
    color: #374151;
    margin-top: 4px;
}
.field-note { font-weight: 400; color: var(--gray-400); font-size: .8rem; }
.crawler-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: .9rem;
    box-sizing: border-box;
    transition: border-color .15s;
}
.crawler-input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.crawler-file-input { padding: 7px; cursor: pointer; }
.crawler-modal-status { min-height: 20px; font-size: .85rem; }
.crawler-modal-error   { color: #dc2626; }
.crawler-modal-success { color: #15803d; }
.crawler-modal-info    { color: #0369a1; }
.crawler-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.btn-crawler-primary {
    background: var(--color-primary, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-crawler-primary:hover:not(:disabled) { background: #4338ca; }
.btn-crawler-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-crawler-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: .9rem;
    cursor: pointer;
    transition: border-color .15s;
}
.btn-crawler-secondary:hover { border-color: #9ca3af; }

/* ── Client Dashboard ───────────────────────────────────── */
.dash-stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:14px;margin-bottom:20px}
.dash-stat-card{background:var(--geo-surface,#fff);border:1px solid var(--geo-border,#e2e8f0);border-radius:12px;padding:18px 20px;text-align:center}
.dash-stat-alert{border-color:#fecaca;background:#fef2f2}
.dash-stat-value{font-size:2rem;font-weight:800;color:var(--geo-primary,#6366f1);line-height:1}
.dash-stat-alert .dash-stat-value{color:#dc2626}
.dash-stat-label{font-size:12px;font-weight:600;color:var(--geo-text-muted,#64748b);margin-top:4px;text-transform:uppercase;letter-spacing:.5px}
.dash-table-wrap{background:var(--geo-surface,#fff);border:1px solid var(--geo-border,#e2e8f0);border-radius:12px;overflow-x:auto}
.dash-table{width:100%;border-collapse:collapse;font-size:13px}
.dash-table th{padding:10px 14px;text-align:left;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--geo-text-muted,#64748b);background:var(--geo-surface-alt,#f8fafc);border-bottom:1px solid var(--geo-border,#e2e8f0)}
.dash-table td{padding:10px 14px;border-bottom:1px solid var(--geo-border,#e2e8f0)}
.dash-table tr:hover td{background:#f8fafc}
.dash-table tr:last-child td{border-bottom:none}
.dash-actions{display:flex;gap:6px}
.dash-action-btn{padding:3px 10px;border:1px solid var(--geo-border,#e2e8f0);border-radius:6px;font-size:12px;font-weight:600;background:#fff;color:var(--geo-primary,#6366f1);cursor:pointer}
.dash-action-btn:hover{background:var(--geo-surface-alt,#f8fafc)}
.dash-alert-badge{display:inline-block;background:#fee2e2;color:#dc2626;font-size:11px;font-weight:700;padding:1px 6px;border-radius:99px;margin-left:6px}
.dash-sched-badge{font-size:12px;margin-left:4px;cursor:help}

/* ── What Changed Diff Banner ───────────────────────────── */
.diff-banner{background:var(--geo-surface,#fff);border:1px solid var(--geo-border,#e2e8f0);border-radius:12px;margin:12px 0 16px;overflow:hidden}
.diff-banner-header{display:flex;align-items:center;padding:12px 16px;background:var(--geo-surface-alt,#f8fafc);border-bottom:1px solid var(--geo-border,#e2e8f0)}
.diff-banner-title{font-size:14px;font-weight:700;color:var(--geo-primary,#6366f1)}
.diff-banner-date{font-size:12px;color:var(--geo-text-muted,#94a3b8);margin-left:12px}
.diff-banner-close{margin-left:auto;background:none;border:none;font-size:18px;color:#94a3b8;cursor:pointer;padding:0 4px}
.diff-banner-close:hover{color:#1e293b}
.diff-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--geo-border,#e2e8f0)}
.diff-metric{background:var(--geo-surface,#fff);padding:14px 16px;text-align:center}
.diff-metric-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--geo-text-muted,#64748b);margin-bottom:6px}
.diff-metric-values{display:flex;align-items:center;justify-content:center;gap:8px;font-size:18px;font-weight:700}
.diff-metric-prev{color:#94a3b8}
.diff-metric-arrow{font-size:12px}
.diff-metric-curr{color:var(--geo-text,#1e293b)}
.diff-metric-delta{font-size:13px;font-weight:600;margin-top:4px}
.diff-up .diff-metric-arrow,.diff-up .diff-metric-delta{color:#059669}
.diff-down .diff-metric-arrow,.diff-down .diff-metric-delta{color:#dc2626}
.diff-same .diff-metric-arrow,.diff-same .diff-metric-delta{color:#94a3b8}
.diff-services{padding:12px 16px;display:flex;flex-wrap:wrap;gap:8px}
.diff-service-item{display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:8px;font-size:13px}
.diff-gained{background:#d1fae5;color:#065f46}
.diff-lost{background:#fee2e2;color:#991b1b}
.diff-changed{background:#e0e7ff;color:#3730a3}
.diff-service-icon{font-size:12px}
.diff-service-name{font-weight:600}
.diff-no-changes{padding:12px 16px;font-size:13px;color:var(--geo-text-muted,#94a3b8);text-align:center}
/* ── Tab Badge ──────────────────────────────────────────── */
.tab-badge-soon{display:inline-block;padding:1px 6px;font-size:10px;font-weight:700;background:#dbeafe;color:#1d4ed8;border-radius:99px;margin-left:4px;vertical-align:middle;letter-spacing:.3px}

/* ══════════════════════════════════════════════════════════
   AI CONTENT BRIEF TAB
   ══════════════════════════════════════════════════════════ */

.brief-mode-btn {
    padding: 8px 16px; border: 1px solid #d1d5db; border-radius: 6px;
    background: #fff; font-size: 13px; font-weight: 500; color: #475569; cursor: pointer;
}
.brief-mode-btn.active {
    background: var(--color-primary, #1E3A8A); color: #fff; border-color: var(--color-primary, #1E3A8A);
}

.brief-strategy-box {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 16px;
    border-left: 3px solid #2563eb;
}
.brief-strategy-box p { font-size: 15px; color: var(--gray-800); line-height: 1.6; margin: 0; }
.brief-cached-badge {
    display: inline-block; margin-top: 8px; font-size: 11px; color: var(--gray-500);
    background: #f1f5f9; padding: 2px 8px; border-radius: 4px;
}

.brief-section {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 12px;
    overflow-x: auto;
}
.brief-section-label {
    font-size: 11px;
    font-weight: 600;
    color: #737373;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
}

.brief-metric-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.brief-metric-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; text-align: center;
}
.brief-metric-value { font-size: 20px; font-weight: 700; color: var(--color-primary, #1E3A8A); }
.brief-metric-label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.brief-metric-sub { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

.brief-outline-list { display: flex; flex-direction: column; gap: 12px; }
.brief-outline-item { display: flex; gap: 12px; align-items: flex-start; }
.brief-outline-content { flex: 1; }
.brief-outline-num {
    width: 28px; height: 28px; border-radius: 50%; background: var(--color-primary, #1E3A8A);
    color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0; margin-top: 2px;
}
.brief-outline-heading { font-size: 15px; font-weight: 600; color: var(--gray-800); }
.brief-outline-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.brief-outline-coverage { font-size: 13px; color: #475569; margin-top: 4px; }
.brief-answer-capsule {
    font-size: 13px; color: #0369a1; background: #f0f9ff; border-left: 3px solid #38bdf8;
    padding: 6px 10px; margin-top: 6px; border-radius: 0 6px 6px 0;
}

.brief-badge {
    display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px;
    border-radius: 4px; text-transform: uppercase;
}
.brief-badge-question_h2 { background: #dbeafe; color: #1d4ed8; }
.brief-badge-statement_h2 { background: #e0e7ff; color: #4338ca; }
.brief-badge-how_to_h2 { background: #dcfce7; color: #166534; }
.brief-badge-muted { background: #f1f5f9; color: var(--gray-500); font-weight: 400; display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.brief-badge-source { background: #fef3c7; color: #92400e; }
.brief-badge-high { background: #fee2e2; color: #991b1b; }
.brief-badge-medium { background: #fef9c3; color: #854d0e; }
.brief-badge-low { background: #f0fdf4; color: #166534; }
.brief-badge-required { background: #fee2e2; color: #991b1b; }
.brief-badge-recommended { background: #dbeafe; color: #1d4ed8; }

.brief-question-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px 16px; margin-bottom: 8px;
}
.brief-question-text { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.brief-question-meta { display: flex; gap: 6px; margin-top: 6px; }
.brief-question-guidance { font-size: 13px; color: #475569; margin-top: 6px; }

.brief-entity-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.brief-entity-chip {
    padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 500; cursor: default;
}
.brief-entity-critical { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.brief-entity-recommended { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.brief-entity-optional { background: #fff; color: var(--gray-400); border: 1px solid #e2e8f0; }

.brief-stat-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px 16px; margin-bottom: 8px;
    border-left: 3px solid #e2e8f0;
}
.brief-stat-must_include { border-left-color: #ef4444; }
.brief-stat-differentiation { border-left-color: #f59e0b; }
.brief-stat-original_data_opportunity { border-left-color: #22c55e; }
.brief-stat-type { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--gray-500); }
.brief-stat-desc { font-size: 14px; font-weight: 500; color: var(--gray-800); margin-top: 4px; }
.brief-stat-why { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

.brief-ai-summary { font-size: 14px; color: var(--gray-800); line-height: 1.5; margin-bottom: 12px; }
.brief-ai-opps { margin-bottom: 12px; }
.brief-ai-opp { font-size: 13px; color: #166534; margin-bottom: 6px; }
.brief-engine-gaps { display: flex; flex-direction: column; gap: 8px; }
.brief-engine-gap {
    background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px;
    padding: 12px 16px; font-size: 13px;
}
.brief-gap-action { color: #0369a1; margin-top: 4px; }

.brief-score-row {
    display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: #475569;
}
.brief-gap-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.brief-gap-table th { text-align: left; padding: 8px 12px; background: #f8fafc; color: #475569; font-weight: 600; border-bottom: 2px solid var(--gray-200); }
.brief-gap-table td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; }

.brief-schema-item { padding: 8px 0; font-size: 13px; color: var(--gray-700); }
.brief-schema-item .brief-badge { margin-right: 8px; }

.brief-bulk-item { border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.brief-bulk-item.brief-bulk-failed { border-color: #fecaca; }
.brief-bulk-header {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer;
    background: #f8fafc; font-size: 14px;
}
.brief-bulk-header:hover { background: #f1f5f9; }
.brief-bulk-num { font-weight: 700; color: var(--gray-500); min-width: 24px; }
.brief-bulk-kw { font-weight: 600; color: var(--gray-800); flex: 1; }
.brief-bulk-expand { color: var(--gray-400); margin-left: auto; }
.brief-bulk-body { padding: 16px; border-top: 1px solid #e2e8f0; }

.brief-history-items { display: flex; flex-direction: column; }
.brief-history-item {
    display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 6px;
    cursor: pointer; font-size: 13px;
}
.brief-history-item:hover { background: #f1f5f9; }
.brief-history-kw { font-weight: 600; color: var(--gray-800); flex: 1; }
.brief-history-domain { color: var(--gray-500); }
.brief-history-date { color: var(--gray-400); font-size: 12px; }

@media (max-width: 640px) {
    .brief-metric-cards { grid-template-columns: repeat(2, 1fr); }
    .brief-outline-item { flex-direction: column; gap: 4px; }
    .brief-outline-num { margin-bottom: -4px; }
}

/* ══════════════════════════════════════════════════════════
   DARK MODE
   ══════════════════════════════════════════════════════════ */

/* ── Toggle button ── */
.dark-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
    padding: 0;
}
.dark-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-300);
}
/* Light mode: show moon, hide sun */
.dark-toggle .dt-sun  { display: none; }
.dark-toggle .dt-moon { display: block; }
/* Dark mode: show sun, hide moon */
html[data-theme="dark"] .dark-toggle .dt-sun  { display: block; }
html[data-theme="dark"] .dark-toggle .dt-moon { display: none; }

/* ── CSS variable overrides ── */
html[data-theme="dark"] {
    --color-primary:       #93c5fd;
    --color-primary-light: #60a5fa;
    --color-accent:        #3b82f6;
    --color-accent-hover:  #2563eb;
    --color-accent-light:  #1e3a5f;
    --color-success:       #34d399;
    --color-success-bg:    #042f1a;
    --color-warning:       #fbbf24;
    --color-warning-bg:    #1c1200;
    --color-danger:        #f87171;
    --color-danger-bg:     #2d0a0a;
    --color-info:          #60a5fa;
    --color-info-bg:       #0c1a2e;
    --gray-50:             #1e293b;
    --gray-100:            #1e293b;
    --gray-200:            #334155;
    --gray-300:            #475569;
    --gray-400:            #64748b;
    --gray-500:            #94a3b8;
    --gray-600:            #cbd5e1;
    --gray-700:            #e2e8f0;
    --gray-800:            #f1f5f9;
    --gray-900:            #f8fafc;
    color-scheme: dark;
}

/* ── Body & page ── */
html[data-theme="dark"] body {
    background-color: #0f172a;
    color: #e2e8f0;
}

/* ── Main surfaces (cards, sections, panels) ── */
html[data-theme="dark"] .geo-form-section,
html[data-theme="dark"] .geo-results-section,
html[data-theme="dark"] .notice {
    background: #1e293b;
    border-color: var(--gray-700);
}

/* ── Tab bar ── */
html[data-theme="dark"] .geo-main-tabs {
    background: #1e293b;
    border-color: var(--gray-700);
}
html[data-theme="dark"] .geo-main-tab {
    color: var(--gray-400);
}
html[data-theme="dark"] .geo-main-tab:hover:not(.active) {
    color: #e2e8f0;
    background: #334155;
}
html[data-theme="dark"] .geo-main-tab.active {
    background: #0f172a;
    color: #93c5fd;
    border-bottom-color: #0f172a;
}

/* ── Form inputs & selects ── */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background: #1e293b;
    color: #e2e8f0;
    border-color: var(--gray-700);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #94a3b8;
}
html[data-theme="dark"] select option {
    background: #1e293b;
    color: #e2e8f0;
}

/* ── Tables ── */
html[data-theme="dark"] table th {
    background: #1e293b;
    color: var(--gray-400);
    border-color: var(--gray-700);
}
html[data-theme="dark"] table td {
    border-color: var(--gray-700);
    color: #e2e8f0;
}
html[data-theme="dark"] table tr:hover td {
    background: #1e293b;
}
html[data-theme="dark"] .geo-results-table th,
html[data-theme="dark"] .geo-results-table td {
    border-color: var(--gray-700);
}

/* ── Competitor comparison ── */
html[data-theme="dark"] .competitor-table th {
    background: #0c1a2e;
}
html[data-theme="dark"] .cited-row td,
html[data-theme="dark"] .not-cited-row td {
    background: transparent;
}

/* ── Result cards & summary bars ── */
html[data-theme="dark"] .geo-summary-bar,

/* ── Content Brief: Floating Action Bar (light mode) ─────────────────────── */
.geo-floating-bar {
    background: #fff;
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    position: sticky;
    top: 8px;
    z-index: 10;
}
html[data-theme="dark"] .geo-floating-bar {
    background: #1e293b;
    border-color: var(--gray-700);
}
html[data-theme="dark"] .geo-export-btn {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}
html[data-theme="dark"] .geo-export-btn:hover {
    background: #475569;
}

/* ── Metric / stat cards ── */
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .brief-metric-card,
html[data-theme="dark"] .brief-question-card,
html[data-theme="dark"] .brief-stat-card,
html[data-theme="dark"] .brief-bulk-item,
html[data-theme="dark"] .brief-engine-gap {
    background: #1e293b;
    border-color: var(--gray-700);
}

/* ── Brief-specific ── */
html[data-theme="dark"] .brief-strategy-box {
    background: #1e1e2e;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 2px 8px rgba(0,0,0,0.3);
    border-left: 3px solid #3b82f6;
}
html[data-theme="dark"] .brief-strategy-box p { color: #e2e8f0; }
html[data-theme="dark"] .brief-bulk-header { background: #1e293b; }
html[data-theme="dark"] .brief-bulk-header:hover { background: #334155; }
html[data-theme="dark"] .brief-gap-table th { background: #1e293b; color: var(--gray-400); }
html[data-theme="dark"] .brief-gap-table td { border-color: var(--gray-700); }
html[data-theme="dark"] .brief-history-item:hover { background: #1e293b; }
html[data-theme="dark"] .brief-entity-chip.brief-entity-optional {
    background: #1e293b;
    border-color: var(--gray-700);
    color: var(--gray-400);
}
html[data-theme="dark"] .brief-mode-btn {
    background: #1e293b;
    border-color: var(--gray-700);
    color: var(--gray-400);
}
html[data-theme="dark"] .brief-mode-btn.active {
    background: #1e3a5f;
    color: #93c5fd;
    border-color: #3b82f6;
}

/* ── Domain Overview panel ── */
html[data-theme="dark"] .ov-card,
html[data-theme="dark"] .ov-section {
    background: #1e293b;
    border-color: var(--gray-700);
}

/* ── Content Analyzer ── */
html[data-theme="dark"] .analyzer-section,
html[data-theme="dark"] .analyzer-card {
    background: #1e293b;
    border-color: var(--gray-700);
}

/* ── Admin Dashboard ── */
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .dashboard-card {
    background: #1e293b;
    border-color: var(--gray-700);
}

/* ── Buttons — primary ── */
.geo-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, box-shadow 150ms ease;
}
.geo-submit-btn:hover {
    background: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.geo-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
html[data-theme="dark"] .geo-submit-btn {
    background: #1d4ed8;
}
html[data-theme="dark"] .geo-submit-btn:hover {
    background: #1e40af;
}

/* ── Headings ── */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4 {
    color: #93c5fd;
}

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

/* ── Borders globally ── */
html[data-theme="dark"] hr,
html[data-theme="dark"] .geo-section-divider {
    border-color: var(--gray-700);
}

/* ── Code / pre ── */
html[data-theme="dark"] code,
html[data-theme="dark"] pre {
    background: #1e293b;
    color: #e2e8f0;
    border-color: var(--gray-700);
}

/* ── Scrollbar (webkit) ── */
html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0f172a;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ── Toggle button in dark mode ── */
html[data-theme="dark"] .dark-toggle {
    border-color: var(--gray-700);
    color: var(--gray-400);
}
html[data-theme="dark"] .dark-toggle:hover {
    background: #1e293b;
    color: #e2e8f0;
}

/* ── Re-scan empty state ─────────────────────────────────── */
.brief-ai-empty {
    text-align: center;
    padding: 32px 24px;
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    border: 1px solid #fed7aa;
    border-radius: 12px;
}
.brief-ai-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.brief-ai-empty p {
    font-size: 15px;
    color: var(--gray-800);
    margin-bottom: 8px;
}
.brief-ai-empty-sub {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 16px;
}
.brief-ai-empty .geo-submit-btn {
    display: inline-block;
    width: auto;
    padding: 10px 24px;
}
html[data-theme="dark"] .brief-ai-empty {
    background: linear-gradient(135deg, #1c1200 0%, #1a1000 100%);
    border-color: #78350f;
}
html[data-theme="dark"] .brief-ai-empty p { color: #e2e8f0; }
html[data-theme="dark"] .brief-ai-empty-sub { color: var(--gray-400); }

/* ── Content Scoring Panel ───────────────────────────────── */
.brief-scoring-header h3 { font-size: 18px; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.brief-scoring-header p  { font-size: 14px; color: var(--gray-500); margin-bottom: 16px; }

#brief-draft-input {
    width: 100%; padding: 14px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 14px; font-family: 'JetBrains Mono', monospace, inherit;
    resize: vertical; min-height: 200px; line-height: 1.6; box-sizing: border-box;
    background: #fff; color: var(--gray-800);
}
#brief-draft-input:focus { border-color: var(--color-primary, #1E3A8A); outline: none; box-shadow: 0 0 0 3px rgba(30,58,138,0.1); }

.brief-scoring-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.brief-overall-score {
    display: flex; align-items: center; gap: 16px; padding: 20px 24px;
    background: #f8fafc; border-radius: 12px; margin: 24px 0;
    border: 1px solid #e2e8f0;
}
.brief-score-circle {
    width: 80px; height: 80px; border-radius: 50%; display: flex; flex-direction: column;
    align-items: center; justify-content: center; border: 4px solid #e2e8f0; flex-shrink: 0;
}
.brief-score-circle.consistency-high { border-color: #22c55e; }
.brief-score-circle.consistency-med  { border-color: #f59e0b; }
.brief-score-circle.consistency-low  { border-color: #ef4444; }
.brief-score-num   { font-size: 24px; font-weight: 800; color: var(--gray-800); line-height: 1; }
.brief-score-label { font-size: 11px; color: var(--gray-400); }
.brief-score-grade { font-size: 32px; font-weight: 800; }
.brief-score-grade.consistency-high { color: #22c55e; }
.brief-score-grade.consistency-med  { color: #f59e0b; }
.brief-score-grade.consistency-low  { color: #ef4444; }
.brief-score-summary { font-size: 14px; color: #475569; flex: 1; }

.brief-signal-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px;
}
.brief-signal-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px;
}
.brief-signal-label  { font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.brief-signal-values { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.brief-signal-yours  { font-weight: 700; color: var(--gray-800); }
.brief-signal-target { color: var(--gray-400); font-size: 11px; }
.brief-signal-bar-bg   { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.brief-signal-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.bar-good { background: #22c55e; }
.bar-warn { background: #f59e0b; }
.bar-low  { background: #ef4444; }
.brief-signal-score { font-size: 11px; color: var(--gray-400); text-align: right; margin-top: 4px; }

.brief-entity-chips    { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.brief-entity-found    { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.brief-entity-missing  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.brief-heading-check { padding: 6px 0; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.check-found   { color: #166534; }
.check-missing { color: #991b1b; }

.brief-entity-coverage,
.brief-heading-coverage,
.brief-question-coverage { margin-bottom: 24px; }

/* Dark mode — scoring panel */
html[data-theme="dark"] .brief-scoring-header h3 { color: #e2e8f0; }
html[data-theme="dark"] .brief-scoring-header p  { color: var(--gray-400); }
html[data-theme="dark"] #brief-draft-input { background: #1e293b; color: #e2e8f0; border-color: var(--gray-700); }
html[data-theme="dark"] .brief-overall-score { background: #1e293b; border-color: var(--gray-700); }
html[data-theme="dark"] .brief-score-num  { color: #f1f5f9; }
html[data-theme="dark"] .brief-score-summary { color: var(--gray-400); }
html[data-theme="dark"] .brief-signal-card { background: #1e293b; border-color: var(--gray-700); }
html[data-theme="dark"] .brief-signal-yours { color: #f1f5f9; }
html[data-theme="dark"] .brief-signal-bar-bg { background: #334155; }
html[data-theme="dark"] .brief-entity-found   { background: #052e16; color: #4ade80; border-color: #166534; }
html[data-theme="dark"] .brief-entity-missing { background: #2d0a0a; color: #f87171; border-color: #991b1b; }
html[data-theme="dark"] .brief-heading-check { border-bottom-color: var(--gray-700); }
html[data-theme="dark"] .check-found   { color: #4ade80; }
html[data-theme="dark"] .check-missing { color: #f87171; }

/* Dual sub-score gauges */
.brief-dual-gauges {
    display: flex; gap: 24px; justify-content: center; margin: 20px 0 8px;
}
.brief-sub-gauge {
    text-align: center; padding: 16px 24px; border-radius: 12px;
    background: #fff; border: 1px solid #e2e8f0; min-width: 140px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.brief-sub-gauge-ring {
    display: flex; align-items: baseline; justify-content: center; gap: 1px;
    margin-bottom: 6px;
}
.brief-sub-gauge-num {
    font-size: 24px; font-weight: 800; color: #0a0a0a; line-height: 1;
}
.brief-sub-gauge-pct {
    font-size: 14px; font-weight: 600; color: #a3a3a3;
}
.brief-sub-gauge-label {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: #a3a3a3; margin-bottom: 2px;
}
.brief-sub-gauge-detail {
    font-size: 11px; color: #a3a3a3;
}
.brief-sub-gauge.gauge-good { border-color: #22c55e; }
.brief-sub-gauge.gauge-good .brief-sub-gauge-num { color: #16a34a; }
.brief-sub-gauge.gauge-warn { border-color: #f59e0b; }
.brief-sub-gauge.gauge-warn .brief-sub-gauge-num { color: #d97706; }
.brief-sub-gauge.gauge-low  { border-color: #ef4444; }
.brief-sub-gauge.gauge-low .brief-sub-gauge-num  { color: #dc2626; }

/* Signal group headers */
.brief-signal-group { margin-bottom: 20px; }
.brief-signal-group-header {
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: #475569; margin-bottom: 10px;
    padding-left: 10px; border-left: 3px solid #6366f1;
}

/* Dark mode — dual gauges */
html[data-theme="dark"] .brief-sub-gauge { background: #1e293b; border-color: var(--gray-700); }
html[data-theme="dark"] .brief-sub-gauge-num { color: #f1f5f9; }
html[data-theme="dark"] .brief-sub-gauge.gauge-good { border-color: #22c55e; }
html[data-theme="dark"] .brief-sub-gauge.gauge-good .brief-sub-gauge-num { color: #4ade80; }
html[data-theme="dark"] .brief-sub-gauge.gauge-warn { border-color: #f59e0b; }
html[data-theme="dark"] .brief-sub-gauge.gauge-warn .brief-sub-gauge-num { color: #fbbf24; }
html[data-theme="dark"] .brief-sub-gauge.gauge-low  { border-color: #ef4444; }
html[data-theme="dark"] .brief-sub-gauge.gauge-low .brief-sub-gauge-num  { color: #f87171; }
html[data-theme="dark"] .brief-signal-group-header { color: var(--gray-400); border-left-color: #818cf8; }

@media (max-width: 640px) {
    .brief-signal-cards  { grid-template-columns: 1fr; }
    .brief-overall-score { flex-direction: column; text-align: center; }
    .brief-scoring-actions { flex-direction: column; }
    .brief-dual-gauges { flex-direction: column; align-items: center; }
    .brief-sub-gauge { min-width: 200px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   Facts & Entities v2
   ════════════════════════════════════════════════════════════════════════════ */
.brief-facts-loading { text-align: center; padding: 24px; }
.brief-facts-progress { color: var(--gray-500); font-size: 14px; margin-top: 8px; }
.brief-facts-count { font-weight: 400; color: var(--gray-500); font-size: 13px; margin-left: 8px; }

.brief-sources-row { display: flex; gap: 24px; flex-wrap: wrap; }
.brief-sources-group { min-width: 120px; }
.brief-sources-label { font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; margin-bottom: 6px; }
.brief-source-badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 12px; margin: 2px; }
.brief-source-ai { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.brief-source-web { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.brief-source-forum { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }

.brief-topic-group { border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.brief-topic-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; background: #f8fafc; }
.brief-topic-header:hover { background: #f1f5f9; }
.brief-topic-title { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.brief-topic-meta { display: flex; align-items: center; gap: 8px; }
.brief-topic-coverage { font-size: 12px; color: var(--gray-500); }
.brief-topic-chevron { color: var(--gray-400); }
.brief-topic-body { padding: 12px 16px; border-top: 1px solid #e2e8f0; }
.brief-topic-desc { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; font-style: italic; }

.brief-fact-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.brief-fact-item:last-child { border-bottom: none; }
.brief-fact-check { width: 20px; flex-shrink: 0; font-size: 14px; padding-top: 2px; }
.brief-fact-covered .brief-fact-check { color: #22c55e; }
.brief-fact-uncovered .brief-fact-check { color: #d1d5db; }
.brief-fact-content { flex: 1; min-width: 0; }
.brief-fact-text { font-size: 13px; color: var(--gray-800); line-height: 1.5; }
.brief-fact-stat-badge { display: inline-block; font-size: 10px; font-weight: 600; color: #0369a1; background: #e0f2fe; padding: 1px 6px; border-radius: 3px; margin-top: 4px; }
.brief-fact-sources { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.brief-source-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border-radius: 10px; font-size: 10px; font-weight: 600; padding: 0 4px; }
.brief-source-dot.brief-source-ai  { background: #dcfce7; color: #166534; }
.brief-source-dot.brief-source-web { background: #e2e8f0; color: #475569; }
.brief-source-dot.brief-source-geo { background: #fef3c7; color: #92400e; }

.brief-fact-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; border-left: 3px solid #e2e8f0; }
.brief-fact-frustration    { border-left-color: #ef4444; }
.brief-fact-confusion      { border-left-color: #f59e0b; }
.brief-fact-seeking_advice { border-left-color: #3b82f6; }
.brief-fact-myth           { border-left-color: #a855f7; background: #faf5ff; }
.brief-fact-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; }
.brief-fact-action { font-size: 13px; color: #0369a1; margin-top: 6px; font-style: italic; }
.brief-myth-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #7c3aed; }

.brief-entity-freq-list { display: flex; flex-wrap: wrap; gap: 6px; }
.brief-entity-freq-item { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; font-size: 12px; }
.brief-entity-freq-term { font-weight: 600; color: var(--gray-800); }
.brief-entity-freq-range { color: #0369a1; }
.brief-entity-heading { border-color: #3b82f6; background: #eff6ff; }
.brief-entity-heading-badge { font-size: 9px; font-weight: 700; color: #1d4ed8; background: #dbeafe; padding: 1px 4px; border-radius: 3px; }

.brief-gap-section { margin-bottom: 12px; border-radius: 8px; overflow: hidden; }
.brief-gap-header { font-size: 13px; font-weight: 600; padding: 10px 14px; cursor: pointer; }
.brief-gap-citability    { border: 2px solid #22c55e; background: #f0fdf4; }
.brief-gap-citability .brief-gap-header { color: #166534; background: #dcfce7; }
.brief-gap-table-stakes  { border: 1px solid #e2e8f0; }
.brief-gap-table-stakes .brief-gap-header { color: #475569; }
.brief-gap-traditional   { border: 1px solid #e2e8f0; }
.brief-gap-traditional .brief-gap-header { color: var(--gray-500); }
.brief-gap-item { font-size: 13px; color: var(--gray-800); padding: 6px 14px; border-top: 1px solid #f1f5f9; line-height: 1.5; }
.brief-ai-empty { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; color: var(--gray-500); }

/* Dark mode overrides */
html[data-theme="dark"] .brief-topic-header  { background: #1e293b; }
html[data-theme="dark"] .brief-topic-header:hover { background: #263244; }
html[data-theme="dark"] .brief-topic-title   { color: #f1f5f9; }
html[data-theme="dark"] .brief-topic-body    { border-top-color: var(--gray-700); }
html[data-theme="dark"] .brief-topic-group   { border-color: var(--gray-700); }
html[data-theme="dark"] .brief-fact-text     { color: #e2e8f0; }
html[data-theme="dark"] .brief-fact-item     { border-bottom-color: var(--gray-800); }
html[data-theme="dark"] .brief-fact-card     { background: #1e293b; border-color: var(--gray-700); }
html[data-theme="dark"] .brief-entity-freq-item { background: #1e293b; border-color: var(--gray-700); }
html[data-theme="dark"] .brief-entity-freq-term { color: #f1f5f9; }
html[data-theme="dark"] .brief-gap-table-stakes,
html[data-theme="dark"] .brief-gap-traditional { border-color: var(--gray-700); }
html[data-theme="dark"] .brief-gap-item      { color: #e2e8f0; border-top-color: var(--gray-800); }
html[data-theme="dark"] .brief-ai-empty      { background: #1e293b; border-color: #475569; }
html[data-theme="dark"] .brief-source-web    { background: #263244; color: var(--gray-400); border-color: var(--gray-700); }
html[data-theme="dark"] .brief-source-badge.brief-source-web { background: #263244; border-color: var(--gray-700); }

/* ── Content Brief v3 Upgrades ── */

/* AI Extractability Checklist */
.brief-checklist { display: flex; flex-direction: column; gap: 8px; }
.brief-checklist-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; background: #fafafa; border-radius: 8px; }
.brief-checklist-required { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; background: #fee2e2; color: #991b1b; white-space: nowrap; margin-top: 2px; }
.brief-checklist-recommended { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; background: #dbeafe; color: #1e40af; white-space: nowrap; margin-top: 2px; }
.brief-checklist-content { flex: 1; }
.brief-checklist-signal { font-weight: 600; font-size: 13px; color: #1e293b; }
.brief-checklist-how { font-size: 12px; color: #64748b; margin-top: 2px; }

/* Visual Content Plan */
.brief-visual-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; }
.brief-visual-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6366f1; margin-bottom: 4px; }
.brief-visual-cols { font-size: 13px; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.brief-visual-desc { font-size: 12px; color: #475569; }
.brief-visual-why { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.brief-visual-alt { font-size: 11px; color: #94a3b8; font-style: italic; margin-top: 4px; }

/* Outline v3 — expandable cards */
.brief-outline-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px 0; }
.brief-outline-toggle:hover { background: #f8fafc; border-radius: 6px; }
.brief-outline-header-content { flex: 1; }
.brief-outline-chevron { color: #94a3b8; font-size: 12px; transition: transform 0.15s; flex-shrink: 0; }
.brief-outline-chevron-open { transform: rotate(180deg); }
.brief-outline-body { padding: 0 0 12px 42px; border-bottom: 1px solid #f1f5f9; }

/* AI Citation Tip (inline in outline) */
.brief-ai-tip { background: #eff6ff; border-left: 3px solid #3b82f6; padding: 8px 12px; font-size: 12px; color: #1e40af; border-radius: 0 4px 4px 0; margin-top: 8px; }

/* Pain point chips (inline in outline) */
.brief-outline-pains { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.brief-pain-chip { background: #fef3c7; color: #92400e; font-size: 11px; padding: 2px 8px; border-radius: 12px; }

/* Entity targets (inline in outline) */
.brief-outline-entities { font-size: 12px; color: #64748b; margin-top: 6px; }
.brief-outline-entities-label { font-weight: 600; }
.brief-entity-inline { background: #f0fdf4; color: #166534; font-size: 11px; padding: 1px 6px; border-radius: 4px; margin: 0 2px; }

/* Outline visual suggestion */
.brief-outline-visual { font-size: 11px; color: #6366f1; margin-top: 6px; }

/* Entity list v3 */
.brief-entity-list-v3 { display: flex; flex-direction: column; gap: 4px; }
.brief-entity-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.brief-entity-critical { background: #fef2f2; }
.brief-entity-recommended { background: #f8fafc; }
.brief-entity-optional { background: transparent; }
.brief-entity-term { font-weight: 600; color: #1e293b; }
.brief-entity-count { font-size: 11px; font-weight: 700; color: #059669; background: #f0fdf4; padding: 1px 6px; border-radius: 4px; }
.brief-entity-importance { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; }
.brief-entity-context { font-size: 12px; color: #64748b; margin-left: auto; max-width: 40%; text-align: right; }

/* Stat source suggestion */
.brief-stat-source { font-size: 11px; color: #6366f1; margin-top: 4px; }
.brief-stat-placement { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* Stat type badges v3 */
.brief-stat-competitor_consensus { border-left: 3px solid #d97706; }
.brief-stat-differentiation { border-left: 3px solid #059669; }
.brief-stat-freshness_signal { border-left: 3px solid #3b82f6; }

@media (max-width: 640px) {
    .brief-sources-row     { flex-direction: column; }
    .brief-entity-freq-list { gap: 4px; }
}

/* ── GSC Dashboard ──────────────────────────────────────────────────────── */
.gsc-metric-card {
    background: #fff;
    border: none;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 200ms ease, transform 200ms ease;
    position: relative;
    overflow: hidden;
}
.gsc-metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #1E3A8A;
    opacity: 0;
    transition: opacity 200ms ease;
}
.gsc-metric-card:hover::before {
    opacity: 1;
}
.gsc-metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.gsc-metric-value {
    font-size: 36px;
    font-weight: 800;
    color: #0a0a0a;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}
.gsc-metric-label {
    font-size: 11px;
    font-weight: 600;
    color: #737373;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
}
.gsc-metric-change {
    font-size: 13px;
    margin-top: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    border-radius: 20px;
}
.gsc-metric-change.up { color: #059669; }
.gsc-metric-change.down { color: #dc2626; }

.gsc-subtab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}
.gsc-subtab:hover { color: var(--gray-800); }
.gsc-subtab {
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.gsc-subtab.active {
    color: #0a0a0a;
    border-bottom-color: #0a0a0a;
    font-weight: 600;
}

.gsc-card {
    background: var(--color-surface, #fff);
    border: var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--sp-5);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition-base);
}
.gsc-card:hover {
    box-shadow: var(--shadow-sm);
}
.gsc-card-title {
    font-size: 11px;
    font-weight: 600;
    color: #737373;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 16px;
}

.gsc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.gsc-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid var(--gray-200);
    color: var(--gray-500);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.gsc-table th:hover { color: var(--gray-800); }
.gsc-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}
.gsc-table tbody tr:nth-child(even) {
    background: var(--gray-50);
}
.gsc-table tbody tr {
    transition: background var(--transition-fast);
}
.gsc-table tr:hover { background: #f8fafc; }
.gsc-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Position badges */
.gsc-pos { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.gsc-pos-1 { background: var(--color-success-bg, #dcfce7); color: #166534; }
.gsc-pos-2 { background: #fef9c3; color: #854d0e; }
.gsc-pos-3 { background: #ffedd5; color: #9a3412; }
.gsc-pos-4 { background: var(--color-danger-bg, #fee2e2); color: #991b1b; }

/* Action buttons in tables */
.gsc-action-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #1E3A8A;
    color: #1E3A8A;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.gsc-action-btn {
    transition: all var(--transition-fast);
}
.gsc-action-btn:hover {
    background: #0a0a0a;
    color: #fff;
    border-color: #0a0a0a;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.gsc-action-btn--danger {
    border-color: #ef4444;
    color: #ef4444;
}
.gsc-action-btn--danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
.gsc-conn-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.gsc-conn-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    padding: 3px 10px;
}

/* Distribution bar */
.gsc-dist-bar {
    display: flex;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}
.gsc-dist-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    min-width: 30px;
}
.gsc-dist-1 { background: #059669; }
.gsc-dist-2 { background: #eab308; }
.gsc-dist-3 { background: #f97316; }
.gsc-dist-4 { background: #dc2626; }

.gsc-dist-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--gray-700);
}
.gsc-dist-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.gsc-dist-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Decay alert row */
.gsc-decay-row { background: #fef2f2 !important; }

/* Cannibalization warning */
.gsc-canni-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.gsc-canni-badges { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

/* URL list inside each row */
.gsc-canni-url-item { display: flex; gap: 6px; align-items: baseline; font-size: 11px; padding: 2px 0; }
.gsc-canni-url-more { display: none; }
.gsc-canni-url-dominant { color: #059669; font-weight: 600; }
.gsc-canni-url-loser    { color: #64748b; }
.gsc-canni-pos          { color: #94a3b8; font-size: 10px; white-space: nowrap; }
.gsc-canni-pct-winner   { color: #059669; font-size: 10px; font-weight: 700; }
.gsc-canni-pct-loser    { color: #dc2626; font-size: 10px; font-weight: 600; }

/* Click-split column */
.gsc-canni-split-value       { font-weight: 700; font-size: 13px; white-space: nowrap; }
.gsc-canni-split-value.gsc-canni-split-high { color: #dc2626; }
.gsc-canni-split-value.gsc-canni-split-med  { color: #d97706; }
.gsc-canni-split-value.gsc-canni-split-low  { color: #64748b; }
.gsc-canni-split-sub { font-size: 10px; color: #94a3b8; margin-top: 1px; white-space: nowrap; }

/* Show-more link */
.gsc-canni-show-more { display: block; font-size: 11px; color: #2563eb; text-decoration: none; margin-top: 3px; }
.gsc-canni-show-more:hover { text-decoration: underline; }

/* Fix buttons (override gsc-action-btn colours per fix type) */
.gsc-canni-fix-redirect  { background: #fff7ed !important; color: #c2410c !important; border-color: #fed7aa !important; }
.gsc-canni-fix-canonical { background: #eff6ff !important; color: #1d4ed8 !important; border-color: #bfdbfe !important; }
.gsc-canni-fix-merge     { background: #faf5ff !important; color: #7c3aed !important; border-color: #ddd6fe !important; }
.gsc-canni-fix-monitor   { background: #f8fafc !important; color: #94a3b8 !important; border-color: #e2e8f0 !important; }

/* Impact recovery banner */
.gsc-canni-impact-banner { background: linear-gradient(135deg, #ecfdf5, #f0fdf4); border: 1px solid #bbf7d0; border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; text-align: center; }
.gsc-canni-impact-number { font-size: 28px; font-weight: 800; color: #059669; line-height: 1; }
.gsc-canni-impact-label  { font-size: 12px; color: #64748b; margin-top: 4px; }
html[data-theme="dark"] .gsc-canni-impact-banner { background: linear-gradient(135deg, #064e3b, #065f46); border-color: #047857; }
html[data-theme="dark"] .gsc-canni-impact-number { color: #34d399; }

/* Stability badges */
.gsc-canni-stability-summary { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.gsc-canni-oscillating { display: inline-block; font-size: 11px; font-weight: 600; color: #dc2626; background: #fef2f2; padding: 1px 6px; border-radius: 3px; margin-left: 4px; }
.gsc-canni-switching   { display: inline-block; font-size: 11px; font-weight: 600; color: #ea580c; background: #fff7ed; padding: 1px 6px; border-radius: 3px; margin-left: 4px; }
.gsc-canni-new-comp    { display: inline-block; font-size: 11px; font-weight: 600; color: #d97706; background: #fffbeb; padding: 1px 6px; border-radius: 3px; margin-left: 4px; }
html[data-theme="dark"] .gsc-canni-oscillating { background: rgba(220,38,38,0.15); color: #fca5a5; }
html[data-theme="dark"] .gsc-canni-switching   { background: rgba(234,88,12,0.15);  color: #fdba74; }
html[data-theme="dark"] .gsc-canni-new-comp    { background: rgba(217,119,6,0.15);  color: #fcd34d; }

/* Brand keywords collapsed section */
.gsc-canni-brand-section { margin-top: 24px; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.gsc-canni-brand-summary { padding: 12px 16px; background: #f0fdf4; cursor: pointer; list-style: none; user-select: none; }
.gsc-canni-brand-summary::-webkit-details-marker { display: none; }
.gsc-canni-brand-label   { font-size: 13px; font-weight: 600; color: #15803d; }
.gsc-canni-brand-note    { padding: 10px 16px; font-size: 12px; color: #525252; background: #fafafa; border-top: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; }
.gsc-canni-brand-section .gsc-table { margin: 12px 16px; width: calc(100% - 32px); }

/* GEO Scan CTA banner in Content Brief */
.gsc-geo-cta {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.gsc-geo-cta-text {
    font-size: 14px;
    color: #1e40af;
    font-weight: 500;
}
.gsc-geo-cta-btn {
    padding: 8px 16px;
    background: #1E3A8A;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.gsc-geo-cta-btn:hover { background: #1e40af; }

/* ── Brief v3: GSC Panel (MISSING — used in renderBrief) ─────────────── */
.brief-gsc-panel {
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}
.brief-gsc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--gray-50, #fafafa);
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800, #1f2937);
}
.brief-gsc-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    background: #dbeafe;
    color: #1d4ed8;
    margin-left: auto;
}
.brief-gsc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}
.brief-decay-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}
.brief-entity-tag {
    background: #f1f5f9;
    color: var(--gray-600, #4b5563);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
}

/* ── Brief: VCP comparison table – scrollable wrapper ─────────────────── */
.brief-mini-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.brief-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 480px;
}
.brief-mini-table th {
    background: #f1f5f9;
    font-weight: 600;
    text-align: left;
    padding: 7px 10px;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
    white-space: nowrap;
}
.brief-mini-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: top;
}
.brief-mini-table tbody tr:last-child td { border-bottom: none; }
.brief-mini-table tbody tr:hover td { background: #f8fafc; }
html[data-theme="dark"] .brief-mini-table-wrap { border-color: #334155; }
html[data-theme="dark"] .brief-mini-table th { background: #1e293b; color: #94a3b8; border-color: #334155; }
html[data-theme="dark"] .brief-mini-table td { color: #e2e8f0; border-color: #1e293b; }
html[data-theme="dark"] .brief-mini-table tbody tr:hover td { background: #263244; }

/* ── Shimmer skeleton loading ── */
@keyframes gsc-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.gsc-skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: gsc-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
    color: transparent !important;
}
.gsc-skeleton * { visibility: hidden; }

/* ── Fade-in for loaded content ── */
@keyframes gsc-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.gsc-fade-in {
    animation: gsc-fade-in var(--transition-slow) ease forwards;
}

/* ── Truncated text with tooltip ── */
.gsc-truncate {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}
.gsc-truncate:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    background: var(--gray-900);
    color: #fff;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: var(--shadow-md);
}

/* ── Global Utility Classes (Deploy 5 — shared across all tabs) ── */

/* Color utilities */
.u-text-success { color: var(--color-success); }
.u-text-warning { color: var(--color-warning); }
.u-text-danger { color: var(--color-danger); }
.u-text-muted { color: var(--gray-400); }
.u-text-secondary { color: var(--gray-500); }
.u-text-accent { color: var(--color-accent); }
.u-text-bold { font-weight: var(--weight-semibold); }

/* Spacing utilities */
.u-mb-2 { margin-bottom: var(--sp-2); }
.u-mb-3 { margin-bottom: var(--sp-3); }
.u-mb-4 { margin-bottom: var(--sp-4); }
.u-mt-2 { margin-top: var(--sp-2); }
.u-mt-3 { margin-top: var(--sp-3); }

/* Icon alignment (most common: 13 occurrences) */
.u-icon-inline { vertical-align: -3px; flex-shrink: 0; }
.gsc-section-label { font-size: 13px; font-weight: 600; color: #64748b; margin-bottom: 8px; }

/* Empty state */
.u-empty-state { text-align: center; padding: var(--sp-5); color: var(--gray-400); }

/* Smooth transitions for all interactive elements across tabs */
.geo-card, .geo-btn, .citability-card, .ca-card {
    transition: box-shadow var(--transition-base, 200ms ease), transform var(--transition-base, 200ms ease);
}
.geo-card:hover, .citability-card:hover, .ca-card:hover {
    box-shadow: var(--shadow-md);
}

/* Table improvements for all tabs */
.geo-table tbody tr, .ov-table tbody tr, .ca-table tbody tr {
    transition: background var(--transition-fast, 120ms ease);
}


/* Content Analyzer metric card overrides */
.apo-metric-card { background: #ffffff !important; border: none !important; border-radius: 12px !important; box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04) !important; padding: 16px 20px !important; text-align: center !important; }
.apo-metric-value { font-size: 28px !important; font-weight: 800 !important; color: #0a0a0a !important; letter-spacing: -0.02em !important; }
.apo-metric-label { font-size: 11px !important; font-weight: 500 !important; color: #737373 !important; text-transform: uppercase !important; letter-spacing: 0.05em !important; margin-top: 6px !important; }


/* Content Analyzer attention box override */
.apo-alert, .analyzer-alert, [class*='attention'] { background: #fffbeb !important; border: none !important; border-left: 3px solid #d97706 !important; border-radius: 8px !important; padding: 14px 18px !important; }


/* Dashboard icon button in header (next to dark mode toggle) */
button.header-icon-btn.header-icon-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    border: 1px solid #e5e5e5 !important;
    background: #fff !important;
    color: #525252 !important;
    cursor: pointer !important;
    transition: all 150ms ease !important;
    font-size: 0 !important;
    line-height: 0 !important;
}
button.header-icon-btn.header-icon-btn:hover {
    background: #f5f5f5;
    color: #0a0a0a;
}
button.header-icon-btn.header-icon-btn.active {
    background: #eff6ff;
    color: #2563eb;
}



.geo-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 768px) {
    #gsc-metrics { grid-template-columns: repeat(2, 1fr); }
    #gsc-sub-overview > div { grid-template-columns: 1fr; }
}
/* ── tmp_deploy3: Layout & UX improvements ── */
.gsc-hidden-row { display: none; }
.gsc-show-all-wrap {
    text-align: center;
    padding: var(--sp-3);
    border-top: 1px solid var(--gray-100, #f1f5f9);
}
.gsc-show-all-btn {
    padding: 8px 24px;
}

/* Overview 3-column grid on wide screens */
@media (min-width: 1024px) {
    #gsc-sub-overview {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--sp-4);
    }
    #gsc-position-dist,
    #gsc-brand-split,
    #gsc-traffic-trend {
        grid-column: span 2;
    }
}


/* Visual Overhaul: .geo-card.not-cited:hover */
.geo-card.not-cited:hover {
    opacity: 1;
}


/* Visual Overhaul: .geo-citation-url:hover */
.geo-citation-url:hover {
    text-decoration: underline;
}


/* Visual Overhaul: .geo-citation-row:last-child */
.geo-citation-row:last-child {
    border-bottom: none;
}


/* Visual Overhaul: .ov-metric-card — hover lift removed; divider bar layout */
.ov-metric-card::before { display: none; }
.ov-metric-card:hover   { box-shadow: none; }


/* Visual Overhaul: .ov-action-card:hover */
.ov-action-card:hover {
    background: #fafafa;
}

/* ── Toast Notifications ──────────────────────────────────────────────── */
.geo-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 420px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.geo-toast-visible { transform: translateY(0); opacity: 1; }
.geo-toast-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.geo-toast-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.geo-toast-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.geo-toast-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.geo-toast-close {
    background: none; border: none; font-size: 18px; cursor: pointer;
    color: inherit; opacity: 0.6; padding: 0 4px; margin-left: auto;
}
.geo-toast-close:hover { opacity: 1; }

/* ── Keyword Cluster Cards ──────────────────────────────────────────────── */
.gsc-cluster-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
#gsc-cluster-summary {
    font-size: 14px;
    font-weight: 600;
    color: #0a0a0a;
}
.gsc-cluster-filter-group {
    display: inline-flex;
    gap: 6px;
}
.gsc-cluster-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.gsc-cluster-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.15s ease;
}
.gsc-cluster-card:hover {
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
}
.gsc-cluster-has-gap {
    border-left: 3px solid #dc2626;
}
.gsc-cluster-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.gsc-cluster-name {
    font-size: 14px;
    font-weight: 600;
    color: #0a0a0a;
    letter-spacing: -0.01em;
}
.gsc-cluster-meta {
    font-size: 12px;
    color: #737373;
    margin-top: 2px;
}
/* Cluster coverage ratio badge */
.gsc-cluster-cov { font-weight: 600; }
.gsc-cluster-cov.cov-good { color: #059669; }
.gsc-cluster-cov.cov-warn { color: #d97706; }
.gsc-cluster-cov.cov-low { color: #dc2626; }
.gsc-cluster-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}
.gsc-cluster-metric-value {
    font-size: 16px;
    font-weight: 700;
    color: #0a0a0a;
    letter-spacing: -0.02em;
}
.gsc-cluster-metric-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a3a3a3;
    margin-top: 2px;
}
.gsc-cluster-trend {
    font-size: 13px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}
.gsc-cluster-trend.up {
    color: #059669;
    background: #ecfdf5;
}
.gsc-cluster-trend.down {
    color: #dc2626;
    background: #fef2f2;
}
.gsc-cluster-top-kw {
    margin-top: 10px;
    font-size: 12px;
    color: #525252;
}
.gsc-cluster-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    align-items: center;
}
.gsc-cluster-brief-btn {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.gsc-cluster-brief-btn:hover {
    background: #1d4ed8;
    transform: translateY(-0.5px);
}
.gsc-cluster-expand-btn {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.gsc-cluster-expand-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.gsc-cluster-keywords {
    margin-top: 12px;
}
.gsc-cluster-kw-table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}
.gsc-cluster-kw-table th {
    text-align: left;
    padding: 4px 6px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    color: #737373;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.gsc-cluster-kw-table th:hover { color: #1e3a8a; background: #f8fafc; }
.gsc-th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.gsc-th-sort:hover { color: #1e3a8a !important; background: #f8fafc; }
.gsc-th-active { color: #1e3a8a !important; }
.gsc-cluster-kw-table th:not(:first-child),
.gsc-cluster-kw-table td:not(:first-child) {
    text-align: right;
}
.gsc-cluster-kw-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #f3f4f6;
}
.gsc-cluster-gap {
    background: #fef2f2;
    border-left: 3px solid #dc2626;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #525252;
    line-height: 1.5;
}
.gsc-cluster-filter {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #525252;
    cursor: pointer;
    transition: all 0.15s ease;
}
.gsc-cluster-filter:hover {
    background: #f3f4f6;
}
.gsc-cluster-filter.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.gsc-cluster-refine-btn {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #525252;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: auto;
}
.gsc-cluster-refine-btn:hover {
    background: #f3f4f6;
}
.gsc-cluster-refine-btn.refining {
    opacity: 0.7;
    cursor: wait;
}
.gsc-cluster-refine-btn.refined {
    background: #ecfdf5;
    color: #059669;
    border-color: #059669;
}

/* ── Intent classification notice ──────────────────────────────────────────── */
#gsc-intent-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #6b7280;
    padding: 6px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 12px;
}
.gsc-intent-notice-text strong {
    color: #374151;
}
.gsc-classify-remaining-btn {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid #6366f1;
    background: #fff;
    color: #6366f1;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: auto;
    white-space: nowrap;
}
.gsc-classify-remaining-btn:hover {
    background: #eef2ff;
}
.gsc-classify-remaining-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ── Cluster stats row + Other cluster + gap keyword ─────────────────────── */
.gsc-cluster-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04);
}
.gsc-cluster-stat {
    text-align: center;
}
.gsc-cluster-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: #0a0a0a;
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gsc-cluster-stat-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a3a3a3;
    margin-top: 4px;
}
.gsc-cluster-other {
    background: #fafafa;
    border: 1px dashed #d1d5db;
    box-shadow: none;
}
.gsc-cluster-kw-gap {
    color: #dc2626;
    font-weight: 600;
}

/* ── Progressive loading indicators ──────────────────────────────────────── */
.gsc-section-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
    color: #737373;
    margin-bottom: 16px;
    border: 1px solid #f0f0f0;
}
.gsc-loading-dots {
    display: flex;
    gap: 4px;
}
.gsc-loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2563eb;
    animation: gscDotPulse 1.2s ease-in-out infinite;
}
.gsc-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.gsc-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes gscDotPulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}
.gsc-card-loading .gsc-card-body {
    min-height: 60px;
    position: relative;
}
.gsc-card-loading .gsc-card-body::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f8f9fb 25%, #f0f1f3 50%, #f8f9fb 75%);
    background-size: 200% 100%;
    animation: gscShimmer 1.5s infinite;
    border-radius: 6px;
}
@keyframes gscShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* ── Content Brief: Framework Stat Strip ──────────────────────────────────── */
.brief-framework-strip {
    display: grid;
    grid-template-columns: 140px 1fr 120px 1fr;
    gap: 0;
    align-items: start;
}
.brief-fw-col {
    padding: 0 16px;
    border-left: 1px solid #f0f0f0;
}
.brief-fw-col:first-child {
    padding-left: 0;
    border-left: none;
}
.brief-fw-value-lg {
    font-size: 28px;
    font-weight: 800;
    color: #0a0a0a;
    letter-spacing: -0.03em;
    line-height: 1;
}
.brief-fw-value {
    font-size: 14px;
    font-weight: 600;
    color: #0a0a0a;
    line-height: 1.4;
}
.brief-fw-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a3a3a3;
    margin-top: 4px;
}
.brief-fw-sub {
    font-size: 11px;
    color: #737373;
    margin-top: 4px;
    line-height: 1.3;
}
@media (max-width: 768px) {
    .brief-framework-strip {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .brief-fw-col {
        border-left: none;
        padding-left: 0;
        padding-bottom: 12px;
        border-bottom: 1px solid #f0f0f0;
    }
}

/* ── AI Visibility Score ──────────────────────────────────────────────── */
.geo-visibility-hero {
    margin-bottom: 24px; padding: 24px;
    background: #fff; border: 1px solid #e5e5e5; border-radius: 12px;
}
.geo-visibility-section { margin-bottom: 20px; }
.geo-visibility-gauge { display: flex; align-items: center; gap: 20px; }
.geo-gauge-ring {
    width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0;
    background: conic-gradient(var(--gauge-color) calc(var(--gauge-pct) * 1%), #f0f0f0 0);
    display: flex; align-items: center; justify-content: center;
}
.geo-gauge-inner {
    width: 96px; height: 96px; border-radius: 50%; background: #fff;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.geo-visibility-score { font-size: 36px; font-weight: 800; line-height: 1; }
.geo-visibility-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: #a3a3a3; margin-top: 2px;
}
.geo-visibility-title { font-size: 16px; font-weight: 700; color: #0a0a0a; margin-bottom: 4px; }
.geo-visibility-subtitle { font-size: 13px; color: #737373; }
.geo-visibility-meta { display: flex; flex-direction: column; }

/* ── Competitor Bar Chart ─────────────────────────────────────────────── */
.geo-comp-chart { border-top: 1px solid #f0f0f0; padding-top: 16px; }
.geo-comp-chart-title {
    font-size: 13px; font-weight: 700; color: #525252;
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px;
}
.geo-comp-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.geo-comp-bar-label {
    width: 180px; font-size: 12px; color: #525252; text-align: right;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0;
}
.geo-comp-bar-track { flex: 1; height: 20px; background: #fafafa; border-radius: 4px; overflow: hidden; }
.geo-comp-bar { height: 20px; border-radius: 4px; transition: width 0.3s ease; }
.geo-comp-bar-you { background: #2563eb; }
.geo-comp-bar-other { background: #d1d5db; }
.geo-comp-score { font-size: 13px; font-weight: 700; color: #0a0a0a; min-width: 30px; }
.geo-comp-badge-you {
    display: inline-block; font-size: 9px; font-weight: 700;
    background: #2563eb; color: #fff; padding: 1px 5px; border-radius: 3px;
    text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle; margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — MISSING OVERRIDES (appended)
   All sections: Domain Overview, Content Analyzer, Citability,
   Opportunity Finder, Brief v3, GEO Scan misc
   ═══════════════════════════════════════════════════════════════ */

/* ── Domain Overview: metric bar (flex divider layout) ── */
html[data-theme="dark"] .ov-metrics-bar { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .ov-metric-card { background: none; box-shadow: none; border-right-color: #334155; }
html[data-theme="dark"] .ov-metric-value { color: #f1f5f9; }
html[data-theme="dark"] .ov-metric-label { color: #64748b; }
html[data-theme="dark"] .ov-metric-sub   { color: #475569; }

/* ── Domain Overview: chart + table wrappers ── */
html[data-theme="dark"] .ov-chart-wrap  { background: #1e293b; box-shadow: 0 0 0 1px rgba(255,255,255,0.06); }
html[data-theme="dark"] .ov-table-wrap  { background: #1e293b; box-shadow: 0 0 0 1px rgba(255,255,255,0.06); }
html[data-theme="dark"] .ov-section-title { color: #94a3b8; border-bottom-color: #334155; }
html[data-theme="dark"] .ov-th           { background: none; color: #94a3b8; border-bottom-color: #334155; }
html[data-theme="dark"] .ov-td           { color: #cbd5e1; border-bottom-color: #1e293b; }
html[data-theme="dark"] .ov-td-num       { color: #f1f5f9; }
html[data-theme="dark"] .ov-kw-text      { color: #e2e8f0; }
html[data-theme="dark"] .ov-table tr:hover .ov-td { background: #263244; }
html[data-theme="dark"] .ov-table tr:last-child .ov-td { border-bottom: none; }

/* ── Domain Overview: mini charts, sov, competitor cards ── */
html[data-theme="dark"] .ov-mini-chart-card  { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .ov-mini-chart-title { color: #94a3b8; }
html[data-theme="dark"] .ov-sov-card         { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .ov-comp-table-card  { background: #1e293b; border-color: #334155; }

/* ── Domain Overview: callout + action cards ── */
html[data-theme="dark"] .ov-callout         { background: #1a2744; border-color: #334155; }
html[data-theme="dark"] .ov-callout-title   { color: #e2e8f0; }
html[data-theme="dark"] .ov-callout-list    { color: #cbd5e1; }
html[data-theme="dark"] .ov-actions         { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .ov-actions-header  { background: #263244; border-bottom-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .ov-actions-header:hover { background: #2d3a52; }
html[data-theme="dark"] .ov-action-card     { border-bottom-color: #334155; }
html[data-theme="dark"] .ov-action-card:hover { background: #263244; }

/* ── Domain Overview: pills ── */
html[data-theme="dark"] .ov-pill { background: #263244; color: #94a3b8; }
html[data-theme="dark"] .ov-pill:hover { background: #334155; color: #e2e8f0; }
html[data-theme="dark"] .ov-pill.active { background: #e2e8f0; color: #0f172a; }

/* ── Content Analyzer: page overview metric cards ── */
html[data-theme="dark"] .apo-metric-card  { background: #1e293b !important; box-shadow: 0 0 0 1px rgba(255,255,255,0.06) !important; }
html[data-theme="dark"] .apo-metric-value { color: #f1f5f9 !important; }
html[data-theme="dark"] .apo-metric-label { color: #94a3b8 !important; }
html[data-theme="dark"] .apo-header       { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .apo-header-title { color: #e2e8f0; }
html[data-theme="dark"] .apo-header-desc  { color: #94a3b8; }

/* ── Content Analyzer: citability / rec cards ── */
html[data-theme="dark"] .citability-table-wrap    { background: #1e293b; }
html[data-theme="dark"] .citability-table thead th { background: #263244; color: #94a3b8; border-bottom-color: #334155; }
html[data-theme="dark"] .citability-table tbody td { border-bottom-color: #334155; color: #cbd5e1; }
html[data-theme="dark"] .recommendations { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .rec-item  { background: #263244; box-shadow: none; }
html[data-theme="dark"] .rec-card  { background: #263244; box-shadow: none; }
html[data-theme="dark"] .rec-card p, html[data-theme="dark"] .rec-item p { color: #cbd5e1; }

/* ── Opportunity Finder: filter controls ── */
html[data-theme="dark"] .opp-vol-select   { background: #1e293b; color: #e2e8f0; border-color: #475569; }
html[data-theme="dark"] .opp-section-pill { background: #263244; color: #94a3b8; border-color: #475569; }
html[data-theme="dark"] .opp-section-pill.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
html[data-theme="dark"] .opp-tier-chip    { background: #263244; color: #94a3b8; border-color: #475569; }
html[data-theme="dark"] .opp-tier-chip.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
html[data-theme="dark"] .opp-tier-empty   { background: #1e293b; border-color: #334155; color: #94a3b8; }
html[data-theme="dark"] .opp-tier-section { background: #1a2233; }
html[data-theme="dark"] .opp-tier-header  { color: #e2e8f0; border-bottom-color: #334155; }

/* ── Brief v3: checklist + visual + outline ── */
html[data-theme="dark"] .brief-checklist-item    { background: #263244; }
html[data-theme="dark"] .brief-checklist-signal  { color: #e2e8f0; }
html[data-theme="dark"] .brief-checklist-how     { color: #94a3b8; }
html[data-theme="dark"] .brief-visual-card       { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .brief-visual-cols       { color: #e2e8f0; }
html[data-theme="dark"] .brief-outline-toggle:hover { background: #263244; }
html[data-theme="dark"] .brief-outline-body      { border-bottom-color: #334155; }
html[data-theme="dark"] .brief-entity-critical   { background: #2d1515; }
html[data-theme="dark"] .brief-entity-recommended { background: #1e293b; }
html[data-theme="dark"] .brief-entity-row        { color: #e2e8f0; }
html[data-theme="dark"] .brief-entity-term       { color: #f1f5f9; }

/* ── GEO Scan: history pagination, visibility gauge ── */
html[data-theme="dark"] .scan-history-pagination button { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .scan-history-pagination button:hover { background: #263244; }
html[data-theme="dark"] .geo-gauge-inner  { background: #1e293b; }
html[data-theme="dark"] .geo-comp-bar-track { background: #263244; }
html[data-theme="dark"] .geo-comp-bar-label { color: #94a3b8; }
html[data-theme="dark"] .geo-comp-chart-title { color: #94a3b8; }
html[data-theme="dark"] .geo-comp-chart   { border-top-color: #334155; }
html[data-theme="dark"] .geo-gauge-ring   { background: conic-gradient(var(--gauge-color) calc(var(--gauge-pct) * 1%), #263244 0); }
html[data-theme="dark"] .geo-visibility-title    { color: #f1f5f9; }
html[data-theme="dark"] .geo-visibility-subtitle { color: #94a3b8; }

/* ── GSC missing overrides ── */
html[data-theme="dark"] .gsc-modal-content { background: #1e293b; color: #e2e8f0; }
html[data-theme="dark"] .gsc-canni-brand-note { background: #263244; color: #94a3b8; border-color: #334155; }

/* ── Brief AI tip / pain chip / inline entity ── */
html[data-theme="dark"] .brief-ai-tip        { background: #1a2744; border-left-color: #3b82f6; color: #93c5fd; }
html[data-theme="dark"] .brief-pain-chip     { background: #2d1e00; color: #fbbf24; }
html[data-theme="dark"] .brief-entity-inline { background: #052e16; color: #4ade80; }

/* ── Analyzer kw chip ── */
html[data-theme="dark"] .analyzer-kw-chip-gsc   { background: #1a2744; border-color: #3b4f7a; color: #93c5fd; }
html[data-theme="dark"] .analyzer-kw-chip-title { background: #0d2d1a; border-color: #1a5c38; color: #4ade80; }
html[data-theme="dark"] .analyzer-kw-warning    { background: #2d1e00; border-color: #78350f; color: #fbbf24; }

/* ═══════════════════════════════════════════════════════════════
   GEO SCAN RESULT CARDS — dark mode (was entirely missing)
   ═══════════════════════════════════════════════════════════════ */

/* ── Service result cards (article.geo-card) ── */
html[data-theme="dark"] .geo-card              { background: #1e293b; box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 2px 8px rgba(0,0,0,0.3); }
html[data-theme="dark"] .geo-card:hover        { box-shadow: 0 0 0 1px rgba(255,255,255,0.10), 0 8px 24px rgba(0,0,0,0.4); }
html[data-theme="dark"] .geo-card-header       { border-bottom-color: #334155; }
html[data-theme="dark"] .geo-card-service-name { color: #f1f5f9; }
html[data-theme="dark"] .geo-card-footer       { background: #263244; border-top-color: #334155; color: #94a3b8; }
html[data-theme="dark"] .geo-card-citation-status { border-bottom-color: #334155; }
html[data-theme="dark"] .geo-card-expand-btn   { border-color: #475569; color: #94a3b8; background: transparent; }
html[data-theme="dark"] .geo-card-expand-btn:hover { background: #263244; color: #e2e8f0; }

/* ── Citation rows inside cards ── */
html[data-theme="dark"] .geo-citation-row          { border-bottom-color: #334155; }
html[data-theme="dark"] .geo-citation-row:hover    { background: #263244; }
html[data-theme="dark"] .geo-citation-url          { color: #60a5fa; }
html[data-theme="dark"] .geo-inline-note           { color: #64748b; border-top-color: #334155; }

/* ── Overview left card: citation score ── */
html[data-theme="dark"] .geo-citation-score-card { background: #1e293b; box-shadow: 0 0 0 1px rgba(255,255,255,0.06); }
html[data-theme="dark"] .geo-score-number        { color: #f1f5f9; }
html[data-theme="dark"] .geo-score-total         { color: #64748b; }
html[data-theme="dark"] .geo-score-label         { color: #94a3b8; }
html[data-theme="dark"] .geo-score-details       { border-top-color: #334155; }
html[data-theme="dark"] .geo-score-row           { color: #94a3b8; }
html[data-theme="dark"] .geo-score-val           { color: #f1f5f9; }
html[data-theme="dark"] .geo-score-vs-competitor { border-top-color: #334155; }
html[data-theme="dark"] .geo-score-found         { color: #4ade80; }
html[data-theme="dark"] .geo-score-not-found     { color: #f87171; }

/* ── Top cited domains widget ── */
html[data-theme="dark"] .top-domains-widget  { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .top-domains-title   { color: #e2e8f0; }
html[data-theme="dark"] .top-domains-table th { color: #94a3b8; border-bottom-color: #334155; }
html[data-theme="dark"] .top-domains-table td { color: #cbd5e1; border-bottom-color: #263244; }
html[data-theme="dark"] .top-domains-table tr:last-child td { border-bottom: none; }
html[data-theme="dark"] .top-domains-table .row-you        { background: #052e16; }
html[data-theme="dark"] .top-domains-table .row-competitor { background: #2d1e00; }

/* ── Cited URLs section inside cards ── */
html[data-theme="dark"] .geo-cited-urls,
html[data-theme="dark"] .geo-competitor-cited-urls { border-top-color: #334155; }
html[data-theme="dark"] .geo-cited-urls h4,
html[data-theme="dark"] .geo-competitor-cited-urls h4 { color: #94a3b8; }
html[data-theme="dark"] .geo-cited-url-row         { border-bottom-color: #263244; }
html[data-theme="dark"] .geo-cited-url-row a       { color: #60a5fa; }

/* ── Not-cited collapsible ── */
html[data-theme="dark"] .geo-not-cited-details         { color: #64748b; }
html[data-theme="dark"] .geo-not-cited-details summary { color: #f87171; }
html[data-theme="dark"] .geo-not-cited-details p       { color: #94a3b8; }
html[data-theme="dark"] .geo-section-divider-sub h3    { color: #64748b; }

/* ── Missing-from / competitor comparison ── */
html[data-theme="dark"] .missing-from-card      { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .competitor-table th    { background: #263244; }

/* ── Fan-out widget (inside scan results) ── */
html[data-theme="dark"] .fanout-widget          { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .fanout-kw-item         { border-bottom-color: #334155; color: #cbd5e1; }
html[data-theme="dark"] .fanout-kw-link         { color: #60a5fa; }

/* ── Article Generation Panel ── */
.brief-article-panel {
    background: var(--color-surface, #fff);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
}
.brief-article-progress-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    margin-bottom: 12px;
    overflow: hidden;
}
.brief-article-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #6366f1);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.brief-article-status {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}
.brief-article-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.brief-article-content {
    font-size: 15px;
    line-height: 1.7;
    color: #1e293b;
}
.brief-article-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 12px;
    color: #0f172a;
}
.brief-article-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 8px;
}
.brief-article-content p {
    margin-bottom: 16px;
}
.brief-article-content a {
    color: #2563eb;
    text-decoration: underline;
}
.brief-article-content ul {
    padding-left: 24px;
    margin-bottom: 16px;
}
.brief-article-content li {
    margin-bottom: 6px;
}
html[data-theme="dark"] .brief-article-panel {
    background: #1e293b;
    border-color: #334155;
}
html[data-theme="dark"] .brief-article-progress-bar {
    background: #334155;
}
html[data-theme="dark"] .brief-article-status {
    color: #94a3b8;
    border-bottom-color: #334155;
}
html[data-theme="dark"] .brief-article-actions {
    border-bottom-color: #334155;
}
html[data-theme="dark"] .brief-article-content {
    color: #e2e8f0;
}
html[data-theme="dark"] .brief-article-content h2 {
    color: #f1f5f9;
}
html[data-theme="dark"] .brief-article-content h3 {
    color: #e2e8f0;
}
.brief-article-table-wrap {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.brief-article-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 480px;
}
.brief-article-table-wrap th {
    background: #f8fafc;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
    white-space: nowrap;
}
.brief-article-table-wrap td {
    padding: 9px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: top;
}
.brief-article-table-wrap tbody tr:last-child td {
    border-bottom: none;
}
.brief-article-table-wrap tbody tr:hover td {
    background: #f8fafc;
}
html[data-theme="dark"] .brief-article-table-wrap {
    border-color: #334155;
}
html[data-theme="dark"] .brief-article-table-wrap th {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}
html[data-theme="dark"] .brief-article-table-wrap td {
    color: #e2e8f0;
    border-color: #1e293b;
}
html[data-theme="dark"] .brief-article-table-wrap tbody tr:hover td {
    background: #263244;
}
html[data-theme="dark"] .brief-article-content a {
    color: #60a5fa;
}

/* ── Content Analyzer: Suggest chips + signal breakdown (dark) ── */
html[data-theme="dark"] .analyzer-kw-chip-gsc      { background: #1a2744; border-color: #3b4f7a; color: #93c5fd; }
html[data-theme="dark"] .analyzer-kw-chip-title    { background: #0d2d1a; border-color: #1a5c38; color: #4ade80; }
html[data-theme="dark"] .analyzer-kw-chip-selectable:hover { box-shadow: 0 0 0 2px rgba(139,92,246,.4); }
html[data-theme="dark"] .analyzer-kw-chip-active   { outline-color: #818cf8; }
html[data-theme="dark"] .analyzer-kw-warning       { background: #2d2008; border-color: #92400e; color: #fde68a; }
html[data-theme="dark"] .citability-comp-label     { color: #64748b; }
html[data-theme="dark"] .citability-comp-pages     { color: #64748b; }
html[data-theme="dark"] .citability-comp-pages a   { color: #818cf8; }

/* ── SEO Enrichment: Organic Baseline Bar ─────────────────────────────────── */
.ov-organic-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 12px;
}
.ov-organic-bar-label {
    font-weight: 700;
    color: #15803d;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-right: 4px;
}
.ov-organic-pill {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    white-space: nowrap;
}
html[data-theme="dark"] .ov-organic-bar        { background: #0d2d1a; border-color: #1a5c38; }
html[data-theme="dark"] .ov-organic-bar-label  { color: #4ade80; }
html[data-theme="dark"] .ov-organic-pill       { background: #14532d; color: #86efac; border-color: #166534; }

/* ── SEO Enrichment: Competitor Chip ─────────────────────────────────────── */
.ov-competitor-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    white-space: nowrap;
    transition: background .15s;
}
.ov-competitor-chip:hover { background: #dbeafe; }
html[data-theme="dark"] .ov-competitor-chip { background: #1e2d4a; border-color: #2d4a7a; color: #93c5fd; }
html[data-theme="dark"] .ov-competitor-chip:hover { background: #263c5e; }

/* ── SEO Enrichment: Category Chip ──────────────────────────────────────── */
.ov-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    white-space: nowrap;
    color: #7e22ce;
}
.ov-category-chip:hover { background: #f3e8ff; }
html[data-theme="dark"] .ov-category-chip { background: #2d1a4a; border-color: #4c2889; color: #c084fc; }
html[data-theme="dark"] .ov-category-chip:hover { background: #3b2263; }

/* ── Chip count badge ─────────────────────────────────────────────────────── */
.ov-chip-count {
    background: rgba(0,0,0,.08);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
}
html[data-theme="dark"] .ov-chip-count { background: rgba(255,255,255,.12); }

/* ── SEO Enrichment: Gap Toggle Tabs ─────────────────────────────────────── */
.ov-gap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.ov-gap-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary, #1E3A8A);
    margin: 0;
}
.ov-gap-toggle-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ov-gap-toggle {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.ov-gap-toggle:hover { background: #e2e8f0; }
.ov-gap-toggle--active {
    background: #1E3A8A;
    color: #fff;
    border-color: #1E3A8A;
}
.ov-badge {
    display: inline-block;
    background: rgba(255,255,255,.25);
    border-radius: 10px;
    padding: 0 6px;
    font-size: 11px;
    margin-left: 4px;
    font-weight: 700;
}
.ov-gap-toggle:not(.ov-gap-toggle--active) .ov-badge { background: rgba(0,0,0,.1); color: #475569; }
.ov-gap-desc {
    font-size: 12px;
    color: var(--geo-text-muted, #64748b);
    margin: 0 0 12px;
}
.ov-gap-hidden-row { display: none; }
.ov-gap-show-more {
    margin-top: 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--geo-accent, #3b82f6);
    background: transparent;
    border: 1px solid var(--geo-accent, #3b82f6);
    border-radius: 6px;
    padding: 5px 14px;
    transition: background .15s, color .15s;
}
.ov-gap-show-more:hover { background: var(--geo-accent, #3b82f6); color: #fff; }
.ov-section-inner { padding: 16px 20px; }
html[data-theme="dark"] .ov-gap-title   { color: #93c5fd; }
html[data-theme="dark"] .ov-gap-toggle  { background: #1e293b; border-color: #334155; color: #94a3b8; }
html[data-theme="dark"] .ov-gap-toggle:hover { background: #263348; }
html[data-theme="dark"] .ov-gap-toggle--active { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* ── SEO Enrichment: Source Pill ─────────────────────────────────────────── */
.ov-source-pill {
    display: inline-block;
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.ov-source-pill--cited {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}
.ov-source-pill--gap {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
html[data-theme="dark"] .ov-source-pill--cited { background: #14532d; color: #4ade80; border-color: #166534; }
html[data-theme="dark"] .ov-source-pill--gap   { background: #422006; color: #fbbf24; border-color: #92400e; }

/* ── SEO Enrichment: Drilldown Highlight ─────────────────────────────────── */
.ov-drilldown-highlight {
    background: #f0fdf4 !important;
}
html[data-theme="dark"] .ov-drilldown-highlight { background: #0d2d1a !important; }

/* ── Domain Overview: Form Collapse ────────────────────────────────────── */
.ov-form-body { position: relative; }
.ov-form-fields {
    max-height: 600px;
    overflow: hidden;
    transition: max-height var(--transition-slow, 300ms) ease, opacity var(--transition-slow, 300ms) ease;
    opacity: 1;
}
.ov-form-body.is-collapsed .ov-form-fields {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}
.ov-form-collapsed-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 0 2px;
}
.ov-form-body.is-collapsed .ov-form-collapsed-bar { display: flex; }
.ov-form-collapsed-domain {
    font-size: 14px;
    font-weight: 600;
    color: var(--geo-text, #1e293b);
}
.geo-btn-sm {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: var(--geo-text, #1e293b);
    cursor: pointer;
    transition: background var(--transition-fast, 120ms) ease;
}
.geo-btn-sm:hover { background: #f1f5f9; }
html[data-theme="dark"] .ov-form-collapsed-domain { color: #e2e8f0; }
html[data-theme="dark"] .geo-btn-sm { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .geo-btn-sm:hover { background: #263348; }

/* ── GEO Scan: Engine Logo in Signal Pill ──────────────────────────────── */
.geo-signal-logo {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* ── Domain Overview: Topic Clusters ───────────────────────────────────── */
.ov-topic-cluster {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    margin: 0 8px 8px 0;
    min-width: 140px;
    cursor: default;
    transition: border-color var(--transition-fast, 120ms) ease;
}
.ov-topic-cluster:hover { border-color: #3b82f6; }
.ov-topic-name {
    font-size: 13px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 5px;
}
.ov-topic-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ov-topic-status--good { color: #059669; }
.ov-topic-status--warn { color: #d97706; }
.ov-topic-status--bad { color: #dc2626; }
.ov-topic-dot.ov-topic-status--good { background: #059669; }
.ov-topic-dot.ov-topic-status--warn { background: #d97706; }
.ov-topic-dot.ov-topic-status--bad { background: #dc2626; }
.ov-topic-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #64748b;
}
.ov-topic-meta span { white-space: nowrap; }
html[data-theme="dark"] .ov-topic-cluster { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .ov-topic-cluster:hover { border-color: #3b82f6; }
html[data-theme="dark"] .ov-topic-name { color: #e2e8f0; }
html[data-theme="dark"] .ov-topic-meta { color: #94a3b8; }

/* ── Dark mode: systemic white-bg fix (Post-QA 2026-04-09) ───────────── */

html[data-theme="dark"] .geo-summary-bar,
html[data-theme="dark"] .geo-fanout-actions,
html[data-theme="dark"] #fanout-action-panel,
html[data-theme="dark"] .ov-analytics-card,
html[data-theme="dark"] .gsc-card,
html[data-theme="dark"] .gsc-metric-card,
html[data-theme="dark"] .trends-chart-card,
html[data-theme="dark"] .trends-chart-full,
html[data-theme="dark"] .cross-scan-insights,
html[data-theme="dark"] .not-cited-list-item,
html[data-theme="dark"] .not-cited-expandable,
html[data-theme="dark"] .not-cited-details-body,
html[data-theme="dark"] .citation-legend,
html[data-theme="dark"] #gsc-chart-container,
html[data-theme="dark"] #gsc-position-dist,
html[data-theme="dark"] #gsc-kw-changes,
html[data-theme="dark"] #gsc-mobile-gaps,
html[data-theme="dark"] #gsc-brand-split,
html[data-theme="dark"] #gsc-device-split,
html[data-theme="dark"] #gsc-country-list,
html[data-theme="dark"] #gsc-discover-panel,
html[data-theme="dark"] #gsc-serp-features,
html[data-theme="dark"] #gsc-intent-notice {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .geo-btn-secondary,
html[data-theme="dark"] .geo-btn-export,
html[data-theme="dark"] .gsc-action-btn,
html[data-theme="dark"] .gsc-show-all-btn,
html[data-theme="dark"] .header-icon-btn,
html[data-theme="dark"] .geo-feedback-fab {
    background: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .ov-badge,
html[data-theme="dark"] .ov-chip-count,
html[data-theme="dark"] .ov-funnel-pill,
html[data-theme="dark"] .citation-rank,
html[data-theme="dark"] .geo-main-tab:not(.active) {
    background: #334155 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .ov-table th,
html[data-theme="dark"] .gsc-table th,
html[data-theme="dark"] table th {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}
html[data-theme="dark"] .ov-th {
    background: transparent !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 2px solid #475569 !important;
}

html[data-theme="dark"] .ov-table td,
html[data-theme="dark"] .gsc-table td,
html[data-theme="dark"] table td {
    border-color: #334155 !important;
}

html[data-theme="dark"] .gsc-card h4,
html[data-theme="dark"] .gsc-card .gsc-metric-value,
html[data-theme="dark"] .gsc-card .gsc-metric-label,
html[data-theme="dark"] .ov-analytics-card h4 {
    color: #e2e8f0 !important;
}

/* ==========================================================================
   Design Refresh — Domain Overview vertical section spacing
   ========================================================================== */
#ov-results > * + * { margin-top: 20px; }

/* ==========================================================================
   Design Refresh — Content Brief step progress indicator
   ========================================================================== */
.brief-progress-steps {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}
.brief-step {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--gray-200, #e2e8f0);
    transition: background 0.3s ease;
}
.brief-step--done { background: var(--color-primary, #1E3A8A); }
.brief-step--active { background: #818cf8; }

/* ==========================================================================
   Design Refresh — Content Analyzer panel divider
   ========================================================================== */
.analyzer-columns > div:first-child {
    border-right: 1px solid var(--gray-200, #e2e8f0);
    padding-right: 24px;
}
@media (max-width: 768px) {
    .analyzer-columns > div:first-child { border-right: none; padding-right: 0; border-bottom: 1px solid var(--gray-200, #e2e8f0); padding-bottom: 16px; }
}

/* ==========================================================================
   Design Refresh — Dark mode additions
   ========================================================================== */
html[data-theme="dark"] .geo-form-section { border-color: #334155; background: #1e293b; }
html[data-theme="dark"] .ov-metrics-bar .ov-metric-card { border-right-color: #2d3e50; }
html[data-theme="dark"] .analyzer-columns > div:first-child { border-right-color: #334155; }
@media (max-width: 768px) {
    html[data-theme="dark"] .analyzer-columns > div:first-child { border-bottom-color: #334155; border-right: none; }
}
html[data-theme="dark"] .brief-step { background: #334155; }
html[data-theme="dark"] .brief-step--done { background: #4f8ef7; }
html[data-theme="dark"] .brief-step--active { background: #818cf8; }

/* ==========================================================================
   Design Refresh — GEO Scan cited-engines logo row
   ========================================================================== */
.geo-cited-engines {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    margin-top: 8px;
}
.geo-engine-logo-cited {
    /* 28×28 chip per spec */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--gray-100, #f1f5f9);
    transition: background 0.15s;
    cursor: default;
}
.geo-engine-logo-cited:hover { background: var(--gray-200, #e2e8f0); }
.geo-engine-logo-cited .geo-signal-logo { width: 16px; height: 16px; }
html[data-theme="dark"] .geo-cited-engines { }
html[data-theme="dark"] .geo-engine-logo-cited { background: #334155; }
html[data-theme="dark"] .geo-engine-logo-cited:hover { background: #475569; }

/* ==========================================================================
   Design Refresh — Global typography utility classes
   ========================================================================== */
.geo-display    { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; }
.geo-heading    { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.25; }
.geo-subheading { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.4; }
.geo-body       { font-size: 14px; font-weight: 400; line-height: 1.6; }
.geo-caption    { font-size: 12px; font-weight: 500; color: var(--gray-400, #94a3b8); line-height: 1.4; }

/* ==========================================================================
   Design Refresh — Spacing rhythm utilities
   ========================================================================== */
.ov-section-break-lg { margin-top: 32px; }
.ov-section-break-md { margin-top: 20px; }
.ov-section-break-sm { margin-top: 12px; }

/* ══════════════════════════════════════════════════════════════════════════════
   GA4 AI Traffic Dashboard Styles
   ══════════════════════════════════════════════════════════════════════════════ */

/* Section Toggle Pills */
.analytics-section-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: #f8fafc;
    color: #64748b;
    transition: all 0.15s;
}
.analytics-section-btn:first-child { border-radius: 6px 0 0 6px; }
.analytics-section-btn:last-child { border-radius: 0 6px 6px 0; }
.analytics-section-btn.active {
    background: var(--color-primary, #1E3A8A);
    color: #fff;
}
.analytics-section-btn:hover:not(.active) { background: #e2e8f0; }

/* GA4 Sub-tabs — matches .gsc-subtab pattern */
.ga4-subpanel { /* no special styles needed — visibility toggled by JS */ }
.ga4-subtab {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}
.ga4-subtab:hover { background: #f8fafc; color: #334155; }
.ga4-subtab.active {
    background: var(--color-primary, #1E3A8A);
    color: #fff;
    border-color: var(--color-primary, #1E3A8A);
}

/* GA4 KPI Metric Cards */
.ga4-metric-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
}
.ga4-metric-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 8px;
}
.ga4-metric-value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
}

/* Platform Source Dots */
.ga4-source-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 2px;
}

/* Page Filter Buttons */
.ga4-page-filter {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}
.ga4-page-filter:hover { background: #f8fafc; }
.ga4-page-filter.active {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

/* Responsive: stack metrics on mobile */
@media (max-width: 768px) {
    #ga4-metrics { grid-template-columns: repeat(2, 1fr) !important; }
    #ga4-chart-row { grid-template-columns: 1fr !important; }
    .ga4-metric-value { font-size: 22px; }
}

/* ── Beta Email Identity — user chip in header ─────────────────────────────── */
.sg-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    background: var(--geo-bg-soft, #f8fafc);
    border: 1px solid var(--geo-border, #e2e8f0);
    border-radius: 999px;
    color: var(--geo-fg, #334155);
    margin-right: 8px;
}
.sg-user-chip-email {
    font-weight: 500;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sg-user-chip-change {
    font-size: 11px;
    color: var(--geo-link, #3b82f6);
    text-decoration: none;
}
.sg-user-chip-change:hover {
    text-decoration: underline;
}
