/* Windbound — Dashboard Styles (Modernized) */

/* ── Design tokens ─────────────────────────────────── */
:root {
  --accent: #7c5cfc;
  --accent-light: #a78bfa;
  --accent-dim: #6345e0;
  --accent2: #3b82f6;
  --surface-1: #0b0d12;
  --surface-2: #111318;
  --surface-3: #171a22;
  --surface-4: #1e2230;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --z-dropdown: 20;
  --z-modal: 50;
  --z-toast: 60;
  --z-context-menu: 70;
}

/* ── Scrollbar ──────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.06) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124, 92, 252, 0.3); }

/* ── Animations ─────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes glowPulse {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 2px currentColor); }
  50% { opacity: 0.7; filter: drop-shadow(0 0 6px currentColor); }
}
@keyframes pulse-ring {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(2); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 1s linear infinite;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(0.75rem) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(0.75rem) scale(0.95); }
}
@keyframes iSpinnerBlade {
  0% { opacity: 0.85; }
  50% { opacity: 0.25; }
  100% { opacity: 0.25; }
}

.animate-fade-in {
  animation: fadeInUp 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.animate-fade-in-delay-1 { animation-delay: 60ms; }
.animate-fade-in-delay-2 { animation-delay: 120ms; }
.animate-fade-in-delay-3 { animation-delay: 180ms; }

/* ── Sidebar nav categories ────────────────────────── */
.nav-category {
  margin-bottom: 0.25rem;
}
.nav-category:first-child {
  margin-top: 0;
}
.nav-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.75rem;
  margin-bottom: 0.125rem;
  cursor: pointer;
  user-select: none;
  border-radius: 0.375rem;
  transition: background 150ms ease;
}
.nav-category-header:hover {
  background: rgba(255, 255, 255, 0.03);
}
.nav-category-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  transition: color 150ms ease;
}
.nav-category-header:hover .nav-category-label {
  color: #9ca3af;
}
.nav-category-chevron {
  width: 0.75rem;
  height: 0.75rem;
  color: #4b5563;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), color 150ms ease;
  flex-shrink: 0;
}
.nav-category-header:hover .nav-category-chevron {
  color: #6b7280;
}
.nav-category.collapsed .nav-category-chevron {
  transform: rotate(-90deg);
}
.nav-category-items {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-category.collapsed .nav-category-items {
  grid-template-rows: 0fr;
}
.nav-category-items > div {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

/* ── Sidebar nav links ──────────────────────────────── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #9ca3af;
  transition: all 180ms ease;
  position: relative;
}
.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, #7c5cfc, #3b82f6);
  transition: height 200ms ease;
}
.nav-link:hover {
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.04);
}
.nav-link.active {
  color: #fff;
  background: rgba(124, 92, 252, 0.1);
}
.nav-link.active::before {
  height: 60%;
}
.nav-link.active svg {
  color: #a78bfa;
  filter: drop-shadow(0 0 6px rgba(124, 92, 252, 0.5));
}

/* ── Metric ring ────────────────────────────────────── */
.metric-ring {
  transform: rotate(-90deg);
}
.metric-ring-bg {
  stroke: rgba(255, 255, 255, 0.08);
}
.metric-ring-fill {
  transition: stroke-dashoffset 800ms cubic-bezier(0.4, 0, 0.2, 1);
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--ring-color, rgba(124, 92, 252, 0.4)));
}

/* ── Card base — glassmorphism ──────────────────────── */
.card {
  background: rgba(23, 26, 34, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: transform 250ms ease, border-color 250ms ease, box-shadow 250ms ease;
}
.card-hover:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 92, 252, 0.15);
  box-shadow: 0 0 20px rgba(124, 92, 252, 0.08), 0 8px 32px -8px rgba(0, 0, 0, 0.3);
}

/* ── Status dot pulse ───────────────────────────────── */
.status-dot {
  position: relative;
  animation: glowPulse 2.5s ease-in-out infinite;
}
.status-dot::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  animation: pulse-ring 2s ease-out infinite;
}
.status-online::before { background: rgba(34, 197, 94, 0.3); }
.status-offline::before { background: rgba(239, 68, 68, 0.3); }

