/* ============================================================
   CPMS SEO Tool 2026 — Full Design System
   Pixel-perfect clone: seo.ngoctraimkt.com
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ══════════════════════════════════════════
   1. CSS VARIABLES (Exact from source)
══════════════════════════════════════════ */
:root {
  /* Brand Colors */
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-glow: rgba(14,165,233,0.15);
  --accent: #8b5cf6;
  --accent-glow: rgba(139,92,246,0.15);
  --gold: #f59e0b;
  --gold-dark: #d97706;
  --gold-light: #fbbf24;
  --success: #22c55e;
  --success-bg: rgba(34,197,94,0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245,158,11,0.1);
  --error: #ef4444;
  --error-bg: rgba(239,68,68,0.1);
  --info: #3b82f6;
  --info-bg: rgba(59,130,246,0.1);
  --teal: #14b8a6;
  --teal-bg: rgba(20,184,166,0.1);

  /* Dark Surfaces */
  --bg: #0a0d14;
  --surface: #111827;
  --surface-2: #1a1d27;
  --surface-3: #21253a;
  --surface-hover: #2a2f45;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.15);

  /* Text */
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #475569;

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed: 60px;
  --header-height: 56px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 150ms cubic-bezier(0.16,1,0.3,1);
  --transition-slow: 350ms cubic-bezier(0.16,1,0.3,1);
}

/* Light Theme */
[data-theme="light"] {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --surface-hover: #e2e8f0;
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.18);
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;
}

/* ══════════════════════════════════════════
   2. RESET & BASE
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ══════════════════════════════════════════
   3. AUTH SCREEN
══════════════════════════════════════════ */
.auth-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(14,165,233,0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(139,92,246,0.07) 0%, transparent 60%);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 420px;
  max-width: calc(100vw - 32px);
  text-align: center;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6), 0 0 30px rgba(14,165,233,0.08);
  animation: fadeInUp 0.5s ease;
}
.auth-logo-block { margin-bottom: 28px; }
.auth-logo-avatar {
  width: 60px; height: 60px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f59e0b, #f97316);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900; color: #000;
  margin: 0 auto 12px;
}
.auth-logo-title {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 4px;
}
.auth-logo-sub { font-size: 13px; color: var(--text-muted); }
.auth-form label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.pin-input {
  width: 100%; padding: 14px; font-size: 22px; letter-spacing: 10px; text-align: center;
  background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--radius);
  color: var(--text); margin-bottom: 14px; font-family: 'JetBrains Mono', monospace;
  transition: border-color var(--transition);
}
.pin-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.auth-hint { color: var(--text-faint); font-size: 12px; margin-top: 12px; }

/* ══════════════════════════════════════════
   4. APP LAYOUT
══════════════════════════════════════════ */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* ══════════════════════════════════════════
   5. SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: width var(--transition-slow);
  flex-shrink: 0; overflow: hidden; position: relative; z-index: 100;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-bottom-text { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }

/* Logo Block */
.sidebar-logo {
  padding: 0 12px;
  height: var(--header-height);
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-avatar {
  width: 36px; height: 36px; border-radius: var(--radius);
  background: linear-gradient(135deg, #f59e0b, #f97316);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900; color: #000;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.logo-text { overflow: hidden; min-width: 0; transition: opacity var(--transition); }
.logo-name { font-size: 13px; font-weight: 800; color: var(--text); white-space: nowrap; letter-spacing: 0.5px; }
.logo-sub { font-size: 10px; color: var(--text-faint); white-space: nowrap; }

/* Sidebar Toggle */
.sidebar-toggle-btn {
  position: absolute; top: 14px; right: 10px;
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text-muted); width: 26px; height: 26px;
  border-radius: var(--radius); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition); z-index: 1;
}
.sidebar-toggle-btn:hover { background: var(--surface-hover); color: var(--text); }
.sidebar.collapsed .sidebar-toggle-btn { transform: rotate(180deg); }

/* Nav */
.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; overflow-x: hidden; }
.nav-section-label {
  font-size: 10px; font-weight: 700; color: var(--text-faint);
  letter-spacing: 1.5px; padding: 12px 8px 5px; text-transform: uppercase;
  white-space: nowrap; transition: opacity var(--transition);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  text-decoration: none; cursor: pointer; white-space: nowrap; overflow: hidden;
  position: relative; transition: all var(--transition);
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: var(--primary-glow); color: var(--primary); font-weight: 600;
  border-left: 2px solid var(--primary); margin-left: -1px;
}
.nav-icon { font-size: 15px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--transition); }
.nav-divider { height: 1px; background: var(--border); margin: 8px 8px; }

/* Sidebar Bottom */
.sidebar-bottom {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-bottom-text { transition: opacity var(--transition); overflow: hidden; }

/* API Key Guide button (gold gradient) */
.btn-guide-gold {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border: none; border-radius: var(--radius);
  color: #000; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; overflow: hidden;
  margin-bottom: 6px; transition: all var(--transition);
}
.btn-guide-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,158,11,0.4); }

/* OpenRouter sidebar section */
.openrouter-sidebar {
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
}
.openrouter-sidebar.hidden { display: none; }

/* Logout button */
.btn-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px;
  background: var(--error-bg); border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius); color: var(--error);
  font-size: 12px; font-weight: 600; cursor: pointer; margin-top: 6px;
  transition: all var(--transition);
}
.btn-logout:hover { background: rgba(239,68,68,0.2); }

/* Mobile overlay */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 90;
  backdrop-filter: blur(4px);
}

