/* ============================================================
   additions.css — Phase 3
   Mobile-first · RTL hardened · New components
   ============================================================ */

/* ---------- AI Layer Components ---------- */

/* Spinning loader */
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: #8B5CF6;
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
.ai-spinner-sm {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: #8B5CF6;
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* Loading card (full-width in insights grid) */
.ai-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.ai-loading-text { margin: 0; color: var(--text-muted); }

/* Inline loading row (inside future plan card) */
.ai-loading-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Summary bar above AI insights grid */
.ai-summary-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(0,198,255,0.06));
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* Small "Claude AI" badge inline */
.ai-badge-inline {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: linear-gradient(135deg, #8B5CF6, #00C6FF);
  color: #fff;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Footer label on AI insight cards */
.ai-insight-footer {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 8px;
  opacity: 0.7;
}

/* AI Strategy card in future plan */
.ai-strategy-card {
  border-left: 3px solid #8B5CF6;
}
.ai-strategy-body {
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

/* ---------- Content Type Chips ---------- */
.content-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.content-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}
.content-chip:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}
.content-chip.selected {
  border-color: var(--accent-purple);
  background: rgba(139,92,246,0.15);
  color: var(--accent-purple);
}

/* ---------- Creator type tags on search cards ---------- */
.creator-type-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}
.creator-type-tag {
  padding: 2px 9px;
  border-radius: 12px;
  background: rgba(139,92,246,0.13);
  color: var(--accent-purple);
  font-size: 0.73rem;
  font-weight: 600;
}

