/* ==========================================================================
   Vantic design system (owner decisions 2026-10-13)

   One token sheet and a small component set. New screens are built only from
   these; old screens move onto them one at a time and their legacy rules are
   deleted as they go. The rules for this file are enforced by
   api/tests/test_design_system_sheet.py:

   - Raw colors live only in the token blocks (:root and .ds-light).
   - Font sizes, weights, radii, shadows and layers come from tokens.
   - No !important.
   - Sentence case. Uppercase only for .ds-kicker micro labels.

   Theme: dark for the app and the client Review view. .ds-light flips the
   same tokens for the brief and anything printed.
   Icons: Lucide (ISC), inlined by dsIcon() in app.js.
   ========================================================================== */

:root {
  /* Neutrals, darkest to lightest */
  --ds-n0: #0b0d10;
  --ds-n1: #111418;
  --ds-n2: #171b20;
  --ds-n3: #1f242a;
  --ds-n4: #2b3139;
  --ds-n5: #3b434d;
  --ds-n6: #8c95a0;
  --ds-n7: #b6bec7;
  --ds-n8: #eef1f4;

  /* One accent. Dark text on it; a lighter tint for links on dark ground. */
  --ds-accent: #00c5cb;
  --ds-accent-hover: #2fd4d9;
  --ds-on-accent: #00191b;
  --ds-accent-soft: rgba(0, 197, 203, 0.14);
  --ds-link: #4fdadf;

  /* Status */
  --ds-success: #3ccf8e;
  --ds-warning: #f0b44c;
  --ds-danger: #f26d6d;
  --ds-info: #a5b1ff;
  --ds-success-soft: rgba(60, 207, 142, 0.14);
  --ds-warning-soft: rgba(240, 180, 76, 0.14);
  --ds-danger-soft: rgba(242, 109, 109, 0.14);

  /* Time of day: the same six colors on pins, chips, rows and the brief.
     No sky blue (the accent owns cyan) and no red (errors own red). Mid-day
     is pale sunlight and golden leans orange, so neither reads as the amber
     warning beside it. */
  --ds-tod-bluehour: #b39dff;
  --ds-tod-sunrise: #ff9fb8;
  --ds-tod-midday: #fbe9b0;
  --ds-tod-golden: #ffa64d;
  --ds-tod-sunset: #ff7f50;
  --ds-tod-dusk: #7d86ff;
  --ds-tod-custom: #b6bec7;

  /* Overlay scrim for sheets and the map legend */
  --ds-scrim: rgba(5, 7, 9, 0.72);
  --ds-glass: rgba(17, 20, 24, 0.86);

  /* On the picture: controls that sit on live imagery. The picture is dark
     in both themes, so .ds-light does not flip these. */
  --ds-on-image: #fff;
  --ds-on-image-line: rgba(255, 255, 255, 0.28);
  --ds-image-glass: rgba(5, 7, 10, 0.62);

  /* Type: Geist for the interface, Geist Mono only for numbers and IDs */
  --ds-font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --ds-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ds-fs-11: 11px;
  --ds-fs-12: 12px;
  --ds-fs-13: 13px;
  --ds-fs-15: 15px;
  --ds-fs-20: 20px;
  --ds-fs-28: 28px;
  --ds-w-regular: 400;
  --ds-w-medium: 500;
  --ds-w-semibold: 600;

  /* Shape and depth */
  --ds-r-sm: 6px;
  --ds-r-md: 10px;
  --ds-r-round: 999px;
  --ds-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.32), 0 6px 16px rgba(0, 0, 0, 0.24);
  --ds-shadow-2: 0 18px 48px rgba(0, 0, 0, 0.5);
  --ds-focus: 0 0 0 2px var(--ds-n0), 0 0 0 4px var(--ds-accent);

  /* Space: 8 px grid with a 4 px half step */
  --ds-s1: 4px;
  --ds-s2: 8px;
  --ds-s3: 12px;
  --ds-s4: 16px;
  --ds-s5: 24px;
  --ds-s6: 32px;
  --ds-s7: 48px;
  --ds-control: 36px;
  --ds-control-sm: 32px;

  /* Layers, mapped onto the legacy scale so old and new screens coexist */
  --ds-z-raised: 1;
  --ds-z-sticky: 100;
  --ds-z-dropdown: var(--z-dropdown, 4000);
  --ds-z-overlay: var(--z-overlay, 9999);
  --ds-z-modal: var(--z-modal, 10000);
  --ds-z-toast: var(--z-top, 12000);
}

/* Paper: the brief and anything printed. Same roles, light values. */
.ds-light {
  --ds-n0: #ffffff;
  --ds-n1: #f7f8f9;
  --ds-n2: #ffffff;
  --ds-n3: #eff1f3;
  --ds-n4: #dde1e5;
  --ds-n5: #c4cad1;
  --ds-n6: #646d78;
  --ds-n7: #444c56;
  --ds-n8: #14181d;
  --ds-link: #00737a;
  --ds-accent-soft: rgba(0, 127, 134, 0.1);
  --ds-success: #1d7a52;
  --ds-warning: #94600a;
  --ds-danger: #b42318;
  --ds-info: #4453c7;
  /* Time of day on paper: the same six hues at print depth, stepped in
     lightness (mid-day lightest, dusk darkest) so they stay apart for
     color-blind readers and on a grey printer. Labels stay in ink. */
  --ds-tod-bluehour: #7262ee;
  --ds-tod-sunrise: #de5b8f;
  --ds-tod-midday: #e8b923;
  --ds-tod-golden: #ea8a17;
  --ds-tod-sunset: #d4552d;
  --ds-tod-dusk: #3d47b8;
  --ds-tod-custom: #7a838e;
  --ds-scrim: rgba(20, 24, 29, 0.4);
  --ds-glass: rgba(255, 255, 255, 0.92);
  --ds-shadow-1: 0 1px 2px rgba(20, 24, 29, 0.08), 0 4px 12px rgba(20, 24, 29, 0.08);
  --ds-shadow-2: 0 18px 48px rgba(20, 24, 29, 0.18);
}

/* ---- Base ---------------------------------------------------------------- */

.ds-root {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ds-n0);
  color: var(--ds-n8);
  font-family: var(--ds-font);
  font-size: var(--ds-fs-13);
  font-weight: var(--ds-w-regular);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.ds-root *,
.ds-root *::before,
.ds-root *::after { box-sizing: border-box; }
.ds-root button,
.ds-root input,
.ds-root select,
.ds-root textarea { font: inherit; color: inherit; }
/* Low specificity on purpose: components restyle their own links. */
.ds-root a:where(:not(.ds-btn):not(.btn)) { color: var(--ds-link); text-decoration: none; }
.ds-root a:where(:not(.ds-btn):not(.btn)):hover { text-decoration: underline; text-underline-offset: 2px; }
.ds-root :focus-visible { outline: none; box-shadow: var(--ds-focus); }

.ds-mono { font-family: var(--ds-mono); font-variant-numeric: tabular-nums; }
.ds-num { font-variant-numeric: tabular-nums lining-nums; }
.ds-dim { color: var(--ds-n7); }
.ds-faint { color: var(--ds-n6); }
.ds-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ds-h1 { margin: 0; font-size: var(--ds-fs-28); font-weight: var(--ds-w-semibold); line-height: 1.15; letter-spacing: -0.01em; }
.ds-h2 { margin: 0; font-size: var(--ds-fs-20); font-weight: var(--ds-w-semibold); line-height: 1.25; }
.ds-h3 { margin: 0; font-size: var(--ds-fs-15); font-weight: var(--ds-w-semibold); line-height: 1.3; }
.ds-body { font-size: var(--ds-fs-13); }
.ds-small { font-size: var(--ds-fs-12); }
.ds-kicker {
  font-size: var(--ds-fs-11);
  font-weight: var(--ds-w-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-n6);
}

/* ---- Icons ----------------------------------------------------------------- */

.ds-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -3px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ds-icon--sm { width: 14px; height: 14px; vertical-align: -2px; }
.ds-icon--lg { width: 20px; height: 20px; vertical-align: -4px; }

/* ---- Buttons: primary, secondary, ghost, destructive -------------------- */

