.upgrade-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.62);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 20px;
}

.upgrade-modal-overlay.open {
  display: flex;
}

.upgrade-modal-card {
  width: 100%;
  max-width: 560px;
  background: #151517;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

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

.upgrade-modal-title {
  font-size: 20px;
  font-weight: 700;
}

.upgrade-modal-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
}

.upgrade-modal-subtitle {
  opacity: 0.86;
  line-height: 1.6;
  margin-bottom: 16px;
}

.upgrade-plan-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.upgrade-feature-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.upgrade-feature-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.upgrade-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.upgrade-primary {
  background: #fff;
  color: #111;
  border: 1px solid rgba(255,255,255,0.12);
}

.upgrade-secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
}

/* =========================================================
   Repair drawer
   ========================================================= */

#repair-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1500;
}

#repair-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

#repair-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 540px;
  max-width: 92vw;
  height: 100vh;
  background: var(--drawer-bg);
  color: var(--drawer-text);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 1600;
  overflow-y: auto;
  padding: 22px;
  box-shadow: -20px 0 50px rgba(0,0,0,0.4);
}

#repair-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.drawer-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.drawer-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.drawer-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.drawer-section {
  border-top: 1px solid var(--drawer-line);
  padding-top: 18px;
  margin-top: 18px;
}

.drawer-section h3 {
  margin: 0 0 10px 0;
  font-size: 13px;
}

.drawer-code,
.drawer-code-block {
  background: var(--drawer-surface);
  border-radius: 12px;
  padding: 16px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.drawer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 0 28px 0;
}

.drawer-actions button {
  border: 1px solid rgba(255,255,255,0.14);
  background: #121214;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
}

.drawer-actions button.primary {
  background: #0d0d0f;
  font-weight: 700;
}

.drawer-meta .pill,
.drawer-ai-meta .pill,
#repair-drawer .pill,
#intelligence-drawer .pill {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(255,255,255,0.18);
}

.drawer-ai-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.drawer-history {
  margin: 0;
  padding-left: 18px;
}

.drawer-history li {
  margin: 0 0 8px 0;
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.5;
}

/* =========================================================
   Competitor snapshot modal
   ========================================================= */

.competitor-snapshot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 130;
  padding: 20px;
}

.competitor-snapshot-overlay.open {
  display: flex;
}

.competitor-snapshot-card {
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  overflow-y: auto;
  background: #ffffff;
  color: #0f172a;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  padding: 22px;
}

.competitor-snapshot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.competitor-snapshot-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #64748b;
  margin-bottom: 6px;
}

.competitor-snapshot-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.competitor-snapshot-close {
  border: 0;
  background: transparent;
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.competitor-snapshot-body {
  display: grid;
  gap: 16px;
}

.competitor-snapshot-section {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 14px;
  background: #f8fafc;
}

.competitor-snapshot-section h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.4;
}

.competitor-snapshot-section p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.competitor-snapshot-list {
  margin: 8px 0 0 18px;
  padding: 0;
}

.competitor-snapshot-list li {
  margin-bottom: 8px;
  line-height: 1.6;
}

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

.competitor-snapshot-metric {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
}

.competitor-snapshot-metric strong {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}

.competitor-snapshot-metric span {
  color: #64748b;
  font-size: 12px;
}

/* =========================================================
   Brand voice modal
   ========================================================= */

.brand-voice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 131;
  padding: 20px;
}

.brand-voice-overlay.open {
  display: flex;
}

.brand-voice-card {
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  overflow-y: auto;
  background: #ffffff;
  color: #0f172a;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  padding: 22px;
}

.brand-voice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.brand-voice-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #64748b;
  margin-bottom: 6px;
}

.brand-voice-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.brand-voice-close {
  border: 0;
  background: transparent;
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.brand-voice-body {
  display: grid;
  gap: 16px;
}

.brand-voice-section {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 14px;
  background: #f8fafc;
}

.brand-voice-section h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.4;
}

.brand-voice-section p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.brand-voice-list {
  margin: 8px 0 0 18px;
  padding: 0;
}

.brand-voice-list li {
  margin-bottom: 8px;
  line-height: 1.6;
}

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

.brand-voice-tone-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
}

.brand-voice-tone-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