/* ── Toast notification — pill style ────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  z-index: 50;
  background: #131316;
  overflow: hidden;
  box-shadow:
    0 32px 64px -16px rgba(0,0,0,0.30),
    0 16px 32px -8px rgba(0,0,0,0.30),
    0 8px 16px -4px rgba(0,0,0,0.24),
    0 0 0 1px rgba(0,0,0,1.00),
    inset 0 0 0 1px rgba(255,255,255,0.08),
    inset 0 1px 0 0 rgba(255,255,255,0.12);
  animation: toast-in 250ms cubic-bezier(0.16, 1, 0.3, 1);
  transition: width 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.toast-exit {
  animation: toast-out 200ms ease forwards;
}
.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 8px;
}
.toast-icon svg { width: 18px; height: 18px; }
.toast-text {
  white-space: nowrap;
}
.toast-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 99px;
  background: rgba(255,255,255,0.15);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
  flex-shrink: 0;
  margin-right: 8px;
}
.toast-check svg { width: 14px; height: 14px; }
.toast-error {
  background: linear-gradient(180deg, #2d1519 0%, #1a0c0e 100%);
  box-shadow:
    0 32px 64px -16px rgba(0,0,0,0.30),
    0 16px 32px -8px rgba(0,0,0,0.30),
    0 0 0 1px rgba(239,68,68,0.25),
    inset 0 0 0 1px rgba(239,68,68,0.12),
    inset 0 1px 0 0 rgba(239,68,68,0.15);
}

/* iOS-style spinner */
.ispinner {
  position: relative;
  width: 15px;
  height: 15px;
  display: inline-block;
  flex-shrink: 0;
  margin-right: 8px;
}
.ispinner-blade {
  position: absolute;
  top: 37%;
  left: 44%;
  width: 2px;
  height: 5px;
  background-color: #fff;
  border-radius: 1px;
  animation: iSpinnerBlade 1s linear infinite;
  will-change: opacity;
}
.ispinner-blade:nth-child(1)  { transform: rotate(0deg) translateY(-130%);   animation-delay: -1.667s; }
.ispinner-blade:nth-child(2)  { transform: rotate(30deg) translateY(-130%);  animation-delay: -1.583s; }
.ispinner-blade:nth-child(3)  { transform: rotate(60deg) translateY(-130%);  animation-delay: -1.5s;   }
.ispinner-blade:nth-child(4)  { transform: rotate(90deg) translateY(-130%);  animation-delay: -1.417s; }
.ispinner-blade:nth-child(5)  { transform: rotate(120deg) translateY(-130%); animation-delay: -1.333s; }
.ispinner-blade:nth-child(6)  { transform: rotate(150deg) translateY(-130%); animation-delay: -1.25s;  }
.ispinner-blade:nth-child(7)  { transform: rotate(180deg) translateY(-130%); animation-delay: -1.167s; }
.ispinner-blade:nth-child(8)  { transform: rotate(210deg) translateY(-130%); animation-delay: -1.083s; }
.ispinner-blade:nth-child(9)  { transform: rotate(240deg) translateY(-130%); animation-delay: -1s;     }
.ispinner-blade:nth-child(10) { transform: rotate(270deg) translateY(-130%); animation-delay: -0.917s; }
.ispinner-blade:nth-child(11) { transform: rotate(300deg) translateY(-130%); animation-delay: -0.833s; }
.ispinner-blade:nth-child(12) { transform: rotate(330deg) translateY(-130%); animation-delay: -0.75s;  }

/* ── Log container ──────────────────────────────────── */
.log-viewer {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  tab-size: 4;
}

/* ── Badge — gradient tinted backgrounds ────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ── Button styles ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 180ms ease;
  cursor: pointer;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: linear-gradient(135deg, #7c5cfc, #3b82f6);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(124, 92, 252, 0.15);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}
.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(124, 92, 252, 0.3);
  filter: brightness(1.1);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: #9ca3af;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border-color: rgba(124, 92, 252, 0.2);
  box-shadow: 0 0 12px rgba(124, 92, 252, 0.06);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.15);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.1);
}

/* ── Tables ─────────────────────────────────────────── */
table thead tr {
  background: rgba(124, 92, 252, 0.04);
  border-bottom: 1px solid rgba(124, 92, 252, 0.12);
}
table tbody tr {
  transition: background 150ms ease;
}
table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}
table tbody tr:hover {
  background: rgba(124, 92, 252, 0.04);
}

/* ── Inputs / forms ─────────────────────────────────── */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
select,
textarea {
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 92, 252, 0.4);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.12);
  outline: none;
}

