﻿/* ═══════════════════════════════════════════════════
   DESIGN TOKENS — Single source of truth
═══════════════════════════════════════════════════ */
:root {
  /* Core palette — dark neon chemistry */
  --bg-base:     #0a1322;
  --bg-surface:  #101b2f;
  --bg-card:     #16233b;
  --bg-glass:    rgba(22,35,59,0.88);
  --border:      rgba(122,153,198,0.18);
  --border-glow: rgba(122,153,198,0.34);

  /* Neon accents */
  --neon-blue:   #5f91d6;
  --neon-cyan:   #6ab8d1;
  --neon-green:  #59b894;
  --neon-purple: #9a86c5;
  --neon-pink:   #c683a8;
  --neon-amber:  #d5b063;
  --neon-red:    #cf7d88;

  /* Text */
  --text-primary:   #e8f4ff;
  --text-secondary: #9eb5d1;
  --text-muted:     #6f86a3;

  /* Semantic */
  --clr-alkane:   #3b9eff;
  --clr-alkene:   #00ffb3;
  --clr-alkyne:   #ff6eb4;
  --clr-benzene:  #ffcc44;
  --clr-alcohol:  #b97aff;
  --clr-acid:     #ff4d6d;
  --clr-ester:    #00e5ff;
  --clr-iron:     #ff7c35;
  --clr-trans:    #a0c4ff;

  /* Spacing */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  14px;
  --sp-lg:  20px;
  --sp-xl:  28px;

  /* Radius */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;

  /* Typography */
  --font-ar: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
  --font-mono: 'Courier New', monospace;

  /* Animation */
  --ease-out: cubic-bezier(0.16,1,0.3,1);
  --ease-spring: cubic-bezier(0.34,1.56,0.64,1);
}

[data-theme="light"] {
  --bg-base:     #f0f4ff;
  --bg-surface:  #e2eaf8;
  --bg-card:     #ffffff;
  --bg-glass:    rgba(255,255,255,0.88);
  --border:      rgba(60,100,180,0.14);
  --border-glow: rgba(60,100,180,0.35);
  --text-primary:   #0f1e35;
  --text-secondary: #3a5580;
  --text-muted:     #8aaac0;
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; font-family: var(--font-ar); background: var(--bg-base); color: var(--text-primary); line-height: 1.85; letter-spacing: 0; text-rendering: optimizeLegibility; }
button { font-family: var(--font-ar); cursor: pointer; border: none; background: none; }
input { font-family: var(--font-ar); }
svg { display: block; }

/* Scroll container */
.scroll-y { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.scroll-y::-webkit-scrollbar { width: 3px; }
.scroll-y::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: 99px; }
.scroll-y::-webkit-scrollbar-track { background: transparent; }

/* ═══════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════ */
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

/* ──── TOPBAR ──── */
#topbar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--sp-md);
  background: linear-gradient(180deg, rgba(9,16,30,0.96), rgba(13,23,40,0.94));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(122,153,198,0.22);
  position: relative; z-index: 100;
}
#topbar-logo {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  pointer-events: none;
}
.topbar-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(122,153,198,0.26);
}
.topbar-brand-text {
  min-width: 0;
}
.topbar-brand-main {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.6px;
  color: #eef3fb;
  line-height: 1.2;
}
.topbar-btn {
  min-height: 36px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  gap: 5px;
  transition: all 0.2s; flex-shrink: 0;
  padding: 0 10px;
}
.topbar-btn:active { transform: scale(0.92); background: rgba(255,255,255,0.12); }
[data-theme="light"] .topbar-btn { background: rgba(0,0,0,0.05); }
.topbar-btn-install {
  min-width: 72px;
  background: rgba(210,225,245,0.07);
  border-color: rgba(150,180,215,0.3);
}
.topbar-btn-install .install-text {
  font-size: 11px;
  font-weight: 800;
}
.topbar-btn-install .install-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #bdd5eb;
}
.topbar-btn-install .install-icon-svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topbar-btn-install.is-ready {
  border-color: rgba(106,184,209,0.5);
  color: #d9eef3;
  background: rgba(106,184,209,0.12);
}
.topbar-btn-install:hover {
  border-color: rgba(170,200,230,0.45);
  background: rgba(170,200,230,0.12);
}
.topbar-btn-install:active {
  background: rgba(170,200,230,0.18);
}
.topbar-btn-install.is-ready .install-icon {
  color: #d9eef3;
}
#btn-back,
#btn-theme {
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 16px;
}

/* ──── CONTENT ──── */
#view { flex: 1; padding: var(--sp-md); padding-bottom: 104px; }

/* ──── BOTTOM NAV ──── */
#bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  display: flex;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 9px 4px 7px; color: var(--text-muted);
  font-size: 9.5px; font-weight: 700; transition: color 0.2s;
  position: relative;
}
.nav-item .nav-icon { font-size: 20px; transition: transform 0.2s var(--ease-spring); }
.nav-item.active { color: var(--neon-cyan); }
.nav-item.active .nav-icon { transform: translateY(-2px); }
.nav-item::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px; background: var(--neon-cyan);
  border-radius: 99px; transition: width 0.3s var(--ease-out);
}
.nav-item.active::after { width: 28px; }

/* ═══════════════════════════════════════════════════
   GLASSMORPHISM CARDS
═══════════════════════════════════════════════════ */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  transition: transform 0.15s var(--ease-out), border-color 0.2s;
}
.glass-card:active { transform: scale(0.975); }
.glass-card.glow-blue  { border-color: rgba(59,158,255,0.35); }
.glass-card.glow-green { border-color: rgba(0,255,179,0.35); }
.glass-card.glow-pink  { border-color: rgba(255,110,180,0.35); }
.glass-card.glow-amber { border-color: rgba(255,204,68,0.35); }

/* ═══════════════════════════════════════════════════
   HOME SCREEN
═══════════════════════════════════════════════════ */
.home-hero {
  margin-bottom: var(--sp-lg);
  padding: var(--sp-lg) var(--sp-md);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 90% at 50% 5%, rgba(106,184,209,0.2) 0%, rgba(106,184,209,0.04) 42%, rgba(10,18,32,0) 74%),
    linear-gradient(180deg, #0b1220 0%, #0f1a2d 100%);
  border: 1px solid rgba(106,184,209,0.24);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-brand-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.hero-brand-mark {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(220,230,245,0.24);
}
.hero-title {
  font-size: clamp(30px, 10vw, 40px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 2.8px;
  color: #f2f6fd;
}
.hero-tagline {
  font-size: 11px;
  color: #9db1cb;
  letter-spacing: 0.9px;
}

.section-label {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: var(--sp-sm); padding-right: 4px;
}
.home-section-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin: -4px 0 10px;
  padding-right: 4px;
}
.home-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.home-section-block {
  position: relative;
}

/* Unit cards grid */
.units-grid { display: flex; flex-direction: column; gap: 10px; }
.unit-card {
  display: flex; align-items: center; gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-md);
  cursor: pointer;
}
.unit-card-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.unit-card-body { flex: 1; min-width: 0; }
.unit-card-title { font-size: 14px; font-weight: 800; margin-bottom: 2px; }
.unit-card-meta { font-size: 11px; color: var(--text-muted); }
.unit-card-arrow { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }

/* Progress pill */
.prog-bar { height: 3px; background: var(--border); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 99px; transition: width 0.6s var(--ease-out); }

