/* PROJECT AIN — Complete RTL UI v0.3 */

:root {
  --bg: #0a0a1a;
  --bg-card: #12122a;
  --bg-card-hover: #1a1a3a;
  --bg-input: #1e1e3a;
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --border: #2a2a4a;
  --accent-primary: #6a11cb;
  --accent-secondary: #2575fc;
  --online: #22c55e;
  --offline: #ef4444;
  --gold: #ffd700;
  --cyan: #00f0ff;
  --orange: #ff8c00;
  --pink: #ff2d78;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  --transition: 0.2s ease;
  --font-ui: 'Segoe UI', 'Arial', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

/* Light mode vars */
[data-theme="light"] {
  --bg: #f0f2f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fa;
  --bg-input: #e8eaed;
  --text: #1a1a2e;
  --text-muted: #5a5a7a;
  --border: #d0d2da;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --accent-primary: #7c3aed;
  --accent-secondary: #3b82f6;
}

body { transition: background 0.3s ease, color 0.3s ease; }

*, ::before, ::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

#particleCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
}
[data-theme="light"] #particleCanvas { opacity: 0.12; }

#noiseOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#scrollProgress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--gold));
  z-index: 200;
  width: 0%;
  transition: width 0.1s ease;
}

.skip-link {
  position: absolute;
  top: -999px;
  right: 8px;
  background: var(--accent-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 300;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Boot Screen */
#bootScreen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: #000;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 14px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#bootScreen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-content { max-width: 700px; width: 100%; white-space: pre-wrap; line-height: 1.5; }

/* Navbar */
.navbar {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(106, 17, 203, 0.3);
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.nav-logo {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.logo-lion { font-size: 1.4rem; }
.logo-tag { font-size: 0.6rem; opacity: 0.7; margin-right: 4px; }
.logo-version {
  font-size: 0.55rem;
  background: rgba(255,255,255,0.15);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  margin-right: 4px;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: all var(--transition);
}
.nav-links a:hover { background: rgba(255,255,255,0.1); color: #fff; }

.nav-icon-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.85);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.nav-icon-btn:hover { background: rgba(255,255,255,0.2); }

.creator-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.2);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.creator-badge .dot {
  width: 6px; height: 6px;
  background: var(--online);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* AI-Ready */
.ai-ready { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.ai-ready-details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  overflow: hidden;
}
.ai-ready-details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
  list-style: none;
}
.ai-ready-details summary::-webkit-details-marker { display: none; }
.ai-icon { width: 16px; height: 16px; }
.ai-badge {
  background: rgba(106,17,203,0.2);
  color: var(--accent-primary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 600;
}
.ai-ready-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px;
  padding: 8px 16px 16px;
}
.ai-item dt { font-weight: 600; font-size: 0.8rem; color: var(--gold); }
.ai-item dd { font-size: 0.78rem; color: var(--text-muted); margin: 2px 0 0; }
.ai-footer {
  text-align: center; font-size: 0.7rem;
  color: var(--text-muted); padding: 6px 16px;
  border-top: 1px solid var(--border);
}

/* Container */
.container {
  max-width: 1400px; margin: 0 auto; padding: 32px 24px;
  position: relative; z-index: 2;
}

/* GEO Claim */
.geo-claim {
  background: rgba(106,17,203,0.1);
  border: 1px solid rgba(106,17,203,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  direction: ltr;
}

/* Dashboard Header */
.dashboard-header { text-align: center; margin-bottom: 24px; }
.dashboard-header h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 8px; }
.highlight {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle { color: var(--text-muted); font-size: 1.05rem; }
.subtitle strong { color: var(--text); }

/* Trust Stats */
.trust-stats {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 4px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
  font-size: 0.85rem;
}
.trust-stat-item { white-space: nowrap; }
.trust-stat-divider { color: var(--text-muted); opacity: 0.3; }

/* LIVE Bar */
.live-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.live-bar-dot {
  color: var(--online); animation: pulse 1.5s infinite; font-size: 0.7rem;
}
.live-bar-label {
  color: var(--online); font-weight: 700; font-size: 0.7rem;
  letter-spacing: 1px; margin-left: 8px;
}
.live-bar-divider { opacity: 0.2; }

/* Share Bar */
.share-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 8px 16px; margin-bottom: 24px; font-size: 0.8rem;
}
.share-label { color: var(--text-muted); font-size: 0.8rem; }
.share-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); padding: 4px 12px;
  border-radius: var(--radius-pill); font-size: 0.75rem;
  cursor: pointer; transition: all var(--transition);
}
.share-btn:hover { color: var(--text); border-color: var(--accent-primary); }
.share-link-btn {
  background: rgba(106,17,203,0.1); border: 1px solid rgba(106,17,203,0.3);
  color: var(--accent-primary); padding: 4px 12px;
  border-radius: var(--radius-pill); font-size: 0.75rem;
  cursor: pointer; transition: all var(--transition);
}
.share-link-btn:hover { background: rgba(106,17,203,0.2); }

/* ====== WHAT-IF SIMULATOR ====== */
.what-if {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}
.what-if-header {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 4px;
}
.what-if-header h2 { font-size: 1.3rem; }
.what-if-live {
  font-size: 0.65rem; color: var(--online); font-weight: 700;
  animation: pulse 1.5s infinite;
}
.what-if-sub { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
.simulator-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}
.sim-controls { display: flex; flex-direction: column; gap: 20px; }
.sim-group label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; margin-bottom: 8px;
}
.sim-val {
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.05rem;
}
.sim-group input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  outline: none;
}
.sim-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  cursor: pointer;
  box-shadow: 0 0 12px rgba(106,17,203,0.4);
}
.sim-range-labels { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-muted); margin-top: 4px; }