.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-s2);
  height: var(--ds-control);
  padding: 0 var(--ds-s4);
  border: 1px solid transparent;
  border-radius: var(--ds-r-sm);
  background: transparent;
  color: var(--ds-n8);
  font-size: var(--ds-fs-13);
  font-weight: var(--ds-w-medium);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.ds-btn:disabled,
.ds-btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.ds-btn--sm { height: var(--ds-control-sm); padding: 0 var(--ds-s3); font-size: var(--ds-fs-12); }
.ds-btn--icon { width: var(--ds-control); padding: 0; }
.ds-btn--icon.ds-btn--sm { width: var(--ds-control-sm); }
.ds-btn--block { width: 100%; }

.ds-btn--primary { background: var(--ds-accent); color: var(--ds-on-accent); }
.ds-btn--primary:hover:not(:disabled) { background: var(--ds-accent-hover); }
.ds-btn--secondary { background: var(--ds-n2); border-color: var(--ds-n4); }
.ds-btn--secondary:hover:not(:disabled) { background: var(--ds-n3); border-color: var(--ds-n5); }
.ds-btn--ghost { color: var(--ds-n7); }
.ds-btn--ghost:hover:not(:disabled) { background: var(--ds-n3); color: var(--ds-n8); }
.ds-btn--destructive { color: var(--ds-danger); border-color: var(--ds-n4); }
.ds-btn--destructive:hover:not(:disabled) { background: var(--ds-danger-soft); border-color: var(--ds-danger); }
.ds-btn[aria-pressed="true"] { background: var(--ds-accent-soft); border-color: var(--ds-accent); color: var(--ds-n8); }

/* ---- Inputs ------------------------------------------------------------------ */

.ds-field { display: grid; gap: var(--ds-s1); }
.ds-label { font-size: var(--ds-fs-12); font-weight: var(--ds-w-medium); color: var(--ds-n7); }
.ds-input,
.ds-textarea {
  width: 100%;
  min-height: var(--ds-control);
  padding: var(--ds-s2) var(--ds-s3);
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-sm);
  background: var(--ds-n1);
  color: var(--ds-n8);
  font-size: var(--ds-fs-13);
}
.ds-textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
.ds-input::placeholder,
.ds-textarea::placeholder { color: var(--ds-n6); }
.ds-input:hover,
.ds-textarea:hover { border-color: var(--ds-n5); }
.ds-input:focus-visible,
.ds-textarea:focus-visible { border-color: var(--ds-accent); }
/* The one size outside the scale: iOS zooms the page into any field under
   16px, so phones and touch screens get 16px field text. */
@media (max-width: 899px), (pointer: coarse) {
  .ds-input,
  .ds-textarea,
  .ds-root .ds-input,
  .ds-root .ds-textarea { font-size: 16px; }
}

/* ---- Chips, badges, status ------------------------------------------------ */

.ds-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-s1);
  height: 24px;
  padding: 0 var(--ds-s2);
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-round);
  background: var(--ds-n2);
  color: var(--ds-n7);
  font-size: var(--ds-fs-12);
  font-weight: var(--ds-w-medium);
  white-space: nowrap;
}
button.ds-chip { cursor: pointer; }
button.ds-chip:hover { border-color: var(--ds-n5); color: var(--ds-n8); }
.ds-chip[aria-pressed="true"],
.ds-chip[aria-current="true"] { border-color: var(--ds-accent); background: var(--ds-accent-soft); color: var(--ds-n8); }
.ds-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: var(--ds-r-round);
  background: var(--ds-tone, var(--ds-n6));
}

/* Letter badge: the shot's identity on every surface. */
.ds-letter {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 var(--ds-s1);
  border-radius: var(--ds-r-round);
  background: var(--ds-tone, var(--ds-n7));
  color: var(--ds-on-accent);
  font-family: var(--ds-mono);
  font-size: var(--ds-fs-12);
  font-weight: var(--ds-w-semibold);
  line-height: 1;
}
.ds-letter--lg { min-width: 36px; height: 36px; font-size: var(--ds-fs-15); }

.ds-status { display: inline-flex; align-items: center; gap: var(--ds-s1); font-size: var(--ds-fs-12); font-weight: var(--ds-w-medium); }
.ds-status--success { color: var(--ds-success); }
.ds-status--warning { color: var(--ds-warning); }
.ds-status--danger { color: var(--ds-danger); }

/* Time-of-day tones, set on any element that reads --ds-tone. */
.ds-tod-bluehour { --ds-tone: var(--ds-tod-bluehour); }
.ds-tod-sunrise { --ds-tone: var(--ds-tod-sunrise); }
.ds-tod-midday { --ds-tone: var(--ds-tod-midday); }
.ds-tod-golden { --ds-tone: var(--ds-tod-golden); }
.ds-tod-sunset { --ds-tone: var(--ds-tod-sunset); }
.ds-tod-dusk { --ds-tone: var(--ds-tod-dusk); }
.ds-tod-custom { --ds-tone: var(--ds-tod-custom); }

/* ---- Surfaces --------------------------------------------------------------- */

.ds-card {
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-md);
  background: var(--ds-n1);
}
.ds-divider { height: 1px; border: 0; margin: 0; background: var(--ds-n4); }
.ds-empty {
  display: grid;
  place-items: center;
  gap: var(--ds-s2);
  padding: var(--ds-s6) var(--ds-s4);
  color: var(--ds-n6);
  text-align: center;
}

/* List rows: 36 px minimum, one line, hover and selected states. */
.ds-row {
  display: flex;
  align-items: center;
  gap: var(--ds-s3);
  width: 100%;
  min-height: var(--ds-control);
  padding: var(--ds-s1) var(--ds-s3);
  border: 0;
  border-radius: var(--ds-r-sm);
  background: transparent;
  color: var(--ds-n8);
  text-align: left;
  cursor: pointer;
}
.ds-row:hover { background: var(--ds-n2); }
.ds-row[aria-current="true"] { background: var(--ds-n3); box-shadow: inset 2px 0 0 var(--ds-accent); }

/* ---- Toast -------------------------------------------------------------------- */

.ds-toast {
  position: fixed;
  left: 50%;
  bottom: var(--ds-s5);
  z-index: var(--ds-z-toast);
  transform: translateX(-50%);
  max-width: min(480px, calc(100vw - 32px));
  padding: var(--ds-s3) var(--ds-s4);
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-md);
  background: var(--ds-n2);
  box-shadow: var(--ds-shadow-2);
  color: var(--ds-n8);
  font-size: var(--ds-fs-13);
}

@keyframes rv-mini-fold { to { transform: scale(0.37); opacity: 0; } }
@keyframes rv-mini-tab { from { transform: scale(0.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .rv-mini.is-folding,
  .rv-mini.is-shut .rv-mini-open { animation: none; }
  .ds-root *,
  .ds-root *::before,
  .ds-root *::after { transition: none; animation: none; }
}

/* ==========================================================================
   Client Review view (share links)
   ========================================================================== */

html.vnt-review-route,
html.vnt-review-route body { background: var(--ds-n0); }

.rv-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.rv-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--ds-s4);
  padding: var(--ds-s3) var(--ds-s5);
  border-bottom: 1px solid var(--ds-n4);
  background: var(--ds-n1);
}
.rv-brand { display: flex; align-items: center; min-width: 0; max-width: 180px; }
.rv-logo { display: block; max-width: 100%; max-height: 32px; object-fit: contain; }
.rv-brand-name { font-size: var(--ds-fs-13); font-weight: var(--ds-w-semibold); color: var(--ds-n7); white-space: nowrap; }
.rv-title { min-width: 0; }
.rv-project { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-meta { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ds-fs-13); }
.rv-actions { display: flex; align-items: center; gap: var(--ds-s2); }
.rv-save-status { grid-column: 1 / -1; margin: 0; }
.rv-save-status:empty { display: none; }

.rv-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
}

