/*
 * Voice Desk design system — Phase 1
 *
 * The system owns visual tokens and shared shell treatment only. Product
 * layouts and every existing behaviour hook remain in their current pages
 * until their dedicated redesign phase.
 */
:root {
  color-scheme: light;
  --vd-paper: #f7f4ee;
  --vd-surface: #fffdf9;
  --vd-surface-muted: #edf1eb;
  --vd-ink: #17201d;
  --vd-ink-soft: #435149;
  --vd-forest: #0d7656;
  --vd-forest-strong: #095e45;
  --vd-moss: #dde9df;
  --vd-saffron: #e8a13a;
  --vd-clay: #b95c43;
  --vd-mist: #d8ddd7;
  --vd-focus: #0c6f9f;
  --vd-radius-sm: 0.5rem;
  --vd-radius: 0.875rem;
  --vd-radius-lg: 1.25rem;
  --vd-shadow: 0 14px 32px rgb(23 32 29 / 8%);
  --vd-content: 74rem;
  --vd-reading: 48rem;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--vd-paper);
  scroll-padding-top: 5rem;
}

body,
body[data-ui-redesign] {
  min-width: 0;
  background: var(--vd-paper) !important;
  color: var(--vd-ink) !important;
  font-family: inherit;
  text-rendering: optimizeLegibility;
}

body[data-vd-shell] {
  min-height: 100vh;
}

body ::selection {
  background: var(--vd-moss);
  color: var(--vd-ink);
}

body :where(h1, h2, h3, h4) {
  color: var(--vd-ink) !important;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

body :where(p, li, dd, dt) {
  color: var(--vd-ink-soft);
}

body :where(a) {
  color: var(--vd-forest);
  text-underline-offset: 0.18em;
}

body :where(input, select, textarea) {
  min-width: 0;
  min-height: 2.75rem;
  border: 1px solid var(--vd-mist) !important;
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface) !important;
  color: var(--vd-ink) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%);
}

body :where(input, select, textarea)::placeholder {
  color: #708078;
  opacity: 1;
}

body :where(button, [role="button"]) {
  min-height: 2.75rem;
  border-radius: var(--vd-radius-sm);
}

body :where(button, a, input, select, textarea, summary, [role="button"]):focus-visible {
  outline: 3px solid var(--vd-focus) !important;
  outline-offset: 3px;
}

body :where(button, [role="button"]):disabled,
body :where(input, select, textarea):disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

body .bg-brand-500,
body .bg-emerald-500 {
  background-color: var(--vd-forest) !important;
}

body .hover\:bg-brand-400:hover,
body .hover\:bg-brand-500:hover,
body .hover\:bg-emerald-400:hover,
body .hover\:bg-emerald-500:hover {
  background-color: var(--vd-forest-strong) !important;
}

body .text-emerald-400,
body .text-emerald-500,
body .text-brand-400,
body .text-brand-500 {
  color: var(--vd-forest) !important;
}

body .text-white,
body .text-gray-100,
body .text-gray-200,
body .text-gray-300 {
  color: var(--vd-ink) !important;
}

/* Preserve the semantic contrast of existing solid actions after removing the
   legacy dark canvas. The application markup still owns its state and copy. */
body .bg-brand-500.text-white,
body .bg-emerald-500.text-white,
body .bg-red-500.text-white,
body [class*="bg-brand-"][class*="text-white"],
body [class*="bg-emerald-"][class*="text-white"],
body [class*="bg-red-"][class*="text-white"] {
  color: #ffffff !important;
}

body .text-gray-400,
body .text-gray-500,
body .text-gray-600 {
  color: var(--vd-ink-soft) !important;
}

body .border-white\/5,
body .border-white\/10,
body .border-white\/\[\.05\],
body .border-white\/\[\.06\],
body .border-white\/\[\.08\],
body .border-gray-700,
body .border-gray-800 {
  border-color: var(--vd-mist) !important;
}

body [class*="bg-[#"],
body .bg-white\/5,
body .bg-white\/10,
body .bg-white\/\[\.03\],
body .bg-white\/\[\.04\] {
  background-color: var(--vd-surface) !important;
}

body .card,
body .card-glass,
body .modal,
body .modal-bg,
body .code,
body .code-block {
  border-color: var(--vd-mist) !important;
  background: var(--vd-surface) !important;
  box-shadow: var(--vd-shadow);
}

/* The admin consoles are intentionally dark operational surfaces. Keep the
   shared light product layer from turning their login gate and panel into a
   low-contrast light/dark hybrid. */
body.vd-admin-page {
  min-width: 0;
  background: #030704 !important;
  color: #e5e7eb !important;
}

body.vd-admin-page :where(h1, h2, h3, h4) {
  color: #f9fafb !important;
  letter-spacing: normal;
}

body.vd-admin-page :where(p, li, dd, dt) {
  color: #9ca3af !important;
}

body.vd-admin-page :where(a) {
  color: #34d399;
}

body.vd-admin-page :where(input, select, textarea) {
  min-height: 2.5rem;
  border-color: rgb(255 255 255 / 10%) !important;
  background-color: rgb(255 255 255 / 5%) !important;
  color: #f9fafb !important;
  box-shadow: none !important;
}

body.vd-admin-page :where(input, select, textarea)::placeholder {
  color: #6b7280 !important;
}

body.vd-admin-page .text-white,
body.vd-admin-page .text-gray-100,
body.vd-admin-page .text-gray-200,
body.vd-admin-page .text-gray-300 {
  color: #f9fafb !important;
}

body.vd-admin-page .text-gray-400,
body.vd-admin-page .text-gray-500,
body.vd-admin-page .text-gray-600 {
  color: #9ca3af !important;
}

body.vd-admin-page .text-emerald-400,
body.vd-admin-page .text-emerald-500,
body.vd-admin-page .text-brand-400,
body.vd-admin-page .text-brand-500 {
  color: #34d399 !important;
}

body.vd-admin-page .bg-emerald-500,
body.vd-admin-page .bg-brand-500 {
  background-color: #10b981 !important;
}

body.vd-admin-page .bg-white\/5,
body.vd-admin-page .bg-white\/10,
body.vd-admin-page .bg-white\/\[\.03\],
body.vd-admin-page .bg-white\/\[\.04\],
body.vd-admin-page [class*="bg-[#"] {
  background-color: rgb(255 255 255 / 5%) !important;
}

body.vd-admin-page .border-white\/5,
body.vd-admin-page .border-white\/10,
body.vd-admin-page .border-white\/\[\.05\],
body.vd-admin-page .border-white\/\[\.06\],
body.vd-admin-page .border-white\/\[\.08\],
body.vd-admin-page .border-gray-700,
body.vd-admin-page .border-gray-800 {
  border-color: rgb(255 255 255 / 10%) !important;
}