/* ── Bot tabs — gradient active border ──────────────── */
.bot-tab {
  position: relative;
  transition: color 200ms ease, background 200ms ease;
}
.bot-tab:hover {
  background: rgba(255, 255, 255, 0.04);
}
.bot-tab.active {
  background: rgba(124, 92, 252, 0.1);
  box-shadow: 0 0 12px rgba(124, 92, 252, 0.06);
}
.bot-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, #7c5cfc, #3b82f6);
  opacity: 0;
  transition: opacity 200ms ease;
}
.bot-tab.active::after {
  opacity: 1;
}

/* ── Conversation sidebar items ─────────────────────── */
.convo-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  color: #9ca3af;
  cursor: pointer;
  transition: all 150ms ease;
}
.convo-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
}
.convo-item.active {
  background: rgba(124, 92, 252, 0.12);
  color: #fff;
}
.convo-actions {
  margin-left: auto;
}

/* ── Claude avatar ──────────────────────────────────── */
.claude-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(124, 92, 252, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* ── Code blocks — Discord / Claude style ───────────── */
.code-block {
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0d0e11;
  min-width: 0;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: #191b20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.code-lang {
  font-size: 12px;
  font-weight: 500;
  color: #8b8f96;
  font-family: inherit;
}
.code-copy,
.code-create-file {
  font-size: 12px;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 500;
  transition: all 150ms;
}
.code-copy:hover,
.code-create-file:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #d1d5db;
}
.code-create-file {
  color: #a78bfa;
}
.code-create-file:hover {
  color: #c4b5fd;
}

/* ── Inline code ────────────────────────────────────── */
.inline-code {
  background: #1e1f26;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.8em;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: #e2e4e9;
}

/* ── Blockquotes ────────────────────────────────────── */
.chat-blockquote {
  border-left: 3px solid rgba(255, 255, 255, 0.15);
  padding-left: 12px;
  margin: 6px 0;
  color: #a1a5ad;
}

/* ── Usage bar ──────────────────────────────────────── */
.usage-bar {
  border-radius: 999px;
}
.usage-bar-fill {
  border-radius: 999px;
  min-width: 2px;
}

/* ── Prism.js dark theme overrides ──────────────────── */
pre[class*="language-"],
code[class*="language-"] {
  background: #111318 !important;
  text-shadow: none !important;
}
.code-block pre {
  margin: 0 !important;
  padding: 0.75rem 1rem !important;
  background: #0d0e11 !important;
  border-radius: 0 !important;
}
.code-block pre code {
  font-size: 0.8125rem;
  line-height: 1.6;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  white-space: pre !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  display: block;
}
.code-block pre {
  overflow-x: auto !important;
}

/* ── Chat content list styling ──────────────────────── */
.chat-content ul, .chat-content ol {
  margin: 0.5rem 0;
  padding-left: 0;
}
.chat-content li {
  margin-bottom: 0.25rem;
}

/* ── IDE: Chat Panel Resize Handle ──────────────────── */
.chat-resize-handle {
  width: 5px;
  cursor: col-resize;
  background: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: background 150ms ease;
}
.chat-resize-handle:hover,
.chat-resize-handle.active {
  background: rgba(124, 92, 252, 0.4);
}
.chat-resize-handle::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  right: -3px;
}

/* ── IDE: Log Panel Resize Handle ──────────────────── */
.log-resize-handle {
  height: 4px;
  cursor: row-resize;
  background: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: background 150ms ease;
}
.log-resize-handle:hover,
.log-resize-handle.active {
  background: rgba(124, 92, 252, 0.4);
}
.log-resize-handle::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -3px;
  bottom: -3px;
}