.rv-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--ds-n4);
  background: var(--ds-n1);
}
.rv-map {
  flex: 0 0 auto;
  height: 280px;
  border-bottom: 1px solid var(--ds-n4);
  background: var(--ds-n2);
}
.rv-map[hidden] { display: none; }
.rv-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--ds-s2);
  padding: var(--ds-s3) var(--ds-s4) var(--ds-s1);
}
.rv-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 var(--ds-s2) var(--ds-s3); }
.rv-group { padding-top: var(--ds-s2); }
.rv-group-head {
  display: flex;
  align-items: center;
  gap: var(--ds-s2);
  margin: 0;
  padding: var(--ds-s2) var(--ds-s3) var(--ds-s1);
  font-size: var(--ds-fs-12);
  font-weight: var(--ds-w-medium);
  color: var(--ds-n7);
}
.rv-group-icon { display: inline-flex; color: var(--ds-tone); }
.rv-group-label { flex: 1 1 auto; }
.rv-group-range { font-size: var(--ds-fs-12); font-weight: var(--ds-w-regular); }
.rv-row-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A named shot: its name over its type. */
.rv-row-name--titled { display: flex; flex-direction: column; gap: 1px; white-space: normal; text-align: left; }
.rv-row-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--ds-w-medium); }
/* The planner's description can be long: two lines, then an ellipsis. */
.rv-row-kind { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0; overflow: hidden; font-size: var(--ds-fs-12); line-height: 1.35; overflow-wrap: anywhere; }
.rv-row:has(.rv-row-name--titled) { padding-top: var(--ds-s2); padding-bottom: var(--ds-s2); }
/* The saved planned frame beside the letter (client portal backlog, 2026-10-19). */
.rv-row-thumb { flex: 0 0 auto; width: 48px; height: 27px; border-radius: var(--ds-r-sm); object-fit: cover; background: var(--ds-n2); }
.rv-row-thumb.is-preview-image-failed { display: none; }
.rv-row-height { flex: 0 0 auto; font-size: var(--ds-fs-12); }
/* The client's own direction read back: Priority, If time, priority time. */
.rv-tier { margin-left: var(--ds-s2); font-size: var(--ds-fs-11); vertical-align: middle; }
.rv-foot { margin: 0; padding: var(--ds-s2) var(--ds-s4) var(--ds-s4); border-top: 1px solid var(--ds-n4); }

.rv-detail {
  display: flex;
  flex-direction: column;
  gap: var(--ds-s3);
  min-height: 0;
  overflow-y: auto;
  padding: var(--ds-s5);
}
.rv-frame {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 62vh;
  overflow: hidden;
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-md);
  background: var(--ds-n2);
}
.rv-frame--empty { display: grid; place-items: center; }
.rv-image,
.rv-frame .vmv-preview-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.rv-frame .vmv-generated-frame,
.rv-frame .vmv-generated-frame > a { display: block; width: 100%; height: 100%; }
.rv-frame .vmv-preview-attribution {
  position: absolute;
  left: var(--ds-s2);
  bottom: var(--ds-s2);
  margin: 0;
  padding: 2px var(--ds-s2);
  border-radius: var(--ds-r-sm);
  background: var(--ds-glass);
  color: var(--ds-n7);
  font-size: var(--ds-fs-11);
}
.rv-frame .brief-preview-fallback { color: var(--ds-n6); font-size: var(--ds-fs-12); }
.rv-detail .capture-geometry-note {
  display: block;
  margin: 0;
  padding: var(--ds-s1) var(--ds-s2);
  border: 0;
  border-radius: var(--ds-r-sm);
  background: var(--ds-warning-soft);
  color: var(--ds-warning);
  font-size: var(--ds-fs-12);
}

.rv-caption-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-s3); }
.rv-caption-text { flex: 1 1 auto; min-width: 0; }
.rv-caption-text p { margin: 2px 0 0; }
.rv-chips { display: flex; flex-wrap: wrap; gap: var(--ds-s2); }
/* Heights of a 360 stack, under the viewer. Thumb-size, one row; a long
   stack scrolls sideways. */
.rv-levels { display: flex; flex-direction: column; gap: var(--ds-s1); min-width: 0; }
.rv-levels[hidden] { display: none; }
.rv-levels-head { display: flex; justify-content: space-between; gap: var(--ds-s3); }
.rv-levels-track { display: flex; gap: var(--ds-s1); padding: 3px; border: 1px solid var(--ds-n4); border-radius: var(--ds-r-md); background: var(--ds-n1); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.rv-levels-track::-webkit-scrollbar { display: none; }
.rv-level { flex: 1 0 64px; height: 44px; padding: 0 var(--ds-s2); border: 0; border-radius: var(--ds-r-sm); background: transparent; color: var(--ds-n7); font: inherit; font-size: var(--ds-fs-12); white-space: nowrap; cursor: pointer; scroll-snap-align: center; }
.rv-level b { font-size: var(--ds-fs-15); font-weight: var(--ds-w-medium); color: var(--ds-n8); }
.rv-level:hover { background: var(--ds-n2); }
.rv-level[aria-pressed="true"] { background: var(--ds-accent); color: var(--ds-on-accent); }
.rv-level[aria-pressed="true"] b { color: inherit; }
.rv-level:focus-visible { outline: 2px solid var(--ds-link); outline-offset: 1px; }
.rv-specs { margin: 0; }
.rv-purpose { margin: 0; font-size: var(--ds-fs-15); line-height: 1.45; }
.rv-notes { margin: 0; white-space: pre-line; }
.rv-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-s2);
  margin-top: auto;
  padding-top: var(--ds-s3);
  border-top: 1px solid var(--ds-n4);
}
.rv-pager-end { min-width: 88px; }

/* The viewer (2026-11-10): one picture. It opens on the live engine; a gear
   on its top left opens the settings (3D quality, the saved frame). The
   body repaints per shot; the viewer above it stays mounted, so the engine
   is reused. The engine's own overrides sit with the other 3D page rules in
   styles.css. */
.rv-viewer { display: flex; flex: 0 0 auto; flex-direction: column; gap: var(--ds-s3); min-width: 0; }
/* The stage is its own stacking context: the controls on the picture take
   their layers from the token scale and stay inside it. The engine's own
   layers (4 to 6, styles.css) sit between "raised" and "sticky". */
.rv-stage { position: relative; display: flex; flex: 0 0 auto; flex-direction: column; gap: var(--ds-s3); min-width: 0; isolation: isolate; }
.rv-gear {
  position: absolute;
  top: var(--ds-s2);
  left: var(--ds-s2);
  z-index: var(--ds-z-sticky);
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--ds-on-image-line);
  border-radius: var(--ds-r-md);
  background: var(--ds-image-glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
}
/* .ds-root button inherits text color; the controls on the picture are white. */
.ds-root .rv-gear,
.ds-root .rv-mini-open,
.ds-root .rv-mini-btn { color: var(--ds-on-image); }
.rv-gear .ds-icon { width: 20px; height: 20px; }
.rv-gear:hover,
.rv-gear[aria-expanded="true"] { background: var(--ds-glass); }
.rv-gear:focus-visible,
.rv-mini-open:focus-visible,
.rv-mini-btn:focus-visible { outline: 2px solid var(--ds-on-image); outline-offset: 1px; }
.rv-settings {
  position: absolute;
  top: calc(var(--ds-s2) + 50px);
  left: var(--ds-s2);
  z-index: var(--ds-z-dropdown);
  display: grid;
  gap: var(--ds-s3);
  width: 208px;
  max-width: calc(100% - 2 * var(--ds-s2));
  padding: var(--ds-s3);
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-md);
  background: var(--ds-n1);
  box-shadow: var(--ds-shadow-1);
}
.rv-settings[hidden] { display: none; }
/* The live view's "Google" credit: small grey text in the bottom left,
   under the start of the scrub line. A tap opens the settings, which list the other sources. */
.rv-credit { position: absolute; left: 65px; bottom: 2px; z-index: var(--ds-z-sticky); cursor: pointer; }
.rv-credit .m3d-credits--host { padding: 0; border: 0; border-radius: 0; background: none; color: var(--ds-n7); text-shadow: 0 1px 2px var(--ds-scrim); }
.rv-credit .m3d-credits--host .cesium-widget-credits { color: inherit; font-size: var(--ds-fs-11); line-height: 1.2; }
.rv-credit .m3d-credits--host a { color: inherit; }
/* The player keeps the bar's own bottom space: the credit sits in the empty
   lower edge of the scrub line's touch area. */
