/* VB Platform Design System, extracted from mockup-platform.html */

:root {
  /* Brand */
  --brand-900: #0E2530;
  --brand-800: #132F3C;
  --brand: #1A3A4A;
  --brand-600: #255062;
  --brand-500: #35687E;
  --brand-300: #8FAFBD;

  /* Light theme */
  --paper: #fcfcfc;
  --paper-2: #f4f4f4;
  --paper-3: #ececec;
  --surface: #FFFFFF;
  --surface-2: #ffffff;
  --ink-900: #16222A;
  --ink-800: #223039;
  --ink-700: #3B4A53;
  --ink-500: #6A7780;
  --ink-400: #8B96A0;
  --ink-300: #B0B9C0;
  --line: rgba(26, 58, 74, 0.1);
  --line-strong: rgba(26, 58, 74, 0.2);

  /* Data */
  --green: #10B981;
  --green-ink: #047857;
  --green-bg: rgba(16, 185, 129, 0.08);
  --red: #EF4444;
  --red-ink: #B91C1C;
  --red-bg: rgba(239, 68, 68, 0.08);
  --amber: #F59E0B;
  --amber-ink: #B45309;
  --amber-bg: rgba(245, 158, 11, 0.1);

  /* Phase */
  --p-accel: #10B981;
  --p-accum: #EAB308;
  --p-distr: #F97316;
  --p-decel: #EF4444;

  --serif: 'Inter', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --sidebar-w: 232px;
}

/* Dark mode */
html.dark {
  --paper: #0F1619;
  --paper-2: #131B1F;
  --paper-3: #182127;
  --surface: #161F24;
  --surface-2: #1B262C;
  --ink-900: #EDE8DE;
  --ink-800: #D8D2C6;
  --ink-700: #A8B2B8;
  --ink-500: #7A858C;
  --ink-400: #5E686F;
  --ink-300: #3E464C;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --brand: #5A9BB0;
  --brand-500: #8FAFBD;
  --green-bg: rgba(16, 185, 129, 0.12);
  --red-bg: rgba(239, 68, 68, 0.12);
  --amber-bg: rgba(245, 158, 11, 0.14);
}

/* Reset within platform */
.vbd-platform * { box-sizing: border-box; }
.vbd-platform {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01';
  line-height: 1.5;
  min-height: 100vh;
}

/* Typography helpers */
.vbd-platform .mono { font-family: var(--mono); font-feature-settings: 'zero'; }
.vbd-platform .serif { font-family: var(--serif); }