/* ══════════════════════════════════════════
   6. MAIN WRAPPER & HEADER
══════════════════════════════════════════ */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.app-header {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; flex-shrink: 0; position: relative; z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-center { flex: 1; display: flex; align-items: center; overflow: hidden; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.breadcrumb { font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

.menu-toggle {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); width: 34px; height: 34px;
  border-radius: var(--radius); font-size: 16px;
  display: none; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.menu-toggle:hover { background: var(--surface-2); color: var(--text); }

/* AI Provider Tabs — header center */
/* AI Provider Tabs — header center (Phase 9) */
.provider-tabs {
  display: flex !important;
  gap: 3px;
  align-items: center;
  overflow-x: auto !important;
  flex-wrap: nowrap !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  width: 100%;
}
.provider-tabs::-webkit-scrollbar { display: none !important; }
.provider-tabs button,
.provider-tabs .provider-tab {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  min-width: fit-content !important;
}
.provider-tab {
  padding: 5px 12px; border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: transparent; color: var(--text-muted);
  font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.provider-tab:hover { background: var(--surface-2); color: var(--text); }
.provider-tab.active {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
  box-shadow: 0 0 12px rgba(14,165,233,0.2);
}

/* API Key input */
.api-key-wrap {
  display: flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color var(--transition);
}
.api-key-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
#api-key-input {
  background: transparent; border: none; outline: none;
  padding: 7px 10px; color: var(--text); font-size: 12px;
  width: 175px; font-family: 'JetBrains Mono', monospace;
}
#api-key-input::placeholder { color: var(--text-faint); font-family: 'Inter', sans-serif; font-size: 11px; }
.key-toggle {
  background: none; border: none; color: var(--text-faint);
  padding: 0 8px; cursor: pointer; font-size: 13px;
  transition: color var(--transition);
}
.key-toggle:hover { color: var(--text); }
.header-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 4px; }
.ai-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.ai-status-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

.btn-theme {
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text-muted); width: 32px; height: 32px;
  border-radius: var(--radius); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
}
.btn-theme:hover { background: var(--surface-hover); color: var(--text); }

/* ══════════════════════════════════════════
   7. STATUS BAR (Progress while AI running)
══════════════════════════════════════════ */
.status-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; font-size: 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0; min-height: 36px;
}
.status-bar.hidden { display: none; }
.status-icon { font-size: 14px; flex-shrink: 0; }
.status-text { flex: 1; color: var(--text-muted); }
.status-provider {
  background: rgba(14,165,233,0.1); border: 1px solid rgba(14,165,233,0.2);
  padding: 2px 8px; border-radius: var(--radius-full);
  color: var(--primary); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.status-percent { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--gold); font-weight: 600; }
.progress-track {
  width: 100px; height: 4px; background: var(--surface-3);
  border-radius: 2px; overflow: hidden; flex-shrink: 0;
}
.progress-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #ef4444, #f97316, #eab308);
  transition: width 0.4s ease;
}

/* ══════════════════════════════════════════
   8. MAIN CONTENT
══════════════════════════════════════════ */
.main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  background: var(--bg);
}
.view-container {
  max-width: 1100px; margin: 0 auto;
  padding: 24px 28px; min-height: calc(100vh - var(--header-height) - 36px);
  animation: fadeIn 0.25s ease;
}

/* ══════════════════════════════════════════
   9. BUTTONS
══════════════════════════════════════════ */
/* Gold CTA (primary action) */
.btn-gold {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 52px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border: none; border-radius: var(--radius);
  color: #000; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
  box-shadow: 0 2px 16px rgba(245,158,11,0.25);
}
.btn-gold:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(245,158,11,0.4); }
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Blue primary */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none; border-radius: var(--radius);
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  box-shadow: 0 2px 10px rgba(14,165,233,0.25);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(14,165,233,0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Green (Audit) */
.btn-green {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border: none; border-radius: var(--radius);
  color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
}
.btn-green:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(34,197,94,0.4); }
.btn-green:disabled { opacity: 0.5; cursor: not-allowed; }

/* Teal (2FA) */
.btn-teal {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  border: none; border-radius: var(--radius);
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-teal:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(20,184,166,0.35); }

/* Secondary */
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Outlined */
.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: transparent; border: 1px solid var(--primary);
  border-radius: var(--radius); color: var(--primary);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.btn-outline:hover { background: var(--primary-glow); }

/* Danger */
.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  background: var(--error); border: none;
  border-radius: var(--radius); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.btn-danger:hover { background: #dc2626; }

/* Icon button */
.btn-icon {
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text-muted); width: 32px; height: 32px;
  border-radius: var(--radius); font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition); flex-shrink: 0;
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }

.btn-sm { padding: 6px 12px !important; font-size: 12px !important; height: auto !important; }
.btn-full { width: 100% !important; }

/* ══════════════════════════════════════════
   10. FORM ELEMENTS
══════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-required { color: var(--error); }
.form-input, .form-select, .form-textarea {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 12px;
  color: var(--text); font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-faint); }
.form-select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ══════════════════════════════════════════
   11. CARDS
══════════════════════════════════════════ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-strong); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }

/* KPI Cards */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
  display: flex; align-items: center; gap: 14px;
  transition: all var(--transition);
}
.kpi-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.kpi-icon-wrap {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.kpi-icon-blue { background: var(--primary-glow); }
.kpi-icon-purple { background: var(--accent-glow); }
.kpi-icon-gold { background: rgba(245,158,11,0.12); }
.kpi-info { flex: 1; }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 2px; }
.kpi-label { font-size: 12px; color: var(--text-muted); }