.rv-credit:empty { display: none; }
.rv-credit .m3d-credits--host:not(.is-open) .cesium-credit-textContainer::after { content: none; }
.rv-credits { display: grid; gap: var(--ds-s1); max-height: 160px; overflow-y: auto; font-size: var(--ds-fs-12); color: var(--ds-n6); overflow-wrap: anywhere; }
.rv-credits[hidden] { display: none; }
.rv-credits-head { color: var(--ds-n6); }
.rv-credits-list .cesium-widget-credits { position: static; display: block; margin: 0; padding: 0; color: var(--ds-n8); font-size: var(--ds-fs-12); line-height: 1.45; }
.rv-credits-list .cesium-credit-logoContainer { display: block; margin-bottom: var(--ds-s1); }
.rv-credits-list .cesium-credit-textContainer { display: inline; }
.rv-credits-list .cesium-credit-expand-link { display: none; }
.rv-credits-list .cesium-credit-logoContainer img { max-height: 20px; }
.ds-root .rv-credits-list a { color: var(--ds-n8); }
.rv-settings-view { min-height: 44px; padding: 0 var(--ds-s3); border: 1px solid var(--ds-n4); border-radius: var(--ds-r-sm); background: var(--ds-n2); font-size: var(--ds-fs-13); font-weight: var(--ds-w-medium); cursor: pointer; }
.ds-root .rv-settings-view { color: var(--ds-n8); }
.rv-settings-view:hover { background: var(--ds-n3); }
.rv-settings-view:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 1px; }
/* The 3D quality picker: the engine would lay it over the picture; the
   settings give it a place. */
.rv-quality { min-width: 0; }
.rv-quality[hidden] { display: none; }
.rv-quality .tv-quality-control { position: static; inset: auto; display: grid; gap: var(--ds-s1); padding: 0; border: 0; background: transparent; color: var(--ds-n6); font-size: var(--ds-fs-12); white-space: nowrap; }
.rv-quality .tv-quality-control select { box-sizing: border-box; width: 100%; max-width: none; min-height: 44px; padding: 0 var(--ds-s2); border: 1px solid var(--ds-n4); border-radius: var(--ds-r-sm); background: var(--ds-n1); color: var(--ds-n8); font-size: var(--ds-fs-13); }
.rv-quality .tv-quality-control select:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 1px; }
/* The corner map is for phones (shown in the phone block below); on desktop
   the map sits beside the list. */
.rv-mini { display: none; }
/* Phones: the shot's title in the viewer block, Previous and Next on its
   sides (shown in the phone block below). The words wrap; none are cut. */
.rv-shotbar { display: none; align-items: center; gap: var(--ds-s2); min-width: 0; }
.rv-shotbar-step { display: inline-grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--ds-n4); border-radius: var(--ds-r-md); background: var(--ds-n1); color: var(--ds-n8); cursor: pointer; }
.rv-shotbar-step .ds-icon { width: 20px; height: 20px; }
.rv-shotbar-step:hover { background: var(--ds-n2); }
.rv-shotbar-step:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 1px; }
.rv-shotbar-step--end { border-color: transparent; background: transparent; cursor: default; }
.rv-shotbar-text { flex: 1 1 auto; min-width: 0; }
.rv-shotbar-name { margin: 0; font-size: var(--ds-fs-15); font-weight: var(--ds-w-semibold); line-height: 1.25; overflow-wrap: anywhere; }
.rv-shotbar-kind { margin: 1px 0 0; line-height: 1.3; overflow-wrap: anywhere; }
.rv-shotbar-count { flex: 0 0 auto; white-space: nowrap; }
.rv-frame-slot { display: contents; }
.rv-detail-body { display: contents; }
/* .ds-root button inherits text color; the accent button needs its own. */
.rv-play3d { position: absolute; right: var(--ds-s3); bottom: var(--ds-s3); z-index: var(--ds-z-raised); }
.ds-root .rv-play3d { color: var(--ds-on-accent); }
.rv-frame--empty .rv-play3d { position: static; }
.rv-live3d {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 340px;
  max-height: 62vh;
  overflow: hidden;
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-md);
  background: var(--ds-n0);
}
.rv-live3d[hidden] { display: none; }
/* Live 3D could not start: one short line under the saved frame. */
.rv-notice { margin: 0; color: var(--ds-warning); }

/* Approvals, when the owner allows them for the link. */
.rv-progress { margin: 0; padding: 0 var(--ds-s4) var(--ds-s2); }
/* Shots updated since the client's last visit (2026-10-20). */
.rv-fresh { margin: 0; padding: 0 var(--ds-s4) var(--ds-s2); color: var(--ds-accent); }
/* The client's first open (2026-10-20). */
.rv-intro { margin: 0; padding: 0 var(--ds-s4) var(--ds-s2); color: var(--ds-n6); }
.rv-fresh .ds-btn { vertical-align: middle; }
/* Shots above the Part 107 cap (field flags, 2026-10-18). */
.rv-review-lead { margin: 0 0 var(--ds-s2); }
.rv-flag { margin: 0 var(--ds-s4) var(--ds-s3); padding: var(--ds-s2) var(--ds-s3); border-left: 3px solid var(--ds-warning); background: var(--ds-warning-soft); color: var(--ds-warning); }
.rv-row-mark { display: inline-flex; flex: 0 0 auto; width: 14px; }
.rv-row-mark > span { display: inline-flex; }
.rv-review {
  display: grid;
  gap: var(--ds-s3);
  padding: var(--ds-s4);
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-md);
  background: var(--ds-n1);
}
.rv-review-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--ds-s2); }
.rv-review-head .ds-h3 { margin: 0; }
.rv-review-status:focus { outline: none; }
.rv-review-status:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; border-radius: var(--ds-r-sm); }
.rv-review-actions { display: flex; flex-wrap: wrap; gap: var(--ds-s2); }
/* Crew check-off (2026-11-14): a shot's state at a glance. Green when every
   capture is done, yellow when some are, red when none are or one needs a
   reshoot. The list row carries the same colour on its letter. */