/* App shell */
.vbd-platform .app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.vbd-platform .sidebar {
  border-right: 1px solid var(--line);
  background: var(--paper);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.vbd-platform .main { min-width: 0; display: flex; flex-direction: column; }

.vbd-platform .topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 24px;
  background: rgba(250, 247, 242, 0.8);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
html.dark .vbd-platform .topbar { background: rgba(15, 22, 25, 0.8); }
/* Dark mode: the wordmark logo is dark text, so invert it to white so
   "VOLATILITY" stays legible on the dark topbar/sidebar. */
html.dark .vbd-platform .sb-logo-full,
html.dark .vbd-platform .vbd-v2-mobile-brand img,
body[data-theme="dark"] .sb-logo-full,
body[data-theme="dark"] .vbd-v2-mobile-brand img,
.vbd-platform.dark .sb-logo-full,
.vbd-platform.dark .vbd-v2-mobile-brand img { filter: brightness(0) invert(1); }
.vbd-platform .content { padding: 32px; max-width: 1400px; width: 100%; }

/* Sidebar bits */
.vbd-platform .sb-logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; }
.vbd-platform .sb-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--brand); color: #F4EFE7;
  display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 17px; font-weight: 500; line-height: 1;
}
.vbd-platform .sb-name { font-family: var(--serif); font-size: 17px; letter-spacing: -0.01em; font-weight: 500; color: var(--ink-900); white-space: nowrap; }
.vbd-platform .sb-section { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-500); padding: 14px 10px 6px; }
.vbd-platform .sb-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--ink-700);
  cursor: pointer;
  user-select: none;
  border: none; background: transparent;
  text-align: left; width: 100%;
  font-family: inherit;
}
.vbd-platform .sb-item:hover { background: rgba(26,58,74,0.04); color: var(--ink-900); }
html.dark .vbd-platform .sb-item:hover { background: rgba(255,255,255,0.04); }
.vbd-platform .sb-item.active { background: rgba(26,58,74,0.08); color: var(--ink-900); font-weight: 500; }
html.dark .vbd-platform .sb-item.active { background: rgba(255,255,255,0.06); }
.vbd-platform .sb-item .n { font-family: var(--mono); font-size: 10.5px; color: var(--ink-500); background: var(--paper-2); padding: 1px 6px; border-radius: 4px; }
.vbd-platform .sb-item.active .n { background: var(--brand); color: #F4EFE7; }

/* Cards */
.vbd-platform .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.vbd-platform .card-warm { background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; }

/* Phase chip */
.vbd-platform .phase {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.vbd-platform .phase .d { width: 6px; height: 6px; border-radius: 50%; }
.vbd-platform .phase-accel { background: rgba(16, 185, 129, 0.1); color: var(--green-ink); }
.vbd-platform .phase-accel .d { background: var(--p-accel); }
.vbd-platform .phase-accum { background: rgba(234, 179, 8, 0.12); color: #854D0E; }
.vbd-platform .phase-accum .d { background: var(--p-accum); }
.vbd-platform .phase-distr { background: rgba(249, 115, 22, 0.1); color: #9A3412; }
.vbd-platform .phase-distr .d { background: var(--p-distr); }
.vbd-platform .phase-decel { background: rgba(239, 68, 68, 0.1); color: var(--red-ink); }
.vbd-platform .phase-decel .d { background: var(--p-decel); }
html.dark .vbd-platform .phase-accel { color: #6EE7B7; }
html.dark .vbd-platform .phase-accum { color: #FDE68A; }
html.dark .vbd-platform .phase-distr { color: #FDBA74; }
html.dark .vbd-platform .phase-decel { color: #FCA5A5; }

/* Direction pill */
.vbd-platform .dir {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.04em;
}
.vbd-platform .dir-long { background: var(--green-bg); color: var(--green-ink); }
.vbd-platform .dir-short { background: var(--red-bg); color: var(--red-ink); }
html.dark .vbd-platform .dir-long { color: #6EE7B7; }
html.dark .vbd-platform .dir-short { color: #FCA5A5; }

.vbd-platform .eyebrow-mono {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-500);
}

.vbd-platform .h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; margin: 0; color: var(--ink-900); }
.vbd-platform .h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.15; letter-spacing: -0.01em; margin: 0; color: var(--ink-900); }
.vbd-platform .h2 em { font-style: italic; color: var(--brand-500); font-weight: 400; }

/* Buttons */
.vbd-platform .btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-900);
  cursor: pointer; font-family: inherit;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.vbd-platform .btn:hover { background: var(--paper-2); }
.vbd-platform .btn-primary { background: var(--brand); color: #F4EFE7; border-color: var(--brand); }
.vbd-platform .btn-primary:hover { background: var(--brand-800); }
.vbd-platform .btn-ghost { background: transparent; border-color: transparent; color: var(--ink-700); padding: 6px 8px; }
.vbd-platform .btn-ghost:hover { background: rgba(26,58,74,0.05); }
html.dark .vbd-platform .btn-ghost:hover { background: rgba(255,255,255,0.04); }

.vbd-platform .divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Input */
.vbd-platform .input {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 7px; padding: 6px 10px;
  font-family: var(--sans); font-size: 13px; color: var(--ink-900);
}
.vbd-platform .input:focus { outline: none; border-color: var(--brand-500); }

/* Utilities */
.vbd-platform .muted { color: var(--ink-500); }
.vbd-platform .num-pos { color: var(--green-ink); }
.vbd-platform .num-neg { color: var(--red-ink); }
html.dark .vbd-platform .num-pos { color: #6EE7B7; }
html.dark .vbd-platform .num-neg { color: #FCA5A5; }

.vbd-platform .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.vbd-platform .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.vbd-platform .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Chip */
.vbd-platform .chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 4px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
}

/* Segmented control */
.vbd-platform .seg { display: flex; gap: 4px; background: var(--paper-2); padding: 3px; border-radius: 8px; }
.vbd-platform .seg button {
  flex: 1; border: none; padding: 6px 12px; border-radius: 6px;
  font-size: 12px; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--ink-700); font-weight: 400;
}
.vbd-platform .seg button.on {
  background: var(--surface); color: var(--ink-900); font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

/* Preset pill */
.vbd-platform .preset-pill {
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px;
  cursor: pointer; font-family: inherit; font-weight: 400;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-700);
}
.vbd-platform .preset-pill.active {
  border-color: var(--brand); background: var(--brand); color: #F4EFE7; font-weight: 500;
}

/* Responsive */
@media (max-width: 960px) {
  .vbd-platform .app { grid-template-columns: 1fr; }
  /* !important so it beats the later ".vbd-platform .sidebar{display:flex}" base rule.
     Scanner-v2 re-enables the sidebar as an off-canvas drawer with its own later !important. */
  .vbd-platform .sidebar { display: none !important; }
  .vbd-platform .mobile-nav { display: flex !important; }
  .vbd-platform .content { padding: 20px; }
  .vbd-platform .topbar { padding: 12px 20px; }
  .vbd-platform .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .vbd-platform .grid-4 { grid-template-columns: 1fr; }
  .vbd-platform .grid-3 { grid-template-columns: 1fr; }
  .vbd-platform .grid-2 { grid-template-columns: 1fr; }
}

/* Mobile bottom tab bar */
.vbd-platform .mobile-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
html.dark .vbd-platform .mobile-nav { background: rgba(15, 22, 25, 0.95); }
.vbd-platform .mobile-nav button {
  flex: 1; border: none; background: transparent;
  padding: 6px 4px; font-size: 10.5px;
  color: var(--ink-500); font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.vbd-platform .mobile-nav button.active { color: var(--ink-900); font-weight: 500; }

/* Scrollbar */
.vbd-platform ::-webkit-scrollbar { width: 10px; height: 10px; }
.vbd-platform ::-webkit-scrollbar-track { background: transparent; }
.vbd-platform ::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid var(--paper); }

/* Notifications */
.vbd-notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  transition: background 0.1s;
}
.vbd-notif-item:last-child { border-bottom: none; }
.vbd-notif-item:hover { background: var(--paper-2); }
.vbd-notif-new { background: rgba(26,58,74,.03); }
.vbd-notif-icon { flex-shrink: 0; margin-top: 2px; }
.vbd-notif-title { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink-900); line-height: 1.4; }
.vbd-notif-body { font-family: var(--sans); font-size: 12px; color: var(--ink-600); line-height: 1.4; margin-top: 2px; }
.vbd-notif-time { font-family: var(--mono); font-size: 10px; color: var(--ink-400); margin-top: 4px; letter-spacing: .02em; }

/* Notification preferences */
.vbd-notif-pref {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.vbd-notif-pref:last-child { border-bottom: none; }

/* Toggle switch */
.vbd-toggle { position: relative; display: inline-block; width: 34px; height: 20px; cursor: pointer; }
.vbd-toggle input { opacity: 0; width: 0; height: 0; }
.vbd-toggle-track {
  position: absolute; inset: 0; border-radius: 10px;
  background: var(--ink-300); transition: background 0.2s;
}
.vbd-toggle-track::after {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.vbd-toggle input:checked + .vbd-toggle-track { background: var(--brand); }
.vbd-toggle input:checked + .vbd-toggle-track::after { transform: translateX(14px); }

/* Column settings dropdown */
.vbd-col-settings {
  position: absolute; top: 100%; right: 0; z-index: 70;
  width: 220px; margin-top: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.06);
  padding: 8px 0;
  display: none;
}
.vbd-col-settings.open { display: block; }
.vbd-col-settings-header {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-500);
  padding: 8px 14px 6px;
}
.vbd-col-settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px;
  font-family: var(--sans); font-size: 13px; color: var(--ink-900);
}
.vbd-col-settings-item:hover { background: var(--paper-2); }
.vbd-col-settings-item.disabled {
  color: var(--ink-400); pointer-events: none;
}
.vbd-col-settings-item.disabled .vbd-toggle { opacity: 0.35; }

/* ── Search autocomplete dropdown ── */
.vbd-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 90;
  overflow: hidden;
}
.vbd-search-item {
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-900);
  cursor: pointer;
  transition: background 0.1s;
}
.vbd-search-item:hover,
.vbd-search-item.active {
  background: var(--paper-2);
}
.vbd-search-item + .vbd-search-item {
  border-top: 1px solid var(--line);
}

/* Mobile scanner cards */
#vbd-scanner-cards { display: none; }

.vbd-mobile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  transition: background 0.1s, box-shadow 0.1s;
}
.vbd-mobile-card:hover { background: var(--paper-2); }
.vbd-mobile-card + .vbd-mobile-card { margin-top: 8px; }

.vbd-mobile-card__top {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px 8px;
}
.vbd-mobile-card__meta {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px 10px;
  font-family: var(--sans); font-size: 12px; color: var(--ink-500);
}
.vbd-mobile-card__signals {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}
.vbd-mobile-card__bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
}
.vbd-mobile-card__rr {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--ink-700); white-space: nowrap;
}
.vbd-mobile-card__score { flex: 1; min-width: 0; }