body.vd-admin-page .card,
body.vd-admin-page .card-glass,
body.vd-admin-page .modal,
body.vd-admin-page .modal-bg,
body.vd-admin-page .code,
body.vd-admin-page .code-block {
  border-color: rgb(255 255 255 / 10%) !important;
  background: rgb(13 26 15 / 92%) !important;
  box-shadow: 0 18px 50px rgb(0 0 0 / 24%);
}

body :where([style*="backdrop-filter"], [class*="backdrop-blur"]) {
  backdrop-filter: none !important;
}

body .hero-glow,
body .gradient-glow,
body .blur-3xl,
body .bg-clip-text,
body .text-transparent.bg-clip-text {
  background-image: none !important;
  -webkit-text-fill-color: currentColor;
}

/* Shared app shell */
body [data-site-nav],
body [data-vd-header] {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--vd-mist) !important;
  background: rgb(247 244 238 / 96%) !important;
  color: var(--vd-ink);
  box-shadow: 0 1px 0 rgb(23 32 29 / 4%);
}

body [data-site-nav] a:not([class*="bg-"]) {
  color: var(--vd-ink-soft) !important;
}

body [data-site-nav] a:hover:not([class*="bg-"]),
body [data-site-nav] a[data-nav].text-emerald-400 {
  color: var(--vd-forest) !important;
}

body [data-site-nav] [class~="bg-emerald-500"],
body [data-site-nav] [class~="bg-brand-500"] {
  color: #fff !important;
  box-shadow: none;
}

body [data-site-nav] summary {
  min-height: 2.5rem;
  border-color: var(--vd-mist) !important;
  background: var(--vd-surface-muted) !important;
  color: var(--vd-ink) !important;
}

body [data-vd-main] {
  min-width: 0;
}

body footer,
body [data-vd-footer] {
  border-color: var(--vd-mist) !important;
  background: var(--vd-surface-muted);
  color: var(--vd-ink-soft);
}

/* The landing footer has a deliberately broad set of editorial routes. */
body.vd-landing-page footer > div > .flex.flex-col {
  flex-wrap: wrap;
}

body.vd-landing-page footer > div > .flex.flex-col > .flex.items-center.gap-6 {
  flex: 1 1 34rem;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.vd-container {
  width: min(calc(100% - 2rem), var(--vd-content));
  margin-inline: auto;
}

.vd-editorial__main {
  width: min(calc(100% - 2rem), var(--vd-reading));
  margin-inline: auto;
  padding-block: clamp(3rem, 8vw, 6rem);
}

.vd-editorial__header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--vd-mist);
}

.vd-editorial .prose,
.vd-prose {
  font-size: 1rem;
  line-height: 1.75;
}

body .vd-editorial .prose h2,
body .vd-prose h2 {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--vd-mist);
  color: var(--vd-ink) !important;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

body .vd-editorial .prose p,
body .vd-editorial .prose ul,
body .vd-prose p,
body .vd-prose ul {
  color: var(--vd-ink-soft) !important;
  font-size: 1rem;
}

body .vd-editorial .prose strong,
body .vd-prose strong {
  color: var(--vd-ink) !important;
}

/* Mobile navigation drawer; its DOM is enhanced by ui-shell.js. */
.vd-drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 39;
  width: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: rgb(23 32 29 / 32%);
}

body[data-vd-drawer-open] {
  overflow: hidden;
}

@media (max-width: 63.99rem) {
  /* The pre-existing desktop link set is too dense at tablet widths. Keep the
     same navigation choices in the accessible drawer until desktop space is
     genuinely available. */
  body [data-site-nav] > div > div.hidden.md\:flex {
    display: none !important;
  }

  body [data-site-nav] > div > div.flex.items-center > a.hidden {
    display: none !important;
  }

  body [data-site-nav] details.md\:hidden {
    display: block !important;
  }

  /* Auth actions remain available in the drawer. Keeping a second inline
     cluster at this width squeezes the brand and causes horizontal overflow. */
  body [data-site-nav] #nav-auth-anon:not(.hidden),
  body [data-site-nav] #nav-auth-user:not(.hidden) {
    display: none !important;
  }

  body [data-vd-drawer][open] > div {
    position: fixed !important;
    inset: 0 0 0 auto !important;
    z-index: 50;
    display: block;
    width: min(21rem, 88vw);
    margin: 0 !important;
    padding: 1.25rem !important;
    overflow-y: auto;
    border: 0 !important;
    border-left: 1px solid var(--vd-mist) !important;
    border-radius: 0 !important;
    background: var(--vd-surface) !important;
    box-shadow: -18px 0 38px rgb(23 32 29 / 14%);
  }

  body [data-vd-drawer][open] > div a {
    min-height: 2.75rem;
    color: var(--vd-ink) !important;
  }

  body [data-vd-drawer][open] > div a[class~="bg-emerald-500"],
  body [data-vd-drawer][open] > div a[class~="bg-brand-500"],
  body [data-vd-drawer][open] > div a[class~="bg-red-500"],
  body [data-vd-drawer][open] > div a[class~="bg-red-500/80"] {
    color: #ffffff !important;
  }

  body [data-site-nav] > div {
    gap: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Phase 2 — landing proof before persuasion. */
body.vd-landing-page {
  overflow-x: clip;
}

.vd-landing {
  overflow-x: clip;
}

.vd-landing-hero {
  border-bottom: 1px solid var(--vd-mist);
  background: var(--vd-paper);
}

.vd-landing-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(25rem, 1.18fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6.5rem);
  width: min(calc(100% - 2rem), var(--vd-content));
  margin-inline: auto;
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2.25rem, 5vw, 4rem);
}

.vd-landing-hero__copy,
.vd-landing-hero__proof {
  min-width: 0;
}

.vd-landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  color: var(--vd-forest);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.vd-landing-eyebrow::before {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--vd-saffron);
  content: "";
}

.vd-landing-hero h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(2.75rem, 5.3vw, 5.25rem);
  font-weight: 760;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.vd-landing-hero__lede {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  color: var(--vd-ink-soft);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.65;
}

.vd-landing-hero__api-note {
  max-width: 34rem;
  margin: 1rem 0 0;
  color: var(--vd-ink-soft);
  font-size: 0.875rem;
  line-height: 1.55;
}

.vd-landing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
  margin-top: 2rem;
}

.vd-button-primary,
.vd-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.625rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--vd-radius-sm);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.vd-button-primary {
  background: var(--vd-forest);
  color: #fff !important;
}

.vd-button-primary:hover {
  background: var(--vd-forest-strong);
  color: #fff !important;
}

.vd-button-secondary {
  border-color: var(--vd-mist);
  background: var(--vd-surface);
  color: var(--vd-ink) !important;
}

.vd-button-secondary:hover {
  border-color: var(--vd-forest);
  color: var(--vd-forest) !important;
}

.vd-landing-proof {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  border: 1px solid var(--vd-ink);
  border-radius: var(--vd-radius-lg);
  background: var(--vd-surface);
  box-shadow: var(--vd-shadow);
}