.rv-crew-mark { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--ds-r-round); font-size: var(--ds-fs-12); font-weight: var(--ds-w-semibold); line-height: 18px; white-space: nowrap; }
.rv-crew-mark--green { color: var(--ds-success); background: var(--ds-success-soft); }
.rv-crew-mark--yellow { color: var(--ds-warning); background: var(--ds-warning-soft); }
.rv-crew-mark--red { color: var(--ds-danger); background: var(--ds-danger-soft); }
.rv-row-mark[data-rv-crew-mark] { width: auto; }
.rv-level { position: relative; }
.rv-level-state { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: var(--ds-r-round); border: 2px solid var(--ds-danger); }
.rv-level[data-rv-crew-state="done"] .rv-level-state { border-color: var(--ds-success); background: var(--ds-success); }
.rv-level[data-rv-crew-state="issue"] .rv-level-state { border-color: var(--ds-danger); background: var(--ds-danger); }
.rv-row[data-rv-crew-tone] .ds-letter { box-shadow: 0 0 0 2px var(--rv-crew-tone, transparent); }
.rv-row[data-rv-crew-tone="green"] { --rv-crew-tone: var(--ds-success); }
.rv-row[data-rv-crew-tone="yellow"] { --rv-crew-tone: var(--ds-warning); }
.rv-row[data-rv-crew-tone="red"] { --rv-crew-tone: var(--ds-danger); }
/* The checklist: one line per capture, its box, its label, its time. */
.rv-crew-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rv-crew-item { display: grid; grid-template-columns: 44px minmax(64px, auto) 1fr auto; align-items: center; column-gap: var(--ds-s2); padding: 2px 0; border-radius: var(--ds-r-sm); }
.rv-crew-item.is-picked { background: var(--ds-n2); }
.rv-crew-item > .rv-crew-issue-note,
.rv-crew-item > .rv-crew-form,
.rv-crew-item > .rv-review-error { grid-column: 2 / -1; margin: 0 0 var(--ds-s2); }
.rv-crew-check { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.rv-crew-box { width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid var(--ds-danger); border-radius: var(--ds-r-sm); color: transparent; }
.rv-crew-box svg { width: 18px; height: 18px; }
.rv-crew-item--done .rv-crew-box { border-color: var(--ds-success); background: var(--ds-success); color: var(--ds-n0); }
.rv-crew-item--issue .rv-crew-box { border-color: var(--ds-danger); background: var(--ds-danger-soft); color: var(--ds-danger); }
.rv-crew-check:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: -4px; border-radius: var(--ds-r-md); }
.rv-crew-label { justify-self: start; padding: 6px 4px; border: 0; background: none; color: inherit; font: inherit; font-weight: var(--ds-w-semibold); text-align: left; }
button.rv-crew-label { cursor: pointer; }
.rv-crew-label[aria-pressed="true"] { color: var(--ds-accent); }
.rv-crew-when { color: var(--ds-n6); }
.rv-crew-item--done .rv-crew-when { color: var(--ds-success); }
.rv-crew-item--issue .rv-crew-when { color: var(--ds-danger); }
.rv-crew-issue-note { color: var(--ds-danger); }
/* Crew check-off: the shot's numbers in a two-column list. */
.rv-crew-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--ds-s2) var(--ds-s3); margin: 0; }
.rv-crew-spec { min-width: 0; }
.rv-crew-spec dt { margin: 0; }
.rv-crew-spec dd { margin: 0; overflow-wrap: anywhere; }
.rv-crew-spec--wide { grid-column: 1 / -1; }
.rv-crew-spec--wide dd { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--ds-s2); }
.rv-crew-specs { margin-top: var(--ds-s3); }
.rv-review[aria-busy="true"] .rv-review-actions,
.rv-review[aria-busy="true"] .rv-review-form-actions { opacity: 0.6; pointer-events: none; }
.rv-review-form { display: grid; gap: var(--ds-s2); }
.rv-review-form-actions { display: flex; flex-wrap: wrap; gap: var(--ds-s2); }
.rv-review-error { margin: 0; color: var(--ds-danger); }
.rv-review-error:empty { display: none; }
.rv-thread { display: grid; gap: var(--ds-s2); margin: 0; padding: var(--ds-s3) 0 0; border-top: 1px solid var(--ds-n4); list-style: none; }
.rv-thread-item { display: grid; gap: 2px; }
.rv-thread-item--updated { padding-left: var(--ds-s3); border-left: 2px solid var(--ds-info); }
.rv-mark-updated { color: var(--ds-info); }
.ds-status--info { color: var(--ds-info); }
.rv-thread-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

/* Map letters: same badge as the list, ringed so they read on imagery. */
.rv-marker { background: transparent; border: 0; }
.rv-marker .ds-letter { box-shadow: 0 0 0 2px var(--ds-n0), var(--ds-shadow-1); transition: transform 120ms ease; }
.rv-marker.is-selected .ds-letter { box-shadow: 0 0 0 2px var(--ds-n0), 0 0 0 4px var(--ds-accent); transform: scale(1.15); }
.rv-map .leaflet-control-attribution { background: var(--ds-glass); color: var(--ds-n7); }
.rv-map .leaflet-control-attribution a { color: var(--ds-n7); }
.rv-map .leaflet-bar a { background: var(--ds-n2); color: var(--ds-n8); border-color: var(--ds-n4); }
.rv-map .leaflet-bar a:hover { background: var(--ds-n3); }

/* Phones: the viewer stays on top; the shot list scrolls below it, and the
   picked shot's details open under its row (owner calls 2026-11-09 and
   2026-11-10). */
@media (max-width: 899px) {
  /* The page is the scroller here. The app locks body scrolling everywhere
     else (styles.css); without this the shot list below the viewer cannot be
     scrolled to. */
  html.vnt-review-route body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
  .rv-root { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  .rv-root.rv-detail-open { height: 100vh; height: 100dvh; overflow: hidden; }
  .rv-header { grid-template-columns: minmax(0, 1fr) auto; padding: var(--ds-s3) var(--ds-s4); }
  .rv-brand { display: none; }
  .rv-action-label { display: none; }
  .rv-actions .ds-btn { width: var(--ds-control); padding: 0; }
  .rv-body { display: flex; flex-direction: column; }
  /* The viewer sticks while the list scrolls, so it is laid out by the body. */
  .rv-detail { display: contents; }
  .rv-viewer {
    position: sticky;
    top: 0;
    z-index: var(--ds-z-sticky);
    order: 1;
    gap: var(--ds-s2);
    padding: var(--ds-s2) var(--ds-s4);
    border-bottom: 1px solid var(--ds-n4);
    background: var(--ds-n0);
  }
  .rv-detail-body { display: flex; flex-direction: column; gap: var(--ds-s3); order: 2; padding: var(--ds-s3) var(--ds-s4) var(--ds-s4); }
  .rv-side { order: 3; border-top: 1px solid var(--ds-n4); border-right: 0; }
  /* The picked shot's details sit under its row in the list. */
  .rv-list .rv-detail-body { order: 0; margin: 0 var(--ds-s2) var(--ds-s2); padding: var(--ds-s2) var(--ds-s3) var(--ds-s3); border-left: 2px solid var(--ds-accent); border-radius: 0; }
  /* The title is in the viewer block once: the shot card's own title row
     would repeat it, and the title row carries Previous and Next, so the
     card's pager goes too. */
  .rv-shotbar { display: flex; }
  .rv-shotbar:empty { display: none; }
  .rv-caption-row,
  .rv-pager { display: none; }
  /* A shot with no specs, notes or review panel leaves no empty band. */
  .rv-detail-body:not(:has(> :not(.rv-caption-row):not(.rv-pager))) { display: none; }
  /* The pinned title already names the stack and its height. */
  .rv-levels-head { display: none; }
  /* The corner map: bottom right of the live view, flush with the player
     row. It folds to a button and grows to fill the picture. */
  .rv-mini {
    position: absolute;
    right: var(--ds-s2);
    bottom: var(--ds-s2);
    z-index: var(--ds-z-sticky);
    display: block;
    width: 152px;
    height: 128px;
    overflow: hidden;
    border: 1px solid var(--ds-on-image-line);
    border-radius: var(--ds-r-md);
    background: var(--ds-n2);
    isolation: isolate;
  }
  /* The player keeps to the left of the corner map, low in the picture:
     play in the bottom left corner over "Google", the scrub line beside play
     up to the map, and the time just above the start of the line. The bottom
     of play's square and of the line's box (28 px, the height of the
     iPhone's knob) sit on the map's bottom edge, 9 px up. A 360 has no time
     and no line, so play sits alone in the corner. Play takes a 36 px touch
     area here to stay close to the edge. */
  .rv-live3d .m3d-shell--embedded .m3d-bar { padding: 8px 6px 0; }
  /* "Google" sits under the player layer: the see-through play button floats over it. */
  .rv-stage .rv-credit { left: 8px; z-index: var(--ds-z-raised); }
  .rv-live3d .m3d-transport { flex-wrap: wrap; align-items: flex-end; gap: 0 var(--ds-s2); max-width: calc(100% - 164px); }
  .rv-live3d:has(.rv-mini.is-shut) .m3d-transport { max-width: calc(100% - 72px); }
  .rv-live3d .m3d-transport #m3dTime { order: 0; flex: 0 0 100%; box-sizing: border-box; padding-left: 44px; margin-bottom: -12px; white-space: nowrap; }
  .rv-live3d .m3d-transport #m3dMotion { order: 1; margin-bottom: 5px; }
  .rv-live3d .m3d-transport #m3dScrub { order: 2; flex: 1; height: 28px; margin-bottom: 9px; }
  /* Play looks like the map's chevron button: a 28 px dark square inside a
     36 px touch area. */
  .rv-live3d .m3d-transport #m3dMotion { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 4px; border: 0; border-radius: var(--ds-r-md); background: var(--ds-scrim); background-clip: content-box; font-size: var(--ds-fs-13); }
  .rv-mini.is-large { top: 60px; left: var(--ds-s2); width: auto; height: auto; }
  .rv-mini.is-shut { width: auto; height: auto; overflow: visible; border: 0; background: transparent; }
  /* The fold shrinks the map into the corner, then the MAP tab pops in. */
  .rv-mini.is-folding { transform-origin: 100% 100%; animation: rv-mini-fold 0.42s ease-in forwards; }
  .rv-mini.is-shut .rv-mini-open { animation: rv-mini-tab 0.28s ease-out; }
  /* The map keeps its own layers (Leaflet's go to 1000) inside its box, so
     the two buttons need only sit one step above it. */
  .rv-mini-body { position: absolute; inset: 0; isolation: isolate; }
  .rv-mini-body .rv-map { height: 100%; border-bottom: 0; }
  .rv-mini.is-shut .rv-mini-body,
  .rv-mini.is-shut .rv-mini-btn,
  .rv-mini:not(.is-shut) .rv-mini-open { display: none; }
  /* Folded, the map is a tab like the lead-gen tour's: the icon over a small
     capital label, on glass. The label is a .ds-kicker, the one micro label
     the sheet prints in capitals; it keeps the size and weight the tab had. */
  .rv-mini-open { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-sizing: border-box; width: 56px; height: 56px; padding: 0; border: 1px solid var(--ds-on-image-line); border-radius: var(--ds-r-md); background: var(--ds-image-glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); cursor: pointer; }
  .rv-mini-open .ds-kicker { color: inherit; font-size: var(--ds-fs-13); font-weight: var(--ds-w-regular); letter-spacing: 0.14em; }
  .rv-mini-open .ds-icon { width: 18px; height: 18px; }
  .rv-mini-btn { position: absolute; top: 0; z-index: var(--ds-z-raised); display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--ds-r-md); background: transparent; cursor: pointer; }
  .rv-mini-btn .ds-icon { box-sizing: content-box; width: 16px; height: 16px; padding: 6px; border-radius: var(--ds-r-sm); background: var(--ds-scrim); }
  .rv-mini-size { left: 0; }
  .rv-mini-shut { right: 0; }
  /* The small map has no room for zoom buttons; pinch and the large map zoom. */
  .rv-mini:not(.is-large) .leaflet-control-zoom { display: none; }
  .rv-mini .leaflet-control-attribution { font-size: var(--ds-fs-11); }
  .rv-list { overflow: visible; }
  .rv-row { min-height: 44px; }
  .rv-frame { max-height: none; }
  .rv-live3d { aspect-ratio: auto; height: clamp(240px, 42vh, 380px); min-height: 0; max-height: none; }
  /* Thumb-size review buttons. */
  .rv-review .ds-btn { height: 44px; }
}
/* A phone on its side: a pinned viewer would fill the screen. */
@media (max-width: 899px) and (max-height: 560px) {
  .rv-viewer { position: static; }
  .rv-frame { max-height: 78vh; }
}


