:root {
  --bg: #090e1f;
  --sidebar-bg: #0c1228;
  --card-bg: #111827;
  --surface: #161f38;
  --surface2: #1d2844;
  --border: #263052;
  --border-subtle: #1a2238;
  --primary: #7060f0;
  --primary-hover: #8070f5;
  --primary-glow: rgba(112,96,240,0.25);
  --teal: #00c9b1;
  --text: #e2e8f8;
  --text-muted: #7a85a0;
  --text-dim: #3a4560;
  --danger: #ff5c6b;
  --success: #4caf7d;
  --warning: #f0a500;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }

/* ── Login page ──────────────────────────────────────────────────────── */
.page-center {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: radial-gradient(ellipse at 50% 0%, #1a2050 0%, var(--bg) 70%);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow);
}

.card h1 { font-size: 22px; margin-bottom: 24px; font-weight: 700; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 6px;
  color: var(--text-muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

input, select, textarea {
  width: 100%; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 10px 14px; font-size: 14px;
  outline: none; transition: border-color 0.2s; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 100px; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 20px; border-radius: 8px; border: none;
  cursor: pointer; font-size: 14px; font-weight: 500;
  transition: all 0.2s; font-family: inherit; color: var(--text);
}

.btn-primary { background: var(--primary); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface2); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--primary); }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-icon { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 6px 10px; border-radius: 8px; }
.btn-icon:hover { border-color: var(--primary); color: var(--text); }

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

/* ── Icon rail ───────────────────────────────────────────────────────── */
.icon-rail {
  width: 56px; background: var(--sidebar-bg);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; flex-shrink: 0; gap: 0;
}

.rail-top { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-bottom: 8px; }

.rail-btn {
  position: relative; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 10px;
  color: var(--text-muted); cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0; min-width: auto;
}
.rail-btn:hover { background: var(--surface); color: var(--text); }
.rail-btn.active { background: rgba(112,96,240,0.18); color: var(--primary); }
.rail-btn.rail-logout:hover { background: rgba(255,92,107,0.1); color: var(--danger); }
.rail-hamburger { margin-bottom: 2px; }

.rail-divider {
  width: 28px; height: 1px;
  background: var(--border-subtle); margin: 4px 0 8px; flex-shrink: 0;
}

/* Tooltip on hover */
.rail-btn::after {
  content: attr(title); position: absolute;
  left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px;
  font-size: 12px; color: var(--text); white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.15s; z-index: 200;
}
.rail-btn:hover::after { opacity: 1; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  width: 270px; background: var(--sidebar-bg);
  display: flex; flex-direction: column; flex-shrink: 0;
  overflow: hidden; border-right: 1px solid var(--border-subtle);
  transition: width 0.2s ease;
}
.sidebar.collapsed { width: 0; border-right: none; }

.sidebar-top-label {
  padding: 18px 16px 10px;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
  flex-shrink: 0;
}

/* ── New item button ─────────────────────────────────────────────────── */
.new-item-btn {
  margin: 0 12px 14px; padding: 10px; background: transparent;
  border: 1px solid var(--primary); border-radius: 10px;
  color: var(--primary); cursor: pointer; text-align: center;
  font-size: 13px; font-weight: 500; transition: all 0.2s; user-select: none;
}
.new-item-btn:hover { background: var(--primary-glow); color: #fff; }

/* ── Sidebar sections ────────────────────────────────────────────────── */
.sidebar-section { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.sidebar-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 16px 8px; cursor: pointer; user-select: none;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
}
.sidebar-section-header:hover { color: var(--text); }
.sidebar-section-arrow { font-size: 10px; }

.sidebar-section-body { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.sidebar-list { overflow-y: auto; }

/* ── Sidebar items ───────────────────────────────────────────────────── */
.sidebar-item {
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; transition: background 0.15s;
}
.sidebar-item:hover { background: var(--surface2); }
.sidebar-item.active { background: var(--surface2); }

.sidebar-item-icon {
  width: 20px; text-align: center; color: var(--text-muted);
  font-size: 13px; flex-shrink: 0;
}

.sidebar-item-title {
  font-size: 13px; font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.sidebar-item-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.chat-delete-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 11px; padding: 2px 4px; border-radius: 4px; opacity: 0; flex-shrink: 0;
}
.sidebar-item:hover .chat-delete-btn { opacity: 1; }
.chat-delete-btn:hover { color: var(--danger); }

/* ── Scrollbar ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Main content ────────────────────────────────────────────────────── */
.main-content {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg); padding: 16px; min-width: 0;
}

.view-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

/* ── Main card ───────────────────────────────────────────────────────── */
.main-card {
  flex: 1; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden; min-height: 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.main-card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.main-card-title { font-size: 17px; font-weight: 600; }

.dots-menu-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 20px; padding: 2px 8px; border-radius: 6px; letter-spacing: 2px; line-height: 1;
}
.dots-menu-btn:hover { background: var(--surface2); color: var(--text); }

/* ── Dots dropdown ───────────────────────────────────────────────────── */
.dots-dropdown {
  position: absolute; right: 0; top: 100%; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px; min-width: 150px;
  box-shadow: var(--shadow); z-index: 100;
}
.dots-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: var(--text); transition: background 0.15s;
}
.dots-dropdown-item:hover { background: var(--surface2); }
.dots-dropdown-item.danger { color: var(--danger); }

/* ── Note card header title input ───────────────────────────────────── */
.note-card-title-input {
  font-size: 17px; font-weight: 600;
  background: transparent; border: none; outline: none;
  color: var(--text); padding: 0; width: 100%;
}
.note-card-title-input:focus { outline: none; border: none; }

/* ── Note tags row (between card header and format bar) ─────────────── */
.note-tags-row {
  padding: 8px 20px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap;
}

/* ── Format toolbar ──────────────────────────────────────────────────── */
.note-format-bar {
  display: flex; align-items: center; gap: 2px;
  padding: 8px 16px; border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0; flex-wrap: wrap;
}

.fmt-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 26px; padding: 0 5px;
  background: none; border: none; border-radius: 5px;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.fmt-btn:hover { background: var(--surface2); color: var(--text); }
.fmt-btn.fmt-active { background: var(--surface2); color: var(--text); box-shadow: inset 0 0 0 1px var(--primary); }

.fmt-divider { width: 1px; height: 16px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

/* ── Note layout ─────────────────────────────────────────────────────── */
.note-layout { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.note-header { padding: 14px 20px 12px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }

.note-title-input {
  font-size: 20px; font-weight: 600;
  background: transparent; border: none; border-radius: 0;
  padding: 0; width: 100%; color: var(--text);
}
.note-title-input:focus { outline: none; }

.note-meta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }

.note-body-fill {
  flex: 1; min-height: 0; resize: none; border: none; border-radius: 0;
  background: transparent; padding: 18px 20px; font-size: 15px;
  line-height: 1.7; color: var(--text);
}
.note-body-fill:focus { outline: none; }
.note-body-fill::placeholder { color: var(--text-dim); }
.note-body-fill[contenteditable]:empty::before {
  content: attr(data-placeholder); color: var(--text-dim); pointer-events: none;
}
.note-body-fill ol, .note-body-fill ul { padding-left: 24px; margin: 6px 0; }
.note-body-fill li { margin-bottom: 4px; }



.note-toolbar {
  padding: 10px 14px; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

.note-toolbar-btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted); cursor: pointer;
  font-size: 16px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.2s;
}
.note-toolbar-btn:hover { border-color: var(--primary); color: var(--text); }

/* ── Send / Save pill button ─────────────────────────────────────────── */
.send-pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; background: var(--primary);
  color: #fff; border: none; border-radius: 20px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
}
.send-pill-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.send-pill-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── Tags ────────────────────────────────────────────────────────────── */
.tag-input-area {
  display: flex; flex-wrap: wrap; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; min-height: 36px; flex: 1;
}

.tag {
  background: var(--primary); color: #fff; padding: 2px 10px;
  border-radius: 20px; font-size: 11px;
  display: flex; align-items: center; gap: 4px;
}

.tag-remove {
  cursor: pointer; opacity: 0.7; font-size: 13px; line-height: 1;
  background: none; border: none; color: #fff; padding: 0;
  min-width: auto; height: auto;
}
.tag-remove:hover { opacity: 1; }
.tag-ai { background: rgba(112,96,240,0.6); }

/* ── AI badge ────────────────────────────────────────────────────────── */
.ai-badge {
  font-size: 10px; color: var(--primary);
  background: rgba(112,96,240,0.15); border-radius: 4px; padding: 1px 5px;
}

/* ── Files section ───────────────────────────────────────────────────── */
.files-section {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; margin: 0 20px;
}

.file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--border-subtle);
}
.file-item:last-child { border-bottom: none; }