@media (max-width: 768px) {
  .vbd-platform .card:has(#vbd-scanner-table) { display: none !important; }
  #vbd-scanner-cards { display: block !important; }
}

/* Collapsed sidebar: 64px icon strip, hide labels */
.vbd-platform.sb-collapsed { --sidebar-w: 64px; }
.vbd-platform.sb-collapsed .sb-logo { padding: 6px 6px 18px; flex-direction: column; gap: 8px; align-items: stretch; }
.vbd-platform.sb-collapsed .sb-brand { display: none; }
.vbd-platform.sb-collapsed .sb-name,
.vbd-platform.sb-collapsed .sb-section,
.vbd-platform.sb-collapsed .sb-item span:not(.n) { display: none; }
.vbd-platform.sb-collapsed .sb-item { justify-content: center; padding: 7px 4px; }
.vbd-platform.sb-collapsed .sb-collapse { width: 100%; }
.vbd-platform.sb-collapsed .sidebar > div:last-child { padding: 8px 4px !important; }
.vbd-platform.sb-collapsed .sidebar > div:last-child > div { justify-content: center !important; }
.vbd-platform.sb-collapsed #vbd-theme-toggle { display: none !important; }
.vbd-platform.sb-collapsed .sb-user-meta { display: none !important; }
.vbd-platform.sb-collapsed .sidebar > div:last-child > div > div:last-child { display: none !important; }
/* Sidebar bottom block padding fix so user info isn't clipped */
.vbd-platform .sidebar { padding-bottom: 18px !important; }
.vbd-platform .sidebar > div[style*="border-top"] { padding-bottom: 18px !important; margin-bottom: 0 !important; }

/* Collapsed: 64px icon strip */
.vbd-platform.sb-collapsed { --sidebar-w: 64px; }
.vbd-platform.sb-collapsed .sb-logo { padding: 10px 6px 14px; flex-direction: column; gap: 8px; }
.vbd-platform.sb-collapsed .sb-logo-full { display: none; }
.vbd-platform.sb-collapsed .sb-logo-mark { display: none; }
.vbd-platform.sb-collapsed .sb-collapse-ic { transform: rotate(180deg); }
.vbd-platform.sb-collapsed .sb-section { display: none; }
.vbd-platform.sb-collapsed .sb-item { justify-content: center; padding: 8px 4px; }
.vbd-platform.sb-collapsed .sb-item span:not(.n) { display: none; }
.vbd-platform.sb-collapsed .sidebar > div:last-child { padding: 10px 4px 14px !important; }
.vbd-platform.sb-collapsed .sidebar > div:last-child > div { justify-content: center !important; gap: 0 !important; }
.vbd-platform.sb-collapsed .sidebar > div:last-child > div > div:last-child { display: none !important; }

/* Push the bottom user-info block + collapse button to the bottom */
.vbd-platform .sidebar > .sb-collapse-bottom,
.vbd-platform .sidebar > div:last-child { flex: 0 0 auto; }
.vbd-platform .sidebar > .sb-collapse-bottom { margin-top: auto; }

.vbd-platform .sb-logo {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 14px 16px;
  overflow: hidden;
}
.vbd-platform .sb-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  width: 100%;
  min-width: 0;
}
.vbd-platform .sb-logo-full {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  object-fit: contain;
}
.vbd-platform .sb-logo-mark { display: none; height: 30px; width: 30px; }

