/* ==========================================================================
   Vectrieve, on top of the Company OS
   --------------------------------------------------------------------------
   static/css/os.css is vendored from BSLv1 unchanged (scripts/sync_bsl_os.sh).
   This file adds only what Vectrieve needs and the OS has no reason to carry:

     1. Accent tokens (one colour, one job)
     2. Glass on surfaces that genuinely float, with solid fallbacks
     3. Brand wordmark and icon sizing
     4. State classes the existing JavaScript toggles
     5. Public shell (marketing and auth pages)
     6. Dashboard: tab panes, routing canvas, file tree, finder
     7. Workspace: the full height chat app
     ...then one section per area, each fenced with a "section:" comment so
     parallel edits land in separate places.

   Rules (docs/design-system.md in BSLv1): every value resolves to an --os-
   or --vt- token, no literal colours outside the token block, and nothing
   here restyles an OS component. A button, badge or field that is missing
   belongs in os.css upstream, not here.
   ========================================================================== */

/* ---------- 1. Accent --------------------------------------------------- */

/* Vectrieve blue. It continues the product's existing identity (the old logo
   tile and the "personal" route lines users already know), moved off the
   stock framework values. Its one job is to mark retrieved context: the
   active project, the sources an answer used, the route a repository feeds.
   Buttons stay on the OS inverse pair; the accent is never decoration.
   Dark is the OS base, light the opt-in, matching os.css. */
:root {
  --vt-accent: #8fb0f5;
  --vt-accent-strong: #b3caf8;
  --vt-accent-wash: rgba(143, 176, 245, 0.14);
  --vt-accent-line: rgba(143, 176, 245, 0.42);
  --vt-glass-bg: rgba(17, 17, 17, 0.72);
  --vt-glass-filter: saturate(160%) blur(18px);
  --vt-code-bg: var(--os-surface-2);
  --vt-chat-max: 46rem;
}

:root[data-theme='light'] {
  --vt-accent: #2148b8;
  --vt-accent-strong: #15327f;
  --vt-accent-wash: rgba(33, 72, 184, 0.09);
  --vt-accent-line: rgba(33, 72, 184, 0.34);
  --vt-glass-bg: rgba(247, 247, 248, 0.74);
}

.vt-accent { color: var(--vt-accent); }
.vt-mark {
  background: var(--vt-accent-wash);
  color: var(--os-ink);
  border-radius: var(--os-radius-sm);
  padding: 0 0.15em;
}

/* ---------- 2. Glass ---------------------------------------------------- */

/* Retired in November 2026: the app has no glass. Every surface is solid
   on the field (vt-field.css); the shell's glass is switched off with
   html[data-glass="off"] in vt_base.html. */

/* ---------- 3. Brand and icons ------------------------------------------ */

/* No drawn Vectrieve logo exists yet, so the brand is the name set in the
   house face. Do not replace this with a generated mark. */
.vt-wordmark {
  font-weight: var(--os-weight-bold);
  font-size: var(--os-text-lg);
  letter-spacing: var(--os-tracking-tight);
  color: var(--os-ink);
  text-decoration: none;
  line-height: 1;
}
.vt-wordmark-sm { font-size: var(--os-text-base); }

/* Lucide glyphs rendered by static/js/vt-icons.js. 1em so they follow text. */
.vt-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
}
.vt-icon-lg { width: 1.25rem; height: 1.25rem; }
i[data-lucide] { display: inline-block; width: 1em; height: 1em; }

/* ---------- 4. State classes the JavaScript toggles --------------------- */

/* static/js/dashboard.js and workspace.js toggle `hidden` on 160 nodes. It is
   kept as the one shared state class (it reads as the HTML attribute), and
   everything else they toggle is an is-* or vt-* name defined here. */
.hidden { display: none !important; }
[hidden] { display: none !important; }

.is-disabled, .vt-disabled { opacity: 0.5; cursor: not-allowed; }
.vt-spin { animation: vt-spin 0.8s linear infinite; }
@keyframes vt-spin { to { transform: rotate(360deg); } }

/* Status ink for text a script sets after a check or a save */
.vt-ok { color: var(--os-success); }
.vt-bad { color: var(--os-danger); }
.vt-warn { color: var(--os-warn); }
.vt-info { color: var(--os-info); }
.vt-muted { color: var(--os-ink-muted); }

/* Modal and drawer entrance, replacing scale-95 / scale-100 */
.vt-enter { opacity: 0; transform: translateY(6px); }
.vt-entered {
  opacity: 1;
  transform: none;
  transition: opacity var(--os-motion-base) var(--os-ease),
              transform var(--os-motion-base) var(--os-ease);
}

/* An input a script marks as invalid or valid */
.os-input.is-invalid, .os-select.is-invalid, .os-textarea.is-invalid { border-color: var(--os-danger); }
.os-input.is-valid { border-color: var(--os-success); }

/* Hand-built modal markup that a script opens by removing `hidden`. Same
   look as the os-modal macro; use this when the script, not os.js, owns it. */
.vt-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--os-space-4);
}
.vt-modal > .os-modal-backdrop { position: absolute; inset: 0; background: var(--os-backdrop); }
.vt-modal .os-modal-panel { max-width: 36rem; }
.vt-modal-wide .os-modal-panel { max-width: 52rem; }
.vt-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-3);
  margin-bottom: var(--os-space-4);
}
.vt-modal-head .os-modal-title { margin: 0; display: flex; align-items: center; gap: var(--os-space-2); }

/* Small shared bits the pages reach for */
.vt-code {
  font-family: var(--os-font-mono);
  font-size: var(--os-text-sm);
  background: var(--os-fill);
  border-radius: var(--os-radius-sm);
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}
.vt-pre {
  font-family: var(--os-font-mono);
  font-size: var(--os-text-sm);
  background: var(--vt-code-bg);
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-md);
  padding: var(--os-space-3) var(--os-space-4);
  overflow-x: auto;
  white-space: pre;
}
.vt-h2 { font-size: var(--os-text-lg); font-weight: var(--os-weight-bold); letter-spacing: var(--os-tracking-tight); }
.vt-h3 { font-size: var(--os-text-md); font-weight: var(--os-weight-bold); }
.vt-lede { font-size: var(--os-text-md); color: var(--os-ink-muted); max-width: 62ch; }
.vt-meta { font-size: var(--os-text-xs); color: var(--os-ink-dim); }
.vt-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vt-scroll-y { overflow-y: auto; min-height: 0; }
.vt-grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--os-space-4);
}
.vt-divider { border: 0; border-top: 1px solid var(--os-line); margin: var(--os-space-5) 0; }
.vt-danger-zone { border-color: var(--os-danger); }
.vt-danger-zone .os-card-title { color: var(--os-danger); }
.vt-checkbox { display: inline-flex; align-items: center; gap: var(--os-space-2); font-size: var(--os-text-base); cursor: pointer; }
.vt-checkbox input { width: 1rem; height: 1rem; accent-color: var(--os-ink); }
.vt-file-input { font-size: var(--os-text-sm); color: var(--os-ink-muted); max-width: 100%; }
.vt-file-input::file-selector-button {
  font: inherit;
  color: var(--os-ink);
  background: transparent;
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-radius-md);
  padding: var(--os-space-2) var(--os-space-3);
  margin-right: var(--os-space-3);
  cursor: pointer;
}

/* ---------- 5. Public shell --------------------------------------------- */

.vt-public { min-height: 100vh; display: flex; flex-direction: column; }
.vt-public-head {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--os-line);
}
.vt-public-head-inner,
.vt-public-main,
.vt-public-foot-inner {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding-inline: var(--os-space-4);
}
@media (min-width: 768px) {
  .vt-public-head-inner, .vt-public-main, .vt-public-foot-inner { padding-inline: var(--os-space-8); }
}
.vt-public-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-3);
  min-height: 3.5rem;
}
.vt-public-nav { display: flex; align-items: center; gap: var(--os-space-1); flex-wrap: wrap; justify-content: flex-end; }
.vt-public-nav a:not(.os-btn) {
  color: var(--os-ink-muted);
  text-decoration: none;
  font-size: var(--os-text-sm);
  padding: var(--os-space-2);
  border-radius: var(--os-radius-md);
}
.vt-public-nav a:not(.os-btn):hover,
.vt-public-nav a[aria-current='page'] { color: var(--os-ink); }
@media (max-width: 599px) {
  .vt-public-nav .vt-hide-phone { display: none; }
}
.vt-public-main { flex: 1; padding-block: var(--os-space-10) var(--os-space-12); }
.vt-public-foot { border-top: 1px solid var(--os-line); }
.vt-public-foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--os-space-3);
  padding-block: var(--os-space-6);
  font-size: var(--os-text-sm);
  color: var(--os-ink-dim);
}
.vt-public-foot a { color: var(--os-ink-muted); text-decoration: none; }
.vt-public-foot a:hover { color: var(--os-ink); }

