/* ================================================================
   VanderBot 1.0 — app.css
   Consolidated from: base, layout, vb2-chat, vb-fix-final, mobile-structure-fix
   Do not patch this file — edit and recompile from source.
   ================================================================ */
/* ─────────────────────────────────────────────────────────────────────────────
   VanderBot 2.0 — Base
   Artiquity Ethos aesthetic: flat, editorial, linen, hairline rules.
   Replaces old glass/blob/purple base entirely.
   ───────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--vb-linen);
  color: var(--vb-graphite);
  font-family: var(--vb-font-sans);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Faint dot grid — the substrate */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--vb-grid);
  background-size: var(--vb-grid-size);
  opacity: 0.55;
}

/* Kill old blobs — gone */
.blobs, .blob, .blob-p, .blob-o, .blob-l { display: none !important; }

#root { position: relative; z-index: 1; min-height: 100dvh; }

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; text-align: left; }
a { color: var(--vb-sienna); text-decoration: none; }
a:hover { text-decoration: underline; }
input, textarea, select { font: inherit; color: inherit; }
textarea { resize: none; }

/* ── Headings — serif + sans weight contrast (Artiquity style) ── */
h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.1;
  color: var(--vb-graphite);
  letter-spacing: -0.02em;
}
h1 {
  font-family: var(--vb-font-serif);
  font-size: 48px;
  font-weight: 300;
  letter-spacing: -0.03em;
}
h2 {
  font-family: var(--vb-font-serif);
  font-size: 32px;
  font-weight: 300;
}
h3 {
  font-family: var(--vb-font-sans);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
h4 {
  font-family: var(--vb-font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

/* Weight contrast accent — light + medium in same headline */
h1 strong, h2 strong { font-weight: 500; }
h1 em, h2 em { font-style: italic; font-weight: 300; color: var(--vb-graphite-60); }

/* Artiquity "Your artwork is ready" style — large serif, weight contrast */
.display-serif {
  font-family: var(--vb-font-serif);
  font-size: 42px;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--vb-graphite);
}
.display-serif strong {
  font-weight: 500;
}

p { margin: 0; }

/* Labels / eyebrow */
.eyebrow, .label, .mono {
  font-family: var(--vb-font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vb-graphite-40);
}

/* ── Hairline dividers — the only structure ── */
.rule { border: none; border-top: 1px solid var(--vb-graphite-20); margin: 0; }
.rule-light { border: none; border-top: 1px solid var(--vb-graphite-08); margin: 0; }

/* ── Form controls — flat, no shadow, 1px border ── */
.input {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--vb-font-sans);
  font-size: 15px;
  color: var(--vb-graphite);
  background: var(--vb-linen);
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r3);
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--vb-graphite-60); }
.input::placeholder { color: var(--vb-graphite-40); }

/* ── Buttons — flat, editorial ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--vb-r3);
  font-family: var(--vb-font-sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.btn:active { opacity: 0.85; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Primary — dark ink fill */
.btn-primary {
  background: var(--vb-graphite);
  color: var(--vb-linen);
  border: 1px solid var(--vb-graphite);
}
.btn-primary:hover:not(:disabled) { background: var(--vb-graphite-mid); border-color: var(--vb-graphite-mid); }

/* Sienna CTA — matches Artiquity orange button */
.btn-cta {
  background: var(--vb-sienna);
  color: #fff;
  border: 1px solid var(--vb-sienna);
}
.btn-cta:hover:not(:disabled) { filter: brightness(1.08); }

/* Secondary — outlined */
.btn-secondary {
  background: transparent;
  color: var(--vb-graphite);
  border: 1px solid var(--vb-graphite-20);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--vb-graphite-60); }

/* Ghost */
.btn-ghost { background: transparent; color: var(--vb-graphite-60); }
.btn-ghost:hover:not(:disabled) { color: var(--vb-graphite); background: var(--vb-graphite-04); }

/* Danger */
.btn-danger { background: var(--vb-rust); color: #fff; border: 1px solid var(--vb-rust); }

/* Icon button */
.btn-icon {
  width: 34px; height: 34px; padding: 0;
  border-radius: var(--vb-r3);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Chips / badges — flat, hairline border ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r2);
  font-family: var(--vb-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vb-graphite-60);
  background: transparent;
}
.chip-sienna { border-color: var(--vb-sienna); color: var(--vb-sienna); }
.chip-sage   { border-color: var(--vb-sage);   color: var(--vb-sage); }
.chip-amber  { border-color: var(--vb-amber);  color: var(--vb-amber); }

/* ─── Glass overrides — kill glass entirely ── */
.glass-card, .glass-card-strong {
  background: var(--vb-linen-deep);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--vb-graphite-20);
  box-shadow: none;
  border-radius: var(--vb-r4);
}
.glass-pill {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--vb-linen-deep);
  border: 1px solid var(--vb-graphite-20);
  box-shadow: none;
}
.glass-icon-cell {
  background: var(--vb-linen-deep);
  border: 1px solid var(--vb-graphite-20);
  box-shadow: none;
  color: var(--vb-sienna);
}

/* Scrim — lighter, no blur */
.scrim {
  position: fixed; inset: 0;
  background: rgba(28, 26, 23, 0.35);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadein .12s ease-out;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes slidein-up { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.dialog {
  background: var(--vb-linen);
  border-radius: var(--vb-r4);
  border: 1px solid var(--vb-graphite-20);
  max-width: 880px;
  width: 100%;
  max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(28,26,23,0.18);
  animation: slidein-up .15s ease-out;
}
.dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--vb-graphite-20);
}
.dialog-body { flex: 1; overflow: auto; padding: 22px; }
.dialog-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--vb-graphite-20);
}

/* ── Scrollbar — minimal ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--vb-graphite-20); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--vb-graphite-40); }

/* ── Focus ── */
:focus-visible { outline: 1px solid var(--vb-sienna); outline-offset: 2px; border-radius: var(--vb-r2); }

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px;
  border: 1.5px solid var(--vb-graphite-20);
  border-top-color: var(--vb-graphite);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

/* ── Utility ── */
.hidden { display: none !important; }
.flex { display: flex; }
.column { flex-direction: column; }
.center { align-items: center; justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.grow { flex: 1 1 0; min-width: 0; min-height: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accent { color: var(--vb-sienna); }
.muted { color: var(--vb-graphite-40); }

@media (max-width: 768px) {
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
  .display-serif { font-size: 30px; }
}

/* ── layout.css ─────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────
   VanderBot 2.0 — Layout
   Artiquity aesthetic: linen sidebar, hairline borders, no shadows.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Shell ───────────────────────────────────────────────── */
.shell { display: flex; min-height: 100dvh; }

.shell-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--vb-linen-deep);
  border-right: 1px solid var(--vb-graphite-20);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

/* Resize handle — sits fully inside the sidebar's right edge so the whole
   width is a reliable drag target (a partly-offscreen handle only hovered). */
.sidebar-resize {
  position: absolute; top: 0; right: 0; width: 10px; height: 100%;
  cursor: col-resize; z-index: 30; touch-action: none;
}
.sidebar-resize::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 2px;
  background: transparent; transition: background .15s;
}
.sidebar-resize:hover::after, body.vb-resizing .sidebar-resize::after {
  background: var(--vb-sienna);
}
body.vb-resizing { cursor: col-resize; user-select: none; }

/* Collapse */
.sidebar-collapse {
  position: absolute; top: 14px; right: 10px; width: 24px; height: 24px;
  border-radius: var(--vb-r2); display: flex; align-items: center; justify-content: center;
  color: var(--vb-graphite-40); cursor: pointer; z-index: 25;
}
.sidebar-collapse:hover { background: var(--vb-graphite-08); color: var(--vb-graphite); }
.sidebar-collapse .icon-expand { display: none; }
.shell.collapsed .sidebar-collapse .icon-collapse { display: none; }
.shell.collapsed .sidebar-collapse .icon-expand { display: block; }