/* Stats row */
.stats-row { display: flex; gap: 8px; margin-bottom: var(--sp-lg); }
.stat-chip {
  flex: 1; padding: 10px 8px; text-align: center;
  border-radius: var(--r-md); background: var(--bg-card); border: 1px solid var(--border);
}
.stat-val { font-size: 20px; font-weight: 900; }
.stat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.home-track-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.home-track { padding: 12px; border-radius: 14px; }
.home-track-title { font-size: 12px; font-weight: 800; margin-bottom: 4px; color: var(--text-primary); }
.home-track-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.7; }
.home-focus { padding: 12px; margin-bottom: 12px; border-radius: 14px; }
.home-focus-title { font-size: 12px; font-weight: 800; margin-bottom: 8px; color: var(--neon-cyan); }
.home-focus-list { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--text-secondary); line-height: 1.7; }
.home-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.home-quick-btn {
  padding: 10px 8px; border-radius: 12px; font-size: 11.5px; font-weight: 800;
  color: var(--text-primary); border: 1px solid var(--border); background: var(--bg-card);
}
.search-input,
.home-quick-btn,
.organic-step,
.periodic-filter-btn,
.rxn-ctrl-btn,
.btn-primary,
.btn-ghost,
.today-task-start,
.today-plan-weak-btn {
  letter-spacing: 0;
  font-weight: 700;
}
.organic-subtitle { font-size: 12px; font-weight: 800; color: var(--neon-cyan); margin-bottom: 8px; }
.organic-mini-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.organic-mini-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.7;
  background: rgba(255,255,255,0.03);
}
.home-quick-btn:active { transform: scale(0.97); }
.home-weak { padding: 12px; margin-bottom: 12px; border-radius: 14px; }
.home-weak-title { font-size: 12px; font-weight: 800; margin-bottom: 8px; color: var(--neon-amber); }
.home-weak-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border);
  margin-bottom: 6px; font-size: 12px; color: var(--text-secondary); cursor: pointer;
}
.home-weak-item:active { transform: scale(0.99); }

.today-plan {
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 14px;
}
.today-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.today-plan-title { font-size: 13px; font-weight: 900; color: var(--neon-cyan); }
.today-plan-date { font-size: 10px; color: var(--text-muted); }
.today-plan-progress {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.today-plan-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.today-plan-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.today-plan-weak-btn {
  border: 1px solid rgba(106,184,209,0.4);
  background: rgba(106,184,209,0.12);
  color: var(--text-primary);
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 999px;
  padding: 6px 10px;
}
.today-plan-list { display: flex; flex-direction: column; gap: 6px; }
.today-task {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
}
.today-task.done { opacity: 0.75; }
.today-task-check {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}
.today-task-body { min-width: 0; }
.today-task-title { font-size: 11.5px; font-weight: 800; color: var(--text-primary); }
.today-task-desc { font-size: 10.5px; color: var(--text-muted); line-height: 1.6; }
.today-task-start {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 800;
  padding: 7px 10px;
}
.home-paths {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.home-path-card {
  padding: 12px;
  border-radius: 14px;
  position: relative;
  min-height: 0;
}
.home-path-title {
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 3px;
  color: var(--neon-cyan);
}
.home-path-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.home-path-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.exam-blocked-card {
  padding: 16px;
  border-radius: 14px;
}
.exam-blocked-title {
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--neon-cyan);
}
.exam-blocked-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 14px;
}

/* ═══════════════════════════════════════════════════
   SECTION / NODE SYSTEM
═══════════════════════════════════════════════════ */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: var(--sp-md); font-size: 11px; color: var(--text-muted);
}
.breadcrumb span { cursor: pointer; }
.breadcrumb span:hover { color: var(--text-primary); }
.breadcrumb-sep { opacity: 0.4; }

.section-list { display: flex; flex-direction: column; gap: 8px; }
.section-item {
  display: flex; align-items: center; gap: 12px; padding: 14px var(--sp-md);
  cursor: pointer;
}
.section-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.section-item-title { font-size: 14px; font-weight: 700; flex: 1; }
.section-item-count { font-size: 11px; color: var(--text-muted); }

/* Node accordion */
.node-wrap { margin-bottom: 8px; }
.node-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px var(--sp-md); cursor: pointer;
  border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--bg-card); transition: border-color 0.2s;
}
.node-header:active { transform: scale(0.99); }
.node-header.open { border-radius: var(--r-md) var(--r-md) 0 0; border-bottom-color: transparent; }
.node-chevron { font-size: 10px; color: var(--text-muted); transition: transform 0.25s var(--ease-out); margin-right: auto; }
.node-header.open .node-chevron { transform: rotate(180deg); }
.node-title { font-size: 13px; font-weight: 700; }
.node-count { font-size: 10px; color: var(--text-muted); margin-right: auto; }

.node-body {
  display: none; padding: 10px var(--sp-md) 12px;
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: rgba(255,255,255,0.025);
}
.node-body.open { display: block; }
[data-theme="light"] .node-body { background: rgba(0,0,0,0.02); }

/* Node items */
.node-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 8px; border-radius: 8px; margin-bottom: 4px;
  font-size: 12.5px; line-height: 1.7;
}
.item-bullet { flex-shrink: 0; margin-top: 2px; }
.item-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 800; padding: 2px 6px;
  border-radius: 99px; margin-left: 5px; vertical-align: middle;
  letter-spacing: 0.3px;
}
.badge-law    { background: rgba(255,204,68,0.12);  color: var(--neon-amber); border: 1px solid rgba(255,204,68,0.3); }
.badge-eq     { background: rgba(0,255,179,0.1);    color: var(--neon-green); border: 1px solid rgba(0,255,179,0.3); }
.badge-obs    { background: rgba(255,110,180,0.1);  color: var(--neon-pink);  border: 1px solid rgba(255,110,180,0.3); }
.badge-mem    { background: rgba(185,122,255,0.1);  color: var(--neon-purple);border: 1px solid rgba(185,122,255,0.3); }
.badge-tip    { background: rgba(59,158,255,0.1);   color: var(--neon-blue);  border: 1px solid rgba(59,158,255,0.3); }

/* ═══════════════════════════════════════════════════
   COMPARE TABLES
═══════════════════════════════════════════════════ */
.compare-block { margin-bottom: var(--sp-md); }
.compare-block h4 { font-size: 13px; font-weight: 800; margin-bottom: 10px; padding: 8px 12px; border-radius: var(--r-sm); }
.chem-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.chem-table th { padding: 8px 10px; text-align: center; font-weight: 800; background: rgba(255,255,255,0.05); }
.chem-table td { padding: 7px 10px; text-align: center; border-bottom: 1px solid var(--border); }
.chem-table tr:last-child td { border: none; }
[data-theme="light"] .chem-table th { background: rgba(0,0,0,0.04); }
.table-scroll { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); }