/* Auth and single task pages: one column, form first */
.vt-auth {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
}
.vt-auth-wide { max-width: 36rem; }
.vt-auth h1 { font-size: var(--os-text-xl); letter-spacing: var(--os-tracking-tight); margin-bottom: var(--os-space-2); }
.vt-auth .vt-lede { margin-bottom: var(--os-space-6); }
.vt-auth-alt { margin-top: var(--os-space-6); font-size: var(--os-text-sm); color: var(--os-ink-muted); }
.vt-auth-alt a { color: var(--os-ink); }
.vt-or {
  display: flex;
  align-items: center;
  gap: var(--os-space-3);
  margin: var(--os-space-5) 0;
  font-size: var(--os-text-xs);
  color: var(--os-ink-dim);
}
.vt-or::before, .vt-or::after { content: ''; flex: 1; border-top: 1px solid var(--os-line); }
.vt-btn-block { width: 100%; }
.vt-password { position: relative; }
.vt-password .os-input { padding-right: 4.5rem; }
.vt-password-toggle {
  position: absolute;
  right: var(--os-space-1);
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- 6. The shared shell, set for Vectrieve ---------------------- */

/* bsl_web's vectrieve preset is a stock framework blue (#3b82f6). Vectrieve's
   own accent replaces it; glass.css derives the text-safe ink, the wash and
   the on-accent colour from this one value, in both themes. */
[data-product='vectrieve'] { --bsl-accent: #2148b8; }

/* One accent on signed in pages: the shell's derived values. */
.bsl-body {
  --vt-accent: var(--bsl-accent-ink);
  --vt-accent-wash: var(--bsl-accent-wash);
}

.vt-header-form { margin: 0; }

/* shell.css sets `.bsl-body a { color: inherit }`, which outranks the OS
   button colours, so a primary button written as a link took the ink of
   its own background. Restore the OS colours for link buttons. */
.bsl-body a.os-btn { color: var(--os-ink); }
.bsl-body a.os-btn-primary { color: var(--os-inverse-ink); }
.bsl-body a.os-btn-danger { color: var(--os-danger); }
.bsl-body a.os-btn-quiet { color: var(--os-ink-muted); }

/* The OS dim ink is tuned for the OS ground; under the shell it sits on
   --bsl-bg and drops below 4.5:1. Use the shell's dim ink, which is
   measured against that ground. */
.bsl-body { --os-ink-dim: var(--bsl-ink-dim); }

/* A full height app (the workspace) opts out of the reading column and sits
   under the glass header, the way BSL Nexus does. */
.bsl-main:has(.vt-app) { max-width: none; padding: 0; }
.bsl-main .vt-app { height: calc(100vh - var(--bsl-header-height)); height: calc(100dvh - var(--bsl-header-height)); }

/* ==== section: dashboard ================================================ */

/* dashboard: data tabs (hub, databases, files, repositories) */

/* Each tab opens with its one line description and its actions; the page
   title above it is rewritten by switchTab(). */
.vt-tab-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-3);
  padding-block: var(--os-space-5);
}
.vt-tab-bar .vt-lede { margin: 0; }

/* Overview */
.vt-open-workspace {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-3);
}
.vt-db-list { display: grid; gap: 0; }
.vt-db-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--os-space-1) var(--os-space-3);
  padding: var(--os-space-3) 0;
  border-bottom: 1px solid var(--os-line);
}
.vt-db-list > li:last-child { border-bottom: 0; }
.vt-feed-time { font-size: var(--os-text-xs); color: var(--os-ink-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vt-activity { display: grid; }
.vt-activity > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--os-space-1);
  padding: var(--os-space-3) 0;
  border-bottom: 1px solid var(--os-line);
}
.vt-activity > li:last-child { border-bottom: 0; }
@media (min-width: 640px) {
  .vt-activity > li { grid-template-columns: 9rem 6.5rem minmax(0, 1fr); align-items: baseline; gap: var(--os-space-3); }
}

/* Databases: one card per vector namespace */
.vt-db-card { display: flex; flex-direction: column; gap: var(--os-space-4); }
.vt-db-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--os-space-2); }
.vt-db-card .vt-ns {
  font-family: var(--os-font-mono);
  font-size: var(--os-text-xs);
  color: var(--os-ink-muted);
  overflow-wrap: anywhere;
  margin-top: var(--os-space-1);
}
.vt-db-card-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--os-space-2); }
.vt-db-card.is-personal { border-color: var(--vt-accent-line); }
.vt-sources-label { font-size: var(--os-text-xs); color: var(--os-ink-dim); margin-bottom: var(--os-space-1); }
.vt-sources > li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--os-space-2);
  padding: var(--os-space-1) 0;
  font-size: var(--os-text-sm);
}
.vt-sources > li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.vt-branch {
  font-family: var(--os-font-mono);
  font-size: var(--os-text-xs);
  color: var(--vt-accent);
  background: var(--vt-accent-wash);
  border-radius: var(--os-radius-sm);
  padding: 0.05rem 0.4rem;
  white-space: nowrap;
}
.vt-db-new { border-style: dashed; }

/* Files: upload progress and the column finder */
.vt-upload-progress { margin-bottom: var(--os-space-5); }
.vt-finder {
  display: flex;
  flex-direction: column;
  height: 37.5rem;
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-lg);
  background: var(--os-surface);
  overflow: hidden;
}
@media (max-width: 899px) { .vt-finder { height: 30rem; } }
.vt-finder-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-2) var(--os-space-3);
  padding: var(--os-space-3) var(--os-space-4);
  border-bottom: 1px solid var(--os-line);
}
.vt-finder-head .os-input { max-width: 20rem; }
.vt-finder-cols {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.vt-finder-col {
  width: 16rem;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  border-right: 1px solid var(--os-line);
  padding: var(--os-space-2);
}
@media (max-width: 599px) { .vt-finder-col { width: 13.5rem; } }
.vt-finder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-2);
  width: 100%;
  min-height: 2.25rem;
  padding: var(--os-space-2);
  border: 0;
  border-radius: var(--os-radius-md);
  background: transparent;
  color: var(--os-ink-muted);
  font: inherit;
  font-size: var(--os-text-sm);
  text-align: left;
  cursor: pointer;
}
.vt-finder-item > span { display: flex; align-items: center; gap: var(--os-space-2); min-width: 0; }
.vt-finder-item:hover { background: var(--os-fill); color: var(--os-ink); }
.vt-finder-item.is-folder .vt-icon { color: var(--os-ink); }
.vt-finder-item.is-selected { background: var(--vt-accent-wash); color: var(--os-ink); font-weight: var(--os-weight-medium); }
.vt-finder-item.is-selected .vt-icon { color: var(--vt-accent); }
.vt-finder-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--os-space-2);
  padding: var(--os-space-6);
  color: var(--os-ink-muted);
  font-size: var(--os-text-sm);
  text-align: center;
}
.vt-finder-preview {
  width: 20rem;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  padding: var(--os-space-5);
  display: flex;
  flex-direction: column;
  gap: var(--os-space-4);
  background: var(--os-surface-2);
}
@media (max-width: 599px) { .vt-finder-preview { width: 17rem; } }
.vt-finder-preview h4 { font-size: var(--os-text-md); overflow-wrap: anywhere; }
.vt-finder-preview .os-kv > div { grid-template-columns: 5rem minmax(0, 1fr); }
.vt-finder-preview-actions { margin-top: auto; display: grid; gap: var(--os-space-2); }

/* Repositories: routing canvas. The SVG sits behind the cards and is drawn
   from their positions, so it scrolls with them. */
.vt-routing { position: relative; padding-bottom: var(--os-space-8); }
.vt-routing-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}
.vt-routing > :not(svg) { position: relative; z-index: 1; }
.vt-routing .vt-route-menu { z-index: 50; }
.vt-repo:has(.vt-route-menu:not(.hidden)) { z-index: 3; }
/* When branch rows stack, lines would cut through the text: the
   "N destinations" control carries the route on its own. */
@media (max-width: 1099px) {
  .vt-routing-svg, .vt-port, .vt-source-port { display: none; }
  .vt-targets { margin-bottom: var(--os-space-6); }
}
.vt-routing-heading { font-size: var(--os-text-sm); font-weight: var(--os-weight-medium); color: var(--os-ink-muted); margin-bottom: var(--os-space-3); }
.vt-targets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--os-space-4);
  margin-bottom: var(--os-space-10);
}
.db-target-node {
  position: relative;
  width: 13rem;
  max-width: 100%;
  padding: var(--os-space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--os-space-1);
  text-align: center;
  background: var(--os-surface);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-radius-lg);
}
@media (max-width: 599px) { .db-target-node { width: calc(50% - var(--os-space-2)); } }
.db-target-node .vt-ns { font-family: var(--os-font-mono); font-size: var(--os-text-xs); color: var(--os-ink-dim); max-width: 100%; }
.db-target-node.is-personal { border-color: var(--vt-accent-line); }
.vt-port {
  position: absolute;
  bottom: -0.45rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.9rem;
  height: 0.9rem;
  border-radius: var(--os-radius-full);
  background: var(--os-bg);
  border: 2px solid var(--os-ink-muted);
}
.db-target-node.is-personal .vt-port { border-color: var(--vt-accent); }
.vt-source-port {
  position: absolute;
  top: calc(-1 * var(--os-space-2));
  left: 50%;
  transform: translateX(-50%);
  width: 0.8rem;
  height: 0.8rem;
  border-radius: var(--os-radius-full);
  background: var(--os-bg);
  border: 2px solid var(--os-line-strong);
}
.route-line {
  fill: none;
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
  opacity: 0.85;
}
.route-line-personal { stroke: var(--vt-accent); }
.route-line-global { stroke: var(--os-ink-muted); }
/* Moves only while a branch is really syncing. */
.route-line.syncing-active {
  stroke-width: 2.5;
  opacity: 1;
  animation: vt-route-flow 0.8s linear infinite;
}
@keyframes vt-route-flow { to { stroke-dashoffset: -24; } }