/* Tool Cards */
.tool-cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  cursor: pointer; transition: all var(--transition); position: relative; overflow: hidden;
}
.tool-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(14,165,233,0.04) 0%, rgba(139,92,246,0.04) 100%);
  opacity: 0; transition: opacity var(--transition);
}
.tool-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.35); }
.tool-card:hover::after { opacity: 1; }
.tool-card-icon { font-size: 32px; margin-bottom: 10px; display: block; position: relative; z-index: 1; }
.tool-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--text); position: relative; z-index: 1; }
.tool-card p { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-bottom: 14px; position: relative; z-index: 1; }

/* ══════════════════════════════════════════
   12. PAGE HEADER
══════════════════════════════════════════ */
.page-header { margin-bottom: 24px; }
.page-title {
  font-size: clamp(18px, 3vw, 26px); font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 4px;
}
.page-subtitle { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ══════════════════════════════════════════
   13. TWO-PANEL LAYOUT (Input + Output)
══════════════════════════════════════════ */
.two-panel { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.panel-title {
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
  margin-bottom: 18px; display: flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.panel-title-between { justify-content: space-between; }

/* ══════════════════════════════════════════
   14. ACTION BAR
══════════════════════════════════════════ */
.action-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 14px; border-top: 1px solid var(--border); margin-top: 14px;
}

/* ══════════════════════════════════════════
   15. OUTPUT AREA
══════════════════════════════════════════ */
.output-area { min-height: 350px; }
.output-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 280px; gap: 12px; color: var(--text-faint); text-align: center;
}
.output-placeholder-icon { font-size: 48px; opacity: 0.25; }
.output-placeholder p { font-size: 13px; max-width: 240px; line-height: 1.6; }

/* ══════════════════════════════════════════
   16. MARKDOWN OUTPUT
══════════════════════════════════════════ */
.markdown-output { color: var(--text); font-size: 14px; line-height: 1.85; }
.markdown-output h1 { font-size: 20px; font-weight: 800; margin: 20px 0 10px; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.markdown-output h2 { font-size: 16px; font-weight: 700; margin: 18px 0 8px; color: var(--primary); }
.markdown-output h3 { font-size: 14px; font-weight: 700; margin: 14px 0 6px; }
.markdown-output p { margin: 8px 0; }
.markdown-output ul, .markdown-output ol { padding-left: 20px; margin: 8px 0; }
.markdown-output li { margin: 4px 0; }
.markdown-output table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
.markdown-output th { background: var(--surface-3); padding: 9px 12px; text-align: left; font-weight: 600; border: 1px solid var(--border); }
.markdown-output td { padding: 8px 12px; border: 1px solid var(--border); color: var(--text-muted); }
.markdown-output tr:nth-child(even) td { background: var(--surface-2); }
.markdown-output code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--primary); }
.markdown-output pre { background: #0d1117; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; overflow-x: auto; margin: 10px 0; }
.markdown-output pre code { background: none; padding: 0; color: #e6edf3; }
.markdown-output blockquote { border-left: 3px solid var(--primary); padding: 8px 14px; margin: 10px 0; background: var(--primary-glow); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-muted); }
.markdown-output strong { color: var(--text); font-weight: 700; }
.markdown-output a { color: var(--primary); }
.markdown-output hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ══════════════════════════════════════════
   17. TABS (Preview / Raw / Meta)
══════════════════════════════════════════ */
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; }
.tab-btn {
  padding: 6px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.tab-btn:hover { background: var(--surface-2); color: var(--text); }
.tab-btn.active { background: var(--primary-glow); color: var(--primary); border-color: rgba(14,165,233,0.3); }

/* ══════════════════════════════════════════
   18. KEYWORD TABLE
══════════════════════════════════════════ */
.keyword-table-wrap { overflow-x: auto; }
.keyword-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.keyword-table th {
  background: var(--surface-3); padding: 9px 12px;
  text-align: left; font-weight: 700; color: var(--text-muted);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.keyword-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.keyword-table tr:hover td { background: var(--surface-2); }

.intent-badge {
  display: inline-block; padding: 2px 7px;
  border-radius: var(--radius-full); font-size: 10px; font-weight: 700;
}
.intent-informational { background: var(--info-bg); color: var(--info); }
.intent-transactional { background: var(--success-bg); color: var(--success); }
.intent-navigational { background: var(--warning-bg); color: var(--warning); }
.intent-commercial { background: var(--accent-glow); color: #a78bfa; }

.diff-bar { display: flex; align-items: center; gap: 6px; }
.diff-track { flex: 1; height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; max-width: 70px; }
.diff-fill { height: 100%; border-radius: 3px; }
.diff-easy { background: var(--success); }
.diff-medium { background: var(--warning); }
.diff-hard { background: var(--error); }

/* ══════════════════════════════════════════
   19. AUDIT SCORE CIRCLE
══════════════════════════════════════════ */
.score-wrap { display: flex; align-items: center; gap: 24px; margin-bottom: 20px; }
.score-circle { position: relative; flex-shrink: 0; }
.score-circle svg { overflow: visible; }
.breakdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; }
.breakdown-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
}
.breakdown-name { font-size: 10px; color: var(--text-faint); margin-bottom: 4px; }
.breakdown-bar-wrap { display: flex; align-items: center; gap: 6px; }
.breakdown-bar-track { flex: 1; height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.breakdown-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 1s ease; }
.breakdown-score { font-size: 11px; font-weight: 700; color: var(--primary); min-width: 24px; text-align: right; }

/* Issues list */
.issues-list { display: flex; flex-direction: column; gap: 7px; }
.issue-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius); font-size: 13px;
}
.issue-critical { background: var(--error-bg); border: 1px solid rgba(239,68,68,0.2); }
.issue-warning { background: var(--warning-bg); border: 1px solid rgba(245,158,11,0.2); }
.issue-info { background: var(--info-bg); border: 1px solid rgba(59,130,246,0.2); }
.issue-success { background: var(--success-bg); border: 1px solid rgba(34,197,94,0.2); }
.issue-icon { font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.issue-body { flex: 1; }
.issue-title { font-weight: 600; margin-bottom: 2px; }
.issue-desc { font-size: 12px; opacity: 0.8; line-height: 1.4; }

/* ══════════════════════════════════════════
   20. BADGES
══════════════════════════════════════════ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.badge-info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(59,130,246,0.25); }
.badge-gold { background: rgba(245,158,11,0.12); color: var(--gold); border: 1px solid rgba(245,158,11,0.25); }
.badge-error { background: var(--error-bg); color: var(--error); border: 1px solid rgba(239,68,68,0.25); }
.badge-purple { background: var(--accent-glow); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
.badge-free { background: var(--success-bg); color: var(--success); border: 1px solid rgba(34,197,94,0.3); padding: 2px 7px; border-radius: var(--radius-full); font-size: 10px; font-weight: 700; }
.badge-paid { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); padding: 2px 7px; border-radius: var(--radius-full); font-size: 10px; font-weight: 700; }
.badge-best { background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(249,115,22,0.2)); color: #fbbf24; border: 1px solid rgba(245,158,11,0.4); padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; }

/* ══════════════════════════════════════════
   21. SPINNER
══════════════════════════════════════════ */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: currentColor; border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

/* ══════════════════════════════════════════
   22. TOAST
══════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  animation: slideInRight 0.3s ease;
  max-width: 360px; backdrop-filter: blur(8px);
}
.toast-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.35); color: #4ade80; }
.toast-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.35); color: #f87171; }
.toast-warning { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.35); color: #fbbf24; }
.toast-info { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.35); color: #60a5fa; }

/* ══════════════════════════════════════════
   23. MODAL
══════════════════════════════════════════ */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); }
.modal-box {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  width: 620px; max-width: calc(100vw - 24px);
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 48px rgba(0,0,0,0.7); animation: fadeInUp 0.3s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 15px; font-weight: 700; }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.modal-tab {
  padding: 5px 12px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.modal-tab:hover { background: var(--surface-2); color: var(--text); }
.modal-tab.active { background: var(--primary-glow); color: var(--primary); border-color: rgba(14,165,233,0.4); }
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* Provider guide card */
.guide-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.guide-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.guide-icon { font-size: 24px; }
.guide-card-title { font-size: 14px; font-weight: 700; }
.guide-step { display: flex; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.guide-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-glow); color: var(--primary);
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.guide-open-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: var(--primary-glow);
  border: 1px solid rgba(14,165,233,0.35); border-radius: var(--radius);
  color: var(--primary); font-size: 12px; font-weight: 700;
  text-decoration: none; transition: all var(--transition); margin-top: 8px;
}
.guide-open-btn:hover { background: rgba(14,165,233,0.2); text-decoration: none; }

