:root {
  --bg-dark: #090d16;
  --bg-sidebar: #0f1523;
  --bg-card: rgba(18, 25, 41, 0.7);
  --bg-input: #131b2e;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #a855f7;
  --accent-rose: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-dark);
}

body {
  font-family: var(--font-main);
  color: var(--text-main);
  display: flex;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.08) 0px, transparent 50%);
}

/* APP SHELL CONTAINER */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* BACKDROP OVERLAY FOR MOBILE DRAWERS */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 40;
  transition: opacity 0.25s ease;
}

/* 1. SIDEBAR (NAYA WORKSPACE) */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  z-index: 30;
  transition: width 0.25s ease, opacity 0.25s ease;
  flex-shrink: 0;
}

/* DESKTOP COLLAPSED SIDEBAR: CLEAN DISPLAY NONE */
.app-container.sidebar-collapsed .sidebar {
  display: none !important;
}

.sidebar-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 4px 15px var(--primary-glow);
  flex-shrink: 0;
}

.brand-text h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
  white-space: nowrap;
}

.badge-status {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-emerald);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

.btn-icon-sidebar-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon-sidebar-close:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

/* SIDEBAR NAV (HOME BUTTON) */
.sidebar-nav {
  padding: 12px 14px 6px 14px;
}

.nav-item {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.nav-item:hover, .nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.nav-icon {
  font-size: 16px;
}

/* USER PROFILE BOX */
.user-profile-box {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.015);
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.user-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-select, .custom-name-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.custom-select:focus, .custom-name-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ROOMS SECTION */
.rooms-section {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.room-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.room-item.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.room-item-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 2px;
}

.room-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-item.active .room-item-title {
  color: #c7d2fe;
}

.room-item-desc {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-delete-room {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
}

.room-item:hover .btn-delete-room {
  opacity: 1;
}

.btn-delete-room:hover {
  color: #f87171;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

.tech-badge {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
}

.tech-badge strong {
  color: var(--text-muted);
}

.memory-tag {
  color: var(--accent-cyan);
  font-size: 10px;
  font-family: var(--font-mono);
}

/* 2. MAIN CONTENT WRAPPER */
.main-content {
  flex: 1;
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

/* =======================================================
   A. HOME VIEW (DASHBOARD ROOM CARDS)
   ======================================================= */
.home-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  background: transparent;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.home-topbar {
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 21, 35, 0.4);
  backdrop-filter: blur(8px);
  gap: 12px;
}

.home-topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.home-content-container {
  padding: 32px 36px 60px 36px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.home-hero {
  margin-bottom: 36px;
  background: linear-gradient(135deg, rgba(26, 33, 56, 0.6), rgba(15, 21, 35, 0.8));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.home-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.home-hero h1 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.home-hero p {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 680px;
  margin-bottom: 24px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 22px;
  font-weight: 800;
  color: #c7d2fe;
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ROOM CARDS GRID */
.rooms-grid-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid-header h2 {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
}

.home-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.room-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
}

.room-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.room-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}

.room-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.room-card-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.room-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.room-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
}

.room-card-action {
  font-size: 13px;
  font-weight: 600;
  color: #818cf8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.room-card:hover .room-card-action {
  color: #a5b4fc;
}

.card-create-new {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  cursor: pointer;
  min-height: 180px;
}

.card-create-new:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  transform: translateY(-4px);
}

.create-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #a5b4fc;
}

.card-create-new span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

/* =======================================================
   B. CHAT VIEW
   ======================================================= */
.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  position: relative;
  background: transparent;
}

.chat-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 21, 35, 0.7);
  backdrop-filter: blur(10px);
  gap: 12px;
  z-index: 20;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

/* HAMBURGER MENU BUTTON: PINNED & ALWAYS ACCESSIBLE */
.btn-header-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-header-icon:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.btn-home-back {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.25);
  color: #38bdf8;
}

.btn-home-back:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.4);
}