/* ---------- Sidebar nav badge (pending requests count) ---------- */
.nav-badge {
  margin-left: auto;
  background: var(--accent-purple);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ---------- Request cards (creator inbox) ---------- */
.request-card { padding: 20px 24px; margin-bottom: 14px; }
.request-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.request-brand    { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.request-campaign { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }
.request-status-badge {
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.req-status-pending  { background: rgba(251,191,36,0.15);  color: #f59e0b; }
.req-status-accepted { background: rgba(52,211,153,0.15);  color: #34d399; }
.req-status-declined { background: rgba(248,113,113,0.15); color: #f87171; }
.request-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.83rem; color: var(--text-secondary); margin-bottom: 10px; }
.request-keymsg { font-size: 0.88rem; color: var(--text-primary); font-style: italic; margin-bottom: 6px; line-height: 1.5; }
.request-req    { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 6px; }
.request-date   { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 12px; }
.request-actions { display: flex; gap: 10px; }

/* ---------- Mobile hamburger always visible on small screens ---------- */
@media (max-width: 768px) {
  #menuToggle { display: flex !important; }
  .dashboard-main { padding: 16px 12px 80px; }
  .sidebar { transform: translateX(-100%); width: 260px; }
  body[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0) !important; box-shadow: 4px 0 24px rgba(0,0,0,0.5); }
  body[dir="rtl"] .sidebar.open { box-shadow: -4px 0 24px rgba(0,0,0,0.5); }
  .dashboard-main { margin-left: 0 !important; margin-right: 0 !important; }
  .dash-header { flex-direction: column; align-items: flex-start; }
  .charts-grid { grid-template-columns: 1fr !important; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-visual { order: -1; }
  .hero-visual svg { max-width: 280px; margin: 0 auto; }
  .hero-cta { justify-content: center; }
  .hero-stats { justify-content: center; flex-wrap: wrap; gap: 20px; }
  .auth-card { padding: 28px 18px; }
  .upload-mobile-btn { display: flex !important; }
  .upload-desktop-hint { display: none !important; }
  .future-plan-grid { grid-template-columns: 1fr !important; }
  .pricing-result-grid { grid-template-columns: 1fr !important; }
  .settings-grid { grid-template-columns: 1fr !important; }
  .nav-links { display: none; }
}

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

/* ---------- Sidebar overlay for mobile ---------- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 49;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ---------- RTL Hardening ---------- */
[dir="rtl"] .sidebar {
  left: auto; right: 0;
  border-right: none; border-left: 1px solid var(--border);
}
[dir="rtl"] .dashboard-main { margin-left: 0; margin-right: 260px; }
[dir="rtl"] .kpi-card::after {
  left: auto; right: 0;
  background: linear-gradient(270deg, currentColor, transparent);
}
[dir="rtl"] .insight-header { flex-direction: row-reverse; }
[dir="rtl"] .insight-rec { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .section-heading { flex-direction: row-reverse; }
[dir="rtl"] .nav-brand { flex-direction: row-reverse; }
[dir="rtl"] .dash-title,
[dir="rtl"] .dash-sub { text-align: right; }
[dir="rtl"] .toast-container { right: auto; left: 24px; }
[dir="rtl"] .hero-badge { flex-direction: row-reverse; }
[dir="rtl"] .filter-bar { flex-direction: row-reverse; }

[dir="rtl"] .toggle-row { flex-direction: row-reverse; }
[dir="rtl"] .toggle-switch { margin-left: 0; margin-right: 16px; }
[dir="rtl"] .plan-card-label { text-align: right; }
[dir="rtl"] .action-item { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .chart-panel-header { flex-direction: row-reverse; }
[dir="rtl"] .form-label { text-align: right; }
[dir="rtl"] .auth-sub { text-align: right; }
[dir="rtl"] .sidebar-section-label { text-align: right; }
[dir="rtl"] .sidebar-name,
[dir="rtl"] .sidebar-role { text-align: right; }
[dir="rtl"] .sidebar-footer { text-align: right; }
[dir="rtl"] #logoutBtnSidebar svg { transform: scaleX(-1); }
[dir="rtl"] .sidebar { direction: rtl; }
[dir="rtl"] .sidebar-link { justify-content: flex-start; }
[dir="rtl"] .sim-compare-item { text-align: right; }
[dir="rtl"] .brand-metric-row { flex-direction: row-reverse; }
[dir="rtl"] .pricing-breakdown-row { flex-direction: row-reverse; }

/* KPI cards */
[dir="rtl"] .kpi-card { text-align: right; }

/* Plan cards & confidence */
[dir="rtl"] .plan-card { text-align: right; }
[dir="rtl"] .plan-confidence-row { flex-direction: row-reverse; }
[dir="rtl"] .plan-explanation-header { flex-direction: row-reverse; }

/* Simulation */
[dir="rtl"] .simulation-section-header { flex-direction: row-reverse; }
[dir="rtl"] .sim-controls { flex-direction: row-reverse; }

/* Pricing section */
[dir="rtl"] .pricing-breakdown-title { text-align: right; }
[dir="rtl"] .pricing-disclaimer { text-align: right; }
[dir="rtl"] .confidence-row { flex-direction: row-reverse; }

/* Settings */
[dir="rtl"] .settings-card-title { flex-direction: row-reverse; }
[dir="rtl"] .info-banner { flex-direction: row-reverse; }
[dir="rtl"] .sim-methodology { text-align: right; }

/* Brand report */
[dir="rtl"] .brand-report-header { flex-direction: row-reverse; }
[dir="rtl"] .brand-scores-row .brand-score-card { text-align: right; }

/* Brand overview — header banner */
[dir="rtl"] .brand-header-banner { direction: rtl; }
[dir="rtl"] .brand-header-banner > div { text-align: right; }
/* Brand overview — section heading: push h2 to the right in RTL */
[dir="rtl"] .section-heading h2   { order: 2; text-align: right; }
[dir="rtl"] .section-heading .line { order: 1; }
/* Brand overview — feature cards (use .card, not .kpi-card) */
[dir="rtl"] #section-brand-overview .card { text-align: right; }

/* Find creators — search bar */
[dir="rtl"] .creator-search-bar { flex-direction: row-reverse; }
/* Find creators — result cards */
[dir="rtl"] .creator-result-card { flex-direction: row-reverse; }
[dir="rtl"] .creator-result-info { text-align: right; }
[dir="rtl"] .creator-type-tags   { justify-content: flex-end; }

/* Request cards (brand + creator requests share these classes) */
[dir="rtl"] .request-card-header { flex-direction: row-reverse; }
[dir="rtl"] .request-brand,
[dir="rtl"] .request-campaign    { text-align: right; }
[dir="rtl"] .request-meta        { justify-content: flex-end; }
[dir="rtl"] .request-keymsg,
[dir="rtl"] .request-req,
[dir="rtl"] .request-date        { text-align: right; }
[dir="rtl"] .request-actions     { flex-direction: row-reverse; }

@media (max-width: 768px) {
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  [dir="rtl"] .sidebar.open { transform: translateX(0); }
  [dir="rtl"] .dashboard-main { margin-right: 0; }
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.filter-label {
  font-size: 0.82rem; font-weight: 700;
  color: var(--text-muted); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.06em;
}
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  padding: 5px 14px; border-radius: 100px;
  font-size: 0.82rem; font-weight: 600;
  background: var(--bg-card); border: 1.5px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition);
}
.filter-pill:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.filter-pill.active {
  background: rgba(0,198,255,0.1); border-color: var(--accent-blue); color: var(--accent-blue);
}
.filter-select {
  padding: 6px 30px 6px 12px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1.5px solid var(--border);
  color: var(--text-primary); font-size: 0.85rem; cursor: pointer;
  outline: none; transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238899BB' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.filter-select:focus { border-color: var(--accent-blue); }
.reset-zoom-btn {
  padding: 5px 12px; border-radius: var(--radius-sm);
  background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.3);
  color: var(--accent-purple); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.reset-zoom-btn:hover { background: rgba(139,92,246,0.2); }

/* ---------- Future Plan ---------- */
.period-selector {
  display: flex; gap: 12px; margin-bottom: 32px; flex-wrap: wrap;
}
.period-btn {
  padding: 12px 28px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1.5px solid var(--border);
  color: var(--text-secondary); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.period-btn:hover { border-color: var(--accent-purple); color: var(--accent-purple); }
.period-btn.active {
  background: rgba(139,92,246,0.12); border-color: var(--accent-purple);
  color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(139,92,246,0.08);
}
.future-plan-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 28px;
}
.plan-card {
  background: var(--grad-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--glow-card);
  transition: all var(--transition);
}
.plan-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.plan-card-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 8px;
}
.plan-card-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; margin-bottom: 4px; }
.plan-card-sub { font-size: 0.82rem; color: var(--text-secondary); }
.plan-card.highlight {
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(0,198,255,0.04));
  border-color: rgba(139,92,246,0.25);
}
.risk-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px;
  font-size: 0.85rem; font-weight: 700;
}
.risk-high   { background: rgba(248,113,113,0.12); color: var(--accent-red); border: 1px solid rgba(248,113,113,0.3); }
.risk-medium { background: rgba(251,146,60,0.12);  color: var(--accent-orange); border: 1px solid rgba(251,146,60,0.3); }
.risk-low    { background: rgba(52,211,153,0.12);  color: var(--accent-green); border: 1px solid rgba(52,211,153,0.3); }

.action-plan-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.action-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: rgba(0,198,255,0.03);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55;
}
.action-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-blue); flex-shrink: 0; margin-top: 5px;
}

