/* VoxMark Generated Stylesheet */
/* Author: Divyanshu Sinha      */

/* ═══════════════════════════════════════════════════
   VOXMARK — Design System
   Author: Divyanshu Sinha
═══════════════════════════════════════════════════ */

:root {
  --bg-base:    #0d0f18;
  --bg-surface: #13162a;
  --bg-panel:   #181c30;
  --bg-input:   #1e2238;
  --bg-hover:   #252a44;
  --bg-active:  #2d3354;

  --accent:     #7c6dff;
  --accent-dim: #5a50c0;
  --accent-glow:#7c6dff44;
  --accent2:    #38d9a9;
  --accent3:    #f59e0b;

  --text-primary:   #e8eaf6;
  --text-secondary: #9ea3c0;
  --text-muted:     #5c627a;
  --text-inverse:   #0d0f18;

  --border:     #252a44;
  --border-accent: #7c6dff55;

  --success: #22c55e;
  --warn:    #f59e0b;
  --error:   #ef4444;
  --info:    #3b82f6;

  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  --shadow-sm: 0 2px 8px #0008;
  --shadow-md: 0 4px 24px #0008;
  --shadow-lg: 0 8px 48px #000b;

  --topbar-h: 52px;
  --statusbar-h: 28px;
  --sidebar-w: 240px;
}

[data-theme="light"] {
  --bg-base:    #f5f6ff;
  --bg-surface: #ffffff;
  --bg-panel:   #f0f1ff;
  --bg-input:   #ffffff;
  --bg-hover:   #e8eaff;
  --bg-active:  #d8dbff;
  --text-primary:   #1a1d2e;
  --text-secondary: #4a4f6a;
  --text-muted:     #8a8fac;
  --border:     #dde0f0;
  --border-accent: #7c6dff55;
  --shadow-sm: 0 2px 8px #0001;
  --shadow-md: 0 4px 24px #0002;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: auto;
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  overflow: visible;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── TOPBAR ── */
#topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  user-select: none;
  position: relative;
  z-index: 50;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.topbar-logo-mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 0 12px var(--accent-glow);
}

.topbar-sep { flex: 1; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tb-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.tb-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-accent); }
.tb-btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.tb-btn.primary:hover { background: var(--accent-dim); }
.tb-btn-icon { background: none; border: none; color: var(--text-secondary); padding: 6px 8px; cursor: pointer; border-radius: var(--radius-sm); font-size: 16px; transition: all .15s; }
.tb-btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

.topbar-divider { width: 1px; height: 22px; background: var(--border); }

/* ── LAYOUT ── */
#layout {
  display: flex;
  height: calc(100vh - var(--topbar-h) - var(--statusbar-h));
}

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: width .2s ease;
}
#sidebar.collapsed { width: 0; border-right: none; }

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 14px 14px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
  transition: all .12s;
  border-left: 2px solid transparent;
}
.sidebar-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-item.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-glow); }
.sidebar-item-icon { font-size: 15px; flex-shrink: 0; width: 18px; text-align: center; }

.sidebar-divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ── VML CHEATSHEET ── */
.vml-ref-list {
  overflow-y: auto;
  flex: 1;
  padding: 0 0 8px;
}

.vml-ref-item {
  padding: 5px 14px;
  cursor: pointer;
  font-size: 12px;
}
.vml-ref-item code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--bg-panel);
  padding: 1px 5px;
  border-radius: 3px;
}
.vml-ref-item:hover { background: var(--bg-hover); }
.vml-ref-item p { color: var(--text-muted); font-size: 11px; margin-top: 1px; }

/* ── MAIN AREA ── */
#main {
  flex: 1;
  display: flex;
  min-width: 0;
  overflow: hidden;
}

/* ── EDITOR PANE ── */
#editor-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--border);
}

.pane-header {
  height: 36px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  flex-shrink: 0;
}
.pane-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.pane-actions { margin-left: auto; display: flex; gap: 4px; }

#editor {
  flex: 1;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.75;
  padding: 20px 24px;
  border: none;
  outline: none;
  resize: none;
  width: 100%;
  overflow-y: auto;
  tab-size: 2;
  caret-color: var(--accent);
  letter-spacing: 0.01em;
}
#editor::selection { background: var(--accent-glow); }
#editor:focus { box-shadow: none; }

/* ── DIVIDER ── */
#pane-divider {
  width: 5px;
  background: var(--border);
  cursor: col-resize;
  flex-shrink: 0;
  transition: background .15s;
  position: relative;
}
#pane-divider::after {
  content: '⋮';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 16px;
}
#pane-divider:hover, #pane-divider.dragging { background: var(--accent); }

/* ── PREVIEW PANE ── */
#preview-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#preview {
  flex: 1;
  overflow-y: auto;
  padding: 28px 40px;
  background: var(--bg-base);
  scroll-behavior: smooth;
}