/* ══════════════════════════════════════════
   24. SECURITY / 2FA
══════════════════════════════════════════ */
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.security-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.security-section-title { font-size: 14px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.toggle-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle-track {
  width: 42px; height: 22px; background: var(--surface-3);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  position: relative; transition: background var(--transition);
}
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted); transition: all var(--transition);
}
.toggle-input:checked + .toggle-track { background: var(--primary); border-color: var(--primary); }
.toggle-input:checked + .toggle-track::after { left: calc(100% - 17px); background: #fff; }
.toggle-input { display: none; }
.warning-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--warning-bg);
  border: 1px solid rgba(245,158,11,0.3); border-radius: var(--radius);
  font-size: 13px; color: var(--warning); margin-bottom: 14px;
}

/* ══════════════════════════════════════════
   25. SITEMAP BADGE
══════════════════════════════════════════ */
.sitemap-row { display: flex; align-items: center; gap: 8px; }
.sitemap-row .form-input { flex: 1; }
.sitemap-badge-wrap { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ══════════════════════════════════════════
   26. WORD COUNT BAR
══════════════════════════════════════════ */
.word-count-bar { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12px; color: var(--text-muted); }
.word-count-badge { background: var(--surface-3); padding: 2px 8px; border-radius: var(--radius-full); font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--primary); font-weight: 600; }

/* ══════════════════════════════════════════
   27. WELCOME BANNER (Dashboard)
══════════════════════════════════════════ */
.welcome-banner {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 24px 28px; margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.welcome-banner::before {
  content: ''; position: absolute; top: -50px; right: -50px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(14,165,233,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.welcome-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-full);
  background: var(--primary-glow); border: 1px solid rgba(14,165,233,0.3);
  font-size: 11px; font-weight: 700; color: var(--primary);
  margin-bottom: 10px;
}
.welcome-title { font-size: clamp(18px, 3vw, 28px); font-weight: 900; color: var(--text); margin-bottom: 6px; line-height: 1.2; }
.welcome-subtitle { font-size: 13px; color: var(--text-muted); max-width: 540px; }
.provider-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.provider-chip {
  padding: 3px 10px; background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-full); font-size: 11px; font-weight: 600; color: var(--text-muted);
}