.vt-repo { padding: 0; overflow: visible; }
.vt-repo + .vt-repo { margin-top: var(--os-space-5); }
.vt-repo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-3);
  padding: var(--os-space-4) var(--os-space-5);
  border-bottom: 1px solid var(--os-line);
}
.vt-repo-head h3 { font-size: var(--os-text-md); overflow-wrap: anywhere; }
.vt-branch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--os-space-4);
  padding: var(--os-space-5);
  border-bottom: 1px solid var(--os-line);
}
.vt-branch-row:last-child { border-bottom: 0; }
@media (min-width: 1100px) {
  .vt-branch-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 6rem minmax(0, 1.2fr); align-items: start; }
}
.vt-cell-label { font-size: var(--os-text-xs); color: var(--os-ink-dim); margin-bottom: var(--os-space-1); }
.vt-commit {
  margin-top: var(--os-space-3);
  padding: var(--os-space-3);
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-md);
  background: var(--os-surface-2);
}
.vt-commit-msg { font-size: var(--os-text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-commit-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--os-space-2); margin-top: var(--os-space-1); font-size: var(--os-text-xs); color: var(--os-ink-dim); }
.vt-sync-state { margin-top: var(--os-space-2); font-size: var(--os-text-xs); display: inline-flex; align-items: center; gap: var(--os-space-1); }
.vt-route-cell { position: relative; padding-top: var(--os-space-2); }
.routing-dropdown { position: relative; }
.vt-route-trigger { width: 100%; justify-content: space-between; }
.vt-route-menu {
  position: absolute;
  top: calc(100% + var(--os-space-2));
  left: 0;
  z-index: 50;
  width: min(18rem, calc(100vw - 2 * var(--os-space-4)));
  background: var(--os-surface);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-radius-lg);
  box-shadow: var(--os-shadow-lg);
  overflow: hidden;
}
.vt-route-menu-group { padding: var(--os-space-2) var(--os-space-3) var(--os-space-1); font-size: var(--os-text-xs); color: var(--os-ink-dim); }
.vt-route-menu label {
  display: flex;
  align-items: center;
  gap: var(--os-space-2);
  padding: var(--os-space-2) var(--os-space-3);
  font-size: var(--os-text-sm);
  cursor: pointer;
}
.vt-route-menu label:hover { background: var(--os-fill); }
.vt-route-menu input { width: 1rem; height: 1rem; accent-color: var(--os-ink); flex-shrink: 0; }
.vt-route-menu-list { max-height: 10rem; overflow-y: auto; }
.vt-route-menu-foot { padding: var(--os-space-3); border-top: 1px solid var(--os-line); }
.vt-branch-actions { display: flex; flex-wrap: wrap; gap: var(--os-space-2); justify-content: flex-start; }
@media (min-width: 1100px) { .vt-branch-actions { justify-content: flex-end; } }
.vt-sync-progress { display: grid; gap: var(--os-space-2); }
.vt-sync-progress-head { display: flex; justify-content: space-between; gap: var(--os-space-2); font-size: var(--os-text-xs); }
.vt-sync-progress-head > span:first-child { display: inline-flex; align-items: center; gap: var(--os-space-1); }
.vt-log {
  height: 8rem;
  overflow-y: auto;
  padding: var(--os-space-2) var(--os-space-3);
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-md);
  background: var(--vt-code-bg);
  font-family: var(--os-font-mono);
  font-size: var(--os-text-xs);
  color: var(--os-ink-muted);
  display: flex;
  flex-direction: column;
  gap: var(--os-space-1);
}
.vt-log-line { overflow-wrap: anywhere; }
.vt-log-line b { font-weight: var(--os-weight-bold); }

/* Data modals */
.vt-modal-section + .vt-modal-section { margin-top: var(--os-space-5); }
.vt-ext-grid { grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); }
.vt-check-list {
  max-height: 10rem;
  overflow-y: auto;
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-md);
  padding: var(--os-space-1);
}
.vt-check-list label {
  display: flex;
  align-items: center;
  gap: var(--os-space-2);
  padding: var(--os-space-2);
  border-radius: var(--os-radius-sm);
  font-size: var(--os-text-sm);
  cursor: pointer;
}
.vt-check-list label:hover { background: var(--os-fill); }
.vt-check-list input { width: 1rem; height: 1rem; accent-color: var(--os-ink); flex-shrink: 0; }
.vt-repo-list { max-height: 22rem; }
.vt-repo-list button { display: flex; align-items: center; justify-content: space-between; gap: var(--os-space-2); width: 100%; }
.vt-repo-list button > span { display: grid; gap: var(--os-space-1); min-width: 0; }
.vt-modal-actions { display: grid; gap: var(--os-space-2); margin-top: var(--os-space-5); }

/* dashboard: org tabs (team, audit log, billing, integrations) and their modals */
.vt-dash-alert { margin-bottom: var(--os-space-6); }
.vt-dash-alert p + p { margin-top: var(--os-space-2); }
.vt-dash-alert a { color: var(--os-ink); }
.vt-inline-form { margin: 0; display: inline-flex; }
.vt-ink { color: var(--os-ink); }

/* Request inbox: one row per pending decision, hairlines between */
.vt-requests { border: 1px solid var(--os-line); border-radius: var(--os-radius-lg); background: var(--os-surface); }
.vt-request {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--os-space-3);
  padding: var(--os-space-4);
  border-top: 1px solid var(--os-line);
  transition: opacity var(--os-motion-slow) var(--os-ease);
}
.vt-request:first-child { border-top: 0; }
.vt-request-who { display: flex; gap: var(--os-space-3); align-items: flex-start; min-width: 0; flex: 1 1 18rem; }
.vt-request-who > div { min-width: 0; }
.vt-request-who .vt-h3 { overflow-wrap: anywhere; }
.vt-request-actions { flex-shrink: 0; }

/* Member and seat tables */
.vt-person { display: flex; align-items: center; gap: var(--os-space-3); min-width: 12rem; }
.vt-person-name { font-weight: var(--os-weight-medium); }
.vt-members td { vertical-align: middle; }
.vt-select-sm { min-height: 2rem; padding-block: var(--os-space-1); width: auto; min-width: 7rem; }
.vt-filter-select { width: auto; max-width: 14rem; }
.vt-row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--os-space-2); }

/* A row's overflow menu: <details> so it opens on click and from the keyboard */
.vt-menu { position: relative; }
.vt-menu > summary { list-style: none; cursor: pointer; }
.vt-menu > summary::-webkit-details-marker { display: none; }
.vt-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--os-space-1));
  z-index: 20;
  min-width: 14rem;
  display: grid;
  padding: var(--os-space-1);
  background: var(--os-surface);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-radius-md);
  box-shadow: var(--os-shadow-md);
  text-align: left;
}
.vt-menu-panel button {
  font: inherit;
  font-size: var(--os-text-sm);
  text-align: left;
  color: var(--os-ink);
  background: none;
  border: 0;
  border-radius: var(--os-radius-sm);
  padding: var(--os-space-2) var(--os-space-3);
  min-height: 2.25rem;
  cursor: pointer;
}
.vt-menu-panel button:hover { background: var(--os-fill); }
.vt-menu-panel button.vt-bad { color: var(--os-danger); }

/* Billing */
@media (min-width: 1024px) { .vt-usage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vt-stat-of { font-size: var(--os-text-sm); font-weight: var(--os-weight-regular); color: var(--os-ink-muted); letter-spacing: 0; }
.vt-stat-meter { margin-top: var(--os-space-3); }
.vt-stat-meter .os-meter-fill { background: var(--vt-accent); }
.vt-usage-list { display: grid; max-height: 12rem; overflow-y: auto; }
.vt-usage-row {
  display: flex;
  justify-content: space-between;
  gap: var(--os-space-3);
  padding: var(--os-space-2) 0;
  border-bottom: 1px solid var(--os-line);
  font-size: var(--os-text-sm);
}
.vt-usage-row:last-child { border-bottom: 0; }
.vt-chart { position: relative; height: 18rem; }
@media (max-width: 599px) { .vt-chart { height: 14rem; } }
.vt-grid-2-wide > .os-card { align-content: start; }
.vt-price-list { display: grid; margin: 0; }
.vt-price-list > div {
  display: flex;
  justify-content: space-between;
  gap: var(--os-space-3);
  padding: var(--os-space-2) 0;
  border-bottom: 1px solid var(--os-line);
  font-size: var(--os-text-sm);
}
.vt-price-list > div:last-child { border-bottom: 0; }
.vt-price-list dd { margin: 0; white-space: nowrap; }

/* Modals: chip lists and invite links */
.vt-chip-list { max-height: 22rem; overflow-y: auto; }
.vt-chip-scroll { max-height: 12rem; }
@media (max-width: 479px) { .vt-chip-list.os-grid-chips { grid-template-columns: minmax(0, 1fr); } }
.vt-join-code { letter-spacing: 0.15em; text-align: center; }
.vt-input-short { max-width: 8rem; }
.vt-invite-links { display: grid; gap: var(--os-space-2); max-height: 14rem; overflow-y: auto; }
.vt-invite-link {
  display: grid;
  grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--os-space-2);
}
@media (max-width: 599px) { .vt-invite-link { grid-template-columns: minmax(0, 1fr) auto; } .vt-invite-link > span { grid-column: 1 / -1; } }
.vt-invite-url { font-size: var(--os-text-xs); }

/* On a phone a table whose rows are records (log entries, people,
   connections) stacks each row instead of scrolling sideways. Cells with a
   data-label show it before the value; the header stays for screen readers. */
@media (max-width: 599px) {
  .vt-stack-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .vt-stack-table,
  .vt-stack-table tbody,
  .vt-stack-table tr,
  .vt-stack-table td { display: block; width: 100%; }
  .vt-stack-table tr { padding: var(--os-space-3); border-bottom: 1px solid var(--os-line); }
  .vt-stack-table tbody tr:last-child { border-bottom: 0; }
  .vt-stack-table td { border: 0; padding: var(--os-space-1) 0; }
  .vt-stack-table tbody tr:hover td { background: none; }
  .vt-stack-table td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--os-ink-dim);
    font-family: var(--os-font);
    font-size: var(--os-text-xs);
  }
  .vt-stack-table .vt-cell-end { text-align: left; padding-top: var(--os-space-2); }
  .vt-stack-table .vt-menu-panel { right: auto; left: 0; }
}
/* ==== end section: dashboard ============================================ */