/* ---------- Compact Projections Summary ---------- */
.plan-projections-summary {
  display: flex; flex-wrap: wrap; gap: 0;
  background: rgba(0,0,0,0.1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 16px; overflow: hidden;
}
.proj-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 20px; flex: 1; min-width: 120px;
  border-right: 1px solid var(--border);
}
.proj-item:last-child { border-right: none; }
.proj-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--text-muted);
}
.proj-value {
  font-size: 1.15rem; font-weight: 700; line-height: 1.2; color: var(--text-primary);
}
.proj-value--sm { font-size: 0.9rem; }
.proj-sub { font-size: 0.75rem; color: var(--text-secondary); }
[dir="rtl"] .proj-item { border-right: none; border-left: 1px solid var(--border); text-align: right; }
[dir="rtl"] .proj-item:last-child { border-left: none; }
@media (max-width: 600px) {
  .proj-item { min-width: 45%; border-right: none; border-bottom: 1px solid var(--border); }
  .proj-item:last-child { border-bottom: none; }
  [dir="rtl"] .proj-item { border-left: none; }
}

/* ---------- Projection Confidence Row ---------- */
.plan-confidence-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; background: rgba(0,0,0,0.12);
  border-radius: var(--radius-md); margin-bottom: 24px;
  border: 1px solid var(--border);
}
.confidence-label-text {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); white-space: nowrap;
}
.confidence-score-text {
  font-size: 0.88rem; font-weight: 700; white-space: nowrap; cursor: help;
}

/* ---------- Plan Explanation (collapsible) ---------- */
.plan-explanation {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; margin-bottom: 20px;
}
.plan-explanation-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; cursor: pointer;
  font-size: 0.88rem; font-weight: 600; color: var(--text-secondary);
  user-select: none; transition: background var(--transition);
}
.plan-explanation-header:hover { background: rgba(255,255,255,0.03); }
.plan-explanation-header svg { transition: transform 0.25s ease; flex-shrink: 0; }
.plan-explanation.open .plan-explanation-header svg { transform: rotate(180deg); }
.plan-explanation-body {
  display: none; padding: 0 18px 18px;
  font-size: 0.84rem; color: var(--text-secondary); line-height: 1.7;
}
.plan-explanation-body p { margin-bottom: 8px; }
.plan-explanation-body p:last-child { margin-bottom: 0; }
.plan-explanation.open .plan-explanation-body { display: block; }