.vd-landing-proof__topline,
.vd-landing-proof__result,
.vd-landing-proof__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
}

.vd-landing-proof__label,
.vd-landing-proof__safe {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vd-landing-proof__label {
  color: var(--vd-ink-soft);
}

.vd-landing-proof__safe {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--vd-moss);
  border-radius: 999px;
  background: var(--vd-moss);
  color: var(--vd-forest);
}

.vd-landing-proof__script {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--vd-mist);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-paper);
  color: var(--vd-ink);
  font-size: 1rem;
  line-height: 1.55;
}

.vd-landing-proof__heading {
  margin: 0;
  color: var(--vd-ink);
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 750;
  line-height: 1.08;
}

.vd-landing-proof__intro {
  margin: 0.65rem 0 0;
  color: var(--vd-ink-soft);
  font-size: 0.875rem;
  line-height: 1.55;
}

.vd-landing-proof__caption {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--vd-ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vd-landing-voice-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
}

.vd-landing-voice {
  display: grid;
  gap: 0.28rem;
  min-height: 5.5rem;
  padding: 0.75rem;
  border: 1px solid var(--vd-mist);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface);
  color: var(--vd-ink);
  text-align: left;
}

.vd-landing-voice:hover,
.vd-landing-voice[aria-pressed="true"] {
  border-color: var(--vd-forest);
  background: var(--vd-moss);
}

.vd-landing-voice[aria-pressed="true"]::after {
  align-self: start;
  color: var(--vd-forest);
  font-size: 0.75rem;
  font-weight: 700;
  content: "Selected";
}

.vd-landing-voice__name {
  color: var(--vd-ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.vd-landing-voice__role {
  color: var(--vd-ink-soft);
  font-size: 0.78rem;
  line-height: 1.35;
}

.vd-landing-proof__voice-name {
  margin: 0;
  color: var(--vd-ink);
  font-size: 1rem;
  font-weight: 750;
}

.vd-landing-proof__voice-meta,
.vd-landing-proof__status {
  margin: 0.2rem 0 0;
  color: var(--vd-ink-soft);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.vd-landing-proof__play {
  flex: 0 0 auto;
  padding-inline: 0.875rem;
  border: 1px solid var(--vd-forest);
  background: var(--vd-forest);
  color: #fff;
  font-weight: 700;
}

.vd-landing-proof__play:hover {
  background: var(--vd-forest-strong);
}

.vd-landing-waveform {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  min-height: 2rem;
  padding: 0.5rem 0;
}

.vd-landing-waveform span {
  display: block;
  width: 0.22rem;
  height: var(--vd-wave-height, 1rem);
  border-radius: 999px;
  background: var(--vd-mist);
}

.vd-landing-proof[data-preview-state="playing"] .vd-landing-waveform span:nth-child(-n + 8) {
  background: var(--vd-saffron);
}

.vd-landing-proof__progress {
  width: 100%;
  height: 0.45rem;
  accent-color: var(--vd-forest);
}

.vd-landing-proof__progress-text {
  min-width: 2.5rem;
  color: var(--vd-ink-soft);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.vd-landing-proof__footer {
  padding-top: 0.25rem;
  border-top: 1px solid var(--vd-mist);
}

.vd-landing-proof__footer p {
  margin: 0;
  color: var(--vd-ink-soft);
  font-size: 0.8125rem;
}

.vd-landing-proof__footer a {
  flex: 0 0 auto;
  color: var(--vd-forest);
  font-size: 0.875rem;
  font-weight: 750;
}

.vd-landing-credibility {
  width: min(calc(100% - 2rem), var(--vd-content));
  margin-inline: auto;
  padding-block: 1rem 2rem;
}

.vd-landing-credibility__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--vd-mist);
  border-bottom: 1px solid var(--vd-mist);
  list-style: none;
}

.vd-landing-credibility__item {
  min-width: 0;
  padding: 1rem;
  border-right: 1px solid var(--vd-mist);
}

.vd-landing-credibility__item:last-child {
  border-right: 0;
}

.vd-landing-credibility strong,
.vd-landing-credibility span {
  display: block;
}

.vd-landing-credibility strong {
  color: var(--vd-ink);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.vd-landing-credibility span {
  margin-top: 0.25rem;
  color: var(--vd-ink-soft);
  font-size: 0.75rem;
}

.vd-landing-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: min(calc(100% - 2rem), var(--vd-content));
  margin: 0 auto clamp(3rem, 6vw, 5rem);
}

.vd-landing-path {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--vd-mist);
  border-radius: var(--vd-radius);
  background: var(--vd-surface);
}

.vd-landing-path h2 {
  margin: 0;
  color: var(--vd-ink);
  font-size: 1.125rem;
}

.vd-landing-path p {
  margin: 0.5rem 0 0;
  color: var(--vd-ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.vd-landing-path a {
  display: inline-block;
  margin-top: 0.875rem;
  color: var(--vd-forest);
  font-size: 0.875rem;
  font-weight: 750;
}

@media (max-width: 63.99rem) {
  .vd-landing-hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .vd-landing-hero h1 {
    max-width: 13ch;
  }
}

@media (max-width: 41.99rem) {
  .vd-landing-hero__grid {
    width: min(calc(100% - 1.5rem), var(--vd-content));
    padding-block: 2.25rem 1.5rem;
  }

  .vd-landing-actions,
  .vd-landing-proof__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .vd-landing-actions a,
  .vd-landing-proof__footer a {
    width: 100%;
  }

  .vd-landing-voice-list,
  .vd-landing-credibility__list,
  .vd-landing-paths {
    grid-template-columns: minmax(0, 1fr);
  }

  .vd-landing-credibility {
    width: min(calc(100% - 1.5rem), var(--vd-content));
  }

  .vd-landing-credibility__item {
    border-right: 0;
    border-bottom: 1px solid var(--vd-mist);
  }

  .vd-landing-credibility__item:last-child {
    border-bottom: 0;
  }
}

/* Voice Desk â€” Phase 3 */
body.vd-desk-page {
  overflow-x: clip;
}

.vd-desk {
  width: min(100%, var(--vd-content));
  min-width: 0;
  overflow-x: clip;
  padding-bottom: 3.5rem;
}

.vd-desk-context-strip {
  display: flex;
  width: min(calc(100% - 2rem), var(--vd-content));
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem auto 0;
}

.vd-desk-context-status {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--vd-mist);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-muted);
  color: var(--vd-ink-soft);
  font-size: 0.8125rem;
}

.vd-desk-context-tray {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  align-items: stretch;
  gap: 0.75rem;
}

.vd-desk-context-tray > .card {
  min-width: min(100%, 15rem);
  padding: 0.625rem 0.75rem !important;
  box-shadow: none;
}

.vd-desk-context-tray > .card h3 {
  display: none;
}

.vd-desk-context-tray #usage-anon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
}

.vd-desk-context-tray #usage-anon p {
  display: none;
}