/* ==========================================================================
   App shell (owner decision 2026-10-13)

   A slim top bar replaces the one-link sidebar: brand, Projects, search,
   notifications and the account menu. Pages inside the shell that have not
   moved onto the design system yet read the legacy tokens flipped below, so
   the whole app shares the dark ground in one step.
   ========================================================================== */

html.vnt-app-route,
html.vnt-app-route body { background: var(--ds-n0); }

.ds-app {
  --vnt-accent: var(--ds-accent);
  --vnt-accent-400: var(--ds-link);
  --vnt-accent-600: var(--ds-accent-hover);
  --vnt-accent-700: var(--ds-accent-hover);
  --vnt-accent-bright: var(--ds-link);
  --vnt-accent-dim: var(--ds-accent-soft);
  --vnt-accent-2: var(--ds-warning);
  --vnt-coral: var(--ds-warning);
  --vnt-success: var(--ds-success);
  --vnt-danger: var(--ds-danger);
  --vnt-info: var(--ds-info);
  --vnt-chip: var(--ds-n2);
  --vnt-bg: var(--ds-n0);
  --vnt-bg-2: var(--ds-n1);
  --vnt-bg-3: var(--ds-n2);
  --vnt-panel: var(--ds-n1);
  --vnt-panel-2: var(--ds-n2);
  --vnt-border: var(--ds-n4);
  --vnt-border-2: var(--ds-n5);
  --vnt-text: var(--ds-n8);
  --vnt-text-dim: var(--ds-n7);
  --vnt-text-faint: var(--ds-n6);
  --accent: var(--ds-accent);
  --accent-glow: var(--ds-accent-soft);
  --text-hi: var(--ds-n8);
  --text-mid: var(--ds-n7);
  --text-lo: var(--ds-n6);
  --text-primary: var(--ds-n8);
  --text-secondary: var(--ds-n7);
  --text-muted: var(--ds-n6);
  --surface-0: var(--ds-n0);
  --surface-1: var(--ds-n1);
  --surface-2: var(--ds-n2);
  --surface-3: var(--ds-n3);
  --surface-hover: var(--ds-n3);
  --bg-dark: var(--ds-n0);
  --bg-panel: var(--ds-n1);
  --bg-card: var(--ds-n2);
  --bg-card-hover: var(--ds-n3);
  --bg-input: var(--ds-n0);
  --border-color: var(--ds-n4);
  --red: var(--ds-danger);
  --red-bg: var(--ds-danger-soft);
  --green: var(--ds-success);
  --green-bg: var(--ds-success-soft);
  --yellow: var(--ds-warning);
  --yellow-bg: var(--ds-warning-soft);
  --blue: var(--ds-accent);
  --blue-bg: var(--ds-accent-soft);
}

.ds-app.app-layout { flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; }
.ds-app .main-content { min-height: 0; }

.ds-topbar {
  position: relative;
  z-index: var(--ds-z-sticky);
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--ds-s4);
  height: 52px;
  padding: 0 var(--ds-s4);
  border-bottom: 1px solid var(--ds-n4);
  background: var(--ds-n1);
}
.ds-topbar a.ds-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-s2);
  min-width: 0;
  color: var(--ds-n8);
  font-size: var(--ds-fs-15);
  font-weight: var(--ds-w-semibold);
}
.ds-topbar a.ds-topbar-brand:hover { text-decoration: none; }
.ds-topbar-logo { display: block; max-width: 120px; max-height: 24px; object-fit: contain; }
.ds-topbar-mark { display: inline-flex; color: var(--ds-accent); }
.ds-topbar-mark svg { width: 20px; height: 20px; }
.ds-topbar-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-topbar-nav { display: flex; align-self: stretch; gap: var(--ds-s1); }
.ds-topbar a.ds-topbar-link {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--ds-s3);
  color: var(--ds-n7);
  font-weight: var(--ds-w-medium);
  box-shadow: inset 0 -2px 0 transparent;
}
.ds-topbar a.ds-topbar-link:hover { color: var(--ds-n8); text-decoration: none; }
.ds-topbar a.ds-topbar-link[aria-current="page"] { color: var(--ds-n8); box-shadow: inset 0 -2px 0 var(--ds-accent); }
.ds-topbar-right { display: flex; align-items: center; gap: var(--ds-s2); margin-left: auto; }
.ds-topbar .ds-topbar-search { justify-content: flex-start; min-width: 200px; color: var(--ds-n7); }
.ds-topbar-kbd {
  margin-left: auto;
  padding: 1px var(--ds-s1);
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-sm);
  color: var(--ds-n6);
  font-family: var(--ds-mono);
  font-size: var(--ds-fs-11);
}
.ds-topbar .notif-btn { position: relative; min-width: 0; min-height: 0; padding: 0; color: var(--ds-n7); }
.ds-topbar .notif-btn .ds-icon { width: 18px; height: 18px; }
.ds-topbar .ds-topbar-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 16px;
  height: 16px;
  padding: 0 var(--ds-s1);
  border-radius: var(--ds-r-round);
  background: var(--ds-danger);
  color: var(--ds-n0);
  font-size: var(--ds-fs-11);
  font-weight: var(--ds-w-semibold);
}
.ds-topbar .ds-topbar-badge.hidden { display: none; }
.ds-topbar .user-avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-round);
  background: var(--ds-n3);
  color: var(--ds-n8);
  font-size: var(--ds-fs-12);
  font-weight: var(--ds-w-semibold);
}
.ds-topbar .user-avatar-btn:hover { border-color: var(--ds-n5); }
.ds-topbar .user-avatar-btn .ds-icon { width: 16px; height: 16px; }
.ds-topbar .user-avatar-btn .ds-topbar-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: var(--ds-r-round);
  object-fit: cover;
}
.ds-topbar .user-avatar-btn:has(.ds-topbar-avatar-img) { overflow: hidden; padding: 0; }
.ds-topbar .ds-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: var(--ds-z-dropdown);
  min-width: 220px;
  padding: var(--ds-s1);
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-md);
  background: var(--ds-n2);
  box-shadow: var(--ds-shadow-2);
}
.ds-topbar .ds-menu[hidden] { display: none; }
.ds-menu .user-avatar-dd-head { padding: var(--ds-s2) var(--ds-s2) var(--ds-s3); border-bottom: 1px solid var(--ds-n4); margin-bottom: var(--ds-s1); }
.ds-menu .user-avatar-dd-name { color: var(--ds-n8); font-weight: var(--ds-w-semibold); }
.ds-menu .user-avatar-dd-email { color: var(--ds-n6); font-size: var(--ds-fs-12); overflow-wrap: anywhere; }
.ds-menu .user-avatar-dd-item,
.ds-menu a.user-avatar-dd-item {
  display: block;
  width: 100%;
  padding: var(--ds-s2);
  border: 0;
  border-radius: var(--ds-r-sm);
  background: transparent;
  color: var(--ds-n8);
  font-size: var(--ds-fs-13);
  text-align: left;
  cursor: pointer;
}
.ds-menu .user-avatar-dd-item:hover,
.ds-menu a.user-avatar-dd-item:hover { background: var(--ds-n3); text-decoration: none; }
.ds-menu .user-avatar-dd-signout { color: var(--ds-danger); }