/* ══════════════════════════════════════════
   28. FOOTER
══════════════════════════════════════════ */
.page-footer {
  margin-top: 40px; padding: 24px 0;
  border-top: 1px solid var(--border);
}
.footer-top {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.footer-logo {
  width: 36px; height: 36px; border-radius: var(--radius);
  background: linear-gradient(135deg, #f59e0b, #f97316);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #000;
}
.footer-brand { font-size: 13px; font-weight: 700; color: var(--text); }
.footer-brand-sub { font-size: 11px; color: var(--text-muted); }
.footer-sep { margin: 0 8px; color: var(--text-faint); }
.footer-tagline { font-size: 13px; color: var(--text-muted); flex: 1; }
.footer-bottom {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-faint);
}
.footer-links { display: flex; gap: 12px; }
.footer-links a { color: var(--text-muted); font-size: 12px; }
.footer-links a:hover { color: var(--primary); text-decoration: none; }
.footer-contact { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.footer-social { display: flex; gap: 8px; }
.footer-social a {
  width: 28px; height: 28px; border-radius: var(--radius);
  background: var(--surface-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted); transition: all var(--transition);
  text-decoration: none;
}
.footer-social a:hover { background: var(--primary-glow); color: var(--primary); border-color: rgba(14,165,233,0.3); text-decoration: none; }

/* ══════════════════════════════════════════
   29. PHASE PROGRESS (8-Phase Workflow)
══════════════════════════════════════════ */
.phase-progress { margin: 14px 0; }
.phase-steps { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.phase-step {
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 10px; font-weight: 700; border: 1px solid var(--border);
  color: var(--text-faint); background: var(--surface-2);
  transition: all var(--transition-slow);
}
.phase-step.active { background: var(--primary-glow); color: var(--primary); border-color: rgba(14,165,233,0.4); }
.phase-step.done { background: var(--success-bg); color: var(--success); border-color: rgba(34,197,94,0.4); }

/* ══════════════════════════════════════════
   30. MISC & UTILS
══════════════════════════════════════════ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.w-full { width: 100%; }

/* Raw textarea output */
.raw-textarea {
  width: 100%; min-height: 500px; padding: 14px;
  background: #0d1117; color: #e6edf3;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  line-height: 1.7; resize: vertical;
}

/* Active tab highlight */
.tab-btn.active, .active-tab {
  background: var(--primary-glow) !important;
  color: var(--primary) !important;
  border-color: rgba(14,165,233,0.35) !important;
}
.active-count {
  background: var(--primary-glow) !important;
  color: var(--primary) !important;
  border-color: rgba(14,165,233,0.35) !important;
}

/* ══════════════════════════════════════════
   31. ANIMATIONS
══════════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-3px)} 80%{transform:translateX(3px)} }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateY(4px); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ══════════════════════════════════════════
   32. RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 767px) {
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%); z-index: 200;
    transition: transform var(--transition-slow);
    width: var(--sidebar-width) !important;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .menu-toggle { display: flex; }
  .app-header { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 8px; }
  .header-center { order: 3; width: 100%; }
  .provider-tabs { width: 100%; overflow-x: auto; }
  .main-content { margin-left: 0; }
  .view-container { padding: 16px; }
  .two-panel { grid-template-columns: 1fr; }
  .tool-cards-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .security-grid { grid-template-columns: 1fr; }
  .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-contact { margin-left: 0; }
  #api-key-input { width: 130px; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar .nav-label,
  .sidebar .logo-text,
  .sidebar .nav-section-label,
  .sidebar-bottom-text { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
  .two-panel { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .view-container { padding: 12px; }
  .breakdown-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   33. PHASE 2 ADDITIONS
══════════════════════════════════════════ */

/* Status Bar Phase 2 (Fix 2.1) — two-row layout */
.status-bar {
  display: flex; flex-direction: column; gap: 0;
  padding: 8px 16px 6px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.status-bar.hidden { display: none !important; }
.status-bar-top {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; margin-bottom: 6px;
}
.status-bar-top > span:first-child { font-size: 14px; }
.status-bar-top > span:nth-child(2) { flex: 1; color: var(--text-muted); font-size: 12px; }

/* Provider badge in status bar */
.provider-badge {
  font-size: 11px; color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px; border-radius: var(--radius-full);
  white-space: nowrap; margin-left: auto;
}
.status-percent {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--gold); font-weight: 700;
}
.progress-track { width: 100%; height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #ef4444, #f97316, #eab308);
  transition: width 0.4s ease;
}
.status-bar.status-success .progress-fill { background: var(--success); }
.status-bar.status-error .progress-fill { background: var(--error); }

/* Cancel AI button (Bug 5.2) */
.btn-cancel {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  background: var(--error-bg); border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius); color: var(--error);
  font-size: 11px; font-weight: 700; cursor: pointer;
  transition: all var(--transition); white-space: nowrap; flex-shrink: 0;
}
.btn-cancel:hover { background: rgba(239,68,68,0.2); }

/* KPI grid — 4 columns (Dashboard) */
.kpi-grid { grid-template-columns: repeat(4, 1fr); }
.kpi-icon-green { background: rgba(34,197,94,0.12); }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Full Footer Grid (Fix 6.1) */
.app-footer {
  margin-top: 40px;
  padding: 28px 0 0;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 0;
}
.footer-brand-col { grid-column: 1; }
.footer-links-col { grid-column: auto; }
.footer-logo-row { display: flex; align-items: center; gap: 10px; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: span 2; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand-col { grid-column: 1; }
}

/* SERP Preview (Feature 3.3) */
.serp-preview-wrapper { background: #fff; border-radius: 8px; padding: 18px; }

/* Editable Meta suggestions (Feature 4.2) */
.meta-edit-row { display: flex; align-items: center; gap: 8px; }

/* Model search input in sidebar */
.model-search-input {
  width: 100%; padding: 6px 10px; font-size: 12px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  margin-bottom: 4px;
}
.model-search-input:focus { outline: none; border-color: var(--primary); }
.model-selector {
  width: 100%; padding: 6px 8px; font-size: 12px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
}

/* Sidebar divider text */
.sidebar-divider {
  font-size: 9px; color: var(--text-faint);
  text-align: center; letter-spacing: 3px;
  padding: 4px 0;
}

/* AI status indicator in sidebar */
.ai-status-indicator {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 0;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); flex-shrink: 0;
}

/* OpenRouter config block in sidebar */
.openrouter-config {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px;
  margin-bottom: 6px;
}
.openrouter-config.hidden { display: none; }
.badge-loaded {
  display: block; font-size: 10px; font-weight: 700;
  color: var(--success); margin-bottom: 6px;
}

/* Phase step done/active (existing classes, kept for clarity) */
.phase-step.active { background: var(--primary-glow); color: var(--primary); border-color: rgba(14,165,233,0.4); animation: pulse 1.5s ease infinite; }

/* Tab active-tab highlight fix */
.active-tab {
  background: var(--primary-glow) !important;
  color: var(--primary) !important;
  border-color: rgba(14,165,233,0.35) !important;
}

/* ══════════════════════════════════════════
   34. PHASE 3 — Streaming, History, Onboarding, Quality
══════════════════════════════════════════ */

/* ── Theme smooth transition (P4) ── */
[data-transitioning="true"] *,
[data-transitioning="true"] *::before,
[data-transitioning="true"] *::after {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease !important;
}

/* ── Streaming Output (P1) ── */
.stream-status-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(14,165,233,0.06);
  border: 1px solid rgba(14,165,233,0.2);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 12px; color: var(--text-muted);
}
.stream-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--error); flex-shrink: 0;
  animation: pulse 1s ease infinite;
}
.stream-wc-live {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--gold); font-weight: 700;
}
.stream-output {
  min-height: 300px; max-height: 60vh;
  overflow-y: auto; padding: 16px;
  background: var(--surface);
  border: 1px solid rgba(14,165,233,0.2);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px; line-height: 1.85; color: var(--text);
}
.stream-output p { margin: 8px 0; }
.stream-output h2 { font-size: 16px; font-weight: 700; color: var(--primary); margin: 16px 0 6px; }
.stream-output h3 { font-size: 14px; font-weight: 700; margin: 12px 0 4px; }
.stream-output ul, .stream-output ol { padding-left: 20px; margin: 8px 0; }
.stream-output li { margin: 3px 0; }
.stream-output strong { color: var(--text); }
.stream-output code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* ── Word Count Target buttons (P6) ── */
.word-target-btns {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin-bottom: 8px;
}
.word-target-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 4px; gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: all var(--transition);
}
.word-target-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.word-target-btn.active-wt {
  background: var(--primary-glow);
  border-color: rgba(14,165,233,0.5);
  color: var(--primary);
}
.wt-num { font-size: 14px; font-weight: 800; color: var(--text); line-height: 1; }
.wt-label { font-size: 10px; color: var(--text-faint); }
.word-target-btn.active-wt .wt-num,
.word-target-btn.active-wt .wt-label { color: var(--primary); }