@media (min-width: 769px) {
  .shell.collapsed .shell-sidebar { width: 56px; }
  .shell.collapsed .sidebar-inner { padding: 14px 0; align-items: center; }
  .shell.collapsed .sidebar-brand { padding: 12px 10px; justify-content: center; width: 100%; cursor: pointer; }
  .shell.collapsed .sidebar-brand > div { display: none; }
  .shell.collapsed .sidebar-collapse { position: static; margin: 8px auto 0; width: 36px; height: 36px; }
  .shell.collapsed .sidebar-actions { padding: 10px 0 8px; }
  .shell.collapsed .sidebar-actions .btn { width: 36px; height: 36px; padding: 0; font-size: 0; justify-content: center; }
  .shell.collapsed .sidebar-nav.top { width: 100%; align-items: center; }
  .shell.collapsed .sidebar-nav.top .nav-item { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .shell.collapsed .sidebar-nav.top .label, .shell.collapsed .nav-count { display: none; }
  .shell.collapsed .sidebar-search,
  .shell.collapsed .sidebar-section-label,
  .shell.collapsed .sidebar-list,
  .shell.collapsed .sidebar-resize { display: none; }
  .shell.collapsed .sidebar-user { justify-content: center; padding: 10px 0; }
  .shell.collapsed .sidebar-user .meta { display: none; }
}

.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Sidebar internals ─────────────────────────────────────── */
.sidebar-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  min-height: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 4px 16px;
  border-bottom: 1px solid var(--vb-graphite-20);
  margin-bottom: 12px;
}
a.sidebar-brand { text-decoration: none; color: inherit; }
.sidebar-brand .sidebar-logo { display:block; width:auto; height:auto; max-height:60px; max-width:100%; }
.sidebar-brand .mark { width: 30px; height: 30px; display: inline-flex; flex-shrink: 0; }
.sidebar-brand .name {
  font-family: var(--vb-font-serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--vb-graphite);
}
.sidebar-brand .name em { font-style: normal; color: var(--vb-sienna); }
.sidebar-brand .sub {
  font-family: var(--vb-font-mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--vb-graphite-40);
  margin-top: 3px;
}

.sidebar-actions { padding: 0 2px 10px; display: flex; flex-direction: column; gap: 6px; }
.sidebar-actions .btn { width: 100%; }
.sidebar-actions .btn-primary {
  background: var(--vb-graphite);
  color: var(--vb-linen);
  border: 1px solid var(--vb-graphite);
  border-radius: var(--vb-r3);
}
.sidebar-actions .btn-primary:hover:not(:disabled) { background: var(--vb-graphite-mid); }

.sidebar-nav.top { margin: 0 0 6px; display: flex; flex-direction: column; gap: 1px; }
.sidebar-nav.top .nav-item { width: 100%; }
.sidebar-nav.top .nav-item.active {
  background: var(--vb-graphite-08);
  color: var(--vb-graphite);
}
.nav-count { margin-left: auto; font-family: var(--vb-font-mono); font-size: 10px; color: var(--vb-graphite-40); }

.sidebar-search { padding: 0 2px 8px; }

.sidebar-section-label {
  font-family: var(--vb-font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--vb-graphite-40);
  padding: 8px 6px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

/* Empty state for the Recent list — muted, italic, understated so it doesn't
   slam a big default-size line against the 9px section label above it. */
.conv-empty {
  font-family: var(--vb-font-sans);
  font-size: 12.5px;
  line-height: 1.5;
  font-style: italic;
  color: var(--vb-graphite-40);
  padding: 10px 8px 14px;
}

/* Nav items — flat text links */
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  font-size: 14px;
  color: var(--vb-graphite-60);
  cursor: pointer;
  border-radius: var(--vb-r3);
  transition: background .1s, color .1s;
  text-decoration: none;
}
.nav-item:hover { background: var(--vb-graphite-08); color: var(--vb-graphite); text-decoration: none; }
.nav-item.active { color: var(--vb-graphite); background: var(--vb-graphite-08); }
.nav-item svg { flex-shrink: 0; color: inherit; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

/* Conversation list items */
.conv-item {
  display: flex;
  flex-direction: column;
  padding: 7px 8px;
  border-radius: var(--vb-r3);
  cursor: pointer;
  transition: background .1s;
  border-left: 2px solid transparent;
  text-align: left !important;
  width: 100%;
}
.conv-item:hover { background: var(--vb-graphite-08); }
.conv-item.active {
  background: var(--vb-graphite-04);
  border-left-color: var(--vb-sienna);
}
.conv-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--vb-graphite);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-item-meta {
  font-family: var(--vb-font-mono);
  font-size: 10px;
  color: var(--vb-graphite-40);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Recents row = clickable title + hover ⋯ menu (Claude-style) */
.conv-row {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: var(--vb-r3);
}
.conv-row:hover { background: var(--vb-graphite-08); }
.conv-row.active { background: var(--vb-graphite-04); }
/* Hairline divider between recents rows; suppressed under the hover/active wash. */
.conv-row + .conv-row { border-top: 1px solid var(--vb-graphite-08); }
.conv-row.active, .conv-row:hover { border-top-color: transparent; }
.conv-row .conv-item {
  flex: 1;
  min-width: 0;
  display: block;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--vb-graphite);
}
.conv-row .conv-item:hover { background: transparent; }   /* row handles the hover bg */
.conv-menu-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-right: 4px;
  border: none;
  background: transparent;
  color: var(--vb-graphite-40);
  cursor: pointer;
  border-radius: var(--vb-r3);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .12s, background .12s, color .12s;
}
.conv-row:hover .conv-menu-btn { opacity: 1; }
.conv-menu-btn:hover { background: var(--vb-graphite-12, rgba(40,35,35,0.12)); color: var(--vb-graphite); }
.conv-menu {
  position: absolute;
  top: calc(100% - 2px);
  right: 4px;
  z-index: 60;
  min-width: 136px;
  background: var(--vb-linen, #fff);
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r3);
  box-shadow: 0 8px 24px rgba(28,26,23,0.16);
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.conv-menu-item {
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--vb-graphite);
  padding: 7px 10px;
  border-radius: 4px;
}
.conv-menu-item:hover { background: var(--vb-graphite-08); }
.conv-menu-item.danger { color: #B23A2A; }
.conv-menu-item.danger:hover { background: rgba(178,58,42,0.09); }
/* Touch devices have no hover — keep the ⋯ discoverable. */
@media (max-width: 768px) {
  .conv-menu-btn { opacity: 0.5; }
}

/* Workspace folders */
.ws-folder { margin-bottom: 1px; }
.ws-folder-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--vb-graphite);
  cursor: pointer;
  border-radius: var(--vb-r3);
  user-select: none;
}
.ws-folder-head:hover { background: var(--vb-graphite-08); }
.ws-folder-head .chev { color: var(--vb-graphite-40); font-size: 10px; transition: transform .15s; }
.ws-folder.open .ws-folder-head .chev { transform: rotate(90deg); }
.ws-folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-folder-count { font-family: var(--vb-font-mono); font-size: 10px; color: var(--vb-graphite-40); }
.ws-folder-body { padding-left: 12px; }