/* ---------- Scenario Simulation ---------- */
.simulation-section-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.simulation-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.3);
  color: var(--accent-purple);
}
.sim-controls {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.sim-control-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 180px; }
.sim-label-text {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
}
.sim-result-area {
  border-radius: var(--radius-md); border: 1px solid var(--border);
  padding: 20px; min-height: 80px; transition: all var(--transition);
}
.sim-placeholder { text-align: center; color: var(--text-muted); font-size: 0.88rem; padding: 20px 0; }
.sim-compare-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 14px;
}
.sim-compare-item {
  background: rgba(0,0,0,0.12); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
}
.sim-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px;
}
.sim-before { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 4px; }
.sim-arrow  { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; }
.sim-after  { font-size: 1.05rem; font-weight: 700; }
.sim-delta  { font-size: 0.78rem; font-weight: 500; opacity: 0.8; margin-left: 4px; }
.sim-warning {
  background: rgba(248,113,113,0.07); border: 1px solid rgba(248,113,113,0.25);
  border-radius: var(--radius-md); padding: 12px 16px;
  font-size: 0.85rem; color: var(--accent-red); margin-bottom: 14px; line-height: 1.55;
}
.sim-methodology {
  font-size: 0.77rem; color: var(--text-muted); line-height: 1.6; padding: 10px 14px;
  background: rgba(0,0,0,0.1); border-radius: var(--radius-sm); margin-top: 8px;
}

/* ---------- Ad Pricing ---------- */
.pricing-result-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px;
}
.pricing-main-card {
  background: var(--grad-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px; box-shadow: var(--glow-card);
}
.pricing-class-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 100px;
  font-size: 1rem; font-weight: 800; margin-bottom: 20px;
}
.class-underpriced { background: rgba(251,146,60,0.1); color: var(--accent-orange); border: 1px solid rgba(251,146,60,0.3); }
.class-fair        { background: rgba(52,211,153,0.1); color: var(--accent-green); border: 1px solid rgba(52,211,153,0.3); }
.class-overpriced  { background: rgba(248,113,113,0.1); color: var(--accent-red); border: 1px solid rgba(248,113,113,0.3); }
.price-range {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin: 20px 0;
}
.price-tier {
  text-align: center; padding: 14px 8px;
  border-radius: var(--radius-md); border: 1px solid var(--border);
}
.price-tier.ideal { background: rgba(139,92,246,0.08); border-color: rgba(139,92,246,0.3); }
.price-tier-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 6px;
}
.price-tier-value { font-size: 1.35rem; font-weight: 800; }
.price-tier.ideal .price-tier-value { color: var(--accent-purple); }

.confidence-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.confidence-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.confidence-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.confidence-label { font-size: 0.8rem; font-weight: 700; white-space: nowrap; }

/* Pricing breakdown table */
.pricing-breakdown {
  margin-top: 16px; padding: 14px 16px;
  background: rgba(0,0,0,0.15); border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.pricing-breakdown-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 10px;
}
.pricing-breakdown-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.81rem; color: var(--text-secondary); gap: 8px;
}
.pricing-breakdown-row:last-child { border-bottom: none; }
.pricing-breakdown-row.total {
  font-weight: 700; color: var(--text-primary);
  border-top: 1px solid rgba(255,255,255,0.08); border-bottom: none;
  padding-top: 9px; margin-top: 4px;
}
.pricing-disclaimer {
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.6;
  padding: 11px 14px; background: rgba(0,0,0,0.1);
  border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.04);
  margin-top: 14px; font-style: italic;
}

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.settings-card {
  background: var(--grad-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--glow-card);
}
.settings-card-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px; color: var(--text-primary);
}
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
.toggle-info { flex: 1; }
.toggle-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
.toggle-desc  { font-size: 0.78rem; color: var(--text-muted); }
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; margin-left: 16px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 12px; cursor: pointer; transition: background var(--transition);
}
.toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform var(--transition); box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.toggle-switch input:checked + .toggle-track { background: var(--accent-purple); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(20px); }
.info-banner {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  background: rgba(0,198,255,0.05); border: 1px solid rgba(0,198,255,0.2);
  border-radius: var(--radius-md); font-size: 0.85rem; color: var(--text-secondary);
  margin-top: 14px; line-height: 1.55;
}
.info-icon { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }

/* ---------- Brand Dashboard ---------- */
.brand-header-banner {
  background: linear-gradient(135deg, rgba(0,198,255,0.07), rgba(52,211,153,0.05));
  border: 1px solid rgba(0,198,255,0.2); border-radius: var(--radius-xl);
  padding: 28px 32px; margin-bottom: 28px;
  display: flex; align-items: center; gap: 20px;
}
.brand-header-icon {
  width: 60px; height: 60px; border-radius: var(--radius-md);
  background: rgba(0,198,255,0.12); display: flex; align-items: center;
  justify-content: center; font-size: 1.8rem; flex-shrink: 0;
}
.brand-metric-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.brand-metric-row:last-child { border-bottom: none; }
.brand-metric-label { font-size: 0.85rem; color: var(--text-secondary); }
.brand-metric-value { font-size: 0.92rem; font-weight: 700; }

/* Brand Report - Score Row */
.brand-report-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.brand-scores-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px;
}
.brand-score-card {
  background: var(--grad-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 16px; text-align: center;
  box-shadow: var(--glow-card); transition: all var(--transition);
}
.brand-score-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.brand-score-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px;
}
.brand-score-value {
  font-size: 2.2rem; font-weight: 800; line-height: 1.1; margin-bottom: 6px;
}
.brand-score-sub { font-size: 0.8rem; color: var(--text-secondary); font-weight: 600; }

/* Gradient text helper */
.grad-text {
  background: var(--grad-btn);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Brand Report Grid */
.brand-report-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px;
}
.brand-report-card {
  background: var(--grad-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--glow-card);
}
.brand-risk-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.brand-risk-item:last-child { border-bottom: none; padding-bottom: 0; }
.brand-risk-title { font-size: 0.88rem; font-weight: 700; margin-bottom: 4px; }
.brand-risk-body  { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.55; }

/* Creator Tier Badge */
.brand-tier-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 100px;
  background: rgba(0,198,255,0.08); border: 1px solid rgba(0,198,255,0.25);
  font-size: 0.85rem; font-weight: 700; color: var(--accent-blue);
}

/* Legacy roi-score kept for compatibility */
.roi-score {
  font-size: 3rem; font-weight: 800; text-align: center;
  background: var(--grad-btn);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin: 8px 0;
}

/* ---------- Mobile upload button ---------- */
.upload-mobile-btn {
  display: none; width: 100%; padding: 18px;
  border-radius: var(--radius-lg); background: var(--grad-btn);
  color: #fff; font-size: 1.05rem; font-weight: 700;
  border: none; cursor: pointer; margin-bottom: 16px;
  align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 4px 20px rgba(139,92,246,0.4); transition: transform 0.1s ease;
}
.upload-mobile-btn:active { transform: scale(0.98); }

/* ---------- Empty section state ---------- */
.empty-section {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 20px; text-align: center; color: var(--text-muted);
}
.empty-section-icon  { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.6; }
.empty-section-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.empty-section-sub   { font-size: 0.88rem; max-width: 320px; }

/* ---------- Success pop animation ---------- */
@keyframes success-pop {
  0%  { transform: scale(0.85); opacity: 0; }
  65% { transform: scale(1.05); }
  100%{ transform: scale(1); opacity: 1; }
}
.success-anim { animation: success-pop 0.4s ease forwards; }

/* ---------- Collaboration Request Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl); padding: 32px;
  max-width: 460px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(139,92,246,0.15);
  animation: modal-in 0.2s ease;
}
@keyframes modal-in {
  from { opacity:0; transform:scale(0.94) translateY(12px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer; font-size: 1.1rem;
  color: var(--text-muted); padding: 4px 8px; border-radius: var(--radius-sm);
  transition: color var(--transition); line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Creator Search (Brand Feature) ---------- */