/* Bottom collapse button: full-width, sits above user info */
.vbd-platform .sb-collapse-bottom {
  display: flex; align-items: center; gap: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-500);
  font: 500 12.5px/1 var(--sans, system-ui);
  padding: 9px 12px;
  margin: 8px 12px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.vbd-platform .sb-collapse-bottom:hover { background: var(--paper-2); color: var(--ink-900); border-color: var(--line-strong); }
.vbd-platform .sb-collapse-bottom .sb-collapse-ic { transform: rotate(0); transition: transform .2s; }
.vbd-platform.sb-collapsed .sb-collapse-bottom .sb-collapse-ic { transform: rotate(180deg); }
.vbd-platform.sb-collapsed .sb-collapse-bottom .sb-collapse-lbl { display: none; }
.vbd-platform.sb-collapsed .sb-collapse-bottom { justify-content: center; padding: 9px 4px; margin: 8px 6px 10px; }

/* Collapsed sidebar: 64px icon strip */
.vbd-platform.sb-collapsed { --sidebar-w: 64px; }
.vbd-platform.sb-collapsed .sb-logo { padding: 12px 6px 14px; }
.vbd-platform.sb-collapsed .sb-logo-full { display: none; }
.vbd-platform.sb-collapsed .sb-logo-mark { display: none; }
.vbd-platform.sb-collapsed .sb-section { display: none; }
.vbd-platform.sb-collapsed .sb-item { justify-content: center; padding: 8px 4px; }
.vbd-platform.sb-collapsed .sb-item span:not(.n) { display: none; }
.vbd-platform.sb-collapsed .sidebar > div:last-child { padding: 10px 4px 12px !important; }
.vbd-platform.sb-collapsed .sidebar > div:last-child > div { justify-content: center !important; gap: 0 !important; }
.vbd-platform.sb-collapsed .sidebar > div:last-child > div > div:last-child { display: none !important; }