/* ── IDE: Log Panel ───────────────────────────────── */
#log-panel {
  display: flex;
  flex-direction: column;
}
#log-panel.hidden {
  display: none !important;
}
.log-tab-btn {
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 100ms ease;
}
.log-tab-btn:hover {
  color: #d1d5db;
  background: rgba(255, 255, 255, 0.05);
}
.log-tab-btn.active {
  color: #e5e7eb;
  background: rgba(124, 92, 252, 0.12);
}
.chat-mode-btn {
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 100ms ease;
}
.chat-mode-btn:hover {
  color: #d1d5db;
  background: rgba(255, 255, 255, 0.05);
}
.chat-mode-btn.active {
  color: #e5e7eb;
  background: rgba(124, 92, 252, 0.15);
}
.log-entry {
  padding: 1px 0;
  line-height: 1.5;
  word-break: break-all;
}
.log-entry-time {
  color: #4b5563;
  margin-right: 6px;
}
.log-entry.log-error { color: #f87171; }
.log-entry.log-warn { color: #fbbf24; }
.log-entry.log-info { color: #9ca3af; }

.log-entry.log-lsp { color: #a78bfa; }

/* ── IDE: File Tree ─────────────────────────────────── */
.file-tree-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  color: #9ca3af;
  transition: all 120ms ease;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-tree-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
}
.file-tree-item.active {
  background: rgba(124, 92, 252, 0.12);
  color: #fff;
}
.file-tree-item .folder-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 150ms ease;
  color: #6b7280;
}
.file-tree-item .folder-chevron.open {
  transform: rotate(90deg);
}
.file-tree-item .file-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: #6b7280;
}
.file-tree-folder-children {
  /* indent per depth handled by padding-left */
}

/* ── IDE: Editor Tabs ───────────────────────────────── */
.editor-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11px;
  color: #9ca3af;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 120ms ease;
  position: relative;
  flex-shrink: 0;
}
.editor-tab:hover {
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.03);
}
.editor-tab.active {
  color: #fff;
  border-bottom-color: #7c5cfc;
  background: rgba(124, 92, 252, 0.06);
}
.editor-tab .tab-close {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 120ms ease;
}
.editor-tab:hover .tab-close {
  opacity: 0.6;
}
.editor-tab .tab-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}
.editor-tab .dirty-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
  display: none;
}
.editor-tab.dirty .dirty-dot {
  display: block;
}

/* ── IDE: Diff View ────────────────────────────────── */
#diff-toggle-btn.diff-active {
  color: #a78bfa;
  background: rgba(124, 92, 252, 0.15);
  border-color: rgba(124, 92, 252, 0.3);
}
.editor-tab.diff-active {
  border-bottom-color: #f59e0b;
}
#diff-editor-container,
#diff-editor-container .monaco-editor,
#diff-editor-container .monaco-diff-editor,
#diff-editor-container .overflow-guard {
  background: #111318 !important;
}

/* ── IDE: Collab Remote Cursors ────────────────────── */
.yRemoteSelection {
  /* background color is set per-user via injected CSS (.yRemoteSelection-{id}) */
}
.yRemoteSelectionHead {
  position: absolute;
  border-left: 2px solid;
  height: 100%;
  box-sizing: border-box;
  z-index: 10;
}
.yRemoteSelectionHead::after {
  /* content is set per-user via injected CSS (.yRemoteSelectionHead-{id}::after) */
  position: absolute;
  top: -1.4em;
  left: -2px;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px 3px 3px 0;
  white-space: nowrap;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  z-index: 20;
}
/* Show name label on hover over the cursor line */
.yRemoteSelectionHead:hover::after {
  opacity: 1;
}

/* ── IDE: Collab User Avatars ──────────────────────── */
#collab-users {
  display: flex;
  align-items: center;
}
.collab-live-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 4px;
  flex-shrink: 0;
  animation: glowPulse 2s ease-in-out infinite;
  cursor: default;
}
.collab-user-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--surface-2);
  flex-shrink: 0;
  cursor: default;
  position: relative;
  z-index: 1;
  transition: transform 150ms ease;
}
.collab-user-dot:hover {
  transform: scale(1.2);
  z-index: 2;
}

/* ── IDE: Collaborator Panel ───────────────────────── */
.collab-share-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 4px;
  border-radius: 4px;
  transition: background 120ms ease;
}
.collab-share-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.collab-share-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #a78bfa;
  background: rgba(124, 92, 252, 0.15);
  flex-shrink: 0;
  object-fit: cover;
}
img.collab-share-avatar {
  border: none;
}
.collab-share-name {
  font-size: 10px;
  color: #d1d5db;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collab-share-perm {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}
.collab-perm-toggle {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 120ms ease;
}
.collab-perm-read,
.collab-share-perm.collab-perm-read {
  background: rgba(156, 163, 175, 0.12);
  color: #9ca3af;
}
.collab-perm-write,
.collab-share-perm.collab-perm-write {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}
.collab-perm-toggle:hover {
  filter: brightness(1.3);
}
.collab-share-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: all 120ms ease;
  flex-shrink: 0;
}
.collab-share-row:hover .collab-share-remove {
  opacity: 1;
}
.collab-share-remove:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