/* ==== section: workspace ================================================ */
/* The workspace: a full height chat app, modelled on BSL Nexus. Panes are
   projects | conversation | context. The two side panes keep the widths
   the resizers in workspace.js set inline, so the grid columns are auto.
   Below 1180px the context pane is a slide over, below 900px the project
   list is too, and the conversation takes the screen. */
.vt-app {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 0; /* height: set under the shell header in section 6 */
  background: var(--os-bg);
}

.vt-ws-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  background: var(--os-surface);
  border-right: 1px solid var(--os-line);
}
.vt-ws-pane-context { border-right: 0; border-left: 1px solid var(--os-line); }

.vt-ws-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: -3px;
  width: 6px;
  cursor: col-resize;
  z-index: 5;
}
.vt-ws-pane-context .vt-ws-resizer { right: auto; left: -3px; }
.vt-ws-resizer:hover { background: var(--os-line-strong); }

.vt-ws-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-2);
  padding: var(--os-space-2) var(--os-space-3);
  border-bottom: 1px solid var(--os-line);
  min-height: 3rem;
  flex-shrink: 0;
}
.vt-ws-pane-title {
  font-size: var(--os-text-2xs);
  font-weight: var(--os-weight-bold);
  letter-spacing: var(--os-tracking-wide);
  text-transform: uppercase;
  color: var(--os-ink-dim);
}
.vt-ws-pane-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--os-space-2);
}
.vt-ws-pane-tools {
  display: grid;
  gap: var(--os-space-2);
  padding: var(--os-space-3);
  border-bottom: 1px solid var(--os-line);
  flex-shrink: 0;
}
.vt-ws-close { display: none; }

/* Icon buttons inside panes and the conversation head */
.vt-ws-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--os-radius-md);
  background: none;
  color: var(--os-ink-muted);
  cursor: pointer;
  transition: background var(--os-motion-fast) var(--os-ease), color var(--os-motion-fast) var(--os-ease);
}
.vt-ws-icon-btn:hover { background: var(--os-fill); color: var(--os-ink); }
.vt-ws-icon-btn.is-danger:hover { color: var(--os-danger); background: var(--os-danger-wash); }
.vt-ws-icon-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.vt-ws-icon-btn .vt-icon { width: 1rem; height: 1rem; }

/* A menu that drops from a button: personas, databases, engines */
.vt-ws-menu-wrap { position: relative; }
.vt-ws-menu {
  position: absolute;
  top: calc(100% + var(--os-space-1));
  left: 0;
  z-index: 50;
  width: 17rem;
  max-width: calc(100vw - 2rem);
  padding: var(--os-space-2);
  background: var(--os-surface);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-radius-lg);
  box-shadow: var(--os-shadow-lg);
}
.vt-ws-menu-up { top: auto; bottom: calc(100% + var(--os-space-1)); }
.vt-ws-menu-end { left: auto; right: 0; }
.vt-ws-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-2);
  padding: 0 var(--os-space-1) var(--os-space-2);
  margin-bottom: var(--os-space-1);
  border-bottom: 1px solid var(--os-line);
  font-size: var(--os-text-sm);
  font-weight: var(--os-weight-medium);
}
.vt-ws-menu-list { max-height: 14rem; overflow-y: auto; display: grid; gap: 2px; }
.vt-ws-check {
  display: flex;
  align-items: center;
  gap: var(--os-space-2);
  padding: var(--os-space-2);
  border-radius: var(--os-radius-sm);
  font-size: var(--os-text-sm);
  color: var(--os-ink-muted);
  cursor: pointer;
  min-width: 0;
}
.vt-ws-check:hover { background: var(--os-fill); color: var(--os-ink); }
.vt-ws-check input { width: 0.95rem; height: 0.95rem; flex-shrink: 0; accent-color: var(--vt-accent); }
.vt-ws-check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-ws-count {
  margin-left: auto;
  font-size: var(--os-text-xs);
  color: var(--vt-accent);
  background: var(--vt-accent-wash);
  border-radius: var(--os-radius-full);
  padding: 0 var(--os-space-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vt-ws-menu-btn { width: 100%; justify-content: flex-start; }
.vt-ws-menu-btn .vt-ws-count { margin-left: auto; }

/* ---------- Project list ---------- */
.vt-ws-projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.vt-ws-projects > *, .vt-ws-pane-tools > * { min-width: 0; }
.project-item { border-radius: var(--os-radius-md); border-left: 2px solid transparent; }
.project-item.is-active { background: var(--vt-accent-wash); border-left-color: var(--vt-accent); }
.vt-ws-project-row {
  display: flex;
  align-items: center;
  gap: var(--os-space-1);
  padding-right: var(--os-space-1);
  border-radius: var(--os-radius-md);
}
.vt-ws-project-row:hover { background: var(--os-fill); }
.project-item.is-active .vt-ws-project-row:hover { background: transparent; }
.vt-ws-project-main {
  display: flex;
  align-items: center;
  gap: var(--os-space-2);
  flex: 1;
  min-width: 0;
  padding: var(--os-space-2);
  cursor: pointer;
  color: var(--os-ink-muted);
}
.vt-ws-project-main:hover, .project-item.is-active .vt-ws-project-main { color: var(--os-ink); }
.project-item.is-active .vt-ws-project-main .vt-icon { color: var(--vt-accent); }
.vt-ws-project-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--os-text-sm);
}
.project-item.is-active .vt-ws-project-name { font-weight: var(--os-weight-medium); }
.vt-ws-project-tag { font-size: var(--os-text-2xs); color: var(--os-ink-dim); white-space: nowrap; }
.vt-ws-project-row .vt-ws-reveal { opacity: 0; }
.vt-ws-project-row:hover .vt-ws-reveal,
.vt-ws-project-row:focus-within .vt-ws-reveal,
.project-item.is-active .vt-ws-reveal { opacity: 1; }
@media (hover: none) { .vt-ws-project-row .vt-ws-reveal { opacity: 1; } }

.vt-ws-children {
  margin: 0 0 var(--os-space-2) var(--os-space-4);
  padding-left: var(--os-space-2);
  border-left: 1px solid var(--os-line);
}
.vt-ws-sub-label {
  padding: var(--os-space-3) var(--os-space-2) var(--os-space-1);
  font-size: var(--os-text-xs);
  color: var(--os-ink-dim);
}
.vt-ws-session {
  display: flex;
  align-items: center;
  gap: var(--os-space-1);
  border-radius: var(--os-radius-sm);
  font-size: var(--os-text-sm);
  color: var(--os-ink-muted);
}
.vt-ws-session:hover { background: var(--os-fill); color: var(--os-ink); }
.vt-ws-session.is-active { color: var(--os-ink); background: var(--os-fill-strong); }
.vt-ws-session-main {
  display: flex;
  align-items: center;
  gap: var(--os-space-2);
  flex: 1;
  min-width: 0;
  padding: var(--os-space-1) var(--os-space-2);
  cursor: pointer;
}
.vt-ws-session-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-ws-session .vt-ws-icon-btn { width: 1.6rem; height: 1.6rem; opacity: 0; }
.vt-ws-session:hover .vt-ws-icon-btn, .vt-ws-session:focus-within .vt-ws-icon-btn { opacity: 1; }
@media (hover: none) { .vt-ws-session .vt-ws-icon-btn { opacity: 1; } }

/* Small centred states inside panes and the conversation */
.vt-ws-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--os-space-2);
  padding: var(--os-space-8) var(--os-space-3);
  font-size: var(--os-text-sm);
  color: var(--os-ink-dim);
  text-align: center;
}
.vt-ws-state .vt-icon { width: 1.25rem; height: 1.25rem; }
.vt-ws-state-sm { padding: var(--os-space-3) var(--os-space-2); font-size: var(--os-text-xs); }
.vt-ws-state.is-error { color: var(--os-danger); }

/* ---------- Conversation ---------- */
.vt-ws-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--os-bg);
}
.vt-ws-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--os-space-2) var(--os-space-3);
  padding: var(--os-space-2) var(--os-space-3);
  border-bottom: 1px solid var(--os-line);
  background: var(--os-surface);
  flex-shrink: 0;
}
.vt-ws-title-row {
  display: flex;
  align-items: center;
  gap: var(--os-space-1);
  flex: 1 1 14rem;
  min-width: 0;
}
.vt-ws-title {
  font-size: var(--os-text-md);
  font-weight: var(--os-weight-bold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
#mobileProjectName { display: none; }
.vt-ws-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--os-space-2);
}
.vt-ws-field { display: inline-flex; align-items: center; gap: var(--os-space-1); }
.vt-ws-field > .os-label { margin: 0; font-size: var(--os-text-xs); white-space: nowrap; }
.vt-ws-field .os-select { min-height: 2rem; padding-block: var(--os-space-1); font-size: var(--os-text-sm); width: auto; max-width: 16rem; }

.vt-ws-banner {
  padding: var(--os-space-2) var(--os-space-4);
  border-bottom: 1px solid var(--os-line);
  font-size: var(--os-text-sm);
  display: flex;
  align-items: center;
  gap: var(--os-space-2);
  flex-shrink: 0;
}
.vt-ws-banner.is-danger { background: var(--os-danger-wash); color: var(--os-danger); }
.vt-ws-banner.is-warn { background: var(--os-warn-wash); color: var(--os-warn); }