.sim-insights {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 160px;
}
.sim-insight {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
  font-size: 0.83rem;
}
.sim-agent-icon { font-size: 1.1rem; flex-shrink: 0; }
.sim-agent-name { font-weight: 700; color: var(--text); white-space: nowrap; }
.sim-agent-text { color: var(--text-muted); }
.sim-insight-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; min-height: 100px;
  color: var(--text-muted); font-size: 0.85rem;
  background: var(--bg-input); border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

/* Answer-First */
.answer-first {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.answer-card {
  background: rgba(106,17,203,0.08);
  border-radius: var(--radius); padding: 20px;
}
.takeaway-icon { font-size: 2rem; margin-bottom: 8px; }
.takeaway-text { font-size: 0.95rem; line-height: 1.7; }
.takeaway-text strong { color: var(--gold); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-item {
  background: var(--bg-input);
  border-radius: var(--radius-sm); padding: 16px;
}
.stat-num {
  display: block; font-size: 1.4rem; font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.stat-label cite {
  display: block; font-style: normal; font-size: 0.65rem;
  color: var(--text-muted); opacity: 0.6; margin-top: 2px;
}
.answer-cta {
  font-size: 0.8rem; color: var(--text-muted); margin-top: 16px;
  text-align: center; padding-top: 16px; border-top: 1px solid var(--border);
}

/* Agent Grid */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* 3D Agent Cards */
.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 800px;
}
.agent-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 100%;
  background: var(--accent);
  transition: width var(--transition);
}
.agent-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow), 0 8px 32px rgba(106,17,203,0.15);
}
.agent-card:hover::before { width: 6px; }

.card-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.agent-icon { font-size: 2rem; transition: transform 0.3s ease; }
.agent-card:hover .agent-icon { transform: scale(1.2) rotate(-5deg); }
.agent-info h2 { font-size: 1.2rem; font-weight: 600; margin: 0; }
.agent-en { font-size: 0.8rem; color: var(--text-muted); }
.status-badge {
  margin-right: auto; padding: 4px 12px;
  border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600;
}
.status-badge.online { background: rgba(34,197,94,0.15); color: var(--online); }
.status-badge.offline { background: rgba(239,68,68,0.15); color: var(--offline); }
.agent-role { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; }
.agent-desc { font-size: 0.9rem; margin-bottom: 16px; }
.card-stats {
  display: flex; gap: 16px; font-size: 0.8rem;
  color: var(--text-muted); margin-bottom: 16px;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.card-actions { display: flex; gap: 8px; }

/* Buttons */
.btn {
  padding: 8px 20px; border: none;
  border-radius: var(--radius-sm); font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: all var(--transition);
  font-family: inherit;
}
.btn-start { background: rgba(34,197,94,0.15); color: var(--online); }
.btn-start:hover { background: rgba(34,197,94,0.25); }
.btn-stop { background: rgba(239,68,68,0.15); color: var(--offline); }
.btn-stop:hover { background: rgba(239,68,68,0.25); }
.btn-chat { background: rgba(106,17,203,0.15); color: var(--accent-primary); }
.btn-chat:hover { background: rgba(106,17,203,0.25); }
.btn-send {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff; padding: 10px 28px; border-radius: var(--radius-sm);
  font-size: 1rem; align-self: flex-end;
}
.btn-send:hover { opacity: 0.9; }

/* GEO Fact Cards */
.geo-facts { margin-bottom: 32px; }
.section-title { font-size: 1.1rem; margin-bottom: 16px; color: var(--gold); text-align: center; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.fact-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: all var(--transition); }
.fact-card:hover { border-color: var(--accent-primary); transform: translateY(-2px); }
.fact-card-wide { grid-column: 1 / -1; }
.fact-icon { font-size: 1.5rem; margin-bottom: 8px; }
.fact-card h3 { font-size: 0.95rem; margin-bottom: 6px; }
.fact-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }

/* System Status */
.system-status {
  text-align: center; padding: 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px;
}
.system-status h3 { margin-bottom: 8px; font-size: 1rem; }
.status-text { display: flex; align-items: center; justify-content: center; gap: 8px; }
.system-stats-row {
  display: flex; justify-content: center; gap: 24px;
  margin-top: 12px; font-size: 0.85rem; color: var(--text-muted);
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-online { background: var(--online); box-shadow: 0 0 8px var(--online); }
.dot-offline { background: var(--offline); }

/* Media Bar */
.media-bar {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 4px; padding: 12px;
  font-size: 0.78rem; color: var(--text-muted);
  border-top: 1px solid var(--border); margin-top: 16px;
}
.media-bar-label { font-weight: 600; color: var(--text); }

/* Chat Page */
.chat-header { text-align: center; margin-bottom: 12px; }
.chat-stats {
  display: flex; justify-content: center; gap: 16px;
  font-size: 0.8rem; color: var(--text-muted); margin-top: 4px;
}

/* Chat Actions Bar */
.chat-actions-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 0; margin-bottom: 12px; flex-wrap: wrap;
}
.btn-chat-action {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); padding: 6px 14px;
  border-radius: var(--radius-pill); font-size: 0.78rem;
  cursor: pointer; transition: all var(--transition);
  font-family: inherit;
}
.btn-chat-action:hover { color: var(--text); border-color: var(--accent-primary); }
.toggle-label {
  display: flex; align-items: center; gap: 4px;
}
.toggle-label input[type="checkbox"] { accent-color: var(--accent-primary); }
.chat-actions-hint {
  margin-right: auto; font-size: 0.7rem; color: var(--text-muted);
}
.chat-actions-hint kbd {
  background: var(--bg-input); padding: 1px 6px;
  border-radius: 3px; font-size: 0.65rem;
  border: 1px solid var(--border);
}

.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  height: calc(100vh - 320px);
  min-height: 500px;
}

/* Chat Sidebar */
.chat-sidebar {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 20px;
}
.chat-sidebar h3 {
  font-size: 0.95rem; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.agent-list { display: flex; flex-direction: column; gap: 4px; }
.agent-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text);
  transition: background var(--transition);
}
.agent-list-item:hover { background: var(--bg-card-hover); }
.agent-list-item.active { background: rgba(106,17,203,0.2); }
.al-icon { font-size: 1.2rem; }
.agent-list-item small { display: block; color: var(--text-muted); font-size: 0.75rem; }
.al-status {
  margin-right: auto; width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}
.al-on { background: var(--online); box-shadow: 0 0 6px var(--online); }
.al-off { background: var(--offline); }

/* Sample Questions */
.sidebar-faq h4 { font-size: 0.85rem; margin-bottom: 8px; color: var(--text-muted); }
#sampleQuestions { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.sample-q {
  width: 100%; text-align: right;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-muted); padding: 8px 12px;
  border-radius: var(--radius-sm); font-size: 0.8rem;
  cursor: pointer; transition: all var(--transition);
  font-family: inherit;
}
.sample-q:hover { color: var(--text); border-color: var(--accent-primary); }

