/* YM Trends — YesMadam Google Brand Intelligence (standalone + embedded)
   Stat typography uses dashboard tokens; #brand-stat-cards scopes .stat-* so main dashboard stats are untouched. */

.ym-dash-surface {
  --blue: #068ecc;
  --blue-dark: #057ab0;
  --pink: #ac2e57;
  --text: #1a1a2e;
  --muted: #6b7280;
  --success: #10b981;
  --warning: #f59e0b;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-hover: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-border-strong: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  --glass-shadow-hover: 0 8px 32px rgba(58, 175, 216, 0.08);
  --glass-blur: blur(20px);
  --radius-lg: 24px;
  --radius-sm: 10px;
}

.ym-brand-page {
  min-height: 100vh;
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text, #111827);
}

.ym-dash-surface.ym-brand-page {
  background-color: #f4f6fb;
  background-image:
    radial-gradient(at 0% 0%, rgba(58, 175, 216, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(184, 50, 120, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(58, 175, 216, 0.15) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(184, 50, 120, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
}

.ym-brand-page:not(.ym-dash-surface) {
  background: linear-gradient(135deg, #f0f7ff 0%, #fdf5f9 50%, #f5f8ff 100%);
}

.ym-brand-page-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.ym-brand-back {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #3aafd8;
  text-decoration: none;
}

.ym-brand-back:hover {
  text-decoration: underline;
}

.ym-brand-page i[data-lucide] {
  width: 1.2em;
  height: 1.2em;
  stroke-width: 2.2;
}

#brand-stat-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

#brand-stat-cards .stat-card {
  background: var(--glass-bg, rgba(255, 255, 255, 0.7));
  backdrop-filter: var(--glass-blur, blur(20px));
  -webkit-backdrop-filter: var(--glass-blur, blur(20px));
  border-radius: var(--radius-lg, 24px);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.6));
  padding: 22px;
  box-shadow: var(--glass-shadow, 0 4px 24px rgba(0, 0, 0, 0.04));
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

#brand-stat-cards .stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow-hover, 0 8px 32px rgba(58, 175, 216, 0.08));
  background: var(--glass-bg-hover, rgba(255, 255, 255, 0.85));
}

#brand-stat-cards .stat-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.08;
  filter: blur(10px);
}

#brand-stat-cards .stat-card.blue::after {
  background: var(--blue, #068ecc);
}

#brand-stat-cards .stat-card.green::after {
  background: var(--success, #10b981);
}

#brand-stat-cards .stat-card.pink::after {
  background: var(--pink, #ac2e57);
}

#brand-stat-cards .stat-card.warm::after {
  background: var(--warning, #f59e0b);
}

#brand-stat-cards .stat-card.purple::after {
  background: #8b5cf6;
}

#brand-stat-cards .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

#brand-stat-cards .stat-card.blue .stat-icon {
  background: rgba(58, 175, 216, 0.12);
  color: var(--blue, #068ecc);
  box-shadow: 0 0 0 1px rgba(58, 175, 216, 0.08), 0 12px 28px rgba(58, 175, 216, 0.15);
}

#brand-stat-cards .stat-card.green .stat-icon {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success, #10b981);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.08), 0 12px 28px rgba(16, 185, 129, 0.12);
}

#brand-stat-cards .stat-card.pink .stat-icon {
  background: rgba(184, 50, 120, 0.12);
  color: var(--pink, #ac2e57);
  box-shadow: 0 0 0 1px rgba(184, 50, 120, 0.08), 0 12px 28px rgba(184, 50, 120, 0.12);
}

#brand-stat-cards .stat-card.warm .stat-icon {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warning, #f59e0b);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1), 0 12px 28px rgba(245, 158, 11, 0.14);
}

#brand-stat-cards .stat-card.purple .stat-icon {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.08), 0 12px 28px rgba(139, 92, 246, 0.14);
}

#brand-stat-cards .stat-icon i[data-lucide] {
  width: 22px;
  height: 22px;
}

#brand-stat-cards .stat-label {
  font-size: 13px;
  color: var(--muted, #6b7280);
  font-weight: 600;
  margin-bottom: 6px;
}

#brand-stat-cards .stat-value {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text, #1a1a2e);
  line-height: 1.2;
  word-break: break-word;
}

#brand-stat-cards .stat-sub {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-top: 6px;
  line-height: 1.4;
}

#brand-stat-cards .stat-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 100px;
  margin-top: 16px;
  overflow: hidden;
}