.vd-desk-context-tray #usage-anon button {
  min-height: 2.25rem;
  padding-inline: 0.75rem;
  white-space: nowrap;
}

.vd-desk-context-tray #usage-user {
  min-width: 13rem;
}

.vd-desk-context-tray #api-key-widget > div:first-child {
  margin-bottom: 0.35rem;
}

.vd-desk-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.vd-desk-kicker,
.vd-desk-eyebrow {
  margin: 0;
  color: var(--vd-forest) !important;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.vd-desk-intro h2 {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  line-height: 1.04;
}

.vd-desk-intro p:last-child {
  max-width: 52ch;
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.vd-desk-layout,
.vd-desk-primary,
.vd-desk-single,
.vd-desk-script {
  min-width: 0;
}

.vd-desk-layout {
  display: block !important;
}

.vd-desk-primary {
  width: 100%;
}

.vd-desk-sidebar[data-vd-context-moved="true"] {
  display: none;
}

.vd-desk-footer-links {
  padding-top: 0.25rem;
  color: var(--vd-ink-soft) !important;
}

.vd-desk-mode-tabs {
  display: inline-flex;
  max-width: 100%;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--vd-mist);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-muted);
}

.vd-desk-mode-tab {
  display: inline-flex;
  min-width: 0;
  min-height: 2.5rem !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: calc(var(--vd-radius-sm) - 0.125rem) !important;
  background: transparent;
  color: var(--vd-ink-soft) !important;
  font-size: 0.8125rem;
  font-weight: 750;
  white-space: nowrap;
}

.vd-desk-mode-tab:hover,
.vd-desk-mode-tab.is-active {
  background: var(--vd-surface) !important;
  color: var(--vd-ink) !important;
  box-shadow: 0 1px 3px rgb(23 32 29 / 12%);
}

.vd-desk-mode-badge {
  padding: 0.125rem 0.35rem;
  border-radius: 999px;
  background: var(--vd-moss);
  color: var(--vd-forest) !important;
  font-size: 0.5625rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

#mode-single.vd-desk-single {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(19rem, 5fr);
  grid-template-areas:
    "workspace voice"
    "result result"
    "continue continue";
  gap: 1rem;
}

#mode-single.vd-desk-single.hidden {
  display: none;
}

#mode-single.vd-desk-single > * {
  margin-top: 0 !important;
}

.vd-desk-canvas,
.vd-desk-workspace,
.vd-desk-voice-panel,
.vd-desk-action-bar,
.vd-desk-result,
.vd-desk-continue,
.vd-desk-script > .card,
.vd-desk-script-action,
.vd-desk-script-result {
  min-width: 0;
}

.vd-desk-workspace {
  grid-area: workspace;
  display: grid;
  align-self: start;
  gap: 1rem;
}

.vd-desk-workspace .vd-desk-canvas,
.vd-desk-workspace .vd-desk-action-bar {
  grid-area: auto;
}

.vd-desk-canvas {
  display: flex;
  min-height: 25rem;
  flex-direction: column;
  padding: clamp(1rem, 2vw, 1.5rem) !important;
  border-color: var(--vd-mist) !important;
  background: var(--vd-surface) !important;
}

.vd-desk-canvas > .flex:first-child {
  gap: 0.75rem;
}

.vd-desk-canvas #tts-text {
  min-height: 19rem;
  flex: 1;
  padding: 0.25rem 0;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none;
  color: var(--vd-ink) !important;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  line-height: 1.7;
  resize: vertical;
}

.vd-desk-canvas #tts-text:focus {
  outline: none;
}

.vd-desk-canvas #tts-text:focus-visible {
  outline: 3px solid var(--vd-focus) !important;
  outline-offset: 0.35rem;
}

.vd-desk-canvas .bg-white\/5 {
  background: var(--vd-moss) !important;
}

.vd-desk-canvas-footer {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  color: var(--vd-ink-soft);
  font-size: 0.75rem;
}

.vd-desk-starters {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.375rem;
}

.vd-desk-starters button {
  min-height: 2rem !important;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--vd-mist);
  border-radius: 999px !important;
  background: var(--vd-surface-muted);
  color: var(--vd-ink-soft) !important;
  font-size: 0.6875rem;
  font-weight: 700;
}

.vd-desk-starters button:hover {
  border-color: var(--vd-forest);
  color: var(--vd-forest) !important;
}

.vd-desk-voice-panel {
  grid-area: voice;
  align-self: start;
  padding: 1.25rem !important;
  background: var(--vd-surface) !important;
}

.vd-desk-selected-voice {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--vd-mist);
}

.vd-desk-selected-voice p {
  margin: 0.3rem 0 0;
}

#vd-selected-voice-name {
  color: var(--vd-ink) !important;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.2;
}

#vd-selected-voice-meta {
  font-size: 0.8125rem;
}

.vd-desk-voice-panel details {
  min-width: 0;
  border-bottom: 1px solid var(--vd-mist);
}

.vd-desk-voice-panel details:last-of-type {
  border-bottom: 0;
}

.vd-desk-voice-panel summary {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  cursor: pointer;
  color: var(--vd-ink) !important;
  font-size: 0.8125rem;
  font-weight: 800;
  list-style: none;
}

.vd-desk-voice-panel summary::-webkit-details-marker {
  display: none;
}

.vd-desk-voice-panel summary::after {
  margin-left: auto;
  content: "+";
  color: var(--vd-forest);
  font-size: 1.1rem;
}

.vd-desk-voice-panel details[open] > summary::after {
  content: "-";
}

.vd-desk-voice-panel details > :not(summary) {
  margin-bottom: 1rem;
}

.vd-desk-voice-panel #presets-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vd-desk-voice-panel .preset-card {
  min-height: 4.25rem !important;
  padding: 0.625rem !important;
  border-color: var(--vd-mist) !important;
  background: var(--vd-surface-muted) !important;
}

.vd-desk-voice-controls {
  align-items: stretch;
}

.vd-desk-voice-controls select {
  min-width: 0;
}

.vd-desk-voice-controls button {
  flex: 0 0 2.75rem;
}

.vd-desk-voice-controls #lang-filter {
  flex: 0 1 8rem;
  min-width: 5.5rem;
}

.vd-desk-sound-controls {
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.vd-desk-sound-controls > div {
  min-width: 0;
}

.vd-desk-sound-controls input[type="range"] {
  min-height: 1.5rem;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none;
  accent-color: var(--vd-forest);
}

.vd-desk-action-bar,
.vd-desk-script-action {
  grid-area: action;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--vd-mist);
  border-radius: var(--vd-radius);
  background: rgb(255 253 249 / 94%);
  box-shadow: 0 8px 20px rgb(23 32 29 / 9%);
}

.vd-desk-action-bar {
  align-self: stretch;
}

.vd-desk-action-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.375rem 0.75rem;
  color: var(--vd-ink-soft);
  font-size: 0.75rem;
}