.brand-voice-tone-card span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.brand-voice-example {
  display: block;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  line-height: 1.7;
}

/* =========================================================
   Intelligence drawer
   ========================================================= */

#intelligence-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 1700;
}

#intelligence-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

#intelligence-drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  width: min(1040px, calc(100vw - 48px));
  max-width: min(1040px, calc(100vw - 48px));
  height: auto;
  max-height: calc(100vh - 56px);
  background: var(--drawer-bg);
  color: var(--drawer-text);
  transform: translate(-50%, calc(-50% + 24px)) scale(.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
  opacity: 0;
  z-index: 1800;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.42);
  pointer-events: none;
}

#intelligence-drawer.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

#intelligence-drawer .drawer-head {
  margin-bottom: 14px;
}

#intelligence-drawer .drawer-title {
  font-size: 20px;
  line-height: 1.3;
}

#intelligence-drawer .drawer-meta {
  margin-bottom: 20px;
}

#intelligence-drawer .drawer-section {
  padding-top: 20px;
  margin-top: 20px;
}

#intelligence-drawer .drawer-ai-output,
#intelligence-drawer #intelligence-body {
  max-width: 100%;
  line-height: 1.7;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

#intelligence-drawer .drawer-actions {
  padding: 20px 0 8px 0;
}

/* Marketing Strategy inside intelligence drawer */
#intelligence-drawer .ms-shell {
  display: grid;
  gap: 16px;
}

#intelligence-drawer .ms-config-grid {
  display: grid;
  gap: 12px;
}

#intelligence-drawer .ms-config-card {
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  padding: 12px;
}

#intelligence-drawer .ms-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.78);
}

#intelligence-drawer .ms-select {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: #ffffff;
  color: #111827;
  padding: 10px 12px;
  font-size: 14px;
}

#intelligence-drawer .ms-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#intelligence-drawer .ms-btn {
  border: 1px solid rgba(255,255,255,0.14);
  background: #121214;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

#intelligence-drawer .ms-btn:hover {
  background: #1a1b1f;
}

#intelligence-drawer .ms-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#intelligence-drawer .ms-btn-primary {
  background: #0d0d0f;
  font-weight: 700;
}

#intelligence-drawer .ms-status {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 24px;
}

#intelligence-drawer .ms-output {
  border: 1px solid var(--drawer-line);
  border-radius: 14px;
  background: var(--drawer-surface);
  padding: 14px;
  min-height: 120px;
}

#intelligence-drawer .ms-placeholder {
  color: rgba(255,255,255,0.68);
  line-height: 1.6;
}

#intelligence-drawer .ms-preview-card {
  display: grid;
  gap: 8px;
}

#intelligence-drawer .ms-preview-card p {
  margin: 0;
  line-height: 1.6;
}

#intelligence-drawer .ms-output-toolbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 4px 0 10px;
}

#intelligence-drawer .ms-btn-small {
  padding: 8px 12px;
  font-size: 13px;
}

/* Intelligence markdown polish */
#intelligence-drawer .ai-report-title {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

#intelligence-drawer .ai-report-section {
  margin: 22px 0 10px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}

#intelligence-drawer .ai-section-title {
  margin: 18px 0 8px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 700;
}

#intelligence-drawer .ai-bullet-list,
#intelligence-drawer .ai-ordered-list {
  margin: 8px 0 14px 20px;
  padding: 0;
}

#intelligence-drawer .ai-bullet-list li,
#intelligence-drawer .ai-ordered-list li {
  margin: 6px 0;
  line-height: 1.6;
}

#intelligence-drawer .ai-table-wrap {
  overflow-x: auto;
  margin: 14px 0 18px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
}

#intelligence-drawer .ai-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#intelligence-drawer .ai-table th,
#intelligence-drawer .ai-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#intelligence-drawer .ai-table th {
  font-weight: 700;
  background: rgba(255,255,255,0.04);
}

#intelligence-drawer .ai-table tr:last-child td {
  border-bottom: 0;
}

#intelligence-drawer h2.ai-report-title,
#intelligence-drawer h3.ai-report-section,
#intelligence-drawer h4.ai-section-title {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* =========================================================
   GEO / AEO UI
   ========================================================= */