/* Word count progress bar ── */
.wc-target-bar { margin-top: 8px; }
.wc-progress-track {
  width: 100%; height: 6px; background: var(--surface-3);
  border-radius: 3px; overflow: hidden;
}
.wc-progress-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.5s ease, background-color 0.3s ease;
}
.wc-progress-fill.wc-low { background: var(--error); }
.wc-progress-fill.wc-ok  { background: var(--warning); }
.wc-progress-fill.wc-great { background: var(--success); }

/* ── Local Quality Score box (P6) ── */
.quality-score-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  margin-bottom: 12px;
}
.qs-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; font-size: 12px; font-weight: 700;
  color: var(--text-muted);
}
.qs-badge {
  font-size: 18px; font-weight: 900;
}
.qs-checks { display: flex; flex-direction: column; gap: 4px; }
.qs-check-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.qs-check-row:last-child { border: none; }
.qs-icon { font-size: 12px; width: 16px; text-align: center; flex-shrink: 0; }
.qs-label { flex: 1; color: var(--text-muted); white-space: nowrap; }
.qs-detail { font-size: 10px; color: var(--text-faint); text-align: right; flex: 1; }
.qs-pts { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }

/* ── History Panel (P2) ── */
.history-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.history-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  background: transparent;
  border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  margin-bottom: -1px;
}
.history-tab:hover { color: var(--text); }
.history-tab.active {
  color: var(--primary); border-bottom-color: var(--primary);
}
.history-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  background: var(--primary-glow); color: var(--primary);
  border-radius: 50%; font-size: 10px; font-weight: 700;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  transition: all var(--transition);
}
.history-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.history-card-header {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px;
}
.history-card-icon { font-size: 20px; flex-shrink: 0; }
.history-card-meta { flex: 1; min-width: 0; }
.history-card-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.history-card-date { font-size: 11px; color: var(--text-faint); }
.history-card-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.history-empty {
  text-align: center; padding: 40px 20px;
  display: flex; flex-direction: column; align-items: center;
}