/* ── STATUSBAR ── */
#statusbar {
  height: var(--statusbar-h);
  background: var(--accent);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  font-size: 12px;
  color: rgba(255,255,255,.85);
  font-weight: 500;
  user-select: none;
}
.status-sep { opacity: .4; }
.status-right { margin-left: auto; display: flex; gap: 14px; }
#render-indicator {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent2);
  margin-right: 4px;
  transition: background .3s;
}
#render-indicator.loading {
  background: var(--accent3);
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── PREVIEW / DOCUMENT TYPOGRAPHY ──
   Scoped to both #preview (live editor pane) and .vml-doc (standalone
   static-build output — see compiler.py's to_page()) so the two surfaces
   share identical block-level spacing instead of diverging. Without the
   .vml-doc alias, the static build's body had no matching selector for
   any of these rules; the global `* { margin: 0 }` reset above won, and
   every heading/paragraph/list/hr collapsed flush against its neighbor
   with zero vertical spacing. */
#preview, .vml-doc {
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-primary);
}

#preview .vml-h1, .vml-doc .vml-h1,
#preview .vml-h2, .vml-doc .vml-h2,
#preview .vml-h3, .vml-doc .vml-h3,
#preview .vml-h4, .vml-doc .vml-h4,
#preview .vml-h5, .vml-doc .vml-h5,
#preview .vml-h6, .vml-doc .vml-h6 {
  font-weight: 700;
  line-height: 1.25;
  margin: 1.6em 0 .6em;
  color: var(--text-primary);
  letter-spacing: -.02em;
  position: relative;
}
#preview .vml-h1, .vml-doc .vml-h1 { font-size: 2.1rem; }
#preview .vml-h2, .vml-doc .vml-h2 { font-size: 1.6rem; border-bottom: 1px solid var(--border); padding-bottom: .4em; }
#preview .vml-h3, .vml-doc .vml-h3 { font-size: 1.25rem; }
#preview .vml-h4, .vml-doc .vml-h4 { font-size: 1.05rem; }

.vml-heading-anchor {
  opacity: 0;
  text-decoration: none;
  color: var(--accent);
  font-size: .8em;
  margin-left: 8px;
  transition: opacity .15s;
}
#preview :is(h1,h2,h3,h4):hover .vml-heading-anchor,
.vml-doc :is(h1,h2,h3,h4):hover .vml-heading-anchor { opacity: 1; }

#preview p, .vml-doc p { margin: .75em 0; }
#preview a, .vml-doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
#preview a:hover, .vml-doc a:hover { color: var(--accent2); }
#preview strong, .vml-doc strong { font-weight: 700; color: var(--text-primary); }
#preview em, .vml-doc em { font-style: italic; color: var(--text-secondary); }
#preview ul, #preview ol, .vml-doc ul, .vml-doc ol { padding-left: 1.5em; margin: .5em 0; }
#preview li, .vml-doc li { margin: .3em 0; }
#preview hr.vml-hr, .vml-doc hr.vml-hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