@media (max-width: 768px) {
  .ds-topbar { gap: var(--ds-s2); padding: 0 var(--ds-s3); }
  .ds-topbar-name,
  .ds-topbar-search-label,
  .ds-topbar-kbd { display: none; }
  .ds-topbar .ds-topbar-search { justify-content: center; min-width: 0; width: var(--ds-control-sm); padding: 0; }
}

/* ---- Legacy controls inside the shell -------------------------------------- */

.ds-app .btn {
  min-height: var(--ds-control);
  padding: 0 var(--ds-s4);
  border-radius: var(--ds-r-sm);
  font-size: var(--ds-fs-13);
  font-weight: var(--ds-w-medium);
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
}
.ds-app .btn-sm { min-height: var(--ds-control-sm); padding: 0 var(--ds-s3); font-size: var(--ds-fs-12); }
.ds-app .btn-primary { border-color: var(--ds-accent); background: var(--ds-accent); color: var(--ds-on-accent); font-size: var(--ds-fs-13); letter-spacing: 0; text-transform: none; }
.ds-app .btn-primary:hover { border-color: var(--ds-accent-hover); background: var(--ds-accent-hover); box-shadow: none; }
.ds-app .btn-secondary,
.ds-app .btn-ghost { border-color: var(--ds-n4); background: var(--ds-n2); color: var(--ds-n8); }
.ds-app .btn-secondary:hover,
.ds-app .btn-ghost:hover { border-color: var(--ds-n5); background: var(--ds-n3); color: var(--ds-n8); }
.ds-app .btn-danger { border-color: var(--ds-danger); background: var(--ds-danger-soft); color: var(--ds-danger); }
.ds-app .btn:disabled { opacity: 0.5; cursor: default; }
.ds-app .form-input {
  border-color: var(--ds-n4);
  border-radius: var(--ds-r-sm);
  background-color: var(--ds-n0);
  color: var(--ds-n8);
  font-size: var(--ds-fs-13);
}
.ds-app .form-input:hover { border-color: var(--ds-n5); }
.ds-app .form-input:focus { border-color: var(--ds-accent); background-color: var(--ds-n0); box-shadow: none; }
.ds-app .form-input:disabled { color: var(--ds-n6); }
.ds-app .settings-section { border-color: var(--ds-n4); border-radius: var(--ds-r-md); background: var(--ds-n1); }
.ds-app .settings-section h2 { font-size: var(--ds-fs-15); font-weight: var(--ds-w-semibold); }
.ds-app .settings-desc { color: var(--ds-n7); font-size: var(--ds-fs-13); }
/* Legacy fills on the accent: dark text, as on every DS accent surface. */
.ds-app :is(.notif-unread-pill, .profile-avatar-initials, .capture-filter-btn.is-active, .vnt-admin-pill.is-studio) { color: var(--ds-on-accent); }
/* The inbox rows kept a paper-era white card under the dark shell, which
   put an unread title in white on white (seen 2026-10-19). DS surfaces. */
.ds-app .notif-row { background: var(--ds-n1); border-color: var(--ds-n4); color: var(--ds-n7); }
.ds-app .notif-row:hover { background: var(--ds-n2); }
.ds-app .notif-row-unread { border-color: var(--ds-n4); border-left-color: var(--ds-accent); box-shadow: none; }
.ds-app .notif-title { color: var(--ds-n7); }
.ds-app .notif-row-unread .notif-title { color: var(--ds-n8); }
.ds-app .notif-body, .ds-app .notif-meta { color: var(--ds-n6); }
.ds-app .notif-icon { background: var(--ds-accent-soft); color: var(--ds-accent); }

/* ---- Projects ---------------------------------------------------------------- */

.pj-page { width: 100%; max-width: 1120px; margin: 0 auto; padding: var(--ds-s6) var(--ds-s5) var(--ds-s7); }
.pj-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--ds-s4); margin: 0 0 var(--ds-s5); }
.pj-sub { margin: var(--ds-s1) 0 0; }
.pj-sub:empty { display: none; }
.pj-head .projects-actions { display: flex; flex-wrap: wrap; gap: var(--ds-s2); }
.pj-table-wrap { overflow-x: auto; border: 1px solid var(--ds-n4); border-radius: var(--ds-r-md); background: var(--ds-n1); }
.pj-table { width: 100%; border-collapse: collapse; }
.pj-table th {
  padding: var(--ds-s2) var(--ds-s4);
  border-bottom: 1px solid var(--ds-n4);
  background: transparent;
  color: var(--ds-n6);
  font-size: var(--ds-fs-12);
  font-weight: var(--ds-w-medium);
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: nowrap;
}
.pj-table td { padding: var(--ds-s2) var(--ds-s4); border-bottom: 1px solid var(--ds-n3); background: transparent; color: var(--ds-n7); vertical-align: middle; }
.pj-table tbody tr:last-child td { border-bottom: 0; }
.pj-table .project-row { cursor: pointer; }
.pj-table .project-row:hover td { background: var(--ds-n2); }
.pj-table .project-name { width: 100%; min-width: 220px; }
.pj-table a.pj-name { display: block; color: var(--ds-n8); font-size: var(--ds-fs-13); font-weight: var(--ds-w-medium); }
.pj-meta { display: block; margin-top: 2px; color: var(--ds-n6); font-size: var(--ds-fs-12); }
.pj-meta .projects-row-counts { display: inline; margin: 0; color: inherit; font-size: inherit; }
.pj-date { white-space: nowrap; }
.pj-actions-head { width: 1%; }
.pj-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ds-control-sm);
  height: var(--ds-control-sm);
  border: 0;
  border-radius: var(--ds-r-sm);
  background: transparent;
  color: var(--ds-n7);
  list-style: none;
  cursor: pointer;
}
.pj-menu summary::-webkit-details-marker { display: none; }
.pj-menu summary:hover,
.pj-menu[open] summary { background: var(--ds-n3); color: var(--ds-n8); }
.pj-menu .projects-kebab-menu {
  z-index: var(--ds-z-dropdown);
  min-width: 180px;
  padding: var(--ds-s1);
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-md);
  background: var(--ds-n2);
  box-shadow: var(--ds-shadow-2);
}
.pj-menu .projects-kebab-menu a,
.pj-menu .projects-kebab-menu button {
  display: block;
  width: 100%;
  padding: var(--ds-s2);
  border: 0;
  border-radius: var(--ds-r-sm);
  background: transparent;
  color: var(--ds-n8);
  font-size: var(--ds-fs-13);
  font-weight: var(--ds-w-regular);
  text-align: left;
  cursor: pointer;
}
.pj-menu .projects-kebab-menu a:hover,
.pj-menu .projects-kebab-menu button:hover { background: var(--ds-n3); text-decoration: none; }
.pj-menu .projects-kebab-menu .projects-delete-btn { color: var(--ds-danger); }
.pj-menu .projects-kebab-menu .projects-delete-btn.is-confirming { background: var(--ds-danger-soft); }
.pj-empty { display: grid; justify-items: start; gap: var(--ds-s2); padding: var(--ds-s5); }
.pj-empty p { margin: 0; }
.pj-shared { margin-top: var(--ds-s6); padding-top: var(--ds-s5); border-top: 1px solid var(--ds-n4); }
.pj-shared:empty { display: none; }
.pj-shared h2 { margin: 0 0 var(--ds-s1); font-size: var(--ds-fs-15); font-weight: var(--ds-w-semibold); }
.pj-shared p { margin: 0 0 var(--ds-s3); color: var(--ds-n7); }
.pj-shared .shared-project-row {
  display: flex;
  align-items: center;
  gap: var(--ds-s2);
  padding: var(--ds-s2) var(--ds-s3);
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-md);
  background: var(--ds-n1);
}
.pj-shared .shared-project-row > div { display: grid; flex: 1 1 auto; min-width: 0; }
.pj-shared .shared-project-row small { color: var(--ds-n6); font-size: var(--ds-fs-12); }
.pj-shared .shared-project-row + .shared-project-row { margin-top: var(--ds-s2); }