.creator-search-bar {
  display: flex; align-items: center; gap: 12px;
}
.creator-search-input {
  flex: 1; margin: 0 !important;
}
.creator-results-grid {
  display: flex; flex-direction: column; gap: 12px;
}
.creator-result-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; transition: border-color var(--transition);
}
.creator-result-card:hover { border-color: var(--border-strong); }
.creator-result-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; color: #fff; flex-shrink: 0;
}
.creator-result-info { flex: 1; min-width: 0; }
.creator-result-name {
  font-weight: 700; font-size: 0.95rem; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.creator-result-email {
  font-size: 0.82rem; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 540px) {
  .creator-result-card { flex-wrap: wrap; gap: 12px; }
  .creator-result-card .btn { width: 100%; text-align: center; }
  .creator-search-bar { flex-wrap: wrap; }
  .creator-search-input { width: 100%; }
}

/* ---------- Print / PDF report ---------- */
@media print {
  .navbar, .sidebar, .sidebar-overlay, .btn, .filter-bar,
  .period-selector, .sim-controls, #simulationSection,
  #menuToggle { display: none !important; }
  .dashboard-main { margin: 0 !important; padding: 20px !important; }
  .dashboard-layout { display: block !important; }
  body { background: #fff !important; color: #000 !important; }
  .card, .plan-card, .chart-panel, .settings-card,
  .brand-report-card, .brand-score-card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ---------- Responsive overrides for new Phase 3 components ---------- */
@media (max-width: 768px) {
  .brand-scores-row    { grid-template-columns: 1fr !important; }
  .brand-report-grid   { grid-template-columns: 1fr !important; }
  .sim-compare-grid    { grid-template-columns: 1fr 1fr; }
  .sim-controls        { flex-direction: column; }
  .sim-control-group   { min-width: unset; width: 100%; }
  .pricing-breakdown-row { flex-direction: column; gap: 2px; }
  .pricing-breakdown-row span:last-child { font-weight: 700; }
  .plan-confidence-row { flex-wrap: wrap; gap: 8px; }
  .plan-confidence-row .confidence-bar { min-width: 100px; }
}

@media (max-width: 480px) {
  .sim-compare-grid  { grid-template-columns: 1fr; }
  .brand-scores-row  { grid-template-columns: 1fr; }
}

/* ---------- Register page — compact on short viewports (laptops) ---------- */
/* Allow the auth page to scroll instead of clipping the card at the top    */
@media (max-height: 820px) {
  .auth-page {
    align-items: flex-start;
    padding-top: 72px;
    padding-bottom: 24px;
  }
}

/* Tighten spacing so the full form fits without scrolling where possible   */
@media (max-height: 760px) {
  .auth-logo        { margin-bottom: 14px; }
  .auth-logo svg    { width: 28px; height: 28px; }
  .auth-logo-text   { font-size: 1rem; }
  .auth-title       { font-size: 1.3rem; margin-bottom: 4px; }
  .auth-sub         { margin-bottom: 16px; font-size: 0.85rem; }
  .form-group       { margin-bottom: 10px; }
  .role-card        { padding: 10px 10px; gap: 4px; }
  .role-card .role-icon { font-size: 1.4rem; }
  .role-grid        { gap: 8px; margin-bottom: 10px; }
  .content-chip     { padding: 4px 10px; font-size: 0.75rem; }
  .content-type-chips { gap: 6px; }
  .auth-card        { padding: 24px 28px; }
}

/* ---------- Chatbot FAB + Panel ---------- */
/* ── Chat FAB ───────────────────────────────────────────── */
.chat-fab {
  position: fixed; bottom: 20px; right: 24px;
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 200;
  filter: drop-shadow(0 6px 18px rgba(139,92,246,0.6));
  transition: transform 0.25s, filter 0.25s;
  animation: fab-float 3s ease-in-out infinite;
}
.chat-fab:hover {
  transform: scale(1.1) translateY(-5px);
  filter: drop-shadow(0 10px 28px rgba(139,92,246,0.9));
  animation: none;
}
@keyframes fab-float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
body[dir="rtl"] .chat-fab { right: auto; left: 24px; }

/* ── Hero robot — light mode ─────────────────────────────── */
[data-theme="light"] #bodyGrad stop:first-child { stop-color: #DDD6FE; }
[data-theme="light"] #bodyGrad stop:last-child  { stop-color: #C7D2FE; }
[data-theme="light"] #headGrad stop:first-child { stop-color: #C4B5FD; }
[data-theme="light"] #headGrad stop:last-child  { stop-color: #A5B4FC; }
[data-theme="light"] .hr-dark   { fill: #312E81; }
[data-theme="light"] .hr-screen { fill: #EEF2FF; }
[data-theme="light"] .hr-card-val { fill: #1E293B; }

/* Light mode robot adjustments */
[data-theme="light"] .chat-fab {
  filter: drop-shadow(0 6px 18px rgba(109,40,217,0.22));
}
[data-theme="light"] .chat-fab:hover {
  filter: drop-shadow(0 10px 28px rgba(109,40,217,0.38));
}
/* Lighten gradient stops to a brighter palette on light bg */
[data-theme="light"] #fabRG stop:first-child { stop-color: #a78bfa; }
[data-theme="light"] #fabRG stop:last-child  { stop-color: #60a5fa; }
[data-theme="light"] #fabRGd stop:first-child { stop-color: #8b5cf6; }
[data-theme="light"] #fabRGd stop:last-child  { stop-color: #3b82f6; }
/* Inner panel slightly more visible */
[data-theme="light"] .rob-inner  { opacity: 0.3; }
/* Pupils — darker for contrast on lighter head */
[data-theme="light"] .rob-pupil  { fill: #1e293b; }
/* Antenna — darken for visibility on light bg */
[data-theme="light"] .rob-antenna-line { stroke: #7c3aed; }
[data-theme="light"] .rob-antenna-glow { fill: #7c3aed; opacity: 0.25; }
[data-theme="light"] .rob-antenna-tip  { fill: #a78bfa; }

/* speech bubble */
.chat-fab-bubble {
  position: absolute;
  right: calc(100% + 12px); bottom: 28px;
  background: var(--bg-card, #1e1e3a);
  border: 1px solid rgba(139,92,246,0.45);
  border-radius: 14px 14px 0 14px; padding: 9px 15px;
  font-size: 0.82rem; font-weight: 500; white-space: nowrap;
  color: var(--text-primary);
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  pointer-events: none;
  animation: bubble-loop 10s ease infinite;
}
@keyframes bubble-loop {
  0%   { opacity: 0; transform: translateX(10px); }
  8%   { opacity: 1; transform: translateX(0); }
  45%  { opacity: 1; transform: translateX(0); }
  55%  { opacity: 0; transform: translateX(10px); }
  100% { opacity: 0; transform: translateX(10px); }
}
/* tail pointing bottom-right toward the robot */
.chat-fab-bubble::after {
  content: '';
  position: absolute; right: -1px; bottom: -8px;
  border: 8px solid transparent;
  border-bottom: none; border-right: none;
  border-top-color: rgba(139,92,246,0.45);
  border-left-color: transparent;
  width: 0; height: 0;
  border-style: solid;
  border-width: 8px 8px 0 0;
  border-color: rgba(139,92,246,0.45) transparent transparent transparent;
}
body[dir="rtl"] .chat-fab-bubble { right: auto; left: calc(100% + 12px); border-radius: 14px 14px 14px 0; }
body[dir="rtl"] .chat-fab-bubble::after {
  right: auto; left: -1px; bottom: -8px;
  border-color: rgba(139,92,246,0.45) transparent transparent transparent;
  border-width: 8px 0 0 8px;
}

/* ── Chat Panel ─────────────────────────────────────────── */
.chat-resize-handle {
  position: absolute; top: 0; left: 0;
  width: 28px; height: 28px;
  cursor: nw-resize; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px 0 8px 0;
  color: rgba(139,92,246,0.45);
  transition: color 0.15s, background 0.15s;
}
.chat-resize-handle:hover { color: rgba(139,92,246,1); background: rgba(139,92,246,0.1); }
body[dir="rtl"] .chat-resize-handle { left: auto; right: 0; cursor: ne-resize; border-radius: 0 20px 0 8px; }

.chat-panel {
  position: fixed; bottom: 90px; right: 24px;
  width: 390px;
  background: var(--bg-card, #1a1a2e);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.45), 0 0 0 1px rgba(139,92,246,0.1);
  display: flex; flex-direction: column;
  z-index: 199; overflow: hidden;
  transform: translateY(16px) scale(0.96); opacity: 0; pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.chat-panel.open {
  transform: translateY(0) scale(1); opacity: 1; pointer-events: all;
  animation: panel-glow 3s ease-in-out infinite alternate;
}
@keyframes panel-glow {
  from { box-shadow: 0 12px 48px rgba(0,0,0,0.45), 0 0 0 1px rgba(139,92,246,0.2); }
  to   { box-shadow: 0 12px 48px rgba(0,0,0,0.45), 0 0 22px rgba(139,92,246,0.28), 0 0 0 1px rgba(139,92,246,0.45); }
}
body[dir="rtl"] .chat-panel { right: auto; left: 24px; }

/* ── Chat Header ────────────────────────────────────────── */
.chat-header {
  padding: 16px 18px; border-bottom: 1px solid rgba(139,92,246,0.2);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, rgba(139,92,246,0.22), rgba(59,130,246,0.16));
}
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0;
}
.chat-status-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #22c55e; border: 2px solid var(--bg-card, #1a1a2e);
}
.chat-header-text { display: flex; flex-direction: column; gap: 1px; }
.chat-title   { font-weight: 700; font-size: 0.92rem; }
.chat-subtitle { font-size: 0.71rem; color: var(--text-muted); opacity: 0.85; }
.chat-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1rem; padding: 3px 7px;
  border-radius: 6px; transition: color var(--transition), background var(--transition);
}
.chat-close:hover { color: var(--text-primary); background: var(--border); }

/* ── Chat Messages ──────────────────────────────────────── */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 220px; max-height: 360px;
}
/* bot message row (small avatar + bubble) */
.chat-msg-row {
  display: flex; gap: 8px; align-items: flex-end;
  align-self: flex-start; max-width: 92%;
}
body[dir="rtl"] .chat-msg-row { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar-sm {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: flex; align-items: center; justify-content: center;
}
.chat-msg {
  max-width: 100%; padding: 9px 13px; border-radius: 14px;
  font-size: 0.84rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.chat-msg-bot {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
body[dir="rtl"] .chat-msg-bot {
  text-align: right;
  border-bottom-left-radius: 14px; border-bottom-right-radius: 4px;
}
.chat-msg-user {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; max-width: 84%;
}
body[dir="rtl"] .chat-msg-user {
  align-self: flex-start; text-align: right;
  border-bottom-right-radius: 14px; border-bottom-left-radius: 4px;
}

/* typing dots */
.chat-typing { display: flex; gap: 5px; align-items: center; padding: 11px 13px; }
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted);
  animation: chat-bounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chat-bounce {
  0%,80%,100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* ── Suggestion chips ───────────────────────────────────── */
.chat-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 2px 0 4px 0; align-self: flex-start;
}
body[dir="rtl"] .chat-chips { align-self: flex-end; }
.chat-chip {
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.35);
  border-radius: 20px; padding: 6px 14px;
  font-size: 0.78rem; color: var(--accent-purple);
  cursor: pointer; transition: background 0.15s, transform 0.12s;
  font-family: inherit; white-space: nowrap;
}
.chat-chip:hover { background: rgba(139,92,246,0.22); transform: translateY(-1px); }

/* ── Input row ──────────────────────────────────────────── */
.chat-input-row {
  padding: 10px 12px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center;
}
.chat-input {
  flex: 1; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 20px; padding: 8px 14px; color: var(--text-primary);
  font-size: 0.84rem; outline: none; font-family: inherit;
}
.chat-input:focus { border-color: var(--accent-purple); }
.chat-send {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s;
}
.chat-send:hover { opacity: 0.85; }

@media (max-width: 768px) {
  .chat-panel { width: calc(100vw - 32px); right: 16px; bottom: 80px; }
  body[dir="rtl"] .chat-panel { right: auto; left: 16px; }
  .chat-fab { bottom: 16px; right: 16px; }
  body[dir="rtl"] .chat-fab { right: auto; left: 16px; }
}

/* ---------- Health Score Card ---------- */
.health-score-card {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
}
.health-score-left {
  display: flex; align-items: center; gap: 16px; flex-shrink: 0;
}
.health-ring-svg { flex-shrink: 0; }
.health-score-left > div > div:first-child {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 4px;
}
#healthScoreStatus {
  font-size: 1rem; font-weight: 700; color: var(--text-primary);
}
.health-score-right {
  display: flex; gap: 12px; flex-wrap: wrap; flex: 1;
}
.health-component {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; min-width: 90px;
  flex: 1;
}
.health-component-label {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
  text-align: center;
}
.health-component-value {
  font-size: 1.1rem; font-weight: 800; color: var(--text-primary);
}

/* ---------- Explainability Rows ---------- */
.explain-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.explain-row:last-child { border-bottom: none; }
.explain-label {
  font-size: 0.83rem; color: var(--text-muted); font-weight: 500;
}
.explain-value {
  font-size: 0.83rem; color: var(--text-primary); font-weight: 700;
  text-align: right; white-space: nowrap;
}

/* RTL adjustments */
[dir="rtl"] .health-score-card { flex-direction: row-reverse; }
[dir="rtl"] .health-score-left { flex-direction: row-reverse; }
[dir="rtl"] .explain-row { flex-direction: row-reverse; }
[dir="rtl"] .explain-value { text-align: left; }

@media (max-width: 600px) {
  .health-score-card { flex-direction: column; align-items: flex-start; }
  .health-score-right { width: 100%; }
}