/* Sync progress: a thin bar with a plain status line */
.vt-ws-sync {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-3);
  padding: var(--os-space-1) var(--os-space-4);
  border-bottom: 1px solid var(--os-line);
  font-size: var(--os-text-xs);
  color: var(--os-ink-muted);
  overflow: hidden;
  flex-shrink: 0;
}
.vt-ws-sync-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: var(--vt-accent);
  transition: width var(--os-motion-slow) var(--os-ease);
}
.vt-ws-sync-label { display: inline-flex; align-items: center; gap: var(--os-space-2); min-width: 0; }
.vt-ws-sync-label strong { color: var(--os-ink); font-weight: var(--os-weight-medium); }

/* Chat sessions as tabs */
.vt-ws-tabs {
  display: flex;
  align-items: center;
  gap: var(--os-space-2);
  padding: var(--os-space-2) var(--os-space-3);
  border-bottom: 1px solid var(--os-line);
  background: var(--os-surface);
  flex-shrink: 0;
  min-width: 0;
}
#chatTabs {
  display: flex;
  gap: var(--os-space-1);
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
}
#chatTabs::-webkit-scrollbar { display: none; }
.vt-ws-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--os-space-1);
  flex-shrink: 0;
  max-width: 14rem;
  min-height: 2rem;
  padding: 0 var(--os-space-1) 0 var(--os-space-3);
  border: 1px solid transparent;
  border-radius: var(--os-radius-md);
  font-size: var(--os-text-sm);
  color: var(--os-ink-muted);
  cursor: pointer;
}
.vt-ws-tab:hover { background: var(--os-fill); color: var(--os-ink); }
.vt-ws-tab.is-active { background: var(--os-fill-strong); border-color: var(--os-line); color: var(--os-ink); font-weight: var(--os-weight-medium); }
.vt-ws-tab > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-ws-tab .vt-ws-icon-btn { width: 1.5rem; height: 1.5rem; opacity: 0; }
.vt-ws-tab:hover .vt-ws-icon-btn, .vt-ws-tab.is-active .vt-ws-icon-btn, .vt-ws-tab:focus-within .vt-ws-icon-btn { opacity: 1; }
@media (hover: none) { .vt-ws-tab .vt-ws-icon-btn { opacity: 1; } }
.vt-ws-tabs-empty { display: inline-flex; align-items: center; gap: var(--os-space-2); font-size: var(--os-text-sm); color: var(--os-ink-dim); }

/* The log: every turn is centred at a reading width */
#chatHistory {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  padding: var(--os-space-6) var(--os-space-4) var(--os-space-8);
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { #chatHistory { scroll-behavior: auto; } }
#chatHistory > * { max-width: var(--vt-chat-max); margin-inline: auto; }
#chatHistory > * + * { margin-top: var(--os-space-6); }
.vt-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--os-space-2);
  min-height: 60%;
  color: var(--os-ink-dim);
  font-size: var(--os-text-sm);
  text-align: center;
}
.vt-chat-empty .vt-icon { width: 1.5rem; height: 1.5rem; }
.vt-chat-empty strong { color: var(--os-ink); font-size: var(--os-text-md); font-weight: var(--os-weight-medium); }

.vt-turn { display: flex; flex-direction: column; gap: var(--os-space-2); }
.vt-turn-user { align-items: flex-end; }
.vt-bubble {
  max-width: min(85%, 40rem);
  padding: var(--os-space-3) var(--os-space-4);
  border-radius: var(--os-radius-lg);
  background: var(--os-inverse-bg);
  color: var(--os-inverse-ink);
  font-size: var(--os-text-base);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.vt-turn-text { white-space: pre-wrap; }
.vt-turn-role { font-size: var(--os-text-xs); color: var(--os-ink-dim); font-weight: var(--os-weight-medium); }
.vt-turn-body { min-width: 0; }
.vt-turn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--os-space-1);
  margin-top: var(--os-space-3);
  opacity: 0;
  transition: opacity var(--os-motion-fast) var(--os-ease);
}
.vt-turn:hover .vt-turn-actions, .vt-turn:focus-within .vt-turn-actions { opacity: 1; }
@media (hover: none) { .vt-turn-actions { opacity: 1; } }

.vt-attachments { display: flex; flex-wrap: wrap; gap: var(--os-space-2); margin-top: var(--os-space-2); }
.vt-attachment {
  display: inline-flex;
  align-items: center;
  gap: var(--os-space-1);
  max-width: 12rem;
  padding: var(--os-space-1) var(--os-space-2);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-radius-full);
  font-size: var(--os-text-xs);
  color: inherit;
  text-decoration: none;
}
.vt-attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-turn-user .vt-attachment { border-color: currentColor; }

/* Rendered markdown */
.vt-md { font-size: var(--os-text-md); line-height: 1.65; color: var(--os-ink); overflow-wrap: anywhere; }
.vt-md > *:first-child { margin-top: 0; }
.vt-md > *:last-child { margin-bottom: 0; }
.vt-md p { margin: 0 0 var(--os-space-3); }
.vt-md h1, .vt-md h2, .vt-md h3, .vt-md h4 {
  margin: var(--os-space-5) 0 var(--os-space-2);
  font-size: var(--os-text-md);
  font-weight: var(--os-weight-bold);
  line-height: 1.35;
}
.vt-md h1 { font-size: var(--os-text-lg); }
.vt-md ul, .vt-md ol { margin: 0 0 var(--os-space-3); padding-left: var(--os-space-5); }
.vt-md ul { list-style: disc; }
.vt-md ol { list-style: decimal; }
.vt-md li { margin-bottom: var(--os-space-1); }
.vt-md a { color: var(--os-ink); text-underline-offset: 2px; }
.vt-md strong { font-weight: var(--os-weight-bold); }
.vt-md blockquote { margin: 0 0 var(--os-space-3); padding-left: var(--os-space-3); border-left: 2px solid var(--os-line-strong); color: var(--os-ink-muted); }
.vt-md :not(pre) > code {
  font-family: var(--os-font-mono);
  font-size: 0.88em;
  background: var(--os-fill-strong);
  padding: 0.1em 0.35em;
  border-radius: var(--os-radius-sm);
}
.vt-md hr { border: 0; border-top: 1px solid var(--os-line); margin: var(--os-space-5) 0; }
.vt-md table { width: 100%; border-collapse: collapse; margin: 0 0 var(--os-space-3); font-size: var(--os-text-sm); display: block; overflow-x: auto; }
.vt-md th, .vt-md td { border-bottom: 1px solid var(--os-line); padding: var(--os-space-2); text-align: left; }
.vt-md th { color: var(--os-ink-muted); font-weight: var(--os-weight-medium); }

/* Retrieved sources: the accent's job */
.vt-ws-cite {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin: 0 0.15em;
  padding: 0 0.45em;
  border-radius: var(--os-radius-sm);
  background: var(--vt-accent-wash);
  color: var(--vt-accent);
  font-family: var(--os-font-mono);
  font-size: var(--os-text-xs);
  line-height: 1.7;
  vertical-align: 0.05em;
  overflow-wrap: anywhere;
}
.vt-ws-cite .vt-icon { width: 0.85em; height: 0.85em; }

/* Code blocks from the markdown renderer */
.vt-codeblock {
  margin: 0 0 var(--os-space-4);
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-md);
  overflow: hidden;
  background: var(--vt-code-bg);
}
.vt-codeblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-2);
  padding: var(--os-space-1) var(--os-space-1) var(--os-space-1) var(--os-space-3);
  border-bottom: 1px solid var(--os-line);
  background: var(--os-fill);
}
.vt-codeblock-lang { font-family: var(--os-font-mono); font-size: var(--os-text-xs); color: var(--os-ink-dim); }
.vt-codeblock pre { margin: 0; padding: var(--os-space-3) var(--os-space-4); overflow-x: auto; background: none; }
.vt-codeblock code, #artifactContent {
  font-family: var(--os-font-mono);
  font-size: var(--os-text-sm);
  line-height: 1.6;
  white-space: pre;
  background: none;
  color: var(--os-ink);
}
.vt-copied { color: var(--os-success); }

/* Prism tokens on OS colours, so code reads in both themes */
.vt-app .token.comment, .vt-app .token.prolog, .vt-app .token.doctype, .vt-app .token.cdata { color: var(--os-ink-dim); font-style: italic; }
.vt-app .token.punctuation, .vt-app .token.operator { color: var(--os-ink-muted); }
.vt-app .token.keyword, .vt-app .token.boolean, .vt-app .token.important, .vt-app .token.atrule { color: var(--os-ink); font-weight: var(--os-weight-bold); }
.vt-app .token.string, .vt-app .token.char, .vt-app .token.attr-value, .vt-app .token.regex { color: var(--os-success); }
.vt-app .token.number, .vt-app .token.constant, .vt-app .token.symbol { color: var(--os-warn); }
.vt-app .token.function, .vt-app .token.class-name, .vt-app .token.tag, .vt-app .token.selector { color: var(--vt-accent); }
.vt-app .token.property, .vt-app .token.attr-name, .vt-app .token.variable { color: var(--os-info); }

/* Context line above the log after a reply */
#contextMetadataBadge {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--os-space-1) var(--os-space-4);
  padding: var(--os-space-2) var(--os-space-3);
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-md);
  background: var(--os-surface);
  font-size: var(--os-text-xs);
  color: var(--os-ink-muted);
}
#contextMetadataBadge strong { color: var(--os-ink); font-weight: var(--os-weight-medium); }
#contextMetadataBadge .is-retrieved strong { color: var(--vt-accent); }

