/*
 * Visit page "Examples" sheet (spec V04–V08, revision 1). Every selector is scoped to .vx-*; nothing here
 * changes the hero, composer or any other route.
 *
 * Structure: .vx-sheet is the full-width coloured page area below the hero (its backdrop fades in above the
 * panel), .vx-panel is the inset rounded sheet (lighter, still coloured), .vx-inner holds chips + masonry.
 * Colours derive from Cropus warmth: apricot #f6a342, amber #de9b4a / #bd8440, coral #e0703f (from
 * terracotta #a2654b), rose #e08a91, cream #fcf3e9 / canvas #fefdfb, espresso #180f08, cocoa #3d2e24 /
 * #6b5a50. The vivid aurora is an owner-requested scoped exception to the no-gradient rule
 * (.stitch/DESIGN.md "Visit Examples sheet").
 *
 * Glass (revision 3, "clear, not frosted"): with data-glass="on" the sheet panel, the sticky chip bar and
 * the card capsules (play, mute, duration) are clear glass: a very light tint, NO blur (saturate only), a
 * crisp bevel (top-left specular rim, faint darker bottom-right rim, inner thickness shadow). Chromium adds
 * a lens: an SVG feDisplacementMap from a smooth rounded-rect map that bends what is behind only along a
 * 10–18px rim (lib/visit-examples/lens.ts). Other engines keep tint + rims without displacement.
 * data-glass="off" is the solid warm surface.
 *
 * Masonry: placements for 2–5 columns arrive as custom properties (lib/visit-examples/masonry.ts); the
 * container query on .vx-inner (the sheet's own inline size, so the sidebar state matters, not the
 * viewport) picks the column count. Card top = a × column width + b × K.
 */