/* ── Onboarding (P5) ── */
.onboarding-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.4s ease;
}
.onboarding-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 520px; max-width: calc(100vw - 32px);
  text-align: center;
  box-shadow: 0 16px 64px rgba(0,0,0,0.7), 0 0 40px rgba(14,165,233,0.08);
  animation: fadeInUp 0.4s ease;
}
.onboarding-skip {
  position: absolute; top: 16px; right: 16px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-faint);
  font-size: 11px; padding: 4px 10px; cursor: pointer;
  transition: all var(--transition);
}
.onboarding-skip:hover { color: var(--text); background: var(--surface-2); }
.onboarding-dots {
  display: flex; gap: 6px; justify-content: center;
  margin-bottom: 24px;
}
.ob-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--border);
  transition: all var(--transition);
}
.ob-dot.active { background: var(--primary); border-color: var(--primary); width: 22px; border-radius: 4px; }
.ob-dot.done { background: var(--success); border-color: var(--success); }
.onboarding-icon { font-size: 52px; margin-bottom: 16px; }
.onboarding-title {
  font-size: 20px; font-weight: 800; color: var(--text);
  margin-bottom: 10px;
}
.onboarding-desc {
  font-size: 13px; color: var(--text-muted);
  line-height: 1.7; margin-bottom: 20px;
}
.onboarding-tools {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 20px;
  text-align: left;
}
.ob-tool {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.onboarding-providers {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 20px; text-align: left;
}
.ob-provider {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none;
  transition: all var(--transition);
}
.ob-provider:hover { background: var(--surface-3); border-color: var(--border-strong); text-decoration: none; }
.ob-provider span:first-child { flex: 1; }
.ob-best {
  border-color: rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.06);
}
.onboarding-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 24px;
}

/* ── Keyword table sort icons (P3) ── */
.kw-sort-header { cursor: pointer; user-select: none; }
.kw-sort-header:hover { color: var(--primary); }
.kw-sort-header.sort-asc::after { content: ' ↑'; color: var(--primary); font-size: 10px; }
.kw-sort-header.sort-desc::after { content: ' ↓'; color: var(--primary); font-size: 10px; }

/* Keyword filter toolbar ── */
.kw-toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.kw-search {
  flex: 1; min-width: 160px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 12px;
  color: var(--text); font-size: 12px;
}
.kw-search:focus { outline: none; border-color: var(--primary); }
.kw-filter-select {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 10px;
  color: var(--text); font-size: 12px; cursor: pointer;
}

/* ══════════════════════════════════════════
   35. PHASE 4 — Firebase Integration Styles
══════════════════════════════════════════ */

/* Auth Screen Custom tabs & styles */
.auth-tab {
  transition: all var(--transition);
}
.auth-tab.active {
  border-bottom-color: var(--primary) !important;
  color: var(--primary) !important;
}
.auth-tab:hover {
  background: var(--surface-3) !important;
}
.btn-social-google:hover {
  background: var(--surface-3) !important;
  border-color: var(--border-strong) !important;
}

/* User sidebar profile panel */
.sidebar-user-panel {
  transition: all var(--transition);
}
.sidebar-user-panel img {
  border-radius: 50%;
  border: 2px solid var(--primary-glow);
}
.user-email {
  font-family: 'Inter', sans-serif;
}

/* Cloud sync badge & states */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  transition: all var(--transition);
}
.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: all var(--transition);
}
.sync-dot.sync-success {
  background: var(--success) !important;
  box-shadow: 0 0 8px var(--success-glow);
}
.sync-dot.sync-error {
  background: var(--error) !important;
  box-shadow: 0 0 8px var(--error-glow);
}
.sync-dot.sync-pulse {
  background: var(--warning) !important;
  animation: sync-pulse-anim 1s ease-infinite;
}

@keyframes sync-pulse-anim {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.sync-status-syncing {
  color: var(--warning) !important;
}
.sync-status-synced {
  color: var(--success) !important;
}
.sync-status-error {
  color: var(--error) !important;
}

/* ══════════════════════════════════════════
   36. PHASE 8 — Premium User Profile Dropdown, Badges, Rewrite & Command Palette
══════════════════════════════════════════ */

/* User Sidebar Profile dropdown & trigger style */
.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.user-profile:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.user-profile .avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  flex-shrink: 0;
}
#user-info {
  min-width: 0;
  flex: 1;
}

/* Dropdown menu styling */
.profile-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 1px var(--border-strong);
  overflow: hidden;
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-menu button {
  padding: 11px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition);
}
.profile-menu button:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Sidebar navigation badge counter styling */
.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(14,165,233,0.3);
  animation: scaleIn 0.2s ease;
}

/* Floating selection-based rewrite toolbar */
.rewrite-toolbar {
  position: absolute;
  display: flex;
  align-items: center;
  background: rgba(10,15,30,0.95);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 4px 6px;
  gap: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6), 0 0 15px rgba(14,165,233,0.15);
  backdrop-filter: blur(10px);
  z-index: 1000;
  animation: scaleIn 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.rewrite-toolbar .btn-tb {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.rewrite-toolbar .btn-tb:hover {
  background: var(--primary-glow);
  color: var(--primary);
}

/* Command Palette layout */
.command-palette-overlay {
  animation: fadeIn 0.2s ease;
}
.command-palette-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cp-item {
  border-left: 3px solid transparent;
}
.cp-item.active {
  background: var(--surface-2);
  border-left-color: var(--primary);
}
.cp-item:hover {
  background: var(--surface-2);
}

/* Keyframe Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================
   PHASE 10 — Stage 2: UX/UI Optimization
   G-Skills Rebranding + 10 Providers
   ============================================ */

/* --- Logo Brand --- */
.brand-logo-wrap,
.footer-brand-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
}