@media (max-width: 768px) {
  .pj-page { padding: var(--ds-s4) var(--ds-s3) var(--ds-s6); }
  .pj-head { align-items: flex-start; flex-direction: column; }
  .pj-table th,
  .pj-table td { padding: var(--ds-s2) var(--ds-s3); }
  .pj-table .project-name { min-width: 160px; }
}
/* Phones: one list row per project, the menu at its right. */
@media (max-width: 700px) {
  .pj-table tbody { gap: 0; }
  .pj-table .project-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 var(--ds-s2);
    padding: var(--ds-s3);
    border: 0;
    border-bottom: 1px solid var(--ds-n3);
    border-radius: 0;
  }
  .pj-table .project-row:last-child { border-bottom: 0; }
  .pj-table .project-row td { padding: 0; }
  .pj-table .project-row .project-name a { padding: 0; font-size: var(--ds-fs-15); }
  .pj-table .project-row .project-actions { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
  .pj-table .project-row td[data-label] { margin-top: var(--ds-s1); font-size: var(--ds-fs-12); }
}

/* The closed More sheet sits under the phone nav; keep it from painting there. */
.ds-app .mobile-more-drawer:not(.open) .mobile-more-sheet { visibility: hidden; }

/* ---- Account ----------------------------------------------------------------- */

.ac-page { width: 100%; max-width: 760px; margin: 0 auto; padding: var(--ds-s6) var(--ds-s5) var(--ds-s7); }
.ac-head { display: grid; gap: var(--ds-s4); margin: 0 0 var(--ds-s5); }
.ac-tabs { display: flex; flex-wrap: wrap; justify-self: stretch; gap: var(--ds-s1); width: 100%; padding: 0; border: 0; border-bottom: 1px solid var(--ds-n4); border-radius: 0; background: transparent; }
.ac-tabs a.account-tab {
  margin-bottom: -1px;
  padding: var(--ds-s2) var(--ds-s3);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ds-n7);
  font-size: var(--ds-fs-13);
  font-weight: var(--ds-w-medium);
}
.ac-tabs a.account-tab:hover { color: var(--ds-n8); text-decoration: none; }
.ac-tabs a.account-tab.active { border-bottom-color: var(--ds-accent); background: transparent; color: var(--ds-n8); }
.ac-body.settings-page { max-width: none; margin: 0; padding: 0; }
.ac-body .settings-section { padding: var(--ds-s5); margin: 0 0 var(--ds-s4); }
.ac-body .settings-section h2 { margin: 0 0 var(--ds-s1); }
.ac-body .form-group label { color: var(--ds-n7); font-size: var(--ds-fs-12); font-weight: var(--ds-w-medium); }
.ac-body .settings-section > .btn + .btn { margin-left: var(--ds-s2); }

@media (max-width: 768px) {
  .ac-page { padding: var(--ds-s4) var(--ds-s3) var(--ds-s6); }
  .ac-body .settings-section { padding: var(--ds-s4); }
}

/* ---- Admin ------------------------------------------------------------------- */

.vnt-admin.ds-app { background: var(--ds-n0); color: var(--ds-n8); }
.vnt-admin a.vnt-admin-tab { color: var(--ds-n7); }
.vnt-admin a.vnt-admin-tab:hover { color: var(--ds-n8); text-decoration: none; }
.vnt-admin a.vnt-admin-tab.is-active { color: var(--ds-n8); }
.vnt-admin .vnt-admin-account-open {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ds-n8);
  font-weight: var(--ds-w-medium);
  text-align: left;
  cursor: pointer;
}
.vnt-admin .vnt-admin-account-open:hover { color: var(--ds-link); }
.vnt-admin .vnt-admin-table td small { display: block; }
.vnt-admin .vnt-admin-pill.is-team { color: var(--ds-n0); }
.vnt-admin-guests { display: inline-flex; align-items: center; gap: var(--ds-s2); color: var(--ds-n7); font-size: var(--ds-fs-13); white-space: nowrap; }
.vnt-admin-guests input { accent-color: var(--ds-accent); }
.adm-ops-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ds-s3); margin-bottom: var(--ds-s4); }
.adm-ops-head h2 { margin: 0; }
.adm-ops-head p { margin: var(--ds-s1) 0 0; color: var(--ds-n6); }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--ds-s3); align-items: start; }
.adm-card { border: 1px solid var(--ds-n4); border-radius: var(--ds-r-md); background: var(--ds-n2); --adm-tone: var(--ds-n6); }
.adm-card.is-ok { --adm-tone: var(--ds-success); }
.adm-card.is-warn { --adm-tone: var(--ds-warning); }
.adm-card.is-bad { --adm-tone: var(--ds-danger); border-color: var(--ds-danger); }
.adm-card > summary { display: grid; gap: var(--ds-s1); padding: var(--ds-s3) var(--ds-s4); list-style: none; cursor: pointer; }
.adm-card > summary::-webkit-details-marker { display: none; }
.adm-card-title { display: flex; align-items: center; gap: var(--ds-s2); color: var(--ds-n7); font-size: var(--ds-fs-12); font-weight: var(--ds-w-medium); }
.adm-dot { width: 8px; height: 8px; border-radius: var(--ds-r-round); background: var(--adm-tone); }
.adm-card-line { color: var(--ds-n8); font-size: var(--ds-fs-15); font-weight: var(--ds-w-semibold); }
.adm-card[open] { grid-column: 1 / -1; }
.adm-card-detail { padding: 0 var(--ds-s4) var(--ds-s4); border-top: 1px solid var(--ds-n4); color: var(--ds-n7); }
.adm-card-detail h3 { margin: var(--ds-s3) 0 var(--ds-s1); color: var(--ds-n8); font-size: var(--ds-fs-13); font-weight: var(--ds-w-semibold); }
.adm-card-detail p,
.adm-card-detail ul { margin: var(--ds-s1) 0; }
.adm-ops-note { margin: var(--ds-s4) 0 0; color: var(--ds-n6); font-size: var(--ds-fs-12); }


/* ---- Route loading ---------------------------------------------------------
   A quiet status while a view waits on a library it loads on demand (the 3D
   engine). It shows only after a short delay, so a cached load never flashes. */
.vnt-route-loading {
  position: fixed;
  top: var(--ds-s3);
  left: 50%;
  z-index: var(--ds-z-toast);
  padding: var(--ds-s2) var(--ds-s4);
  border: 1px solid var(--ds-n4);
  border-radius: var(--ds-r-round);
  background: var(--ds-glass);
  color: var(--ds-n8);
  font-family: var(--ds-font);
  font-size: var(--ds-fs-13);
  font-weight: var(--ds-w-medium);
  box-shadow: var(--ds-shadow-1);
  transform: translateX(-50%);
}
.vnt-route-loading[hidden] { display: none; }