.header-room-info {
  min-width: 100px;
  flex: 1 1 auto;
  overflow: hidden;
}

.header-room-info h1 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-room-info p {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-header-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: var(--font-main);
  white-space: nowrap;
}

@media (max-width: 1366px) {
  .btn-header-action .action-label {
    display: none;
  }
  .btn-header-action {
    padding: 8px 10px;
  }
}

.btn-header-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-header-action.active-toggle {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.chat-feed-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* CHAT FEED MESSAGES */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.message-row {
  display: flex;
  gap: 12px;
  max-width: 82%;
  animation: fadeInMsg 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-row.me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-row.system {
  align-self: center;
  max-width: 90%;
  text-align: center;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #334155;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar.ai-avatar {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 0 12px var(--primary-glow);
}

.avatar.user-avatar {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
}

.avatar.friend-avatar {
  background: linear-gradient(135deg, #10b981, #059669);
}

.message-bubble-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

.message-row.me .message-bubble-wrapper {
  align-items: flex-end;
}

.message-meta {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
}

.sender-name {
  font-weight: 600;
  color: var(--text-muted);
}

.ai-tag {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  word-break: break-word;
}

.message-row.me .message-bubble {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
  border-bottom-right-radius: 4px;
}

.message-row.ai .message-bubble {
  background: rgba(26, 33, 56, 0.75);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border-bottom-left-radius: 4px;
}

.message-row.system .message-bubble {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
}

/* TYPING INDICATOR */
.ai-typing-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px 8px 20px;
  padding: 8px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  animation: fadeInMsg 0.2s ease;
}

.typing-avatar {
  font-size: 16px;
  animation: pulse-dot 1.5s infinite;
}

.typing-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #c7d2fe;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  background: #a5b4fc;
  border-radius: 50%;
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* SUGGESTION PILLS */
.suggestion-pills {
  display: flex;
  gap: 8px;
  padding: 0 20px 10px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.suggestion-pills::-webkit-scrollbar {
  display: none;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  padding: 7px 13px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: var(--font-main);
  flex-shrink: 0;
}

.pill-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #fff;
}

/* CHAT INPUT AREA */
.chat-input-area {
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px)) 20px;
  background: rgba(15, 21, 35, 0.7);
  border-top: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}

.chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 6px 10px;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.chat-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.mention-tag-btn {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.mention-tag-btn:hover {
  background: var(--primary);
  color: #fff;
}

.chat-form input#messageInput,
.chat-form input {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 14.5px;
  font-family: var(--font-main);
  padding: 8px 6px;
  min-width: 100px;
  display: block;
}

.chat-form input::placeholder {
  color: var(--text-dim);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
  box-shadow: 0 2px 10px var(--primary-glow);
  flex-shrink: 0;
  min-height: 38px;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* =======================================================
   C. LIVING NOTES (SUPPORT FULLSCREEN!)
   ======================================================= */
.notes-panel {
  width: 440px;
  min-width: 440px;
  background: #0d1322;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  z-index: 25;
  transition: width 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
}

/* FULLSCREEN LIVING NOTES - 100% DEVICE FIT */
.notes-panel.fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 1000 !important;
  transform: none !important;
  border: none !important;
  background: #090d16 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.notes-panel.fullscreen .notes-header {
  padding: 12px 20px;
  background: rgba(15, 21, 35, 0.95);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  z-index: 20;
  flex-shrink: 0;
}

.notes-panel.fullscreen .notes-body {
  flex: 1;
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  position: relative;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}

.notes-panel.fullscreen .markdown-body {
  font-size: 15px;
}

.notes-panel.fullscreen .markdown-body table {
  font-size: 14px;
}

/* PAN & ZOOM VIEWPORT & CONTENT */
.notes-zoom-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: auto;
  position: relative;
  background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
  cursor: default;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) rgba(0, 0, 0, 0.2);
}