.footer-brand-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: brightness(1.1);
}

/* --- Provider Tabs: 10 providers scroll --- */
#provider-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  max-width: calc(100vw - 520px);
}

#provider-tabs::-webkit-scrollbar {
  height: 3px;
}

#provider-tabs::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
}

#provider-tabs .provider-tab {
  flex-shrink: 0;
  scroll-snap-align: start;
  white-space: nowrap;
  font-size: 12px;
  padding: 4px 10px;
}

/* --- Dashboard provider badges wrap --- */
.provider-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 700px;
  margin: 0 auto;
}

/* --- Mobile Responsive: Provider Tabs --- */
@media (max-width: 768px) {
  #provider-tabs {
    max-width: calc(100vw - 60px);
    padding-bottom: 4px;
  }

  #provider-tabs .provider-tab {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* Sidebar collapsed state */
  #sidebar.collapsed .brand-logo-img {
    width: 28px;
    height: 28px;
  }

  #sidebar.collapsed .brand-name,
  #sidebar.collapsed .brand-tagline {
    display: none;
  }
}

/* --- Mobile: Header layout --- */
@media (max-width: 600px) {
  #app > :not(#sidebar) {
    flex-direction: column;
  }

  #breadcrumb {
    display: none;
  }

  #provider-tabs {
    max-width: calc(100vw - 40px);
  }

  .brand-logo-img {
    width: 30px;
    height: 30px;
  }
}

/* --- Footer: Mobile 2-column --- */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px;
  }

  .footer-brand-col {
    grid-column: 1 / -1;
  }

  .footer-brand-logo-img {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- New provider tab colors --- */
.provider-tab[data-provider="qwen"].active,
.provider-tab[data-provider="qwen"]:hover {
  background: rgba(255, 106, 0, 0.2);
  border-color: #FF6A00;
  color: #FF6A00;
}

.provider-tab[data-provider="perplexity"].active,
.provider-tab[data-provider="perplexity"]:hover {
  background: rgba(31, 184, 205, 0.2);
  border-color: #1FB8CD;
  color: #1FB8CD;
}

.provider-tab[data-provider="nvidia"].active,
.provider-tab[data-provider="nvidia"]:hover {
  background: rgba(118, 185, 0, 0.2);
  border-color: #76B900;
  color: #76B900;
}

/* --- API Key input placeholder per provider --- */
#api-key-input[data-provider="qwen"]::placeholder { color: #FF6A00; opacity: 0.6; }
#api-key-input[data-provider="perplexity"]::placeholder { color: #1FB8CD; opacity: 0.6; }
#api-key-input[data-provider="nvidia"]::placeholder { color: #76B900; opacity: 0.6; }

/* --- Dashboard: 10 providers label update --- */
.dashboard-hero-desc strong {
  color: var(--accent-color, #FFD700);
}

img[alt='G-Skills'], .brand-logo-img {
  width:36px!important; height:36px!important;
  max-width:36px!important; max-height:36px!important;
  object-fit:contain!important; border-radius:6px!important;
}
#provider-tabs { overflow-x:auto!important; flex-wrap:nowrap!important; }
#provider-tabs button { flex-shrink:0!important; font-size:11px!important; padding:3px 9px!important; }
/* PHASE 10 HOTFIX */
#sidebar img[alt="G-Skills"], img.brand-logo-img {
  width:36px!important; height:36px!important;
  max-width:36px!important; max-height:36px!important;
  object-fit:contain!important; border-radius:8px!important;
}
#provider-tabs { display:flex!important; flex-wrap:nowrap!important; overflow-x:auto!important; max-width:calc(100vw - 460px)!important; }
#provider-tabs button, #provider-tabs .provider-tab { flex-shrink:0!important; font-size:11px!important; padding:3px 8px!important; white-space:nowrap!important; }

/* PHASE 10 LOGO FIX */
.brand-logo-img, #sidebar img[alt='G-Skills'] { background: #1a2235 !important; border-radius: 8px !important; }


/* PHASE 10 - HEADER TABS 10 PROVIDERS FIX */
#provider-tabs {
  display:flex!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  max-width:calc(100vw - 420px)!important;
  scrollbar-width:none!important;
  -webkit-overflow-scrolling:touch!important;
  gap:2px!important;
}
#provider-tabs::-webkit-scrollbar { display:none!important; }
#provider-tabs button, #provider-tabs .provider-tab {
  flex-shrink:0!important;
  font-size:11px!important;
  padding:3px 7px!important;
  white-space:nowrap!important;
  min-width:unset!important;
}

/* --- Phase 10 Model Connection & Explorer Styles --- */
.ai-provider-status:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

#api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-green {
  background-color: #22c55e !important;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.dot-red {
  background-color: #ef4444 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.dot-gray {
  background-color: #64748b !important;
}

/* Model Explorer Modal Styles */
#model-explorer-modal .modal-box {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
}

#model-table th, #model-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#model-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.btn-select-model {
  background: var(--primary-glow) !important;
  border: 1px solid rgba(14, 165, 233, 0.3) !important;
  color: var(--primary) !important;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-select-model:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

#modal-search:focus {
  outline: none;
  border-color: var(--primary) !important;
}