.vd-desk-action-meta span:last-child {
  color: var(--vd-forest);
  font-weight: 800;
}

.vd-desk-action-bar #generate-btn,
.vd-desk-script-action #generate-script-btn {
  grid-column: 2;
  min-width: 11.5rem;
  padding-inline: 1.25rem;
  box-shadow: none !important;
}

.vd-desk-subtitle-option {
  display: flex;
  grid-column: 1 / -1;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
  color: var(--vd-ink-soft) !important;
  font-size: 0.75rem;
  cursor: pointer;
}

.vd-desk-subtitle-option input {
  min-height: auto;
  width: 1rem;
  height: 1rem;
}

.vd-desk-result {
  grid-area: result;
  border-color: var(--vd-mist) !important;
  background: var(--vd-surface) !important;
}

.vd-desk-result-status {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
}

.vd-desk-result canvas,
.vd-desk-script-result canvas {
  border: 1px solid var(--vd-mist);
}

.vd-desk-result .audio-player,
.vd-desk-script-result .audio-player {
  accent-color: var(--vd-forest) !important;
}

.vd-desk-result a,
.vd-desk-script-result a {
  min-height: 2.75rem;
  border-color: var(--vd-mist) !important;
  background: var(--vd-surface-muted) !important;
  color: var(--vd-ink) !important;
}

.vd-desk-continue {
  grid-area: continue;
  max-width: 34rem;
  justify-self: start;
  box-shadow: none !important;
}

.vd-desk-script {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas:
    "script mapping"
    "settings mapping"
    "action action"
    "result result";
  gap: 1rem;
}

.vd-desk-script.hidden {
  display: none;
}

.vd-desk-script > .card:nth-child(1) { grid-area: script; }
.vd-desk-script > .card:nth-child(2) { grid-area: mapping; }
.vd-desk-script > .card:nth-child(3) { grid-area: settings; }
.vd-desk-script-action { grid-area: action; }
.vd-desk-script-result { grid-area: result; }

.vd-desk-speaker {
  background: var(--vd-surface-muted) !important;
  border-color: var(--vd-mist) !important;
}

.vd-desk-script textarea {
  min-height: 18rem;
  color: var(--vd-ink) !important;
}

@media (max-width: 80rem) {
  .vd-desk {
    width: min(100%, 68rem);
  }

  #mode-single.vd-desk-single {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "canvas"
      "voice"
      "action"
      "result"
      "continue";
  }

  .vd-desk-workspace {
    display: contents;
  }

  .vd-desk-workspace .vd-desk-canvas {
    grid-area: canvas;
  }

  .vd-desk-workspace .vd-desk-action-bar {
    grid-area: action;
  }

  .vd-desk-voice-panel {
    position: static;
  }

  .vd-desk-action-bar {
    position: static;
  }

  .vd-desk-script {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "script"
      "mapping"
      "settings"
      "action"
      "result";
  }
}

@media (max-width: 48rem) {
  .vd-desk-context-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .vd-desk-context-tray {
    width: 100%;
    flex-wrap: wrap;
  }

  .vd-desk-context-tray > .card {
    flex: 1 1 13rem;
  }

  .vd-desk-canvas {
    min-height: 24rem;
  }

  .vd-desk-canvas #tts-text {
    min-height: 15rem;
  }

  .vd-desk-voice-controls {
    flex-wrap: wrap;
  }

  .vd-desk-voice-controls #voice-select {
    flex: 1 1 calc(100% - 3.5rem);
  }

  .vd-desk-voice-controls #lang-filter {
    flex: 1 1 100%;
  }
}

@media (max-width: 41.99rem) {
  .vd-desk {
    padding-inline: 0.75rem;
    padding-top: 1.25rem;
  }

  .vd-desk-context-strip {
    width: calc(100% - 1.5rem);
  }

  .vd-desk-intro h2 {
    max-width: 15ch;
  }

  .vd-desk-mode-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .vd-desk-mode-tab {
    min-width: 0;
    padding-inline: 0.45rem;
    font-size: 0.6875rem;
  }

  .vd-desk-canvas,
  .vd-desk-voice-panel,
  .vd-desk-result,
  .vd-desk-script > .card,
  .vd-desk-script-result {
    padding: 1rem !important;
  }

  .vd-desk-canvas-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .vd-desk-starters {
    justify-content: flex-start;
  }

  .vd-desk-action-bar,
  .vd-desk-script-action {
    grid-template-columns: minmax(0, 1fr);
    bottom: 0;
  }

  .vd-desk-action-bar #generate-btn,
  .vd-desk-script-action #generate-script-btn {
    grid-column: 1;
    width: 100%;
  }

  .vd-desk-subtitle-option {
    grid-column: 1;
  }

  .vd-desk-result > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .vd-desk-result .flex.gap-2.mt-3,
  .vd-desk-script-result .flex.gap-2.mt-3 {
    flex-direction: column;
  }

  .vd-desk-continue {
    width: 100%;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vd-desk-page *,
  .vd-desk-page *::before,
  .vd-desk-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Phase 4 — project modes and Studio. These layouts are additive: route
   hooks, server calls, and result elements remain owned by their pages. */
.vd-project {
  width: min(calc(100% - 2rem), var(--vd-content));
  margin-inline: auto;
  padding-block: clamp(1.5rem, 4vw, 3.5rem);
}

.vd-project-intro {
  width: min(100%, 47rem);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.vd-project-intro h1 {
  margin: 0.2rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.98;
}

.vd-project-intro > p:last-child {
  max-width: 42rem;
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.65;
}

.vd-project-eyebrow,
.vd-project-kicker {
  margin: 0;
  color: var(--vd-forest) !important;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.vd-project-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1rem, 2.25vw, 1.5rem);
  border: 1px solid var(--vd-mist) !important;
  border-radius: var(--vd-radius-lg);
  background: var(--vd-surface) !important;
  box-shadow: var(--vd-shadow);
}

.vd-project-card h2 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.vd-project-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.vd-field-label {
  display: block;
  color: var(--vd-ink) !important;
  font-size: 0.8rem;
  font-weight: 750;
}

.vd-field-help {
  margin: 0;
  color: var(--vd-ink-soft) !important;
  font-size: 0.8rem;
  line-height: 1.55;
}

.vd-file-control,
.vd-format-badge {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--vd-mist);
  border-radius: 999px;
  background: var(--vd-surface-muted);
  color: var(--vd-ink) !important;
  font-size: 0.75rem;
  font-weight: 750;
  padding: 0.35rem 0.75rem;
}

.vd-file-control {
  position: relative;
  cursor: pointer;
}

.vd-file-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.vd-text-button,
.vd-secondary-button {
  border: 1px solid var(--vd-mist);
  background: var(--vd-surface-muted);
  color: var(--vd-ink) !important;
  font-size: 0.8rem;
  font-weight: 700;
}

