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

:root {
  --bg-dark: #0d0e12;
  --bg-card: #161820;
  --bg-elevated: #1c1e2a;
  --bg-input: #12131a;
  --border: #262838;
  --border-focus: #7c5cfc;
  --text: #eeeef4;
  --text-muted: #8b8ea0;
  --text-dim: #5c5f73;
  --accent: #7c5cfc;
  --accent-dim: #6a4de6;
  --accent-glow: rgba(124, 92, 252, 0.15);
  --success: #00d68f;
  --warning: #ffb547;
  --danger: #ff4d6a;
  --radius: 16px;
  --radius-sm: 10px;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --glow-purple: 0 0 20px rgba(124, 92, 252, 0.2);
  --gradient-card: linear-gradient(135deg, rgba(124, 92, 252, 0.08) 0%, rgba(124, 92, 252, 0.02) 100%);
  --gradient-accent: linear-gradient(135deg, #7c5cfc 0%, #a78bfa 100%);
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

body.light-theme {
  --bg-dark: #f3f6ff;
  --bg-card: #ffffff;
  --bg-elevated: #f8fafc;
  --bg-input: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #475569;
  --text-dim: #64748b;
  --accent: #6d4adb;
  --accent-dim: #5c3cc2;
  --accent-glow: rgba(109, 74, 219, 0.1);
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
}
body.light-theme .panel-card,
body.light-theme .column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
body.light-theme .last-sync,
body.light-theme .scheduled-placeholder,
body.light-theme .note-actions + div {
  color: var(--text-muted);
}
body.light-theme .tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
body.light-theme .column[data-column="todo"] {
  border-left: 3px solid #3b82f6;
}
body.light-theme .column[data-column="inProgress"] {
  border-left: 3px solid #22c55e;
}
body.light-theme .column[data-column="done"] {
  border-left: 3px solid #8b5cf6;
}
body.light-theme .btn-ready,
body.light-theme .external-link {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

/* Landing page */
.landing-page {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.landing-page.hidden {
  display: none !important;
}

.landing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.landing-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.landing-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.landing-card input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 16px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.sign-in-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
}

/* Header buttons */
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

body.light-theme .icon-btn {
  background: var(--bg-elevated);
}

/* Lock toggle buttons */
.lock-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text-muted);
  opacity: 0.7;
}
.lock-btn:hover {
  opacity: 1;
  background: var(--accent-glow);
  border-color: var(--accent);
}
.lock-btn.locked {
  color: var(--accent);
  opacity: 1;
}
.sidebar-lock-btn {
  margin: 8px auto;
}

.btn-sign-out {
  padding: 6px 14px;
  font-size: 13px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sign-out:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* App layout */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* When sidebar is unlocked, app scrolls and sidebar flows with content */
.app.sidebar-unlocked {
  overflow-y: auto;
}
.app:not(.sidebar-unlocked) .main-container {
  overflow-y: auto;
}
.app.sidebar-unlocked .main-container {
  overflow-y: visible;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease, min-width 0.25s ease;
  position: relative;
  overflow-y: auto;
  flex-shrink: 0;
}
/* Locked sidebar stays in view */
.app:not(.sidebar-unlocked) .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
}

.sidebar-toggle {
  flex-shrink: 0;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  transition: color 0.2s, background 0.2s;
}

.sidebar-toggle:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.app.sidebar-collapsed .sidebar-toggle {
  justify-content: center;
}

.sidebar-toggle-icon {
  display: block;
}

.app.sidebar-collapsed .sidebar .sidebar-content {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  width: 0;
}

.app.sidebar-collapsed .sidebar {
  width: 56px;
  min-width: 56px;
}

.app.sidebar-collapsed .sidebar-lock-btn {
  display: none;
}

.app.sidebar-collapsed .sidebar-toggle {
  border-bottom: 1px solid var(--border);
  justify-content: center;
  padding: 0;
}

.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  min-width: 0;
  transition: opacity 0.2s;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 20px;
}