/* Expected questions */
.expected-block { border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--sp-md); }
.expected-header { padding: 10px var(--sp-md); font-size: 13px; font-weight: 800; background: rgba(255,204,68,0.08); border: 1px solid rgba(255,204,68,0.25); border-bottom: none; }
.expected-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px var(--sp-md); border: 1px solid rgba(255,204,68,0.15);
  border-top: none; font-size: 12.5px; line-height: 1.7;
  background: rgba(255,204,68,0.04);
}
.expected-num { color: var(--neon-amber); font-weight: 800; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════
   SVG MIND MAP ENGINE
═══════════════════════════════════════════════════ */
.mindmap-container {
  position: relative; width: 100%; overflow: hidden;
  border-radius: var(--r-xl); border: 1px solid var(--border);
  background: var(--bg-surface); touch-action: pan-x pan-y;
  cursor: grab;
}
.mindmap-container:active { cursor: grabbing; }
#mindmap-svg { display: block; }

/* SVG node styling (applied via JS) */
.mm-node-rect { rx: 10; ry: 10; }
.mm-node-foreign { overflow: visible; }

/* Molecule animation */
@keyframes float-atom { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse-bond { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes electron-move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } }
@keyframes glow-pulse { 0%,100% { filter: drop-shadow(0 0 4px currentColor); } 50% { filter: drop-shadow(0 0 12px currentColor); } }
@keyframes fadeSlideUp { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: translateY(0); } }

.anim-float { animation: float-atom 3s ease-in-out infinite; }
.anim-pulse { animation: pulse-bond 2s ease-in-out infinite; }
.anim-glow  { animation: glow-pulse 2.5s ease-in-out infinite; }

/* Reaction path animation */
.reaction-path {
  stroke-dasharray: 8 4;
  animation: dash-flow 1.5s linear infinite;
}
@keyframes dash-flow { to { stroke-dashoffset: -24; } }

/* ═══════════════════════════════════════════════════
   SEARCH
═══════════════════════════════════════════════════ */
.search-box {
  position: relative; margin-bottom: var(--sp-md);
}
.search-input {
  width: 100%; padding: 12px 44px 12px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text-primary);
  font-size: 14px; outline: none; transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--neon-blue); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: 0.4; pointer-events: none; }