#brand-stat-cards .stat-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#brand-stat-cards .stat-bar-fill.blue {
  background: var(--blue, #068ecc);
}

#brand-stat-cards .stat-bar-fill.green {
  background: var(--success, #10b981);
}

#brand-stat-cards .stat-bar-fill.pink {
  background: var(--pink, #ac2e57);
}

#brand-stat-cards .stat-bar-fill.warm {
  background: var(--warning, #f59e0b);
}

#brand-stat-cards .stat-bar-fill.purple {
  background: #8b5cf6;
}

#google-content .trend-card {
  background: var(--glass-bg, rgba(255, 255, 255, 0.7));
  backdrop-filter: var(--glass-blur, blur(20px));
  -webkit-backdrop-filter: var(--glass-blur, blur(20px));
  border-radius: var(--radius-lg, 24px);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.6));
  box-shadow: var(--glass-shadow, 0 4px 24px rgba(0, 0, 0, 0.04));
  padding: 22px;
  margin-bottom: 18px;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

#google-content .trend-card:hover {
  background: var(--glass-bg-hover, rgba(255, 255, 255, 0.85));
  box-shadow: var(--glass-shadow-hover, 0 8px 32px rgba(58, 175, 216, 0.08));
}

#google-content .chart-label {
  font-size: 12px;
  color: var(--muted, #6b7280);
  text-align: center;
  margin-top: 10px;
  font-weight: 500;
}

.queries-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.query-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f9fafb;
  font-size: 13px;
}

.query-name {
  color: #374151;
  flex: 1;
}

.query-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  flex-shrink: 0;
  margin-left: 8px;
}

.badge-breakout {
  background: #fce7f3;
  color: #9d174d;
}

.badge-rising {
  background: #e6f1fb;
  color: #0c447c;
}

.badge-top {
  background: #eaf3de;
  color: #3b6d11;
}

.region-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}

.region-rank {
  width: 24px;
  color: #9ca3af;
  font-size: 11px;
}

.region-name {
  width: 120px;
  color: #374151;
  font-weight: 500;
}

.region-bar-track {
  flex: 1;
  background: #f3f4f6;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.region-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.region-value {
  width: 30px;
  text-align: right;
  color: #6b7280;
  font-size: 12px;
}

#google-content .section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.25px;
  color: var(--text, #1a1a2e);
  margin: 0 0 14px;
}

#google-content .google-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px 22px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.7));
  backdrop-filter: var(--glass-blur, blur(20px));
  -webkit-backdrop-filter: var(--glass-blur, blur(20px));
  border-radius: var(--radius-lg, 24px);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.6));
  box-shadow: var(--glass-shadow, 0 4px 24px rgba(0, 0, 0, 0.04));
}

#google-content .brand-title {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #1a1a2e);
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

#google-content .brand-sub {
  font-size: 13px;
  color: var(--muted, #6b7280);
  margin: 0;
  line-height: 1.45;
}

#google-content .google-meta-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

#google-content .meta-text {
  font-size: 12px;
  color: var(--muted, #6b7280);
}

#google-content .refresh-btn {
  background: linear-gradient(135deg, #3aafd8, #b83278);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
  box-shadow: 0 4px 16px rgba(58, 175, 216, 0.22);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

#google-content .refresh-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(58, 175, 216, 0.28);
}

#google-content .refresh-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#google-content .source-note {
  font-size: 12px;
  color: var(--muted, #6b7280);
  text-align: center;
  margin-top: 12px;
  font-weight: 500;
}

.error-card {
  text-align: center;
  padding: 48px 24px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.85));
  backdrop-filter: var(--glass-blur, blur(20px));
  -webkit-backdrop-filter: var(--glass-blur, blur(20px));
  border-radius: var(--radius-lg, 24px);
  border: 1px solid rgba(220, 38, 38, 0.18);
  box-shadow: var(--glass-shadow, 0 4px 24px rgba(0, 0, 0, 0.04));
}

.error-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.error-msg {
  font-size: 15px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.error-hint {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 20px;
}

.retry-btn {
  background: linear-gradient(135deg, #3aafd8, #b83278);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(58, 175, 216, 0.2);
}

.empty {
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
  padding: 20px 0;
}

.google-skeleton .skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 50%, #eef2f7 100%);
  background-size: 200% 100%;
  animation: ym-sk 1.2s ease-in-out infinite;
}

@keyframes ym-sk {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (max-width: 768px) {
  #brand-stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  #google-content .google-header-row {
    flex-direction: column;
    gap: 12px;
  }

  #google-content .google-meta-right {
    align-items: flex-start;
    text-align: left;
  }

  .region-name {
    width: 80px;
    font-size: 11px;
  }
}