.notes-zoom-viewport.pan-mode,
.notes-zoom-viewport.is-dragging {
  cursor: grab !important;
  user-select: none;
}

.notes-zoom-viewport.is-dragging {
  cursor: grabbing !important;
}

.notes-zoom-content {
  transform-origin: 0 0;
  transition: transform 0.08s ease-out;
  min-width: 100%;
  padding: 24px 28px 80px 28px;
  box-sizing: border-box;
}

.notes-panel.fullscreen .notes-zoom-content {
  padding: 30px 48px 120px 48px;
  max-width: 100%;
}

/* ZOOM TOOLBAR FLOATING PILL (CANVAS WIDGET) */
.notes-zoom-toolbar.floating {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 30px;
  padding: 4px 8px;
  margin: 0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.2);
  user-select: none;
  transition: all 0.25s ease;
}

.notes-zoom-toolbar.floating:hover {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.7), 0 0 25px rgba(99, 102, 241, 0.35);
}

.zoom-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 2px;
}

.btn-zoom-sm {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-main);
  line-height: 1;
}

.btn-zoom-sm:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
}

.btn-pan-toggle.active {
  background: rgba(6, 182, 212, 0.25) !important;
  border-color: rgba(6, 182, 212, 0.6) !important;
  color: #67e8f9 !important;
}

.zoom-level-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  padding: 3px 6px;
  background: rgba(6, 182, 212, 0.1);
  border-radius: 4px;
  min-width: 42px;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.zoom-level-badge:hover {
  background: rgba(6, 182, 212, 0.2);
}

@media (max-width: 600px) {
  .notes-zoom-toolbar.floating {
    bottom: 12px;
    right: 12px;
    padding: 3px 6px;
    gap: 3px;
  }
}

/* EMPTY NOTES CARD */
.empty-notes-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  margin: 20px auto;
  max-width: 520px;
  animation: fadeInMsg 0.3s ease;
}

.empty-notes-icon {
  font-size: 42px;
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
}

.empty-notes-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.empty-notes-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.empty-notes-hint-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: #c7d2fe;
  line-height: 1.5;
  text-align: left;
}

.empty-notes-hint-box code {
  color: #38bdf8;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 4px;
  border-radius: 3px;
}

/* COLLAPSED NOTES PANEL */
.notes-panel.collapsed {
  display: none !important;
}

.notes-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(15, 21, 35, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  min-height: 56px;
}

.notes-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  min-width: 0;
}

.notes-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.notes-title-box h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.notes-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* In non-fullscreen sidebar mode: hide the button text labels so they never collide */
#notesPanel:not(.fullscreen) .notes-actions .btn-action-label {
  display: none;
}

#notesPanel:not(.fullscreen) .notes-actions .btn-sm {
  padding: 6px 9px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
}

/* In fullscreen mode: show full labels cleanly */
.notes-panel.fullscreen .notes-actions .btn-action-label {
  display: inline;
  margin-left: 4px;
}

.notes-panel.fullscreen .notes-actions .btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  height: 34px;
}

.btn-fullscreen-toggle {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
  color: #c7d2fe !important;
  font-weight: 600;
}

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

.btn-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
  white-space: nowrap;
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-icon-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon-close:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

