:root {
  --primary: #6C63FF;
  --primary-2: #8B83FF;
  --primary-soft: rgba(108,99,255,0.14);
  --primary-glow: rgba(108,99,255,0.45);
  --secondary: #FF6B35;
  --secondary-soft: rgba(255,107,53,0.14);
  --bg: #0F0F1A;
  --bg-2: #15152540;
  --card: #1A1A2E;
  --card-2: #1F1F38;
  --border: #2A2A4A;
  --border-soft: #22223F;
  --text: #E8E8F4;
  --text-2: #A3A3C2;
  --text-3: #6B6B8C;
  --green: #10B981;
  --yellow: #F59E0B;
  --red: #EF4444;
  --blue: #3B82F6;
  --purple: #8B5CF6;
  --orange: #F97316;
  --teal: #34D399;
  --gray: #6B7280;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss02";
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: normal; }

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2A2A4A; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #353560; background-clip: padding-box; border: 2px solid transparent; }

/* App layout */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  width: 100vw;
  background:
    radial-gradient(900px 600px at 100% -10%, rgba(108,99,255,0.10), transparent 60%),
    radial-gradient(700px 500px at -10% 100%, rgba(255,107,53,0.06), transparent 60%),
    var(--bg);
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, rgba(26,26,46,0.6), rgba(15,15,26,0.9));
  border-left: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 4px;
  position: relative;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #4F46E5);
  display: grid; place-items: center;
  box-shadow: 0 4px 18px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,0.15);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: -2px;
  border-radius: 12px; padding: 2px;
  background: linear-gradient(135deg, rgba(108,99,255,0.5), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--text-3); }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: background .18s, color .18s;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.03); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(108,99,255,0.18), rgba(108,99,255,0.04));
  color: #fff;
}
.nav-item.active::before {
  content: ""; position: absolute; right: 0; top: 22%; bottom: 22%;
  width: 3px; border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 12px var(--primary-glow);
}
.nav-item .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-3);
  width: 18px; text-align: center;
}
.nav-item.active .num { color: var(--primary-2); }
.nav-item .lab { flex: 1; }
.nav-item .badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 10px var(--secondary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 10px;
  padding: 14px 8px 4px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), #C2410C);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.user-meta { font-size: 12.5px; }
.user-meta .nm { font-weight: 600; }
.user-meta .rl { color: var(--text-3); font-size: 11px; }

/* Main area */
.main {
  overflow: hidden;
  display: flex; flex-direction: column;
  min-width: 0;
}
.topbar {
  display: flex; align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(15,15,26,0.6);
  backdrop-filter: blur(10px);
  gap: 16px;
  flex-shrink: 0;
}
.page-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.page-crumb { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.topbar-tools { margin-right: auto; display: flex; gap: 10px; align-items: center; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 8px 12px;
  width: 280px;
  transition: border .15s;
}
.search:focus-within { border-color: var(--primary); }
.search input {
  background: none; border: 0; outline: 0;
  color: var(--text); flex: 1; font-size: 13px;
}
.search input::placeholder { color: var(--text-3); }
.kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-3);
}

.icon-btn {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-2);
  position: relative;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 8px; left: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 80px;
}

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(31,31,56,0.6), rgba(26,26,46,0.85));
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 20px;
  position: relative;
}
.card-hover:hover { border-color: var(--border); }
.card-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.card-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