/* ── Standalone YM page: tab switcher + AI news cards ─────────────── */
.ym-standalone-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ym-standalone-title {
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin: 0 0 6px;
  color: var(--text, #1a1a2e);
}

.ym-standalone-sub {
  font-size: 13px;
  color: var(--muted, #6b7280);
  margin: 0;
}

.ym-standalone-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.ym-brand-page .refresh-btn-secondary {
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: var(--glass-bg, rgba(255, 255, 255, 0.85));
  backdrop-filter: var(--glass-blur, blur(12px));
  -webkit-backdrop-filter: var(--glass-blur, blur(12px));
  color: var(--text, #374151);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.6));
  box-shadow: var(--glass-shadow, 0 2px 12px rgba(0, 0, 0, 0.04));
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.2s ease;
}

.ym-brand-page .refresh-btn-secondary:hover {
  border-color: rgba(58, 175, 216, 0.45);
  color: #3aafd8;
  box-shadow: 0 4px 16px rgba(58, 175, 216, 0.12);
}

.tab-switcher {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 20px;
  gap: 4px;
  padding: 5px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.7));
  backdrop-filter: var(--glass-blur, blur(20px));
  -webkit-backdrop-filter: var(--glass-blur, blur(20px));
  border-radius: 999px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.6));
  box-shadow: var(--glass-shadow, 0 4px 24px rgba(0, 0, 0, 0.04));
}

.tab-btn {
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #6b7280);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-btn.active {
  background: linear-gradient(135deg, #3aafd8, #b83278);
  color: #fff;
  box-shadow: 0 4px 14px rgba(58, 175, 216, 0.22);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.news-card {
  background: var(--glass-bg, rgba(255, 255, 255, 0.7));
  backdrop-filter: var(--glass-blur, blur(20px));
  -webkit-backdrop-filter: var(--glass-blur, blur(20px));
  border-radius: var(--radius-lg, 24px);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.6));
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--glass-shadow, 0 4px 24px rgba(0, 0, 0, 0.04));
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.news-card:hover {
  background: var(--glass-bg-hover, rgba(255, 255, 255, 0.85));
  box-shadow: var(--glass-shadow-hover, 0 8px 32px rgba(58, 175, 216, 0.08));
  transform: translateY(-2px);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sentiment-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

.badge-positive {
  background: #e1f5ee;
  color: #0f6e56;
}

.badge-negative {
  background: #fcebeb;
  color: #a32d2d;
}

.badge-neutral {
  background: #f1efe8;
  color: #5f5e5a;
}

.badge-alert {
  background: #faeeda;
  color: #633806;
}

.card-category-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.05em;
}

.news-card .card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #1a1a2e);
  margin: 0;
  line-height: 1.4;
  letter-spacing: -0.2px;
}

.card-body {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
}

.card-insight {
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
  line-height: 1.5;
  margin: 0;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.card-source {
  font-size: 12px;
  color: #9ca3af;
}

.card-open-link {
  font-size: 12px;
  color: #378add;
  text-decoration: none;
  font-weight: 500;
}

.card-open-link:hover {
  text-decoration: underline;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ym-filter-empty {
  display: none;
  text-align: center;
  padding: 40px 16px 8px;
  grid-column: 1 / -1;
}

.ym-filter-empty-emoji {
  font-size: 32px;
  margin: 0 0 12px;
}

.ym-filter-empty-text {
  color: var(--muted, #9ca3af);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--glass-bg, rgba(255, 255, 255, 0.75));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #374151);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
}

.pill:hover {
  border-color: rgba(58, 175, 216, 0.35);
}

.pill.active {
  background: linear-gradient(135deg, #068ecc, #b83278);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(58, 175, 216, 0.22);
}

.skeleton-card {
  background: var(--glass-bg, rgba(255, 255, 255, 0.7));
  border-radius: var(--radius-lg, 24px);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.6));
  padding: 22px;
  box-shadow: var(--glass-shadow, 0 4px 24px rgba(0, 0, 0, 0.04));
}

.ym-skeleton-wrap .skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 50%, #eef2f7 100%);
  background-size: 200% 100%;
  animation: ym-sk 1.2s ease-in-out infinite;
  margin-bottom: 8px;
}

.sk-h16 {
  height: 16px;
}

.sk-h20 {
  height: 20px;
}

.sk-h14 {
  height: 14px;
}

.sk-h12 {
  height: 12px;
}

.sk-w30 {
  width: 30%;
}

.sk-w40 {
  width: 40%;
}

.sk-w80 {
  width: 80%;
}

.sk-w90 {
  width: 90%;
}

.ym-empty-grid {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: #9ca3af;
}

.ym-empty-emoji {
  font-size: 32px;
  margin: 0 0 12px;
}

.ym-error-card {
  margin-top: 16px;
}

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

  .filter-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .pill {
    flex-shrink: 0;
  }

  .ym-standalone-meta {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  #brand-stat-cards {
    grid-template-columns: 1fr;
  }
}