/* Sidebar user row */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px;
  border-top: 1px solid var(--vb-graphite-20);
  margin-top: auto;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--vb-graphite-20);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--vb-font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--vb-graphite);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user .meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  line-height: 1.25;
}
.sidebar-user .meta .uname {
  font-size: 13px; font-weight: 500; color: var(--vb-graphite);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.sidebar-user .meta .urole {
  font-family: var(--vb-font-mono);
  font-size: 10px; color: var(--vb-graphite-40);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}

/* ── Auth shell — boot/loading + error states ──────────────────
   The router paints `.auth-shell` (a centered spinner) while a view
   module loads, and login.js then replaces it with a full-screen
   `.login2`. Without an explicit full-viewport linen background here
   the spinner rendered top-left on a transparent box, so the swap to
   the login layout flashed/reflowed. Matching the login surface makes
   the boot → sign-in transition seamless. */
.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--vb-s4);
  padding: var(--vb-s6);
  background: var(--vb-linen);
}

/* ── Auth page ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--vb-s6);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--vb-linen);
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r4);
  padding: var(--vb-s8) var(--vb-s8);
}
.auth-card .auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--vb-s8);
}
.auth-card h2 {
  font-family: var(--vb-font-serif);
  font-size: 26px;
  font-weight: 300;
  margin-bottom: var(--vb-s2);
}
.auth-card p {
  font-size: 14px;
  color: var(--vb-graphite-60);
  margin-bottom: var(--vb-s6);
}
.auth-card .field { margin-bottom: var(--vb-s4); }
.auth-card .field label {
  display: block;
  font-family: var(--vb-font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vb-graphite-60);
  margin-bottom: var(--vb-s1);
}
.auth-card .btn { width: 100%; margin-top: var(--vb-s4); }
.auth-card .auth-footer {
  font-size: 12px;
  color: var(--vb-graphite-40);
  text-align: center;
  margin-top: var(--vb-s4);
}

/* ── Home / empty state ─────────────────────────────────────── */
.home-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--vb-s8) var(--vb-s6);
  max-width: var(--composer-max);
  margin: 0 auto;
  width: 100%;
  text-align: center;
}
.home-page .greeting {
  font-family: var(--vb-font-serif);
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.03em;
  margin-bottom: var(--vb-s3);
}
.home-page .greeting strong { font-weight: 500; }
.home-page .sub-greeting {
  font-size: 16px;
  color: var(--vb-graphite-60);
  margin-bottom: var(--vb-s8);
}
.starters {
  display: flex;
  flex-direction: column;
  gap: var(--vb-s2);
  width: 100%;
}
.starter-row {
  display: flex;
  gap: var(--vb-s2);
  width: 100%;
}
.starter-btn {
  flex: 1;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r3);
  background: transparent;
  font-size: 14px;
  color: var(--vb-graphite-60);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
  line-height: 1.4;
}
.starter-btn:hover { border-color: var(--vb-graphite-60); color: var(--vb-graphite); background: var(--vb-graphite-04); }
.starter-btn strong { display: block; font-weight: 500; color: var(--vb-graphite); font-size: 13px; margin-bottom: 2px; }

/* Workspace chips on home */
.ws-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vb-s2);
  margin-bottom: var(--vb-s6);
  justify-content: center;
}
.ws-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r2);
  font-size: 13px;
  font-weight: 500;
  color: var(--vb-graphite);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.ws-chip:hover { border-color: var(--vb-graphite-60); background: var(--vb-graphite-04); }
.ws-chip .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ── Chat surface ─────────────────────────────────────────── */
.chat-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-topbar {
  display: flex;
  align-items: center;
  gap: var(--vb-s3);
  padding: 10px 20px;
  border-bottom: 1px solid var(--vb-graphite-20);
  background: var(--vb-linen);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}
.chat-topbar .title {
  font-size: 14px;
  font-weight: 500;
  color: var(--vb-graphite);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-topbar .ws-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r2);
  font-family: var(--vb-font-mono);
  font-size: 10px;
  color: var(--vb-graphite-60);
}
.chat-topbar .ws-badge .dot { width: 5px; height: 5px; border-radius: 50%; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--vb-s6) var(--vb-s4);
}
.messages-inner {
  max-width: var(--composer-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--vb-s6);
}

/* ── Message rows — NO bubbles, text on surface ── */
.msg {
  display: flex;
  flex-direction: column;
  gap: var(--vb-s2);
}
.msg-label {
  font-family: var(--vb-font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--vb-graphite-40);
}
.msg-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--vb-graphite);
}
.msg-body p + p { margin-top: 0.8em; }
.msg-body strong { font-weight: 600; }
.msg-body em { font-style: italic; color: var(--vb-graphite-60); }
.msg-body code {
  font-family: var(--vb-font-mono);
  font-size: 13px;
  background: var(--vb-graphite-08);
  border-radius: var(--vb-r1);
  padding: 1px 5px;
}
.msg-body pre {
  background: var(--vb-linen-deep);
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r3);
  padding: var(--vb-s3) var(--vb-s4);
  overflow-x: auto;
  font-size: 13px;
}
.msg-body ul, .msg-body ol { padding-left: 1.4em; }
.msg-body li { margin: 0.2em 0; }
.msg-body a { color: var(--vb-sienna); }

/* User message — slightly indented, muted label */
.msg.user .msg-body { color: var(--vb-graphite-60); }
.msg.user .msg-label::before { content: "You"; }
.msg.assistant .msg-label::before { content: "VanderBot"; }

/* Streaming indicator — visible dots */
.msg-streaming {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}
.msg-streaming span {
  width: 5px; height: 5px;
  background: var(--vb-graphite-40);
  border-radius: 50%;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.msg-streaming span:nth-child(2) { animation-delay: .2s; }
.msg-streaming span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse-dot { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

/* Ruled separator between messages */
.msg-sep {
  border: none;
  border-top: 1px solid var(--vb-graphite-08);
  margin: 0;
}

/* ── Composer ─────────────────────────────────────────────── */
.composer-wrap {
  padding: var(--vb-s4) var(--vb-s4) env(safe-area-inset-bottom, 12px);
  border-top: 1px solid var(--vb-graphite-20);
  background: var(--vb-linen);
  flex-shrink: 0;
}
.composer {
  max-width: var(--composer-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r4);
  background: var(--vb-linen);
  transition: border-color .12s;
  overflow: hidden;
}
.composer:focus-within { border-color: var(--vb-graphite-60); }
.composer-textarea {
  width: 100%;
  padding: 12px 14px 6px;
  font-family: var(--vb-font-sans);
  font-size: 15px;
  color: var(--vb-graphite);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  min-height: 48px;
  max-height: 220px;
  overflow-y: auto;
  line-height: 1.5;
}
.composer-textarea::placeholder { color: var(--vb-graphite-40); }
.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 8px;
  gap: var(--vb-s2);
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: var(--vb-s1);
  overflow-x: auto;
  flex: 1;
}
.composer-hint {
  font-family: var(--vb-font-mono);
  font-size: 9px;
  color: var(--vb-graphite-40);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.send-btn {
  width: 30px; height: 30px;
  background: var(--vb-graphite);
  color: var(--vb-linen);
  border-radius: var(--vb-r2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
}
.send-btn:hover:not(:disabled) { background: var(--vb-sienna); }
.send-btn:disabled { opacity: 0.4; }

/* Mobile composer skills bar */
@media (max-width: 480px) {
  .composer-tools { flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
}

/* ── Project / workspace page ─────────────────────────────── */
.page-header {
  padding: var(--vb-s6) var(--vb-s8);
  border-bottom: 1px solid var(--vb-graphite-20);
}
.page-header .eyebrow { margin-bottom: var(--vb-s2); }
.page-header h2 {
  font-family: var(--vb-font-serif);
  font-size: 28px;
  font-weight: 300;
}
.page-header .desc { font-size: 14px; color: var(--vb-graphite-60); margin-top: var(--vb-s2); }

.page-body { padding: var(--vb-s6) var(--vb-s8); }

/* Stats row — Artiquity labeled value grid */
.stat-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r3);
  overflow: hidden;
  margin-bottom: var(--vb-s6);
}
.stat-cell {
  flex: 1;
  padding: 14px 16px;
  border-right: 1px solid var(--vb-graphite-20);
}
.stat-cell:last-child { border-right: none; }
.stat-cell .label {
  font-family: var(--vb-font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--vb-graphite-40);
  margin-bottom: 4px;
}
.stat-cell .value {
  font-size: 22px;
  font-weight: 500;
  color: var(--vb-graphite);
  line-height: 1;
}
.stat-cell .value-sub {
  font-size: 12px;
  color: var(--vb-graphite-60);
  margin-top: 2px;
}

/* Files grid */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--vb-s3);
}
.file-card {
  padding: 14px;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r3);
  background: var(--vb-linen);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.file-card:hover { border-color: var(--vb-graphite-60); background: var(--vb-graphite-04); }