/* Stat card */
.stat-card {
  background: linear-gradient(160deg, rgba(31,31,56,0.7), rgba(26,26,46,0.95));
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::after { display: none; }
.stat-label {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-2); font-size: 12.5px;
}
.stat-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-2);
  display: grid; place-items: center;
}
.stat-value {
  font-size: 30px; font-weight: 700;
  letter-spacing: -.02em;
  margin: 10px 0 6px;
  font-feature-settings: "ss02", "tnum";
}
.stat-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16,185,129,0.12);
  color: #34D399;
}
.stat-delta.down { background: rgba(239,68,68,0.12); color: #F87171; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.badge.cold { background: rgba(59,130,246,0.14); color: #60A5FA; }
.badge.warm { background: rgba(245,158,11,0.14); color: #FBBF24; }
.badge.ready { background: rgba(16,185,129,0.14); color: #34D399; }
.badge.unfit { background: rgba(107,114,128,0.18); color: #9CA3AF; }
.badge.online { background: rgba(139,92,246,0.16); color: #A78BFA; }
.badge.workshop { background: rgba(249,115,22,0.16); color: #FB923C; }
.badge.free { background: rgba(52,211,153,0.16); color: #34D399; }
.badge.sold { background: rgba(108,99,255,0.18); color: #A5B4FC; }
.badge.solid::before { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  background: none; color: var(--text-2);
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { color: var(--text); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4F46E5);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); color: #fff; }
.btn-secondary {
  background: var(--card-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--card); border-color: var(--primary); }
.btn-ghost { border-color: var(--border-soft); }
.btn-ghost:hover { background: rgba(255,255,255,0.04); border-color: var(--border); }
.btn-danger { background: rgba(239,68,68,0.12); color: #F87171; border-color: rgba(239,68,68,0.3); }
.btn-success { background: rgba(16,185,129,0.14); color: #34D399; border-color: rgba(16,185,129,0.3); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

/* Toggle */
.toggle {
  width: 36px; height: 20px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle::after {
  content: ""; position: absolute;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px; right: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle.on { background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.toggle.on::after { transform: translateX(-16px); }

/* Input */
.input, .textarea, .select {
  width: 100%;
  background: rgba(15,15,26,0.6);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  outline: 0;
  transition: border .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); }
.textarea { resize: vertical; min-height: 80px; }
.label { font-size: 12px; color: var(--text-2); margin-bottom: 6px; display: block; font-weight: 500; }

/* Table */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: right;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
  vertical-align: middle;
}
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: rgba(108,99,255,0.04); }
.table tbody tr:last-child td { border-bottom: 0; }

/* Tabs */
.tabs {
  display: inline-flex;
  background: rgba(15,15,26,0.5);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}
.tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
  background: none; border: 0;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, var(--primary), #4F46E5);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* Filter pills */
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-soft);
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
}
.pill:hover { border-color: var(--border); color: var(--text); }
.pill.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: #fff;
}
.pill .count {
  margin-right: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-3);
}
.pill.active .count { color: var(--primary-2); }

/* Progress bar */
.bar { width: 100%; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.bar-fill.green { background: linear-gradient(90deg, #10B981, #34D399); }
.bar-fill.yellow { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.bar-fill.red { background: linear-gradient(90deg, #EF4444, #F87171); }

/* Slide panel */
.scrim {
  position: fixed; inset: 0;
  background: rgba(8,8,16,0.6);
  backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  animation: fade .15s ease forwards;
}
@keyframes fade { to { opacity: 1; } }
.slide-panel {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: min(540px, 92vw);
  background: linear-gradient(180deg, #1A1A2E, #15152A);
  border-left: 1px solid var(--border);
  z-index: 61;
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
  transform: translateX(-100%);
  animation: slidein .25s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes slidein { to { transform: translateX(0); } }
.slide-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 14px;
}
.slide-body { flex: 1; overflow-y: auto; padding: 24px; }

/* Modal */
.modal-shell {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(8,8,16,0.65);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fade .15s ease forwards;
  opacity: 0;
}
.modal {
  width: 100%; max-width: 540px;
  background: linear-gradient(180deg, #1F1F38, #1A1A2E);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  max-height: 90vh;
  display: flex; flex-direction: column;
  transform: scale(.96);
  animation: pop .2s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes pop { to { transform: scale(1); } }
.modal-head {
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
}
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border-soft);
  display: flex; gap: 10px; justify-content: flex-start;
}

/* Toast */
.toast-zone {
  position: fixed; top: 22px; left: 22px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  background: rgba(31,31,56,0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  min-width: 280px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  pointer-events: all;
  animation: toastin .25s cubic-bezier(.2,.7,.2,1);
}
@keyframes toastin {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.toast.success { border-right: 3px solid #10B981; }
.toast.error { border-right: 3px solid #EF4444; }
.toast.info { border-right: 3px solid #3B82F6; }
.toast-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
}
.toast.success .toast-icon { background: rgba(16,185,129,0.16); color: #34D399; }
.toast.error .toast-icon { background: rgba(239,68,68,0.16); color: #F87171; }
.toast.info .toast-icon { background: rgba(59,130,246,0.16); color: #60A5FA; }

/* Skeleton */
.skel {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Spinner */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-3);
  gap: 14px;
}
.empty-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: rgba(108,99,255,0.08);
  display: grid; place-items: center;
  color: var(--primary-2);
}

/* Chat */
.chat-frame { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 130px); border: 1px solid var(--border-soft); border-radius: 16px; overflow: hidden; background: var(--card); }
.chat-list { border-left: 1px solid var(--border-soft); overflow-y: auto; min-height: 0; background: rgba(15,15,26,0.4); }
.chat-conv-item { padding: 14px 16px; border-bottom: 1px solid var(--border-soft); cursor: pointer; transition: background .12s; }
.chat-conv-item:hover { background: rgba(255,255,255,0.03); }
.chat-conv-item.active { background: linear-gradient(90deg, rgba(108,99,255,0.14), transparent); }
.chat-conv-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chat-name { font-size: 13.5px; font-weight: 600; }
.chat-time { font-size: 10.5px; color: var(--text-3); font-family: 'JetBrains Mono', monospace; }
.chat-preview { font-size: 12px; color: var(--text-3); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-pane { display: flex; flex-direction: column; overflow: hidden; background:
  linear-gradient(180deg, rgba(31,31,56,0.3), rgba(15,15,26,0.5)),
  radial-gradient(circle at 30% 30%, rgba(108,99,255,0.05) 0%, transparent 50%);
}
.chat-header { padding: 16px 22px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  position: relative;
  word-wrap: break-word;
}
.bubble.bot {
  align-self: flex-start;
  background: rgba(31,31,56,0.9);
  border: 1px solid var(--border-soft);
  border-bottom-right-radius: 4px;
}
.bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), #4F46E5);
  border-bottom-left-radius: 4px;
  color: #fff;
}
.bubble .meta { display: block; font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 4px; font-family: 'JetBrains Mono', monospace; text-align: left; }
.bubble.bot .meta { color: var(--text-3); }
.day-divider { align-self: center; font-size: 11px; color: var(--text-3); padding: 6px 12px; background: rgba(15,15,26,0.6); border-radius: 999px; margin: 12px 0; }
.attach {
  display: flex; gap: 10px; padding: 8px; background: rgba(15,15,26,0.5); border-radius: 10px; margin-top: 6px;
  align-items: center;
}
.attach-thumb { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg, var(--secondary), #C2410C); display: grid; place-items: center; color: #fff; flex-shrink: 0; }

.chat-composer { padding: 14px 18px; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* Grid helpers */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.flex-1 { flex: 1; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 22px; }
.bold { font-weight: 700; }
.semi { font-weight: 600; }

/* Section heading */
.section-h {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 14px;
}
.section-h h2 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.section-h .h-sub { color: var(--text-3); font-size: 12px; }

/* Lab simulator phone */
.phone-frame {
  width: 360px;
  height: 640px;
  background: linear-gradient(180deg, #1A1A2E, #0F0F1A);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 12px;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  display: flex; flex-direction: column;
}
.phone-screen {
  flex: 1;
  background: var(--bg);
  border-radius: 24px;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* Mobile bottom-nav */
.bottom-nav { display: none; }
@media (max-width: 900px) {
  body { font-size: 13px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 16px; padding-bottom: 100px; }
  .topbar { padding: 12px 16px; }
  .search { width: 140px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .chat-frame { grid-template-columns: 1fr; height: calc(100vh - 200px); }
  .chat-list { display: none; }
  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(15,15,26,0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 6px 6px 10px;
    z-index: 50;
    overflow-x: auto;
  }
  .bn-item {
    flex: 1;
    min-width: 70px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 4px;
    border-radius: 10px;
    color: var(--text-3);
    font-size: 10.5px;
    cursor: pointer;
  }
  .bn-item.active { color: var(--primary-2); background: var(--primary-soft); }
}

/* Persian digits */
.fa-num { font-feature-settings: "ss02", "tnum"; }

/* Persona card */
.persona-card {
  background: linear-gradient(180deg, rgba(31,31,56,0.6), rgba(26,26,46,0.9));
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px;
}
.persona-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
  margin-bottom: 12px;
}

/* Donut SVG */
.donut-bg { stroke: rgba(255,255,255,0.05); }

/* Drag handle */
.drag-handle { color: var(--text-3); cursor: grab; }
.drag-handle:active { cursor: grabbing; }

/* Misc helpers */
.divider { height: 1px; background: var(--border-soft); margin: 16px 0; }
.kbd-key { font-family: 'JetBrains Mono', monospace; font-size: 10px; padding: 2px 6px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 4px; color: var(--text-2); }

.glow-ring {
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(108,99,255,0.4), 0 0 40px rgba(108,99,255,0.2);
  opacity: 0; transition: opacity .2s;
}
.glow-on:hover .glow-ring { opacity: 1; }

/* If-then rule */
.rule-row { display: grid; grid-template-columns: auto 1fr auto 1fr auto; gap: 10px; align-items: center; padding: 14px; border: 1px dashed var(--border-soft); border-radius: 12px; background: rgba(15,15,26,0.3); }
.rule-kw { font-size: 11.5px; font-weight: 700; color: var(--primary-2); font-family: 'JetBrains Mono', monospace; padding: 4px 10px; background: var(--primary-soft); border-radius: 6px; }

/* Comparison bars */
.cmp-bar { display: flex; flex-direction: column; gap: 6px; }
.cmp-bar .row { gap: 8px; }

/* AB column */
.ab-col { background: rgba(15,15,26,0.4); border: 1px solid var(--border-soft); border-radius: 14px; padding: 18px; }
.ab-col.a { border-top: 3px solid var(--primary); }
.ab-col.b { border-top: 3px solid var(--secondary); }

/* Meta suggestion */
.meta-card {
  background: linear-gradient(180deg, rgba(31,31,56,0.6), rgba(26,26,46,0.9));
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px;
}
.diff-block {
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border-soft);
  font-size: 13px; line-height: 1.7;
}
.diff-red { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.2); }
.diff-green { background: rgba(16,185,129,0.06); border-color: rgba(16,185,129,0.2); }
.diff-tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-left: 8px; }
.diff-tag.red { background: rgba(239,68,68,0.18); color: #F87171; }
.diff-tag.green { background: rgba(16,185,129,0.18); color: #34D399; }