/* Memory boundary: everything above is outside the model's memory */
.context-boundary-line {
  display: flex;
  align-items: center;
  gap: var(--os-space-3);
  color: var(--os-ink-dim);
  font-size: var(--os-text-xs);
}
.context-boundary-line::before, .context-boundary-line::after { content: ''; flex: 1; height: 1px; background: var(--os-line-strong); }

.vt-ws-status { display: inline-flex; align-items: center; gap: var(--os-space-2); font-size: var(--os-text-sm); color: var(--os-ink-muted); }
.vt-ws-status.is-error { color: var(--os-danger); }
.vt-ws-status.is-warn { color: var(--os-warn); }

/* ---------- Composer ---------- */
.vt-ws-composer {
  border-top: 1px solid var(--os-line);
  background: var(--os-surface);
  padding: var(--os-space-3) var(--os-space-4) var(--os-space-4);
  flex-shrink: 0;
}
.vt-ws-composer-inner { max-width: var(--vt-chat-max); margin: 0 auto; }
.vt-ws-composer-box {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-radius-lg);
  background: var(--os-surface);
  transition: border-color var(--os-motion-fast) var(--os-ease);
}
.vt-ws-composer-box:focus-within { border-color: var(--os-focus); }
.vt-ws-composer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--os-space-1) var(--os-space-2);
  padding: var(--os-space-2);
  border-bottom: 1px solid var(--os-line);
}
.vt-ws-sep { width: 1px; align-self: stretch; background: var(--os-line); margin-inline: var(--os-space-1); }
.vt-ws-spacer { margin-left: auto; }
.vt-ws-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--os-space-1);
  min-height: 1.85rem;
  padding: 0 var(--os-space-2);
  border-radius: var(--os-radius-sm);
  font-size: var(--os-text-sm);
  color: var(--os-ink-muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.vt-ws-toggle:hover { background: var(--os-fill); color: var(--os-ink); }
.vt-ws-toggle input { width: 0.9rem; height: 0.9rem; accent-color: var(--vt-accent); margin: 0; }
.vt-ws-toggle:has(input:checked) { color: var(--os-ink); }
.vt-ws-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--os-space-1);
  min-height: 1.85rem;
  padding: 0 var(--os-space-2);
  border: 1px solid transparent;
  border-radius: var(--os-radius-sm);
  background: none;
  font: inherit;
  font-size: var(--os-text-sm);
  color: var(--os-ink-muted);
  cursor: pointer;
  white-space: nowrap;
}
.vt-ws-chip-btn:hover { background: var(--os-fill); color: var(--os-ink); }
.vt-ws-chip-btn.is-done { color: var(--os-success); }
#webSiteFilters { display: flex; align-items: center; gap: var(--os-space-1); padding-left: var(--os-space-1); border-left: 1px solid var(--os-line); }
#webSiteFilters.hidden { display: none; }
.vt-ws-slider {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--os-space-3);
  padding: var(--os-space-2) var(--os-space-3);
  border-bottom: 1px solid var(--os-line);
  font-size: var(--os-text-xs);
  color: var(--os-ink-muted);
}
.vt-ws-slider input[type=range] { width: 100%; accent-color: var(--vt-accent); }
.vt-ws-slider output { font-family: var(--os-font-mono); color: var(--os-ink); font-variant-numeric: tabular-nums; }
#promptAttachmentsPreview { display: flex; flex-wrap: wrap; gap: var(--os-space-2); padding: var(--os-space-2) var(--os-space-3) 0; }
#promptAttachmentsPreview:empty { display: none; }
.vt-ws-thumb {
  position: relative;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-radius-md);
  overflow: hidden;
  background: var(--os-fill);
  color: var(--os-ink-muted);
}
.vt-ws-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vt-ws-thumb-ext { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: var(--os-text-2xs); }
.vt-ws-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 1.1rem;
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--os-radius-sm);
  background: var(--os-inverse-bg);
  color: var(--os-inverse-ink);
  cursor: pointer;
}
.vt-ws-thumb-remove .vt-icon { width: 0.7rem; height: 0.7rem; }
.vt-ws-input-row { display: flex; align-items: flex-end; gap: var(--os-space-2); padding: var(--os-space-2) var(--os-space-2) var(--os-space-2) var(--os-space-3); }
#promptInput {
  flex: 1;
  min-width: 0;
  min-height: 2.25rem;
  max-height: 16rem;
  padding: var(--os-space-2) 0;
  border: 0;
  outline: none;
  resize: none;
  background: none;
  font: inherit;
  font-size: var(--os-text-md);
  line-height: 1.5;
  color: var(--os-ink);
}
#promptInput::placeholder { color: var(--os-ink-dim); }
#promptInput:disabled { cursor: not-allowed; }
.vt-ws-send { width: 2.25rem; padding: 0; }
.vt-ws-send .vt-icon { width: 1rem; height: 1rem; }
.vt-ws-hint { margin-top: var(--os-space-2); font-size: var(--os-text-xs); color: var(--os-ink-dim); text-align: center; }

/* ---------- Context pane ---------- */
.vt-ws-ctx-tabs {
  display: flex;
  gap: var(--os-space-1);
  padding: var(--os-space-2);
  border-bottom: 1px solid var(--os-line);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.vt-ws-ctx-tab {
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--os-text-sm);
  color: var(--os-ink-muted);
  padding: var(--os-space-1) var(--os-space-2);
  min-height: 2rem;
  border-radius: var(--os-radius-sm);
  cursor: pointer;
  white-space: nowrap;
}
.vt-ws-ctx-tab:hover { background: var(--os-fill); color: var(--os-ink); }
.vt-ws-ctx-tab[aria-selected='true'] { background: var(--os-fill-strong); color: var(--os-ink); font-weight: var(--os-weight-medium); }
.vt-ws-ctx-tab[disabled] { opacity: 0.45; cursor: not-allowed; }
.vt-ws-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.vt-ws-panel.hidden { display: none !important; }
.vt-ws-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-2);
  padding: var(--os-space-3);
  border-bottom: 1px solid var(--os-line);
  flex-shrink: 0;
}
.vt-ws-panel-head > div { min-width: 0; }
.vt-ws-panel-head > .os-row { flex-wrap: nowrap; flex-shrink: 0; }
.vt-ws-panel-head h2 { font-size: var(--os-text-base); font-weight: var(--os-weight-medium); }
.vt-ws-panel-head p { font-size: var(--os-text-xs); color: var(--os-ink-dim); }
.vt-ws-panel-field { padding: var(--os-space-3); border-bottom: 1px solid var(--os-line); flex-shrink: 0; }
.vt-ws-panel-field .os-field { margin: 0; }
.vt-ws-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--os-space-2); }

/* File trees: the <ul>/<li>/<label> shape is what workspace.js walks */
.file-tree { font-size: var(--os-text-sm); }
.file-tree ul { list-style: none; margin: 0; padding: 0; }
.file-tree ul ul { padding-left: var(--os-space-3); margin-left: var(--os-space-2); border-left: 1px solid var(--os-line); }
.file-tree summary { list-style: none; }
.file-tree summary::-webkit-details-marker { display: none; }
.vt-tree-row {
  display: flex;
  align-items: center;
  gap: var(--os-space-1);
  min-height: 1.85rem;
  padding: 0 var(--os-space-1);
  border-radius: var(--os-radius-sm);
  color: var(--os-ink-muted);
  cursor: pointer;
}
.vt-tree-row:hover { background: var(--os-fill); color: var(--os-ink); }
.vt-tree-row label { display: flex; align-items: center; gap: var(--os-space-2); flex: 1; min-width: 0; cursor: pointer; }
.vt-tree-dir > label { flex: 0 0 auto; }
.vt-tree-row input[type=checkbox] { width: 0.9rem; height: 0.9rem; flex-shrink: 0; accent-color: var(--vt-accent); margin: 0; }
.vt-tree-row:has(input:checked) { color: var(--os-ink); }
.vt-tree-row:has(input[data-type="file"]:checked) .vt-tree-name { color: var(--vt-accent); }
.vt-tree-chevron { transition: transform var(--os-motion-fast) var(--os-ease); }
details[open] > summary .vt-tree-chevron { transform: rotate(90deg); }
.vt-tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--os-font-mono); font-size: var(--os-text-xs); }
.vt-tree-dir .vt-tree-name { font-family: var(--os-font); font-size: var(--os-text-sm); font-weight: var(--os-weight-medium); }
.vt-tree-file { padding-left: var(--os-space-5); }
.vt-tree-tools { display: flex; gap: 2px; opacity: 0; }
.vt-tree-row:hover .vt-tree-tools, .vt-tree-row:focus-within .vt-tree-tools { opacity: 1; }
@media (hover: none) { .vt-tree-tools { opacity: 1; } }
.vt-tree-tools .vt-ws-icon-btn { width: 1.6rem; height: 1.6rem; }
.vt-tree-children { margin-left: var(--os-space-3); padding-left: var(--os-space-2); border-left: 1px solid var(--os-line); }
.vt-tree-empty { padding: var(--os-space-2) var(--os-space-3); font-size: var(--os-text-xs); color: var(--os-ink-dim); }
.vt-tree-kind { color: var(--os-ink-dim); }