.file-card .file-icon {
  width: 32px; height: 32px;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--vb-s2);
  color: var(--vb-graphite-60);
}
.file-card .file-name {
  font-size: 13px; font-weight: 500; color: var(--vb-graphite);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 2px;
}
.file-card .file-meta {
  font-family: var(--vb-font-mono);
  font-size: 10px; color: var(--vb-graphite-40);
}

/* ── Action Approval — the ONE dark surface ─────────────────── */
.approval-scrim {
  position: fixed; inset: 0;
  background: var(--vb-dark);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--vb-s6);
  animation: fadein .15s ease-out;
}
.approval-card {
  width: 100%;
  max-width: 520px;
  background: var(--vb-dark-surface);
  border: 1px solid var(--vb-dark-stroke);
  border-radius: var(--vb-r4);
  overflow: hidden;
}
.approval-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--vb-dark-stroke);
  display: flex;
  align-items: center;
  gap: 10px;
}
.approval-head .eyebrow {
  font-family: var(--vb-font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--vb-dark-fg-60);
}
.approval-head h3 {
  font-family: var(--vb-font-serif);
  font-size: 20px;
  font-weight: 300;
  color: var(--vb-dark-fg);
  margin-top: 4px;
}
.approval-body { padding: 20px 22px; }
.approval-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.approval-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.approval-row .al {
  font-family: var(--vb-font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vb-dark-fg-60);
  width: 80px;
  flex-shrink: 0;
  padding-top: 2px;
}
.approval-row .av {
  font-size: 13px;
  color: var(--vb-dark-fg);
  flex: 1;
  line-height: 1.4;
}
.approval-foot {
  display: flex;
  gap: var(--vb-s2);
  padding: 16px 22px;
  border-top: 1px solid var(--vb-dark-stroke);
}
.approval-foot .btn-approve {
  flex: 1;
  background: var(--vb-sienna);
  color: #fff;
  border: 1px solid var(--vb-sienna);
  border-radius: var(--vb-r3);
  height: 38px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: filter .12s;
}
.approval-foot .btn-approve:hover { filter: brightness(1.1); }
.approval-foot .btn-deny {
  flex: 1;
  background: transparent;
  color: var(--vb-dark-fg-60);
  border: 1px solid var(--vb-dark-stroke);
  border-radius: var(--vb-r3);
  height: 38px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.approval-foot .btn-deny:hover { border-color: var(--vb-dark-fg-60); color: var(--vb-dark-fg); }

/* ── Toast ─────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 64px);
  left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 500; pointer-events: none;
}
.toast {
  padding: 9px 16px;
  background: var(--vb-graphite);
  color: var(--vb-linen);
  border-radius: var(--vb-r3);
  font-size: 13px;
  pointer-events: auto;
  white-space: nowrap;
  animation: fadein .15s ease-out;
}
.toast.error { background: var(--vb-rust); }
.toast.success { background: var(--vb-sage); }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .shell-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(82vw, 300px) !important;
    transform: translateX(-100%);
    transition: transform .2s ease-out;
    box-shadow: none;
    background: var(--vb-linen, #F9F7F1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .shell-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(28,26,23,0.14);
  }
  .sidebar-overlay,
  #mobile-scrim {
    display: block;
    position: fixed; inset: 0;
    background: rgba(28,26,23,0.28);
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  #mobile-scrim:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .chat-topbar { padding: 10px 14px; }
  .page-header, .page-body { padding-left: var(--vb-s4); padding-right: var(--vb-s4); }
  .stat-row { flex-direction: column; }
  .stat-cell { border-right: none; border-bottom: 1px solid var(--vb-graphite-20); }
  .stat-cell:last-child { border-bottom: none; }
  .home-page { padding: var(--vb-s6) var(--vb-s4); }
  .starter-row { flex-direction: column; }
  .files-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .files-grid { grid-template-columns: 1fr; }
}

/* ── Mobile bottom nav ────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(54px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--vb-linen);
  border-top: 1px solid var(--vb-graphite-20);
  z-index: 40;
  align-items: center;
  justify-content: space-around;
}
.mobile-nav .mn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  font-family: var(--vb-font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--vb-graphite-40);
  cursor: pointer;
  transition: color .1s;
}
.mobile-nav .mn-item.active { color: var(--vb-graphite); }
@media (max-width: 768px) {
  .mobile-nav { display: flex; }
  .shell-main { padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Overflow menu ────────────────────────────────────────── */
.overflow-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--vb-linen);
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r4);
  box-shadow: 0 4px 20px rgba(28,26,23,0.12);
  min-width: 180px;
  overflow: hidden;
  z-index: 60;
  animation: slidein-up .12s ease-out;
}
.overflow-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--vb-graphite-60);
  text-align: left;
  transition: background .1s, color .1s;
  border-bottom: 1px solid var(--vb-graphite-08);
}
.overflow-menu button:last-child { border-bottom: none; }
.overflow-menu button:hover { background: var(--vb-graphite-08); color: var(--vb-graphite); }

/* ── Mobile menu button (inside .shell) ─────────────────── */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 12px; left: 14px;
    width: 38px; height: 38px;
    background: var(--vb-linen);
    border: 1px solid var(--vb-graphite-20);
    border-radius: 2px;
    cursor: pointer;
    z-index: 60;
    color: var(--vb-graphite);
    box-shadow: none;
  }
  .mobile-menu-btn:hover { background: var(--vb-cream-mid); }
  .shell-main { padding-top: 62px; }
}
@media (min-width: 769px) {
  .mobile-menu-btn { display: none; }
}

/* ── vb2-chat.css ───────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────
   VanderBot 2.0 — Chat view fix
   Targets the ACTUAL class names chat.js renders.
   Single source of truth: replaces ethos-tight, desktop-canvas, desktop,
   mobile-fix, vb2-overrides (all removed from index.html).
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Kill legacy blobs & animations ──────────────────────── */
.blobs, .blob, .blob-p, .blob-o, .blob-l { display: none !important; }
* { animation-duration: 0.001s !important; }
.chat-thread *,
.msg-row *,
.msg-bubble *,
.streaming-ring { animation-duration: revert !important; }
@keyframes pulse-dot { 0%, 80%, 100% { opacity: 0.25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* ── Root surface ─────────────────────────────────────────── */
html, body {
  background: var(--vb-linen);
  color: var(--vb-graphite);
  font-family: var(--vb-font-sans);
  -webkit-font-smoothing: antialiased;
}
body {
  background-color: var(--vb-linen);
  background-image: var(--vb-grid);
  background-size: var(--vb-grid-size);
  background-attachment: fixed;
}

/* ── Shell layout ─────────────────────────────────────────── */
.shell { display: flex; min-height: 100dvh; background: var(--vb-linen); }
.shell-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--vb-linen);
}