/* Geometry stays on its owning grid/card instead of invalidating every media/control descendant. */
@property --vx-c2 { syntax: "<integer>"; inherits: false; initial-value: 0; }
@property --vx-s2 { syntax: "<integer>"; inherits: false; initial-value: 1; }
@property --vx-t2 { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --vx-gh2 { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --vx-c3 { syntax: "<integer>"; inherits: false; initial-value: 0; }
@property --vx-s3 { syntax: "<integer>"; inherits: false; initial-value: 1; }
@property --vx-t3 { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --vx-gh3 { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --vx-c4 { syntax: "<integer>"; inherits: false; initial-value: 0; }
@property --vx-s4 { syntax: "<integer>"; inherits: false; initial-value: 1; }
@property --vx-t4 { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --vx-gh4 { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --vx-c5 { syntax: "<integer>"; inherits: false; initial-value: 0; }
@property --vx-s5 { syntax: "<integer>"; inherits: false; initial-value: 1; }
@property --vx-t5 { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --vx-gh5 { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --vx-c { syntax: "<integer>"; inherits: false; initial-value: 0; }
@property --vx-s { syntax: "<integer>"; inherits: false; initial-value: 1; }
@property --vx-t { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --vx-gh { syntax: "<length>"; inherits: false; initial-value: 0px; }

.vx-sheet {
  --vx-peek: clamp(136px, 22dvh, 224px);
  --vx-glow: 160px;
  --vx-rise-gap: 24px;
  --vx-radius: 32px;
  --vx-ease: cubic-bezier(.22, 1, .36, 1);
  --vx-reflow: 360ms;
  --vx-intro-delay: 900ms;
  --vx-card-radius: 20px;
  --vx-ink: #180f08;
  --vx-muted: #5c4a40;
  --vx-chip-ink: #3d2e24;
  --vx-chip-row: rgba(255, 255, 255, .56);
  --vx-chip-row-edge: rgba(255, 255, 255, .78);
  --vx-chip-hover: rgba(24, 15, 8, .06);
  --vx-chip-on: #180f08;
  --vx-chip-on-ink: #fefdfb;
  --vx-frame: #f5f1ee;
  --vx-frame-edge: rgba(255, 255, 255, .72);
  --vx-panel-edge: rgba(255, 255, 255, .6);
  --vx-grain-opacity: .28;

  /* Palette A (chosen, revision 3): softened ≈ 33% — peach / apricot / cream led, still clearly coloured. */
  --vx-backdrop-base: linear-gradient(180deg, #fbd5b1 0%, #f8c7a0 45%, #f6c099 100%);
  --vx-backdrop:
    radial-gradient(760px 520px at 8% 220px, rgba(246, 170, 92, .62), rgba(246, 170, 92, 0) 70%),
    radial-gradient(720px 520px at 92% 260px, rgba(232, 128, 86, .5), rgba(232, 128, 86, 0) 70%),
    radial-gradient(820px 460px at 52% 120px, rgba(255, 241, 224, .85), rgba(255, 241, 224, 0) 70%),
    radial-gradient(700px 560px at 24% 900px, rgba(228, 168, 100, .56), rgba(228, 168, 100, 0) 70%),
    radial-gradient(760px 600px at 82% 980px, rgba(232, 152, 152, .42), rgba(232, 152, 152, 0) 70%),
    radial-gradient(420px 340px at 34% 540px, rgba(238, 142, 102, .36), rgba(238, 142, 102, 0) 70%),
    radial-gradient(380px 320px at 68% 620px, rgba(255, 216, 182, .9), rgba(255, 216, 182, 0) 70%),
    radial-gradient(460px 380px at 50% 1320px, rgba(246, 178, 112, .47), rgba(246, 178, 112, 0) 70%),
    radial-gradient(420px 360px at 12% 1480px, rgba(232, 160, 160, .34), rgba(232, 160, 160, 0) 70%);
  --vx-panel-base: #fdebd9;
  --vx-panel:
    radial-gradient(56% 40% at 8% 0%, rgba(246, 170, 92, .28), rgba(246, 170, 92, 0) 72%),
    radial-gradient(48% 36% at 94% 4%, rgba(232, 128, 86, .17), rgba(232, 128, 86, 0) 72%),
    radial-gradient(52% 36% at 52% 16%, rgba(255, 250, 243, .92), rgba(255, 250, 243, 0) 70%),
    radial-gradient(44% 34% at 78% 38%, rgba(232, 152, 152, .18), rgba(232, 152, 152, 0) 72%),
    radial-gradient(44% 34% at 18% 46%, rgba(228, 168, 100, .2), rgba(228, 168, 100, 0) 72%);

  --vx-fade-from: #fefdfb;
  grid-column: 2;
  position: relative;
  z-index: 1;
  isolation: isolate;
  container: vx-sheet / inline-size;
  min-width: 0;
  min-height: calc(100dvh + var(--vx-glow));
  margin-top: calc(-1 * (var(--vx-peek) + var(--vx-glow)));
  padding-top: var(--vx-glow);
  color: var(--vx-ink);
  /* The glow above the panel overlays empty hero space; it must never take clicks from the composer. */
  pointer-events: none;
  will-change: transform;
}
.vx-sheet[hidden] { display: none; }
.vx-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--vx-backdrop), var(--vx-backdrop-base);
  background-repeat: no-repeat;
  background-size: 100% min(1800px, 100%), 100% 100%;
}
/* Top fade of the glow: a small gradient overlay (glow height only) from the hero colour to transparent.
   Revision 5 replaced a full-height mask-image, which forced a page-tall mask texture on long galleries. */
.vx-sheet::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: -1;
  height: var(--vx-glow);
  background: linear-gradient(180deg, var(--vx-fade-from) 0%, transparent 100%);
  pointer-events: none;
}

/* Palette B — coral / rose / terracotta dominant. */
.vx-sheet[data-palette="b"] {
  --vx-backdrop-base: linear-gradient(180deg, #f2a99a 0%, #ea9184 45%, #e6887c 100%);
  --vx-backdrop:
    radial-gradient(760px 520px at 8% 220px, rgba(224, 112, 63, .9), rgba(224, 112, 63, 0) 70%),
    radial-gradient(720px 520px at 92% 240px, rgba(224, 138, 145, .9), rgba(224, 138, 145, 0) 70%),
    radial-gradient(820px 460px at 52% 120px, rgba(255, 228, 214, .75), rgba(255, 228, 214, 0) 70%),
    radial-gradient(700px 560px at 22% 900px, rgba(162, 101, 75, .55), rgba(162, 101, 75, 0) 70%),
    radial-gradient(760px 600px at 84% 960px, rgba(246, 179, 138, .8), rgba(246, 179, 138, 0) 70%),
    radial-gradient(420px 340px at 34% 540px, rgba(246, 163, 66, .45), rgba(246, 163, 66, 0) 70%),
    radial-gradient(380px 320px at 68% 620px, rgba(255, 220, 206, .85), rgba(255, 220, 206, 0) 70%),
    radial-gradient(460px 380px at 50% 1320px, rgba(224, 112, 63, .65), rgba(224, 112, 63, 0) 70%),
    radial-gradient(420px 360px at 12% 1480px, rgba(162, 101, 75, .45), rgba(162, 101, 75, 0) 70%);
  --vx-panel-base: #fce3dc;
  --vx-panel:
    radial-gradient(56% 40% at 8% 0%, rgba(224, 112, 63, .32), rgba(224, 112, 63, 0) 72%),
    radial-gradient(48% 36% at 94% 4%, rgba(224, 138, 145, .38), rgba(224, 138, 145, 0) 72%),
    radial-gradient(52% 36% at 52% 16%, rgba(255, 249, 245, .9), rgba(255, 249, 245, 0) 70%),
    radial-gradient(44% 34% at 78% 38%, rgba(162, 101, 75, .14), rgba(162, 101, 75, 0) 72%),
    radial-gradient(44% 34% at 18% 46%, rgba(246, 179, 138, .34), rgba(246, 179, 138, 0) 72%);
}

.vx-panel {
  position: relative;
  min-height: 100dvh;
  margin-inline: clamp(16px, 4.4cqi, 60px);
  overflow: clip;
  border-radius: var(--vx-radius) var(--vx-radius) 0 0;
  background: var(--vx-panel-base);
  box-shadow: 0 -10px 40px rgba(120, 52, 18, .12);
  pointer-events: auto;
}
.vx-surface {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--vx-panel);
  background-repeat: no-repeat;
  background-size: 100% min(1400px, 100%);
}
/* Fine static grain keeps the gradients from banding. */
.vx-surface::after {
  content: "";
  position: absolute;
  /* Grain only where the gradients are (top ≈ 1400px): a page-tall grain layer costs raster on every
     tile of a long gallery, and the smooth base gradient below does not band. */
  inset: 0 0 auto;
  height: min(100%, 1400px);
  /* Plain low-opacity grain (no blend mode): a full-height blended layer is expensive to raster. */
  opacity: var(--vx-grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .38 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ---------------------------------------------------------------- clear liquid glass (data-glass="on") */

.vx-sheet[data-glass="on"] {
  --vx-muted: #4d3c33;
  /* Clear, not frosted: near-zero tint, no blur — the backdrop stays sharp. */
  --vx-glass-tint: linear-gradient(180deg, rgba(255, 252, 248, .16) 0%, rgba(255, 250, 244, .1) 40%, rgba(255, 250, 244, .12) 100%);
  --vx-glass-saturate: saturate(118%);
  --vx-bevel-light: rgba(255, 255, 255, .92);
  --vx-bevel-dark: rgba(96, 44, 14, .2);
  --vx-bevel-inner: rgba(255, 255, 255, .28);
  --vx-glass-spec: linear-gradient(135deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .5) 18%, rgba(255, 255, 255, .08) 46%, rgba(255, 255, 255, 0) 60%, rgba(96, 44, 14, .16) 100%);
  --vx-capsule: rgba(255, 252, 248, .74);
  --vx-chip-ink: #241811;
  --vx-capsule-ink: #241811;
  /* Tab bar: one capsule whose own tint keeps every label ≥ 4.5:1 over the brightest or darkest poster. */
  --vx-tabbar: rgba(255, 251, 246, .7);
  --vx-chip-row: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .1));
}
/* Palette B's coral backdrop is darker through clear glass: deeper muted ink keeps ≥ 4.5:1. */
.vx-sheet[data-glass="on"][data-palette="b"] { --vx-muted: #3f3028; }
/* Shared clear-glass recipe: tint, saturate-only backdrop, bevel, specular rim (::after), optional lens.
   Only fixed-size elements filter their backdrop. The sheet panel (it resizes during card expand and is the
   largest surface) is tint + bevel only, so scrolling never re-runs a large backdrop or displacement pass. */
/* Backdrop filters only on elements that exist once (sticky tab bar) or only on the active card (play /
   mute) — never on the per-card duration pills: 60 backdrop filters made a long gallery raster late. */
.vx-sheet[data-glass="on"] :is(.vx-chips, .vx-play, .vx-mute) {
  -webkit-backdrop-filter: var(--vx-glass-saturate);
  backdrop-filter: var(--vx-glass-saturate);
}
.vx-sheet[data-glass="on"] .vx-card[data-vx-state="idle"] :is(.vx-play, .vx-mute) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.vx-sheet[data-glass="on"][data-vx-lens="on"] .vx-chips {
  backdrop-filter: var(--vx-lens,) var(--vx-glass-saturate);
}
/* While cards reflow (expand / collapse / filter, ≈ 400 ms) the capsules on moving cards pause their
   backdrop filters — tint and rims stay — so no filter re-runs inside layout-animating frames. */
.vx-sheet[data-vx-reflowing] :is(.vx-play, .vx-mute, .vx-meta span) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.vx-sheet[data-glass="on"] .vx-panel {
  background: var(--vx-glass-tint);
  box-shadow: 0 -10px 40px rgba(120, 52, 18, .08);
}
html[data-theme="dark"] .vx-sheet[data-glass="on"] .vx-panel {
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .4);
}
/* Crisp specular rim: brightest top-left, fading, with a faint darker bottom-right. */
.vx-sheet[data-glass="on"] .vx-chips::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  background: var(--vx-glass-spec);
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.vx-sheet[data-glass="on"] .vx-surface { background-image: none; }
.vx-sheet[data-glass="on"] .vx-surface::after { opacity: .18; }

/* Sticky tab bar: one clear-glass capsule (tinted for legibility), plain labels, one sliding thumb. */
.vx-sheet[data-glass="on"] .vx-chips {
  border-color: rgba(255, 255, 255, .55);
  background: var(--vx-tabbar);
  box-shadow:
    inset 1.5px 1.5px 0 var(--vx-bevel-light),
    inset -1px -1px 0 var(--vx-bevel-dark),
    inset 0 0 10px var(--vx-bevel-inner),
    0 6px 18px rgba(60, 25, 5, .14),
    0 1px 2px rgba(60, 25, 5, .08);
}

/* Card controls: small clear-glass capsules over the poster / video. */
.vx-sheet[data-glass="on"] :is(.vx-play, .vx-mute, .vx-meta span) {
  border: 0;
  background: var(--vx-capsule);
  color: var(--vx-capsule-ink);
  box-shadow:
    inset 1px 1px 0 var(--vx-bevel-light),
    inset -1px -1px 0 rgba(60, 25, 5, .22),
    inset 0 0 6px rgba(255, 255, 255, .35),
    0 2px 8px rgba(30, 12, 2, .22);
}
.vx-sheet[data-glass="on"] .vx-mute:hover { background: rgba(255, 252, 248, .82); }

/* Lite (low-capability devices): the same look without any backdrop-filter — a plain warm tint on the
   sticky tab bar and capsules; the rise is transform-only (controller). */
.vx-sheet[data-vx-lite] :is(.vx-chips, .vx-play, .vx-mute, .vx-meta span) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.vx-sheet[data-vx-lite][data-glass="on"] .vx-chips { background: rgba(253, 246, 238, .96); }
html[data-theme="dark"] .vx-sheet[data-vx-lite][data-glass="on"] .vx-chips { background: rgba(30, 29, 28, .96); }

/* Cards stay solid; hover adds only a faint glass rim. */
@media (hover: hover) and (pointer: fine) {
  .vx-sheet[data-glass="on"] .vx-card:hover .vx-frame { border-color: rgba(255, 255, 255, .95); }
}

/* ---------------------------------------------------------------- internal: hero wash (review toggle) */

.app-shell:has(.vx-sheet[data-hero-wash="on"]:not([hidden])) .main-content:has(> .workspace:not(.is-chat-active)) {
  background: linear-gradient(180deg, #fefdfb 0%, #fdf7f0 32%, #fbe9d6 64%, #f8cb9c 100%);
}
.vx-sheet[data-hero-wash="on"] { --vx-fade-from: #f8cb9c; }
.vx-sheet[data-hero-wash="on"][data-palette="b"] { --vx-fade-from: #f3b4a4; }
.app-shell:has(.vx-sheet[data-hero-wash="on"][data-palette="b"]:not([hidden])) .main-content:has(> .workspace:not(.is-chat-active)) {
  background: linear-gradient(180deg, #fefdfb 0%, #fdf6f2 32%, #fbe5dc 64%, #f3b4a4 100%);
}
html[data-theme="dark"] .app-shell:has(.vx-sheet[data-hero-wash="on"]:not([hidden])) .main-content:has(> .workspace:not(.is-chat-active)) {
  background: linear-gradient(180deg, #131313 0%, #141414 45%, #171615 80%, #1a1817 100%);
}

.vx-inner {
  position: relative;
  container: vx / inline-size;
  display: grid;
  /* Revision 5: the tab capsule is centred (also while sticky); the quiet note sits centred under it and
     scrolls away with the content (only the capsule sticks). */
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "chips" "note" "grid" "empty";
  gap: 20px 24px;
  width: min(100%, 1228px);
  margin: 0 auto;
  padding: 20px 24px 96px;
}

/* ---------------------------------------------------------------- header (chips are sticky) */

/* The header's children join the .vx-inner grid so the tab bar can stick for the whole sheet. */
.vx-header { display: contents; }
/* Segmented control: one capsule, plain 14px/500 labels, one sliding indicator (thumb or underline). */
.vx-chips {
  grid-area: chips;
  justify-self: center;
  position: sticky;
  top: 12px;
  z-index: 6;
  min-width: 0;
  max-width: 100%;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--vx-chip-row-edge);
  border-radius: 999px;
  background: var(--vx-chip-row);
  box-shadow: 0 1px 2px rgba(24, 15, 8, .05);
}
.vx-tabs-scroll {
  --vx-fade-start: 0px;
  --vx-fade-end: 0px;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 999px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--vx-fade-start), #000 calc(100% - var(--vx-fade-end)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--vx-fade-start), #000 calc(100% - var(--vx-fade-end)), transparent 100%);
}
.vx-tabs-scroll::-webkit-scrollbar { display: none; }
.vx-tabs-scroll[data-fade~="start"] { --vx-fade-start: 22px; }
.vx-tabs-scroll[data-fade~="end"] { --vx-fade-end: 22px; }
.vx-tabs { position: relative; display: flex; width: max-content; height: 100%; }
.vx-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--vx-chip-on);
  transform-origin: 0 50%;
  pointer-events: none;
}
.vx-tabs:not([data-vx-thumb]) .vx-thumb { display: none; }
.vx-chip {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  height: 100%;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--vx-chip-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 32px;
  letter-spacing: -.005em;
  white-space: nowrap;
  transition: color 200ms ease, background-color 140ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .vx-chip:not([aria-selected="true"]):hover { background: var(--vx-chip-hover); color: var(--vx-ink); }
}
.vx-chip[aria-selected="true"] { color: var(--vx-chip-on-ink); }
/* Before the controller places the thumb (or without JS) the selected tab paints its own fill. */
.vx-tabs:not([data-vx-thumb]) .vx-chip[aria-selected="true"] { background: var(--vx-chip-on); }
.vx-chip:focus-visible { outline: 1.5px solid var(--focus-ring, #525252); outline-offset: -2px; }
/* Underline style (internal review toggle): a 2px ink line under the active label. */
.vx-sheet[data-tab-style="underline"] .vx-thumb { top: auto; bottom: 4px; height: 2px; border-radius: 2px; background: var(--vx-ink); }
.vx-sheet[data-tab-style="underline"] .vx-chip[aria-selected="true"] { color: var(--vx-ink); }
.vx-sheet[data-tab-style="underline"] .vx-tabs:not([data-vx-thumb]) .vx-chip[aria-selected="true"] { background: none; text-decoration: underline 2px; text-underline-offset: 6px; }
.vx-note {
  grid-area: note;
  justify-self: center;
  max-width: 100%;
  margin: -12px 0 0;
  color: var(--vx-muted);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}
.vx-tabpanel { grid-area: grid; min-width: 0; }
.vx-empty { grid-area: empty; }

/* ---------------------------------------------------------------- masonry */

.vx-grid {
  --vx-cols: 2;
  --vx-gap: 12px;
  --vx-cap: 72px;
  --vx-rowgap: 20px;
  --vx-k: calc(var(--vx-cap) + var(--vx-rowgap));
  --vx-colw: calc((100cqi - (var(--vx-cols) - 1) * var(--vx-gap)) / var(--vx-cols));
  --vx-gh: var(--vx-gh2);
  position: relative;
  contain: layout style;
  height: var(--vx-gh);
  margin: 0;
  padding: 0;
  list-style: none;
}
.vx-card {
  /* Column, span and top (a max() of linear terms) per column count — lib/visit-examples/masonry.ts. */
  --vx-c: var(--vx-c2);
  --vx-s: var(--vx-s2, 1);
  --vx-t: var(--vx-t2);
  --vx-w: calc(var(--vx-s) * var(--vx-colw) + (var(--vx-s) - 1) * var(--vx-gap));
  position: absolute;
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: auto 300px;
  top: var(--vx-t);
  left: calc(var(--vx-c) * (var(--vx-colw) + var(--vx-gap)));
  width: var(--vx-w);
  min-width: 0;
  animation: vx-card-in 640ms var(--vx-ease) backwards;
  animation-delay: calc(var(--vx-intro-delay) + min(var(--vx-i, 0), 7) * 50ms);
  transition: opacity 640ms var(--vx-ease) var(--vx-d, 0ms);
}
.vx-sheet[data-vx-reflowing] .vx-card {
  transition: top var(--vx-reflow) var(--vx-ease);
}
@container vx (min-width: 560px) {
  .vx-grid { --vx-cols: 3; --vx-gap: 20px; --vx-gh: var(--vx-gh3); }
  .vx-card { --vx-c: var(--vx-c3); --vx-s: var(--vx-s3, 1); --vx-t: var(--vx-t3); }
}
@container vx (min-width: 900px) {
  .vx-grid { --vx-cols: 4; --vx-gap: 24px; --vx-gh: var(--vx-gh4); }
  .vx-card { --vx-c: var(--vx-c4); --vx-s: var(--vx-s4, 1); --vx-t: var(--vx-t4); }
}
@container vx (min-width: 1100px) {
  .vx-grid { --vx-cols: 5; --vx-gap: 24px; --vx-gh: var(--vx-gh5); }
  .vx-card { --vx-c: var(--vx-c5); --vx-s: var(--vx-s5, 1); --vx-t: var(--vx-t5); }
}
.vx-card[hidden] { display: none; }
/* Scroll reveal is opacity-only (no transform): fewer, smaller promoted layers on long galleries. */
.vx-card[data-vx-await] { opacity: 0; animation: none; will-change: opacity; }
/* Revealed by the scroll stagger (a transition): the entrance keyframe must not restart from opacity 0. */
.vx-card[data-vx-revealed] { animation: none; }
.vx-card[data-vx-revealed]:not([data-vx-await]) { transition: none; }
.vx-grid.is-filtering { animation: vx-filter-in 220ms ease-out backwards; }

@keyframes vx-card-in {
  from { opacity: 0; transform: translateY(20px); }
}
@keyframes vx-filter-in {
  from { opacity: 0; }
}

.vx-frame {
  position: relative;
  height: calc(var(--vx-w) * var(--vx-hr, 1.7778));
  overflow: hidden;
  border: 1px solid var(--vx-frame-edge);
  border-radius: var(--vx-card-radius);
  background: var(--vx-frame);
  /* Tight soft shadow (18px blur): cards briefly promoted during a reveal or reflow stay small in GPU
     memory — a 36px blur on long galleries exhausted tile budgets and left areas unpainted. */
  box-shadow: 0 1px 2px rgba(24, 15, 8, .06), 0 10px 18px -10px rgba(90, 38, 10, .3);
  transition: height var(--vx-reflow) var(--vx-ease);
}
/* Tiny inline LQIP under the poster: a card is never blank while its poster loads. The 12px image is
   upscaled with smooth interpolation (already soft) — no CSS blur filter, which made long galleries
   raster late. */
.vx-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--vx-lqip, none) var(--vx-focus, 50% 25%) / cover no-repeat;
}
.vx-sheet[data-vx-ready] .vx-poster:not(.is-loaded) { opacity: 0; }
/* Once the poster is decoded the blurred LQIP is removed, so resizing frames never re-render a blur. */
.vx-frame[data-loaded]::before { display: none; }
.vx-poster { transition: opacity 180ms ease-out; }
.vx-card.is-expanded .vx-frame { box-shadow: 0 1px 2px rgba(24, 15, 8, .08), 0 14px 22px -12px rgba(90, 38, 10, .38); }
.vx-poster,
.vx-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--vx-focus, 50% 25%);
}
.vx-card.is-expanded .vx-video,
.vx-card.is-expanded .vx-poster { object-position: 50% 50%; }
.vx-video {
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease-out;
}
.vx-card.has-frame:not([data-vx-state="idle"]) .vx-video { opacity: 1; }

.vx-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  border-radius: inherit;
  cursor: pointer;
}
.vx-hit:focus-visible {
  outline: 1.5px solid var(--focus-ring, #525252);
  outline-offset: -4px;
  box-shadow: inset 0 0 0 5.5px rgba(254, 253, 251, .9);
}
/* Reuses the video-gallery play badge geometry (40px cream circle, 16px outline play). */
.vx-play {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(24, 15, 8, .08);
  border-radius: 50%;
  background: rgba(254, 253, 251, .92);
  color: #180f08;
  opacity: 0;
  transform: scale(.94);
  transition: opacity 160ms ease, transform 200ms var(--vx-ease);
}
.vx-play svg { width: 16px; height: 16px; }
.vx-card:is([data-vx-state="idle"], [data-vx-state="paused"]) .vx-hit:focus-visible .vx-play,
.vx-card[data-vx-state="paused"] .vx-play { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .vx-card[data-vx-state="idle"] .vx-hit:hover .vx-play { opacity: 1; transform: none; }
}
@media (hover: none), (pointer: coarse) {
  .vx-card[data-vx-state="idle"] .vx-play { opacity: 1; transform: none; }
}

/* Duration pill — video-gallery meta geometry. */
.vx-meta {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.vx-meta span {
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(254, 253, 251, .92);
  color: #3d2e24;
  font-size: 12px;
  font-weight: 500;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
}
.vx-card:is([data-vx-state="playing"], [data-vx-state="paused"], [data-vx-state="ended"]) .vx-meta { opacity: 0; }

.vx-mute {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(24, 15, 8, .08);
  border-radius: 50%;
  background: rgba(254, 253, 251, .92);
  color: #180f08;
  transition: background-color 140ms ease;
}
.vx-mute[hidden] { display: none; }
.vx-mute::after { content: ""; position: absolute; inset: -6px; }
.vx-mute:hover { background: #fefdfb; }
.vx-mute svg { width: 16px; height: 16px; }
.vx-mute .vx-icon-muted,
.vx-card.is-muted .vx-mute .vx-icon-sound { display: none; }
.vx-card.is-muted .vx-mute .vx-icon-muted { display: block; }
.vx-mute:focus-visible { outline: 1.5px solid var(--focus-ring, #525252); outline-offset: 2px; }

.vx-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 2px;
  background: rgba(254, 253, 251, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.vx-progress-fill {
  display: block;
  height: 100%;
  background: #fefdfb;
  transform: scaleX(0);
  transform-origin: left center;
}
.vx-card[data-vx-state="playing"] .vx-progress,
.vx-card[data-vx-state="paused"] .vx-progress,
.vx-card[data-vx-state="ended"] .vx-progress { opacity: 1; }

/* End state: blur the stopped media itself; the scrim never samples the backdrop. */
.vx-card[data-vx-state="ended"] .vx-video { filter: blur(14px); }
.vx-end {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: rgba(24, 15, 8, .6);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  animation: vx-filter-in 200ms ease-out backwards;
}
.vx-end[hidden] { display: none; }
.vx-end button {
  display: inline-flex;
  min-width: 140px;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 140ms ease;
}
.vx-end svg { width: 16px; height: 16px; }
.vx-replay { border: 1px solid rgba(254, 253, 251, .55); color: #fefdfb; }
.vx-replay:hover { background: rgba(254, 253, 251, .12); }
.vx-make { background: #fefdfb; color: #180f08; }
.vx-make:hover { background: #f5f1ee; }
.vx-end button:focus-visible { outline: 1.5px solid #fefdfb; outline-offset: 2px; }

/* Fixed caption block (2-line title + genre) keeps every card height deterministic for the masonry. */
.vx-caption { height: var(--vx-cap, 72px); padding: 12px 4px 0; overflow: hidden; }
.vx-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--vx-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.vx-genre { margin: 2px 0 0; color: var(--vx-muted); font-size: 13px; line-height: 18px; }
.vx-empty { margin: 48px 0; color: var(--vx-muted); font-size: 14px; text-align: center; }
.vx-empty[hidden] { display: none; }

/* ---------------------------------------------------------------- internal review toggles */

.vx-dev-toggles {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: calc(100vw - 32px);
  gap: 4px 10px;
  padding: 6px 8px 6px 12px;
  border: 1px solid rgba(61, 46, 36, .08);
  border-radius: 16px;
  background: rgba(254, 253, 251, .96);
  box-shadow: 0 8px 24px rgba(24, 15, 8, .10);
  color: #6b5a50;
  font-size: 12px;
  pointer-events: auto;
}
.vx-dev-group { display: flex; align-items: center; gap: 2px; }
.vx-dev-group span { margin-right: 4px; white-space: nowrap; }
.vx-dev-toggles button { height: 26px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; color: #3d2e24; }
.vx-dev-toggles button[aria-pressed="true"] { background: #180f08; color: #fefdfb; }
.vx-dev-toggles button:focus-visible { outline: 1.5px solid var(--focus-ring, #525252); outline-offset: 2px; }

/* ---------------------------------------------------------------- hide while a conversation or project runs */

.app-shell:has(.workspace.is-chat-active) .vx-sheet { display: none; }
.app-shell:has(.workspace.is-project-active) .vx-sheet { display: none; }

/* ---------------------------------------------------------------- responsive */

@container vx-sheet (max-width: 600px) {
  .vx-panel { margin-inline: 16px; }
}
@media (max-width: 767px) {
  /* Revision 5: the sheet starts 28px higher on phones, and the warm backdrop begins right under the
     composer (hero bottom ≈ 43dvh + 88px on phones), so there is no white band between them. */
  :root {
    --vx-m-peek: clamp(156px, calc(20dvh + 28px), 212px);
    --vx-m-glow: max(96px, calc(57dvh - var(--vx-m-peek) - 88px));
  }
  .vx-sheet {
    --vx-peek: var(--vx-m-peek);
    --vx-glow: var(--vx-m-glow);
    --vx-rise-gap: 12px;
    --vx-radius: 24px;
    --vx-card-radius: 16px;
  }
  .vx-inner { row-gap: 12px; padding: 12px 12px 72px; }
  .vx-chips { top: 8px; }
  .vx-note { margin-top: -6px; font-size: 12px; line-height: 16px; text-wrap: balance; }
  /* Round 39-3 (supersedes Round 36-M2's height formula): the sheet overlaps only the measured empty room under the
     composer's Project/Plugins row (--vx-m-overlap, set by the controller); unmeasured it is in normal flow. */
  .vx-sheet { margin-top: calc(-1 * min(var(--vx-peek) + var(--vx-glow), var(--vx-m-overlap, 0px))); }
}
@media (max-width: 440px) {
  .vx-chip { padding: 0 12px; }
  .vx-play { width: 32px; height: 32px; }
  .vx-meta { left: 6px; bottom: 6px; }
  .vx-meta span { height: 20px; padding: 0 6px; font-size: 11px; line-height: 20px; }
  .vx-mute { top: 6px; right: 6px; }
  .vx-end button { min-width: 0; width: 100%; max-width: 156px; height: 40px; padding: 0 10px; font-size: 13px; }
  .vx-dev-toggles { right: 8px; bottom: 8px; left: 8px; justify-content: center; padding: 4px 6px; }
  .vx-dev-group span { margin-right: 2px; }
}
@media (max-height: 720px) and (min-width: 768px) {
  .vx-sheet { --vx-peek: clamp(112px, 17dvh, 160px); --vx-glow: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .vx-card,
  .vx-grid.is-filtering,
  .vx-end { animation: none; transition: none; }
  .vx-card[data-vx-await] { opacity: 1; transform: none; }
  .vx-grid, .vx-frame, .vx-play, .vx-video, .vx-meta, .vx-progress, .vx-chip, .vx-poster { transition: none; }
}

/* ---------------------------------------------------------------- dark: calm neutral graphite (revision 3) */
/* No orange blobs: graphite/espresso surfaces and at most one very faint warm glow. Cards and text keep
   their contrast. Palette B shares the same neutral dark. */

html[data-theme="dark"] .vx-sheet,
html[data-theme="dark"] .vx-sheet[data-palette="b"] {
  --vx-fade-from: #131313;
  --vx-ink: #ededed;
  --vx-muted: #b3aba5;
  --vx-chip-ink: #d9d3ce;
  --vx-chip-row: rgba(38, 36, 34, .7);
  --vx-chip-row-edge: rgba(255, 255, 255, .08);
  --vx-chip-hover: rgba(255, 255, 255, .06);
  --vx-chip-on: #ededed;
  --vx-chip-on-ink: #171717;
  --vx-frame: #1c1c1c;
  --vx-frame-edge: rgba(255, 255, 255, .1);
  --vx-panel-edge: rgba(255, 255, 255, .06);
  --vx-grain-opacity: .35;
  --vx-backdrop-base: linear-gradient(180deg, #1a1918 0%, #151413 100%);
  --vx-backdrop: radial-gradient(900px 560px at 50% 140px, rgba(233, 170, 88, .06), rgba(233, 170, 88, 0) 72%);
  --vx-panel-base: #1c1b1a;
  --vx-panel: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0) 320px);
}
html[data-theme="dark"] .vx-panel { box-shadow: 0 -10px 40px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .vx-frame { box-shadow: 0 10px 18px -10px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .vx-play,
html[data-theme="dark"] .vx-mute { border-color: rgba(255, 255, 255, .1); background: rgba(36, 36, 36, .92); color: #ededed; }
html[data-theme="dark"] .vx-mute:hover { background: #303030; }
html[data-theme="dark"] .vx-sheet[data-glass="on"] {
  --vx-muted: #b9b1ab;
  --vx-glass-tint: linear-gradient(180deg, rgba(255, 255, 255, .045) 0%, rgba(255, 255, 255, .02) 40%, rgba(255, 255, 255, .03) 100%);
  --vx-glass-saturate: saturate(110%);
  --vx-bevel-light: rgba(255, 255, 255, .22);
  --vx-bevel-dark: rgba(0, 0, 0, .55);
  --vx-bevel-inner: rgba(255, 255, 255, .04);
  --vx-glass-spec: linear-gradient(135deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .14) 18%, rgba(255, 255, 255, .03) 46%, rgba(255, 255, 255, 0) 60%, rgba(0, 0, 0, .4) 100%);
  --vx-capsule: rgba(30, 29, 28, .74);
  --vx-chip-ink: #f2efec;
  --vx-capsule-ink: #f2efec;
  --vx-tabbar: rgba(26, 25, 24, .82);
  --vx-chip-row: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
}
html[data-theme="dark"] .vx-sheet[data-glass="on"] .vx-mute:hover { background: rgba(48, 47, 46, .82); }
html[data-theme="dark"] .vx-sheet[data-glass="on"] :is(.vx-play, .vx-mute, .vx-meta span) { color: var(--vx-capsule-ink); }
html[data-theme="dark"] .vx-dev-toggles { border-color: #303030; background: #242424; color: #a3a3a3; }
html[data-theme="dark"] .vx-dev-toggles button { color: #c7c7c7; }
html[data-theme="dark"] .vx-dev-toggles button[aria-pressed="true"] { background: #ededed; color: #171717; }

/* Idle promotion avoids a new sheet/tab layer at rise start. A faint, viewport-visible paint stage
   primes the decoded first-row poster resources without changing document geometry. */
.vx-chips { will-change: transform; }
.vx-peek-paint {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: .01;
  pointer-events: none;
  contain: strict;
  z-index: -1;
}
.vx-peek-paint img { position: absolute; inset: 0; width: 100%; height: 960px; object-fit: cover; }

/* Failure keeps the poster and a real retry target. No spinner or dependency on autoplay. */
.vx-card[data-vx-failure] .vx-play { opacity: 1; transform: none; }
.vx-feedback {
  position: absolute;
  z-index: 2;
  left: 8px;
  right: 8px;
  bottom: 36px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(254, 253, 251, .9);
  color: #241811;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
.vx-feedback[hidden] { display: none; }
html[data-theme="dark"] .vx-feedback { background: rgba(30, 29, 28, .9); color: #f2efec; }
.vx-chips { top: max(12px, env(safe-area-inset-top, 0px)); }
.vx-panel { margin-left: max(clamp(16px, 4.4cqi, 60px), env(safe-area-inset-left, 0px)); margin-right: max(clamp(16px, 4.4cqi, 60px), env(safe-area-inset-right, 0px)); }
.vx-inner { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.vx-dev-toggles { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
@media (max-width: 767px) {
  .vx-chips { top: max(8px, env(safe-area-inset-top, 0px)); }
  .vx-panel { margin-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
}

/* Round 7: a uniform portrait grid; metadata sits on the image, not in a separate row. */
.vx-sheet[data-vx-uniform] .vx-grid { --vx-cap: 0px; --vx-rowgap: 12px; --vx-gap: 12px; }
.vx-sheet[data-vx-uniform] .vx-caption {
  position: absolute; z-index: 2; inset: auto 1px 1px; height: auto; padding: 48px 14px 14px;
  border-radius: 0 0 var(--vx-card-radius) var(--vx-card-radius);
  background: linear-gradient(transparent, rgba(24,15,8,.82) 38%, rgba(24,15,8,.94)); pointer-events: none;
}
.vx-sheet[data-vx-uniform] .vx-title { color: #fefdfb; }
.vx-sheet[data-vx-uniform] .vx-genre { color: #fefdfb; margin-top: 4px; }
.vx-sheet[data-vx-uniform] .vx-meta { display: none; }
.vx-sheet[data-vx-uniform] .vx-inner { padding-bottom: calc(162px + var(--vx-dock-keyboard, 0px) + env(safe-area-inset-bottom, 0px)); }
.vx-sheet[data-vx-placeholder] .vx-frame { background: var(--vx-frame); box-shadow: none; }
.vx-sheet[data-vx-placeholder] .vx-frame::before { background-image: none; }
.vx-sheet[data-vx-placeholder] .vx-hit { cursor: default; }
.vx-sheet[data-vx-placeholder] .vx-play { display: none; }
.vx-sheet[data-vx-placeholder] .vx-caption { background: none; padding-top: 16px; }
.vx-sheet[data-vx-placeholder] .vx-title { color: var(--vx-ink); }
.vx-sheet[data-vx-placeholder] .vx-genre { color: var(--vx-muted); }

/* Reference structure: outer shell/header, inset input panel, real mode tile and large action. */
.vx-dock, .vx-dock * { box-sizing: border-box; }
.vx-dock {
  position: fixed; z-index: 50;
  left: calc(var(--vx-dock-left, 0px) + var(--vx-dock-width, 100vw) / 2);
  bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--vx-keyboard, 0px));
  width: min(600px, calc(var(--vx-dock-width, 100vw) - 32px));
  padding: 4px; border: 0; border-radius: 24px;
  background: #eae2dc; color: #3d2e24;
  box-shadow: 0 8px 28px rgba(24,15,8,.1), inset 0 1px 0 rgba(255,255,255,.45);
  opacity: 0; transform: translate(-50%, calc(100% + 48px)); pointer-events: none;
  transition: transform 280ms cubic-bezier(.32,.72,0,1), opacity 280ms ease;
  will-change: transform, opacity;
}
.vx-dock[data-visible="true"] { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.vx-dock-heading { display: flex; align-items: center; justify-content: center; height: 34px; color: #6b5a50; font-size: 14px; line-height: 20px; font-weight: 500; }
.vx-dock-label { position: absolute; z-index: 3; top: 48px; left: 128px; color: #6b5a50; font-size: 11px; line-height: 16px; }
.vx-dock .composer { position: relative; display: block; width: 100%; min-height: 104px; margin: 0; padding: 24px 128px 8px 124px; border: 0; border-radius: 20px; background: #fefdfb; box-shadow: none; transform: none; filter: none; }
.vx-dock .composer::before { content: ''; position: absolute; top: 24px; bottom: 10px; left: 110px; width: 1px; background: rgba(61,46,36,.09); }
.vx-dock .editor-wrap { padding: 0; }
.vx-dock .message-editor { padding: 4px 0 0; height: 34px !important; min-height: 34px; max-height: 34px; font-size: 18px; line-height: 24px; color: #3d2e24; background: transparent; }
.vx-dock .message-editor::placeholder { color: #6b5a50; }
.vx-dock .composer-toolbar { position: static; display: flex; justify-content: flex-start; gap: 6px; margin: 4px 0 0; padding: 0; min-height: 32px; }
.vx-dock :is(.toolbar-group, .agent-mode-picker, .composer-action-slot) { position: static; }
.vx-dock .composer-action-slot { width: 0; flex: 0; }
.vx-dock .composer-toolbar .toolbar-group { position: static; gap: 6px; }
.vx-dock .toolbar-group-right { margin-left: 0; }
.vx-dock :is(:is(#addFileButton,[data-composer-key="addFileButton"]), :is(#dictationMicWrap,[data-composer-key="dictationMicWrap"]), :is(#composerAttachments,[data-composer-key="composerAttachments"])) { display: none; }
.vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) {
  position: absolute; left: 28px; top: -10px; display: flex; align-items: center; justify-content: center;
  width: 54px; height: 88px; padding: 0; border: 1px solid #cbc0b6; border-radius: 16px;
  background: #f5f1ee !important; color: #6b5a50;
  box-shadow: inset 0 1px 8px rgba(255,255,255,.65), 0 3px 8px rgba(24,15,8,.07);
}
.vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .chevron { display: none; }
.vx-dock :is(#agentModeIcon,[data-composer-key="agentModeIcon"]) { width: 24px; height: 24px; }
.vx-dock :is(#agentModeLabel,[data-composer-key="agentModeLabel"]) { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); font-size: 11px; line-height: 16px; white-space: nowrap; }
.vx-dock :is(#effortTrigger,[data-composer-key="effortTrigger"]) { background: #eae2dc; color: #6b5a50; border-radius: 999px; }
.vx-dock :is(#submitButton,[data-composer-key="submitButton"]) {
  position: absolute; inset: 8px 8px auto auto; display: flex; align-items: center; justify-content: center;
  width: 110px; height: 88px; margin: 0; border-radius: 16px; background: #f16a22; color: #241811;
  box-shadow: 0 4px 0 #bd4610; opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: background-color 150ms ease;
}
.vx-dock :is(#submitButton,[data-composer-key="submitButton"])::after { content: 'Send'; position: static; inset: auto; min-width: 0; min-height: 0; font-size: 14px; font-weight: 500; }
.vx-dock :is(#submitButton,[data-composer-key="submitButton"]) svg { display: none; }
.vx-dock :is(#submitButton,[data-composer-key="submitButton"]):hover { background: #ff813d; }
.vx-dock :is(#submitButton,[data-composer-key="submitButton"]).is-streaming::after { content: 'Stop'; }
body:has(.workspace.is-chat-active) .vx-dock { visibility: hidden; }
html[data-theme="dark"] .vx-dock { background: #1b1917; color: #f2efec; box-shadow: 0 8px 28px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.04); }
html[data-theme="dark"] .vx-dock :is(#composerForm,[data-composer-key="composerForm"]) { background: #262321; }
html[data-theme="dark"] .vx-dock :is(#composerForm,[data-composer-key="composerForm"])::before { background: rgba(234,226,220,.09); }
html[data-theme="dark"] .vx-dock :is(#messageEditor,[data-composer-key="messageEditor"]) { background: transparent; color: #f2efec; }
html[data-theme="dark"] .vx-dock :is(.vx-dock-heading, .vx-dock-label),
html[data-theme="dark"] .vx-dock .message-editor::placeholder { color: #cbc0b6; }
html[data-theme="dark"] .vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) { background: #302d2a !important; color: #cbc0b6; border-color: #4e4741; box-shadow: inset 0 1px 8px rgba(255,255,255,.04), 0 3px 8px rgba(0,0,0,.16); }
html[data-theme="dark"] .vx-dock :is(#effortTrigger,[data-composer-key="effortTrigger"]) { background: #38332f; color: #cbc0b6; }
html[data-theme="dark"] .vx-dock :is(#submitButton,[data-composer-key="submitButton"]) { background: #f16a22; color: #241811; box-shadow: 0 4px 0 #bd4610; }
@media (max-width: 480px) {
  .vx-dock { bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--vx-keyboard, 0px)); width: calc(100vw - 24px); left: 50%; border-radius: 24px; }
  .vx-dock-heading { height: 28px; font-size: 12px; line-height: 20px; }
  .vx-dock .composer { min-height: 114px; padding: 26px 76px 8px 78px; border-radius: 20px; }
  .vx-dock .composer::before { top: 24px; bottom: 12px; left: 66px; }
  .vx-dock-label { top: 40px; left: 82px; right: 82px; font-size: 12px; line-height: 16px; }
  .vx-dock .message-editor { height: 36px !important; min-height: 36px; max-height: 36px; font-size: 16px; line-height: 22px; }
  .vx-dock .composer-toolbar { margin-top: 4px; }
  .vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) { left: 8px; top: -12px; width: 48px; height: 76px; border-radius: 14px; }
  .vx-dock :is(#agentModeIcon,[data-composer-key="agentModeIcon"]) { width: 22px; height: 22px; }
  .vx-dock :is(#agentModeLabel,[data-composer-key="agentModeLabel"]) { top: calc(100% + 8px); font-size: 11px; line-height: 16px; }
  .vx-dock :is(#submitButton,[data-composer-key="submitButton"]) { top: 10px; right: 8px; width: 60px; height: 96px; border-radius: 16px; }
  .vx-dock :is(#submitButton,[data-composer-key="submitButton"])::after { font-size: 14px; }
  .vx-sheet[data-vx-uniform] .vx-inner { padding-bottom: calc(184px + var(--vx-dock-keyboard, 0px) + env(safe-area-inset-bottom, 0px)); }
  .vx-sheet[data-vx-uniform] .vx-caption { padding: 36px 10px 10px; }
  .vx-sheet[data-vx-uniform] .vx-title { font-size: 13px; line-height: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .vx-dock, .vx-dock[data-visible="true"] { transform: translate(-50%, 0); transition: opacity 180ms ease; }
}

@media (max-width: 360px) {
  .vx-dock .composer { min-height: 130px; padding-top: 42px; }
  .vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) { height: 92px; }
  .vx-dock :is(#submitButton,[data-composer-key="submitButton"]) { height: 112px; }
}

/* Platform marks inherit Cropus ink; only opacity/transform animate. */
.vx-platform-cycle { display: none; }
.vx-dock :is(#agentModeIcon,[data-composer-key="agentModeIcon"]) { display: none; }
.vx-dock .vx-platform-cycle { display: grid; width: 24px; height: 24px; pointer-events: none; }
.vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-cycle svg { grid-area: 1 / 1; width: 24px; height: 24px; opacity: 0; animation: vx-platform 9s ease-in-out infinite; animation-play-state: paused; }
.vx-dock[data-visible="true"] :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-cycle svg { animation-play-state: running; }
.vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-cycle svg:nth-child(2) { animation-delay: 3s; }
.vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-cycle svg:nth-child(3) { animation-delay: 6s; }
@keyframes vx-platform {
  0% { opacity: 0; transform: translateY(4px); }
  5%, 27% { opacity: 1; transform: translateY(0); }
  33%, 100% { opacity: 0; transform: translateY(-4px); }
}
html[data-theme="dark"] .vx-dock :is(#submitButton,[data-composer-key="submitButton"]):hover { background: #ff813d; }
@media (prefers-reduced-motion: reduce) {
  .vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-cycle svg { animation: none; transform: none; }
  .vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-cycle svg:first-child { opacity: 1; }
}

/* Duration replaces the dock's effort chip; the original home effort selection is retained. */
.vx-dock .effort-picker { display: none; }
.vx-dock-options { display: none; }
.vx-dock .vx-dock-options { display: flex; align-items: center; gap: 5px; min-width: 0; }
.vx-dock-options :is(.vx-duration-trigger, .vx-concept) { display: inline-flex; align-items: center; justify-content: center; height: 29px; padding: 0 9px; border: 0; border-radius: 999px; background: #eae2dc; color: #3d2e24; font: inherit; font-size: 12px; line-height: 18px; white-space: nowrap; }
.vx-dock-options .vx-duration-trigger { cursor: pointer; gap: 5px; }
.vx-duration-trigger svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.vx-dock-options .vx-concept { max-width: 105px; overflow: hidden; text-overflow: ellipsis; }
.vx-dock .vx-concept[hidden], .vx-duration-panel[hidden] { display: none; }
.vx-duration-anchor { position: relative; flex-shrink: 0; }
.vx-duration-panel { position: absolute; bottom: calc(100% + 8px); left: 0; width: 240px; max-height: calc(100dvh - 210px); overflow-x: hidden; overflow-y: auto; padding: 12px; border: 1px solid #ded5ce; border-radius: 16px; background: #fefdfb; color: #3d2e24; box-shadow: 0 6px 20px rgba(24,15,8,.1); font-size: 12px; line-height: 18px; z-index: 5; }
.vx-duration-panel svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.vx-duration-heading { display: flex; align-items: center; gap: 7px; }
.vx-duration-heading strong { font-size: 12px; font-weight: 500; }
.vx-duration-heading button { display: grid; place-items: center; width: 28px; height: 28px; margin-left: auto; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.vx-duration-summary { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.vx-duration-summary output { font-size: 18px; line-height: 24px; font-weight: 500; }
.vx-duration-tier { padding: 1px 6px; border-radius: 999px; background: #eae2dc; color: #6b5a50; font-size: 10px; line-height: 16px; }
.vx-duration-panel input { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 28px; margin: 2px 0 0; padding: 0; border: 0; border-radius: 4px; box-shadow: none; background: transparent; cursor: pointer; }
.vx-duration-panel input::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: #ded5ce; }
.vx-duration-panel input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 0; border-radius: 50%; background: #a63f12; }
.vx-duration-panel input::-moz-range-track { height: 3px; border-radius: 3px; background: #ded5ce; }
.vx-duration-panel input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #a63f12; }
.vx-duration-stops { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; line-height: 16px; }
.vx-duration-stops span { display: inline-flex; align-items: center; gap: 2px; }
.vx-duration-stops svg { width: 10px; height: 10px; }
.vx-duration-panel p { display: flex; align-items: center; gap: 5px; margin: 11px 0 0; color: #6b5a50; font-size: 11px; line-height: 16px; }
.vx-duration-panel p svg { width: 12px; height: 12px; }
.vx-dock :is(.vx-duration-trigger, .vx-duration-panel button, .vx-duration-panel input):focus-visible { outline: 2px solid #a63f12; outline-offset: 3px; }
html[data-theme="dark"] .vx-dock-options :is(.vx-duration-trigger, .vx-concept), html[data-theme="dark"] .vx-duration-tier { background: #38332f; color: #f2efec; }
html[data-theme="dark"] .vx-duration-panel { background: #262321; border-color: #4e4741; color: #f2efec; }
html[data-theme="dark"] .vx-duration-panel p { color: #cbc0b6; }
/* Marks and their captions share an identical timeline and delays. */
.vx-platform-names { display: none; }
.vx-dock :is(#agentModeLabel,[data-composer-key="agentModeLabel"]) { display: none; }
.vx-dock .vx-platform-names { display: grid; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); font-size: 11px; line-height: 16px; }
.vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-names > span { grid-area: 1 / 1; opacity: 0; animation: vx-platform 9s ease-in-out infinite; animation-play-state: paused; }
.vx-dock[data-visible="true"] :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-names > span { animation-play-state: running; }
.vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-names > span:nth-child(2) { animation-delay: 3s; }
.vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-names > span:nth-child(3) { animation-delay: 6s; }
@media (max-width: 480px) {
  .vx-dock-options :is(.vx-duration-trigger, .vx-concept) { height: 32px; padding-inline: 7px; font-size: 11px; }
  .vx-dock-options .vx-concept { max-width: 68px; padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-names > span { animation: none; transform: none; }
  .vx-dock :is(#agentModeTrigger,[data-composer-key="agentModeTrigger"]) .vx-platform-names > span:first-child { opacity: 1; }
}

/* Keep the popup above the composer label and its editor stacking contexts. */
.vx-dock[data-duration-open] .vx-dock-label { visibility: hidden; }
.vx-dock .vx-duration-anchor { z-index: 5; }
.vx-duration-pro[hidden] { display: none; }
.vx-duration-pro { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px 0; }
.vx-duration-pro > svg { width: 26px; height: 26px; color: #a63f12; }
.vx-duration-pro a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 14px; border-radius: 12px; background: #f16a22; color: #241811; font-size: 12px; font-weight: 500; text-decoration: none; }
.vx-duration-pro a:hover { background: #ff813d; }
.vx-duration-pro a:focus-visible { outline: 2px solid #a63f12; outline-offset: 3px; }
.vx-duration-panel[data-locked="true"] { isolation: isolate; background: linear-gradient(135deg, #fefdfb, #fff0dc 50%, #f8dbbf); border-color: #d9ae87; box-shadow: 0 6px 24px rgba(166,63,18,.16), inset 0 1px 0 rgba(255,255,255,.8); }
.vx-duration-panel[data-locked="true"] > * { position: relative; z-index: 1; }
.vx-duration-panel[data-locked="true"]::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; background: linear-gradient(115deg, transparent 15%, rgba(255,255,255,.65) 45%, transparent 70%); animation: vx-pro-shine 3s cubic-bezier(.2,.7,.2,1) both; }
.vx-duration-panel[data-locked="true"] .vx-duration-tier { background: #3d2e24; color: #fefdfb; }
.vx-duration-panel[data-locked="true"] #vx-duration-notice { display: none; }
html[data-theme="dark"] .vx-duration-panel[data-locked="true"] { background: linear-gradient(135deg, #30251e, #463025 55%, #633719); border-color: #8f5933; box-shadow: 0 6px 24px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,221,184,.15); }
html[data-theme="dark"] .vx-duration-panel[data-locked="true"]::before { background: linear-gradient(115deg, transparent 15%, rgba(255,205,153,.14) 45%, transparent 70%); }
html[data-theme="dark"] .vx-duration-panel[data-locked="true"] .vx-duration-tier { background: #f7c391; color: #3d2e24; }
html[data-theme="dark"] .vx-duration-pro > svg { color: #f7c391; }
@keyframes vx-pro-shine { from { opacity: 0; transform: translateX(-30%); } 30% { opacity: 1; } to { opacity: 0; transform: translateX(30%); } }
@media (prefers-reduced-motion: reduce) { .vx-duration-panel[data-locked="true"]::before { animation: none; opacity: 0; } }

.vx-duration-panel[data-fixed="true"] #vx-duration-notice { display: flex; }

/* Round 8a/8c/8e: two persistent home views; reserve bottom clearance on empty home without sheet, but seamless when sheet is present. */
html[data-home-dock="on"] .app-shell:not(:has(.vx-sheet:not([hidden]))) .vx-home-workspace { padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px)); }
html[data-home-dock="on"] .app-shell:has(.vx-sheet:not([hidden])) .vx-home-workspace { padding-bottom: 0; }
html[data-home-dock="on"] .app-shell:not(:has(.vx-sheet:not([hidden]))) .main-content:has(> .vx-home-workspace:not(.is-chat-active):not(.is-project-active)) { height: auto; min-height: 100dvh; overflow: visible; }
html[data-home-dock="on"] .app-shell:not(:has(.vx-sheet:not([hidden]))) .vx-home-workspace:not(.is-chat-active):not(.is-project-active) { padding-bottom: calc(100dvh + 64px + env(safe-area-inset-bottom, 0px)); }
/* Round 8e: sheet surface extends seamlessly to viewport bottom; page background matches the sheet tint so dock sits over a single continuous surface. */
.app-shell:not(:has(.workspace.is-chat-active)):not(:has(.workspace.is-project-active)):has(.vx-sheet:not([hidden])) { background-color: #fdebd9; }
.app-shell:not(:has(.workspace.is-chat-active)):not(:has(.workspace.is-project-active)):has(.vx-sheet[data-palette="b"]:not([hidden])) { background-color: #fce3dc; }
html[data-theme="dark"] .app-shell:not(:has(.workspace.is-chat-active)):not(:has(.workspace.is-project-active)):has(.vx-sheet:not([hidden])) { background-color: #1c1b1a; }
.vx-composer-add-menu { position: fixed; z-index: 160; display: flex; flex-direction: column; gap: 1px; width: min(208px, calc(100vw - 16px)); padding: 4px; border: 1px solid var(--border-color, #eae2dc); border-radius: 12px; background: var(--background-color, #fefdfb); color: var(--text-color, #3d2e24); box-shadow: 0 6px 20px rgba(24,15,8,.08); font: inherit; }
.vx-composer-add-menu button { display: flex; align-items: center; width: 100%; gap: 8px; min-height: 32px; padding: 5px 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 12.5px; line-height: 18px; text-align: left; cursor: pointer; }
.vx-composer-add-menu button:hover,.vx-composer-add-menu button:focus-visible { background: #f5f1ee; }
.vx-composer-add-menu button:focus-visible { outline: 1.5px solid var(--focus-ring,#525252); outline-offset: -2px; }
.vx-composer-add-menu svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.vx-composer-add-menu small { margin-left: auto; padding: 0; background: transparent; color: #6b5a50; font-size: 11px; line-height: 16px; white-space: nowrap; }
.vx-composer-add-menu [aria-disabled="true"] { cursor: default; color: #6b5a50; }
.vx-composer-add-footer { display: flex; align-items: center; gap: 6px; margin-top: 2px; padding: 5px 8px 3px; border-top: 1px solid rgba(61,46,36,.08); color: #6b5a50; font-size: 11px; line-height: 15px; }
.vx-composer-add-footer svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
html[data-theme="dark"] .vx-composer-add-menu { background: #262321; color: #f2efec; border-color: #4e4741; box-shadow: 0 6px 20px rgba(0,0,0,.22); }
html[data-theme="dark"] .vx-composer-add-menu button:hover,html[data-theme="dark"] .vx-composer-add-menu button:focus-visible { background: #38332f; color: #f2efec; }
html[data-theme="dark"] .vx-composer-add-menu small,html[data-theme="dark"] .vx-composer-add-menu [aria-disabled="true"],html[data-theme="dark"] .vx-composer-add-footer { color: #cbc0b6; }
html[data-theme="dark"] .vx-composer-add-footer { border-top-color: rgba(234,226,220,.1); }
.vx-composer-signin-dialog { width: min(440px, calc(100vw - 32px)); padding: 28px 16px 16px; border: 1px solid var(--secondary-500,#eae2dc); border-radius: 20px; background: var(--background-color,#fefdfb); color: inherit; }
.vx-composer-signin-dialog::backdrop { background: rgba(24,15,8,.24); }
.vx-composer-signin-close { position: absolute; right: 8px; top: 5px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 22px; cursor: pointer; }
html[data-theme="dark"] .vx-composer-signin-dialog { background: #262321; color: #f2efec; }