/* Notes */
.vt-notes-intro { padding: var(--os-space-2) var(--os-space-2) var(--os-space-3); font-size: var(--os-text-xs); color: var(--os-ink-dim); }
.vt-note {
  padding: var(--os-space-3);
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-md);
  background: var(--os-surface);
}
.vt-note + .vt-note { margin-top: var(--os-space-2); }
.vt-note-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--os-space-2); }
.vt-note-title { font-size: var(--os-text-sm); font-weight: var(--os-weight-medium); color: var(--os-ink); overflow-wrap: anywhere; }
.vt-note-tools { display: flex; gap: 2px; flex-shrink: 0; }
.vt-note-body {
  margin-top: var(--os-space-1);
  font-size: var(--os-text-sm);
  color: var(--os-ink-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Modals and the code drawer ---------- */
.vt-ws-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--os-space-4);
  background: var(--os-backdrop);
}
@media (min-width: 640px) { .vt-ws-modal { align-items: center; } }
.vt-ws-modal > .os-modal-panel { animation: none; }
.vt-ws-modal-wide > .os-modal-panel { max-width: 40rem; }
.vt-ws-modal .os-modal-foot { margin-top: var(--os-space-4); }
.vt-ws-modal .os-field:last-child { margin-bottom: 0; }
.vt-persona {
  padding: var(--os-space-3);
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-md);
}
.vt-persona + .vt-persona { margin-top: var(--os-space-2); }
.vt-persona-body {
  margin-top: var(--os-space-2);
  max-height: 7rem;
  overflow-y: auto;
  font-size: var(--os-text-sm);
  color: var(--os-ink-muted);
  white-space: pre-wrap;
}
.vt-ws-list-head { margin: var(--os-space-5) 0 var(--os-space-2); font-size: var(--os-text-sm); color: var(--os-ink-muted); }

#mobileBackdrop, #artifactBackdrop {
  position: fixed;
  inset: 0;
  background: var(--os-backdrop);
  z-index: 44;
}
#artifactDrawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(48rem, 100vw);
  z-index: 45;
  display: flex;
  flex-direction: column;
  background: var(--os-surface);
  border-left: 1px solid var(--os-line-strong);
  box-shadow: var(--os-shadow-lg);
  transition: transform var(--os-motion-slow) var(--os-ease);
}
#artifactDrawer.drawer-closed { transform: translateX(105%); visibility: hidden; }
#artifactDrawer.drawer-open { transform: none; visibility: visible; }
.vt-ws-drawer-body { flex: 1; min-height: 0; overflow: auto; padding: var(--os-space-4); background: var(--vt-code-bg); }
.vt-ws-drawer-body pre { margin: 0; }

/* ---------- Narrow screens ---------- */
.vt-ws-only-narrow { display: none; }
@media (max-width: 1179px) {
  #normalSidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(22rem, 92vw) !important;
    z-index: 45;
    transform: translateX(105%);
    transition: transform var(--os-motion-base) var(--os-ease);
    box-shadow: var(--os-shadow-lg);
  }
  #normalSidebar.mobile-sidebar-open { transform: none; }
  #normalSidebar .vt-ws-resizer { display: none; }
  #normalSidebar .vt-ws-close { display: inline-flex; }
}
@media (max-width: 899px) {
  #leftSidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(19rem, 88vw) !important;
    z-index: 45;
    transform: translateX(-105%);
    transition: transform var(--os-motion-base) var(--os-ease);
    box-shadow: var(--os-shadow-lg);
  }
  #leftSidebar.mobile-sidebar-open { transform: none; }
  #leftSidebar .vt-ws-resizer { display: none; }
  #leftSidebar .vt-ws-close { display: inline-flex; }
  #currentProjectName { display: none; }
  #mobileProjectName { display: block; }
  .vt-ws-only-wide { display: none; }
  .vt-ws-only-narrow { display: inline-flex; }
  .vt-ws-head { padding: var(--os-space-2); }
  .vt-ws-settings { width: 100%; }
  .vt-ws-field .os-select { max-width: 10rem; }
  #chatHistory { padding: var(--os-space-4) var(--os-space-3) var(--os-space-6); }
  .vt-ws-composer { padding: var(--os-space-2); }
  #promptInput { font-size: 1rem; }
  .vt-bubble { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  #leftSidebar, #normalSidebar, #artifactDrawer { transition: none; }
}
body.vt-resizing { user-select: none; cursor: col-resize; }
/* ==== end section: workspace ============================================ */

/* ==== section: public =================================================== */

/* Home: text beside a working piece of the workspace */
.vt-home-hero {
  display: grid;
  gap: var(--os-space-8);
  align-items: start;
  padding-bottom: var(--os-space-10);
}
@media (min-width: 960px) {
  .vt-home-hero { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: var(--os-space-10); }
}
.vt-home-hero h1 {
  font-size: var(--os-text-display);
  line-height: 1.05;
  letter-spacing: var(--os-tracking-tight);
  margin-bottom: var(--os-space-4);
}
.vt-home-hero .vt-lede { margin-bottom: var(--os-space-6); }
.vt-home-hero-copy { padding-top: var(--os-space-2); }

/* The sample conversation. Built from real workspace parts, labelled as an
   example, never a screenshot or a device frame. */
.vt-demo {
  background: var(--os-surface);
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-lg);
  overflow: hidden;
}
.vt-demo-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--os-space-2);
  padding: var(--os-space-3) var(--os-space-4);
  border-bottom: 1px solid var(--os-line);
  font-size: var(--os-text-xs);
  color: var(--os-ink-muted);
}
.vt-demo-body { display: grid; }
@media (min-width: 720px) {
  .vt-demo-body { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}
.vt-demo-chat { padding: var(--os-space-5) var(--os-space-4); display: grid; gap: var(--os-space-4); align-content: start; }
.vt-demo-q {
  justify-self: end;
  max-width: 90%;
  background: var(--os-fill-strong);
  border-radius: var(--os-radius-lg);
  padding: var(--os-space-3) var(--os-space-4);
  font-size: var(--os-text-base);
}
.vt-demo-who { font-size: var(--os-text-xs); color: var(--os-ink-dim); margin-bottom: var(--os-space-1); }
.vt-demo-a { font-size: var(--os-text-base); line-height: 1.6; color: var(--os-ink); }
.vt-demo-a p + p { margin-top: var(--os-space-3); }
.vt-cite {
  font: inherit;
  font-size: var(--os-text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--vt-accent);
  background: var(--vt-accent-wash);
  border: 1px solid var(--vt-accent-line);
  border-radius: var(--os-radius-sm);
  padding: 0 0.35em;
  margin-left: 0.15em;
  cursor: pointer;
  vertical-align: 0.1em;
}
.vt-cite:hover, .vt-cite:focus-visible { color: var(--os-ink); }
.vt-demo-sources {
  border-top: 1px solid var(--os-line);
  padding: var(--os-space-4);
  display: grid;
  gap: var(--os-space-3);
  align-content: start;
  background: var(--os-bg);
}
@media (min-width: 720px) {
  .vt-demo-sources { border-top: 0; border-left: 1px solid var(--os-line); }
}
.vt-demo-sources h2 { font-size: var(--os-text-sm); font-weight: var(--os-weight-bold); }
.vt-source {
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-md);
  padding: var(--os-space-3);
  background: var(--os-surface);
  transition: background var(--os-motion-base) var(--os-ease), border-color var(--os-motion-base) var(--os-ease);
}
.vt-source.is-lit { background: var(--vt-accent-wash); border-color: var(--vt-accent-line); }
.vt-source-head { display: flex; gap: var(--os-space-2); align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.vt-source-n { font-size: var(--os-text-xs); color: var(--vt-accent); font-variant-numeric: tabular-nums; }
.vt-source-path { font-family: var(--os-font-mono); font-size: var(--os-text-xs); color: var(--os-ink); overflow-wrap: anywhere; }
.vt-source-meta { font-size: var(--os-text-xs); color: var(--os-ink-dim); margin-top: var(--os-space-1); }
.vt-source pre {
  margin: var(--os-space-2) 0 0;
  font-family: var(--os-font-mono);
  font-size: var(--os-text-2xs);
  line-height: 1.5;
  color: var(--os-ink-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.vt-source blockquote { margin: var(--os-space-2) 0 0; font-size: var(--os-text-sm); color: var(--os-ink-muted); }
.vt-demo-input {
  margin: 0 var(--os-space-4) var(--os-space-4);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-radius-md);
  padding: var(--os-space-2) var(--os-space-3);
  font-size: var(--os-text-sm);
  color: var(--os-ink-dim);
}

/* Home: connections as a dense definition list */
.vt-defs { display: grid; gap: 0; }
.vt-defs > div {
  display: grid;
  gap: var(--os-space-1) var(--os-space-6);
  padding-block: var(--os-space-4);
  border-top: 1px solid var(--os-line);
}
.vt-defs > div:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 720px) {
  .vt-defs > div { grid-template-columns: 11rem minmax(0, 1fr); }
}
.vt-defs dt { font-weight: var(--os-weight-bold); font-size: var(--os-text-md); }
.vt-defs dd { margin: 0; color: var(--os-ink-muted); font-size: var(--os-text-md); max-width: 64ch; }
.vt-defs dd .vt-code { color: var(--os-ink); }

/* Home: the closing call to action, one line and two buttons */
.vt-home-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-4);
  padding-block: var(--os-space-8) 0;
  border-top: 1px solid var(--os-line);
}
.vt-home-cta p { font-size: var(--os-text-lg); max-width: 40ch; }

/* Pricing: one comparison table, plans as columns. Below 760px each plan
   becomes its own block, so nothing scrolls sideways on a phone. */