/* Roblox-style live user avatar strip */
.collab-live-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0;
}
.collab-live-avatar {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  flex-shrink: 0;
  cursor: default;
  transition: transform 150ms ease;
}
.collab-live-avatar:hover {
  transform: scale(1.15);
  z-index: 2;
}
.collab-live-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.collab-live-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.collab-live-online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--surface-2);
  animation: glowPulse 2s ease-in-out infinite;
}
.collab-user-img {
  object-fit: cover;
  padding: 0;
}

/* ── IDE: Thinking Block ────────────────────────────── */
.thinking-block {
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(139, 92, 246, 0.06);
  border-radius: 8px;
  margin: 6px 0;
  overflow: hidden;
}
.thinking-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: #a78bfa;
  user-select: none;
}
.thinking-header:hover {
  background: rgba(139, 92, 246, 0.08);
}
.thinking-header .thinking-chevron {
  width: 12px;
  height: 12px;
  transition: transform 150ms ease;
}
.thinking-header .thinking-chevron.open {
  transform: rotate(90deg);
}
.thinking-body {
  padding: 8px 10px;
  border-top: 1px solid rgba(139, 92, 246, 0.15);
  font-size: 11px;
  line-height: 1.5;
  color: #c4b5fd;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.thinking-body.open {
  display: block;
}

/* ── IDE: Thinking toggle states ────────────────────── */
#thinking-toggle[data-enabled="true"] {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.3);
}

/* ── IDE: Context Menu ──────────────────────────────── */
.context-menu {
  position: fixed;
  background: #1c1f26;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px;
  min-width: 120px;
  z-index: 100;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.context-menu-item {
  padding: 6px 10px;
  font-size: 11px;
  color: #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  transition: all 100ms ease;
}
.context-menu-item:hover {
  background: rgba(124, 92, 252, 0.15);
  color: #fff;
}
.context-menu-item.ctx-danger {
  color: #f87171;
}
.context-menu-item.ctx-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}
.context-menu-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 3px 4px;
}

/* ── Model Selector Dropdown ──────────────────────── */
.model-tier-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.model-tier-dot.tier-haiku { background: #34d399; }
.model-tier-dot.tier-sonnet { background: #a78bfa; }
.model-tier-dot.tier-opus { background: #f59e0b; }

.model-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 100ms ease;
}
.model-option:hover {
  background: rgba(255, 255, 255, 0.06);
}
.model-option.selected {
  background: rgba(124, 92, 252, 0.12);
}
.model-option-info {
  flex: 1;
  min-width: 0;
}
.model-option-name {
  font-size: 11px;
  font-weight: 500;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-option-stats {
  font-size: 9px;
  color: #6b7280;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.model-option-stats .stat-tokens {
  display: flex;
  align-items: center;
  gap: 2px;
}
.model-tier-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.model-tier-label.tier-haiku {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}
.model-tier-label.tier-sonnet {
  background: rgba(129, 140, 248, 0.12);
  color: #a78bfa;
}
.model-tier-label.tier-opus {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
.model-group-header {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
  padding: 6px 10px 3px;
}
.model-group-header:not(:first-child) {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 2px;
  padding-top: 8px;
}
.model-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.model-thinking-badge {
  font-size: 7px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0px 4px;
  border-radius: 3px;
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
}

/* ── File Operation Cards ──────────────────────────── */
.file-op-card {
  border: 1px solid rgba(124, 92, 252, 0.25);
  background: rgba(124, 92, 252, 0.06);
  border-radius: 8px;
  margin: 8px 0;
  overflow: hidden;
}
.file-op-card.file-op-applied {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.06);
}
.file-op-card.file-op-dismissed {
  opacity: 0.5;
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}
.file-op-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(124, 92, 252, 0.15);
}
.file-op-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 500;
  color: #a78bfa;
}
.file-op-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.file-op-apply {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
  cursor: pointer;
  transition: all 100ms ease;
}
.file-op-apply:hover {
  background: rgba(34, 197, 94, 0.25);
}
.file-op-apply:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.file-op-dismiss {
  font-size: 9px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #6b7280;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 100ms ease;
}
.file-op-dismiss:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #9ca3af;
}
.file-op-preview {
  margin: 0;
  padding: 8px 10px;
  font-size: 10px;
  line-height: 1.5;
  color: #d1d5db;
  background: transparent;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.file-op-preview code {
  font-size: 10px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Per-message token badge ────────────────────────── */
.msg-token-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: #4b5563;
  margin-top: 4px;
}
.msg-token-badge svg {
  width: 10px;
  height: 10px;
}

/* ── IDE: Drag-drop overlay ─────────────────────────── */
.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(124, 92, 252, 0.1);
  border: 2px dashed rgba(124, 92, 252, 0.4);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
}
.drop-overlay span {
  color: #a78bfa;
  font-size: 14px;
  font-weight: 500;
}