.geo-aeo-v2-shell {
  display: grid;
  gap: 18px;
}

.geo-aeo-v2-hero {
  display: grid;
  grid-template-columns: minmax(0,1fr) 150px;
  gap: 18px;
  align-items: stretch;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  padding: 18px;
}

.geo-aeo-v2-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  opacity: .72;
  margin-bottom: 8px;
}

.geo-aeo-v2-title {
  margin: 0 0 12px 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
}

.geo-aeo-v2-summary {
  margin: 0;
  line-height: 1.75;
  opacity: .9;
}

.geo-aeo-v2-score-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-self: start;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  padding: 14px 12px;
  text-align: center;
  min-width: 0;
}

.geo-aeo-v2-score-value {
  font-size: 56px;
  line-height: 1;
  font-weight: 800;
}

.geo-aeo-v2-score-denom {
  font-size: 12px;
  opacity: .7;
  margin-top: 4px;
}

.geo-aeo-v2-score-band {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.geo-aeo-v2-meter {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148,163,184,.16);
  margin-top: 14px;
}

.geo-aeo-v2-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg,#8b5cf6,#3b82f6);
}

.geo-aeo-v2-shell.is-weak .geo-aeo-v2-score-panel { border-color: rgba(239,68,68,.24); }
.geo-aeo-v2-shell.is-developing .geo-aeo-v2-score-panel { border-color: rgba(245,158,11,.24); }
.geo-aeo-v2-shell.is-good .geo-aeo-v2-score-panel { border-color: rgba(59,130,246,.24); }
.geo-aeo-v2-shell.is-strong .geo-aeo-v2-score-panel { border-color: rgba(34,197,94,.24); }

.geo-aeo-v2-block {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  padding: 16px;
}

.geo-aeo-v2-block-title {
  margin: 0 0 14px 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
}

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

.geo-aeo-v2-tile {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(15,23,42,0.18);
  padding: 14px;
}

.geo-aeo-v2-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.geo-aeo-v2-tile-label {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
}

.geo-aeo-v2-tile-score {
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
}

.geo-aeo-v2-tile-note {
  line-height: 1.65;
  opacity: .88;
}

.geo-aeo-v2-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.geo-aeo-v2-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  padding: 16px;
}

.geo-aeo-v2-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.geo-aeo-v2-card-head h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 800;
}

.geo-aeo-v2-card-head strong,
.geo-aeo-v3-card-score {
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
}

.geo-aeo-v2-card p {
  margin: 0 0 12px 0;
  line-height: 1.7;
}

.geo-aeo-v2-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.geo-aeo-v2-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
}

.geo-aeo-v2-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.geo-aeo-v2-list li {
  line-height: 1.6;
}

.geo-aeo-v2-stack {
  display: grid;
  gap: 12px;
}

.geo-aeo-v2-stack-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(15,23,42,0.18);
  padding: 14px;
}

.geo-aeo-v2-stack-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 8px;
}

.geo-aeo-v2-stack-card p {
  margin: 0 0 10px 0;
  line-height: 1.7;
}

.geo-aeo-v2-stack-note {
  font-size: 13px;
  line-height: 1.6;
  opacity: .8;
}

.geo-aeo-v2-action-grid {
  display: grid;
  gap: 12px;
}

.geo-aeo-v2-action-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(15,23,42,0.18);
  padding: 14px;
}

.geo-aeo-v2-action-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.geo-aeo-v2-action-title {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 800;
}

.geo-aeo-v2-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.geo-aeo-v2-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
}

.geo-aeo-v2-badge-impact {
  background: rgba(16,185,129,.12);
  color: #86efac;
  border: 1px solid rgba(16,185,129,.24);
}

.geo-aeo-v2-badge-effort {
  background: rgba(245,158,11,.12);
  color: #fde68a;
  border: 1px solid rgba(245,158,11,.24);
}

.geo-aeo-v2-action-copy {
  line-height: 1.7;
  opacity: .9;
}

.geo-aeo-v2-strip {
  display: grid;
  gap: 10px;
}

.geo-aeo-v2-strip-item {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(15,23,42,0.18);
  line-height: 1.65;
}

.geo-aeo-v2-strip-index {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(139,92,246,.16);
  color: #c4b5fd;
}