/* ALERT BANNER */
.notes-alert-banner {
  margin: 12px 18px 0 18px;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  animation: slideDownAlert 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownAlert {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-icon {
  font-size: 18px;
}

.alert-info strong {
  color: #34d399;
  display: block;
}

.alert-info span {
  color: #a7f3d0;
}

.notes-meta {
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.notes-body {
  flex: 1;
  overflow: hidden !important;
  padding: 0 !important;
  position: relative;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* MARKDOWN STYLES */
.markdown-body {
  color: #cbd5e1;
  font-size: 13.5px;
  line-height: 1.65;
}

.markdown-body h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.markdown-body h2 {
  font-size: 15.5px;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 16px;
  margin-bottom: 8px;
}

.markdown-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: 12px;
  margin-bottom: 6px;
}

.markdown-body p {
  margin-bottom: 12px;
}

.markdown-body ul, .markdown-body ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.markdown-body li {
  margin-bottom: 4px;
}

.markdown-body strong {
  color: #fff;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 16px 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 12.5px;
  overflow-x: auto;
  display: block;
}

.markdown-body th, .markdown-body td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}

.markdown-body th {
  background: rgba(255, 255, 255, 0.04);
  color: #c7d2fe;
  font-weight: 600;
}

.markdown-body tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.markdown-body code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
}

.markdown-body pre {
  background: #070a12;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
}

/* GLOW EFFECT ON NOTES UPDATE */
.notes-panel.just-updated {
  box-shadow: inset 0 0 30px rgba(16, 185, 129, 0.15);
  transition: box-shadow 0.5s ease;
}

.notes-textarea {
  width: 100%;
  height: 100%;
  background: #080c17;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 14px;
  resize: none;
  outline: none;
  line-height: 1.6;
}

.notes-textarea:focus {
  border-color: var(--primary);
}

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 16px;
  animation: fadeInModal 0.2s ease;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 440px;
  max-width: 100%;
  background: #111726;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
}

.modal-card-danger {
  border-color: rgba(244, 63, 94, 0.35);
}

.danger-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.danger-icon {
  font-size: 20px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-header h3 {
  font-size: 16.5px;
  color: #fff;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal-desc strong {
  color: var(--accent-emerald);
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.btn-close:hover {
  color: #fff;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input, .form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 14.5px;
  outline: none;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.error-text {
  display: block;
  font-size: 12px;
  color: var(--accent-rose);
  margin-top: 6px;
  font-weight: 600;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-danger {
  background: #e11d48;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.3);
}

.btn-danger:hover {
  background: #be123c;
}

.shake-anim {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.hidden {
  display: none !important;
}

/* =======================================================
   RESPONSIVE DESIGN (TABLET & SMARTPHONE)
   ======================================================= */
@media (max-width: 1024px) {
  .notes-panel:not(.fullscreen) {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 420px;
    max-width: 88vw;
    transform: translateX(100%);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.7);
    z-index: 50;
  }

  .notes-panel.open:not(.fullscreen) {
    transform: translateX(0);
  }

  .notes-panel.collapsed {
    transform: translateX(100%);
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    transform: translateX(-100%);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.7);
    z-index: 50;
  }

  .sidebar.open {
    transform: translateX(0);
    display: flex !important;
  }

  .home-topbar {
    padding: 12px 16px;
  }

  .home-content-container {
    padding: 20px 16px 40px 16px;
  }

  .home-hero {
    padding: 20px;
  }

  .home-hero h1 {
    font-size: 21px;
  }

  .home-room-grid {
    grid-template-columns: 1fr;
  }

  .chat-header {
    padding: 10px 12px;
  }

  .header-room-info h1 {
    font-size: 14.5px;
  }

  .btn-header-action {
    padding: 6px 10px;
    font-size: 11.5px;
  }

  .chat-messages {
    padding: 14px;
  }

  .message-row {
    max-width: 94%;
  }

  .chat-input-area {
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)) 14px;
    flex-shrink: 0;
  }

  .chat-form {
    gap: 6px;
    padding: 5px 8px;
  }

  .mention-tag-btn {
    padding: 6px 8px;
    font-size: 11px;
  }

  .chat-form input#messageInput,
  .chat-form input {
    font-size: 14.5px;
    min-width: 80px;
    padding: 6px 4px;
  }

  .btn-primary {
    padding: 8px 12px;
    min-width: 38px;
    justify-content: center;
  }

  .btn-primary .btn-text {
    display: none;
  }

  .notes-panel:not(.fullscreen) {
    width: 100vw;
    max-width: 100vw;
  }
}

@media (max-width: 480px) {
  .btn-header-action .action-label {
    display: none;
  }
  .chat-input-area {
    padding: 8px 8px calc(10px + env(safe-area-inset-bottom, 0px)) 8px;
  }
  .chat-form {
    gap: 4px;
    padding: 4px 6px;
  }
  .mention-tag-btn {
    padding: 5px 7px;
    font-size: 10.5px;
  }
  .btn-attach-image,
  .btn-voice-input {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }
  .chat-form input#messageInput,
  .chat-form input {
    font-size: 13.5px;
    min-width: 60px;
    padding: 5px 3px;
  }
}

/* HEADER DELETE BUTTON */
.btn-header-delete {
  background: rgba(244, 63, 94, 0.08) !important;
  border-color: rgba(244, 63, 94, 0.25) !important;
  color: #fb7185 !important;
}

.btn-header-delete:hover {
  background: rgba(244, 63, 94, 0.2) !important;
  border-color: rgba(244, 63, 94, 0.45) !important;
  color: #fff !important;
}

/* FLOATING TOAST NOTIFICATION */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(18, 25, 41, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: #fff;
  z-index: 999;
  backdrop-filter: blur(12px);
  animation: slideUpToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
}

.toast-notification.error {
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(244, 63, 94, 0.2);
}

.toast-notification.success {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.2);
}