.ym-brand-page .meta-text {
  font-size: 12px;
  color: var(--muted, #6b7280);
}

/* In-app YM Trends: glass cards & tabs to match main dashboard */
#page-ym-trends .ym-main-tabs {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

#page-ym-trends .ym-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease;
}

#page-ym-trends .ym-card:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

#page-ym-trends .ym-card.sent-positive {
  border-left: 4px solid #22c55e;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.14) 0%, var(--glass-bg) 42%);
}

#page-ym-trends .ym-card.sent-negative {
  border-left: 4px solid #ef4444;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.12) 0%, var(--glass-bg) 42%);
}

#page-ym-trends .ym-card.sent-neutral {
  border-left: 4px solid #94a3b8;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.14) 0%, var(--glass-bg) 42%);
}

#page-ym-trends .ym-card.sent-alert {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16) 0%, var(--glass-bg) 42%);
}

#page-ym-trends .ym-empty {
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(0, 0, 0, 0.1);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* ─────────────────────────────────────────
   COMPETITOR ADS INTELLIGENCE
───────────────────────────────────────── */

.comp-ads-new-badge {
  font-size: 8px; background: #ef4444; color: #fff;
  padding: 1px 5px; border-radius: 8px; margin-left: 4px;
  font-weight: 700; vertical-align: middle;
}

/* Modern Control Deck */
.comp-ads-control-deck {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.03);
}

.deck-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.deck-filters {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #94a3b8;
}