.vt-plans { width: 100%; border-collapse: collapse; font-size: var(--os-text-base); }
.vt-plans th, .vt-plans td {
  text-align: left;
  vertical-align: top;
  padding: var(--os-space-3) var(--os-space-4);
  border-bottom: 1px solid var(--os-line);
}
.vt-plans thead th { vertical-align: top; padding-bottom: var(--os-space-4); }
.vt-plans tbody th { font-weight: var(--os-weight-regular); color: var(--os-ink-muted); width: 13rem; }
.vt-plan-name { display: block; font-size: var(--os-text-lg); font-weight: var(--os-weight-bold); }
.vt-plan-price { display: block; font-size: var(--os-text-xl); font-weight: var(--os-weight-bold); margin-top: var(--os-space-2); font-variant-numeric: tabular-nums; }
.vt-plan-unit { font-size: var(--os-text-sm); font-weight: var(--os-weight-regular); color: var(--os-ink-muted); }
.vt-plan-for { display: block; font-size: var(--os-text-sm); font-weight: var(--os-weight-regular); color: var(--os-ink-muted); margin-top: var(--os-space-2); max-width: 22ch; }
.vt-plans tfoot td { border-bottom: 0; padding-top: var(--os-space-5); }
.vt-plans .vt-no, .vt-plan-card .vt-no { color: var(--os-ink-muted); }
.vt-plans-phone { display: grid; gap: var(--os-space-6); }
@media (max-width: 759px) { .vt-plans-desk { display: none; } }
@media (min-width: 760px) { .vt-plans-phone { display: none; } }
.vt-plan-card { border-top: 1px solid var(--os-line-strong); padding-top: var(--os-space-4); display: grid; gap: var(--os-space-3); }
.vt-plan-card dl { display: grid; gap: var(--os-space-1); margin: 0; }
.vt-plan-card dl > div { display: flex; justify-content: space-between; gap: var(--os-space-3); font-size: var(--os-text-sm); padding-block: var(--os-space-1); border-bottom: 1px solid var(--os-line); }
.vt-plan-card dt { color: var(--os-ink-muted); }
.vt-plan-card dd { margin: 0; text-align: right; }
.vt-addons { width: 100%; max-width: 40rem; border-collapse: collapse; }
.vt-addons td, .vt-addons th { padding: var(--os-space-3) 0; border-bottom: 1px solid var(--os-line); text-align: left; font-size: var(--os-text-base); }
.vt-addons td:last-child, .vt-addons th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vt-addons th { font-weight: var(--os-weight-regular); color: var(--os-ink-muted); font-size: var(--os-text-sm); }

/* Docs: contents beside a reading column */
.vt-docs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--os-space-8); }
@media (min-width: 960px) {
  .vt-docs { grid-template-columns: 13rem minmax(0, 1fr); gap: var(--os-space-12); }
  .vt-docs-toc { position: sticky; top: 5rem; align-self: start; }
}
.vt-docs-toc h2 { font-size: var(--os-text-sm); font-weight: var(--os-weight-bold); margin-bottom: var(--os-space-2); }
.vt-docs-toc ol { display: grid; gap: var(--os-space-1); }
.vt-docs-toc a { color: var(--os-ink-muted); text-decoration: none; font-size: var(--os-text-sm); display: block; padding-block: var(--os-space-1); }
.vt-docs-toc a:hover { color: var(--os-ink); }
.vt-docs .os-doc { max-width: 72ch; }
.vt-docs .os-doc h1 { font-size: var(--os-text-xl); letter-spacing: var(--os-tracking-tight); color: var(--os-ink); margin-bottom: var(--os-space-3); }
.vt-docs .os-doc section { scroll-margin-top: 5rem; }
.vt-docs .os-doc table { width: 100%; border-collapse: collapse; font-size: var(--os-text-sm); }
.vt-docs .os-doc th, .vt-docs .os-doc td { text-align: left; vertical-align: top; padding: var(--os-space-2) var(--os-space-3); border-bottom: 1px solid var(--os-line); }
.vt-docs .os-doc th { color: var(--os-ink); font-weight: var(--os-weight-bold); }
.vt-docs .os-doc dl { display: grid; gap: var(--os-space-2); margin: 0 0 var(--os-space-4); }
.vt-docs .os-doc dt { color: var(--os-ink); font-weight: var(--os-weight-bold); }
.vt-docs .os-doc .vt-routes dt { font-family: var(--os-font-mono); font-weight: var(--os-weight-regular); font-size: var(--os-text-sm); }
.vt-docs .os-doc dd { margin: 0 0 var(--os-space-2); }
.vt-method { display: inline-block; min-width: 3rem; font-family: var(--os-font-mono); font-size: var(--os-text-xs); color: var(--os-ink-muted); }
/* ==== end section: public =============================================== */

/* ==== section: account ================================================== */
.vt-input-narrow { max-width: 28rem; }
.vt-fieldset { border: 0; padding: 0; margin: 0 0 var(--os-space-4); min-width: 0; }
.vt-flush { margin: 0; }
.vt-input-row { display: flex; gap: var(--os-space-2); align-items: center; }
.vt-input-row > .os-input, .vt-input-row > .os-select { flex: 1; min-width: 0; }
.vt-cell-end { text-align: right; white-space: nowrap; }

/* Inline flashes on public pages (includes/_public_flashes.html) */
.vt-flashes { display: grid; gap: var(--os-space-2); margin-bottom: var(--os-space-5); }
.vt-flash {
  display: flex;
  align-items: flex-start;
  gap: var(--os-space-2);
  padding: var(--os-space-3) var(--os-space-4);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-radius-lg);
  background: var(--os-surface);
  font-size: var(--os-text-base);
}
.vt-flash .vt-icon, .vt-flash i[data-lucide] { margin-top: 0.2em; }
.vt-flash-error { border-color: var(--os-danger); background: var(--os-danger-wash); }
.vt-flash-error .vt-icon { color: var(--os-danger); }
.vt-flash-success { border-color: var(--os-success); background: var(--os-success-wash); }
.vt-flash-success .vt-icon { color: var(--os-success); }
.vt-flash-warn { border-color: var(--os-warn); background: var(--os-warn-wash); }
.vt-flash-warn .vt-icon { color: var(--os-warn); }

/* Auth: provider buttons, labelled rows, code inputs */
.vt-sso { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--os-space-2); }
@media (min-width: 480px) { .vt-sso { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vt-sso .os-btn { width: 100%; }
.vt-sso svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.vt-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--os-space-2); }
.vt-label-row .os-label { margin-bottom: var(--os-space-1); }
.vt-link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: var(--os-text-sm);
  color: var(--os-ink-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.vt-link-btn:hover { color: var(--os-ink); }
.vt-code-input {
  font-family: var(--os-font-mono);
  font-size: var(--os-text-lg);
  letter-spacing: 0.3em;
  text-align: center;
}
.vt-qr { display: flex; justify-content: center; padding: var(--os-space-4); background: #ffffff; border-radius: var(--os-radius-lg); } /* ai-tell-ok: QR codes need a white quiet zone in both themes */
.vt-qr img, .vt-qr svg { width: 11rem; height: 11rem; }
.vt-checklist { display: grid; gap: var(--os-space-1); font-size: var(--os-text-sm); color: var(--os-ink-muted); margin-top: var(--os-space-2); }
.vt-checklist li { display: flex; align-items: center; gap: var(--os-space-2); }
.vt-checklist .is-met { color: var(--os-success); }
.vt-checklist-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--os-space-3); }
.vt-req-icon { display: inline-flex; }
.os-progress-bar.vt-strength-0 { background: var(--os-danger); }
.os-progress-bar.vt-strength-1 { background: var(--os-warn); }
.os-progress-bar.vt-strength-2 { background: var(--os-success); }
.vt-status-mark { font-size: 2rem; color: var(--os-ink-muted); margin-bottom: var(--os-space-3); display: block; }
.vt-status-mark.vt-ok { color: var(--os-success); }
.vt-status-mark.vt-bad { color: var(--os-danger); }

/* Settings: a stack of setting rows inside one card */
.vt-setting-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-3);
  padding-block: var(--os-space-4);
  border-top: 1px solid var(--os-line);
}
.vt-setting-row:first-child { border-top: 0; padding-top: 0; }
.os-kv + .vt-setting-row { margin-top: var(--os-space-4); }
.vt-setting-row:last-child { padding-bottom: 0; }
.vt-setting-row > div:first-child { min-width: 0; flex: 1 1 16rem; }
.vt-choice-list { display: grid; gap: var(--os-space-2); }
.vt-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--os-space-3);
  padding: var(--os-space-3) var(--os-space-4);
  border: 1px solid var(--os-line-strong);
  border-radius: var(--os-radius-lg);
  cursor: pointer;
  background: var(--os-surface);
}
.vt-choice:hover { border-color: var(--os-ink-dim); }
.vt-choice:has(input:checked) { border-color: var(--os-ink); background: var(--os-fill); }
.vt-choice input { margin-top: 0.2em; accent-color: var(--os-ink); }
.vt-choice-title { font-weight: var(--os-weight-bold); display: block; }
.vt-choice-sub { font-size: var(--os-text-sm); color: var(--os-ink-muted); display: block; }
.vt-choice-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); }
.vt-choice-grid .vt-choice { align-items: center; }
.vt-select-auto { width: auto; min-width: 9rem; }
.vt-status-mark.vt-warn { color: var(--os-warn); }
@media (max-width: 479px) {
  .vt-wrap-phone { flex-wrap: wrap; }
  .vt-wrap-phone > .os-btn { width: 100%; }
}
/* ==== end section: account ============================================== */

/* A command to copy (Settings > Connect AI apps). Scrolls inside itself so a
   long URL never widens the page at phone width. */
.vt-command {
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 var(--os-space-3);
  padding: var(--os-space-3);
  background: var(--os-fill-strong);
  border-radius: var(--os-radius-sm);
  font-family: var(--os-font-mono);
  font-size: var(--os-text-sm);
  white-space: pre;
}