.search-hint { font-size: 11px; color: var(--text-muted); text-align: center; padding: 30px 0; }
.search-result {
  padding: 12px var(--sp-md); border: 1px solid var(--border);
  border-radius: var(--r-md); margin-bottom: 8px; cursor: pointer;
  background: var(--bg-card); transition: border-color 0.2s;
}
.search-result:active { border-color: var(--neon-blue); }
.sr-title { font-size: 13px; font-weight: 800; margin-bottom: 3px; }
.sr-path { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.sr-preview { font-size: 11.5px; color: var(--text-secondary); line-height: 1.6; }
.sr-preview mark { background: rgba(59,158,255,0.25); color: var(--neon-blue); border-radius: 3px; padding: 0 2px; }
.search-count { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }

/* Laws reference */
.laws-head {
  padding: 14px;
  margin-bottom: 12px;
}
.laws-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.laws-subtitle {
  font-size: 12px;
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.laws-search-box { margin-bottom: 12px; }
.laws-clear-btn {
  position: absolute; left: 46px; top: 50%; transform: translateY(-50%);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.05);
}
.laws-search-btn { left: 102px; }
.laws-chip-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.laws-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 10.8px;
  font-weight: 800;
  color: var(--text-secondary);
  background: var(--bg-card);
}
.laws-chip.active {
  color: var(--text-primary);
  border-color: var(--neon-cyan);
  background: rgba(106,184,209,0.14);
}
.laws-category-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.laws-category-intro {
  padding: 11px 12px;
  border-radius: 12px;
  border-color: rgba(106,184,209,0.34);
  background: linear-gradient(180deg, rgba(106,184,209,0.1), rgba(106,184,209,0.04));
}
.laws-category-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.laws-category-text {
  font-size: 11.2px;
  line-height: 1.85;
  color: var(--text-secondary);
}
.laws-list { display: flex; flex-direction: column; gap: 10px; }
.law-card {
  padding: 13px;
  border-color: rgba(106,184,209,0.26);
  background: linear-gradient(180deg, rgba(16,27,47,0.95), rgba(10,18,32,0.98));
}
.law-card-focus {
  border-color: rgba(106,184,209,0.8);
  box-shadow: 0 0 0 1px rgba(106,184,209,0.35) inset;
}
.law-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.law-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-primary);
}
.law-cat {
  border: 1px solid rgba(106,184,209,0.35);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.law-section {
  margin-bottom: 10px;
}
.law-category-inline {
  border: 1px solid rgba(106,184,209,0.28);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(106,184,209,0.08);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.law-label {
  font-size: 10.6px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}
.law-text {
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.law-formula-ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-primary);
  word-break: break-word;
  text-align: left;
}
.law-formula-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.law-formula-box {
  border: 1px solid rgba(122,153,198,0.3);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
}
.law-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.law-step-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 6px;
}
.law-step-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(106,184,209,0.45);
  color: var(--text-primary);
  font-size: 10.2px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(106,184,209,0.15);
}
.law-example {
  border: 1px solid rgba(89,184,148,0.32);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(89,184,148,0.08);
  font-size: 11.2px;
  line-height: 1.8;
  color: #cfeee0;
}
.law-visual-block {
  border: 1px solid rgba(122,153,198,0.3);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.03);
}
.law-visual-title {
  font-size: 11px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.law-formula-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.ph-scale {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 6px;
}
.ph-cell {
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
}
.ph-cell.acidic { background: rgba(207,125,136,0.78); }
.ph-cell.neutral { background: rgba(89,184,148,0.88); }
.ph-cell.basic { background: rgba(106,184,209,0.82); }
.ph-scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
}
.ksp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
.ksp-card {
  border: 1px solid rgba(122,153,198,0.26);
  border-radius: 10px;
  padding: 8px 9px;
  background: rgba(255,255,255,0.02);
}
.ksp-type {
  font-size: 10.8px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.ksp-law {
  font-size: 12.2px;
  margin-bottom: 2px;
}
.ksp-example {
  font-size: 10.4px;
  color: var(--text-muted);
}
.faraday-flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.faraday-node {
  border: 1px solid rgba(106,184,209,0.35);
  border-radius: 9px;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-primary);
  background: rgba(106,184,209,0.1);
  text-align: center;
}
.faraday-arrow {
  text-align: center;
  color: var(--neon-amber);
  font-size: 12px;
  font-weight: 900;
}
.laws-empty {
  padding: 14px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.organic-roadmap { padding: 12px; margin-bottom: 10px; }
.organic-roadmap-title { font-size: 13px; font-weight: 800; margin-bottom: 8px; color: var(--neon-cyan); }
.organic-roadmap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.organic-step {
  padding: 10px; border: 1px solid var(--border); border-radius: 10px;
  text-align: right; font-size: 11px; line-height: 1.6; color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
}
.organic-step:active { transform: scale(0.98); }

/* Periodic table */
.periodic-head { padding: 12px; margin-bottom: 10px; }
.periodic-search-box { display: flex; flex-direction: column; gap: 8px; }
.periodic-search-actions { display: flex; gap: 6px; justify-content: flex-start; }
.periodic-search-btn { min-width: 64px; text-align: center; }
.periodic-filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.periodic-filter-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-card);
}
.periodic-filter-btn.active {
  color: var(--text-primary);
  border-color: var(--neon-cyan);
  background: rgba(106,184,209,0.14);
}
.periodic-count { font-size: 11px; color: var(--text-muted); }
.periodic-focus-badge {
  display: inline-block;
  margin: 2px 0 8px;
  border: 1px solid rgba(154,134,197,0.45);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-primary);
  background: rgba(154,134,197,0.16);
}
.periodic-stage {
  padding: 10px;
  margin-bottom: 10px;
  overflow-x: auto;
  direction: ltr;
}
.periodic-grid {
  display: grid;
  grid-template-columns: repeat(18, minmax(48px, 1fr));
  grid-template-rows: repeat(9, minmax(54px, auto));
  gap: 4px;
  min-width: 920px;
  direction: ltr;
}
.periodic-row-note {
  font-size: 10px;
  color: var(--text-muted);
  align-self: center;
}
.periodic-row-note.ln { grid-column: 1 / 4; grid-row: 8; }
.periodic-row-note.ac { grid-column: 1 / 4; grid-row: 9; }
.periodic-el {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 54px;
  text-align: right;
}
.periodic-el.active { border-color: var(--neon-cyan); box-shadow: 0 0 0 1px rgba(106,184,209,0.35) inset; }
.periodic-z { font-size: 9px; color: var(--text-muted); line-height: 1; }
.periodic-sym { font-size: 15px; font-weight: 900; line-height: 1; letter-spacing: 0.3px; }
.periodic-ar { font-size: 9.5px; color: var(--text-secondary); line-height: 1.2; }
.periodic-el.is-metal { background: rgba(95,145,214,0.08); }
.periodic-el.is-nonmetal { background: rgba(89,184,148,0.10); }
.periodic-el.is-noble { background: rgba(213,176,99,0.12); }
.periodic-el.is-halogen { background: rgba(198,131,168,0.12); }
.periodic-el.is-alkali { background: rgba(207,125,136,0.12); }
.periodic-el.is-alkaline { background: rgba(122,162,216,0.12); }
.periodic-el.is-transition { background: rgba(154,134,197,0.12); }
.periodic-detail {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20,35,58,0.9), rgba(13,23,40,0.96));
  padding: 12px;
}
.periodic-detail.empty { color: var(--text-muted); font-size: 12px; text-align: center; }
.periodic-detail-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.periodic-detail-main { display: flex; gap: 10px; align-items: center; }
.periodic-detail-symbol { font-size: 26px; font-weight: 900; color: var(--neon-cyan); }
.periodic-detail-name { font-size: 14px; font-weight: 800; }
.periodic-detail-en { font-size: 11px; color: var(--text-muted); }
.periodic-detail-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.periodic-meta-chip {
  border: 1px solid rgba(106,184,209,0.35);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-primary);
  background: rgba(106,184,209,0.12);
}
.periodic-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.periodic-detail-grid div { border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: 11px; color: var(--text-secondary); }
.periodic-detail-grid span { display: block; margin-bottom: 3px; color: var(--text-muted); font-size: 10px; }
.periodic-detail-grid strong { color: var(--text-primary); font-size: 12px; }
.periodic-detail-wide { grid-column: 1 / -1; }
.chem-ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  letter-spacing: 0.2px;
  word-break: break-word;
}
.periodic-shell-list { display: grid; grid-template-columns: 1fr; gap: 6px; }
.periodic-shell-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(122,153,198,0.22);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
}
.periodic-shell-row span { margin-bottom: 0; color: var(--text-secondary); font-size: 10.5px; }
.periodic-shell-row strong { font-size: 12px; color: var(--neon-cyan); }
.periodic-atom-wrap {
  border: 1px solid rgba(106,184,209,0.32);
  border-radius: 12px;
  background: radial-gradient(circle at center, rgba(22,42,68,0.58), rgba(8,15,26,0.95));
  padding: 8px;
}
.periodic-atom-svg {
  width: 100%;
  max-width: 240px;
  height: auto;
  margin: 0 auto;
  display: block;
}
.atom-shell-ring {
  fill: none;
  stroke: rgba(142,174,215,0.34);
  stroke-width: 1.1;
}
.atom-orbit {
  transform-origin: 160px 160px;
  animation: atom-orbit-spin var(--orbit-dur, 10s) linear infinite;
}
.atom-orbit.atom-orbit-reverse { animation-direction: reverse; }
.atom-electron {
  fill: #7ed6ff;
  filter: drop-shadow(0 0 2px rgba(126,214,255,0.8));
}
.atom-nucleus circle {
  fill: rgba(106,184,209,0.18);
  stroke: rgba(106,184,209,0.68);
  stroke-width: 1.2;
}
.atom-nucleus-symbol {
  fill: #e8f4ff;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 900;
}
.atom-nucleus-z {
  fill: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
}
.periodic-atom-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}
.periodic-edu-panel {
  margin-top: 10px;
  border: 1px solid rgba(106,184,209,0.25);
  border-radius: 12px;
  padding: 10px;
  background: rgba(106,184,209,0.06);
}
.periodic-edu-title {
  font-size: 12px;
  font-weight: 900;
  color: var(--neon-cyan);
  margin-bottom: 8px;
}
.periodic-edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.periodic-edu-card {
  border: 1px solid rgba(122,153,198,0.3);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,0.03);
}
.periodic-edu-wide { grid-column: 1 / -1; }
.periodic-edu-label {
  font-size: 10px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.periodic-edu-text {
  font-size: 10.8px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.periodic-close {
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  color: var(--text-secondary);
}
@keyframes atom-orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Organic reaction cards — Phase 12.5 motion upgrade */
.rxn-ctrl-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
}

.rxn-card {
  padding: 12px;
  margin-bottom: 12px;
  border-color: rgba(106,184,209,0.26);
  background: linear-gradient(180deg, rgba(16,27,47,0.95), rgba(10,18,32,0.98));
}
.rxn-card-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.rxn-card-title-wrap { min-width: 0; }
.rxn-card-title {
  font-size: clamp(14px, 4.2vw, 16px);
  line-height: 1.6;
  font-weight: 900;
  color: var(--text-primary);
}
.rxn-card-equation {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: clamp(11px, 3.4vw, 13px);
  line-height: 1.8;
  color: #9bd7ea;
  word-break: break-word;
}
.rxn-ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}
.rxn-card-note {
  align-self: flex-start;
  border: 1px solid rgba(213,176,99,0.5);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  color: #f3cd7f;
}
.rxn-card-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.rxn-card-meta strong { color: var(--text-primary); }

.rxn-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(122,153,198,0.34);
  border-radius: 12px;
  background: rgba(12,21,38,0.9);
  padding: 10px;
}
.scene-enter { animation: rxn-fade-in 0.25s var(--ease-out); }

.rxn-stage-progress {
  align-self: flex-start;
  border: 1px solid rgba(122,153,198,0.25);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 10px;
  color: var(--text-muted);
}
.rxn-scene-title {
  font-size: clamp(13px, 3.8vw, 15px);
  line-height: 1.6;
  font-weight: 800;
  color: #9bd7ea;
}
.rxn-explanation {
  font-size: clamp(11px, 3.2vw, 12px);
  line-height: 1.9;
  color: var(--text-secondary);
}