.vd-text-button {
  min-height: auto !important;
  border: 0;
  background: transparent;
  color: var(--vd-forest) !important;
  padding: 0.25rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.vd-secondary-button {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
}

.vd-stage-note,
.vd-render-status,
.vd-validation {
  margin: 0;
  color: var(--vd-ink-soft) !important;
  font-size: 0.8rem;
  line-height: 1.5;
}

.vd-stage-note {
  border-left: 3px solid var(--vd-moss);
  background: var(--vd-surface-muted);
  padding: 0.65rem 0.75rem;
}

.vd-stage-note[data-state="rendering"],
.vd-render-status[data-state="rendering"] {
  border-color: var(--vd-saffron);
}

.vd-stage-note[data-state="ready"],
.vd-render-status[data-state="ready"],
.vd-validation[data-state="ready"] {
  color: var(--vd-forest) !important;
}

.vd-stage-note[data-state="error"],
.vd-render-status[data-state="error"],
.vd-validation[data-state="error"] {
  color: #a63722 !important;
}

.vd-document-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--vd-ink-soft);
  font-size: 0.76rem;
}

.vd-document-meta span:nth-child(2) {
  margin-left: auto;
}

.vd-project-result {
  display: grid;
  gap: 0.75rem;
}

.vd-project-result a:not(.hidden) {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid var(--vd-mist);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-muted);
  color: var(--vd-ink) !important;
  font-weight: 700;
  padding-inline: 0.9rem;
}

/* Long Text */
.vd-long-workspace {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(16rem, 3fr);
  grid-template-areas:
    "document policy"
    "export policy";
  align-items: start;
  gap: 1rem;
}

.vd-long-document { grid-area: document; }
.vd-long-policy { grid-area: policy; position: sticky; top: 5rem; }
.vd-long-export { grid-area: export; }

.vd-long-document #txt {
  min-height: 23rem;
  color: var(--vd-ink) !important;
  line-height: 1.65;
}

.vd-long-export #btn {
  align-self: flex-start;
  min-width: min(100%, 15rem);
}

.vd-project-outline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--vd-mist);
}

.vd-project-outline li {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--vd-mist);
}

.vd-project-outline span {
  color: var(--vd-ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vd-project-outline strong {
  color: var(--vd-ink);
  font-size: 0.82rem;
  line-height: 1.4;
}

.vd-project > .ecosystem-spotlight {
  margin-block: 1rem;
}

.vd-project-prose {
  width: min(100%, var(--vd-reading));
  margin: 2.5rem auto 0;
}

/* SSML */
.vd-ssml-workspace {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(17rem, 3fr);
  align-items: start;
  gap: 1rem;
}

.vd-ssml-editor #ssml {
  min-height: clamp(22rem, 62vh, 40rem);
  max-width: 100%;
  overflow: auto;
  color: var(--vd-ink) !important;
  line-height: 1.65;
  white-space: pre;
}

.vd-snippet-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.vd-snippet-bar > span {
  color: var(--vd-ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.vd-snippet-bar .chip {
  min-height: 2.25rem;
  border-color: var(--vd-mist) !important;
  background: var(--vd-surface-muted) !important;
  color: var(--vd-forest) !important;
}

.vd-ssml-inspector {
  position: sticky;
  top: 5rem;
}

.vd-inspector-block {
  display: grid;
  min-width: 0;
  gap: 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid var(--vd-mist);
}

/* Saved SSML drafts can contain a long voice label. Keep the inspector's
   implicit grid track within its column instead of widening the document. */
#history-wrap {
  grid-template-columns: minmax(0, 1fr);
}

#history {
  min-width: 0;
}

.vd-inspector-block:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.vd-ssml-reference {
  width: min(100%, var(--vd-reading));
  margin: 1rem auto 0;
}

/* Multi-Voice keeps its existing script endpoint and voice mapping. The table
   makes the input's speaker-to-line relationship visible before render. */
.vd-script-table-wrap {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--vd-mist);
  padding-top: 0.9rem;
}

.vd-script-table-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--vd-ink-soft);
  font-size: 0.72rem;
}

.vd-script-table-heading span:first-child {
  color: var(--vd-ink);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.vd-script-line-table {
  display: grid;
  max-height: 14rem;
  gap: 0.35rem;
  overflow: auto;
}

.vd-script-line {
  display: grid;
  grid-template-columns: 1.75rem minmax(6rem, 0.35fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-muted);
  font-size: 0.78rem;
}

.vd-script-line__number { color: var(--vd-ink-soft); font-variant-numeric: tabular-nums; }
.vd-script-line__speaker { color: var(--vd-forest); overflow-wrap: anywhere; }
.vd-script-line__copy { min-width: 0; color: var(--vd-ink-soft); overflow-wrap: anywhere; }
.vd-project-empty { margin: 0; color: var(--vd-ink-soft) !important; font-size: 0.78rem; line-height: 1.5; }

/* Studio */
.vd-studio-page {
  width: min(calc(100% - 2rem), var(--vd-content));
}

.vd-studio-header {
  box-shadow: none !important;
}

.vd-studio-switchboard {
  display: grid;
  gap: 1rem;
}

.vd-studio-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.vd-studio-tabs button {
  flex: 0 0 auto;
  min-height: 2.75rem;
  border: 1px solid var(--vd-mist);
  background: var(--vd-surface);
  color: var(--vd-ink-soft) !important;
  font-size: 0.8rem;
  font-weight: 750;
  padding-inline: 0.9rem;
}

.vd-studio-tabs button.is-active {
  border-color: var(--vd-forest);
  background: var(--vd-forest);
  color: #fff !important;
}

.vd-studio-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}

.vd-studio-home.hidden,
.vd-project-card.hidden {
  display: none;
}

.vd-studio-home > .vd-studio-task-grid,
.vd-studio-home > .vd-studio-auth-gate {
  grid-column: 1 / -1;
}

.vd-studio-queue,
.vd-studio-recent {
  min-height: 12rem;
  justify-content: space-between;
}

.vd-studio-task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.vd-studio-task-grid button {
  display: grid;
  min-height: 8rem;
  align-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--vd-mist);
  background: var(--vd-surface);
  color: var(--vd-ink) !important;
  padding: 1rem;
  text-align: left;
}

.vd-studio-task-grid button:hover {
  border-color: var(--vd-forest);
  background: var(--vd-surface-muted);
}

.vd-studio-task-grid strong { font-size: 0.9rem; }
.vd-studio-task-grid span { color: var(--vd-ink-soft); font-size: 0.76rem; line-height: 1.45; }

.vd-studio-auth-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--vd-mist);
  border-radius: var(--vd-radius);
  background: var(--vd-surface-muted);
  padding: 1rem;
}

.vd-studio-auth-gate div { display: grid; gap: 0.25rem; }
.vd-studio-auth-gate strong { color: var(--vd-ink); font-size: 0.85rem; }
.vd-studio-auth-gate span { color: var(--vd-ink-soft); font-size: 0.78rem; }
.vd-studio-auth-gate a { white-space: nowrap; text-decoration: none; }