.file-status { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.file-status.processed { background: rgba(76,175,125,0.15); color: var(--success); }
.file-status.rejected  { background: rgba(255,92,107,0.15); color: var(--danger); }
.file-status.pending   { background: rgba(240,165,0,0.15);  color: var(--warning); }

/* ── Chat messages ───────────────────────────────────────────────────── */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 14px; min-height: 0;
}

.message { display: flex; gap: 10px; max-width: 80%; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }

.message-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; background: var(--surface2);
}
.message.user .message-avatar { background: var(--primary); }

.message-bubble {
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: 12px; padding: 10px 14px; line-height: 1.5; font-size: 14px;
}
.message.user .message-bubble { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Markdown inside assistant bubbles */
.message-bubble p { margin-bottom: 6px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble ol, .message-bubble ul { padding-left: 20px; margin: 6px 0; }
.message-bubble li { margin-bottom: 3px; }
.message-bubble strong { font-weight: 600; }
.message-bubble em { font-style: italic; }

.message-citations { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.citation {
  font-size: 11px; padding: 2px 10px;
  background: rgba(112,96,240,0.2); color: var(--primary);
  border-radius: 20px; cursor: pointer;
}
.citation:hover { background: rgba(112,96,240,0.35); }

/* ── Chat input pill ─────────────────────────────────────────────────── */
.chat-input-pill {
  margin: 0 16px 16px; padding: 8px 8px 8px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 28px; display: flex; align-items: center;
  gap: 8px; flex-shrink: 0; transition: border-color 0.2s;
}
.chat-input-pill:focus-within { border-color: var(--primary); }

.chat-input-pill textarea {
  flex: 1; border: none; background: transparent; padding: 2px 0;
  font-size: 14px; min-height: 24px; max-height: 100px;
  resize: none; color: var(--text);
}
.chat-input-pill textarea:focus { outline: none; border: none; }
.chat-input-pill textarea::placeholder { color: var(--text-muted); }

.icon-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 17px; padding: 4px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; min-width: auto; height: auto;
}
.icon-btn:hover { color: var(--text); }

/* ── Alerts ──────────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.alert-error   { background: rgba(255,92,107,0.1); border: 1px solid var(--danger); color: var(--danger); }
.alert-success { background: rgba(76,175,125,0.1); border: 1px solid var(--success); color: var(--success); }
.alert-warn    { background: rgba(240,165,0,0.1);  border: 1px solid var(--warning); color: var(--warning); }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 12px;
  color: var(--text-muted); text-align: center;
}
.empty-state .icon { font-size: 48px; }
.empty-chat-icon { font-size: 72px; }

/* ── Admin table ─────────────────────────────────────────────────────── */
.main-body { flex: 1; overflow-y: auto; padding: 24px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--text-muted); font-weight: 500; }
tr:hover td { background: var(--surface2); }

/* ── Loading dots ────────────────────────────────────────────────────── */
.dots::after { content: ''; animation: dots 1.2s steps(4,end) infinite; }
@keyframes dots {
  0%,20% { content: ''; } 40% { content: '.'; } 60% { content: '..'; } 80%,100% { content: '...'; }
}

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

/* ── Custom modal (replaces alert/confirm/prompt) ────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

.modal-box {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px 28px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow); animation: slideUp 0.15s ease;
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.modal-msg { font-size: 14px; line-height: 1.5; margin-bottom: 20px; color: var(--text); }
.modal-content {
  font-size: 13px; max-height: 260px; overflow-y: auto;
  margin-bottom: 18px; color: var(--text-muted); line-height: 1.6;
}
.modal-input { margin-bottom: 18px; background: var(--surface2); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Settings view ───────────────────────────────────────────────────── */
.settings-body {
  flex: 1; overflow-y: auto; padding: 28px 32px;
  display: flex; flex-direction: column; gap: 20px;
}
.account-columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.account-section-header {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding-bottom: 6px; border-bottom: 1px solid var(--border-subtle);
  margin-top: 4px;
}
.settings-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted); padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px;
}
.settings-msg { font-size: 12px; min-height: 16px; flex: 1; }