.sidebar-link {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.sidebar-spacer {
  flex: 1;
  min-height: 16px;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-sign-out {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sidebar-sign-out:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.agent-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.agent-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.agent-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.agent-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.sidebar-emoji {
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  animation: sidebar-emoji-wave 3.5s ease-in-out infinite;
}

@keyframes sidebar-emoji-wave {
  0%, 65%, 100% { transform: rotate(0deg); }
  8%, 24% { transform: rotate(18deg); }
  16%, 32% { transform: rotate(-8deg); }
  40% { transform: rotate(22deg); }
}

.status-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.status-pill.ready {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
}

.status-pill.working {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
}

.status-pill.idle {
  color: var(--text-dim);
}

.btn-ready {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ready:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

/* Main container */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  min-width: 0;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

/* When nav is unlocked, top-bar scrolls with content */
.app.nav-unlocked .top-bar {
  position: static;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.tab.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.last-sync {
  font-size: 12px;
  color: var(--text-dim);
}

.external-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.external-link:hover {
  text-decoration: underline;
}

/* Main content */
main {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

#panel-youtube-intel {
  height: 100%;
  min-height: 85vh;
  padding: 0;
  overflow: hidden;
}
.yt-intel-iframe {
  width: 100%;
  height: 88vh;
  min-height: 720px;
  border: none;
  display: block;
}

/* Kanban */
.kanban-section h2,
.panel h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 16px;
}

.column {
  background: var(--bg-elevated);
  padding: 14px;
  border-radius: var(--radius);
  min-height: 200px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

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

.column h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 600;
}

.column.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 20px rgba(124, 92, 252, 0.15);
  transition: all 0.2s ease;
}

/* Drag states for task cards */
.task.dragging {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.task.drag-ghost {
  opacity: 0.4;
}

.task[draggable="true"] {
  cursor: grab;
}

.task[draggable="true"]:active {
  cursor: grabbing;
}

.btn-add-task,
.btn-show-archived {
  font-size: 11px;
  padding: 4px 10px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-task:hover,
.btn-show-archived:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.task-list {
  flex: 1;
  min-height: 100px;
}

.task-list-scroll {
  max-height: 280px;
  overflow-y: auto;
}

.task {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border-left: 3px solid var(--border);
  transition: all 0.2s;
}

.task.priority-high {
  border-left-color: var(--danger);
}

.task.priority-medium {
  border-left-color: var(--warning);
}

.task.priority-low {
  border-left-color: var(--text-dim);
}

.task {
  cursor: pointer;
}

.task:hover {
  background: var(--bg-dark);
  border-left-color: var(--accent);
}

.task-drag-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 12px;
  padding: 2px 4px;
  user-select: none;
  flex-shrink: 0;
}

.task-drag-handle:hover {
  color: var(--text-muted);
}

.task-drag-handle:active {
  cursor: grabbing;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task:last-child {
  margin-bottom: 0;
}

.empty-state {
  color: var(--text-dim);
  font-size: 12px;
  padding: 16px;
  text-align: center;
}

/* Bottom panels */
.bottom-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

.panel-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.panel-card h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── NIVIX INTELLIGENCE (Agent Skills — Gemini-style) ────────────────── */
/* Only show NIVIX layout when this panel is active; otherwise .panel { display: none } applies */
.panel.active.panel-nivix {
  padding: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #0f1016;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}
/* Allow scroll when nivix sidebar is unlocked */
.panel.active.panel-nivix:has(.nivix-sidebar-scroll-unlocked) {
  overflow: visible;
}
.panel-nivix .nivix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #12141c;
  border-bottom: 1px solid #262838;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
}
.panel-nivix .nivix-header-left,
.panel-nivix .nivix-header-center {
  min-width: 0;
}
.panel-nivix .nivix-header-right {
  flex-shrink: 0;
}
.panel-nivix .nivix-breadcrumb {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-nivix .nivix-agent-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.nivix-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nivix-sidebar-header-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(124, 92, 252, 0.25);
  border: 1px solid #7c5cfc;
  color: #a78bfa;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.nivix-sidebar-header-toggle:hover {
  background: rgba(124, 92, 252, 0.4);
  color: #c4b5fd;
  border-color: #a78bfa;
}
.nivix-brand {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #8b8ea0;
}
.nivix-back {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1c1e2a;
  border: 1px solid #262838;
  color: #eeeef4;
  cursor: pointer;
  font-size: 16px;
}
.nivix-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nivix-version {
  background: linear-gradient(135deg, #7c5cfc 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 14px;
}
.nivix-sep { color: #5c5f73; }
.nivix-agent-name { color: #eeeef4; font-size: 14px; }
.nivix-header-center {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: #8b8ea0;
  letter-spacing: 0.05em;
}
.nivix-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5c5f73;
}
.nivix-load-bar {
  width: 60px;
  height: 6px;
  background: #1c1e2a;
  border-radius: 3px;
  overflow: hidden;
}
.nivix-load-fill { display: block; height: 100%; width: 20%; background: #06b6d4; border-radius: 3px; }
.nivix-header-right { display: flex; align-items: center; gap: 16px; }
.nivix-neural { display: flex; flex-direction: column; align-items: flex-end; }
.nivix-neural-label { font-size: 10px; color: #8b8ea0; letter-spacing: 0.06em; }
.nivix-neural-active { font-size: 12px; font-weight: 700; color: #00d68f; letter-spacing: 0.05em; }
.nivix-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c5cfc 0%, #06b6d4 100%);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nivix-wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 0;
  flex: 1;
  width: 100%;
  min-width: 0;
  transition: grid-template-columns 0.2s ease;
  overflow: hidden;
}
/* When nivix sidebar is scroll-unlocked, wrap becomes the scroll container */
.nivix-wrap.nivix-sidebar-scroll-unlocked {
  overflow-y: auto;
}
.nivix-wrap.nivix-sidebar-scroll-unlocked .nivix-main {
  overflow-y: visible;
}
.nivix-wrap:not(.nivix-sidebar-scroll-unlocked) .nivix-sidebar {
  overflow-y: auto;
  height: 100%;
}
.nivix-wrap.sidebar-collapsed { grid-template-columns: 52px 1fr; }
@media (max-width: 1024px) {
  .nivix-wrap { grid-template-columns: 220px 1fr; }
  .nivix-wrap.sidebar-collapsed { grid-template-columns: 52px 1fr; }
}
@media (max-width: 768px) {
  .nivix-wrap { grid-template-columns: 1fr; }
  .nivix-wrap.sidebar-collapsed { grid-template-columns: 1fr; }
  .nivix-sidebar { border-right: none; border-bottom: 1px solid #262838; }
}
.nivix-sidebar {
  background: #12141c;
  border-right: 1px solid #262838;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  position: relative;
  min-width: 0;
  overflow: hidden;
  transition: min-width 0.2s ease;
  height: 100%;
}
.nivix-sidebar.collapsed {
  min-width: 52px;
  width: 52px;
  overflow: visible !important;
  z-index: 20;
  cursor: pointer;
  align-self: stretch !important;
  max-height: none !important;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 16px;
  background: #16182a;
  border-right: 2px solid #7c5cfc;
}
.nivix-sidebar-toggle {
  display: none;
}
.nivix-sidebar-open {
  z-index: 30;
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #7c5cfc;
  border: 2px solid #a78bfa;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(124, 92, 252, 0.6);
  flex-shrink: 0;
}
.nivix-sidebar-open:hover { background: #6d4adb; color: #fff; border-color: #c4b5fd; box-shadow: 0 4px 20px rgba(124, 92, 252, 0.8); transform: scale(1.1); }
/* Edge toggle sits on the right border of the sidebar */
.nivix-sidebar-edge-toggle {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 28px;
  height: 48px;
  border-radius: 0 8px 8px 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.nivix-sidebar-edge-toggle:hover {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
}
body.light-theme .nivix-sidebar-edge-toggle {
  background: #f1f5f9;
  border-color: var(--border);
  color: #374151;
}
body.light-theme .nivix-sidebar-edge-toggle:hover {
  background: rgba(109, 74, 219, 0.1);
  color: var(--accent);
}
body.light-theme .nivix-sidebar-open {
  background: #6d4adb;
  border-color: #7c5cfc;
  color: #fff;
  box-shadow: 0 2px 12px rgba(109, 74, 219, 0.5);
}
body.light-theme .nivix-sidebar-open:hover {
  background: #5b3ac4;
  box-shadow: 0 4px 20px rgba(109, 74, 219, 0.7);
}
body.light-theme .nivix-sidebar.collapsed {
  background: #f0edff;
  border-right-color: #6d4adb;
}
.nivix-sidebar.collapsed .nivix-sidebar-inner { display: none; }
.nivix-sidebar.collapsed .nivix-sidebar-edge-toggle { 
  right: -14px;
}
.nivix-sidebar.collapsed .nivix-sidebar-open { display: flex; }
.nivix-sidebar-inner { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.nivix-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #eeeef4;
  padding: 0 16px 16px;
  margin: 0;
  border-bottom: 1px solid #262838;
}
.nivix-agent-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nivix-agent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #8b8ea0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.2s;
  position: relative;
}
.nivix-agent-item:hover {
  background: #1c1e2a;
  color: #eeeef4;
}
.nivix-agent-item.active {
  background: rgba(6, 182, 212, 0.12);
  color: #eeeef4;
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.4);
}
.nivix-agent-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: #06b6d4;
  border-radius: 0 2px 2px 0;
}
.nivix-agent-icon { font-size: 22px; line-height: 1; }
.nivix-agent-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nivix-agent-name-txt { font-size: 14px; font-weight: 600; color: inherit; }
.nivix-agent-sub { font-size: 10px; letter-spacing: 0.06em; opacity: 0.9; }
.nivix-agent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5c5f73;
}
.nivix-stats {
  padding: 16px;
  border-top: 1px solid #262838;
}
.nivix-stats-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #eeeef4;
  margin-bottom: 8px;
}
.nivix-stats-bar {
  height: 8px;
  background: #1c1e2a;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.nivix-stats-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #7c5cfc);
  border-radius: 4px;
  transition: width 0.3s;
}
.nivix-stats-label { font-size: 11px; color: #8b8ea0; }
.nivix-main {
  background: #0f1016;
  padding: 24px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.nivix-detail-panel {
  display: none;
  color: #eeeef4;
  min-width: 0;
}
.nivix-detail-panel.active { display: block; min-width: 0; }
.nivix-detail-panel .nivix-block,
.nivix-detail-panel .nivix-preview-viewport,
.nivix-detail-panel .nivix-form-row,
.nivix-detail-panel .nivix-actions { max-width: 100%; }
.nivix-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.nivix-detail-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: #eeeef4;
}
.nivix-idle {
  font-size: 13px;
  font-weight: 500;
  color: #8b8ea0;
  margin-left: 4px;
}
.nivix-superpower {
  font-size: 11px;
  padding: 6px 12px;
  background: rgba(6, 182, 212, 0.2);
  color: #06b6d4;
  border-radius: 8px;
  letter-spacing: 0.04em;
}
.nivix-detail-desc {
  font-size: 14px;
  color: #8b8ea0;
  line-height: 1.5;
  margin: 0 0 20px 0;
}
.vt-batch-status {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  min-height: 20px;
}
.vt-batch-status-failed {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.vt-batch-status-ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}
.vt-batch-status-pending {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: #fde047;
}
.nivix-block { margin-bottom: 24px; }
.nivix-block-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8b8ea0;
  margin-bottom: 8px;
}
.nivix-pub-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.nivix-pub-row .nivix-select { flex: 1; min-width: 180px; max-width: 100%; }
.nivix-pub-row .nivix-btn-primary { flex-shrink: 0; }
.nivix-input, .nivix-select {
  padding: 12px 14px;
  background: #12141c;
  border: 1px solid #262838;
  border-radius: 10px;
  color: #eeeef4;
  font-size: 14px;
  font-family: inherit;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
<｜tool▁call▁end｜><｜tool▁call▁begin｜>
Read
.nivix-input:focus, .nivix-select:focus {
  outline: none;
  border-color: #06b6d4;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}
.nivix-input.narrow, .nivix-select.narrow { min-width: 120px; }
.nivix-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  background: #12141c;
  border: 1px solid #262838;
  border-radius: 10px;
  color: #eeeef4;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 12px;
}
.nivix-textarea:focus {
  outline: none;
  border-color: #06b6d4;
}
.nivix-btn-primary {
  padding: 12px 24px;
  background: linear-gradient(135deg, #7c5cfc 0%, #06b6d4 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.nivix-btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}
.nivix-btn-teal {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid #06b6d4;
  border-radius: 8px;
  color: #06b6d4;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.nivix-btn-teal:hover { background: rgba(6, 182, 212, 0.15); }
.nivix-btn-outline, .nivix-btn-export {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #262838;
  border-radius: 8px;
  color: #8b8ea0;
  font-size: 12px;
  cursor: pointer;
  margin-right: 8px;
  margin-bottom: 8px;
}
.nivix-btn-outline:hover, .nivix-btn-export:hover {
  border-color: #06b6d4;
  color: #eeeef4;
}
.nivix-btn-outline-teal {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #06b6d4;
  border-radius: 8px;
  color: #06b6d4;
  font-size: 12px;
  cursor: pointer;
}
.nivix-btn-outline-teal:hover { background: rgba(6, 182, 212, 0.1); }
.nivix-style-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.nivix-chip {
  padding: 6px 14px;
  background: #12141c;
  border: 1px solid #262838;
  border-radius: 8px;
  color: #8b8ea0;
  font-size: 12px;
  cursor: pointer;
}
.nivix-chip:hover, .nivix-chip.active {
  border-color: #06b6d4;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.1);
}
.nivix-export-row { display: flex; flex-wrap: wrap; gap: 8px; }
.nivix-form-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.nivix-form-row-inline { margin-top: 8px; }
.nivix-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.nivix-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #8b8ea0;
}
.nivix-platforms label { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.nivix-check { font-size: 13px; color: #8b8ea0; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.nivix-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border: 1px solid #262838;
  border-radius: 10px;
  overflow: hidden;
}
.nivix-tabs .vt-mode-tab {
  flex: 1;
  padding: 10px 14px;
  background: #12141c;
  border: none;
  color: #8b8ea0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.nivix-tabs .vt-mode-tab.active {
  background: linear-gradient(135deg, #7c5cfc 0%, #06b6d4 100%);
  color: #fff;
}
.nivix-progress {
  padding: 12px 14px;
  background: #12141c;
  border-radius: 10px;
  font-size: 13px;
  color: #8b8ea0;
  margin-bottom: 12px;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.nivix-neural-stream {
  margin-top: 24px;
  border: 1px solid #262838;
  border-radius: 10px;
  overflow: hidden;
  background: #12141c;
}
.nivix-stream-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8b8ea0;
  border-bottom: 1px solid #262838;
}
.nivix-encrypted { color: #00d68f; font-weight: 600; }
.nivix-stream-body {
  min-height: 120px;
  padding: 14px;
  font-size: 13px;
  color: #5c5f73;
  font-family: ui-monospace, monospace;
}
.nivix-vault {
  background: #12141c;
  border-left: 1px solid #262838;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.nivix-vault.collapsed {
  min-width: 0;
  overflow: visible;
  padding: 16px 8px;
}
.nivix-vault-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #eeeef4;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nivix-vault-lock { font-size: 14px; opacity: 0.8; }
.nivix-vault-select {
  width: 100%;
  padding: 10px 12px;
  background: #0f1016;
  border: 1px solid #262838;
  border-radius: 8px;
  color: #8b8ea0;
  font-size: 12px;
  margin-bottom: 20px;
}
.nivix-vault-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #5c5f73;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.nivix-vault-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.nivix-vault-offline { font-weight: 600; }
.nivix-vault-toggle {
  position: absolute;
  left: -14px;
  top: 20px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1c1e2a;
  border: 1px solid #262838;
  color: #8b8ea0;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.nivix-vault-toggle:hover { background: #262838; color: #eeeef4; }
.nivix-vault { position: relative; }
.nivix-vault.collapsed .nivix-vault-header,
.nivix-vault.collapsed .nivix-vault-select,
.nivix-vault.collapsed .nivix-vault-empty { display: none !important; }

/* Draft preview (newsletter) - large view */
.nivix-draft-preview-block { margin-top: 24px; }
.nivix-draft-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.nivix-current-draft-label {
  font-size: 13px;
  font-weight: 600;
  color: #06b6d4;
  flex: 1;
  min-width: 0;
  margin: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nivix-current-draft-label.empty {
  color: #5c5f73;
  font-weight: 500;
}
.nivix-preview-badge {
  font-size: 10px;
  padding: 4px 10px;
  background: rgba(124, 92, 252, 0.2);
  color: #a78bfa;
  border-radius: 6px;
  letter-spacing: 0.04em;
}
.nivix-preview-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border: 1px solid #262838;
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.nivix-preview-tab {
  padding: 8px 20px;
  background: #12141c;
  border: none;
  color: #8b8ea0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.nivix-preview-tab:hover { color: #eeeef4; }
.nivix-preview-tab.active {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.4);
}
.nivix-preview-viewport {
  min-height: 420px;
  max-width: 100%;
  background: #12141c;
  border: 1px solid #262838;
  border-radius: 10px;
  overflow: auto;
  padding: 24px;
  transition: max-width 0.2s ease;
  box-sizing: border-box;
}
.nivix-preview-viewport[data-mode="desktop"] { width: 100%; }
.nivix-preview-viewport[data-mode="mobile"] {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  min-height: 500px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}
.nivix-preview-inner {
  color: #eeeef4;
  font-size: 15px;
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto;
}
.nivix-preview-inner h1, .nivix-preview-inner h2 { margin: 1em 0 0.5em; color: #eeeef4; }
.nivix-preview-inner p { margin: 0 0 0.75em; }
.nivix-preview-inner ul, .nivix-preview-inner ol { margin: 0 0 0.75em; padding-left: 1.5em; }
.nivix-preview-placeholder { color: #5c5f73; font-style: italic; }
.nivix-preview-raw {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.5;
  color: #eeeef4;
  font-family: ui-monospace, 'SF Mono', monospace;
}
/* Rendered markdown preview */
.nivix-preview-rendered {
  font-size: 14px;
  line-height: 1.7;
  color: #eeeef4;
  word-break: break-word;
}
.nivix-preview-rendered h1, .nivix-preview-rendered h2, .nivix-preview-rendered h3,
.nivix-preview-rendered h4, .nivix-preview-rendered h5, .nivix-preview-rendered h6 {
  margin: 1em 0 0.5em;
  color: #fff;
  font-weight: 700;
}
.nivix-preview-rendered h1 { font-size: 1.6em; }
.nivix-preview-rendered h2 { font-size: 1.35em; }
.nivix-preview-rendered h3 { font-size: 1.15em; }
.nivix-preview-rendered p { margin: 0.5em 0; }
.nivix-preview-rendered img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.nivix-preview-rendered blockquote {
  border-left: 3px solid #7c5cfc;
  padding: 8px 16px;
  margin: 12px 0;
  background: rgba(124, 92, 252, 0.08);
  color: #a78bfa;
  font-style: italic;
}
.nivix-preview-rendered a {
  color: #7c5cfc;
  text-decoration: underline;
}
.nivix-preview-rendered code {
  background: rgba(124, 92, 252, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.nivix-preview-rendered hr {
  border: none;
  border-top: 1px solid #262838;
  margin: 16px 0;
}
.nivix-preview-rendered ul, .nivix-preview-rendered ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}
.nivix-preview-rendered strong { font-weight: 700; }
/* Alignment button active state */
.nivix-align-btn.active {
  background: #7c5cfc !important;
  color: #fff !important;
  border-color: #a78bfa !important;
}
.nivix-export-hint {
  font-size: 12px;
  color: #5c5f73;
  margin: 8px 0 0;
}
.nivix-drafts-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.nivix-drafts-select {
  min-width: 220px;
}
.nivix-draft-edit-textarea {
  width: 100%;
  min-height: 420px;
  padding: 16px;
  background: #0d0e14;
  border: 1px solid #262838;
  border-radius: 8px;
  color: #eeeef4;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}
.nivix-draft-edit-textarea:focus {
  outline: none;
  border-color: #06b6d4;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

/* Social: competitor report, trending, schedule */
.nivix-block-desc {
  font-size: 13px;
  color: #8b8ea0;
  margin: 0 0 10px 0;
  line-height: 1.4;
}
.nivix-report-box {
  margin-top: 12px;
  border: 1px solid #262838;
  border-radius: 10px;
  overflow: hidden;
  background: #12141c;
}
.nivix-report-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #8b8ea0;
  border-bottom: 1px solid #262838;
}
.nivix-report-body {
  margin: 0;
  padding: 12px 14px;
  font-size: 12px;
  color: #eeeef4;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
  font-family: ui-monospace, monospace;
}
.nivix-schedule-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border: 1px solid #262838;
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.nivix-schedule-tab {
  padding: 8px 18px;
  background: #12141c;
  border: none;
  color: #8b8ea0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.nivix-schedule-tab.active {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
}
.nivix-schedule-list {
  min-height: 80px;
  padding: 12px 14px;
  background: #12141c;
  border: 1px solid #262838;
  border-radius: 10px;
  font-size: 13px;
  color: #8b8ea0;
}
.nivix-schedule-list .nivix-preview-placeholder { margin: 0; }
.nivix-schedule-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #0f1016;
  border-radius: 8px;
  border: 1px solid #262838;
  font-size: 13px;
}
.nivix-schedule-item:last-child { margin-bottom: 0; }
.nivix-schedule-item .sm-item-preview { color: #eeeef4; margin: 4px 0 0; }
.nivix-schedule-item .sm-item-meta { font-size: 11px; color: #5c5f73; margin-top: 6px; }

/* Briefings (AI Daily Brief) */
.briefings-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}
.briefings-controls .btn-primary {
  padding: 8px 14px;
  font-size: 14px;
  white-space: nowrap;
}
.briefings-controls input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}
.briefings-controls input:focus {
  outline: none;
  border-color: var(--accent);
}
.briefings-controls select {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}
.briefings-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.briefing-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.briefing-item:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}
.briefing-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.briefing-item-header h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.briefing-audio-badge {
  font-size: 16px;
  line-height: 1;
}
.briefing-item-preview {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Briefing detail modal — wider for readability */
.modal.briefing-modal {
  max-width: min(95vw, 780px);
  width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.briefing-modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.briefing-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.briefing-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.briefing-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.briefing-audio-indicator {
  color: var(--accent);
  font-weight: 500;
}
.briefing-audio-container {
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.briefing-detail-content {
  max-height: 400px;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  line-height: 1.6;
  color: var(--text);
}
.briefing-detail-content h2 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--text);
}
.briefing-detail-content h2:first-child {
  margin-top: 0;
}
.briefing-detail-content p {
  margin: 10px 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}
.briefing-detail-content h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  margin: 18px 0 8px;
}
.briefing-modal-actions {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.briefing-modal-actions button {
  flex: 1;
}
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.scheduled-placeholder {
  font-size: 13px;
  color: var(--text-dim);
}

#notes-input textarea,
.panel-card textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

.panel-card textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.note-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.notes-list {
  margin-top: 8px;
}

.notes-empty {
  font-size: 13px;
  color: var(--text-dim);
  padding: 12px 0;
}

.note-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.note-item:last-child {
  margin-bottom: 0;
}

.note-preview {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-item-actions {
  display: flex;
  gap: 8px;
}

.btn-note-edit,
.btn-note-delete {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}

.btn-note-edit {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-note-edit:hover {
  background: var(--accent);
  color: white;
}

.btn-note-delete {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-note-delete:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* Security sub-tabs */
.security-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.security-subtab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.security-subtab:hover {
  color: var(--text);
}
.security-subtab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.security-subpanel {
  display: none;
}
.security-subpanel.active {
  display: block;
}

/* Business Manager embedded panel inside Agent Skills */
.bm-embedded-panel {
  margin-top: 16px;
}

/* Security panel */
.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.security-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.security-card-wide {
  grid-column: 1 / -1;
}

.security-card h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.security-card-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.security-placeholder {
  font-size: 13px;
  color: var(--text-dim);
  min-height: 40px;
}

.security-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.security-list li {
  padding: 8px 0;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.security-list li:last-child {
  border-bottom: none;
}

.security-scan-result {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
  white-space: pre-wrap;
  border: 1px solid var(--border);
}

.security-scan-result.success { border-left: 4px solid var(--success); }
.security-scan-result.warn { border-left: 4px solid var(--warning); }
.security-scan-result.error { border-left: 4px solid var(--danger); }
.security-last-scan,
.security-page-last-scan {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 16px;
}
.security-page-last-scan { margin-top: 24px; }

/* Security header row */
.security-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.btn-icon-sm {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon-sm:hover { background: var(--bg-input); color: var(--text); }

/* Compact scan card */
.security-scan-compact {
  display: flex;
  align-items: center;
  gap: 10px;
}
.security-scan-hint {
  font-size: 11px;
  color: var(--text-dim);
}
.btn-sm { font-size: 12px; padding: 5px 12px; }

/* Security rearrange mode */
.security-grid.rearranging .security-card {
  cursor: grab;
  border: 2px dashed var(--accent);
  position: relative;
}
.security-grid.rearranging .security-card:active { cursor: grabbing; }
.security-grid.rearranging .security-card.drag-over {
  border-color: var(--success);
  background: rgba(0, 214, 143, 0.05);
}

/* ── Code Doctor Status Card ── */
.cd-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
}
.cd-status-grid dt { color: var(--text-muted); font-weight: 500; }
.cd-status-grid dd { color: var(--text); margin: 0; }
.cd-mini-history { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.cd-mini-history-item {
  font-size: 11px;
  color: var(--text-dim);
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Code Doctor Detail Section ── */
.cd-detail-section {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.cd-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.cd-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cd-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.cd-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.cd-tab:hover { color: var(--text); }
.cd-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cd-tab-content { min-height: 120px; }

/* History list */
.cd-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cd-history-entry {
  display: grid;
  grid-template-columns: 32px 70px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: border-color 0.2s;
}
.cd-history-entry:hover { border-color: var(--accent); }
.cd-history-icon { font-size: 18px; text-align: center; }
.cd-history-mode {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  text-align: center;
  align-self: center;
}
.cd-history-body { color: var(--text); line-height: 1.4; }
.cd-history-file { color: var(--text-dim); font-family: monospace; font-size: 11px; }
.cd-history-time { color: var(--text-dim); font-size: 11px; white-space: nowrap; }
.cd-history-severity {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 6px;
}
.cd-severity-critical { background: rgba(255,77,106,0.15); color: #ff4d6a; }
.cd-severity-high { background: rgba(255,150,50,0.15); color: #ff9632; }
.cd-severity-medium { background: rgba(255,200,50,0.15); color: #ddb620; }
.cd-severity-low { background: rgba(100,160,255,0.15); color: #64a0ff; }

/* Report content */
.cd-report-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  min-height: 200px;
}
.cd-report-content h3 { margin: 16px 0 8px; font-size: 14px; color: var(--accent); }
.cd-report-content h4 { margin: 12px 0 6px; font-size: 13px; }
.cd-report-content ul { margin: 6px 0; padding-left: 20px; }
.cd-report-content li { margin: 3px 0; }

/* Export bar */
.cd-export-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.cd-export-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}
.cd-export-btn {
  font-size: 12px !important;
  padding: 5px 12px !important;
}

/* Scan file modal */
.cd-scan-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.cd-scan-modal-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 500px;
}
.cd-scan-modal-inner h3 { margin: 0 0 14px; }
.cd-scan-modal-inner input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  margin-bottom: 14px;
}
.cd-scan-modal-btns { display: flex; gap: 8px; justify-content: flex-end; }

/* Docs — 2-column layout */
.docs-layout-v2 {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  margin-top: 4px;
  min-height: 520px;
}
.docs-left-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.docs-search-row {
  display: flex;
  gap: 6px;
}
.docs-search-row input {
  flex: 1;
}
.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.btn-sm:hover { opacity: 0.85; }

#doc-search {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
}
#doc-search:focus {
  outline: none;
  border-color: var(--accent);
}

.docs-layout-v2 .doc-list {
  flex: 1;
  max-height: 480px;
  overflow-y: auto;
}

.docs-layout-v2 .doc-item {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  color: var(--text-muted);
}
.docs-layout-v2 .doc-item:hover {
  background: var(--bg-elevated);
  color: var(--accent);
  border-left-color: var(--accent);
}
.docs-layout-v2 .doc-item.active {
  background: rgba(124,92,252,0.08);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.docs-layout-v2 .doc-preview {
  padding: 20px 24px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  max-height: 520px;
  overflow-y: auto;
  line-height: 1.7;
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.doc-preview-placeholder {
  color: var(--text-dim);
  font-style: italic;
  font-family: inherit;
  font-size: 14px;
  white-space: normal;
}

/* Legacy compat */
#panel-docs .docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  margin-top: 16px;
}
.doc-list { max-height: 400px; overflow-y: auto; }
.doc-item { padding: 10px 12px; cursor: pointer; font-size: 13px; border-radius: var(--radius-sm); transition: background 0.2s; }
.doc-item:hover { background: var(--bg-elevated); color: var(--accent); }
.doc-preview { padding: 16px; background: var(--bg-elevated); border-radius: var(--radius); font-size: 12px; max-height: 400px; overflow-y: auto; white-space: pre-wrap; font-family: 'JetBrains Mono', 'Fira Code', monospace; color: var(--text-muted); border: 1px solid var(--border); }

/* Logs */
.logs-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.logs-controls select,
.logs-controls input {
  padding: 8px 12px;
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
}

.logs-controls input {
  min-width: 200px;
}

.logs-controls select:focus,
.logs-controls input:focus {
  outline: none;
  border-color: var(--accent);
}

.log-entries {
  margin-top: 12px;
}

.log-entry {
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.log-entry:hover {
  background: var(--bg-elevated);
}

.log-entry-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.log-entry-time {
  font-size: 11px;
  color: var(--text-dim);
}

.log-entry-message {
  flex: 1;
  color: var(--text);
}

.log-entry-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.log-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.log-badge.level-info { color: var(--success); }
.log-badge.level-warn { color: var(--warning); }
.log-badge.level-error { color: var(--danger); }

.log-entry-details {
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-muted);
  display: none;
}

.log-entry.expanded .log-entry-details {
  display: block;
}

.log-pagination {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.log-pagination button {
  padding: 8px 14px;
  font-size: 13px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.log-pagination button:hover:not(:disabled) {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.log-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Buttons */
button {
  font-family: inherit;
  cursor: pointer;
}

.btn-primary {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--accent-dim);
}

.btn-secondary {
  padding: 10px 20px;
  font-size: 14px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--text-dim);
}

#save-note {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

#save-note:hover {
  background: var(--accent-dim);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 420px;
}

.modal h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

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

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

.required {
  color: var(--danger);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 60px;
  resize: vertical;
}

.priority-pills {
  display: flex;
  gap: 8px;
}

.priority-pills .pill {
  padding: 8px 16px;
  font-size: 13px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.priority-pills .pill:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.priority-pills .pill.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
}

.modal-error {
  padding: 10px;
  margin-bottom: 16px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.modal-error.hidden {
  display: none;
}

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

/* Responsive */
@media (max-width: 1100px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 64px;
    min-width: 64px;
    padding: 16px 8px;
  }

  .agent-name,
  .status-pill,
  .btn-ready {
    display: none;
  }

  .bottom-panels {
    grid-template-columns: 1fr;
  }

  .logs-controls {
    flex-direction: column;
  }
  .logs-controls .btn-secondary {
    margin-left: 0;
    width: 100%;
  }

  #panel-docs .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-layout-v2 {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }
}

/* SOPs */
.sops-controls {
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.sops-controls input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
}
.sops-controls #sop-search-btn {
  flex-shrink: 0;
}
.sops-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sop-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.sop-item:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}
.sop-item-content h4 {
  font-size: 15px;
  margin: 0 0 4px 0;
}
.sop-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.sop-item-actions {
  display: flex;
  gap: 8px;
}
#sop-view-modal.sop-view-modal,
.modal.sop-view-modal {
  max-width: min(95vw, 1100px);
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
#sop-view-modal .sop-view-header {
  flex-shrink: 0;
}
#sop-view-modal .sop-view-body {
  flex: 1;
  min-height: 0;
  max-height: calc(90vh - 80px);
  overflow-y: auto;
}
.sop-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.sop-view-body {
  overflow-y: auto;
}
.sop-view-actions {
  margin-bottom: 16px;
}
.sop-view-content {
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

/* Reminders */
.reminders-controls {
  margin-bottom: 12px;
}
.reminders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.reminder-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.reminder-item.reminder-overdue {
  border-color: var(--error);
  background: rgba(var(--error-rgb), 0.1);
}
.reminder-content {
  flex: 1;
  min-width: 0;
}
.reminder-message {
  font-size: 13px;
  margin: 0 0 4px 0;
  word-wrap: break-word;
}
.reminder-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.reminder-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.reminder-actions button {
  font-size: 11px;
  padding: 4px 8px;
}
.btn-notion {
  background: rgba(55, 53, 47, 0.4);
  color: #eee;
  border: 1px solid rgba(55, 53, 47, 0.6);
}
.btn-notion:hover {
  background: rgba(55, 53, 47, 0.7);
  color: #fff;
}
.task-notion-btn {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(55, 53, 47, 0.35);
  color: var(--text-muted, #8b8ea0);
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}
.task-notion-btn:hover {
  background: rgba(55, 53, 47, 0.6);
  color: #eee;
}

/* In-app reminder notification (due reminders popup) */
.reminder-notification {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10001;
  max-width: 380px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
  background: var(--bg-elevated);
}
.reminder-notification.hidden {
  display: none !important;
}
.reminder-notification-inner {
  padding: 16px;
}
.reminder-notification-inner h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
}
.reminder-notification-inner p {
  margin: 0 0 8px 0;
  font-size: 14px;
}
.reminder-notification-due {
  font-size: 12px !important;
  color: var(--text-muted);
}
.reminder-notification-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* MVP Vault */
.mvp-vault-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.mvp-vault-controls select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
}
.mvp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mvp-list-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.mvp-list-item:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}
.mvp-list-item h4 {
  font-size: 15px;
  margin: 0;
}
.mvp-list-item .mvp-item-meta {
  font-size: 13px;
  color: var(--text-muted);
}
.mvp-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}
/* Bigger MVP detail modal */
.mvp-detail-modal-lg {
  max-width: 800px !important;
  width: 90vw !important;
  max-height: 88vh !important;
  display: flex;
  flex-direction: column;
}
.mvp-detail-modal-lg .mvp-detail-body {
  flex: 1;
  overflow-y: auto;
  max-height: none;
}
.mvp-steps-guide {
  background: rgba(124,92,252,0.06);
  border: 1px solid rgba(124,92,252,0.15);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.mvp-steps-guide h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--accent);
}
.mvp-steps {
  padding-left: 20px;
  margin: 0;
  line-height: 1.8;
  font-size: 13px;
  color: var(--text-muted);
}
.mvp-steps li { margin-bottom: 4px; }
.mvp-steps a { color: var(--accent); text-decoration: underline; }
.mvp-neural-stream-box {
  background: var(--bg-dark, #0d0d1a);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 16px;
}
.mvp-neural-stream-box h4 {
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mvp-stream-content {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.mvp-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.mvp-detail-header h3 {
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.mvp-detail-body {
  max-height: 70vh;
  overflow-y: auto;
}
.mvp-detail-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.mvp-detail-section {
  margin-bottom: 20px;
}
.mvp-detail-section h4 {
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.mvp-detail-text {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.mvp-bolt-textarea {
  width: 100%;
  min-height: 120px;
  font-family: inherit;
  font-size: 13px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  resize: vertical;
}
.mvp-checklist-pre {
  font-size: 13px;
  white-space: pre-wrap;
  background: var(--bg-input);
  padding: 10px;
  border-radius: var(--radius-sm);
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}
.mvp-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.mvp-links label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.mvp-links input {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
}
.mvp-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}
.mvp-timeline li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.mvp-timeline li:last-child {
  border-bottom: none;
}
#mvp-update-status-select,
#mvp-update-note {
  margin-right: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
}
#mvp-update-note {
  min-width: 200px;
}

/* ─── Premium Theme Enhancements ─────────────────────────────── */

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

/* Body gradient background */
body {
  background: linear-gradient(180deg, #0d0e12 0%, #11121a 50%, #0d0e12 100%);
  background-attachment: fixed;
}
body.light-theme {
  background: linear-gradient(180deg, #f3f6ff 0%, #eef2ff 50%, #f3f6ff 100%) !important;
}

/* Enhanced sidebar */
.sidebar {
  background: linear-gradient(180deg, #13141c 0%, #0f1017 100%);
  border-right-color: var(--border);
}
body.light-theme .sidebar {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

/* Glowing avatar */
.agent-avatar {
  background: var(--gradient-accent);
  box-shadow: var(--glow-purple);
}

/* Top bar glass effect */
.top-bar {
  background: rgba(22, 24, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
body.light-theme .top-bar {
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom-color: var(--border);
}

/* Light theme: detail panels, blocks, inputs */
body.light-theme .nivix-main {
  background: var(--bg-elevated) !important;
}
body.light-theme .nivix-detail-panel {
  color: #111827 !important;
  background: var(--bg-card);
}
body.light-theme .nivix-detail-title {
  color: #111827 !important;
}
body.light-theme .nivix-idle {
  color: #6b7280;
}
body.light-theme .nivix-detail-desc {
  color: #374151;
}
body.light-theme .nivix-block {
  background: transparent;
}
body.light-theme .nivix-block-label {
  color: #374151 !important;
  font-weight: 800;
}
body.light-theme .nivix-input,
body.light-theme .nivix-select {
  background: var(--bg-input);
  border-color: var(--border);
  color: #111827;
}
body.light-theme .nivix-drafts-label {
  color: #374151;
}
body.light-theme .nivix-sidebar-title {
  color: #111827 !important;
  border-bottom-color: var(--border);
}
body.light-theme .nivix-agent-name-txt {
  color: inherit;
}
body.light-theme .nivix-agent-item.active {
  color: #111827 !important;
}
body.light-theme .nivix-agent-item:hover {
  color: #111827 !important;
}
body.light-theme .nivix-stats-title {
  color: #111827 !important;
}
body.light-theme .nivix-stats-label {
  color: #374151;
}
body.light-theme .nivix-current-draft-label {
  color: #0891b2;
}
body.light-theme .nivix-preview-badge {
  background: rgba(109, 74, 219, 0.1);
  color: #6d4adb;
}
body.light-theme .nivix-export-hint {
  color: #6b7280;
}
body.light-theme .nivix-chip {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-muted);
}
body.light-theme .nivix-chip:hover,
body.light-theme .nivix-chip.active {
  background: rgba(109, 74, 219, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}
body.light-theme .nivix-section-image-result {
  background: var(--bg-elevated);
  border-color: var(--border);
}
body.light-theme .nivix-image-controls-col {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
}
body.light-theme .nivix-stream-header {
  color: var(--text-muted);
}
body.light-theme .nivix-neural-stream {
  border-color: var(--border);
}
body.light-theme .nivix-preview-viewport {
  background: var(--bg-card);
  border-color: var(--border);
}
body.light-theme .nivix-preview-inner {
  color: var(--text) !important;
}
body.light-theme .nivix-preview-inner h1,
body.light-theme .nivix-preview-inner h2,
body.light-theme .nivix-preview-inner h3 {
  color: var(--text) !important;
}
body.light-theme .nivix-preview-raw {
  color: var(--text) !important;
}
body.light-theme .nivix-preview-rendered {
  color: var(--text);
}
body.light-theme .nivix-preview-rendered h1, body.light-theme .nivix-preview-rendered h2,
body.light-theme .nivix-preview-rendered h3 {
  color: #111827;
}
body.light-theme .nivix-preview-rendered blockquote {
  background: rgba(109, 74, 219, 0.06);
  color: #6d4adb;
}
body.light-theme .nivix-preview-rendered hr {
  border-top-color: var(--border);
}
body.light-theme .nivix-preview-rendered code {
  background: rgba(109, 74, 219, 0.08);
}
body.light-theme .nivix-preview-tab {
  background: var(--bg-elevated);
  color: var(--text-muted);
}
body.light-theme .nivix-preview-tab:hover {
  color: var(--text);
}
body.light-theme .nivix-preview-tab.active {
  background: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
}
body.light-theme .nivix-preview-tabs {
  border-color: var(--border);
}
body.light-theme .panel.active.panel-nivix {
  background: var(--bg-elevated) !important;
}
body.light-theme .panel-nivix .nivix-header {
  background: var(--bg-card) !important;
  border-bottom-color: var(--border) !important;
}
body.light-theme .nivix-brand {
  color: var(--text-muted);
}
body.light-theme .nivix-agent-name {
  color: var(--text);
}
body.light-theme .nivix-header-center {
  color: var(--text-muted);
}
body.light-theme .nivix-draft-edit-textarea {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text);
}
body.light-theme .nivix-gallery-item {
  background: var(--bg-elevated);
  border-color: var(--border);
}
body.light-theme .nivix-btn-outline,
body.light-theme .nivix-btn-export {
  border-color: var(--border);
  color: var(--text-muted);
}
body.light-theme .nivix-sidebar {
  background: var(--bg-card) !important;
  border-right-color: var(--border) !important;
}
body.light-theme .nivix-agent-item {
  color: var(--text-muted);
}
body.light-theme .nivix-agent-item:hover {
  background: var(--bg-elevated) !important;
  color: var(--text) !important;
}
body.light-theme .nivix-agent-item.active {
  color: var(--text) !important;
}
body.light-theme .nivix-stats {
  border-top-color: var(--border);
}
body.light-theme .nivix-stats-bar {
  background: var(--bg-elevated);
}
body.light-theme .nivix-agent-dot {
  background: var(--text-dim);
}

/* Enhanced cards */
.panel-card,
.security-card,
.agent-card,
.briefing-item,
.sop-item,
.mvp-list-item,
.note-item,
.log-entry {
  box-shadow: var(--card-shadow);
  transition: all 0.25s ease;
}

.panel-card:hover,
.agent-card:hover,
.briefing-item:hover,
.sop-item:hover,
.mvp-list-item:hover {
  box-shadow: var(--card-shadow), var(--glow-purple);
  transform: translateY(-1px);
}

/* Gradient border effect on agent cards */
.agent-card {
  background: var(--gradient-card);
  background-color: var(--bg-card);
}

/* Enhanced status badges */
.agent-header .status {
  background: rgba(0, 214, 143, 0.12);
  color: var(--success);
  border-color: rgba(0, 214, 143, 0.3);
  font-weight: 600;
}

.status-pill.ready {
  color: var(--success);
  border-color: rgba(0, 214, 143, 0.4);
  background: rgba(0, 214, 143, 0.1);
  box-shadow: 0 0 8px rgba(0, 214, 143, 0.15);
}

/* Gradient primary buttons */
.btn-primary {
  background: var(--gradient-accent);
  box-shadow: 0 2px 12px rgba(124, 92, 252, 0.3);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  background: var(--gradient-accent);
  box-shadow: 0 4px 20px rgba(124, 92, 252, 0.45);
  transform: translateY(-1px);
}

.btn-agent-configure {
  background: var(--gradient-accent);
  box-shadow: 0 2px 12px rgba(124, 92, 252, 0.25);
}

.btn-agent-configure:hover {
  box-shadow: 0 4px 20px rgba(124, 92, 252, 0.4);
  transform: translateY(-1px);
}

/* Enhanced tab styling */
.tab.active {
  background: rgba(124, 92, 252, 0.12);
  color: #a78bfa;
  box-shadow: 0 0 12px rgba(124, 92, 252, 0.1);
}

/* Kanban columns */
.column {
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
  box-shadow: var(--card-shadow);
}

/* Task cards */
.task {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.task:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}

/* Modal enhancements */
.modal {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  border-color: var(--border);
}

.modal-overlay {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

/* Landing card enhancement */
.landing-card {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), var(--glow-purple);
}

/* Input focus glow */
input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 2px rgba(124, 92, 252, 0.2);
}

/* Sidebar link active glow */
.sidebar-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
  background: rgba(124, 92, 252, 0.08);
}

/* External links */
.external-link {
  color: #a78bfa;
}

/* Log level badges */
.log-badge.level-info { color: var(--success); background: rgba(0, 214, 143, 0.1); }
.log-badge.level-warn { color: var(--warning); background: rgba(255, 181, 71, 0.1); }
.log-badge.level-error { color: var(--danger); background: rgba(255, 77, 106, 0.1); }

/* Tooltip on hover for log badges and entries */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark, #1a1a2e);
  color: var(--text, #e0e0f0);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  max-width: 300px;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}
.log-entry[data-tooltip]:hover::after {
  left: auto;
  right: 0;
  transform: none;
}

/* Briefing modal */
.briefing-audio-container {
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.08) 0%, var(--bg-elevated) 100%);
  border-color: rgba(124, 92, 252, 0.2);
}

/* Security scan results */
.security-scan-result.success { border-left-color: var(--success); background: rgba(0, 214, 143, 0.05); }
.security-scan-result.warn { border-left-color: var(--warning); background: rgba(255, 181, 71, 0.05); }
.security-scan-result.error { border-left-color: var(--danger); background: rgba(255, 77, 106, 0.05); }

/* Smooth transitions everywhere */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

a, button, input, select, textarea {
  transition-duration: 0.2s;
}

/* Agent Vault – image thumbnails */
.nivix-vault-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  padding: 0 8px 8px;
}
.nivix-vault-images {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nivix-vault-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
}
.nivix-vault-item:hover {
  border-color: var(--primary);
}
.nivix-vault-thumb {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px 8px 0 0;
}
.nivix-vault-meta {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nivix-vault-fname {
  font-size: 0.7rem;
  color: var(--text);
  word-break: break-all;
  line-height: 1.2;
}
.nivix-vault-size {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* Section image result */
.nivix-section-image-result {
  margin-top: 8px;
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Image controls: resize, download, insert */
.nivix-image-workspace {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  align-items: flex-start;
}
.nivix-image-preview-col {
  flex: 1;
  min-width: 0;
  max-width: 500px;
}
.nivix-image-preview-col img {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
  height: auto;
  border-radius: 8px;
  display: none;
}
.nivix-image-controls-col {
  flex: 0 0 220px;
  min-width: 200px;
  padding: 12px;
  background: #12141c;
  border: 1px solid #262838;
  border-radius: 10px;
}
.nivix-image-controls-col .nivix-style-chips {
  gap: 4px;
  margin: 6px 0;
}
.nivix-image-controls-col .nivix-chip {
  padding: 4px 10px;
  font-size: 11px;
}
.nivix-custom-size-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.nivix-size-input {
  width: 60px !important;
  min-width: 50px;
  text-align: center;
  padding: 6px 4px !important;
  font-size: 12px !important;
}
.nivix-size-x {
  color: #8b8ea0;
  font-size: 12px;
  font-weight: 600;
}
.nivix-resize-chip.active {
  border-color: #06b6d4 !important;
  color: #06b6d4 !important;
  background: rgba(6, 182, 212, 0.1) !important;
}
.nivix-image-controls-col .nivix-export-row {
  gap: 4px;
}
.nivix-image-controls-col .nivix-btn-export {
  padding: 5px 10px;
  font-size: 11px;
  margin-right: 4px;
  margin-bottom: 4px;
}
.nivix-image-controls-col .nivix-btn-teal {
  width: 100%;
  text-align: center;
  font-size: 11px;
  padding: 8px 10px;
}
@media (max-width: 800px) {
  .nivix-image-workspace {
    flex-direction: column;
  }
  .nivix-image-controls-col {
    flex: 1;
    min-width: 0;
  }
}

/* Image gallery */
.nivix-image-gallery {
  margin-top: 12px;
}
.nivix-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.nivix-gallery-item {
  position: relative;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  background: var(--bg-elevated);
}
.nivix-gallery-item:hover {
  border-color: #06b6d4;
  transform: scale(1.02);
}
.nivix-gallery-item.selected {
  border-color: #7c5cfc;
  box-shadow: 0 0 8px rgba(124, 92, 252, 0.4);
}
.nivix-gallery-thumb {
  width: 100%;
  height: auto;
  display: block;
}
.nivix-gallery-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nivix-gallery-style-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #06b6d4;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Video Transcriber Neural Stream live progress */
.vt-stream-header {
  font-size: 0.8rem;
  margin-bottom: 6px;
  color: var(--text);
}
.vt-stream-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.vt-stream-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.vt-stream-stats {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.vt-stream-logs {
  font-size: 0.7rem;
  line-height: 1.5;
  max-height: 140px;
  overflow-y: auto;
}
.vt-stream-log {
  padding: 1px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  gap: 6px;
}
.vt-log-time {
  color: rgba(255,255,255,0.25);
  min-width: 50px;
  font-size: 0.65rem;
}
.vt-log-ok { color: #50c878; }
.vt-log-fail { color: #ff6b6b; }
.vt-log-info { color: var(--text-dim); }
.vt-stream-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: vtPulse 1.5s ease-in-out infinite;
}
@keyframes vtPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Course Creator */
.cc-platform-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  background: rgba(0,0,0,0.15);
  transition: border-color 0.2s, color 0.2s;
}
.cc-platform-check:has(input:checked) {
  border-color: var(--primary);
  color: var(--text);
}
.cc-platform-check input { accent-color: var(--primary); }
.cc-module-card {
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.cc-course-item {
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.cc-course-item:hover { border-color: var(--primary); background: rgba(255,255,255,0.03); }
.cc-course-item.active { border-color: var(--primary); background: rgba(var(--primary-rgb, 0,150,255),0.08); }
.cc-pain-point {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.8rem;
}
.cc-freq {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
}
.cc-reddit-post {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 0.78rem;
}
.cc-reddit-link {
  color: #7c5cfc;
  text-decoration: none;
  transition: color 0.2s;
}
.cc-reddit-link:hover {
  color: #a78bfa;
  text-decoration: underline;
}
.cc-subreddit-link {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ff6b35;
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.25);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
}
.cc-subreddit-link:hover {
  background: rgba(255, 107, 53, 0.2);
  border-color: rgba(255, 107, 53, 0.5);
  color: #ff8c5a;
}
.cc-drive-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #00d68f;
  background: rgba(0, 214, 143, 0.1);
  border: 1px solid rgba(0, 214, 143, 0.25);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}
.cc-drive-badge:hover {
  background: rgba(0, 214, 143, 0.2);
  border-color: rgba(0, 214, 143, 0.5);
  color: #2ee6a8;
}
body.light-theme .cc-reddit-link { color: #5b3cc2; }
body.light-theme .cc-reddit-link:hover { color: #7c5cfc; }
body.light-theme .cc-subreddit-link { color: #d9534f; background: rgba(217, 83, 79, 0.08); border-color: rgba(217, 83, 79, 0.2); }
body.light-theme .cc-drive-badge { color: #16a34a; background: rgba(22, 163, 74, 0.08); border-color: rgba(22, 163, 74, 0.2); }
.cc-content-block {
  font-size: 0.8rem;
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
  background: rgba(0,0,0,0.1);
  border-radius: 6px;
}
.cc-content-block h3 { font-size: 1rem; margin: 10px 0 4px; }
.cc-content-block h4 { font-size: 0.9rem; margin: 8px 0 4px; }
.cc-content-block h5 { font-size: 0.85rem; margin: 6px 0 4px; }
.cc-content-block ul { padding-left: 16px; }
.cc-content-block li { margin-bottom: 2px; }
.cc-preview-tab {
  font-size: 0.7rem !important;
  padding: 3px 8px !important;
}
.cc-preview-tab.active {
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: 700;
}
body.light-theme .cc-preview-tab.active {
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
body.light-theme .cc-preview-tab {
  background: var(--bg-elevated);
  color: #374151;
  border: 1px solid var(--border);
}
body.light-theme .cc-preview-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
body.light-theme .cc-drive-link {
  color: #374151;
  border: 1px solid var(--border);
}
body.light-theme .cc-drive-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Video Creator tab buttons */
.vc-input-tab {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.vc-input-tab:hover {
  border-color: var(--primary);
  color: var(--text);
}
.vc-input-tab.active {
  background: rgba(124, 92, 252, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Agent Vault (merged Docs/Logs/SOPs) ── */
.av-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.av-header h2 { margin: 0; }
.av-tabs { display: flex; gap: 4px; }
.av-tab {
  padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); cursor: pointer; font-size: 0.8rem; font-weight: 500;
  transition: all 0.2s;
}
.av-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.av-tab:hover:not(.active) { background: rgba(255,255,255,0.04); }
.av-section { display: none; }
.av-section.active { display: block; }

/* ── Agent sidebar drag-and-drop ── */
.nivix-sidebar-title-row { display: flex; align-items: center; justify-content: space-between; padding-right: 8px; }
.nivix-sidebar-btns { display: flex; gap: 4px; align-items: center; }
.nivix-scroll-lock-btn.locked { color: var(--accent); }
.nivix-lock-btn {
  background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.6;
  transition: opacity 0.2s;
}
.nivix-lock-btn:hover { opacity: 1; }
.nivix-lock-btn.locked { opacity: 1; }
.nivix-agent-item { position: relative; transition: transform 0.15s, opacity 0.15s; }
.nivix-agent-item.dragging { opacity: 0.4; transform: scale(0.95); }
.nivix-agent-item.drag-over { border-top: 2px solid var(--primary); }
.nivix-agent-item .drag-handle {
  position: absolute; left: 0; top: 0; bottom: 0; width: 20px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab; color: rgba(255,255,255,0.15); font-size: 10px;
  transition: color 0.2s;
}
.nivix-agent-item:hover .drag-handle { color: rgba(255,255,255,0.4); }
.nivix-agent-item.locked .drag-handle { display: none; }

/* ── BM Chat + compact Neural Stream ── */
.bm-bottom-row {
  display: grid; grid-template-columns: 280px 1fr; gap: 12px; margin-top: 16px;
}
@media (max-width: 900px) { .bm-bottom-row { grid-template-columns: 1fr; } }
.bm-stream-compact {
  background: #0f1016; border: 1px solid #262838; border-radius: 8px;
  padding: 10px 12px; max-height: 200px; overflow-y: auto;
}
.nivix-stream-body-compact { font-size: 0.72rem; color: var(--text-dim); line-height: 1.5; min-height: 40px; }
.bm-chat-panel {
  background: #0f1016; border: 1px solid #262838; border-radius: 8px;
  display: flex; flex-direction: column; min-height: 250px; max-height: 420px;
}
.bm-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.04em; color: var(--text-dim); border-bottom: 1px solid #262838;
}
.bm-chat-expand-btn { background: none; border: none; cursor: pointer; color: var(--text-dim); font-size: 14px; }
.bm-chat-messages {
  flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
  font-size: 0.8rem; line-height: 1.5;
}
.bm-chat-msg {
  padding: 8px 12px; border-radius: 10px; max-width: 85%; word-wrap: break-word;
}
.bm-chat-bot {
  background: rgba(124,92,252,0.1); border: 1px solid rgba(124,92,252,0.2);
  align-self: flex-start; color: var(--text);
}
.bm-chat-user {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  align-self: flex-end; color: var(--text);
}
.bm-chat-msg img { max-width: 100%; border-radius: 6px; margin-top: 6px; }
.bm-chat-input-row {
  display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px;
  border-top: 1px solid #262838;
}
.bm-chat-icon-btn {
  background: none; border: none; font-size: 16px; cursor: pointer;
  opacity: 0.6; transition: opacity 0.2s; padding: 2px 4px;
}
.bm-chat-icon-btn:hover { opacity: 1; }
.bm-chat-input {
  flex: 1; background: rgba(255,255,255,0.04); border: 1px solid #262838;
  border-radius: 12px; padding: 8px 12px; color: var(--text); font-size: 0.8rem;
  font-family: inherit; line-height: 1.45;
  resize: none; overflow-y: auto;
  min-height: 36px; max-height: 120px;
  word-wrap: break-word; white-space: pre-wrap;
}
.bm-chat-input::placeholder { color: var(--text-dim); }
.bm-chat-send-btn {
  background: var(--primary); border: none; color: #fff; border-radius: 6px;
  padding: 5px 10px; cursor: pointer; font-size: 14px;
}
.bm-chat-voice-status {
  padding: 4px 12px; font-size: 0.72rem; color: #ff6b6b;
  display: flex; align-items: center; gap: 4px;
}
.bm-chat-voice-status.recording { color: #ff6b6b; animation: voicePulse 1s infinite; }
@keyframes voicePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.bm-chat-image-preview { padding: 4px 12px; }
.bm-chat-image-preview img { max-height: 80px; border-radius: 6px; }

/* ── Course Creator Drive popup ── */
.cc-drive-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.cc-drive-modal.hidden { display: none; }
.cc-drive-modal-inner {
  background: var(--bg-elevated, #1a1c28); border: 1px solid #262838;
  border-radius: 12px; width: 90%; max-width: 600px; max-height: 80vh;
  display: flex; flex-direction: column;
}
.cc-drive-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #262838;
}
.cc-drive-modal-header h3 { margin: 0; font-size: 1rem; }
.cc-drive-modal-body {
  padding: 16px 18px; overflow-y: auto; font-size: 0.85rem; line-height: 1.6;
}
.cc-drive-file { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.cc-drive-file a { color: var(--primary); text-decoration: none; }
.cc-drive-file a:hover { text-decoration: underline; }
.cc-drive-folder { font-weight: 600; margin-top: 10px; }
.cc-drive-link { color: var(--primary); text-decoration: none; }
.cc-drive-link:hover { text-decoration: underline; }

/* ── System Backups ── */
.backup-section {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.backup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}
.backup-header h2 { margin: 0; }
.backup-actions { display: flex; gap: 8px; }
.backup-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.backup-disk-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.backup-disk-label {
  font-weight: 600;
  color: var(--text-muted);
}
.backup-status {
  margin-bottom: 12px;
}
.backup-status .backup-running {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(124,92,252,0.08);
  border: 1px solid rgba(124,92,252,0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent);
  animation: backupPulse 2s infinite;
}
@keyframes backupPulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  gap: 12px;
  transition: border-color 0.2s;
}
.backup-item:hover {
  border-color: var(--accent);
}
.backup-item:first-child {
  border-left: 3px solid var(--success);
}
.backup-item-info {
  flex: 1;
  min-width: 0;
}
.backup-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}
.backup-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.backup-item-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,214,143,0.1);
  color: var(--success);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.backup-item-badge.latest {
  background: rgba(124,92,252,0.15);
  color: var(--accent);
}
.backup-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.backup-item-actions button {
  font-size: 11px;
  padding: 5px 10px;
}
.btn-download-backup {
  background: rgba(0,214,143,0.1);
  color: var(--success);
  border: 1px solid rgba(0,214,143,0.2);
  border-radius: 6px;
  cursor: pointer;
}
.btn-download-backup:hover {
  background: rgba(0,214,143,0.2);
}
.btn-delete-backup {
  background: rgba(255,77,106,0.1);
  color: var(--danger);
  border: 1px solid rgba(255,77,106,0.2);
  border-radius: 6px;
  cursor: pointer;
}
.btn-delete-backup:hover {
  background: rgba(255,77,106,0.2);
}
.backup-restore-info {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 13px;
}
.backup-restore-info h4 {
  font-size: 14px;
  margin: 0 0 8px 0;
  color: var(--text);
}
.backup-restore-info ol {
  padding-left: 20px;
  margin: 0 0 8px 0;
  line-height: 1.8;
  color: var(--text-muted);
}
.backup-restore-info code {
  background: var(--bg-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--accent);
}
.backup-restore-info p {
  margin: 0;
  color: var(--text-dim);
  font-size: 12px;
}

/* ── Content Promotion Engine ── */
.sm-promo-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.sm-promo-post-card {
  background: var(--bg-dark, #12131f);
  border: 1.5px solid var(--border, #2a2d44);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.sm-promo-post-card:hover {
  border-color: #7c5cfc;
  box-shadow: 0 0 12px rgba(124,92,252,.25);
  transform: translateY(-2px);
}
.sm-promo-post-card.selected {
  border-color: #7c5cfc;
  box-shadow: 0 0 18px rgba(124,92,252,.4);
  background: rgba(124,92,252,.08);
}
.sm-promo-post-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #7c5cfc;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.sm-promo-post-preview {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text, #e0e0e8);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 140px;
  overflow: hidden;
  position: relative;
}
.sm-promo-post-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(transparent, var(--bg-dark, #12131f));
  pointer-events: none;
}
.sm-promo-post-card.selected .sm-promo-post-preview::after {
  background: linear-gradient(transparent, rgba(18,19,31,.92));
}
.sm-promo-post-chars {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim, #666);
  text-align: right;
}
.nivix-platforms label {
  font-size: 13px;
  color: var(--text, #e0e0e8);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nivix-platforms input[type="checkbox"] {
  accent-color: #7c5cfc;
}

/* Light theme overrides for Content Promotion */
body.light-theme .sm-promo-post-card {
  background: #fff;
  border-color: #d0d0e0;
}
body.light-theme .sm-promo-post-card:hover {
  border-color: #7c5cfc;
  box-shadow: 0 0 12px rgba(124,92,252,.18);
}
body.light-theme .sm-promo-post-card.selected {
  background: rgba(124,92,252,.06);
}
body.light-theme .sm-promo-post-preview {
  color: #1a1a2e;
}
body.light-theme .sm-promo-post-preview::after {
  background: linear-gradient(transparent, #fff);
}
body.light-theme .sm-promo-post-card.selected .sm-promo-post-preview::after {
  background: linear-gradient(transparent, rgba(255,255,255,.92));
}

/* Light theme — Code Doctor */
body.light-theme .cd-history-entry {
  background: #fff;
  border-color: #e0e0e8;
}
body.light-theme .cd-history-entry:hover { border-color: #7c5cfc; }
body.light-theme .cd-history-mode { background: #f0f0f5; color: #555; }
body.light-theme .cd-report-content { background: #fff; border-color: #e0e0e8; }
body.light-theme .cd-tab { color: #666; }
body.light-theme .cd-tab.active { color: #7c5cfc; border-bottom-color: #7c5cfc; }
body.light-theme .cd-tabs { border-bottom-color: #e0e0e8; }
body.light-theme .cd-scan-modal-inner { background: #fff; border-color: #d0d0e0; }
body.light-theme .cd-scan-modal-inner input { background: #f5f5fa; border-color: #d0d0e0; color: #1a1a2e; }
body.light-theme .cd-export-bar { background: #f0f0f5; border-color: #d0d0e0; }
body.light-theme .cd-export-label { color: #555; }
body.light-theme .btn-icon-sm { background: #f0f0f5; border-color: #d0d0e0; color: #555; }
body.light-theme .btn-icon-sm:hover { background: #e0e0e8; color: #1a1a2e; }