.vd-studio-recent-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--vd-mist);
  padding-top: 0.6rem;
}

.vd-studio-recent-item strong { color: var(--vd-ink); font-size: 0.82rem; }
.vd-studio-recent-item span { color: var(--vd-ink-soft); font-size: 0.72rem; text-align: right; }

.studio-auth-locked {
  position: relative;
}

.studio-auth-locked::before {
  content: "Sign in to enable this workspace";
  color: var(--vd-ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.studio-auth-locked :is(input, select, button) {
  background: var(--vd-surface-muted) !important;
}

@media (max-width: 65rem) {
  .vd-long-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "document" "policy" "export";
  }

  .vd-long-policy,
  .vd-ssml-inspector {
    position: static;
  }

  .vd-ssml-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .vd-studio-task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 41.99rem) {
  .vd-project,
  .vd-studio-page {
    width: min(calc(100% - 1.5rem), var(--vd-content));
  }

  .vd-project-card__heading,
  .vd-document-meta,
  .vd-studio-auth-gate {
    align-items: flex-start;
    flex-direction: column;
  }

  .vd-document-meta span:nth-child(2) { margin-left: 0; }
  .vd-file-control { width: 100%; }
  .vd-long-export #btn { width: 100%; }
  .vd-script-line { grid-template-columns: 1.5rem minmax(0, 1fr); }
  .vd-script-line__copy { grid-column: 2; }
  .vd-studio-home,
  .vd-studio-task-grid { grid-template-columns: minmax(0, 1fr); }
  .vd-studio-task-grid { grid-column: 1; }
  .vd-studio-task-grid button { min-height: 6.5rem; }
  .vd-studio-auth-gate a { width: 100%; text-align: center; }
  .vd-ssml-editor #ssml { min-height: 20rem; }
}

/* Phase 5 — account, developer, and editorial surfaces. The selectors below
   only reshape existing route content; data loading, API keys, auth, metadata,
   anchors, and server-rendered copy remain owned by their original documents. */
body[data-phase5-surface="account"] .vd-account-main {
  width: min(calc(100% - 2rem), var(--vd-content));
  max-width: none;
  padding-block: clamp(1.5rem, 4vw, 3.25rem);
}

body[data-phase5-surface="account"] .vd-account-gate-wrap {
  min-height: calc(100vh - 3.5rem);
  padding: 1.5rem;
}

body[data-phase5-surface="account"] .vd-account-gate {
  width: min(100%, 28rem);
  border: 1px solid var(--vd-mist);
  border-radius: var(--vd-radius-lg);
  background: var(--vd-surface);
  box-shadow: var(--vd-shadow);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

body[data-phase5-surface="account"] .vd-account-gate > div:first-child {
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--vd-mist);
  background: var(--vd-moss) !important;
  color: var(--vd-forest);
  font-size: 1.25rem;
}

.vd-account-header {
  align-items: end !important;
  border-bottom: 1px solid var(--vd-mist);
  padding-bottom: 1.25rem;
}

.vd-account-header h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.75rem) !important;
}

.vd-account-header p {
  max-width: 36rem;
  color: var(--vd-ink-soft) !important;
}

.vd-account-stats > .card {
  min-width: 0;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.vd-account-stats > .card:first-child {
  border-radius: var(--vd-radius-sm) 0 0 var(--vd-radius-sm) !important;
}

.vd-account-stats > .card:last-child {
  border-radius: 0 var(--vd-radius-sm) var(--vd-radius-sm) 0 !important;
}

.vd-account-stats > .card > div:first-child {
  color: var(--vd-forest) !important;
  font-size: clamp(1.4rem, 2.7vw, 2rem) !important;
  font-variant-numeric: tabular-nums;
}

.vd-account-layout {
  align-items: start;
}

.vd-account-layout > div {
  min-width: 0;
}

body[data-phase5-surface="account"] .vd-account-key {
  border-top: 3px solid var(--vd-forest) !important;
}

body[data-phase5-surface="account"] .vd-account-key .code-block {
  display: flex;
  min-width: 0;
  align-items: center;
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-muted) !important;
  box-shadow: none;
}