/* GEO/AEO third pass */
.geo-aeo-v3-ring-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto;
}

.geo-aeo-v3-ring {
  width: 112px;
  height: 112px;
  transform: rotate(-90deg);
}

.geo-aeo-v3-ring-track,
.geo-aeo-v3-ring-fill {
  fill: none;
  stroke-width: 10;
}

.geo-aeo-v3-ring-track {
  stroke: rgba(148,163,184,.14);
}

.geo-aeo-v3-ring-fill {
  stroke: #8b5cf6;
  stroke-linecap: round;
  transition: stroke-dashoffset .9s ease;
}

.geo-aeo-v2-shell.is-good .geo-aeo-v3-ring-fill { stroke: #3b82f6; }
.geo-aeo-v2-shell.is-strong .geo-aeo-v3-ring-fill { stroke: #22c55e; }
.geo-aeo-v2-shell.is-developing .geo-aeo-v3-ring-fill { stroke: #f59e0b; }
.geo-aeo-v2-shell.is-weak .geo-aeo-v3-ring-fill { stroke: #8b5cf6; }

.geo-aeo-v3-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.geo-aeo-v3-ring-score {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}

.geo-aeo-v3-ring-denom {
  font-size: 11px;
  opacity: .72;
  margin-top: 2px;
}

.geo-aeo-v3-panel-meta {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.geo-aeo-v3-band {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 800;
}

.geo-aeo-v3-source {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  opacity: .9;
}

.geo-aeo-v3-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.geo-aeo-v3-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: #fff;
  border-radius: 10px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.geo-aeo-v3-btn:hover {
  background: rgba(255,255,255,0.08);
}

.geo-aeo-v3-toggle {
  cursor: pointer;
  position: relative;
  padding-right: 28px;
}

.geo-aeo-v3-toggle::after {
  content: "▾";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: .7;
}

.geo-aeo-v2-block.is-collapsed > *:not(.geo-aeo-v2-block-title) {
  display: none;
}

.geo-aeo-v2-block.is-collapsed .geo-aeo-v3-toggle::after {
  content: "▸";
}

@media (max-width: 900px) {
  #intelligence-drawer {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 18px;
    padding: 18px;
  }

  #intelligence-drawer .drawer-title {
    font-size: 18px;
  }

  .geo-aeo-v2-hero,
  .geo-aeo-v2-grid,
  .geo-aeo-v2-card-grid {
    grid-template-columns: 1fr;
  }

  .geo-aeo-v3-ring-wrap {
    width: 96px;
    height: 96px;
  }

  .geo-aeo-v3-ring {
    width: 96px;
    height: 96px;
  }

  .geo-aeo-v3-ring-score {
    font-size: 24px;
  }
}

/* GEO/AEO action buttons inside centered intelligence drawer */
#intelligence-drawer .geo-aeo-v2-cta {
  margin-top: 12px;
}

#intelligence-drawer .geo-aeo-v2-cta .audit-fix-btn,
#intelligence-drawer .geo-aeo-v2-cta .gated-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

#intelligence-drawer .geo-aeo-v2-cta .audit-fix-btn:hover,
#intelligence-drawer .geo-aeo-v2-cta .gated-btn:hover {
  background: rgba(255,255,255,0.12);
}

/* Intelligence analysis progress */
#intelligence-drawer .intelligence-progress-shell {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

#intelligence-drawer .intelligence-progress-label {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

#intelligence-drawer .intelligence-progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148,163,184,.16);
}

#intelligence-drawer .intelligence-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg,#8b5cf6,#3b82f6);
  transition: width .22s ease;
}

#intelligence-drawer .intelligence-progress-meta {
  font-size: 13px;
  opacity: .82;
}

/* GEO/AEO fix buttons with credit badge */
#intelligence-drawer .geo-aeo-v2-cta {
  margin-top: 12px;
}

#intelligence-drawer .geo-aeo-fix-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 36px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

#intelligence-drawer .geo-aeo-fix-btn:hover {
  background: rgba(255,255,255,0.12);
}

#intelligence-drawer .geo-aeo-fix-btn-label {
  display: inline-flex;
  align-items: center;
}

#intelligence-drawer .geo-aeo-fix-btn-credit {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