/* ── Main header ──────────────────────────────────────────── */
.main-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--vb-graphite-20);
  background: var(--vb-linen);
  flex-shrink: 0;
  min-height: 52px;
}
.main-head .grow { flex: 1; min-width: 0; }
.main-head .title {
  font-family: var(--vb-font-serif);
  font-size: 16px;
  font-weight: 300;
  color: var(--vb-graphite);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main-head .title em { font-style: italic; color: var(--vb-sienna); }
.main-head .meta {
  font-family: var(--vb-font-mono);
  font-size: 10px;
  color: var(--vb-graphite-40);
  margin-top: 2px;
}
.main-head .btn-ghost {
  background: transparent;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r2);
  color: var(--vb-graphite-60);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.main-head .btn-ghost:hover { border-color: var(--vb-graphite-60); color: var(--vb-graphite); }

/* ── Chat thread ──────────────────────────────────────────── */
.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Message rows — NO bubbles ────────────────────────────── */
.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 0;
  border-bottom: 1px solid var(--vb-graphite-08);
}
.msg-row:last-child { border-bottom: none; }

/* Role label */
.msg-row::before {
  font-family: var(--vb-font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--vb-graphite-40);
  margin-bottom: 6px;
  display: block;
}
.msg-row.user::before   { content: "You"; }
.msg-row.assistant::before { content: "VanderBot"; color: var(--vb-sienna); }

/* Message bubble — rendered as flat text */
.msg-bubble {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 15px;
  line-height: 1.7;
}
.msg-row.user .msg-bubble {
  color: var(--vb-graphite-60);
  font-size: 14px;
}
.msg-row.assistant .msg-bubble {
  font-family: var(--vb-font-serif);
  font-weight: 300;
  color: var(--vb-graphite);
  font-size: 15px;
}

/* Markdown inside bubbles */
.msg-bubble p { margin: 0 0 0.7em; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble strong { font-weight: 600; }
.msg-bubble em { font-style: italic; color: var(--vb-graphite-60); }
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 {
  font-family: var(--vb-font-serif);
  font-weight: 400;
  margin: 1em 0 0.4em;
  color: var(--vb-graphite);
}
.msg-bubble h1 { font-size: 20px; }
.msg-bubble h2 { font-size: 17px; }
.msg-bubble h3 { font-size: 15px; }
.msg-bubble code {
  font-family: var(--vb-font-mono);
  font-size: 12px;
  background: var(--vb-graphite-08);
  border-radius: 2px;
  padding: 1px 4px;
}
.msg-bubble pre {
  background: var(--vb-linen-deep);
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r3);
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 12px;
  margin: 0.8em 0;
}
.msg-bubble ul, .msg-bubble ol { padding-left: 1.3em; margin: 0.5em 0; }
.msg-bubble li { margin: 0.2em 0; }
.msg-bubble a { color: var(--vb-sienna); text-decoration: underline; }

/* ── Streaming indicator ──────────────────────────────────── */
.streaming-ring {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 2px 0;
  vertical-align: middle;
}
.streaming-ring span {
  width: 6px;
  height: 6px;
  background: var(--vb-sienna);
  border-radius: 50%;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.streaming-ring span:nth-child(2) { animation-delay: .2s; }
.streaming-ring span:nth-child(3) { animation-delay: .4s; }

/* ── Empty state — flat, left-aligned, ruled list ─────────── */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
  text-align: left;
  padding: 32px 24px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.chat-empty .mark {
  width: 28px;
  height: 28px;
  opacity: 0.20;
  margin-bottom: 20px;
}
.chat-empty h2 {
  font-family: var(--vb-font-serif);
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.2;
  text-align: left;
}
.chat-empty h2 em { font-style: italic; color: var(--vb-sienna); }
.chat-empty .chat-empty-sub {
  font-size: 13px;
  color: var(--vb-graphite-60);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 420px;
  text-align: left;
}

/* Starters — ruled list, zero cards */
.starters {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 520px;
  border-top: 1px solid var(--vb-graphite-12, rgba(28,26,23,0.12));
}
.starter {
  padding: 12px 0;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--vb-graphite-08);
  border-radius: 0;
  background: transparent;
  font-family: var(--vb-font-sans);
  font-size: 13px;
  color: var(--vb-graphite-60);
  cursor: pointer;
  transition: color .12s, padding-left .12s;
  line-height: 1.5;
  width: 100%;
}
.starter:hover {
  color: var(--vb-graphite);
  padding-left: 6px;
  background: transparent;
}

@media (min-width: 1024px) {
  .chat-empty { padding: 40px 32px; }
  .chat-empty h2 { font-size: 34px; }
}


/* ── Composer ─────────────────────────────────────────────── */
.composer-wrap {
  padding: 12px 20px max(12px, env(safe-area-inset-bottom, 12px));
  border-top: 1px solid var(--vb-graphite-20);
  background: var(--vb-linen);
  flex-shrink: 0;
}
.composer {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r4);
  background: var(--vb-linen);
  transition: border-color .12s;
  overflow: visible;
  position: relative;
}
.composer:focus-within { border-color: var(--vb-graphite-60); }

/* File chips row */
.composer-chips {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 0;
}
.composer-chips.has-chips { display: flex; }
.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r2);
  font-size: 12px;
  color: var(--vb-graphite-60);
  background: var(--vb-linen-deep);
}
.chip-thumb {
  width: 20px; height: 20px;
  border-radius: 2px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chip-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-remove {
  color: var(--vb-graphite-40);
  font-size: 10px;
  cursor: pointer;
  padding: 0 2px;
  background: none;
  border: none;
}
.chip-remove:hover { color: var(--vb-graphite); }
/* Composer chip upload status */
.chip.uploading { opacity: 0.8; }
.chip.error { border-color: var(--vb-sienna); }
.chip-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--vb-graphite-40); flex-shrink: 0;
}
.chip-status.err { color: var(--vb-sienna); }
.chip-spin {
  width: 10px; height: 10px; display: inline-block; border-radius: 50%;
  border: 1.5px solid var(--vb-graphite-20); border-top-color: var(--vb-graphite-60);
  animation: spin 0.7s linear infinite;
}

/* Skill bar */
.skill-bar {
  display: flex;
  gap: 6px;
  padding: 8px 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.skill-bar:empty { display: none; }
.skill-bar::-webkit-scrollbar { display: none; }
.skill-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--vb-graphite-20);
  border-radius: 2px;
  font-family: var(--vb-font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--vb-graphite-60);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color .12s, color .12s, background .12s;
}
.skill-pill:hover { border-color: var(--vb-graphite-60); color: var(--vb-graphite); }
.skill-pill.active {
  border-color: var(--vb-sienna);
  color: var(--vb-sienna);
  background: var(--vb-sienna-light);
}

/* Composer row — the input line */
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px 8px 12px;
}
.composer-attach, .composer-mode {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--vb-graphite-40);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--vb-r2);
  flex-shrink: 0;
  transition: color .12s, background .12s;
}
.composer-attach:hover, .composer-mode:hover {
  color: var(--vb-graphite);
  background: var(--vb-graphite-08);
}
.composer-textarea {
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  font-family: var(--vb-font-sans);
  font-size: 15px;
  color: var(--vb-graphite);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  min-height: 32px;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.5;
}
/* Prevent iOS zoom */
@media (max-width: 768px) {
  .composer-textarea { font-size: 16px; }
}
.composer-textarea::placeholder { color: var(--vb-graphite-40); }
.composer-send {
  width: 32px; height: 32px;
  background: var(--vb-graphite);
  color: var(--vb-linen);
  border: none;
  border-radius: var(--vb-r2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .12s;
}
.composer-send:hover:not(:disabled) { background: var(--vb-sienna); }
.composer-send:disabled { opacity: 0.35; cursor: not-allowed; }

/* Slash menu */
.slash-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--vb-linen);
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r4);
  overflow: hidden;
  z-index: 9500;
  box-shadow: 0 4px 20px rgba(28,26,23,0.10);
}
.slash-label {
  font-family: var(--vb-font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--vb-graphite-40);
  padding: 10px 14px 6px;
  border-bottom: 1px solid var(--vb-graphite-08);
}
.slash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--vb-graphite-08);
  transition: background .1s;
}
.slash-item:last-child { border-bottom: none; }
.slash-item:hover, .slash-item.on { background: var(--vb-graphite-04); }
.slash-ic { color: var(--vb-graphite-40); display: flex; align-items: center; }
.slash-title { font-size: 13px; font-weight: 500; color: var(--vb-graphite); }
.slash-desc { font-size: 11px; color: var(--vb-graphite-40); margin-top: 1px; }
.slash-item .hint {
  font-family: var(--vb-font-mono);
  font-size: 9px;
  color: var(--vb-graphite-40);
  letter-spacing: 0.05em;
  margin-left: auto;
}