/* Chat Main */
.chat-main {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.message {
  display: flex; gap: 12px;
  max-width: 80%; animation: fadeIn 0.3s ease;
}
.agent-msg { align-self: flex-start; }
.user-msg { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-input); display: flex;
  align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.msg-content {
  background: var(--bg-input); padding: 12px 16px;
  border-radius: 12px; border-top-right-radius: 2px;
}
.agent-msg .msg-content { border-top-right-radius: 12px; border-top-left-radius: 2px; }
.user-msg .msg-content { background: rgba(106,17,203,0.2); }
.msg-content strong { display: block; margin-bottom: 4px; font-size: 0.8rem; color: var(--text-muted); }
.msg-content p { font-size: 0.95rem; line-height: 1.7; }
.msg-geo-note {
  display: flex; align-items: center; gap: 4px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.geo-note-icon { font-size: 0.7rem; }
.geo-note-text { font-size: 0.65rem; color: var(--text-muted); opacity: 0.5; }

/* TTS Button on messages */
.msg-tts-btn {
  background: none; border: none;
  color: var(--text-muted); font-size: 0.8rem;
  cursor: pointer; padding: 2px 6px;
  border-radius: 4px; margin-top: 4px;
  transition: all var(--transition);
}
.msg-tts-btn:hover { color: var(--accent-primary); background: rgba(106,17,203,0.1); }
.msg-tts-btn.speaking { color: var(--online); animation: pulse 1s infinite; }

/* Chat Input */
.chat-input-area {
  display: flex; gap: 12px; padding: 16px 20px;
  border-top: 1px solid var(--border);
}
#chat-input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text); font-family: inherit; font-size: 0.95rem;
  resize: none; outline: none; transition: border-color var(--transition);
}
#chat-input:focus { border-color: var(--accent-primary); }
#chat-input::placeholder { color: var(--text-muted); }

/* Keyboard Shortcuts Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-content {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  max-width: 420px; width: 90%;
  box-shadow: var(--shadow);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.modal-header h2 { font-size: 1.1rem; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.5rem; cursor: pointer; padding: 4px 8px;
}
.modal-close:hover { color: var(--text); }
.modal-body { display: flex; flex-direction: column; gap: 8px; }
.shortcut-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 0.85rem;
}
.shortcut-row span { color: var(--text-muted); }
.shortcut-row kbd {
  background: var(--bg-input); padding: 2px 8px;
  border-radius: 4px; font-size: 0.75rem;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  min-width: 24px; text-align: center;
}

/* Toast Notifications */
#toastContainer {
  position: fixed; bottom: 20px; left: 20px;
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 0.85rem; box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
}
.toast.toast-out { animation: toastOut 0.3s ease forwards; }
.toast-icon { font-size: 1.1rem; }