.vml-inline-code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--bg-panel);
  color: var(--accent2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ── CODE BLOCKS ── */
.vml-code-wrap {
  background: #1a1d2e;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1em 0;
  box-shadow: var(--shadow-sm);
}
.vml-code-toolbar {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  background: #0f1120;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.vml-code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.vml-copy-btn {
  margin-left: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.vml-copy-btn:hover { background: var(--accent); color: #fff; border-color: transparent; }
.vml-copy-btn.copied { background: var(--success); color: #fff; border-color: transparent; }

.vml-code-block { margin: 0 !important; border-radius: 0 !important; }
.vml-code-block pre { padding: 16px 18px !important; font-family: var(--font-mono) !important; font-size: 13.5px !important; line-height: 1.65 !important; }

/* ── TABLES ── */
.vml-table-wrap { overflow-x: auto; margin: 1em 0; }
.vml-table { width: 100%; border-collapse: collapse; font-size: .95em; }
.vml-table th { background: var(--bg-panel); color: var(--accent); font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--accent-dim); font-size: .85em; text-transform: uppercase; letter-spacing: .06em; }
.vml-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.vml-table tr:hover td { background: var(--bg-hover); }

/* ── BLOCKQUOTE ── */
.vml-blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-panel);
  padding: 12px 18px;
  margin: 1em 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* ── VML WIDGETS ── */

/* Card */
.vml-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: .8em 0;
  transition: box-shadow .2s, border-color .2s;
}
.vml-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-accent); }
.vml-card-title {
  background: var(--bg-panel);
  padding: 10px 16px;
  font-weight: 700;
  font-size: .95em;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.vml-card-body { padding: 14px 16px; color: var(--text-secondary); }

/* Alert */
.vml-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin: .7em 0;
  border: 1px solid;
  font-size: .95em;
}
.vml-alert-icon { font-size: 1.1em; margin-top: 1px; flex-shrink: 0; }
.vml-alert-info  { background: #3b82f611; border-color: #3b82f633; color: #93c5fd; }
.vml-alert-info .vml-alert-icon { color: #3b82f6; }
.vml-alert-warn  { background: #f59e0b11; border-color: #f59e0b33; color: #fcd34d; }
.vml-alert-warn .vml-alert-icon { color: #f59e0b; }
.vml-alert-error { background: #ef444411; border-color: #ef444433; color: #fca5a5; }
.vml-alert-error .vml-alert-icon { color: #ef4444; }
.vml-alert-success { background: #22c55e11; border-color: #22c55e33; color: #86efac; }
.vml-alert-success .vml-alert-icon { color: #22c55e; }

/* Badge */
.vml-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .03em;
  vertical-align: middle;
}

/* Progress */
.vml-progress { margin: .8em 0; }
.vml-progress-label { font-size: 13px; color: var(--text-secondary); display: block; margin-bottom: 5px; font-weight: 500; }
.vml-progress-track {
  height: 8px;
  background: var(--bg-panel);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.vml-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px;
  width: 0;
  transition: width 1s cubic-bezier(.34,1.56,.64,1);
}
.vml-progress-pct { font-size: 12px; color: var(--text-muted); margin-left: 8px; }

/* Tabs */
.vml-tabs { margin: .8em 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.vml-tab-bar { display: flex; background: var(--bg-panel); border-bottom: 1px solid var(--border); overflow-x: auto; }
.vml-tab-btn {
  padding: 9px 18px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.vml-tab-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.vml-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.vml-tab-content { padding: 16px; }
.vml-tab-panel { display: none; }
.vml-tab-panel.active { display: block; }

/* Columns */
.vml-columns { display: flex; gap: 20px; margin: .8em 0; }
.vml-col { min-width: 0; }

/* Callout */
.vml-callout {
  display: flex;
  gap: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: .8em 0;
}
.vml-callout-icon { font-size: 1.3em; flex-shrink: 0; line-height: 1; margin-top: 1px; }
.vml-callout-text { color: var(--text-secondary); }

/* KBD */
.vml-kbd {
  display: inline-block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: .82em;
  color: var(--text-secondary);
  box-shadow: 0 1px 0 var(--border);
}
.vml-kbd-plus { color: var(--text-muted); font-size: .85em; }

/* Tooltip */
.vml-tooltip-wrap { position: relative; display: inline-block; cursor: help; border-bottom: 1px dashed var(--text-muted); }
.vml-tooltip-box {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-active);
  color: var(--text-primary);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 100;
  pointer-events: none;
}
.vml-tooltip-box::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
}
.vml-tooltip-wrap:hover .vml-tooltip-box,
.vml-tooltip-wrap:focus .vml-tooltip-box { display: block; }

/* Timeline */
.vml-timeline { position: relative; padding-left: 22px; margin: .8em 0; }
.vml-timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.vml-timeline-item { display: flex; gap: 14px; margin-bottom: 18px; position: relative; }
.vml-timeline-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-base);
  flex-shrink: 0;
  margin-top: 5px;
  position: relative;
  left: -22px;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.vml-timeline-content { flex: 1; margin-left: -10px; }
.vml-timeline-content strong { color: var(--text-primary); font-size: .95em; }
.vml-timeline-content p { color: var(--text-secondary); font-size: .9em; margin-top: 2px; }

/* Fold */
.vml-fold { margin: .8em 0; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.vml-fold-title {
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: .95em;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.vml-fold-title::before { content: '▶'; font-size: .75em; color: var(--accent); transition: transform .2s; }
.vml-fold[open] .vml-fold-title::before { transform: rotate(90deg); }
.vml-fold-body { padding: 14px 16px; border-top: 1px solid var(--border); }

/* Demo sandbox */
.vml-demo { margin: .8em 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.vml-demo-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: var(--bg-panel); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.vml-demo-run { background: var(--accent); color: #fff; border: none; padding: 4px 12px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; font-family: var(--font-sans); font-weight: 600; }
.vml-demo-split { display: flex; height: 200px; }
.vml-demo-src { flex: 1; background: var(--bg-base); color: var(--text-primary); border: none; border-right: 1px solid var(--border); font-family: var(--font-mono); font-size: 12.5px; padding: 10px; resize: none; outline: none; }
.vml-demo-frame { flex: 1; border: none; background: #fff; }

/* Math */
.vml-math { display: inline-block; }

/* Figure */
.vml-figure { margin: 1em 0; }
.vml-figure img { max-width: 100%; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.vml-figure figcaption { font-size: .88em; color: var(--text-muted); text-align: center; margin-top: 6px; }

/* Chart */
.vml-chart-wrap { margin: .8em 0; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.vml-chart { max-width: 100%; }

/* Error */
.vml-error { background: #ef444411; border: 1px solid #ef444433; color: #ef4444; padding: 8px 12px; border-radius: var(--radius-md); font-size: .9em; font-family: var(--font-mono); }

/* ── PANELS / MODALS ── */
#cmd-palette-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #0009;
  z-index: 200;
  backdrop-filter: blur(4px);
}
#cmd-palette-overlay.open { display: flex; align-items: flex-start; justify-content: center; padding-top: 15vh; }
#cmd-palette {
  width: min(560px, 90vw);
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
#cmd-input {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
}
#cmd-input::placeholder { color: var(--text-muted); }
.cmd-results { max-height: 340px; overflow-y: auto; padding: 8px; }
.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all .1s;
}
.cmd-item:hover, .cmd-item.selected { background: var(--bg-active); color: var(--text-primary); }
.cmd-item-icon { font-size: 16px; width: 20px; text-align: center; }
.cmd-item-kbd { margin-left: auto; font-size: 11px; color: var(--text-muted); background: var(--bg-panel); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); }

/* ── TOAST ── */
#toast-container { position: fixed; bottom: 40px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  animation: slideIn .2s ease;
  max-width: 320px;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── SCROLLBARS ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ── TASK LISTS ── */
#preview .task-list-item, .vml-doc .task-list-item { list-style: none; }
#preview .task-list-item input[type=checkbox], .vml-doc .task-list-item input[type=checkbox] { accent-color: var(--accent); margin-right: 6px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #sidebar { display: none; }
  #pane-divider { display: none; }
  #editor-pane, #preview-pane { flex: 1; }
}

/* ── LOADING OVERLAY ── */
#loading-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  transition: opacity .4s;
}
#loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loader-ring {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-label { font-size: 13px; color: var(--text-muted); }

/* ── MINI TOOLBAR IN EDITOR ── */
#editor-mini-toolbar {
  display: flex;
  gap: 2px;
  padding: 4px 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.mtb-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: all .12s;
  white-space: nowrap;
}
.mtb-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.mtb-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; align-self: center; }

/* ══════════════════════════════════════════
   VML — BUTTONS
══════════════════════════════════════════ */

.vml-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .18s cubic-bezier(.34,1.56,.64,1);
  user-select: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.vml-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.08);
  opacity: 0;
  transition: opacity .15s;
}
.vml-btn:hover::after { opacity: 1; }
.vml-btn:active { transform: scale(.97); }

.vml-btn-primary {
  background: linear-gradient(135deg, var(--accent), #9d50ff);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.vml-btn-primary:hover {
  box-shadow: 0 6px 20px var(--accent-glow);
  transform: translateY(-1px);
}
.vml-btn-secondary {
  background: var(--bg-active);
  color: var(--text-primary);
  border-color: var(--border);
}
.vml-btn-secondary:hover { background: var(--bg-hover); border-color: var(--accent); }

.vml-btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 14px #ef444440;
}
.vml-btn-danger:hover { box-shadow: 0 6px 20px #ef444455; transform: translateY(-1px); }

.vml-btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 4px 14px #22c55e40;
}
.vml-btn-success:hover { box-shadow: 0 6px 20px #22c55e55; transform: translateY(-1px); }

.vml-btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
}
.vml-btn-ghost:hover { background: var(--accent-glow); }

.vml-btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.vml-btn-outline:hover { background: var(--accent); color: #fff; }

.vml-btngroup {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: .6em 0;
}
.vml-btngroup-item { display: inline-flex; }

/* ══════════════════════════════════════════
   VML — HIGHLIGHTED / STYLED BOLD TEXT
══════════════════════════════════════════ */

mark.vml-hl {
  padding: 1px 4px;
  border-radius: 3px;
  font-style: normal;
}

.vml-b { display: inline; }

.vml-b-gradient {
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.vml-b-outline {
  -webkit-text-stroke: 1.5px var(--accent);
  color: transparent;
  font-weight: 800;
  letter-spacing: .02em;
}

.vml-b-shadow {
  font-weight: 800;
  text-shadow: 2px 2px 0 var(--accent), 4px 4px 0 var(--accent-dim);
}

.vml-b-neon {
  font-weight: 800;
  color: var(--accent2);
  text-shadow:
    0 0 6px var(--accent2),
    0 0 14px var(--accent2),
    0 0 30px var(--accent2);
}

.vml-b-stamp {
  font-weight: 900;
  color: var(--accent3);
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 2px solid var(--accent3);
  padding: 1px 6px;
  border-radius: 3px;
  opacity: .85;
}

.vml-b-underline {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.vml-b-strike {
  text-decoration: line-through;
  text-decoration-color: var(--error);
  text-decoration-thickness: 2px;
  opacity: .75;
}

.vml-b-mono {
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--bg-panel);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .9em;
}

/* ══════════════════════════════════════════
   VML — ICONS & SVG
══════════════════════════════════════════ */

.vml-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform .15s;
}
a:hover .vml-icon,
button:hover .vml-icon { transform: scale(1.1); }

.vml-svg-block {
  margin: .8em 0;
  display: flex;
  justify-content: center;
}
.vml-svg-block svg {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

/* Icon Card */
.vml-icon-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin: .7em 0;
  transition: border-color .2s, box-shadow .2s;
}
.vml-icon-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-sm);
}
.vml-icon-card-icon {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.vml-icon-card-title {
  font-weight: 700;
  font-size: .95em;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.vml-icon-card-desc {
  font-size: .88em;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ══════════════════════════════════════════
   VML — CSS WIDGETS
══════════════════════════════════════════ */

/* CSS block info pill */
.vml-css-block-info {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-panel);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  padding: 3px 12px 3px 6px;
  margin: .5em 0;
  font-size: 12px;
  color: var(--text-muted);
}
.vml-css-block-tag {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .07em;
  padding: 1px 7px;
  border-radius: 999px;
  text-transform: uppercase;
}
.vml-css-block-label { color: var(--text-muted); font-size: 11.5px; }

/* Inline style wrapper — no chrome, just the styles */
.vml-styled { /* user styles applied inline */ }

/* Custom class wrapper */
.vml-custom { /* user classes applied directly */ }

/* ── CSS Playground ── */
.vml-cssplay {
  margin: 1em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.vml-cssplay-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.vml-cssplay-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: .03em;
  white-space: nowrap;
}

.vml-cssplay-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-base);
  padding: 3px;
  border-radius: var(--radius-md);
  margin-left: auto;
}
.vml-cssplay-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 3px 12px;
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
}
.vml-cssplay-tab.active { background: var(--bg-active); color: var(--text-primary); }
.vml-cssplay-tab:hover:not(.active) { color: var(--text-secondary); }

.vml-cssplay-run {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 4px 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.vml-cssplay-run:hover { background: var(--accent-dim); }

.vml-cssplay-copy {
  background: var(--bg-active);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.vml-cssplay-copy:hover { background: var(--bg-hover); color: var(--text-primary); }

.vml-cssplay-bg-toggle {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.vml-cssplay-bg-toggle input { accent-color: var(--accent); cursor: pointer; }

.vml-cssplay-editors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  min-height: 180px;
  max-height: 300px;
}

.vml-cssplay-editor-wrap {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.vml-cssplay-editor-wrap:last-child { border-right: none; }

.vml-cssplay-editor-label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .07em;
  flex-shrink: 0;
}

.vml-cssplay-editor {
  flex: 1;
  background: var(--bg-base);
  color: var(--text-primary);
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  padding: 12px 14px;
  resize: none;
  tab-size: 2;
  caret-color: var(--accent);
  overflow-y: auto;
}
.vml-cssplay-editor::selection { background: var(--accent-glow); }

.vml-cssplay-preview-wrap {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.vml-cssplay-preview-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.vml-cssplay-preview {
  width: 100%;
  height: 200px;
  border: none;
  background: #fff;
  display: block;
}

/* ══════════════════════════════════════════
   VML — DIV / LAYOUT SYSTEM
══════════════════════════════════════════ */

.vml-div {
  margin: .6em 0;
}

/* Box variants */
.vml-box {
  margin: .8em 0;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
}
.vml-box-default {
  background: var(--bg-surface);
  border: 1px solid var(--border);
}
.vml-box-raised {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.vml-box-inset {
  background: var(--bg-base);
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 8px #0005;
}
.vml-box-glass {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px #0006;
}
.vml-box-gradient {
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  border: 1px solid var(--border-accent);
}
.vml-box-outline {
  background: transparent;
  border: 2px solid var(--accent);
}
.vml-box-dark {
  background: #0d0f18;
  border: 1px solid #252a44;
  color: #e8eaf6;
}
.vml-box-light {
  background: #f8f9ff;
  border: 1px solid #dde0f0;
  color: #1a1d2e;
}

/* Hero */
.vml-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  border-radius: var(--radius-xl);
  margin: .8em 0;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.vml-hero > * { position: relative; z-index: 1; }

/* Grid */
.vml-grid {
  display: grid;
  margin: .8em 0;
}
.vml-grid-cell {
  min-width: 0;
}

/* Flex */
.vml-flex {
  display: flex;
  margin: .8em 0;
  flex-wrap: nowrap;
}
.vml-flex-item { min-width: 0; }

/* Section */
.vml-section {
  margin: 1.6em 0 1em;
}
.vml-section-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.vml-section-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.02em;
}
.vml-section-subtitle {
  font-size: .95rem;
  color: var(--text-secondary);
  margin-top: 3px;
}
.vml-section-body { padding-top: 4px; }

/* Center / Right alignment */
.vml-center { text-align: center; margin: .5em 0; }
.vml-right  { text-align: right;  margin: .5em 0; }

/* Divider variants */
.vml-divider { margin: 1.4em 0; }
.vml-divider-solid  { border: none; border-top: 1px solid var(--border); }
.vml-divider-dashed { border: none; border-top: 1px dashed var(--border); }
.vml-divider-dotted { border: none; border-top: 1px dotted var(--border); }
.vml-divider-gradient {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.vml-divider-dots, .vml-divider-stars {
  border: none;
  text-align: center;
  color: var(--text-muted);
  font-size: .9em;
  letter-spacing: .3em;
}

/* Spacer */
.vml-spacer { display: block; }

/* ══════════════════════════════════════════
   VML — GRAPH SYSTEM
══════════════════════════════════════════ */

.vml-graph-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: .8em 0;
  box-shadow: var(--shadow-sm);
}
.vml-graph { display: block; }

/* Graph Playground */
.vml-graphplay {
  margin: .8em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}
.vml-graphplay-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.vml-graphplay-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: auto;
}
.vml-graphplay-run {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 4px 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.vml-graphplay-run:hover { background: var(--accent-dim); }
.vml-graphplay-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 300px;
}
.vml-graphplay-editor-wrap {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.vml-graphplay-editor {
  flex: 1;
  font-size: 12px !important;
}
.vml-graphplay-preview {
  padding: 16px;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.vml-graphplay-error {
  margin-top: 8px;
  padding: 8px 10px;
  background: #ef444411;
  border: 1px solid #ef444433;
  color: #ef4444;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-mono);
}

/* ══════════════════════════════════════════
   VML — FANCY EMBED SYSTEM
══════════════════════════════════════════ */

.vml-embed {
  margin: .8em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.vml-embed-label {
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.vml-embed iframe {
  width: 100%;
  height: 360px;
  border: none;
  display: block;
}

.vml-embed-video iframe {
  aspect-ratio: 16/9;
  height: auto;
}

.vml-embed-spotify iframe {
  height: 152px !important;
}

.vml-embed-codepen iframe {
  height: 400px;
}

.vml-embed-map iframe {
  height: 300px;
}

.vml-embed-pdf iframe {
  height: 500px;
}

.vml-embed-site iframe {
  height: 380px;
}

.vml-embed-audio {
  padding: 12px 16px;
}
.vml-embed-audio audio { width: 100%; }

.vml-embed-link {
  padding: 6px 14px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.vml-embed-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.vml-embed-link a:hover { text-decoration: underline; }

.vml-embed-img {
  max-width: 100%;
  border-radius: var(--radius-md);
  display: block;
  margin: .5em 0;
}

/* ══════════════════════════════════════════
   VML — INPUTS & FORM CONTROLS
══════════════════════════════════════════ */

.vml-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: .75em 0;
}

.vml-input-label,
.vml-select-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.vml-input {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.vml-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.vml-input::placeholder { color: var(--text-muted); }

/* Range slider */
.vml-input-range-wrap .vml-range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vml-range {
  flex: 1;
  padding: 0;
  height: 4px;
  cursor: pointer;
  accent-color: var(--accent);
  border: none;
  background: transparent;
}
.vml-range-value {
  min-width: 36px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* Color picker */
.vml-input-color-wrap .vml-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vml-color-picker {
  width: 44px;
  height: 36px;
  padding: 2px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.vml-color-label {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Checkbox */
.vml-checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin: .4em 0;
  user-select: none;
}
.vml-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.vml-checkbox-box {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
  position: relative;
}
.vml-checkbox:checked + .vml-checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}
.vml-checkbox:checked + .vml-checkbox-box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}
.vml-checkbox:focus-visible + .vml-checkbox-box {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
.vml-checkbox-label {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Select / Dropdown */
.vml-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: .75em 0;
}
.vml-select-inner {
  position: relative;
  display: inline-block;
  width: 100%;
}
.vml-select {
  width: 100%;
  padding: 9px 36px 9px 13px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.vml-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.vml-select option {
  background: var(--bg-panel);
  color: var(--text-primary);
}
.vml-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  font-size: 11px;
}

/* ══════════════════════════════════════════
   VML — CONTROL FLOW  (if / else / ifelse)
══════════════════════════════════════════ */

/* ::if and ::else wrappers are invisible by default; JS shows the right one. */
.vml-if, .vml-else {
  display: none; /* overridden by inline JS at page-load */
}

/* ══════════════════════════════════════════
   VML — CLASS SYSTEM  (@ClassName.prop)
══════════════════════════════════════════ */

/* ::class_def emits a <meta> tag — invisible, no styling needed.
   The rule below just ensures it never accidentally displays. */
meta.vml-class-def { display: none !important; }

/* GitHub Repo Card */
.vml-embed-github {
  margin: .8em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  transition: border-color .2s, box-shadow .2s;
}
.vml-embed-github:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-sm);
}
.vml-gh-card { padding: 16px 18px; }
.vml-gh-loading { color: var(--text-muted); font-size: .9em; }
.vml-gh-error   { color: var(--error); font-size: .9em; }
.vml-gh-header  { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.vml-gh-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -.01em;
}
.vml-gh-name:hover { text-decoration: underline; }
.vml-gh-desc {
  font-size: .9em;
  color: var(--text-secondary);
  margin: 0 0 10px;
  line-height: 1.5;
}
.vml-gh-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .82em;
  color: var(--text-muted);
}
.vml-gh-lang { display: flex; align-items: center; gap: 5px; }
.vml-gh-lang-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent2);
  display: inline-block;
}
.vml-gh-stat { font-weight: 500; }

/* ══════════════════════════════════════════
   VML — FOOTER
══════════════════════════════════════════ */

.vml-footer {
  margin-top: 3em;
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg,
    var(--footer-accent, #7c6dff),
    #38d9a9, transparent) 1;
  background: linear-gradient(180deg, transparent, #0d0f1888);
}
.vml-footer-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 28px;
}
.vml-footer-cols {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.vml-footer-col {
  flex: 1;
  min-width: 160px;
}
.vml-footer-col > *:first-child { margin-top: 0; }
.vml-footer-center { text-align: center; }
.vml-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  max-width: 860px;
  margin: 0 auto;
}
.vml-footer-copy { font-weight: 500; }
.vml-footer-made { opacity: .6; }
.vml-footer-heart {
  color: #ef4444;
  display: inline-block;
  animation: vml-heartbeat 2s ease-in-out infinite;
}
@keyframes vml-heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.3); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.2); }
  70%       { transform: scale(1); }
}

/* ══════════════════════════════════════════
   VML — SIDEBAR
══════════════════════════════════════════ */

.vml-sidebar {
  position: fixed;
  top: 0; bottom: 0;
  z-index: 1000;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 32px #0008;
  display: flex;
  flex-direction: column;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.vml-sidebar[style*="right:0"] {
  border-right: none;
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 32px #0008;
}
.vml-sidebar-overlay {
  position: fixed; inset: 0;
  z-index: 999;
  background: #000a;
  backdrop-filter: blur(2px);
}
.vml-sidebar-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.vml-sidebar-title {
  font-weight: 700; font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: -.02em;
}
.vml-sidebar-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
  line-height: 1;
  transition: color .15s, background .15s;
}
.vml-sidebar-close:hover {
  color: var(--text-primary);
  background: var(--bg-panel);
}
.vml-sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 0;
}
.vml-sidebar-link {
  display: flex; align-items: center;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .9rem; font-weight: 500;
  transition: color .15s, background .15s, padding-left .15s, border-color .15s;
  border-left: 3px solid transparent;
}
.vml-sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-panel);
  border-left-color: var(--accent);
  padding-left: 24px;
}
.vml-sidebar-link.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-left-color: var(--accent);
}
.vml-sidebar-heading {
  padding: 8px 20px 4px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); margin-top: 8px;
}
.vml-sidebar-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 16px;
}
.vml-sidebar-widget { padding: 6px 16px; }
.vml-sidebar-toggle {
  position: fixed; top: 16px;
  z-index: 998;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px #0006;
  transition: color .15s, border-color .15s, transform .1s;
}
.vml-sidebar-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.08);
}
.vml-sidebar-toggle-icon { line-height: 1; }

/* ══════════════════════════════════════════
   VML — ROUTER
══════════════════════════════════════════ */

.vml-router { position: relative; }
.vml-router-nav {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.vml-router-nav-link {
  padding: 7px 16px; border-radius: 8px;
  font-size: .875rem; font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.vml-router-nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-panel);
}
.vml-router-nav-link.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.vml-router-body { min-height: 120px; }
.vml-router-page { animation: vml-page-in .2s ease; }
@keyframes vml-page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vml-router-empty {
  color: var(--text-muted); font-style: italic; padding: 1em 0;
}

/* ══════════════════════════════════════════
   VML — INCLUDE
══════════════════════════════════════════ */

.vml-include { display: contents; }
.vml-include-empty { display: block; }

/* ══════════════════════════════════════════
   PYGMENTS SYNTAX HIGHLIGHTING
══════════════════════════════════════════ */
</style>

<!-- Pygments CSS -->
<style>pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.vml-code-block .hll { background-color: #ffffcc }
.vml-code-block .c { color: #7F848E } /* Comment */
.vml-code-block .err { color: #ABB2BF } /* Error */
.vml-code-block .esc { color: #ABB2BF } /* Escape */
.vml-code-block .g { color: #ABB2BF } /* Generic */
.vml-code-block .k { color: #C678DD } /* Keyword */
.vml-code-block .l { color: #ABB2BF } /* Literal */
.vml-code-block .n { color: #E06C75 } /* Name */
.vml-code-block .o { color: #56B6C2 } /* Operator */
.vml-code-block .x { color: #ABB2BF } /* Other */
.vml-code-block .p { color: #ABB2BF } /* Punctuation */
.vml-code-block .ch { color: #7F848E } /* Comment.Hashbang */
.vml-code-block .cm { color: #7F848E } /* Comment.Multiline */
.vml-code-block .cp { color: #7F848E } /* Comment.Preproc */
.vml-code-block .cpf { color: #7F848E } /* Comment.PreprocFile */
.vml-code-block .c1 { color: #7F848E } /* Comment.Single */
.vml-code-block .cs { color: #7F848E } /* Comment.Special */
.vml-code-block .gd { color: #ABB2BF } /* Generic.Deleted */
.vml-code-block .ge { color: #ABB2BF } /* Generic.Emph */
.vml-code-block .ges { color: #ABB2BF } /* Generic.EmphStrong */
.vml-code-block .gr { color: #ABB2BF } /* Generic.Error */
.vml-code-block .gh { color: #ABB2BF } /* Generic.Heading */
.vml-code-block .gi { color: #ABB2BF } /* Generic.Inserted */
.vml-code-block .go { color: #ABB2BF } /* Generic.Output */
.vml-code-block .gp { color: #ABB2BF } /* Generic.Prompt */
.vml-code-block .gs { color: #ABB2BF } /* Generic.Strong */
.vml-code-block .gu { color: #ABB2BF } /* Generic.Subheading */
.vml-code-block .gt { color: #ABB2BF } /* Generic.Traceback */
.vml-code-block .kc { color: #E5C07B } /* Keyword.Constant */
.vml-code-block .kd { color: #C678DD } /* Keyword.Declaration */
.vml-code-block .kn { color: #C678DD } /* Keyword.Namespace */
.vml-code-block .kp { color: #C678DD } /* Keyword.Pseudo */
.vml-code-block .kr { color: #C678DD } /* Keyword.Reserved */
.vml-code-block .kt { color: #E5C07B } /* Keyword.Type */
.vml-code-block .ld { color: #ABB2BF } /* Literal.Date */
.vml-code-block .m { color: #D19A66 } /* Literal.Number */
.vml-code-block .s { color: #98C379 } /* Literal.String */
.vml-code-block .na { color: #E06C75 } /* Name.Attribute */
.vml-code-block .nb { color: #E5C07B } /* Name.Builtin */
.vml-code-block .nc { color: #E5C07B } /* Name.Class */
.vml-code-block .no { color: #E06C75 } /* Name.Constant */
.vml-code-block .nd { color: #61AFEF } /* Name.Decorator */
.vml-code-block .ni { color: #E06C75 } /* Name.Entity */
.vml-code-block .ne { color: #E06C75 } /* Name.Exception */
.vml-code-block .nf { color: #61AFEF; font-weight: bold } /* Name.Function */
.vml-code-block .nl { color: #E06C75 } /* Name.Label */
.vml-code-block .nn { color: #E06C75 } /* Name.Namespace */
.vml-code-block .nx { color: #E06C75 } /* Name.Other */
.vml-code-block .py { color: #E06C75 } /* Name.Property */
.vml-code-block .nt { color: #E06C75 } /* Name.Tag */
.vml-code-block .nv { color: #E06C75 } /* Name.Variable */
.vml-code-block .ow { color: #56B6C2 } /* Operator.Word */
.vml-code-block .pm { color: #ABB2BF } /* Punctuation.Marker */
.vml-code-block .w { color: #ABB2BF } /* Text.Whitespace */
.vml-code-block .mb { color: #D19A66 } /* Literal.Number.Bin */
.vml-code-block .mf { color: #D19A66 } /* Literal.Number.Float */
.vml-code-block .mh { color: #D19A66 } /* Literal.Number.Hex */
.vml-code-block .mi { color: #D19A66 } /* Literal.Number.Integer */
.vml-code-block .mo { color: #D19A66 } /* Literal.Number.Oct */
.vml-code-block .sa { color: #98C379 } /* Literal.String.Affix */
.vml-code-block .sb { color: #98C379 } /* Literal.String.Backtick */
.vml-code-block .sc { color: #98C379 } /* Literal.String.Char */
.vml-code-block .dl { color: #98C379 } /* Literal.String.Delimiter */
.vml-code-block .sd { color: #98C379 } /* Literal.String.Doc */
.vml-code-block .s2 { color: #98C379 } /* Literal.String.Double */
.vml-code-block .se { color: #98C379 } /* Literal.String.Escape */
.vml-code-block .sh { color: #98C379 } /* Literal.String.Heredoc */
.vml-code-block .si { color: #98C379 } /* Literal.String.Interpol */
.vml-code-block .sx { color: #98C379 } /* Literal.String.Other */
.vml-code-block .sr { color: #98C379 } /* Literal.String.Regex */
.vml-code-block .s1 { color: #98C379 } /* Literal.String.Single */
.vml-code-block .ss { color: #98C379 } /* Literal.String.Symbol */
.vml-code-block .bp { color: #E5C07B } /* Name.Builtin.Pseudo */
.vml-code-block .fm { color: #56B6C2; font-weight: bold } /* Name.Function.Magic */
.vml-code-block .vc { color: #E06C75 } /* Name.Variable.Class */
.vml-code-block .vg { color: #E06C75 } /* Name.Variable.Global */
.vml-code-block .vi { color: #E06C75 } /* Name.Variable.Instance */
.vml-code-block .vm { color: #E06C75 } /* Name.Variable.Magic */
.vml-code-block .il { color: #D19A66 } /* Literal.Number.Integer.Long */

:root {
  --: ;
  --brand: #7c6dff;
  --accent2: #38d9a9;
  --gap: 16px;
  --name: value;
}

/* :::css block */


/* :::css block */

.my-box {
  background: linear-gradient(135deg, #7c6dff22, #38d9a911);
  border: 1px solid #7c6dff44;
  border-radius: 12px;
  padding: 20px 24px;
}
.my-box h3 {
  color: #7c6dff;
  margin: 0 0 8px;
}


/* :::css block */

.my-box {
  background: linear-gradient(135deg, #7c6dff22, #38d9a911);
  border: 1px solid #7c6dff44;
  border-radius: 12px;
  padding: 20px 24px;
}
.my-box h3 {
  color: #7c6dff;
  margin: 0 0 8px;
}


/* :::cssplay CSS */

.card {
  background: linear-gradient(135deg, #7c6dff, #38d9a9);
  padding: 24px; border-radius: 16px; color: white;
}


/* :::cssplay CSS */

.card {
  background: linear-gradient(135deg, #7c6dff, #38d9a9);
  padding: 24px; border-radius: 16px; color: white;
}


/* :::css block */


/* :::css block */

.branded {
  border-left: 4px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}


/* :::css block */
…

/* :::cssplay CSS */
css\|\|html

.vml-gen-0 { display:flex;gap:12px;flex-wrap:wrap;margin:.5em 0 }

.vml-gen-1 { background:#7c6dff;color:#fff;padding:10px 18px;border-radius:10px;font-weight:700 }

.vml-gen-2 { background:#22c55e22;color:#22c55e;padding:10px 18px;border-radius:10px;border:1px solid #22c55e44 }

.vml-gen-3 { display:flex;gap:12px;flex-wrap:wrap;margin:.5em 0 }

.vml-gen-4 { background:#7c6dff;color:#fff;padding:10px 18px;border-radius:10px;font-weight:700 }

.vml-gen-5 { background:#22c55e22;color:#22c55e;padding:10px 18px;border-radius:10px;border:1px solid #22c55e44 }

.vml-gen-6 { css }