/* Collapsed: 64px icon strip */
.vbd-platform.sb-collapsed { --sidebar-w: 64px; }
.vbd-platform.sb-collapsed .sb-logo { padding: 12px 6px 14px; flex-direction: column; gap: 8px; }
.vbd-platform.sb-collapsed .sb-logo-full { display: none; }
.vbd-platform.sb-collapsed .sb-logo-mark { display: none; }
.vbd-platform.sb-collapsed .sb-section { display: none; }
.vbd-platform.sb-collapsed .sb-item { justify-content: center; padding: 8px 4px; }
.vbd-platform.sb-collapsed .sb-item span:not(.n) { display: none; }
.vbd-platform.sb-collapsed .sidebar > div:last-child { padding: 10px 4px 12px !important; }
.vbd-platform.sb-collapsed .sidebar > div:last-child > div { justify-content: center !important; gap: 0 !important; }
.vbd-platform.sb-collapsed .sidebar > div:last-child > div > div:last-child { display: none !important; }

/* === Sidebar: VB logo + inline collapse + nav icons === */
.vbd-platform .sidebar { display: flex; flex-direction: column; padding-bottom: 14px !important; }
.vbd-platform .sidebar > div:first-child.sb-logo { flex: 0 0 auto; }

.vbd-platform .sb-logo {
  display: flex !important;
  align-items: center;
  gap: 16px;
  padding: 14px 12px 16px 14px;
  overflow: hidden;
}
.vbd-platform .sb-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex: 0 1 auto;
  min-width: 0;
  margin-right: auto;
}
.vbd-platform .sb-logo-full { display: block; width: auto; height: 24px; max-width: 130px; object-fit: contain; }
.vbd-platform .sb-logo-mark { display: none; height: 28px; width: 28px; }

