/* R98c: Keep only ONE breadcrumb - the r44-breadcrumb (Home > Dashboard > Tab☆) */
/* Hide the old #maximo-breadcrumb (Dashboard > Category > Tab) */
#maximo-breadcrumb {
  display: none;
}
/* Hide any other maximo-breadcrumb duplicates */
.maximo-breadcrumb:not(.r44-breadcrumb) {
  display: none;
}
/* Hide old R66 breadcrumb-nav */
.tab-header .breadcrumb-nav {
  display: none;
}

/* R98c: Hide "Not Connected" status when "Connected" is also shown */
#keyword-research-tab .status-bar .status-disconnected,
#keyword-research-tab .api-status-badge.disconnected,
.serp-status-bar:has(.status-dot.disconnected) {
  display: none;
}

/* R98c: Better empty states */
.empty-results-placeholder {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

/* R99: Fix ai-visibility tab overflow */
#ai-visibility-tab {
  overflow: hidden;
  max-width: 100%;
  width: 100%;
}
/* All subtab content panels - active and inactive */
#ai-visibility-tab .aiv-subtab-content {
  max-width: 100%;
  overflow: hidden;
}
#ai-visibility-tab .aiv-subtab-content.active {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  overflow: hidden;
  gap: var(--space-md);
}
/* All panels inside ai-visibility */
#ai-visibility-tab .panel,
#ai-visibility-tab .panel.panel-right,
#ai-visibility-tab .panel.panel-left {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
#ai-visibility-tab .panel.panel-right {
  flex: 1 1 0;
}
/* Subtabs navigation bar */
#ai-visibility-tab .aiv-subtabs-container,
#ai-visibility-tab .aiv-subtabs {
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}
/* All cards and content inside panels */
#ai-visibility-tab .card,
#ai-visibility-tab .card-body,
#ai-visibility-tab .panel-header,
#ai-visibility-tab .panel-sub,
#ai-visibility-tab .panel-title,
#ai-visibility-tab .aiv-empty-state,
#ai-visibility-tab .aiv-empty-icon {
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
/* Feature badges and platform badges */
#ai-visibility-tab [class*="-feature"],
#ai-visibility-tab [class*="-platform-badge"],
#ai-visibility-tab .aiv-platforms-preview,
#ai-visibility-tab [class*="-features-list"],
#ai-visibility-tab [class*="-platforms-grid"] {
  max-width: 100%;
  overflow: hidden;
  flex-wrap: wrap;
  box-sizing: border-box;
}
@media (max-width: 1024px) {
  #ai-visibility-tab .aiv-subtab-content.active {
    flex-direction: column;
  }
  #ai-visibility-tab .panel.panel-left,
  #ai-visibility-tab .panel.panel-right {
    width: 100%;
    max-width: 100%;
  }
}
/* Auth controls: visible when appropriate (managed by app.js auth state) */
/* logoutBtn shown/hidden by JS based on auth state */
/* authOverlay shown/hidden by JS based on auth state */

/* ============================================================
   AUTH OVERLAY — Full-screen login gate
   ============================================================ */
#authOverlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #0a0d17);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#authOverlay .auth-container {
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  background: var(--surface, #141a31);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: var(--radius-xl, 18px);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  margin: 24px;
}
#authOverlay .auth-brand {
  text-align: center;
  margin-bottom: 28px;
}
#authOverlay .auth-brand .name {
  font-family: var(--font-sans, 'Sora', sans-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #f5f7ff);
  letter-spacing: -0.3px;
}
#authOverlay .auth-brand .sub {
  font-size: 14px;
  color: var(--text-muted, #7781a8);
  margin-top: 4px;
}
#authOverlay .auth-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#authOverlay .auth-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #f5f7ff);
  margin-bottom: 16px;
  text-align: center;
}
#authOverlay .auth-error {
  padding: 10px 14px;
  background: var(--danger-muted, rgba(239,68,68,0.15));
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm, 8px);
  color: var(--danger, #ef4444);
  font-size: 13px;
  margin-bottom: 12px;
}
#authOverlay .auth-success {
  padding: 10px 14px;
  background: var(--success-muted, rgba(34,197,94,0.15));
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: var(--radius-sm, 8px);
  color: var(--success, #22c55e);
  font-size: 13px;
  margin-bottom: 12px;
}
#authOverlay .field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #aab2d1);
  margin-bottom: 6px;
  display: block;
}
#authOverlay .field {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg, #0a0d17);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: var(--radius-sm, 8px);
  color: var(--text-primary, #f5f7ff);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
  margin-bottom: 12px;
  box-sizing: border-box;
}
#authOverlay .field:focus {
  border-color: var(--accent, #7c5cff);
  box-shadow: 0 0 0 3px var(--accent-muted, rgba(124,92,255,0.18));
}
#authOverlay .auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted, #7781a8);
  margin-top: 16px;
}
#authOverlay .auth-switch a {
  color: var(--accent, #7c5cff);
  font-weight: 500;
  cursor: pointer;
}
#authOverlay .auth-switch a:hover {
  color: var(--accent-hover, #8f73ff);
}
#authOverlay .auth-download-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--glass, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: var(--radius, 10px);
  margin-top: 20px;
}
#authOverlay .auth-download-icon {
  font-size: 24px;
  flex-shrink: 0;
}
#authOverlay .auth-download-text {
  flex: 1;
  min-width: 0;
}
#authOverlay .auth-download-text strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary, #f5f7ff);
}
#authOverlay .auth-download-text span {
  font-size: 12px;
  color: var(--text-muted, #7781a8);
}
#authOverlay .auth-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--accent, #7c5cff);
  color: #fff;
  border-radius: var(--radius-sm, 8px);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}
#authOverlay .auth-download-btn:hover {
  background: var(--accent-hover, #8f73ff);
}
@media (max-width: 480px) {
  #authOverlay .auth-container {
    padding: 28px 20px;
    margin: 16px;
    border-radius: var(--radius-lg, 14px);
  }
  #authOverlay .auth-brand .name {
    font-size: 20px;
  }
  #authOverlay .auth-download-banner {
    flex-direction: column;
    text-align: center;
  }
}

/* Logout button styling in header */
#logoutBtn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  font-size: 13px;
  padding: 0 14px;
  height: 36px;
  min-height: 36px;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
#logoutBtn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}
/* User display in header */
#userDisplay {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px) {
  #userDisplay { display: none; }
}

/* R98: Hide duplicate breadcrumbs - keep only the new-style ones */
.tab-content > .breadcrumb:first-child + .breadcrumb,
.tab-content > div > .breadcrumb:first-child + .breadcrumb {
  display: none;
}
/* R98: Improve empty state styling */
.empty-state-box, .empty-state {
  animation: fadeInUp 0.15s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}