/* Footer */
.footer { text-align: center; padding: 24px; border-top: 1px solid var(--border); margin-top: 40px; position: relative; z-index: 2; }
.footer-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer-brand { font-size: 0.9rem; font-weight: 700; }
.footer-links { display: flex; align-items: center; gap: 12px; font-size: 0.8rem; }
.footer-label { color: var(--text-muted); }
.footer-link { color: var(--accent-primary); text-decoration: none; }
.footer-link:hover { text-decoration: underline; }
.footer-trust { display: flex; gap: 8px; font-size: 0.7rem; }
.trust-badge { padding: 2px 8px; background: var(--bg-input); border-radius: var(--radius-pill); color: var(--text-muted); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(20px); } }
.reveal { animation: fadeIn 0.6s ease; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Responsive */
/* AEO Data blocks — hidden from users, visible to AI */
.aeo-data { display: none; }
.aeo-platform { display: none; }

/* Expert Quotes Section */
.expert-quotes {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.expert-quote {
  background: linear-gradient(135deg, rgba(106,17,203,0.08), rgba(37,117,252,0.05));
  border: 1px solid rgba(106,17,203,0.2);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0;
  position: relative;
}
.expert-quote::before {
  content: '"';
  position: absolute;
  top: -4px;
  right: 12px;
  font-size: 3rem;
  color: var(--accent-primary);
  opacity: 0.3;
  line-height: 1;
}
.expert-quote p {
  font-size: 0.9rem;
  line-height: 1.7;
  font-style: italic;
  color: var(--text);
  margin-bottom: 12px;
}
.expert-quote footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.expert-quote footer cite {
  font-style: normal;
  color: var(--accent-primary);
}

/* GEO Citations Panel */
.geo-citations {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}
.citations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}
.citation-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.citation-card:hover {
  border-color: var(--accent-primary);
}
.citation-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(106,17,203,0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  height: fit-content;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.citation-body {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.citation-body strong {
  color: var(--text);
}
.citation-body cite {
  display: block;
  font-style: normal;
  font-size: 0.7rem;
  color: var(--accent-primary);
  margin-top: 4px;
  opacity: 0.8;
}

/* Technical Terms Index */
.terms-index {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
}
.term-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.term {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold);
}
.term-def {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ====== Accessibility Toolbar (תקן 5568) ====== */
.a11y-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(106, 17, 203, 0.4);
  border: none;
  transition: transform var(--transition), box-shadow var(--transition);
}
.a11y-btn:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(106, 17, 203, 0.6); }
.a11y-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.a11y-panel {
  position: fixed;
  bottom: 82px;
  right: 20px;
  z-index: 499;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow: hidden;
}
.a11y-panel.a11y-open { transform: translateY(0); opacity: 1; visibility: visible; }
.a11y-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}
.a11y-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.a11y-close:hover { background: rgba(255,255,255,0.35); }
.a11y-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 380px;
  overflow-y: auto;
}
.a11y-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: right;
  font-family: inherit;
  width: 100%;
}
.a11y-option:hover { background: var(--bg-input); }
.a11y-option:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.a11y-option[aria-pressed="true"] { background: rgba(106,17,203,0.15); }
.a11y-icon { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; }
.a11y-label { flex: 1; }
.a11y-check { font-size: 0.8rem; color: var(--accent-primary); opacity: 0; transition: opacity var(--transition); }
.a11y-option[aria-pressed="true"] .a11y-check { opacity: 1; }
.a11y-reset {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.a11y-reset:hover { color: var(--text); }

/* A11y state classes — applied to html element */
html.a11y-font-increase body { font-size: 120% !important; }
html.a11y-font-decrease body { font-size: 85% !important; }
html.a11y-high-contrast {
  --bg: #000 !important;
  --bg-card: #111 !important;
  --bg-card-hover: #1a1a1a !important;
  --bg-input: #1a1a1a !important;
  --text: #fff !important;
  --text-muted: #ccc !important;
  --border: #444 !important;
}
html.a11y-monochrome body { filter: grayscale(100%) !important; }
html.a11y-invert-colors body { filter: invert(1) hue-rotate(180deg) !important; }
html.a11y-invert-colors img, html.a11y-invert-colors canvas, html.a11y-invert-colors video { filter: invert(1) hue-rotate(180deg) !important; }
html.a11y-underline-links a { text-decoration: underline !important; text-underline-offset: 2px; }
html.a11y-underline-links a:hover { text-decoration-thickness: 2px; }
html.a11y-readable-font body { font-family: 'OpenDyslexic', 'Arial', sans-serif !important; }
html.a11y-big-cursor, html.a11y-big-cursor * { cursor: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"%3E%3Ccircle cx="16" cy="16" r="14" fill="none" stroke="%23666" stroke-width="2"/%3E%3Ccircle cx="16" cy="16" r="4" fill="%236a11cb"/%3E%3C/svg%3E') 16 16, auto !important; }
html.a11y-stop-animations *, html.a11y-stop-animations *::before, html.a11y-stop-animations *::after { animation: none !important; transition: none !important; }

/* A11y RTL overrides */
[dir="rtl"] .a11y-btn { right: auto; left: 20px; }
[dir="rtl"] .a11y-panel { right: auto; left: 20px; }

@media (max-width: 768px) {
  .answer-grid, .simulator-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .agent-grid { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .container { padding: 16px; }
  .dashboard-header h1 { font-size: 1.5rem; }
  .trust-stats { font-size: 0.75rem; padding: 8px 12px; border-radius: var(--radius-sm); }
  .live-bar { font-size: 0.7rem; }
  .creator-badge, .logo-tag, .logo-version { display: none; }
  .system-stats-row { flex-direction: column; gap: 4px; }
  .chat-actions-hint { display: none; }
}
@media (max-width: 480px) {
  .stats-grid, .facts-grid { grid-template-columns: 1fr; }
}