body[data-phase5-surface="account"] .vd-account-key code {
  color: var(--vd-ink) !important;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

body[data-phase5-surface="account"] .vd-account-key button:not(.vd-copy-code),
body[data-phase5-surface="account"] .vd-account-quickstart .snippet-tab {
  min-height: 2.25rem;
  border: 1px solid var(--vd-mist);
  background: var(--vd-surface-muted);
  color: var(--vd-ink) !important;
  box-shadow: none;
}

body[data-phase5-surface="account"] .vd-account-key button:hover,
body[data-phase5-surface="account"] .vd-account-quickstart .snippet-tab:hover {
  border-color: var(--vd-forest);
  background: var(--vd-moss);
}

body[data-phase5-surface="account"] .vd-account-quickstart .snippet-tab.active {
  border-color: var(--vd-forest);
  background: var(--vd-forest) !important;
  color: #fff !important;
}

body[data-phase5-surface="account"] .vd-account-quickstart pre.code-block {
  background: #17201d !important;
  color: #f7f4ee !important;
  box-shadow: none;
}

body[data-phase5-surface="account"] .vd-account-quickstart pre.code-block :is(code, span) {
  color: #edf1eb !important;
}

.vd-account-kicker {
  margin: 0;
  color: var(--vd-forest) !important;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.vd-account-history {
  display: grid;
  gap: 0.65rem;
  border: 1px dashed #b8c5ba;
  border-radius: var(--vd-radius);
  background: var(--vd-surface-muted);
  padding: 1.25rem;
}

.vd-account-history h2 {
  margin: 0;
  font-size: 1rem;
}

.vd-account-history p:not(.vd-account-kicker) {
  margin: 0;
  max-width: 32rem;
  font-size: 0.84rem;
  line-height: 1.55;
}

/* API documentation: a reading layout with an anchored source-of-truth
   navigation, contained code scrolling, and direct copy feedback. */
body[data-phase5-surface="developer"] > header[data-site-nav] {
  position: sticky;
  top: 0;
}

body[data-phase5-surface="developer"] .side {
  border-color: var(--vd-mist) !important;
  background: var(--vd-surface-muted);
  scrollbar-color: #9aac9d transparent;
}

body[data-phase5-surface="developer"] .side h3 {
  color: var(--vd-ink-soft) !important;
  font-size: 0.65rem;
  font-weight: 800;
}

body[data-phase5-surface="developer"] .side a {
  color: var(--vd-ink-soft) !important;
}

body[data-phase5-surface="developer"] .side a:hover,
body[data-phase5-surface="developer"] .side a.active {
  background: var(--vd-moss) !important;
  color: var(--vd-forest) !important;
}

body[data-phase5-surface="developer"] main[data-vd-main] {
  width: min(100%, 61rem);
  max-width: 61rem;
  padding-block: clamp(2rem, 5vw, 4.5rem);
}

body[data-phase5-surface="developer"] main section {
  scroll-margin-top: 5.5rem;
}

body[data-phase5-surface="developer"] main section > h2 {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--vd-mist);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.vd-docs-jump {
  display: none;
  margin-bottom: 1.25rem;
  color: var(--vd-ink);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vd-docs-jump select {
  display: block;
  width: 100%;
  margin-top: 0.45rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}

body[data-phase5-surface="developer"] .card {
  border-radius: var(--vd-radius) !important;
  box-shadow: none;
}

.vd-code-wrap {
  position: relative;
  max-width: 100%;
}

body[data-phase5-surface="developer"] pre.code-block {
  min-width: 0;
  max-width: 100%;
  padding: 1.25rem 1.1rem !important;
  padding-right: 5.25rem !important;
  border: 1px solid #283630 !important;
  border-radius: var(--vd-radius-sm) !important;
  background: #17201d !important;
  color: #edf1eb !important;
  box-shadow: none;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.65;
  overflow-x: auto;
}

body[data-phase5-surface="developer"] pre.code-block :is(code, span) {
  color: #edf1eb !important;
}

.vd-copy-code {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 1;
  min-height: 2rem !important;
  border: 1px solid #53665c;
  border-radius: 0.375rem !important;
  background: #24332c !important;
  color: #f7f4ee !important;
  font-size: 0.72rem;
  font-weight: 750;
  padding-inline: 0.65rem;
}

.vd-copy-code:hover {
  border-color: #b9d3bd;
  background: var(--vd-forest) !important;
}

.vd-copy-status {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body[data-phase5-surface="developer"] table {
  max-width: 100%;
  border-collapse: collapse;
}

body[data-phase5-surface="developer"] th {
  color: var(--vd-ink) !important;
  font-weight: 750;
}

body[data-phase5-surface="developer"] :is(th, td) {
  border-color: var(--vd-mist) !important;
}

/* Editorial routes retain every indexed heading and schema, while their
   existing articles and language pages gain a consistent reading measure. */
body[data-phase5-surface="editorial"] :is(main, article)[data-vd-main],
body[data-phase5-surface="editorial"] article {
  width: min(calc(100% - 2rem), var(--vd-reading));
  max-width: var(--vd-reading);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

body[data-phase5-surface="editorial"] main:has(> header.text-center) {
  width: min(calc(100% - 2rem), var(--vd-content));
  max-width: var(--vd-content);
}

body[data-phase5-surface="editorial"] main.vd-editorial-index {
  width: min(calc(100% - 2rem), var(--vd-content));
  max-width: var(--vd-content);
}

body[data-phase5-surface="editorial"] :is(main, article) > header,
body[data-phase5-surface="editorial"] main > h1:first-child {
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--vd-mist);
}

body[data-phase5-surface="editorial"] :is(main, article) h1 {
  font-size: clamp(2rem, 5vw, 3.6rem) !important;
  line-height: 1.03;
}

body[data-phase5-surface="editorial"] :is(main, article) h2 {
  margin-top: clamp(2rem, 5vw, 3.25rem);
  padding-top: 1.35rem;
  border-top: 1px solid var(--vd-mist);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
}

body[data-phase5-surface="editorial"] :is(main, article) :is(p, li) {
  color: var(--vd-ink-soft) !important;
  font-size: 1rem;
  line-height: 1.75;
}

body[data-phase5-surface="editorial"] :is(main, article) :is(strong, th) {
  color: var(--vd-ink) !important;
}

body[data-phase5-surface="editorial"] :is(main, article) .card {
  border-radius: var(--vd-radius) !important;
  box-shadow: none;
}

body[data-phase5-surface="editorial"] :is(main, article) pre,
body[data-phase5-surface="editorial"] :is(main, article) code:not(.text-brand-400) {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

body[data-phase5-surface="editorial"] :is(main, article) pre {
  overflow: auto;
  border: 1px solid var(--vd-mist);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-muted);
  color: var(--vd-ink) !important;
}

/* Account entry, password reset, and verification states use the same quiet
   form hierarchy. Auth requests and Turnstile behaviour are untouched. */
body[data-phase5-surface="auth"] #modal-overlay {
  background: rgb(23 32 29 / 48%) !important;
}

body[data-phase5-surface="auth"] #modal-overlay .modal,
body[data-phase5-surface="auth"] #state-form > div,
body[data-phase5-surface="auth"] #state-success > div,
body[data-phase5-surface="auth"] #state-error > div {
  border: 1px solid var(--vd-mist) !important;
  background: var(--vd-surface) !important;
  box-shadow: var(--vd-shadow);
}

body[data-phase5-surface="auth"] #modal-overlay .modal {
  overflow: hidden;
  border-radius: var(--vd-radius-lg) !important;
}

body[data-phase5-surface="auth"] #modal-overlay :is(label, p) {
  color: var(--vd-ink-soft) !important;
}

body[data-phase5-surface="auth"] #modal-overlay input,
body[data-phase5-surface="auth"] #state-form input,
body[data-phase5-surface="auth"] #state-error input {
  min-height: 2.9rem;
}

@media (max-width: 63.99rem) {
  .vd-account-header {
    align-items: flex-start !important;
    flex-direction: column;
  }

  body[data-phase5-surface="developer"] .side {
    display: none !important;
  }

  body[data-phase5-surface="developer"] main[data-vd-main] {
    width: 100%;
    max-width: none;
    padding-inline: 1rem;
  }

  .vd-docs-jump {
    display: block;
  }
}

@media (max-width: 41.99rem) {
  body[data-phase5-surface="account"] .vd-account-main {
    width: min(calc(100% - 1.5rem), var(--vd-content));
  }

  .vd-account-stats {
    gap: 0.5rem !important;
  }

  .vd-account-stats > .card {
    border-radius: var(--vd-radius-sm) !important;
  }

  .vd-account-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-phase5-surface="developer"] main[data-vd-main] {
    padding-inline: 0.75rem;
  }

  body[data-phase5-surface="developer"] table {
    display: block;
    overflow-x: auto;
  }

  body[data-phase5-surface="developer"] #voices-list .flex.gap-4 {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-phase5-surface="developer"] #voices-list :is(select, input) {
    width: 100%;
    flex: none;
  }

  body[data-phase5-surface="developer"] .grid > *,
  body[data-phase5-surface="developer"] .vd-code-wrap {
    min-width: 0;
  }

  body[data-phase5-surface="editorial"] footer .flex.items-center.gap-6 {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
  }

  body[data-phase5-surface="editorial"] :is(main, article)[data-vd-main],
  body[data-phase5-surface="editorial"] article {
    width: min(calc(100% - 1.5rem), var(--vd-reading));
  }

  body[data-phase5-surface="editorial"] :is(main, article) h1 {
    font-size: clamp(1.8rem, 11vw, 2.45rem) !important;
  }
}