.vbd-platform .sb-collapse {
  background: transparent;
  border: 0;
  color: var(--ink-500);
  width: 28px; height: 28px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  padding: 0;
  transition: background .15s, color .15s;
}
.vbd-platform .sb-collapse:hover { background: var(--paper-2); color: var(--ink-900); }

/* Nav items: line icons + label */
.vbd-platform .sb-item {
  display: flex !important;
  align-items: center;
  gap: 11px;
  padding: 8px 14px;
  color: var(--ink-700);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: 0;
  position: relative;
}
.vbd-platform .sb-item:hover { background: var(--paper-2); color: var(--ink-900); }
.vbd-platform .sb-item.active { background: var(--paper-2); color: var(--ink-900); font-weight: 500; }
.vbd-platform .sb-item .sb-ic { flex-shrink: 0; color: var(--ink-500); }
.vbd-platform .sb-item.active .sb-ic { color: var(--brand); }
.vbd-platform .sb-item span { flex: 1 1 auto; min-width: 0; }
.vbd-platform .sb-item .n {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--brand);
  color: #F4EFE7;
  padding: 1px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Collapsed: 64px icon strip */
.vbd-platform.sb-collapsed { --sidebar-w: 64px; }
.vbd-platform.sb-collapsed .sb-logo { padding: 12px 6px 14px; flex-direction: column; gap: 8px; align-items: stretch; }
.vbd-platform.sb-collapsed .sb-brand { display: none; }
.vbd-platform.sb-collapsed .sb-logo-full { display: none; }
.vbd-platform.sb-collapsed .sb-logo-mark { display: none; }
.vbd-platform.sb-collapsed .sb-collapse { margin: 0 auto; }
.vbd-platform.sb-collapsed .sb-section { display: none; }
.vbd-platform.sb-collapsed .sb-item { justify-content: center; padding: 10px 4px; gap: 0; }
.vbd-platform.sb-collapsed .sb-item span { display: none; }
.vbd-platform.sb-collapsed .sb-item .n { position: absolute; top: 4px; right: 8px; padding: 0 4px; font-size: 9px; }
.vbd-platform.sb-collapsed .sidebar > div:last-child { padding: 10px 4px 12px !important; }
.vbd-platform.sb-collapsed .sidebar > div:last-child > div { justify-content: center !important; gap: 0 !important; padding: 6px 0 !important; }
.vbd-platform.sb-collapsed .sidebar > div:last-child > div > div:last-child { display: none !important; }

/* Mobile drawer: ignore sb-collapsed state (which is a desktop-only preference).
   Always show labels, sections, brand, user info, theme toggle inside the slide-in drawer. */
@media (max-width: 1024px) {
  .vbd-platform.sb-collapsed { --sidebar-w: 232px !important; }
  .vbd-platform.sb-collapsed .sb-brand { display: inline-flex !important; }
  .vbd-platform.sb-collapsed .sb-section { display: block !important; }
  .vbd-platform.sb-collapsed .sb-item span:not(.n) { display: inline !important; }
  .vbd-platform.sb-collapsed .sb-item { justify-content: flex-start !important; padding: 7px 14px !important; }
  .vbd-platform.sb-collapsed .sb-user-meta { display: block !important; }
  .vbd-platform.sb-collapsed #vbd-theme-toggle { display: inline-flex !important; }
  .vbd-platform.sb-collapsed .sb-logout { display: flex !important; }
}
.sb-logout:hover { background: var(--paper-2); color: var(--ink-900); }