.rxn-visual-panel {
  border: 1px solid rgba(106,184,209,0.3);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(11,20,36,0.95), rgba(8,15,28,0.98));
  padding: 8px;
}
.rxn-visual-svg {
  width: 100%;
  height: auto;
  max-height: 206px;
  display: block;
}
.rxn-v-ltr,
.rxn-v-ltr text {
  direction: ltr;
  unicode-bidi: isolate;
}
.rxn-v-label {
  fill: #93b4d3;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-ar);
}
.rxn-v-formula,
.rxn-v-eq {
  fill: #eaf5ff;
  font-size: 18px;
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.2px;
}
.rxn-v-eq { fill: #f1d08a; font-size: 18px; }
.rxn-v-cond {
  fill: #f3cd7f;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 800;
}
.rxn-v-bond { stroke: #b2c8e2; stroke-width: 2.3; stroke-linecap: round; }
.rxn-v-bond-new { stroke: #8fe0bf; stroke-width: 2.8; stroke-dasharray: 42; stroke-dashoffset: 42; }
.rxn-v-tag {
  fill: rgba(106,184,209,0.16);
  stroke: rgba(106,184,209,0.54);
  stroke-width: 1.4;
}
.rxn-v-reactant-pill {
  fill: rgba(255,255,255,0.04);
  stroke: rgba(126,163,209,0.44);
  stroke-width: 1.3;
}
.rxn-v-reagent-pill {
  fill: rgba(213,176,99,0.12);
  stroke: rgba(213,176,99,0.46);
  stroke-width: 1.2;
}
.rxn-v-product-pill {
  fill: rgba(89,184,148,0.12);
  stroke: rgba(89,184,148,0.52);
  stroke-width: 1.3;
}
.rxn-v-product-final {
  fill: rgba(89,184,148,0.15);
}
.rxn-v-cond-pill,
.rxn-v-water-pill {
  fill: rgba(243,205,127,0.09);
  stroke: rgba(243,205,127,0.38);
  stroke-width: 1.2;
}
.rxn-v-focus-ring {
  fill: rgba(106,184,209,0.08);
  stroke: rgba(106,184,209,0.55);
  stroke-width: 1.4;
  stroke-dasharray: 6 5;
}
.rxn-v-core-text,
.rxn-v-product-text {
  font-size: 21px;
  font-weight: 900;
}
.rxn-v-arrow-line {
  stroke: #f1d08a;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
}
.rxn-v-arrow-head { fill: #f1d08a; opacity: 0; }
.rxn-v-eq-line,
.rxn-v-eq-line-back { stroke-dasharray: 56; stroke-dashoffset: 56; }
.rxn-v-eq-head-back { opacity: 0; }

.rxn-v-core,
.rxn-v-reagent,
.rxn-v-approach-arrow,
.rxn-v-attach-left,
.rxn-v-attach-right,
.rxn-v-product,
.rxn-v-condition,
.rxn-v-oxidant-1,
.rxn-v-arrow-1,
.rxn-v-aldehyde,
.rxn-v-oxidant-2,
.rxn-v-arrow-2,
.rxn-v-acid,
.rxn-v-acid-reactant,
.rxn-v-alcohol-reactant,
.rxn-v-eq-arrow,
.rxn-v-water-leave,
.rxn-v-ester-product,
.rxn-v-ester-bond {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.45s var(--ease-out), opacity 0.35s var(--ease-out);
}

.rxn-topic-alkene-addition .rxn-v-approach-arrow,
.rxn-topic-alkene-addition .rxn-v-attach-left,
.rxn-topic-alkene-addition .rxn-v-attach-right,
.rxn-topic-alkene-addition .rxn-v-product,
.rxn-topic-alkene-addition .rxn-v-condition,
.rxn-topic-ethanol-oxidation .rxn-v-oxidant-1,
.rxn-topic-ethanol-oxidation .rxn-v-arrow-1,
.rxn-topic-ethanol-oxidation .rxn-v-aldehyde,
.rxn-topic-ethanol-oxidation .rxn-v-oxidant-2,
.rxn-topic-ethanol-oxidation .rxn-v-arrow-2,
.rxn-topic-ethanol-oxidation .rxn-v-acid,
.rxn-topic-ethanol-oxidation .rxn-v-condition,
.rxn-topic-esterification .rxn-v-eq-arrow,
.rxn-topic-esterification .rxn-v-water-leave,
.rxn-topic-esterification .rxn-v-ester-product,
.rxn-topic-esterification .rxn-v-ester-bond,
.rxn-topic-esterification .rxn-v-condition {
  opacity: 0;
}

.rxn-topic-alkene-addition .rxn-v-reagent {
  opacity: 1;
  transform: translateX(86px);
}
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-2 .rxn-v-core,
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-2 .rxn-v-focus-ring,
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-2 .rxn-v-cc-1,
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-2 .rxn-v-cc-2 {
  animation: rxn-pulse 1s ease-in-out infinite;
}
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-3 .rxn-v-reagent {
  transform: translateX(0);
  animation: rxn-slide-in 0.5s var(--ease-out);
}
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-3 .rxn-v-approach-arrow,
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-3 .rxn-v-condition {
  opacity: 1;
  animation: rxn-fade-in 0.35s var(--ease-out);
}
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-3 .rxn-v-arrow-line,
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-3 .rxn-v-arrow-head {
  opacity: 1;
  animation: rxn-bond-form 0.6s var(--ease-out) forwards;
}
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-4 .rxn-v-br-link {
  animation: rxn-fade-out 0.45s var(--ease-out) forwards;
}
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-4 .rxn-v-attach-left,
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-4 .rxn-v-attach-right {
  opacity: 1;
  animation: rxn-fade-in 0.4s var(--ease-out);
}
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-4 .rxn-v-bond-new {
  opacity: 1;
  animation: rxn-bond-form 0.62s var(--ease-out) forwards;
}
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-5 .rxn-v-product,
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-5 .rxn-v-condition,
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-6 .rxn-v-product,
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-6 .rxn-v-condition {
  opacity: 1;
  animation: rxn-fade-in 0.45s var(--ease-out);
}
.rxn-stage.rxn-topic-alkene-addition.rxn-scene-6 .rxn-v-product {
  animation: rxn-product-pop 0.65s var(--ease-out);
}

.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-2 .rxn-v-oh-tag {
  animation: rxn-pulse 1s ease-in-out infinite;
}
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-3 .rxn-v-oxidant-1 {
  opacity: 1;
  transform: translateX(-70px);
  animation: rxn-slide-in 0.55s var(--ease-out);
}
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-3 .rxn-v-arrow-1,
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-3 .rxn-v-condition {
  opacity: 1;
  animation: rxn-fade-in 0.35s var(--ease-out);
}
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-3 .rxn-v-arrow-line,
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-3 .rxn-v-arrow-head {
  opacity: 1;
  animation: rxn-bond-form 0.58s var(--ease-out) forwards;
}
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-4 .rxn-v-aldehyde {
  opacity: 1;
  animation: rxn-fade-in 0.42s var(--ease-out);
}
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-5 .rxn-v-oxidant-2 {
  opacity: 1;
  transform: translateX(-62px);
  animation: rxn-slide-in 0.52s var(--ease-out);
}
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-5 .rxn-v-arrow-2,
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-5 .rxn-v-acid,
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-6 .rxn-v-acid,
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-6 .rxn-v-aldehyde,
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-6 .rxn-v-condition {
  opacity: 1;
  animation: rxn-fade-in 0.4s var(--ease-out);
}
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-5 .rxn-v-arrow-2 .rxn-v-arrow-line,
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-5 .rxn-v-arrow-2 .rxn-v-arrow-head {
  opacity: 1;
  animation: rxn-bond-form 0.58s var(--ease-out) forwards;
}
.rxn-stage.rxn-topic-ethanol-oxidation.rxn-scene-6 .rxn-v-product-final {
  animation: rxn-product-pop 0.62s var(--ease-out);
}

.rxn-topic-esterification .rxn-v-acid-reactant {
  transform: translateX(-38px);
}
.rxn-topic-esterification .rxn-v-alcohol-reactant {
  transform: translateX(38px);
}
.rxn-stage.rxn-topic-esterification.rxn-scene-2 .rxn-v-cooh-tag,
.rxn-stage.rxn-topic-esterification.rxn-scene-2 .rxn-v-oh-tag {
  animation: rxn-pulse 1s ease-in-out infinite;
}
.rxn-stage.rxn-topic-esterification.rxn-scene-3 .rxn-v-acid-reactant,
.rxn-stage.rxn-topic-esterification.rxn-scene-3 .rxn-v-alcohol-reactant {
  transform: translateX(0);
}
.rxn-stage.rxn-topic-esterification.rxn-scene-3 .rxn-v-acid-reactant {
  animation: rxn-slide-in-left 0.55s var(--ease-out);
}
.rxn-stage.rxn-topic-esterification.rxn-scene-3 .rxn-v-alcohol-reactant {
  animation: rxn-slide-in 0.55s var(--ease-out);
}
.rxn-stage.rxn-topic-esterification.rxn-scene-3 .rxn-v-eq-arrow,
.rxn-stage.rxn-topic-esterification.rxn-scene-3 .rxn-v-condition {
  opacity: 1;
  animation: rxn-fade-in 0.35s var(--ease-out);
}
.rxn-stage.rxn-topic-esterification.rxn-scene-3 .rxn-v-eq-line,
.rxn-stage.rxn-topic-esterification.rxn-scene-3 .rxn-v-eq-line-back,
.rxn-stage.rxn-topic-esterification.rxn-scene-3 .rxn-v-arrow-head,
.rxn-stage.rxn-topic-esterification.rxn-scene-3 .rxn-v-eq-head-back {
  opacity: 1;
  animation: rxn-bond-form 0.58s var(--ease-out) forwards;
}
.rxn-stage.rxn-topic-esterification.rxn-scene-4 .rxn-v-water-leave,
.rxn-stage.rxn-topic-esterification.rxn-scene-4 .rxn-v-ester-bond {
  opacity: 1;
  animation: rxn-fade-in 0.38s var(--ease-out);
}
.rxn-stage.rxn-topic-esterification.rxn-scene-4 .rxn-v-bond-new {
  opacity: 1;
  animation: rxn-bond-form 0.64s var(--ease-out) forwards;
}
.rxn-stage.rxn-topic-esterification.rxn-scene-5 .rxn-v-water-leave {
  opacity: 1;
  animation: rxn-fade-out 0.5s var(--ease-out) forwards;
}
.rxn-stage.rxn-topic-esterification.rxn-scene-5 .rxn-v-ester-product,
.rxn-stage.rxn-topic-esterification.rxn-scene-6 .rxn-v-ester-product,
.rxn-stage.rxn-topic-esterification.rxn-scene-6 .rxn-v-condition,
.rxn-stage.rxn-topic-esterification.rxn-scene-6 .rxn-v-eq-arrow {
  opacity: 1;
  animation: rxn-fade-in 0.42s var(--ease-out);
}
.rxn-stage.rxn-topic-esterification.rxn-scene-6 .rxn-v-product-final {
  animation: rxn-product-pop 0.65s var(--ease-out);
}

.rxn-equation-grid {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: start;
}
.rxn-row-label {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
  padding-top: 6px;
}
.rxn-row-formulas {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.rxn-formula-box {
  border: 1px solid rgba(122,153,198,0.32);
  border-radius: 9px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
  font-family: var(--font-mono);
  font-size: clamp(11px, 3.3vw, 13px);
  line-height: 1.6;
  color: var(--text-primary);
  max-width: 100%;
  word-break: break-word;
}
.rxn-inline-sep { font-size: 12px; font-weight: 800; color: #f1d08a; }
.rxn-arrow-box {
  min-width: 44px;
  text-align: center;
  border: 1px solid rgba(213,176,99,0.44);
  border-radius: 9px;
  padding: 6px 8px;
  color: #f3cd7f;
  font-size: 14px;
  font-weight: 800;
  background: rgba(213,176,99,0.12);
}
.rxn-condition-text {
  border: 1px solid rgba(106,184,209,0.34);
  border-radius: 9px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-secondary);
  background: rgba(106,184,209,0.08);
}
.rxn-takeaway {
  border: 1px solid rgba(89,184,148,0.34);
  border-radius: 10px;
  padding: 8px;
  background: rgba(89,184,148,0.08);
  font-size: 11px;
  line-height: 1.8;
  color: #cce8dd;
}
.rxn-takeaway span { font-weight: 900; color: var(--text-primary); margin-left: 4px; }

.rxn-highlight {
  border-color: rgba(106,184,209,0.88) !important;
  box-shadow: 0 0 0 1px rgba(106,184,209,0.35) inset;
  animation: rxn-pulse 1.2s ease-in-out infinite;
}
.rxn-highlight-row .rxn-formula-box {
  border-color: rgba(106,184,209,0.88);
  animation: rxn-pulse 1.2s ease-in-out infinite;
}

.rxn-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.rxn-why {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.rxn-why strong { color: var(--text-primary); }

@keyframes rxn-slide-in {
  from { transform: translateX(62px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes rxn-slide-in-left {
  from { transform: translateX(-62px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes rxn-pulse {
  0%, 100% { opacity: 0.72; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes rxn-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rxn-fade-out {
  from { opacity: 1; }
  to { opacity: 0.08; }
}
@keyframes rxn-bond-form {
  from { stroke-dashoffset: 72; opacity: 0; }
  to { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes rxn-product-pop {
  0% { opacity: 0.15; transform: scale(0.9); }
  60% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 420px) {
  .rxn-equation-grid { grid-template-columns: 76px 1fr; }
  .rxn-row-label { font-size: 10px; }
  .rxn-visual-svg { max-height: 182px; }
  .rxn-v-formula,
  .rxn-v-eq { font-size: 16px; }
  .rxn-v-core-text,
  .rxn-v-product-text { font-size: 18px; }
}
/* ═══════════════════════════════════════════════════
   QUIZ ENGINE
═══════════════════════════════════════════════════ */
.quiz-progress-wrap { margin-bottom: var(--sp-md); }
.quiz-prog-bar { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.quiz-prog-fill { height: 100%; background: linear-gradient(90deg, var(--neon-blue), var(--neon-cyan)); border-radius: 99px; transition: width 0.4s var(--ease-out); }
.quiz-prog-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; text-align: center; }

.quiz-card { padding: var(--sp-lg); margin-bottom: var(--sp-md); }
.quiz-q { font-size: 15px; font-weight: 700; line-height: 1.7; margin-bottom: var(--sp-lg); }
.quiz-level {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 10px;
}
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  padding: 12px var(--sp-md); border: 1px solid var(--border);
  border-radius: var(--r-md); font-size: 13px; color: var(--text-primary);
  text-align: right; background: rgba(255,255,255,0.04);
  transition: all 0.2s; cursor: pointer;
}
.quiz-opt:active:not(:disabled) { transform: scale(0.98); }
.quiz-opt.correct  { background: rgba(0,255,179,0.1);   border-color: var(--neon-green);  color: var(--neon-green); }
.quiz-opt.wrong    { background: rgba(255,77,109,0.1);   border-color: var(--neon-red);    color: var(--neon-red); }
.quiz-opt.revealed { background: rgba(255,204,68,0.06);  border-color: rgba(255,204,68,0.3); opacity: 0.6; }
.quiz-opt:disabled { cursor: default; }

.quiz-explain {
  margin-top: var(--sp-md); padding: 10px 12px;
  background: rgba(0,255,179,0.06); border: 1px solid rgba(0,255,179,0.2);
  border-radius: var(--r-sm); font-size: 12px; color: var(--text-secondary); line-height: 1.7;
}
.quiz-adaptive-suggest {
  margin-top: 10px;
  border: 1px solid rgba(106,184,209,0.28);
  border-radius: 10px;
  background: rgba(106,184,209,0.08);
  padding: 10px;
}
.quiz-adaptive-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.quiz-adaptive-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.quiz-adapt-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  padding: 8px 10px;
  text-align: center;
}
.quiz-result {
  text-align: center; padding: var(--sp-xl) var(--sp-lg);
  animation: fadeSlideUp 0.4s var(--ease-out);
}
.quiz-result-score { font-size: 52px; font-weight: 900; line-height: 1; }
.quiz-result-label { font-size: 18px; font-weight: 800; margin-top: 8px; }
.quiz-result-sub { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.quiz-result-bar-wrap { margin: var(--sp-lg) 0; }
.quiz-levels-summary {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; font-size: 10.5px; color: var(--text-secondary);
}
.quiz-levels-summary span {
  border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 9px;
}

.btn-primary {
  width: 100%; padding: 13px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
  color: #000; font-size: 14px; font-weight: 800;
  letter-spacing: 0.3px; cursor: pointer; transition: opacity 0.2s;
}
.btn-primary:active { opacity: 0.85; }
.btn-ghost {
  width: 100%; padding: 12px; border-radius: var(--r-md);
  border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 13px; font-weight: 700; cursor: pointer;
  background: none; margin-top: 8px; transition: border-color 0.2s;
}
.btn-ghost:active { border-color: var(--neon-blue); }

/* ═══════════════════════════════════════════════════
   FLASHCARDS
═══════════════════════════════════════════════════ */
.fc-counter { font-size: 12px; color: var(--text-muted); text-align: center; margin-bottom: var(--sp-md); }
.fc-due-status {
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
  margin: -8px 0 10px;
}
.fc-due-status.is-due-now { color: var(--neon-amber); }
.fc-due-status.is-due-later { color: var(--text-muted); }
.fc-topics { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.fc-topic-btn {
  flex-shrink: 0; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 11px; font-weight: 700; background: var(--bg-card);
}
.fc-topic-btn.active {
  color: var(--text-primary);
  border-color: var(--neon-cyan);
  background: rgba(106,184,209,0.15);
}
.fc-scene { perspective: 1200px; margin-bottom: var(--sp-md); cursor: pointer; min-height: 200px; }
.fc-card {
  position: relative; width: 100%; min-height: 200px;
  transform-style: preserve-3d; transition: transform 0.55s var(--ease-out);
}
.fc-card.flipped { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; border-radius: var(--r-xl);
  border: 1px solid var(--border); backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: var(--sp-xl);
  background: var(--bg-card); min-height: 200px;
}
.fc-face-back { transform: rotateY(180deg); border-color: var(--border-glow); }
.fc-face-label { font-size: 9px; font-weight: 800; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; }
.fc-face-text { font-size: 15px; font-weight: 700; text-align: center; line-height: 1.7; white-space: pre-line; }
.fc-hint { font-size: 11px; color: var(--text-muted); text-align: center; margin-bottom: var(--sp-md); }
.fc-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fc-nav-btn {
  flex: 1; padding: 11px 8px; border: 1px solid var(--border);
  border-radius: var(--r-md); font-size: 13px; font-weight: 700;
  color: var(--text-secondary); background: var(--bg-card);
  cursor: pointer; transition: all 0.2s;
}
.fc-nav-btn:active { border-color: var(--neon-blue); color: var(--neon-blue); }
.fc-confidence { display: flex; gap: 6px; flex: 1; justify-content: center; }
.fc-conf-btn {
  flex: 1; padding: 10px 6px; border-radius: var(--r-sm);
  font-size: 11px; font-weight: 800; cursor: pointer;
  transition: transform 0.15s;
}
.fc-conf-btn:active { transform: scale(0.93); }
.fc-conf-hard { background: rgba(255,77,109,0.12);  border: 1px solid rgba(255,77,109,0.3);  color: var(--neon-red); }
.fc-conf-ok   { background: rgba(255,204,68,0.12);  border: 1px solid rgba(255,204,68,0.3);  color: var(--neon-amber); }
.fc-conf-easy { background: rgba(0,255,179,0.12);   border: 1px solid rgba(0,255,179,0.3);   color: var(--neon-green); }

/* Organic pathway mini-map */
.pathway-scroll { overflow-x: auto; padding-bottom: 8px; }
.pathway-row { display: flex; align-items: center; gap: 0; min-width: max-content; padding: 4px 0; }
.pw-node {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; min-width: 80px;
}
.pw-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid; text-align: center;
}
.pw-sub { font-size: 9px; color: var(--text-muted); text-align: center; max-width: 80px; }
.pw-arrow { display: flex; flex-direction: column; align-items: center; padding: 0 4px; }
.pw-arrow-line { font-size: 10px; color: var(--text-muted); }
.pw-arrow-cond { font-size: 8px; color: var(--neon-amber); max-width: 60px; text-align: center; }

/* Functional group chips */
.fg-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 800; padding: 4px 10px;
  border-radius: 99px; font-family: var(--font-mono); margin: 3px 2px;
  border: 1px solid;
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS & MICRO-INTERACTIONS
═══════════════════════════════════════════════════ */
.fade-in  { animation: fadeSlideUp 0.28s var(--ease-out) both; }
.fade-in-delay-1 { animation-delay: 0.06s; }
.fade-in-delay-2 { animation-delay: 0.12s; }
.fade-in-delay-3 { animation-delay: 0.18s; }

/* ═══════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 90px; left: 50%; z-index: 999;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px 18px;
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: all 0.3s var(--ease-out); white-space: nowrap;
  backdrop-filter: blur(16px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════════
   SVG BOND ANIMATION OVERLAY
═══════════════════════════════════════════════════ */
.bond-demo {
  border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--bg-surface); overflow: hidden; margin-bottom: var(--sp-md);
}
.bond-demo-label { font-size: 11px; font-weight: 800; padding: 10px var(--sp-md) 0; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════
   ORGANIC TAB — FULL REBUILD
═══════════════════════════════════════════════════ */
.organic-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 22px;
}
.organic-section {
  background: linear-gradient(180deg, rgba(15,26,44,0.9), rgba(10,18,32,0.96));
  border: 1px solid rgba(122,153,198,0.24);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.organic-section-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.5;
}
.organic-section-sub {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.85;
}
.organic-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.organic-chip-btn {
  min-height: 40px;
  border-radius: 11px;
  border: 1px solid rgba(122,153,198,0.34);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  font-size: 11.3px;
  font-weight: 800;
  line-height: 1.5;
  padding: 8px 10px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, transform 0.12s;
}
.organic-chip-btn:active {
  transform: scale(0.98);
  border-color: rgba(106,184,209,0.55);
  background: rgba(106,184,209,0.12);
}
.organic-chip-btn.is-selected {
  border-color: rgba(106,184,209,0.64);
  background: rgba(106,184,209,0.14);
  color: var(--text-primary);
}
.organic-subheader-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.organic-back-btn {
  min-height: 36px;
  padding-inline: 12px;
  white-space: nowrap;
}
.organic-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.organic-index-card {
  border: 1px solid rgba(122,153,198,0.34);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  text-align: right;
  padding: 12px;
  min-height: 94px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s, background 0.2s, transform 0.12s;
}
.organic-index-card:active {
  transform: scale(0.985);
  border-color: rgba(106,184,209,0.6);
  background: rgba(106,184,209,0.12);
}
.organic-index-title {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.6;
}
.organic-index-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.organic-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.organic-group-card,
.organic-reagent-card,
.organic-comparison-card {
  border: 1px solid rgba(122,153,198,0.28);
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.organic-group-card h3,
.organic-reagent-card h3,
.organic-comparison-card h3 {
  font-size: 13px;
  font-weight: 900;
  color: #d8ecff;
  line-height: 1.6;
}
.organic-group-card p,
.organic-reagent-card p,
.organic-comparison-card p {
  font-size: 11.2px;
  line-height: 1.85;
  color: var(--text-secondary);
}
.organic-group-card strong,
.organic-reagent-card strong,
.organic-comparison-card strong {
  color: var(--text-primary);
}

.organic-flow-map,
.organic-c2-path,
.organic-lessons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.organic-flow-card,
.organic-step-card {
  border: 1px solid rgba(106,184,209,0.28);
  border-radius: 13px;
  background: rgba(8,16,30,0.66);
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.organic-flow-card h3,
.organic-step-card h3 {
  font-size: 13.5px;
  font-weight: 900;
  color: #e6f6ff;
  line-height: 1.6;
}
.organic-flow-card p,
.organic-step-card p {
  font-size: 11.2px;
  line-height: 1.85;
  color: var(--text-secondary);
}
.organic-flow-arrow {
  border: 1px dashed rgba(122,153,198,0.34);
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  background: rgba(255,255,255,0.02);
  font-size: 10.9px;
  color: var(--text-secondary);
}
.organic-flow-arrow span { line-height: 1.75; }
.organic-flow-arrow strong { color: var(--text-primary); }
.chem-equation-arrow {
  display: inline-block;
  font-size: 16px;
  color: #9bd7ea;
  font-weight: 900;
}
.organic-trap {
  border: 1px solid rgba(207,125,136,0.35);
  border-radius: 10px;
  background: rgba(207,125,136,0.09);
  padding: 7px 9px;
}

.organic-note-card {
  border: 1px solid rgba(122,153,198,0.28);
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
  padding: 11px;
}
.organic-note-card h3 {
  font-size: 12.6px;
  font-weight: 900;
  color: #d8ecff;
  margin-bottom: 4px;
  line-height: 1.65;
}
.organic-note-card p {
  font-size: 11.2px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.organic-note-card ul {
  margin: 0;
  padding-inline-start: 18px;
  display: grid;
  gap: 5px;
}
.organic-note-card li {
  font-size: 11.2px;
  line-height: 1.85;
  color: var(--text-secondary);
}

.organic-steps-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.organic-step-item {
  border: 1px solid rgba(122,153,198,0.24);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  padding: 8px 9px;
}
.organic-step-item h4 {
  font-size: 12.1px;
  font-weight: 900;
  color: #d8ecff;
  margin-bottom: 3px;
}
.organic-step-item p {
  margin: 0;
  font-size: 11px;
  line-height: 1.8;
}

.organic-activity-card {
  border: 1px solid rgba(106,184,209,0.3);
  border-radius: 13px;
  background: rgba(8,16,30,0.72);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.organic-activity-card h3 {
  font-size: 13.5px;
  font-weight: 900;
  color: #e6f6ff;
}
.organic-activity-card p {
  font-size: 11.2px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.organic-activity-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.organic-activity-feedback {
  font-size: 11.2px;
  line-height: 1.8;
  color: #d8ecff;
}
.organic-activity-feedback.ok { color: #95e4bf; }
.organic-activity-feedback.bad { color: #ffb2bf; }
.organic-activity-feedback.muted { color: var(--text-muted); }

.chem-formula,
.chem-equation,
.chem-ltr {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  font-family: var(--font-mono);
}
.chem-formula {
  display: inline-block;
  font-size: 13px;
  color: #eaf5ff;
  line-height: 1.7;
  letter-spacing: 0.1px;
}
.chem-equation {
  display: block;
  border: 1px solid rgba(122,153,198,0.3);
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
  padding: 7px 9px;
  font-size: 13.5px;
  color: #f3e6bf;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.chem-sub { font-size: 0.78em; vertical-align: sub; }
.chem-sup { font-size: 0.76em; vertical-align: super; }

@media (max-width: 480px) {
  .home-track-grid { grid-template-columns: 1fr; }
  .home-quick-grid { grid-template-columns: 1fr; }
  .home-path-actions { grid-template-columns: 1fr; }
  .topbar-brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }
  .topbar-brand-main {
    font-size: 12px;
    letter-spacing: 1.1px;
  }
  .topbar-btn {
    min-height: 34px;
    padding: 0 8px;
  }
  .topbar-btn-install {
    min-width: 58px;
  }
  .topbar-btn-install .install-text { font-size: 10px; }
  .topbar-btn-install .install-icon,
  .topbar-btn-install .install-icon-svg {
    width: 16px;
    height: 16px;
  }
  .hero-brand-mark {
    width: 78px;
    height: 78px;
    border-radius: 15px;
  }
  .hero-title {
    font-size: clamp(27px, 11vw, 34px);
    letter-spacing: 2.1px;
  }
  .hero-tagline { font-size: 10px; }
  .law-card-head { flex-direction: column; align-items: flex-start; }
  .laws-clear-btn { position: static; transform: none; margin-top: 6px; }
  .organic-roadmap-grid { grid-template-columns: 1fr; }
  .organic-mini-cards { grid-template-columns: 1fr; }
  .organic-page { gap: 14px; }
  .organic-section { padding: 12px; gap: 9px; }
  .organic-section-title { font-size: 15px; }
  .organic-grid-2 { grid-template-columns: 1fr; }
  .organic-subheader-row { flex-direction: column; }
  .organic-back-btn { width: 100%; }
  .organic-index-grid { grid-template-columns: 1fr; }
  .organic-group-grid { grid-template-columns: 1fr; }
  .organic-chip-btn { min-height: 42px; font-size: 11px; }
  .chem-formula { font-size: 12.6px; }
  .chem-equation { font-size: 12.8px; }
  .organic-flow-arrow { font-size: 10.6px; }
  .organic-activity-actions { grid-template-columns: 1fr; }
  .periodic-detail-grid { grid-template-columns: 1fr; }
  .periodic-edu-grid { grid-template-columns: 1fr; }
  .periodic-atom-svg { max-width: 210px; }
  .rxn-anim-head { flex-direction: column; align-items: flex-start; }
}