@keyframes slideUpToast {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.empty-notes-hint {
  color: var(--text-dim);
  font-style: italic;
  padding: 20px 0;
  text-align: center;
}

/* =======================================================
   IMAGE UPLOAD: ATTACH BUTTON
   ======================================================= */
.btn-attach-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-attach-image:hover {
  background: rgba(6, 182, 212, 0.3);
  border-color: var(--accent-cyan);
  transform: scale(1.08);
}

.btn-attach-image:active {
  transform: scale(0.95);
}

.btn-attach-image svg {
  width: 17px;
  height: 17px;
}

/* =======================================================
   IMAGE UPLOAD: PREVIEW BAR
   ======================================================= */
.image-preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-md);
  animation: fadeSlideUp 0.25s ease;
}

.image-preview-bar.hidden {
  display: none;
}

.preview-thumb-box {
  position: relative;
  flex-shrink: 0;
}

.preview-thumb-box img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-cancel-image {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-rose);
  color: #fff;
  border: 2px solid #0f1523;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
  padding: 0;
}

.btn-cancel-image:hover {
  transform: scale(1.15);
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.preview-filename {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-filesize {
  font-size: 11px;
  color: var(--text-dim);
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =======================================================
   IMAGE LIGHTBOX MODAL
   ======================================================= */
.image-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(12px);
}

.image-lightbox-modal.hidden {
  display: none;
}

.btn-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(6px);
}

.btn-lightbox-close:hover {
  background: rgba(244, 63, 94, 0.6);
  transform: scale(1.1);
}

.lightbox-img-wrapper {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrapper img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =======================================================
   CHAT MESSAGE: INLINE IMAGE
   ======================================================= */
.message-image-container {
  margin-top: 8px;
  max-width: 280px;
}

.message-image-container img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.message-image-container img:hover {
  border-color: var(--primary);
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.message-image-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Mobile adjustments for image features */
@media (max-width: 768px) {
  .message-image-container {
    max-width: 220px;
  }

  .message-image-container img {
    max-height: 180px;
  }

  .image-preview-bar {
    padding: 8px 10px;
    gap: 8px;
  }

  .preview-thumb-box img {
    width: 44px;
    height: 44px;
  }

  .btn-attach-image {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .btn-attach-image svg {
    width: 15px;
    height: 15px;
  }

  .btn-voice-input {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .btn-voice-input svg {
    width: 15px;
    height: 15px;
  }
}

/* ==========================================
   FEATURE: PINNED ANNOUNCEMENT BAR
   ========================================== */
.pinned-announcement-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(245, 158, 11, 0.06));
  border-bottom: 1px solid rgba(234, 179, 8, 0.25);
  padding: 9px 16px;
  position: relative;
  z-index: 5;
  animation: fadeIn 0.25s ease-out;
  backdrop-filter: blur(8px);
}

.pinned-left-section {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.pinned-icon-badge {
  font-size: 15px;
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(234, 179, 8, 0.4);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}

.pinned-text-wrapper {
  flex: 1;
  min-width: 0;
}

.pinned-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.pinned-badge-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fde047;
  text-transform: uppercase;
}

.pinned-meta-time {
  font-size: 10px;
  color: var(--text-dim);
}

.pinned-text-content {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.4;
  word-break: break-word;
}

.pinned-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-pinned-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.btn-pinned-action:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-pinned-action.btn-unpin:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

/* ==========================================
   FEATURE: VOICE INPUT (SPEECH-TO-TEXT)
   ========================================== */
.btn-voice-input {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.btn-voice-input:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-voice-input.recording {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulseRecording 1.4s infinite;
}

@keyframes pulseRecording {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(239, 68, 68, 0);
    transform: scale(1.08);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    transform: scale(1);
  }
}

/* ==========================================
   FEATURE: LIVE INTERACTIVE TASK CHECKBOX
   ========================================== */
.task-list-item {
  list-style-type: none;
  margin-left: -18px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

.task-list-item input[type="checkbox"],
.interactive-task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  min-width: 17px;
  border: 1.5px solid rgba(165, 180, 252, 0.5);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  margin-top: 3px;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.task-list-item input[type="checkbox"]:hover,
.interactive-task-checkbox:hover {
  border-color: #38bdf8;
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.task-list-item input[type="checkbox"]:checked,
.interactive-task-checkbox:checked {
  background: #10b981;
  border-color: #059669;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.task-list-item input[type="checkbox"]:checked::after,
.interactive-task-checkbox:checked::after {
  content: '✓';
  font-size: 11px;
  font-weight: 900;
  color: #fff;
}

.task-list-item.completed {
  text-decoration: line-through;
  opacity: 0.65;
}

/* Modal Form Textarea */
.form-input[rows] {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

.form-input[rows]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* =======================================================
   FEATURE: SUPERADMIN VISUAL NEURAL BRAIN (KNOWLEDGE GRAPH)
   ======================================================= */

/* 1. BANNER BUTTON IN SUPERADMIN PANEL */
.superadmin-brain-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.14) 0%, rgba(6, 182, 212, 0.1) 50%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 4px 24px rgba(168, 85, 247, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.superadmin-brain-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(168, 85, 247, 0.08) 0%, transparent 60%);
  pointer-events: none;
  animation: rotateBannerGlow 15s linear infinite;
}

@keyframes rotateBannerGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.brain-banner-info {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.brain-glow-icon {
  font-size: 28px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.4);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: pulseBrainGlow 2.5s infinite ease-in-out;
}

@keyframes pulseBrainGlow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(168, 85, 247, 0.3); }
  50% { transform: scale(1.06); box-shadow: 0 0 24px rgba(6, 182, 212, 0.5); }
}

.brain-banner-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brain-banner-info p {
  font-size: 12.5px;
  color: #c7d2fe;
  margin: 0;
  line-height: 1.4;
}

.btn-brain-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.btn-brain-launch:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.6);
  background: linear-gradient(135deg, #c084fc, #4f46e5);
}

/* 1B. BACKUP & RESTORE SECTION IN SUPERADMIN */
.backup-section-box {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 41, 59, 0.4) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.backup-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.backup-badge-icon {
  font-size: 22px;
  width: 40px;
  height: 40px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.backup-header-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 3px 0;
}

.backup-header-info p {
  font-size: 12.5px;
  color: #94a3b8;
  margin: 0;
}

.backup-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.backup-action-card {
  background: rgba(11, 17, 33, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}

.backup-action-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.8);
  transform: translateY(-1px);
}

.backup-card-text strong {
  display: block;
  font-size: 13.5px;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.backup-card-text span {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.backup-card-text code {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
}

.backup-tip-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: #fef08a;
  line-height: 1.5;
}

.backup-tip-banner .tip-icon {
  font-size: 16px;
  line-height: 1.2;
}

.backup-tip-banner strong {
  color: #fff;
}

.backup-tip-banner code {
  background: rgba(234, 179, 8, 0.2);
  color: #fef08a;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* 2. FULLSCREEN BRAIN MODAL */
.brain-modal-overlay {
  z-index: 2000;
  background: rgba(4, 7, 16, 0.88);
  backdrop-filter: blur(16px);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brain-modal-container {
  width: 96vw;
  height: 92vh;
  max-width: 1600px;
  background: #070a14;
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(168, 85, 247, 0.15);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: zoomBrainModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomBrainModal {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* 3. MODAL HEADER */
.brain-modal-header {
  padding: 14px 24px;
  background: rgba(11, 17, 33, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 10;
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.brain-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brain-badge-icon {
  font-size: 24px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brain-header-title h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brain-status-tag {
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.brain-header-title p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.brain-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brain-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  transition: all 0.2s;
}

.brain-search-box:focus-within {
  border-color: #a855f7;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.brain-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 12.5px;
  width: 160px;
}

.btn-brain-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #e2e8f0;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-brain-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-add-neuron {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.btn-add-neuron:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: #10b981;
  color: #fff;
}

.btn-close-brain {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.btn-close-brain:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.4);
}

/* 4. CANVAS WORKSPACE */
.brain-canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0d1226 0%, #060914 80%);
}

#brainCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#brainCanvas:active {
  cursor: grabbing;
}

/* 5. FLOATING HUD LEGEND */
.brain-hud-legend {
  position: absolute;
  top: 16px;
  left: 20px;
  background: rgba(10, 16, 30, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex;
  gap: 14px;
  z-index: 5;
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #cbd5e1;
  font-weight: 500;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

/* 6. CAMERA ZOOM CONTROLS */
.brain-camera-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(10, 16, 30, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.brain-camera-controls button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s;
}

.brain-camera-controls button:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: #a855f7;
  color: #fff;
}

#brainZoomLevel {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  padding: 0 4px;
  min-width: 52px;
  text-align: center;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.brain-camera-controls button.btn-cam-mode {
  width: auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  font-size: 11.5px;
  font-weight: 600;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.brain-camera-controls button.btn-cam-mode.active {
  background: rgba(168, 85, 247, 0.35);
  border-color: #a855f7;
  color: #fff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
}

.cam-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 3px;
}

.brain-control-hint {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(10, 16, 30, 0.78);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 11px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.brain-control-hint b {
  color: #e2e8f0;
}

/* 7. GLASSMORPHIC NEURON INSPECTOR DRAWER */
.neuron-inspector {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 360px;
  max-width: 90vw;
  background: rgba(13, 19, 36, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6), 0 0 24px rgba(168, 85, 247, 0.15);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 20;
  overflow-y: auto;
  animation: slideInInspector 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInInspector {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.neuron-inspector.hidden {
  display: none;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspector-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid currentColor;
}

.btn-inspector-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.btn-inspector-close:hover {
  color: #fff;
}

.neuron-inspector h4 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.inspector-section label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.inspector-content-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #e2e8f0;
  max-height: 200px;
  overflow-y: auto;
}

.inspector-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.synapse-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.synapse-chip:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: #a855f7;
  color: #fff;
  transform: translateY(-1px);
}

.inspector-meta {
  font-size: 11.5px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

.inspector-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.inspector-actions button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 8. NEURON CHECKBOX LIST FOR EDIT FORM */
.neuron-checkbox-list {
  max-height: 160px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.neuron-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-main);
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.neuron-check-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.neuron-check-item input[type="checkbox"] {
  accent-color: #a855f7;
  cursor: pointer;
}