/* File attachments in messages — a real card with a sienna accent rail. */
.msg-file-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--vb-graphite-08);
  border-left: 3px solid var(--vb-sienna);
  border-radius: var(--vb-r2);
  background: var(--vb-linen-deep);
  margin-top: 8px;
  text-decoration: none !important;
  color: var(--vb-graphite);
  font-size: 13px;
  cursor: pointer;
  max-width: 340px;
  transition: border-color .12s, background .12s;
}
.msg-file-card:hover {
  border-left-color: var(--vb-sienna);
  background: var(--vb-sienna-light);
}
.msg-file-card .name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 230px; font-weight: 500; text-decoration: none;
}
.msg-file-card .msg-file-action {
  margin-left: auto;
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  background: var(--vb-graphite-04);
  border-radius: var(--vb-r1);
  font-family: var(--vb-font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--vb-sienna);
  white-space: nowrap;
  text-decoration: none;
}
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg-image {
  max-width: 320px;
  max-height: 240px;
  width: auto;
  height: auto;
  border-radius: var(--vb-r3);
  border: 1px solid var(--vb-graphite-20);
  object-fit: contain;
  background: var(--vb-linen-deep, #e6e1da);
  display: block;
}
.msg-image-link { display: inline-block; }

/* ── Sidebar — left panel ─────────────────────────────────── */
.shell-sidebar {
  background: var(--vb-linen-deep) !important;
  border-right: 1px solid var(--vb-graphite-20) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* Sidebar new-chat button */
.sidebar-actions .btn-primary,
.sidebar-actions a.btn {
  background: var(--vb-graphite) !important;
  color: var(--vb-linen) !important;
  border: 1px solid var(--vb-graphite) !important;
  border-radius: var(--vb-r3) !important;
  box-shadow: none !important;
}
.sidebar-actions .btn-primary:hover,
.sidebar-actions a.btn:hover {
  background: var(--vb-sienna) !important;
  border-color: var(--vb-sienna) !important;
}

/* Conv active state — left border only */
.conv-item.active {
  background: var(--vb-graphite-08) !important;
  border-left: 2px solid var(--vb-sienna) !important;
  border-radius: 0 !important;
}
/* Drop the redundant "New chat." title bar on desktop — the sidebar's active
   conversation highlight already shows which chat you're in. Kept on mobile,
   where the sidebar is a hidden overlay and the top bar holds the menu toggle. */
@media (min-width: 769px) { .main-head { display: none !important; } .main-head:has(.proj-pill) { display: flex !important; } }
/* Mobile: the centered VanderBot logo IS the top bar. Hide the head title/topic
   text so it never runs under the logo (it used to overlap as "New chat." + topic). */
@media (max-width: 768px) { .main-head .grow { display: none; } }
.nav-item.active {
  background: var(--vb-graphite-08) !important;
  border-left: 2px solid var(--vb-sienna) !important;
  border-radius: 0 !important;
  color: var(--vb-graphite) !important;
}

/* Search input */
.sidebar-search input,
input[type="search"],
input[type="text"].sidebar-search-input {
  background: transparent !important;
  border: 1px solid var(--vb-graphite-20) !important;
  border-radius: var(--vb-r2) !important;
  box-shadow: none !important;
  font-size: 13px;
  padding: 7px 10px;
  color: var(--vb-graphite);
}
.sidebar-search input:focus,
input[type="search"]:focus {
  border-color: var(--vb-graphite-60) !important;
  outline: none !important;
}

/* Kill any remaining glass/purple */
[class*="glass"]:not(.shell-sidebar),
[class*="glow"],
[class*="blob"] {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  border-color: var(--vb-graphite-20) !important;
}

/* ── Desktop canvas ≥1024px ───────────────────────────────── */
@media (min-width: 1024px) {
  /* Set the default sidebar width via the variable (not a hardcoded width) so the
     drag-to-resize handle, which sets --sidebar-w inline, actually takes effect. */
  :root { --sidebar-w: 280px; }
  .chat-thread { padding: 40px 48px 32px; }
  .msg-row { max-width: 760px; }
  .composer-wrap { padding: 16px 48px max(16px, env(safe-area-inset-bottom)); }
  .composer { max-width: 760px; }
  .main-head { padding: 14px 48px; }
  .chat-empty { padding: 48px 32px; }
  .chat-empty h2 { font-size: 36px; }
}

@media (min-width: 1280px) {
  :root { --sidebar-w: 300px; }
  .chat-thread { padding: 48px 64px 40px; }
  .msg-row { max-width: 800px; }
  .composer-wrap { padding: 20px 64px max(20px, env(safe-area-inset-bottom)); }
  .composer { max-width: 800px; }
  .main-head { padding: 16px 64px; }
}

@media (min-width: 1600px) {
  :root { --sidebar-w: 320px; }
  .msg-row { max-width: 840px; }
  .composer { max-width: 840px; }
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .chat-thread { padding: 20px 16px 16px; }
  .main-head { padding: 10px 14px; }
  .composer-wrap { padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
  .shell-main { padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Toast ────────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 70px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 9px 16px;
  background: var(--vb-graphite);
  color: var(--vb-linen);
  border-radius: var(--vb-r3);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: auto;
}
.toast.error { background: var(--vb-rust); }
.toast.success { background: var(--vb-sage); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--vb-r3);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--vb-graphite);
  color: var(--vb-linen);
  border-color: var(--vb-graphite);
}
.btn-primary:hover:not(:disabled) { background: var(--vb-sienna); border-color: var(--vb-sienna); }
.btn-secondary {
  background: transparent;
  color: var(--vb-graphite-60);
  border-color: var(--vb-graphite-20);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--vb-graphite-60); color: var(--vb-graphite); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Forms / inputs ───────────────────────────────────────── */
input, textarea, select {
  background: transparent;
  border: 1px solid var(--vb-graphite-20);
  border-radius: var(--vb-r2);
  color: var(--vb-graphite);
  font-family: var(--vb-font-sans);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .12s;
}
input:focus, textarea:focus, select:focus { border-color: var(--vb-graphite-60); }
input::placeholder, textarea::placeholder { color: var(--vb-graphite-40); }

/* ── Eyebrow / mono labels ────────────────────────────────── */
.eyebrow, .mono-label {
  font-family: var(--vb-font-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--vb-graphite-40);
}

/* ── Scroll ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--vb-graphite-20); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--vb-graphite-40); }

/* ── vb-fix-final.css + mobile-structure-fix.css ───────── */
/* ═══════════════════════════════════════════════════════════════════════════
   VanderBot — Nuclear Fix Layer v3 (loaded LAST, wins everything)
   Single source of truth. No conflicts. No legacy hacks.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. SIDEBAR — always opaque linen-deep, never transparent ── */
.shell-sidebar,
aside.shell-sidebar,
.shell-sidebar[class],
[class*="shell-sidebar"] {
  background: var(--vb-linen-deep, #E5E1D8) !important;
  background-color: var(--vb-linen-deep, #E5E1D8) !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

/* ── 2. KILL glass wildcard (safely, not inside sidebar) ── */
[class*="glass"]:not(.shell-sidebar):not(.shell-sidebar *) {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  border-color: var(--vb-graphite-20, rgba(28,26,23,.20)) !important;
}

/* ── 3. BLOBS — gone ── */
.blobs, .blob { display: none !important; }

/* ── 4. MOBILE sidebar — slide-in overlay, not layout ── */
@media (max-width: 768px) {
  .shell {
    display: block !important;
    position: relative !important;
  }
  .shell-main {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100dvh !important;
    padding-top: 62px !important;
    padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .shell-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    right: auto !important;
    width: 280px !important;
    max-width: 85vw !important;
    height: 100dvh !important;
    z-index: 50 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.22s ease-out !important;
    border-right: 1px solid rgba(28,26,23,0.12) !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
  }
  .shell-sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 24px rgba(28,26,23,0.12) !important;
  }

  /* SCRIM — only .mobile-menu-scrim and #mobile-scrim — nothing else */
  #mobile-scrim,
  .mobile-menu-scrim {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(28,26,23,0.40) !important;
    z-index: 49 !important;
    display: block !important;
    opacity: 1 !important;
    transition: opacity 0.2s !important;
    pointer-events: auto !important;
  }
  #mobile-scrim.hidden,
  .mobile-menu-scrim.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .mobile-menu-btn {
    display: flex !important;
    position: fixed !important;
    top: 12px !important;
    left: 12px !important;
    z-index: 60 !important;
    width: 38px !important;
    height: 38px !important;
    background: var(--vb-linen, #EDEAE4) !important;
    border: 1px solid rgba(28,26,23,0.15) !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: var(--vb-graphite, #1C1A17) !important;
    padding: 0 !important;
  }
  .main-head,
  .chat-topbar,
  .page-header {
    padding-left: 62px !important;
  }
}

/* ── 5. DESKTOP — sidebar back in layout flow ── */
@media (min-width: 769px) {
  .shell {
    display: flex !important;
  }
  .shell-main {
    flex: 1 !important;
    min-width: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100dvh !important;
  }
  .mobile-menu-btn {
    display: none !important;
  }
  .shell-sidebar {
    position: sticky !important;
    top: 0 !important;
    transform: none !important;
    height: 100dvh !important;
    transition: none !important;
    box-shadow: none !important;
  }
}

/* ── 6. CHAT LAYOUT — full-height flex column, composer pinned ── */
#main {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
#main > .main-head,
#main > header {
  flex-shrink: 0 !important;
}
#main > .chat-thread {
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
#main > .composer-wrap {
  flex-shrink: 0 !important;
}
/* On mobile the shell is `display:block` (the sidebar is a fixed overlay), so
   #main has no flex parent to stretch it — it collapses to content height and the
   composer floats mid-page. Give it the full viewport height so the flex column
   pins the composer to the bottom. (padding-top stays to clear the fixed menu btn.) */
@media (max-width: 768px) {
  #main {
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  /* Header sits at the very top, inline to the right of the fixed sidebar-toggle
     button (which floats at top:12px/left:12px) instead of dropping below it. */
  #main > .main-head, #main > header {
    min-height: 54px !important;
    display: flex !important;
    align-items: center !important;
    padding: 8px 14px 8px 60px !important;
  }
}

/* ── 7. COMPOSER — flat, no radius except 2px corners ── */
.composer {
  border-radius: 2px !important;
  background: var(--vb-linen, #EDEAE4) !important;
  border: 1px solid var(--vb-graphite-20, rgba(28,26,23,.20)) !important;
  box-shadow: none !important;
}
.composer:focus-within {
  border-color: var(--vb-sienna, #C4601A) !important;
}
.composer-textarea {
  color: var(--vb-graphite, #1C1A17) !important;
  background: transparent !important;
}
.composer-send {
  background: var(--vb-graphite, #1C1A17) !important;
  color: var(--vb-linen, #EDEAE4) !important;
  border-radius: 2px !important;
  border: none !important;
}
.composer-send:not(:disabled):hover {
  background: var(--vb-sienna, #C4601A) !important;
}

/* ── 8. SKILL PILLS — flat, 2px radius ── */
.skill-pill {
  border-radius: 2px !important;
  font-family: var(--vb-font-mono, monospace) !important;
  font-size: 10px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  background: transparent !important;
  color: var(--vb-graphite-60, rgba(28,26,23,.60)) !important;
  border: 1px solid var(--vb-graphite-20, rgba(28,26,23,.20)) !important;
}
.skill-pill:hover {
  color: var(--vb-graphite, #1C1A17) !important;
  border-color: var(--vb-graphite-60, rgba(28,26,23,.60)) !important;
}
.skill-pill.active {
  background: var(--vb-sienna, #C4601A) !important;
  color: #fff !important;
  border-color: var(--vb-sienna, #C4601A) !important;
}

/* ── 9. CONV ITEMS — text left, no center ── */
.conv-item,
button.conv-item {
  text-align: left !important;
}

/* ── 10. STREAMING INDICATOR — visible on linen ── */
.streaming-ring {
  display: flex !important;
  gap: 5px !important;
  align-items: center !important;
  padding: 4px 0 !important;
}
.streaming-ring span {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background: var(--vb-sienna, #C4601A) !important;
  opacity: 0.4 !important;
  animation: vb-pulse 1.2s ease-in-out infinite !important;
}
.streaming-ring span:nth-child(2) { animation-delay: 0.2s !important; }
.streaming-ring span:nth-child(3) { animation-delay: 0.4s !important; }
@keyframes vb-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%       { opacity: 1;   transform: scale(1.1);  }
}

/* ── 11. MOBILE COMPOSER scrollable skill bar ── */
@media (max-width: 480px) {
  .skill-bar {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* ── 12. HOME — starter prompt cards (2-col grid; see home.js for layout) ── */
.fhome-starter {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  text-align: left !important;
  width: 100% !important;
  padding: 14px 15px !important;
  border: 1px solid var(--vb-graphite-20, rgba(28,26,23,.20)) !important;
  border-radius: 10px !important;
  background: transparent !important;
  font-family: var(--vb-font-sans, sans-serif) !important;
  font-size: 13.5px !important;
  line-height: 1.4 !important;
  color: var(--vb-graphite, #1C1A17) !important;
  cursor: pointer !important;
  transition: border-color .15s, transform .15s, background .15s !important;
}
.fhome-starter:hover {
  border-color: var(--vb-sienna, #C4601A) !important;
  background: var(--vb-linen, #EDEAE4) !important;
  transform: translateY(-1px) !important;
  color: var(--vb-graphite, #1C1A17) !important;
}

/* ── 13. FLIP CARDS — text dark on linen ── */
.flip-front, .flip-back {
  background: var(--vb-linen, #EDEAE4) !important;
  color: var(--vb-graphite, #1C1A17) !important;
}
.f-name, .b-title, .b-head {
  color: var(--vb-graphite, #1C1A17) !important;
}
.f-type, .f-hint, .b-empty {
  color: var(--vb-graphite-60, rgba(28,26,23,.60)) !important;
}
.b-pill {
  background: transparent !important;
  border: 1px solid var(--vb-sienna, #C4601A) !important;
  color: var(--vb-sienna, #C4601A) !important;
  border-radius: 2px !important;
  font-size: 11px !important;
  padding: 3px 8px !important;
  cursor: pointer !important;
}
.b-actions button {
  color: var(--vb-graphite-60, rgba(28,26,23,.60)) !important;
  border: 1px solid var(--vb-graphite-20, rgba(28,26,23,.20)) !important;
  background: transparent !important;
  border-radius: 2px !important;
}
.b-actions button:hover {
  color: var(--vb-sienna, #C4601A) !important;
  border-color: var(--vb-sienna, #C4601A) !important;
}

/* ── 14. IOS SAFE-AREA toast ── */
.vb-toast,
[class*="toast"] {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px) !important;
}

/* CACHE BUSTER: vb-nuclear-v3-1781740300 */
/* ─────────────────────────────────────────────────────────────────────────────
   VanderBot — Mobile Structure Fix (SUPERSEDED)
   All rules now live in vb-fix-final.css (loaded after this).
   This file is intentionally empty to avoid conflicts.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── 15. Chat thread — Claude-style messages (loaded LAST; wins everything) ──
   Applies to the dedicated chat view AND the home inline chat (both render
   .msg-row / .msg-bubble). User turns become right-aligned rounded bubbles;
   assistant turns stay clean full-width editorial text. Drops the old
   debug-style uppercase "YOU" / "VANDERBOT" ::before labels. */
.chat-thread, .fhome-thread { gap: 22px !important; }

.msg-row { padding: 0 !important; border-bottom: none !important; }
.msg-row.user::before { display: none !important; }   /* no "You" label on the user bubble */
/* Assistant turns carry a clear "Vanderbot" speaker label so it's obvious who is
   talking vs. the person — the bot reads as its own voice, not just left-aligned text. */
.msg-row.assistant::before {
  display: block !important;
  content: "Vanderbot" !important;
  font-family: var(--vb-font-mono) !important;
  font-size: 10px !important;
  letter-spacing: .16em !important;
  text-transform: uppercase !important;
  color: var(--vb-sienna) !important;
  margin: 0 0 7px !important;
}

/* User turn → right-aligned rounded bubble */
.msg-row.user { align-items: flex-end !important; }
.msg-row.user .msg-bubble {
  background: var(--vb-linen-deep, #E5E1D8) !important;
  color: var(--vb-graphite, #1C1A17) !important;
  border-radius: 16px 16px 4px 16px !important;
  padding: 11px 15px !important;
  max-width: 85% !important;
  width: fit-content !important;
  font-family: var(--vb-font-sans) !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
}

/* Assistant turn → clean full-width editorial text, no bubble */
.msg-row.assistant { align-items: stretch !important; }
.msg-row.assistant .msg-bubble {
  background: transparent !important;
  padding: 0 !important;
  max-width: 100% !important;
  font-family: var(--vb-font-serif) !important;
  font-size: 16px !important;
  line-height: 1.7 !important;
  color: var(--vb-graphite, #1C1A17) !important;
}

/* Typing indicator: the chat view renders .streaming-dots, but only
   .streaming-ring had styles — give the dots the same sienna pulse. */
.streaming-dots { display: inline-flex !important; gap: 5px !important; align-items: center !important; padding: 6px 0 !important; }
.streaming-dots span { width: 7px !important; height: 7px !important; border-radius: 50% !important; background: var(--vb-sienna, #C4601A) !important; opacity: .4 !important; animation: vb-pulse 1.2s ease-in-out infinite !important; }
.streaming-dots span:nth-child(2) { animation-delay: .2s !important; }
.streaming-dots span:nth-child(3) { animation-delay: .4s !important; }

/* Mobile: comfortable thread padding + a rounder, friendlier composer */
@media (max-width: 768px) {
  .chat-thread { padding: 18px 14px 16px !important; }
  .msg-row.user .msg-bubble { max-width: 88% !important; }
  .composer { border-radius: 16px !important; }
}

/* composer mode chip — align its baseline with the textarea text (15px / lh 1.5 / 6px bottom pad) */
.composer-mode-chip { font-size: 15px; line-height: 1.5; padding-bottom: 6px; white-space: nowrap; align-self: flex-end; color: var(--vb-graphite-60); }
.composer-mode-chip.active { color: var(--vb-sienna); font-weight: 500; }
.composer-mode-chip:empty { display: none; }

/* Mobile: make the main content column scroll. On phones .shell-main is height-
   capped with overflow hidden, so .main-body (Files / a Project / Profile / etc.) was
   clipped and couldn't scroll. Chat has no .main-body (its thread scrolls), so it is
   unaffected. */
@media (max-width: 768px) {
  .shell-main > .main-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* Mobile: persistent VanderBot logo in the top bar. The sidebar (which holds the
   brand) is hidden behind the menu button on phones, so without this there is no logo
   on Files / Projects / Chat. Centered in the 62px top zone; tap -> home. */
/* Hidden everywhere now. The fixed top-center brand kept causing overlaps on
   mobile — it doubled with the sidebar logo when the drawer opened, and (being
   position:fixed with no backing) floated over content on scroll. It's redundant
   anyway: the menu button covers nav and the sidebar carries the brand. Desktop
   already hid it. */
.mobile-brand { display: none !important; }

/* When the 'set a password' banner is showing, lift the content column above it so
   the composer and its upward slash menu aren't covered by the fixed bottom banner. */
body.vb-pw-on .shell-main, body.vb-pw-on #main { padding-bottom: calc(var(--pw-banner-h, 84px) + env(safe-area-inset-bottom, 0px)) !important; }

/* Slash autocomplete: keyboard-highlighted item (distinct from hover/current-mode). */
.slash-item.sel { background: var(--vb-graphite-08); box-shadow: inset 2px 0 0 var(--vb-rust); }

/* ─── PWA install prompt — floating card (built by js/pwa.js as .install-banner) ───
   Was unstyled (rendered as a raw block at the top of the page). Brand-matched card,
   pinned bottom-right on desktop, full-width above the bottom nav on mobile. */
.install-banner {
  position: fixed;
  z-index: 8600;
  right: 16px;
  left: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  width: min(360px, calc(100vw - 32px));
  background: var(--vb-linen, #EDEAE3);
  color: var(--vb-graphite, #1C1A17);
  border: 1px solid var(--vb-graphite-20, rgba(28, 26, 23, 0.2));
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 14px 44px rgba(28, 26, 23, 0.2);
  animation: vb-install-rise 0.26s ease both;
}
@keyframes vb-install-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.install-banner h4 {
  font-family: var(--font-display, "Sentient", Georgia, serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 5px;
}
.install-banner h4 em { color: var(--vb-sienna, #C4601A); font-style: normal; }
.install-banner p {
  margin: 0 0 13px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--vb-graphite-60, rgba(28, 26, 23, 0.6));
}
.install-banner .ios-hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--vb-graphite-60, rgba(28, 26, 23, 0.6));
  background: var(--vb-graphite-08, rgba(28, 26, 23, 0.08));
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 13px;
}
.install-banner .ios-hint strong { color: var(--vb-graphite, #1C1A17); font-weight: 600; }
.install-banner .actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
@media (max-width: 768px) {
  .install-banner {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 66px);
  }
}

/* -- Full-width chat --
   Fill the main column at every breakpoint instead of a capped, centered
   reading column (was 720-840px). Side padding on .chat-thread /
   .composer-wrap still gives breathing room. Mobile unaffected. */
.msg-row, .messages-inner, .composer, .chat-empty { max-width: none; }

/* -- Mobile chat top bar: show the conversation title --
   On phones the title was hidden so it wouldn't collide with the centered logo,
   leaving open chats with no title/context. Show the title (+topic) in the top
   bar and drop the centered brand logo on the chat/feed view (it stays in the
   sidebar). Other pages keep the logo. */
@media (max-width: 768px) {
  body:has(#main > .chat-thread) .mobile-brand { display: none !important; }
  #main:not(.feed-mode) > .main-head .grow { display: flex !important; flex-direction: column; justify-content: center; min-width: 0; gap: 1px; }
  #main:not(.feed-mode) > .main-head .title { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
  #main:not(.feed-mode) > .main-head .meta { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