/* Account identity header */
.account-identity {
  display: flex; align-items: center; gap: 16px;
  padding: 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.account-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0; letter-spacing: 0.5px;
}
.account-name { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.account-email { font-size: 13px; color: var(--text-muted); }

/* Settings cards */
.settings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.settings-card-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted);
  padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle);
}
.settings-card .field { margin-bottom: 0; }
.settings-card-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; margin-top: 4px;
}

/* Usage card header */
.usage-card-header {
  display: flex; align-items: baseline; justify-content: space-between;
}
.usage-renew-label {
  font-size: 12px; color: var(--text-muted);
}
.usage-numbers {
  display: flex; flex-direction: column; justify-content: center;
}

/* Budget bar */
.budget-bar-wrap { display: flex; flex-direction: column; gap: 6px; }
.budget-bar-track {
  height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden;
}
.budget-bar-fill {
  height: 100%; border-radius: 3px; background: var(--primary);
  transition: width 0.4s ease;
}
.budget-bar-labels {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
}

/* ── Admin view ──────────────────────────────────────────────────────── */
.admin-body {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
  padding: 20px 24px;
}
.admin-stats { display: flex; gap: 12px; flex-shrink: 0; }
.admin-stat-card {
  flex: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.admin-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.admin-stat-value { font-size: 22px; font-weight: 700; }
.admin-users-panel { display: flex; flex-direction: column; gap: 8px; }
.admin-table-wrap { overflow-x: auto; }
.admin-agent-panel { display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }

/* ── Toggle switch ───────────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--surface2); border-radius: 20px; transition: 0.2s;
}
.toggle-slider::before {
  position: absolute; content: ''; height: 14px; width: 14px;
  left: 3px; bottom: 3px; background: var(--text-muted);
  border-radius: 50%; transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: rgba(112,96,240,0.35); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); background: var(--primary); }

/* ── Utilities ───────────────────────────────────────────────────────── */
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.ml-auto { margin-left: auto; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }
