/* Studio guided voice. One question stays visible beside its own controls. */
/* An animated transform creates a containing block for the fixed Continue
   dock. Render each new voice question in its final position immediately. */
.gs .gs-stage:has(.gv) > * { animation: none; }
.gs .gs-head:has(+ .gv:not(:empty)) { margin-bottom: 8px; }
.gv:not(:empty) { margin-block: 0 16px; display: grid; gap: 6px; min-width: 0; }
.gv-controls, .gv-receipt, .gv-state, .gv-error, .gv-btn {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.gv-controls { flex-wrap: wrap; gap: 4px 8px; }
.gv-btn {
  justify-content: center; min-height: 44px; min-width: 44px; padding: 8px 12px;
  font: inherit; font-size: .95rem; font-weight: 600; line-height: 1.25;
  color: var(--text-1); background: transparent; border: 1px solid var(--border-strong);
  border-radius: var(--r-ctl); cursor: pointer;
}
.gv-btn .ico, .gv-state .ico, .gv-receipt .ico, .gv-error .ico { flex: none; width: 20px; height: 20px; }
.gv-main { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.gv:is([data-voice-guide="brand"], [data-voice-guide="what"]) [data-voice-start] {
  flex: 1 1 210px; min-height: 58px; font-size: 1.08rem;
}
.gv [data-voice-start] .ico { width: 24px; height: 24px; }
.gv-disclosure { margin-block: 3px 8px; }
.gv-example { margin: 2px 0 10px; max-width: 44ch; line-height: 1.45; text-wrap: pretty; }
.gs .gs-what textarea.gs-input {
  height: auto; min-height: 78px; resize: vertical; line-height: 1.45;
  scroll-margin-block: 76px calc(124px + env(safe-area-inset-bottom, 0px));
}
.gs .gs-input {
  scroll-margin-block: 76px calc(124px + env(safe-area-inset-bottom, 0px));
}
/* During transcript repair, keep any existing typed alternative and the Back
   control. An empty second editor would offer a conflicting submit action. */
.gs-stage:has(.gv [data-gv="draft"]) .gs-what:has([data-what]:placeholder-shown) :is(.gs-field, [data-primary]) {
  display: none;
}
.gv-quiet { border-color: transparent; padding-inline: 6px; }
.gv-btn:disabled { opacity: .55; cursor: default; }
.gv-btn:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.gv-btn:focus-visible, .gv textarea:focus-visible { outline: 2px solid var(--text-1); outline-offset: 3px; }
.gv-state { min-height: 36px; font-weight: 600; }
.gv-presence {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
}
.gv-presence.is-speaking {
  border-color: var(--accent-text);
  background: var(--accent-soft);
}
.gv-presence.is-listening {
  border-color: var(--text-2);
}
.gv-presence.is-paused {
  opacity: .84;
}
.gv-presence-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; flex: 1 1 auto;
}
.gv-presence-meta .gv-disclosure { margin: 0; }
.gv-wave {
  display: inline-flex; align-items: center; gap: 3px;
  height: 28px; flex: none; padding-inline: 2px;
}
.gv-bar {
  display: block; width: 3px; height: 26px;
  background: var(--text-1);
  transform-origin: center;
  transform: scaleY(var(--h, .22));
  transition: transform 70ms linear;
}
.gv-presence.is-speaking .gv-bar { background: var(--accent-text); }
.gv-presence.is-processing .gv-bar { background: var(--text-2); }
.gv-presence.is-paused .gv-bar { background: var(--text-3); }
@media (prefers-reduced-motion: reduce) {
  .gv-bar { transition: none; }
}
.gv-line, .gv-error { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.gv-line { text-align: start; max-height: 5lh; overflow: auto; }
.gv-line[data-voice-reply] { margin-block-start: 8px; padding-inline-start: 12px; border-inline-start: 2px solid currentColor; max-height: 9lh; }
.gv-disclosure { font-size: .84rem; line-height: 1.35; color: var(--text-2); }
.gv textarea {
  resize: vertical; width: 100%; min-height: 72px; max-height: 32vh; font: inherit;
  font-size: 1rem; padding: 12px; color: var(--text-1); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-ctl); text-align: start;
  scroll-margin-block: 76px calc(136px + env(safe-area-inset-bottom, 0px));
}
.gv-a11y {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 2px;
}
.gv-a11y > summary {
  display: flex; align-items: center; min-height: 44px;
  color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}
.gv-a11y > summary:hover { color: var(--text-1); }
.gv-a11y-body { display: grid; gap: 10px; padding-top: 8px; }
.gv-a11y-toggle {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  font-size: var(--fs-sm); color: var(--text-1); cursor: pointer;
}
.gv-a11y-toggle input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }
.gv-receipt { color: var(--text-2); font-size: .92rem; }
.gv-receipt > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gv-options, .gv-options section { display: grid; gap: 12px; }
.gv-options p { margin: 0; line-height: 1.5; }
.gs .gs-sum-row[data-chip="what"] .gs-sum-text { flex-direction: column; gap: 4px; }
.gs .gs-sum-row[data-chip="what"] .gs-sum-label { flex: none; }
.gs .gs-sum-row[data-chip="what"] { align-items: flex-start; }
.gs .gs-sum-row[data-chip="what"] .gs-sum-value { line-height: 1.45; }
.gs .gs-sum-row[data-chip="count"] .gs-sum-value { font-weight: 600; }
.gs .gs-stage:has(.gv) { padding-top: clamp(10px, 1.6vh, 20px); }
@media (max-width: 540px) {
  /* A reserved desktop scrollbar gutter offsets the fixed dock in RTL. */
  html:has(.gs .gv) { scrollbar-gutter: auto; }
  .gv-btn { font-size: .9rem; gap: 5px; padding-inline: 10px; }
  .gv-quiet { padding-inline: 3px; }
  .gv-controls { gap: 2px 6px; }
  .gv:not(:empty) { margin-bottom: 10px; gap: 3px; }
  .gs .gs-stage:has(.gv) .gs-q { font-size: clamp(1.45rem, 6.7vw, 1.95rem); }
  .gs .gs-stage:has(.gv) .gs-note { margin-top: 6px; }
  .gs .gs-stage:has(.gv) .gs-grid { gap: 8px; }
}
@media (max-width: 380px) {
  .gs .gs-sum-row { gap: 8px; }
  .gs .gs-sum-text { gap: 6px; }
  .gs .gs-sum-label { flex-basis: 5rem; }
  .gv-controls .gv-btn[data-gv="edit"] .ico { display: none; }
}

