/* The homepage voice demo (browser-demo.js): a bar at the top of the hero that expands into the demo. Page tokens
   only (index.html :root, light and dark), with fallbacks so the module also works on its own. Accent marks activity:
   the bar's mic, the agent speaking, what's new on a tab. */
.vd { --vd-ink: var(--ink, #021f31); --vd-body: var(--body, #33424f); --vd-muted: var(--muted, #5d6f80); --vd-hair: var(--hair, #d6e1e8);
  --vd-surface: var(--surface, #fff); --vd-surface-2: var(--surface-2, #f2f5f8); --vd-accent: var(--accent, #01c3d9); --vd-accent-ink: var(--accent-ink, #00798a);
  --vd-accent-soft: var(--accent-soft, #ccf3f8); --vd-ok-ink: var(--ok-ink, #087252); --vd-ok-soft: var(--ok-soft, #d3f4e9); --vd-risk-ink: var(--risk-ink, #aa3f0d);
  --vd-risk-soft: var(--risk-soft, #ffe4d2); --vd-display: var(--display, system-ui, sans-serif); --vd-mono: var(--mono, ui-monospace, monospace);
  color: var(--vd-body); min-width: 0; }
.vd [hidden] { display: none !important; }
.vd-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vd-k { font: 600 .72rem/1.4 var(--vd-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--vd-muted); }
.vd :focus-visible { outline: 2px solid var(--vd-accent-ink); outline-offset: 2px; }

/* ---- the bar: content-sized and centered; Close at the right while the demo is open -------------------------------- */
.vd-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.vd-bar-btn { grid-column: 2; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 8px 24px 8px 8px; border: 0; border-radius: 999px; text-align: left; font: inherit; color: var(--vd-ink); background: var(--vd-surface); box-shadow: inset 0 0 0 1px var(--vd-hair), 0 10px 24px -18px rgb(2 31 49 / .5); cursor: pointer; transition: box-shadow .2s ease; }
.vd-bar-btn:hover { box-shadow: inset 0 0 0 1px var(--vd-accent-ink), 0 10px 24px -18px rgb(2 31 49 / .5); }
.vd-bar-mic { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #021f31; background: var(--vd-accent); }
.vd-bar-mic::after { content: ""; position: absolute; inset: 0; border-radius: 50%; animation: vd-pulse 2.6s ease-out infinite; }
.vd.is-open .vd-bar-mic::after { animation: none; }
@keyframes vd-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--vd-accent) 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 11px transparent; } }
.vd-mic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.vd-bar-text { min-width: 0; display: grid; gap: 1px; }
.vd-bar-text b { font: 650 .98rem/1.3 var(--vd-display); color: var(--vd-ink); }
.vd-bar-text small { font-size: .82rem; line-height: 1.35; color: var(--vd-muted); }
.vd-close { grid-column: 3; justify-self: end; min-height: 44px; padding: 8px 18px; border: 0; border-radius: 999px; font: 600 .88rem/1 var(--ui, system-ui, sans-serif); color: var(--vd-ink); background: transparent; box-shadow: inset 0 0 0 1px var(--vd-hair); cursor: pointer; }
.vd-close:disabled { opacity: .45; cursor: not-allowed; }

/* Expanding in place: the rows grow from 0 to the demo's height. */
.vd-expand { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s ease; }
.vd.is-open .vd-expand { grid-template-rows: 1fr; }
.vd-expand-in { min-height: 0; overflow: hidden; padding: 0 2px 2px; }
.vd-demo { position: relative; display: grid; gap: clamp(16px, 2.4vw, 24px); margin-top: 14px; padding: clamp(20px, 3.5vw, 40px); border-radius: var(--radius, 18px); background: var(--vd-surface); box-shadow: inset 0 0 0 1px var(--vd-hair); text-align: left; }
.vd-demo h3 { margin: 6px 0 0; font: 700 clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem)/1.15 var(--vd-display); color: var(--vd-ink); }
.vd-demo h3:focus { outline: none; }
.vd-eyebrow { margin: 0; font: 600 .72rem/1.4 var(--vd-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--vd-accent-ink); }
.vd-lede { margin: 12px 0 0; font-size: 1rem; line-height: 1.6; }
.vd-try { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; }
.vd-try li { padding: 7px 13px; border-radius: 999px; font-size: .9rem; line-height: 1.35; color: var(--vd-ink); background: var(--vd-surface-2); box-shadow: inset 0 0 0 1px var(--vd-hair); }

/* ---- the talk panel: the intro and questions beside the console --------------------------------------------------- */
.vd-panel--talk { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); grid-template-areas: "copy side" "ask side"; grid-template-rows: auto 1fr; column-gap: clamp(24px, 4vw, 52px); row-gap: 22px; }
.vd-copy { grid-area: copy; }
.vd-ask { grid-area: ask; align-self: start; }
.vd-side { grid-area: side; display: grid; align-content: start; gap: 14px; min-width: 0; }
.vd-console { display: grid; gap: 14px; padding: clamp(18px, 2.6vw, 26px); border-radius: 16px; background: var(--vd-surface-2); box-shadow: inset 0 0 0 1px var(--vd-hair); }
/* "Show me": two pill-shaped native radios; the input lies over its pill, invisible, so it keeps its own semantics. */
.vd-pick { min-width: 0; margin: 0; padding: 0 0 14px; border: 0; border-bottom: 1px solid var(--vd-hair); }
.vd-pick legend { float: left; width: 100%; margin: 0 0 8px; padding: 0; }
.vd-pick-opts { clear: both; display: flex; flex-wrap: wrap; gap: 8px; }
.vd-pick label { position: relative; display: inline-flex; }
.vd-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.vd-pick span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px; font: 600 .88rem/1.25 var(--ui, system-ui, sans-serif); color: var(--vd-ink); background: var(--vd-surface); box-shadow: inset 0 0 0 1px var(--vd-hair); }
.vd-pick label:hover span { box-shadow: inset 0 0 0 1px var(--vd-accent-ink); }
.vd-pick input:checked + span { background: var(--vd-accent-soft); box-shadow: inset 0 0 0 2px var(--vd-accent-ink); }
.vd-pick input:focus-visible + span { outline: 2px solid var(--vd-accent-ink); outline-offset: 2px; }
.vd-pick-note { margin: 8px 0 0; font-size: .8rem; line-height: 1.45; color: var(--vd-muted); }
.vd-pick-note:empty { display: none; }
.vd-head { display: flex; align-items: center; gap: 16px; }
.vd-meta { display: grid; gap: 2px; }
.vd-state { font: 650 1.05rem/1.3 var(--vd-display); color: var(--vd-ink); }
.vd-timer { min-height: 1.2em; font: .82rem/1.3 var(--vd-mono); font-variant-numeric: tabular-nums; color: var(--vd-muted); }
.vd-orb { position: relative; flex: none; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; color: var(--vd-ink); background: var(--vd-surface); box-shadow: inset 0 0 0 2px var(--vd-hair); transition: box-shadow .2s ease; }
.vd-orb .vd-mic { width: 24px; height: 24px; }
.vd-bars { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 3px; }
.vd-bars i { width: 4px; height: 10px; border-radius: 2px; background: var(--vd-accent-ink); animation: vd-bar .9s ease-in-out infinite; }
.vd-bars i:nth-child(2) { animation-delay: -.7s; } .vd-bars i:nth-child(3) { animation-delay: -.4s; } .vd-bars i:nth-child(4) { animation-delay: -.2s; } .vd-bars i:nth-child(5) { animation-delay: -.55s; }
@keyframes vd-bar { 0%, 100% { height: 8px; } 50% { height: 24px; } }
@keyframes vd-connect { 50% { box-shadow: inset 0 0 0 2px var(--vd-accent-ink), 0 0 0 9px color-mix(in srgb, var(--vd-accent) 18%, transparent); } }
.vd[data-state="connecting"] .vd-orb { box-shadow: inset 0 0 0 2px var(--vd-accent-ink); animation: vd-connect 1.4s ease-in-out infinite; }
.vd[data-state="listening"] .vd-orb { box-shadow: inset 0 0 0 2px var(--vd-accent-ink); }
.vd[data-state="speaking"] .vd-orb { box-shadow: inset 0 0 0 2px var(--vd-accent-ink), 0 0 0 6px color-mix(in srgb, var(--vd-accent) 22%, transparent); }
.vd[data-state="speaking"] .vd-orb .vd-mic { visibility: hidden; }
.vd[data-state="speaking"] .vd-bars { display: flex; }
.vd[data-state="error"] .vd-orb { color: var(--vd-muted); }
.vd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.vd-actions .btn:disabled { opacity: .55; cursor: not-allowed; }
.vd-turnstile { height: 0; overflow: hidden; }
.vd-turnstile.is-open { height: auto; overflow: visible; }
.vd-status { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--vd-ink); }
.vd-status:empty { display: none; }
.vd-status:focus { outline: none; }
.vd-transcript { border-top: 1px solid var(--vd-hair); padding-top: 12px; }
.vd-log, .vd-example { list-style: none; display: grid; gap: 10px; margin: 10px 0 0; padding: 0; }
.vd-log { max-height: 240px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.vd-line { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; font-size: .92rem; line-height: 1.55; color: var(--vd-body); overflow-wrap: anywhere; }
.vd-who { font: 600 .72rem/2.1 var(--vd-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--vd-muted); }
.vd-line--agent .vd-who { color: var(--vd-accent-ink); }
.vd-note, .vd-alt { margin: 0; font-size: .82rem; line-height: 1.6; color: var(--vd-muted); }
.vd-note a, .vd-alt a { color: var(--vd-accent-ink); text-underline-offset: 3px; }
.vd-fallback { display: grid; gap: 10px; padding: clamp(18px, 3vw, 28px); border-radius: var(--radius, 18px); background: var(--vd-surface); box-shadow: inset 0 0 0 1px var(--vd-hair); text-align: left; }
.vd-fallback-lede { margin: 0; line-height: 1.6; }

/* ---- the tabs, across the whole demo, and the call bar beside them ------------------------------------------------- */
.vd-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 4px; border-radius: 12px; background: var(--vd-surface-2); box-shadow: inset 0 0 0 1px var(--vd-hair); }
.vd-tabs { flex: 1 1 320px; max-width: 520px; display: flex; gap: 4px; }
.vd-tab { position: relative; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 6px 12px; border: 0; border-radius: 9px; font: 600 .88rem/1.2 var(--ui, system-ui, sans-serif); color: var(--vd-muted); background: transparent; cursor: pointer; }
.vd-tab:hover { color: var(--vd-ink); }
.vd-tab[aria-selected="true"] { color: var(--vd-ink); background: var(--vd-surface); box-shadow: 0 1px 3px rgb(2 31 49 / .12), inset 0 0 0 1px var(--vd-hair); }
.vd-new { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font: 700 .7rem/1 var(--vd-mono); color: #021f31; background: var(--vd-accent); }
.vd-callbar { margin-left: auto; display: flex; align-items: center; gap: 12px; padding-left: 8px; }
.vd-callbar-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--vd-muted); }
.vd[data-state="connecting"] .vd-callbar-dot, .vd[data-state="listening"] .vd-callbar-dot { background: var(--vd-accent-ink); }
.vd[data-state="speaking"] .vd-callbar-dot { background: var(--vd-accent-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--vd-accent) 30%, transparent); }
.vd-callbar-meta { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.vd-callbar-state { font: 650 .88rem/1.2 var(--vd-display); color: var(--vd-ink); }
.vd-callbar-timer { font: .8rem/1.2 var(--vd-mono); font-variant-numeric: tabular-nums; color: var(--vd-muted); }
.vd-callbar-timer:empty { display: none; }
.vd-callbar-btn { min-height: 40px; padding: 0 16px; font-size: .86rem; }

/* ---- the stage: the work lies over the conversation's own space (kept, not removed), so switching tabs never moves
   the page. The work scrolls inside it. ------------------------------------------------------------------------------ */
.vd-stage { position: relative; min-width: 0; }
.vd.has-tabs .vd-stage { min-height: 520px; }
.vd-stage .vd-panel--talk[hidden] { display: grid !important; visibility: hidden; }
.vd-panel--work { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 12px; padding: 0 clamp(12px, 2vw, 20px) clamp(12px, 2vw, 20px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-radius: 16px; background: var(--vd-surface-2); box-shadow: inset 0 0 0 1px var(--vd-hair); }
.vd-work-head { position: sticky; top: 0; z-index: 1; padding: clamp(12px, 2vw, 18px) 0 8px; margin-bottom: -4px; background: var(--vd-surface-2); }
.vd-badge { display: inline-block; margin: 0; padding: 4px 10px; border-radius: 999px; font: 600 .72rem/1.3 var(--vd-mono); color: var(--vd-risk-ink); background: var(--vd-risk-soft); }
.vd-scenes { display: grid; gap: 12px; }
.vd-scene { border-radius: 14px; background: var(--vd-surface); box-shadow: inset 0 0 0 1px var(--vd-hair); }
.vd-scene-toggle { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border: 0; border-radius: 14px; text-align: left; font: inherit; color: var(--vd-ink); background: transparent; cursor: pointer; }
.vd-scene-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font: 700 .75rem/1 var(--vd-mono); color: #021f31; background: var(--vd-accent); }
.vd-scene.is-folded .vd-scene-n { color: var(--vd-ink); background: var(--vd-surface-2); box-shadow: inset 0 0 0 1px var(--vd-hair); }
.vd-scene-title { flex: 0 1 auto; min-width: 0; font: 650 .95rem/1.3 var(--vd-display); }
.vd-scene-sum { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .84rem; color: var(--vd-muted); }
.vd-scene-chev { flex: none; width: 10px; height: 10px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .2s ease; }
.vd-scene-toggle[aria-expanded="true"] .vd-scene-chev { transform: rotate(-135deg) translateY(-3px); }
.vd-scene-body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 14px clamp(16px, 2.6vw, 28px); padding: 2px 14px 14px; }
.vd-scene-cards { display: grid; gap: 12px; min-width: 0; }
.vd-card { min-width: 0; padding: 14px 16px 16px; border-radius: 12px; font-size: .88rem; line-height: 1.5; color: var(--vd-body); background: var(--vd-surface); box-shadow: inset 0 0 0 1px var(--vd-hair); overflow-wrap: anywhere; }
.vd-card-top { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--vd-hair); }
.vd-card-who { flex: 1; min-width: 0; }
.vd-card-who b { display: block; font-size: .86rem; color: var(--vd-ink); }
.vd-card-who small { display: block; font-size: .76rem; color: var(--vd-muted); }
.vd-card-k { margin: 0 0 6px; font: 600 .72rem/1.4 var(--vd-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--vd-muted); }
.vd-tag { flex: none; padding: 3px 8px; border-radius: 999px; font: 600 .7rem/1.3 var(--vd-mono); color: var(--vd-accent-ink); background: var(--vd-accent-soft); }
.vd-tag--draft { color: var(--vd-risk-ink); background: var(--vd-risk-soft); }
.vd-tag--sent { color: var(--vd-ok-ink); background: var(--vd-ok-soft); }
.vd-situation-list { list-style: none; display: grid; gap: 6px; margin: 10px 0 0; padding: 0; }
.vd-situation-list li { position: relative; padding-left: 14px; }
.vd-situation-list li::before { content: ""; position: absolute; left: 1px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--vd-muted); }
.vd-situation-list b { color: var(--vd-risk-ink); }
.vd-mail-head { display: grid; gap: 4px; margin: 10px 0; padding-bottom: 10px; border-bottom: 1px solid var(--vd-hair); }
.vd-mail-head > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
.vd-mail-head dt { margin: 0; color: var(--vd-muted); }
.vd-mail-head dd { margin: 0; font-weight: 600; color: var(--vd-ink); }
.vd-mail-body p { margin: 0; }
.vd-mail-body p + p { margin-top: 10px; }
.vd-mail-sign { font-size: .8rem; color: var(--vd-muted); }
.vd-caret::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -.15em; background: currentColor; animation: vd-blink 1s steps(1) infinite; }
@keyframes vd-blink { 50% { opacity: 0; } }
.vd-thread { list-style: none; display: grid; gap: 8px; margin: 12px 0 0; padding: 0; }
.vd-bubble { max-width: 84%; padding: 9px 12px; border-radius: 16px; font-size: .86rem; line-height: 1.45; }
.vd-bubble-time { display: block; margin-top: 3px; font: .7rem/1.2 var(--vd-mono); opacity: .75; }
.vd-bubble--out { justify-self: end; border-bottom-right-radius: 5px; color: #021f31; background: var(--vd-accent-soft); }
.vd-bubble--in { justify-self: start; border-bottom-left-radius: 5px; color: var(--vd-ink); background: var(--vd-surface-2); box-shadow: inset 0 0 0 1px var(--vd-hair); }
@media (prefers-color-scheme: dark) { .vd-bubble--out { color: var(--vd-ink); } }
.vd-bubble--typing { display: flex; gap: 4px; padding: 12px 14px; }
.vd-bubble--typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--vd-muted); animation: vd-dot 1.2s ease-in-out infinite; }
.vd-bubble--typing i:nth-child(2) { animation-delay: .15s; } .vd-bubble--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes vd-dot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
.vd-activity { position: sticky; top: 56px; padding: 12px 0 6px; }
.vd-activity .vd-card-k { padding: 0 14px; }
.vd-activity-list { list-style: none; display: grid; margin: 0; padding: 0; }
.vd-activity-list:empty::before { content: "Nothing yet."; display: block; padding: 6px 14px; color: var(--vd-muted); }
.vd-activity-list li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 7px 14px; font-size: .82rem; line-height: 1.45; }
.vd-activity-list li + li { border-top: 1px solid var(--vd-hair); }
.vd-log-time { font: .74rem/1.6 var(--vd-mono); font-variant-numeric: tabular-nums; color: var(--vd-muted); }
.vd-activity-list li.vd-fresh { animation: vd-fresh 2.4s ease-out; }
@keyframes vd-fresh { from { background: var(--vd-accent-soft); } to { background: transparent; } }
.vd-in { animation: vd-in .35s ease-out both; }
@keyframes vd-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 1000px) {
  /* Stacked: heading, then the console (right under the bar on a phone), then "Try asking"; each scene one column. */
  .vd-panel--talk { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "copy" "side" "ask"; }
  .vd-scene-body { grid-template-columns: minmax(0, 1fr); }
  .vd-activity { position: static; }
}
@media (max-width: 560px) {
  .vd-bar { display: flex; gap: 8px; }
  .vd-bar-btn { flex: 1; gap: 12px; padding-right: 14px; }
  .vd-bar-text b { font-size: .92rem; }
  .vd-close { padding: 8px 14px; }
  .vd-demo { padding: 18px 14px; }
  .vd-actions .btn { width: 100%; justify-content: center; }
  .vd-tabs { max-width: none; }
  .vd-tab { font-size: .8rem; padding: 6px; gap: 6px; }
  .vd-callbar { flex: 1 1 100%; padding: 0 0 0 8px; }
  .vd-callbar-btn { margin-left: auto; }
  .vd.has-tabs .vd-stage { min-height: 560px; }
  .vd-scene-toggle { flex-wrap: wrap; gap: 6px 10px; padding: 10px 12px; }
  .vd-scene-title { flex: 1 1 0; }
  .vd-scene-sum { order: 4; flex: 1 1 100%; padding-left: 34px; white-space: normal; }
  .vd-scene-body { padding: 2px 8px 10px; }
  .vd-card { padding: 12px; }
  .vd-line { grid-template-columns: 1fr; gap: 0; }
  .vd-activity-list li { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .vd-expand, .vd-bar-btn, .vd-orb, .vd-scene-chev { transition: none; }
  .vd-bar-mic::after { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--vd-accent) 35%, transparent); }
  .vd-in, .vd-activity-list li.vd-fresh, .vd-caret::after, .vd-bubble--typing i, .vd-bars i { animation: none; }
  .vd[data-state="connecting"] .vd-orb { animation: none; }
  .vd-bars i { height: 14px; }
}