/* ── Message Builder: two-column layout ───────────── */
.msg-builder-columns {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.msg-builder-editor {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.msg-builder-preview {
  flex: 1;
  min-width: 0;
  position: sticky;
  top: 2rem;
}
@media (max-width: 1100px) {
  .msg-builder-columns {
    flex-direction: column;
  }
  .msg-builder-preview {
    position: static;
  }
}

/* ── Live Preview panel ───────────────────────────── */
#live-preview img {
  display: block;
}
#live-preview img[src=""] {
  display: none;
}

/* ── Page title — gradient text ────────────────────── */
.page-title {
  background: linear-gradient(135deg, #7c5cfc, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.375rem;
  font-weight: 700;
}

/* ── Page subtitle ─────────────────────────────────── */
.page-subtitle {
  color: #6b7280;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

/* ── Section title — left accent bar ───────────────── */
.section-title {
  position: relative;
  padding-left: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #7c5cfc, #3b82f6);
}

/* ── Modal backdrop — frosted glass ────────────────── */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Modal panel — frosted glass ───────────────────── */
.modal-panel {
  background: rgba(23, 26, 34, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 92, 252, 0.12);
  border-radius: 0.75rem;
  box-shadow: 0 0 30px rgba(124, 92, 252, 0.06), 0 24px 48px -12px rgba(0, 0, 0, 0.5);
}

/* ── Empty state ───────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
}
.empty-state svg {
  filter: drop-shadow(0 0 8px rgba(124, 92, 252, 0.3));
}

/* ── Focus-visible rings ───────────────────────────── */
:focus-visible {
  outline: 2px solid rgba(124, 92, 252, 0.5);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* ── Skeleton loading shimmer ──────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 0.375rem;
}
.skeleton-text {
  height: 0.75rem;
  width: 60%;
  margin-bottom: 0.5rem;
}
.skeleton-text-sm {
  height: 0.5rem;
  width: 40%;
}
.skeleton-circle {
  border-radius: 50%;
}

/* ── Custom select chevron ─────────────────────────── */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem !important;
}

/* ── Smooth value transitions ──────────────────────── */
.value-transition {
  transition: color 300ms ease;
}

/* ── Stale data indicator ──────────────────────────── */
.stale-indicator {
  animation: glowPulse 1.5s ease-in-out infinite;
  color: var(--warn);
}

/* ── Log level colors ──────────────────────────────── */
.log-error { color: #f87171; }
.log-warn { color: #fbbf24; }
.log-info { color: #60a5fa; }
.log-debug { color: #9ca3af; }
.log-timestamp { color: #6b7280; }

/* ── Confirm modal ─────────────────────────────────── */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-modal .modal-backdrop {
  position: absolute;
  inset: 0;
}
.confirm-modal .modal-panel {
  position: relative;
  width: 100%;
  max-width: 24rem;
  padding: 1.5rem;
}
.confirm-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.confirm-icon-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}
.confirm-icon-warn {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

/* ── Fluid Dropdown ───────────────────────────────── */
.fluid-dropdown {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.fluid-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  background: var(--surface-3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-secondary);
  font: inherit;
  font-size: inherit;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, color 150ms ease;
  outline: none;
  text-align: left;
  min-width: 0;
}
.fluid-dropdown-trigger:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}
.fluid-dropdown-trigger:focus-visible {
  border-color: rgba(124, 92, 252, 0.4);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.12);
}
.fluid-dropdown.open .fluid-dropdown-trigger {
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--surface-4);
  color: var(--text-primary);
}

.fluid-dropdown-trigger-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.fluid-dropdown-trigger-icon svg {
  width: 14px;
  height: 14px;
}

.fluid-dropdown-trigger-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fluid-dropdown-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
.fluid-dropdown.open .fluid-dropdown-chevron {
  transform: rotate(180deg);
}

/* Panel */
.fluid-dropdown-panel {
  position: absolute;
  left: 0;
  min-width: 260px;
  top: 100%;
  margin-top: 6px;
  background: var(--surface-3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  z-index: var(--z-dropdown);
  overflow: hidden;

  /* Animate open/close */
  opacity: 0;
  transform: translateY(-4px) scaleY(0.96);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 180ms ease, transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
.fluid-dropdown.open .fluid-dropdown-panel {
  opacity: 1;
  transform: translateY(0) scaleY(1);
  pointer-events: auto;
}

/* Sliding highlight */
.fluid-dropdown-highlight {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
  transition: transform 280ms cubic-bezier(0.34, 1.4, 0.64, 1),
              height 280ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* Items */
.fluid-dropdown-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: color 150ms ease;
  z-index: 1;

  /* Stagger-in animation */
  opacity: 0;
  transform: translateY(-6px);
}
.fluid-dropdown-item.visible {
  opacity: 1;
  transform: translateY(0);
  transition: color 150ms ease,
              opacity 200ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
.fluid-dropdown-item:hover,
.fluid-dropdown-item.selected {
  color: var(--text-primary);
}

.fluid-dropdown-item-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  transition: transform 200ms ease;
}
.fluid-dropdown-item:hover .fluid-dropdown-item-icon {
  transform: scale(1.15);
}
.fluid-dropdown-item-icon svg {
  width: 16px;
  height: 16px;
}

.fluid-dropdown-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fluid-dropdown-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Prefers reduced motion ────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Material Editor — LiteGraph Theme Override ────── */
.litegraph.litecontextmenu {
  background: var(--surface-3) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  color: var(--text-primary) !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: 12px !important;
}
.litegraph.litecontextmenu .litemenu-entry {
  padding: 5px 12px !important;
  color: var(--text-secondary) !important;
  border-radius: 4px !important;
  margin: 1px 4px !important;
}
.litegraph.litecontextmenu .litemenu-entry:hover {
  background: rgba(124, 92, 252, 0.12) !important;
  color: #fff !important;
}
.litegraph.litecontextmenu .litemenu-entry.separator {
  border-color: rgba(255, 255, 255, 0.06) !important;
}
.lgraphcanvas { background-color: var(--surface-1) !important; }

.mat-palette-category {
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 6px;
}
.mat-palette-category:first-child { margin-top: 0; }
.mat-palette-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: grab;
  transition: all 120ms ease;
  user-select: none;
}
.mat-palette-item:hover {
  background: rgba(124, 92, 252, 0.08);
  color: var(--text-primary);
}
.mat-palette-item:active { cursor: grabbing; }
.mat-palette-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mat-prop-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}
.mat-prop-input {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-primary);
}
.mat-prop-input:focus {
  border-color: rgba(124, 92, 252, 0.4);
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 92, 252, 0.1);
}
.mat-prop-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mat-load-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 120ms ease;
  border: 1px solid transparent;
}
.mat-load-item:hover {
  background: rgba(124, 92, 252, 0.06);
  border-color: rgba(124, 92, 252, 0.15);
}
.mat-load-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: var(--surface-1);
  border: 1px solid rgba(255, 255, 255, 0.06);
  object-fit: cover;
}
.mat-load-item-info { flex: 1; min-width: 0; }
.mat-load-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mat-load-item-date {
  font-size: 10px;
  color: var(--text-muted);
}
#mat-3d-preview {
  background: #0a0b0f;
  display: block;
}
.mat-tex-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--surface-1);
  image-rendering: pixelated;
}
.mat-tex-preview-label {
  font-size: 8px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2px;
}
.mat-load-item-delete {
  padding: 4px;
  border-radius: 4px;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: all 120ms ease;
}
.mat-load-item:hover .mat-load-item-delete { opacity: 1; }
.mat-load-item-delete:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

.mat-template-item {
  padding: 6px 12px;
  color: #d1d5db;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.mat-template-item:hover {
  background: rgba(124, 92, 252, 0.15);
  color: #e5e7eb;
}

/* ── Responsive sidebar ────────────────────────────── */
@media (max-width: 768px) {
  aside.w-60 {
    transform: translateX(-100%);
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  aside.w-60.sidebar-open {
    transform: translateX(0);
  }
  main.ml-60 {
    margin-left: 0 !important;
  }
  .mobile-header {
    display: flex !important;
  }
}