/* Brands & Segmented Control */
.comp-ads-brand-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.brand-pill {
  font-size: 11px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.brand-pill:hover {
  border-color: var(--brand-color, #C0609A);
  color: var(--brand-color, #C0609A);
  transform: translateY(-1px);
}
.brand-pill.active {
  background: var(--brand-color, #C0609A);
  color: #ffffff;
  border-color: var(--brand-color, #C0609A);
  box-shadow: 0 4px 14px rgba(192, 96, 154, 0.25);
}

/* Segmented Control */
.segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.03);
  padding: 3px;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.segmented-control .comp-fmt-btn {
  font-size: 11px;
  padding: 5px 14px;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.segmented-control .comp-fmt-btn:hover {
  color: #0f172a;
}

.segmented-control .comp-fmt-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Deck Actions & Toggles */
.deck-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Premium Switch Button styling */
.premium-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.premium-switch input {
  display: none;
}

.switch-slider {
  position: relative;
  width: 38px;
  height: 20px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 20px;
  transition: all 0.2s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.premium-switch input:checked + .switch-slider {
  background: #10b981;
}

.premium-switch input:checked + .switch-slider::before {
  transform: translateX(18px);
}

.switch-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.deck-divider {
  width: 1px;
  height: 24px;
  background: rgba(0, 0, 0, 0.08);
}

/* Premium Action Buttons */
.premium-action-btn {
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.premium-action-btn.refresh-btn {
  border: 1px solid #C0609A;
  background: linear-gradient(135deg, #ffffff, #fdf4f9);
  color: #C0609A;
}

.premium-action-btn.refresh-btn:hover {
  background: #C0609A;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(192, 96, 154, 0.2);
}

.premium-action-btn.log-btn {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: #64748b;
}

.premium-action-btn.log-btn:hover {
  background: #f8fafc;
  color: #334155;
  border-color: rgba(0, 0, 0, 0.15);
}

/* Premium Stats Strip */
.comp-ads-stats {
  display: flex;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  padding: 12px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
}

.comp-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 24px;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  flex: 1;
  justify-content: center;
  min-width: 120px;
}

.comp-stat:last-child {
  border-right: none;
}

.comp-stat-n {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.comp-stat-l {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  margin-top: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
}

.comp-stat-threat {
  border-color: rgba(239, 68, 68, 0.12);
  background: rgba(239, 68, 68, 0.04);
  border-radius: 8px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.comp-stat-threat .comp-stat-n {
  color: #ef4444;
}

.comp-stat-threat .comp-stat-l {
  color: #b91c1c;
}

/* Ads Grid - 3 columns */
.comp-ads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 900px) { .comp-ads-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .comp-ads-grid { grid-template-columns: 1fr; } }

/* Ad Card */
.comp-ad-card {
  background: #fff; border: 0.5px solid #e5e7eb; border-radius: 14px;
  overflow: hidden; transition: box-shadow 0.15s;
  display: flex; flex-direction: column;
}
.comp-ad-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.comp-ad-active { border-top: 2px solid #10b981; }
.comp-ad-inactive { opacity: 0.7; border-top: 2px solid #9ca3af; }

/* Media Thumbnail */
.comp-ad-media {
  position: relative; height: 180px;
  background: linear-gradient(135deg, #f5f0ff, #f0f6ff);
  overflow: hidden;
}
.comp-ad-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.2s;
}
.comp-ad-media video {
  width: 100%; height: 100%; object-fit: cover;
  background: #000;
}
.comp-ad-card:hover .comp-ad-media img { transform: scale(1.03); }
.comp-ad-no-thumb {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 36px; color: #d1d5db;
}
.comp-ad-format-badge {
  position: absolute; bottom: 7px; left: 7px;
  background: rgba(0,0,0,0.65); color: #fff;
  font-size: 9px; padding: 2px 8px; border-radius: 8px; font-weight: 600;
}
.comp-ad-new-badge {
  position: absolute; top: 7px; left: 7px;
  background: #ef4444; color: #fff;
  font-size: 9px; padding: 2px 7px; border-radius: 8px; font-weight: 700;
}
.comp-ad-inactive-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600; letter-spacing: 0.05em;
}

/* Card Body */
.comp-ad-body { padding: 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }

.comp-ad-meta-row { display: flex; justify-content: space-between; align-items: center; }
.comp-ad-brand { font-size: 12px; font-weight: 700; color: #1a1a2e; }
.comp-ad-date { font-size: 10px; color: #9ca3af; }

.comp-ad-title { font-size: 13px; font-weight: 600; color: #111827; line-height: 1.3; }
.comp-ad-copy { font-size: 11px; color: #6b7280; line-height: 1.5; }

.comp-ad-tags-row { display: flex; gap: 5px; flex-wrap: wrap; }
.comp-ad-cta {
  font-size: 9px; padding: 2px 8px; border-radius: 8px;
  background: #C0609A20; color: #C0609A; font-weight: 600;
}
.comp-ad-platform {
  font-size: 9px; padding: 2px 7px; border-radius: 8px;
  background: #f0f6fc; color: #4A7AAA; font-weight: 500;
}

/* Agency */
.comp-ad-agency {
  font-size: 11px; color: #374151; display: flex; align-items: center; gap: 6px;
  background: #f9fafb; padding: 5px 8px; border-radius: 7px;
}
.agency-conf { font-size: 9px; padding: 1px 6px; border-radius: 6px; font-weight: 500; }
.agency-conf-high { background: #f0fdf4; color: #15803d; }
.agency-conf-medium { background: #fef9c3; color: #854d0e; }
.agency-conf-low { background: #f9fafb; color: #6b7280; }

/* AI Analysis */
.comp-ad-analysis {
  background: linear-gradient(135deg, #fdf5fa, #f0f6fd);
  border-radius: 8px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.comp-ad-analysis-row { font-size: 11px; color: #374151; display: flex; gap: 5px; }
.analysis-label { font-weight: 600; color: #6b7280; flex-shrink: 0; }
.comp-ad-opportunity {
  font-size: 11px; color: #374151;
  border-left: 2px solid #C0609A;
  padding-left: 7px; margin-top: 3px;
  line-height: 1.5;
}

/* Footer Row */
.comp-ad-footer-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 6px;
}
.comp-threat-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 8px; font-weight: 600;
}
.comp-ad-link {
  font-size: 11px; color: #7AAAD4; text-decoration: none; font-weight: 500;
}
.comp-ad-link:hover { text-decoration: underline; }

/* Loading / Empty / Error */
.comp-ads-loading, .comp-ads-empty, .comp-ads-error {
  grid-column: 1 / -1; text-align: center; padding: 48px; color: #6b7280;
}
.comp-spinner {
  width: 32px; height: 32px;
  border: 3px solid #e5e7eb; border-top-color: #C0609A;
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

.comp-ads-footer {
  font-size: 10px; color: #9ca3af; text-align: right; margin-top: 14px;
}
