[hidden] { display: none !important; }

:root {
  font-family: "Inter", system-ui, "Segoe UI", sans-serif;
  color: var(--vv-text);
  background: var(--vv-page);
  --vv-page: #f3f4f6;
  --vv-surface: #fff;
  --vv-text: #111827;
  --vv-muted: #4b5563;
  --vv-border: #e5e7eb;
  --vv-control-border: #6b7280;
  --vv-control-fill: #f9fafb;
  --vv-control-hover: #e5f4f8;
  --vv-accent: #0891b2;
  --vv-action: #0e7490;
  --vv-action-hover: #155e75;
  --vv-action-ink: #fff;
  --vv-focus: #0e7490;
  --vv-stage-background: #f9fafb;
  --vv-indicator-neutral: #2563a6;
  --vv-indicator-live: #15803d;
  --vv-indicator-attention: #92400e;
  --vv-warning: #78350f;
  --vv-danger: #be123c;
  --vv-danger-hover: #9f1239;
  --vv-radius: 1rem;
  --vv-control-radius: .625rem;
  --vv-shell: 60rem;
  --vv-gutter: clamp(.85rem, 4vw, 2rem);
  --vv-card-padding: clamp(.85rem, 4vw, 1.65rem);
  --vv-shadow: 0 1px 3px #1118270d, 0 6px 16px #1118270c;
}

body { margin: 0; min-height: 100vh; }

/* Example hints in empty fields (U2): lighter than typed text and in italics, 4.5:1 or more on every field. */
:root { --vv-hint: #6b7280; }
html.dark-theme, html.dark-theme body[data-view] { --vv-hint: #9ca3af; }
@media (prefers-color-scheme: dark) {
  html:not(.light-theme):not(.glass-theme), html:not(.light-theme):not(.glass-theme) body[data-view] { --vv-hint: #9ca3af; }
}
html.glass-theme, html.glass-theme body[data-view] { --vv-hint: #374151; }
:is(input, textarea)::placeholder { color: var(--vv-hint); opacity: 1; font-style: italic; font-weight: 400; }
p { line-height: 1.5; }
form, .controls { display: flex; align-items: end; gap: .7rem; flex-wrap: wrap; }
label { display: grid; gap: .3rem; }
button, select { font: inherit; min-height: 2.75rem; padding: .55rem .85rem; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--vv-focus); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--vv-focus); outline-offset: 3px; }

#input-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .4rem .7rem;
  align-items: center;
}

#input-level { width: 100%; }
#input-feedback p { grid-column: 1 / -1; margin: 0; overflow-wrap: anywhere; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  padding: .52rem max(var(--vv-gutter), calc((100% - var(--vv-shell)) / 2));
  border-bottom: 1px solid var(--vv-border);
  background: var(--vv-control-fill);
  color: var(--vv-text);
}

#publisher-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 .85rem;
}

:is(#publisher-nav a, #return-to-saved-room, #switch-listener-room) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .9rem;
  font-weight: 600;
}

#return-to-saved-room {
  background: transparent;
}

#publisher-nav a,
#return-to-saved-room {
  padding-inline: .65rem;
  border: 1px solid transparent;
  border-radius: var(--vv-control-radius);
  color: var(--vv-muted);
  text-decoration: none;
}

#publisher-nav a:hover,
#return-to-saved-room:hover {
  border-color: var(--vv-border);
  background: var(--vv-surface);
  color: var(--vv-action);
}

#switch-listener-room {
  padding: .3rem .65rem;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-surface);
  color: var(--vv-action);
}

#switch-listener-room:hover,
#cancel-listener-room:hover {
  background: var(--vv-control-hover);
}

:is(#listener-room-dialog, #invite-qr-dialog, #revoke-invite-dialog) {
  box-sizing: border-box;
  width: min(29rem, calc(100% - 24px));
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  padding: clamp(12px, 4vw, 24px);
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius);
  background: var(--vv-surface);
  color: var(--vv-text);
  box-shadow: var(--vv-shadow);
}

:is(#listener-room-dialog, #invite-qr-dialog, #revoke-invite-dialog)::backdrop {
  background: #11182788;
}

#revoke-invite-heading {
  margin-top: 0;
}

#revoke-invite-dialog button,
#revoke-invite {
  min-height: 44px;
}

#invite-qr-dialog {
  width: min(31rem, calc(100% - 24px));
}

.invite-qr-layout {
  display: grid;
  grid-template-areas: "copy" "code" "close";
  justify-items: center;
  gap: 12px;
}

.invite-qr-copy {
  grid-area: copy;
  text-align: center;
}

#invite-qr-heading {
  margin: 0;
  font-size: clamp(1.2rem, 5vw, 1.65rem);
  line-height: 1.1;
}

.invite-qr-copy p {
  margin: .35em 0;
  color: var(--vv-muted);
  font-size: .875rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.invite-qr-copy p:empty {
  margin: 0;
}

.invite-qr-actions {
  grid-area: close;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35em;
}

.invite-qr-actions button {
  min-height: 44px;
  padding: .2em .85em;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-control-fill);
  color: var(--vv-action);
}

.invite-qr-actions button:hover {
  background: var(--vv-control-hover);
}

#renew-invite-qr:not([aria-disabled="true"]) {
  border-color: var(--vv-action);
  background: var(--vv-action);
  color: var(--vv-action-ink);
}

#renew-invite-qr[aria-disabled="true"] {
  cursor: wait;
}

#invite-qr-image {
  grid-area: code;
  width: min(100%, 384px);
  height: auto;
  image-rendering: pixelated;
}

@media (min-width: 510px) and (max-height: 420px) and (orientation: landscape) {
  #invite-qr-dialog {
    padding: 12px;
  }

  .invite-qr-layout:has(#invite-qr-image:not([hidden])) {
    grid-template-areas: "close code" "copy code";
    grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
    align-items: start;
    row-gap: 6px;
  }

  .invite-qr-copy {
    text-align: start;
  }

  .invite-qr-copy p {
    font-size: .75rem;
  }

  .invite-qr-layout:has(#invite-qr-image:not([hidden])) .invite-qr-actions {
    justify-self: start;
  }

  #invite-qr-image {
    align-self: start;
    width: min(100%, calc(100dvh - 48px));
  }
}

#listener-room-heading {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.15;
}

#listener-room-note,
#listener-room-preview-note {
  margin: .45em 0 .7em;
  color: var(--vv-muted);
  font-size: .875rem;
  line-height: 1.25;
}

#listener-room-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .65em;
}

#listener-room-status {
  margin: 0;
  color: var(--vv-muted);
  overflow-wrap: anywhere;
}

#listener-room-status:empty {
  position: absolute;
}

#listener-room-preview-name {
  margin: .45em 0;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.listener-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5em;
}

:is(.listener-room-actions, .listener-room-footer) button {
  min-height: 48px;
  max-width: 100%;
  padding: .35em .55em;
  font-size: .9rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

:is(#cancel-listener-room, #edit-next-room) {
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-surface);
  color: var(--vv-text);
}

.listener-room-footer {
  padding-top: .4em;
}

#join-next-room[aria-disabled="true"] {
  background: var(--vv-control-fill);
  color: var(--vv-muted);
  cursor: wait;
}

.brand {
  display: flex;
  align-items: center;
  gap: .62rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -.025em;
}

.brand-mark {
  background:
    linear-gradient(currentColor 0 0) 19% 50% / 12% 34% no-repeat,
    linear-gradient(currentColor 0 0) 50% 50% / 12% 76% no-repeat,
    linear-gradient(currentColor 0 0) 81% 50% / 12% 48% no-repeat;
}

.brand-mark {
  display: block;
  width: .9rem;
  height: .9rem;
  padding: .45rem;
  border-radius: .55rem;
  background-color: var(--vv-action);
  background-origin: content-box;
  color: var(--vv-action-ink);
}

#welcome {
  max-width: 55rem;
  margin-inline: auto;
  overflow: clip;
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius);
  background: var(--vv-surface);
  box-shadow: var(--vv-shadow);
}

.welcome-intro {
  padding: clamp(1.1rem, 5vw, 3rem);
  background: var(--vv-stage-background);
}

#welcome-heading {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(1.8rem, 5.6vw, 3.75rem);
  letter-spacing: 0;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.welcome-intro p,
.welcome-options p {
  margin: .55rem 0 0;
  color: var(--vv-muted);
}

.welcome-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1px;
  border-top: 1px solid var(--vv-border);
  background: var(--vv-border);
}

.welcome-options section {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  padding: var(--vv-card-padding);
  background: var(--vv-surface);
}

.welcome-options h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -.025em;
}

.welcome-options :is(a, button) {
  box-sizing: border-box;
  display: grid;
  align-items: center;
  justify-self: start;
  min-height: 48px;
  max-width: 100%;
  margin-top: .8rem;
  padding: .5rem .85rem;
  border: 1px solid var(--vv-action);
  border-radius: var(--vv-control-radius);
  background: var(--vv-surface);
  color: var(--vv-action);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.welcome-options .welcome-action {
  background: var(--vv-action);
  color: var(--vv-action-ink);
}

.welcome-options button:hover {
  background: var(--vv-control-hover);
}

.welcome-options .welcome-action:hover {
  background: var(--vv-action-hover);
}

#check-host-access[aria-disabled="true"] {
  border-color: var(--vv-border);
  background: var(--vv-control-fill);
  color: var(--vv-muted);
  cursor: wait;
}

#host-access-status:empty {
  display: none;
}

[data-view="publisher"] #welcome {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
}

[data-view="listener"] main {
  max-width: 42rem;
  margin: clamp(.7rem, 4.5vw, 3rem) auto 0;
  padding: 0 var(--vv-gutter) var(--vv-gutter);
}

[data-view="listener"] #listener {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius);
  background: var(--vv-surface);
  box-shadow: var(--vv-shadow);
}

[data-view="listener"] .listener-intro {
  min-width: 0;
  padding: var(--vv-card-padding) var(--vv-card-padding) .25rem;
  border-radius: var(--vv-radius) var(--vv-radius) 0 0;
  background: var(--vv-stage-background);
}

[data-view="listener"] #listener-heading {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  font-size: clamp(1.65rem, 6vw, 2.8rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

#listener-event-name-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-surface);
  color: var(--vv-focus);
}

#listener-event-name-toggle::before {
  content: "";
  width: 9px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}

#listener-event-name-toggle[aria-expanded="true"]::before {
  transform: translateY(2px) rotate(225deg);
}

#listener-event-name-panel {
  margin: 0;
  padding: .35em var(--vv-card-padding);
  overflow-wrap: anywhere;
}

@media (max-width: 480px), (max-height: 380px) and (orientation: landscape) {
  [data-view="listener"] .listener-title {
    display: flex;
    align-items: center;
    gap: .35rem;
  }

  [data-view="listener"] #listener-heading[dir="auto"] {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  #listener-event-name-toggle {
    flex: 0 0 auto;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  [data-view="listener"] #listener {
    --vv-card-padding: clamp(12px, 4vw, 16px);
  }

  [data-view="listener"] #play::before {
    display: none;
  }
}

[data-view="listener"] #listener-output {
  margin: .35rem 0 0;
  color: var(--vv-muted);
  font-size: .9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

[data-view="listener"] .listener-feedback {
  min-width: 0;
  padding: .45rem var(--vv-card-padding) .85rem;
  overflow-wrap: anywhere;
}

[data-view="listener"] .listener-notes {
  min-width: 0;
  padding: .6rem var(--vv-card-padding);
  border-top: 1px solid var(--vv-border);
  color: var(--vv-muted);
  font-size: .82rem;
}

.listener-notes:not(:has(> :not([hidden]))) {
  display: none;
}

[data-view="listener"] .listener-notes p {
  margin: 0;
}

[data-view="listener"] #play-state {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  margin: 0;
  font-size: .97rem;
  font-weight: 600;
  line-height: 1.48;
}

[data-view="listener"] #play-state:not(:empty)::before {
  content: "";
  flex: 0 0 .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--vv-indicator, var(--vv-indicator-neutral));
  outline: .22rem solid color-mix(in srgb, var(--vv-indicator, var(--vv-indicator-neutral)) 18%, transparent);
  translate: 0 -.07em;
}

[data-view="listener"] #play-state:is([data-state="ready"], [data-state="captions_ready"]) {
  --vv-indicator: var(--vv-indicator-live);
}

[data-view="listener"] #play-state:is([data-state="audio_paused"], [data-state="audio_resume_failed"], [data-state="paused"], [data-state="retry"],
  [data-state="recovering"], [data-state="audio_waiting"], [data-state="output_reconnecting"], [data-state="output_offline"],
  [data-state="output_throttled"],
  [data-state="live_throttled"], [data-state="live_offline"],
  [data-state="activation_reconnecting"], [data-state="event_output_changed"], [data-state="live_retry"], [data-state="expired"],
  [data-state="waiting_offline"], [data-state="invite_expired"], [data-state="listener_grant_required"],
  [data-state="unresolved"], [data-state="unavailable"], [data-state="room_unavailable"], [data-state="route_capacity"]) {
  --vv-indicator: var(--vv-indicator-attention);
}

[data-view="listener"] #play-state:is([data-state="ended"], [data-state="stopped"], [data-state="captions_stopped"]) {
  --vv-indicator: var(--vv-indicator-neutral);
}

[data-view="listener"] :is(#play-notice, #play-backlog, #source-caption-state, #caption-recovery-status) {
  margin: .65rem 0 0;
  color: var(--vv-muted);
  font-size: .88rem;
}

[data-view="listener"] #output-offline-note {
  margin: .5rem 0;
  color: var(--vv-text);
  font-size: .875rem;
  font-weight: 600;
}

#listener-live-actions:has(#output-offline-note:not([hidden])) {
  flex-wrap: wrap;
}

[data-view="listener"] #listener-live-actions #output-offline-note {
  flex: 0 0 100%;
  order: 1;
  margin: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

[data-view="listener"] .listener-recovery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: .65rem;
  margin-block-start: .65rem;
}

[data-view="listener"] .listener-recovery:not(:has(button:not([hidden]))) {
  display: none;
}

[data-view="listener"] .listener-transcript {
  min-width: 0;
  padding-inline: var(--vv-card-padding);
  overflow-wrap: anywhere;
}

[data-view="listener"] #meaning {
  max-width: 57ch;
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.45;
}

[data-view="listener"] #meaning:not(:empty) {
  padding-block: .85rem;
  border-top: 2px solid var(--vv-accent);
}

#caption-announcement,
#play-state-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

#caption-history-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding-block: .65rem .5rem;
  border-top: 1px solid var(--vv-border);
}

#caption-history-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

#view-transcript {
  min-height: 44px;
  max-width: 100%;
  margin-top: .45rem;
  padding: .3rem .6rem;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-surface);
  color: var(--vv-text);
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#view-transcript:hover {
  background: var(--vv-control-hover);
}

#follow-captions,
#caption-source-toggle,
#keep-caption-screen-awake {
  min-height: 2.75rem;
  max-width: 100%;
  border: 1px solid var(--vv-control-border);
  border-radius: .7rem;
  background: var(--vv-surface);
  color: var(--vv-text);
  font-size: .88rem;
  font-weight: 600;
}

#follow-captions {
  overflow-wrap: anywhere;
}

#caption-new {
  display: block;
  margin-top: .2em;
  color: var(--vv-action);
  font-size: .86em;
}

#follow-captions:hover,
#caption-source-toggle:hover,
#keep-caption-screen-awake:hover {
  background: var(--vv-control-hover);
}

#caption-source-toggle[aria-pressed="true"],
#keep-caption-screen-awake[aria-pressed="true"] {
  border-color: var(--vv-action);
  background: var(--vv-action);
  color: var(--vv-action-ink);
}

#caption-screen-status {
  margin: 0 0 .45rem;
  color: var(--vv-muted);
  font-size: .84rem;
}

#caption-history-limit {
  margin: 0 0 .45rem;
  color: var(--vv-muted);
  font-size: .84rem;
}

#caption-reader[role="region"] {
  position: relative;
  max-height: min(42vh, 22rem);
  overflow-y: auto;
  overflow-anchor: none;
  margin-bottom: .9rem;
  padding-inline-end: .6rem;
  scrollbar-width: thin;
}

[data-view="listener"] #caption-reader[role="region"] #meaning:not(:empty) {
  padding-block: .35rem;
  border: 0;
}

[data-view="listener"] .recovered-caption {
  display: block;
}

[data-view="listener"] .recovered-caption + .recovered-caption {
  margin-top: .85rem;
}

[data-view="listener"] .recovered-caption small {
  display: block;
  color: var(--vv-muted);
  font-size: .88rem;
  margin-top: .25rem;
}

[data-view="listener"] #caption-reader[data-hide-source] .recovered-caption small {
  display: none;
}

[data-view="listener"] #source-line {
  max-width: 70ch;
  margin: 0 0 1.15rem;
  color: var(--vv-muted);
}

[data-view="listener"] :is(#play-notice, #source-caption-state, #caption-recovery-status, #meaning, #source-line):empty {
  margin: 0;
  padding: 0;
  border: 0;
}

[data-view="listener"] #selection {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  container: listener-controls / inline-size;
  gap: .75rem;
  min-width: 0;
  padding: .9rem var(--vv-card-padding) var(--vv-card-padding);
  border-top: 1px solid var(--vv-border);
}

[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .listener-feedback {
  padding-block: 0;
}

[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .listener-intro {
  padding-block-end: .65rem;
}

@media (max-width: 380px) {
  [data-view="listener"] #listener:has(#play-state[data-state="idle"]) #listener-heading {
    font-size: 1.35rem;
  }
}

@media (max-height: 380px) and (orientation: landscape) {
  [data-view="listener"] main:has(#selection:not([hidden])) {
    margin-top: .3rem;
  }

  [data-view="listener"] #listener:has(#selection:not([hidden])) {
    --vv-card-padding: clamp(.5rem, 2.5vw, 1rem);
  }

  [data-view="listener"] #listener:has(#selection:not([hidden])) .listener-intro {
    padding-block: .4rem;
  }

  [data-view="listener"] #listener:has(#selection:not([hidden])) #listener-heading {
    font-size: 1.2rem;
  }

  [data-view="listener"] #listener:has(#selection:not([hidden])) #selection {
    padding-block-start: .35rem;
  }

  [data-view="listener"] #listener:has(#selection:not([hidden])) #play {
    min-height: max(48px, 2.25rem);
  }
}

[data-view="listener"] #output-settings {
  display: grid;
  gap: .75rem;
}

[data-view="listener"] #change-output::after {
  content: "";
  width: .42em;
  height: .42em;
  flex: 0 0 .42em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  rotate: 45deg;
}

[data-view="listener"] #change-output[aria-expanded="true"]::after {
  rotate: 225deg;
}

@media (max-width: 23rem) {
  [data-view="listener"] #listener:has(#change-output[aria-expanded="true"]) #listener-heading {
    font-size: 1.35rem;
  }

  [data-view="listener"] #selection:has(#change-output[aria-expanded="true"]),
  [data-view="listener"] #change-output[aria-expanded="true"] + #output-settings {
    gap: .45rem;
  }
}

[data-view="publisher"] #output-settings {
  grid-column: 1 / -1;
  display: grid;
  gap: .65rem;
}

[data-view="listener"] .listener-preferences {
  min-width: 0;
}

.listener-preferences:not(:has(> :not([hidden]))) {
  display: none;
}

@container listener-controls (max-width: 16rem) {
  [data-view="listener"] .listener-preferences,
  [data-view="listener"] .listener-mode-options {
    grid-template-columns: minmax(0, 1fr);
  }
}

[data-view="listener"] #selection label {
  display: grid;
  gap: .48rem;
  min-width: 0;
  font-size: .88rem;
  font-weight: 700;
}

#listener-output-modes {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

#listener-output-modes legend {
  margin-block-end: .48rem;
  padding: 0;
  font-size: .88rem;
  font-weight: 700;
}

.listener-mode-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .38rem;
}

.listener-mode-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

#listener-output-modes .listener-mode-options label {
  display: grid;
  min-height: max(44px,2.75rem);
  place-items: center;
  padding: .28rem .22rem;
  border: 1px solid var(--vv-control-border);
  border-radius: .65rem;
  color: var(--vv-text);
  font-size: .85rem;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}

#listener-output-modes .listener-mode-options input:checked + label {
  border-color: var(--vv-action);
  background: var(--vv-control-hover);
  box-shadow: inset 0 0 0 1px var(--vv-action);
  color: var(--vv-action);
  font-weight: 700;
}

.listener-mode-options input:focus-visible + label {
  outline: 3px solid var(--vv-focus);
  outline-offset: 2px;
}

.listener-mode-options input:disabled + label {
  opacity: .55;
  cursor: default;
}

:is([data-view="listener"] #selection, [data-view="publisher"] :is(.publisher-workspace, #selection)) label:has(select) {
  position: relative;
}

:is([data-view="listener"] #selection, [data-view="publisher"] :is(.publisher-workspace, #selection)) label:has(select:enabled)::after {
  content: "";
  position: absolute;
  inset-inline-end: 1.18rem;
  bottom: 1.35rem;
  width: .45rem;
  height: .45rem;
  border-right: 2px solid var(--vv-muted);
  border-bottom: 2px solid var(--vv-muted);
  rotate: 45deg;
  pointer-events: none;
}

[data-view="listener"] :is(#selection, .listener-recovery, #listener-live-actions) :is(select, button) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background-color: var(--vv-surface);
  color: var(--vv-text);
  font-size: 1rem;
}

[data-view="listener"] #selection select {
  appearance: none;
  padding-inline: .75rem 2.1rem;
  background-color: var(--vv-control-fill);
  font-weight: 500;
}

[data-view="listener"] :is(#selection, .listener-recovery, #listener-live-actions) button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .65rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

[data-view="listener"] :is(#selection, .listener-recovery, #listener-live-actions) button:hover {
  border-color: var(--vv-focus);
  background: var(--vv-control-hover);
}

#switch-output-status {
  margin: 0;
  color: var(--vv-muted);
  overflow-wrap: anywhere;
}

#switch-output-status:empty {
  display: none;
}

[data-view="listener"] :is(#selection, .listener-recovery) :is(#play:is([data-action="listen"], [data-action="read"]), #resume-audio, #switch-output,
  #capacity-captions, #capacity-captions[hidden] + #capacity-original, #recover-captions, #retry-output:not([aria-disabled="true"])),
[data-view="listener"] #listener-live-actions #play:is([data-action="listen"], [data-action="read"]),
[data-view="listener"] #listener:has(#play-state:is([data-state="expired"], [data-state="live_pending"], [data-state="live_retry"])) #go-live {
  border-color: var(--vv-action);
  background: var(--vv-action);
  color: var(--vv-action-ink);
}

[data-view="listener"] :is(#selection, .listener-recovery) :is(#play:is([data-action="listen"], [data-action="read"]), #resume-audio, #switch-output,
  #capacity-captions, #capacity-captions[hidden] + #capacity-original, #recover-captions, #retry-output):not([aria-disabled="true"]):hover,
[data-view="listener"] #listener-live-actions #play:is([data-action="listen"], [data-action="read"]):hover,
[data-view="listener"] #listener:has(#play-state:is([data-state="expired"], [data-state="live_retry"])) #go-live:hover {
  background: var(--vv-action-hover);
}

[data-view="listener"] :is(#selection, .listener-recovery, #listener-live-actions) button:is(:disabled, [aria-disabled="true"]) {
  border-color: var(--vv-border);
  background: var(--vv-control-fill);
  color: var(--vv-muted);
}

[data-view="listener"] #play:not([data-action="retry"], [data-action="pending"])::before {
  content: "";
  width: .65rem;
  height: .65rem;
  flex: 0 0 .65rem;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

[data-view="listener"] #play[data-action="stop"]::before {
  border-radius: .12rem;
  clip-path: none;
}

[data-view="listener"] #play[data-action="read"]::before {
  clip-path: none;
  background: repeating-linear-gradient(to bottom, currentColor 0 2px, transparent 2px 4px);
}

:is([data-view="listener"], [data-view="publisher"]) :focus-visible {
  outline-color: var(--vv-focus);
}

[data-view="listener"] #listener:has(#selection[hidden]) {
  max-width: 34rem;
  margin-inline: auto;
}

[data-view="listener"] #listener:has(#selection[hidden]) .listener-feedback {
  padding-block-end: var(--vv-card-padding);
}

[data-view="listener"] #listener[data-access="blocked"] #play-state {
  --vv-indicator: var(--vv-indicator-attention);
}

@media (max-width: 43rem) {
  [data-view="listener"] #listener:has(:is(#capacity-captions, #capacity-original,
    #recover-captions, #resume-audio, #view-transcript):not([hidden])) {
    --vv-card-padding: clamp(.65rem, 3vw, 1.1rem);
  }

  [data-view="listener"] #listener:has(:is(#capacity-captions, #capacity-original,
    #recover-captions, #resume-audio, #view-transcript):not([hidden])) #listener-heading {
    font-size: 1.35rem;
  }

  [data-view="listener"] #listener:has(#recover-captions:not([hidden])) #listener-output {
    display: none;
  }
}

@media (max-height: 380px) and (orientation: landscape) {
  [data-view="listener"] main:has(.listener-recovery button:not([hidden])) {
    margin-top: .3rem;
  }

  [data-view="listener"] #listener:has(.listener-recovery button:not([hidden])) .listener-intro {
    padding-top: .25rem;
  }

  [data-view="listener"] #listener:has(.listener-recovery button:not([hidden])) #listener-heading {
    font-size: 1.2rem;
  }

  [data-view="listener"] #listener:has(.listener-recovery button:not([hidden])) .listener-feedback {
    padding-block: .25rem;
  }

  [data-view="listener"] .listener-recovery {
    margin-block-start: .3rem;
  }

  [data-view="listener"] #listener .listener-recovery button {
    min-height: max(44px, 2.6rem);
  }
}

@media (max-height: 500px) and (orientation: landscape), (max-width: 480px) and (orientation: portrait) {
  html:has(#listener-live-actions:not([hidden])) {
    scroll-padding-block-start: calc(var(--listener-live-actions-height, 0px) + .35rem);
  }

  #listener-live-actions {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    gap: .4rem;
    padding: .2rem var(--vv-card-padding);
    border-block: 1px solid var(--vv-border);
    background: var(--vv-surface);
  }

  [data-view="listener"] #listener-live-actions button {
    flex: 1;
    margin: 0;
    min-height: max(48px, 2.25rem);
    padding: .25rem .4rem;
    font-size: .86rem;
  }

  [data-view="listener"] #listener-live-actions #follow-captions {
    flex-direction: column;
    gap: .1em;
    border-color: var(--vv-action);
    color: var(--vv-action);
  }

  #listener-live-actions #caption-new {
    margin: 0;
  }

  #listener-live-actions #resume-audio {
    border-color: var(--vv-action);
    background: var(--vv-action);
    color: var(--vv-action-ink);
  }

  #listener-live-actions #resume-audio[aria-disabled="true"] {
    border-color: var(--vv-border);
    background: var(--vv-control-fill);
    color: var(--vv-muted);
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  #listener-live-actions:has(#follow-captions):has(#resume-audio:not([hidden])) #play::before {
    display: none;
  }

  [data-view="listener"] #listener-live-actions:has(#follow-captions):has(#resume-audio:not([hidden])) button {
    font-size: .74rem;
    padding-inline: .25em;
  }
}

#retry-listener-access {
  min-width: min(100%, 9rem);
  min-height: 3.25rem;
  margin-top: 1rem;
  border: 1px solid var(--vv-action);
  border-radius: var(--vv-control-radius);
  background: var(--vv-action);
  color: var(--vv-action-ink);
  font-weight: 700;
}

#retry-listener-access:hover {
  background: var(--vv-action-hover);
}

#retry-listener-access[aria-disabled="true"] {
  border-color: var(--vv-control-border);
  background: var(--vv-control-fill);
  color: var(--vv-muted);
  cursor: wait;
}

#listener-invite {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .5rem;
  margin-top: .8rem;
}

#play-state:empty ~ #listener-invite {
  margin-top: 0;
}

:is(#listener-invite, #listener-room-form) label {
  min-width: 0;
  font-size: .9rem;
  font-weight: 600;
}

:is(#listener-invite-url, #listener-room-url) {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: .35rem .75rem;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-control-fill);
  color: var(--vv-text);
  font: inherit;
}

:is(#listener-invite-url, #listener-room-url)[aria-invalid="true"] {
  border-color: var(--vv-danger);
}

#listener-invite-error {
  margin: 0;
  color: var(--vv-danger-hover);
  font-size: .85rem;
}

#listener-invite-error:empty {
  position: absolute;
}

:is(#join-listener, #join-next-room, #confirm-next-room) {
  min-height: 48px;
  border: 1px solid var(--vv-action);
  border-radius: var(--vv-control-radius);
  background: var(--vv-action);
  color: var(--vv-action-ink);
  font-weight: 700;
}

:is(#join-listener, #join-next-room, #confirm-next-room):hover {
  background: var(--vv-action-hover);
}

@media (max-width: 30rem) {
  [data-view="listener"] #listener:has(#listener-invite:not([hidden])) {
    --vv-card-padding: clamp(.65rem, 4vw, 1.15rem);
  }

  [data-view="listener"] #listener:has(#listener-invite:not([hidden])) #listener-heading {
    font-size: 1.35rem;
  }

  [data-view="listener"] #listener:has(#listener-invite:not([hidden])) .listener-feedback {
    padding-block-start: .25rem;
  }

  #listener-invite {
    margin-top: .45rem;
  }

  #join-listener {
    padding-inline: .4rem;
  }
}

[data-view="publisher"] main {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 1rem;
  max-width: var(--vv-shell);
  margin: clamp(1rem, 3vw, 2.5rem) auto 0;
  padding: 0 var(--vv-gutter) var(--vv-gutter);
}
[data-view="publisher"] :is(#publisher, #share-room, #listener) {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius);
  background: var(--vv-surface);
  box-shadow: var(--vv-shadow);
}

[data-view="publisher"] #publisher {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  padding: 0;
}

.publisher-stage,
.publisher-workspace {
  min-width: 0;
  padding: var(--vv-card-padding);
}

.publisher-stage {
  display: grid;
  align-content: start;
  border-inline-end: 1px solid var(--vv-border);
  border-radius: var(--vv-radius) 0 0 var(--vv-radius);
  background: var(--vv-stage-background);
}

#publisher-heading {
  margin: 0;
  font-size: clamp(1.65rem, 6vw, 2.8rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

#publisher-event-name {
  min-width: 0;
}

#publisher-event-name-summary {
  align-content: center;
  min-height: 44px;
  color: var(--vv-focus);
  font-weight: 600;
  cursor: pointer;
}

#publisher-event-name-full {
  margin: 0 0 .75em;
  padding: .45em .6em;
  border-radius: var(--vv-control-radius);
  background: var(--vv-control-fill);
  overflow-wrap: anywhere;
}

#event-choices {
  margin-block: .7rem;
}

#event-choices-summary {
  align-content: center;
  min-height: 2.75rem;
  color: var(--vv-focus);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}

#new-event-note, #invite-expiration, .publisher-event-action p {
  margin: .45rem 0;
  font-size: .875rem;
  color: var(--vv-muted);
}

#publisher-setup-note {
  max-width: 32ch;
  margin: .7rem 0 0;
  color: var(--vv-muted);
}

[data-view="publisher"] #capture-state {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  margin: 1rem 0 0;
  color: var(--vv-text);
  font-size: clamp(1rem, 2vw, 1.16rem);
  font-weight: 600;
  overflow-wrap: anywhere;
}

[data-view="publisher"] #capture-state:empty {
  margin: 0;
}

#cancel-microphone-start {
  margin-top: .65rem;
}

.publisher-stage :focus-visible {
  outline-color: var(--vv-action);
}

[data-view="publisher"] #capture-state:not(:empty)::before {
  content: "";
  flex: 0 0 .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--publisher-indicator, var(--vv-indicator-neutral));
  outline: .22rem solid color-mix(in srgb, var(--publisher-indicator, var(--vv-indicator-neutral)) 18%, transparent);
  translate: 0 -.07em;
}

#capture-state:is([data-tone="recording"], [data-tone="saved"]) {
  --publisher-indicator: var(--vv-indicator-live);
}

#capture-state[data-tone="attention"] {
  --publisher-indicator: var(--vv-indicator-attention);
}

[data-view="publisher"] #input-feedback {
  margin: .85rem 0 0;
  padding-top: .7rem;
  border-top: 1px solid var(--vv-border);
  color: var(--vv-muted);
  font-size: .875rem;
}

[data-view="publisher"] :is(#input-level, #microphone-preview-level) {
  height: .6rem;
  accent-color: var(--vv-action);
}

[data-view="publisher"] :is(#input-level, #microphone-preview-level)::-webkit-meter-bar {
  border: 1px solid var(--vv-muted);
  border-radius: 1rem;
  background: var(--vv-control-hover);
}

[data-view="publisher"] :is(#input-level, #microphone-preview-level)::-webkit-meter-optimum-value {
  border-radius: 1rem;
  background: var(--vv-action);
}

[data-view="publisher"] #input-level-status {
  color: var(--vv-warning);
  font-size: .85rem;
}

#capture-input-device {
  color: var(--vv-text);
  font-weight: 600;
}

#capture-pending {
  color: var(--vv-warning);
}

.publisher-workspace {
  align-self: start;
}

#publisher[data-event-active] .publisher-workspace {
  align-self: center;
}

#publisher-live-output {
  display: none;
  margin: 0;
  color: var(--vv-muted);
  font-size: .88rem;
}

[data-view="publisher"] :is(#publisher-mode, #event-name-field, #archive-label, #selection label) {
  min-width: 0;
  font-size: .88rem;
  font-weight: 700;
}

#event-name-field {
  margin-block: .75rem;
}

#event-name {
  box-sizing: border-box;
  min-width: 0;
  min-height: 48px;
  padding: .55rem .75rem;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-surface);
  color: var(--vv-text);
  font: inherit;
  font-size: 1rem;
}

#event-name[aria-invalid="true"] {
  border-color: var(--vv-danger);
}

#event-name-error {
  color: var(--vv-danger-hover);
}

#event-name-error:empty {
  position: absolute;
}

:is(#publisher-heading, #listener-heading)[dir="auto"] {
  overflow-wrap: anywhere;
}

#mode-description {
  min-height: 1.5em;
  margin: .55rem 0 1rem;
  color: var(--vv-muted);
  font-size: .89rem;
}

.microphone-setup:has(#check-microphone:not([hidden])) {
  margin-block: .7rem;
  padding: .75rem;
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-control-fill);
}

.microphone-check-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35em;
}

#microphone-check-note {
  margin: .35rem 0 0;
  color: var(--vv-muted);
  font-size: .85rem;
}

#publisher[data-microphone-setup-issue] #microphone-check-note,
.microphone-setup:has(#check-microphone[hidden]) #microphone-check-note,
#publisher[data-restore] .microphone-setup,
#publisher[data-event-active] .microphone-setup {
  display: none;
}

#microphone-preflight {
  margin-block: .65rem 0;
}

#recovery-microphone {
  display: grid;
  gap: .35rem;
  margin-block: .45rem;
  font-size: .88rem;
  font-weight: 600;
}

#publisher[data-restore] #recovery-microphone {
  display: none;
}

#recovery-microphone:not([hidden]) ~ #publisher-capture-actions button {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 23rem) and (orientation: portrait) {
  #publisher #recovery-microphone:not([hidden]) ~ #publisher-capture-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

#publisher-capture-actions {
  align-items: stretch;
}

[data-view="publisher"] #publisher #check-microphone {
  color: var(--vv-focus);
}

[data-view="publisher"] #publisher #resume-microphone-check:not([aria-disabled="true"]) {
  border-color: var(--vv-action);
  background: var(--vv-action);
  color: var(--vv-action-ink);
}

#resume-microphone-check[aria-disabled="true"] {
  cursor: wait;
}

#microphone-preview {
  display: grid;
  gap: .45rem;
  margin-top: .65rem;
}

.microphone-preview-meter:has(#microphone-preview-level:not([hidden])) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25em .5em;
}

.microphone-preview-meter:has(#microphone-preview-level[hidden]) {
  display: none;
}

#microphone-preview-level {
  flex: 1 1 4rem;
  min-width: 0;
}

#microphone-preview-device,
#microphone-preview-status {
  margin: .35rem 0 0;
  color: var(--vv-muted);
  font-size: .88rem;
  overflow-wrap: anywhere;
}

#microphone-preflight p:empty {
  display: none;
}

[data-view="publisher"] :is(#input-level-status, #microphone-preview-status)[data-input-peak] {
  color: var(--vv-warning);
  font-weight: 600;
}

@media (max-width: 43rem) {
  .publisher-workspace:has(#microphone-preview:not([hidden])) #mode-description {
    display: none;
  }

  [data-view="publisher"] #publisher:has(#microphone-preview:not([hidden])) #publisher-setup-note {
    display: none;
  }
}

@media (max-width: 43rem) and (orientation: portrait),
  (max-height: 420px) and (orientation: landscape) {
  .microphone-setup:has(#microphone-preflight:not([hidden])) {
    padding: 10px;
  }

  .microphone-setup:has(#microphone-preflight:not([hidden])) #microphone-check-note {
    display: none;
  }

  [data-view="publisher"] #publisher .microphone-setup:has(#microphone-preflight:not([hidden])) :is(button, select) {
    min-height: max(44px, 1.5em);
    padding: .2em .5em;
    font-size: .78rem;
    line-height: 1.2;
  }

  [data-view="publisher"] #publisher .microphone-setup:has(#microphone-preflight:not([hidden])) select {
    padding-inline-end: 1.5em;
  }

  #microphone-preflight,
  #microphone-preview {
    margin: 8px 0 0;
  }

  #microphone-preview {
    gap: .3em;
  }

  .microphone-preview-meter,
  #microphone-preview > label {
    font-size: .8rem;
    line-height: 1.2;
  }

  #microphone-preview-device,
  #microphone-preview-status {
    margin: .25em 0 0;
    font-size: .8rem;
    line-height: 1.25;
  }

}

@media (max-width: 43rem) and (orientation: portrait) {
  [data-view="publisher"] #publisher:has(#microphone-preflight:not([hidden])) .publisher-workspace {
    padding-inline: max(12px, .45rem);
  }
}

@media (min-width: 510px) and (max-height: 420px) and (orientation: landscape) {
  #microphone-preview:has(#microphone-preview-level:not([hidden])) {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  }

  .microphone-preview-meter {
    align-self: center;
  }

  #microphone-preview-device {
    grid-column: 1 / -1;
  }
}

.publisher-workspace:has(#mode:disabled) #mode-description,
#publisher:is([data-event-active], [data-event-pending]) #publisher-mode {
  display: none;
}

#publisher:is([data-event-active], [data-event-pending]) #publisher-live-output {
  display: block;
  color: var(--vv-text);
  font-size: 1rem;
  font-weight: 600;
}

.publisher-workspace:has(#mode:disabled) #publisher-capture-actions {
  margin-top: .85rem;
}

[data-view="publisher"] :is(#publisher, #share-room, #listener) :is(button, select) {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 3rem;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-surface);
  color: var(--vv-text);
  font-size: .94rem;
  font-weight: 600;
  line-height: 1.25;
}

[data-view="publisher"] :is(#publisher, #listener) select {
  appearance: none;
  width: 100%;
  min-width: 0;
  padding-inline: 1rem 2.65rem;
  background-color: var(--vv-control-fill);
}

[data-view="publisher"] :is(#publisher, #listener) label:has(select:enabled)::after {
  bottom: 1.4rem;
}

@media (max-width: 43rem) and (orientation: portrait),
  (max-height: 420px) and (orientation: landscape) {
  [data-view="publisher"] #publisher #microphone-preview label:has(select:enabled)::after {
    bottom: 17px;
    inset-inline-end: .65em;
    width: .35em;
    height: .35em;
  }
}

[data-view="publisher"] :is(#publisher, #share-room, #listener) button:hover {
  background: var(--vv-control-hover);
}

[data-view="publisher"] :is(#publisher, #listener) :is(button, select):disabled {
  border-color: var(--vv-border);
  background: var(--vv-control-fill);
  color: var(--vv-muted);
  opacity: 1;
  -webkit-text-fill-color: currentColor;
}

#publisher #save:disabled {
  display: none !important;
}

#publisher-start-actions:has(button:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .7rem;
  width: 100%;
}

#publisher-start-actions:not(:has(button:not([hidden]))),
.publisher-event-action:not(:has(> button:not([hidden]))) {
  display: none;
}

#publisher[data-recording-ended] #publisher-start-actions {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
}

.publisher-event-action button {
  width: 100%;
}

.publisher-event-action p {
  margin-bottom: 0;
}

#original-download-status {
  margin: .55rem 0 0;
  color: var(--vv-muted);
  font-size: .88rem;
}

#original-download-status:empty {
  margin: 0;
}

#publisher[data-restore] :is(#ready-state, #publisher-live-output, #publisher-mode, #mode-description,
  #microphone-preflight, #publisher-capture-actions, #event-choices) {
  display: none;
}

#buffered-download {
  margin-block: .75rem 0;
}

#publisher[data-restore] #buffered-download {
  margin-block: 0 .75rem;
}

#buffered-download p {
  margin: .4em 0 0;
  color: var(--vv-muted);
  font-size: .85rem;
}

#buffered-download-status:empty {
  position: absolute;
}

#publisher[data-restore] .publisher-workspace {
  align-self: center;
}

#publisher[data-restore="checking"]:has(#retry-publisher-access[hidden]) .publisher-workspace {
  display: none;
}

#publisher[data-restore="checking"]:has(#retry-publisher-access[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

#publisher[data-restore="checking"]:has(#retry-publisher-access[hidden]) .publisher-stage {
  border: 0;
  border-radius: var(--vv-radius);
}

#publisher #retry-publisher-access {
  width: 100%;
  border-color: var(--vv-action);
  background: var(--vv-action);
  color: var(--vv-action-ink);
}

#publisher #retry-publisher-access:hover {
  background: var(--vv-action-hover);
}

#publisher #retry-publisher-access[aria-disabled="true"] {
  border-color: var(--vv-border);
  background: var(--vv-control-fill);
  color: var(--vv-muted);
  cursor: wait;
}

#another-room {
  margin-top: .75rem;
}

#another-room-note {
  margin: .4em 0 0;
  color: var(--vv-muted);
  font-size: .85rem;
}

#publisher[data-primary="start"] #start,
#publisher[data-primary="takeover"] #takeover,
#publisher[data-primary="pause"] #pause,
#publisher[data-primary="prepare-event"] #prepare-event,
#publisher[data-primary="new-event"] #new-event,
#publisher[data-primary="resume"] #resume,
#publisher[data-primary="reconnect-capture"] #reconnect-capture,
#publisher[data-primary="save"] #save,
#publisher #stop[data-buffer-recovery]:enabled {
  border-color: var(--vv-action);
  background: var(--vv-action);
  color: var(--vv-action-ink);
}

#publisher #stop:not([data-buffer-recovery]):enabled {
  border-color: var(--vv-danger);
  background: var(--vv-danger);
  color: var(--vv-action-ink);
}

#publisher #stop:not([data-buffer-recovery]):enabled:hover {
  background: var(--vv-danger-hover);
}

#publisher[data-primary]:not([data-primary="stop"]) button:hover:not(:disabled) {
  filter: brightness(.97);
}

[data-view="publisher"] :is(#share-room, #listener) {
  align-self: start;
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

[data-view="publisher"] :is(#share-heading, #listener-heading) {
  margin: 0 0 .65rem;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0;
}

[data-view="publisher"] #share-room .controls {
  align-items: center;
}

[data-view="publisher"] #share-room #copy-invite {
  border-color: var(--vv-action);
  background: var(--vv-control-hover);
  color: var(--vv-action);
}

[data-view="publisher"] #share-room #copy-invite:hover {
  background: var(--vv-action);
  color: var(--vv-action-ink);
}

[data-view="publisher"] #share-room :is(#copy-invite, #share-invite)[aria-disabled="true"] {
  border-color: var(--vv-border);
  background: var(--vv-control-fill);
  color: var(--vv-muted);
  cursor: wait;
}

[data-view="publisher"] #invite {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  color: var(--vv-focus);
  font-size: .92rem;
  font-weight: 600;
}

[data-view="publisher"] #invite[aria-disabled="true"] {
  color: var(--vv-muted);
  cursor: wait;
}

#manual-invite {
  display: grid;
  gap: .25rem;
  margin-top: .45rem;
  min-width: 0;
  font-size: .88rem;
  font-weight: 700;
}

#manual-invite-link {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: max(44px, 2.1rem);
  padding-inline: .55rem;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-control-fill);
  color: var(--vv-text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.25;
}

[data-view="publisher"] :is(#share-status, #invite-preview-status, #listener p) {
  margin: .75rem 0 0;
  color: var(--vv-muted);
  font-size: .9rem;
  overflow-wrap: anywhere;
}

[data-view="publisher"] :is(#share-status, #invite-preview-status, #listener p):empty {
  margin: 0;
}

#share-room:has(#manual-invite:not([hidden])) {
  display: grid;
}

#share-room:has(#manual-invite:not([hidden])) #share-status {
  grid-row: 3;
  margin-bottom: .65rem;
}

[data-view="publisher"] .listener-preferences {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: .65rem;
}

[data-view="publisher"] #switch-output-status {
  grid-column: 1 / -1;
  margin: 0;
}

[data-view="publisher"] #listener #selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  align-items: end;
  margin-top: .85rem;
}

[data-view="publisher"] #listener-output-modes {
  grid-column: 1 / -1;
}

[data-view="publisher"] #listener .listener-mode-options {
  display: flex;
  flex-wrap: wrap;
}

[data-view="publisher"] #listener .listener-mode-options label {
  flex: 1 0 min(100%, 7rem);
}

[data-view="publisher"] #listener #play:not(:disabled) {
  border-color: var(--vv-action);
  background: var(--vv-action);
  color: var(--vv-action-ink);
}

[data-view="publisher"] #listener #play:not(:disabled):hover {
  background: var(--vv-action-hover);
}

[data-view="publisher"] #listener #selection button {
  grid-column: 1 / -1;
}

[data-view="publisher"] #resume-audio {
  width: 100%;
  margin-top: .55rem;
}

[data-view="publisher"] #resume-audio:not([aria-disabled="true"]) {
  border-color: var(--vv-action);
  color: var(--vv-action);
}

[data-view="publisher"] #resume-audio[aria-disabled="true"] {
  background: var(--vv-control-fill);
  color: var(--vv-muted);
}

[data-view="publisher"] #listener #play-state:not(:empty) {
  color: var(--vv-text);
  font-weight: 600;
}

@media (max-width: 43rem) {
  [data-view="publisher"] main {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-view="publisher"] #publisher {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-view="publisher"] .app-header {
    padding-block: .3rem;
  }

  [data-view="publisher"] main {
    margin-top: .7rem;
    gap: .75rem;
  }

  .publisher-stage {
    border-inline-end: 0;
    border-bottom: 1px solid var(--vv-border);
    border-radius: var(--vv-radius) var(--vv-radius) 0 0;
  }

  #publisher-heading {
    font-size: clamp(1.65rem, 6vw, 2.35rem);
  }

  #publisher[data-event-active] :is(.publisher-stage, .publisher-workspace) {
    padding-block: .7rem;
  }

  #publisher:is([data-event-active], [data-recording-ended]) #publisher-heading {
    padding-inline-end: 0;
    font-size: clamp(1.6rem, 6vw, 2.15rem);
    letter-spacing: 0;
  }

  #publisher[data-event-active] #capture-state {
    margin-top: .5rem;
  }

  #publisher[data-event-active] #input-feedback {
    margin-top: .65rem;
    padding-top: .6rem;
  }

  [data-view="publisher"] #share-room {
    padding: .85rem var(--vv-card-padding);
  }

  [data-view="publisher"] #share-room .controls {
    column-gap: 1rem;
  }

  #publisher #start,
  #publisher[data-primary="save"] #save {
    width: 100%;
  }
}

@media (min-width: 32rem) and (max-width: 43rem) and (max-height: 29rem) and (orientation: landscape) {
  [data-view="publisher"] main:has(#publisher[data-event-active]) {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    margin-top: .85rem;
  }

  [data-view="publisher"] #publisher[data-event-active] {
    grid-column: auto;
  }

  #publisher[data-event-active] #publisher-heading {
    font-size: 1.5rem;
  }

  #publisher[data-event-active] :is(.publisher-stage, .publisher-workspace) {
    padding-block: .5rem;
  }

  #publisher[data-event-active] #input-feedback {
    margin-top: .4rem;
    padding-top: .4rem;
  }
}

@media (min-width: 510px) and (max-height: 380px) and (orientation: landscape) {
  [data-view="publisher"]:has(#publisher[data-event-active]) .app-header {
    flex-wrap: nowrap;
    column-gap: .5rem;
  }

  [data-view="publisher"]:has(#publisher[data-event-active]) .brand {
    font-size: 1rem;
  }

  [data-view="publisher"]:has(#publisher[data-event-active]) #publisher-nav {
    column-gap: .5rem;
    justify-content: end;
  }

  [data-view="publisher"]:has(#publisher[data-event-active]) #publisher-nav a {
    font-size: .78rem;
  }

  [data-view="publisher"] #publisher[data-event-active] #publisher-heading[dir="auto"] {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  [data-view="publisher"] main:has(#publisher[data-event-active]) {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, .55fr);
    margin-top: .35rem;
  }

  #publisher[data-event-active] #publisher-heading {
    font-size: 1.15rem;
  }

  [data-view="publisher"] #publisher[data-event-active] #capture-state,
  #publisher[data-event-active] .publisher-workspace:has(#mode:disabled) #publisher-capture-actions {
    margin-top: 0;
  }

  [data-view="publisher"] #publisher[data-event-active] #publisher-capture-actions button {
    min-height: 48px;
    padding: .25em;
    font-size: max(15px, .78rem);
    overflow-wrap: anywhere;
  }

  #publisher[data-event-active] #publisher-capture-actions {
    gap: .4rem;
  }

  [data-view="publisher"] main:has(#publisher[data-event-active]) #share-room {
    padding: .35rem clamp(10px, 3vw, 1rem);
  }

  [data-view="publisher"] main:has(#publisher[data-event-active]) #share-heading {
    margin-bottom: .25rem;
    font-size: 1rem;
  }

  [data-view="publisher"] #share-room :is(#copy-invite, #share-invite, #show-invite-qr) {
    min-height: 48px;
    padding: .25em .35em;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 20rem) and (max-width: 43rem) {
  #publisher-capture-actions:has(#pause:not([hidden]), #resume:not([hidden]), #reconnect-capture:not([hidden])) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  #publisher-capture-actions button {
    padding-inline: .5rem;
  }
}

@media (max-width: 43rem) and (orientation: portrait),
  (min-width: 510px) and (max-height: 380px) and (orientation: landscape) {
  :is(#publisher[data-capture-recovery], #publisher[data-live-capture]) {
    align-self: start;
  }

  #publisher[data-capture-recovery] :is(.publisher-stage, .publisher-workspace) {
    padding: .35rem max(12px, .45rem);
  }

  [data-view="publisher"] :is(#publisher[data-capture-recovery], #publisher[data-live-capture]) #capture-state {
    gap: .5em;
    margin-top: .15em;
    font-size: .9rem;
    line-height: 1.25;
  }

  #publisher[data-capture-recovery] .publisher-workspace {
    display: grid;
    gap: .35rem;
  }

  #publisher[data-capture-recovery] #publisher-live-output {
    order: 1;
    font-size: .85rem;
  }

  #publisher[data-capture-recovery] #recovery-microphone {
    margin: 0;
    min-width: 0;
  }

  #publisher[data-capture-recovery] .publisher-workspace #publisher-capture-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    margin-top: 0;
  }

  #publisher[data-capture-recovery] #publisher-capture-actions:not(:has(:is(#pause, #resume, #reconnect-capture):not([hidden]))) #stop {
    grid-column: 1 / -1;
  }

  [data-view="publisher"] :is(#publisher[data-capture-recovery], #publisher[data-live-capture]) #publisher-capture-actions button {
    min-height: 48px;
    padding: .25em .2em;
    font-size: .8rem;
    line-height: 1.15;
  }

  [data-view="publisher"] #publisher[data-capture-recovery] #recovery-microphone-input {
    min-height: 48px;
    padding: .25em 1.5em .25em .4em;
    font-size: .8rem;
  }

  [data-view="publisher"] #publisher[data-capture-recovery] #recovery-microphone::after {
    bottom: .75em;
    inset-inline-end: .6em;
  }
}

@media (max-width: 43rem) and (orientation: portrait) {
  :is(#publisher[data-capture-recovery], #publisher[data-live-capture]) #publisher-heading {
    font-size: 1.3rem;
  }
}

@media (min-width: 510px) and (max-height: 380px) and (orientation: landscape) {
  [data-view="publisher"]:has(#publisher[data-capture-recovery], #publisher[data-live-capture]) .brand-mark {
    box-sizing: border-box;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 10px;
  }

  [data-view="publisher"]:has(#publisher[data-capture-recovery], #publisher[data-live-capture]) #publisher-nav a {
    font-size: .65rem;
  }

  [data-view="publisher"] main:has(#publisher[data-capture-recovery], #publisher[data-live-capture]) {
    grid-template-columns: minmax(0, 2.35fr) minmax(0, 1fr);
    column-gap: clamp(10px, 2vw, 1rem);
    margin-top: .2rem;
  }

  [data-view="publisher"] main:has(#publisher[data-event-active]):has(#manual-invite:not([hidden])) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :is(#publisher[data-capture-recovery], #publisher[data-live-capture]) {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(#publisher[data-capture-recovery], #publisher[data-live-capture]) #publisher-heading {
    font-size: 1rem;
  }

  #publisher[data-capture-recovery] #recovery-microphone {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
  }

  [data-view="publisher"] #publisher[data-capture-recovery] #recovery-microphone-input {
    padding-inline: .3em 1.2em;
    font-size: .68rem;
  }

  [data-view="publisher"] :is(#publisher[data-capture-recovery], #publisher[data-live-capture]) #publisher-capture-actions button {
    padding-inline: .1em;
    font-size: .75rem;
  }

  [data-view="publisher"]:has(#publisher[data-capture-recovery], #publisher[data-live-capture]) #copy-invite {
    font-size: .75rem;
    line-height: 1.12;
  }
}

@media (max-width: 43rem) and (orientation: portrait),
  (min-width: 510px) and (max-height: 380px) and (orientation: landscape) {
  [data-view="publisher"] #publisher[data-live-capture] {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: .35rem;
    padding: .35rem max(12px, .45rem);
  }

  #publisher[data-live-capture] :is(.publisher-stage, .publisher-workspace) {
    display: contents;
  }

  #publisher[data-live-capture] .publisher-workspace #publisher-capture-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    margin-top: 0;
  }

  #publisher[data-live-capture] #pause[hidden] ~ #stop {
    grid-column: 1 / -1;
  }

  #publisher[data-live-capture] #input-feedback {
    order: 1;
    margin-top: .1rem;
    padding-top: .35rem;
  }

  #publisher[data-live-capture] #publisher-live-output {
    order: 2;
    font-size: .85rem;
  }
}

@media (max-width: 43rem) and (orientation: portrait) {
  [data-view="publisher"]:has(#publisher[data-live-capture]) .brand {
    font-size: 1rem;
  }

  [data-view="publisher"]:has(#publisher[data-live-capture]) .brand-mark {
    box-sizing: border-box;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 9px;
  }

  [data-view="publisher"]:has(#publisher[data-live-capture]) #publisher-nav {
    column-gap: .5rem;
  }

  [data-view="publisher"]:has(#publisher[data-live-capture]) #publisher-nav a {
    font-size: .65rem;
  }

  [data-view="publisher"] :is(#publisher[data-live-capture], #publisher[data-capture-recovery]) #publisher-heading[dir="auto"] {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

[data-view="publisher"] #account-archive {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-radius);
  background: var(--vv-surface);
  box-shadow: var(--vv-shadow);
}

#account-archive summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
  min-height: 3.25rem;
  padding: clamp(1rem, 3.5vw, 1.6rem) var(--vv-card-padding);
  border-radius: var(--vv-radius);
  background: var(--vv-surface);
  color: var(--vv-text);
  cursor: pointer;
  list-style: none;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: 0;
}

#account-archive summary::-webkit-details-marker {
  display: none;
}

#account-archive summary::after {
  content: "";
  flex: 0 0 .52rem;
  height: .52rem;
  margin-inline-end: .16rem;
  border-right: 2px solid var(--vv-muted);
  border-bottom: 2px solid var(--vv-muted);
  rotate: 45deg;
}

#account-archive details:not([open]) summary {
  min-height: 3.6rem;
  padding-block: .8rem;
  background: transparent;
  color: var(--vv-text);
  font-size: 1.05rem;
  letter-spacing: -.02em;
}

#account-archive details:not([open]) summary:hover {
  background: var(--vv-control-fill);
}

#account-archive details:not([open]) summary::after {
  border-color: var(--vv-muted);
}

#account-archive details[open] summary {
  border-bottom: 1px solid var(--vv-border);
  background: var(--vv-stage-background);
  border-radius: var(--vv-radius) var(--vv-radius) 0 0;
}

#account-archive details[open] summary::after {
  rotate: 225deg;
}

.archive-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 15rem);
  gap: clamp(.85rem, 3vw, 1.5rem);
  padding: clamp(1rem, 3vw, 1.8rem) var(--vv-card-padding);
}

.archive-body:has(#account-archive-controls[hidden]),
#account-archive[data-checking] .archive-body {
  grid-template-columns: minmax(0, 1fr);
}

#account-archive[data-checking] :is(#account-archive-controls, #account-download-action, .archive-actions) {
  display: none;
}

#account-archive-controls {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

#account-archive-controls legend {
  margin-bottom: .5rem;
  padding: 0;
  font-size: .88rem;
  font-weight: 700;
}

#account-recording-count {
  color: var(--vv-muted);
  font-variant-numeric: tabular-nums;
}

#account-filter-label {
  margin-block-end: .5rem;
  font-size: .875rem;
  font-weight: 600;
}

#account-archive-filter {
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  padding: .65rem .8rem;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-surface);
  color: var(--vv-text);
  font: inherit;
  font-size: 1rem;
}

#account-filter-status {
  margin: 0 0 .5rem;
  color: var(--vv-muted);
  overflow-wrap: anywhere;
}

#account-filter-status:empty {
  margin: 0;
}

#account-recordings {
  display: grid;
  container: recording-list / inline-size;
  gap: .45rem;
  max-height: 19rem;
  overflow: auto;
  padding: .25rem;
  scrollbar-color: var(--vv-control-border) transparent;
  scrollbar-width: thin;
  scroll-padding-block: .25rem;
}

.archive-recording {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) fit-content(8rem);
  align-items: start;
  gap: .7rem;
  min-width: 0;
  padding: .7rem .8rem;
  border: 1px solid var(--vv-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-surface);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.archive-recording:hover {
  border-color: var(--vv-control-border);
}

.archive-recording:has(input:checked) {
  border-color: var(--vv-focus);
  background: var(--vv-control-hover);
}

.archive-recording:has(input:focus-visible) {
  outline: 2px solid var(--vv-focus);
  outline-offset: -2px;
}

.archive-recording input {
  width: 1.05rem;
  height: 1.05rem;
  margin: .13em 0 0;
  accent-color: var(--vv-focus);
}

.archive-recording time,
.archive-recording-date,
.archive-recording-format {
  display: grid;
  gap: .12rem;
  min-width: 0;
  line-height: 1.35;
}

.archive-recording-format {
  text-align: end;
}

@container recording-list (max-width: 12rem) {
  .archive-recording {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: .45em;
  }

  .archive-recording input {
    grid-area: 1 / 2;
    z-index: 1;
  }

  .archive-recording-date {
    grid-area: 1 / 1 / 2 / -1;
  }

  .archive-recording time {
    padding-inline-end: 1.5em;
  }

  .archive-recording-format {
    grid-column: 1 / -1;
    text-align: start;
  }
}

.archive-recording strong {
  color: var(--vv-text);
  font-size: .95rem;
  font-weight: 700;
}

.archive-recording small {
  color: var(--vv-muted);
  font-size: .78rem;
}

.archive-tools {
  align-self: start;
  min-width: 0;
}

.archive-status {
  margin: 0;
  color: var(--vv-muted);
  font-size: .9rem;
  line-height: 1.5;
}

.archive-status:not(:empty) {
  margin-bottom: .8rem;
}

.archive-status[data-tone="attention"] {
  padding: .75rem .85rem;
  border-radius: var(--vv-control-radius);
  background: #fff0d8;
  color: #683e20;
}

.archive-actions {
  display: grid;
  gap: .65rem;
}

#account-download-action:has(#account-download:not([hidden])) {
  display: grid;
  gap: .65rem;
  margin-bottom: .65rem;
}

.archive-download-target {
  min-width: 0;
  margin: 0;
  color: var(--vv-muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.archive-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.archive-list-actions:has(#account-archive-older:not([hidden])) #account-archive-older {
  flex: 1 1 auto;
}

#account-archive button {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 3rem;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-surface);
  color: var(--vv-text);
  font-size: .94rem;
  font-weight: 700;
  line-height: 1.25;
}

#account-archive button:hover {
  background: var(--vv-control-hover);
}

#account-archive #account-download {
  width: 100%;
  border-color: var(--vv-action);
  background: var(--vv-action);
  color: var(--vv-action-ink);
}

#account-archive #account-download:hover {
  background: var(--vv-action-hover);
}

#account-archive button[aria-disabled="true"],
#account-archive #account-download[aria-disabled="true"] {
  border-color: var(--vv-border);
  background: var(--vv-control-fill);
  color: var(--vv-muted);
  cursor: default;
}

@media (max-width: 43rem) {
  .archive-body {
    grid-template-columns: minmax(0, 1fr);
    gap: .85rem;
    padding-inline: clamp(10px, 4vw, 1.3rem);
  }

  #account-recordings {
    max-height: 16rem;
  }

  #account-recordings:not(:has(.archive-recording:not([hidden]) ~ .archive-recording:not([hidden]))) {
    max-height: none;
  }

  .archive-tools:has(> :where(#account-download-action) #account-download:not([hidden])) {
    padding-top: .65rem;
    border-top: 1px solid var(--vv-border);
  }

  .archive-recording {
    gap: .55rem;
    padding: .62rem;
  }
}


@media (max-width: 43rem) {
  #account-archive[data-filtering] .archive-body {
    gap: .4rem;
    padding-block: .4rem;
  }

  #account-archive[data-filtering] summary {
    min-height: 48px;
    padding-block: .3rem;
    font-size: 1.15rem;
  }

  #account-archive[data-filtering] #account-archive-filter,
  #account-archive[data-filtering] button {
    min-height: 48px;
    padding: .25em .4em;
    font-size: .85rem;
  }

  #account-archive[data-filtering] #account-filter-status,
  #account-archive[data-filtering] .archive-status {
    font-size: .8rem;
    line-height: 1.25;
  }

  #account-archive[data-filtering] .archive-status:not(:empty) {
    margin-bottom: .35rem;
  }

  #account-archive[data-filtering] #account-download-action:has(#account-download:not([hidden])) {
    gap: .25rem;
    margin-bottom: .4rem;
  }

  #account-archive[data-filtering] #account-download-status[data-tone="attention"] {
    padding: .12em .35em;
    font-size: .74rem;
  }

  #account-archive[data-filtering] #account-download-target {
    font-size: .78rem;
    line-height: 1.25;
  }

  #account-archive[data-filtering] .archive-download-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #account-archive[data-filtering] .archive-download-separator {
    display: none;
  }
}

@media (min-width: 510px) and (max-height: 380px) and (orientation: landscape) {
  #account-archive[data-filtering] .archive-body {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: start;
    gap: .45rem;
  }

  #account-archive[data-filtering] .archive-tools {
    border: 0;
    padding: 0;
  }

  #account-archive[data-filtering] #account-recordings {
    max-height: 42vh;
  }
}

[data-view="listener"] #listener-options {
  min-width: 0;
  color: var(--vv-muted);
}

[data-view="listener"] #listener-options summary {
  padding-block: .55rem;
  cursor: pointer;
  font-weight: 600;
}

[data-view="listener"] #listener-options label {
  margin-block: .4rem;
}

[data-view="listener"] #listener-captions[aria-pressed="true"] {
  border-color: var(--vv-action);
  background: var(--vv-control-hover);
}

[data-view="listener"] #listener-captions-note {
  margin: 0;
  color: var(--vv-muted);
  font-size: .88rem;
}

@media (max-width: 480px) and (orientation: portrait) {
  #listener-live-actions {
    flex-direction: column;
  }

  [data-view="listener"] #listener-live-actions button {
    flex: auto;
    min-height: max(44px, 1.5rem);
    font-size: .82rem;
  }

  [data-view="listener"] #listener-live-actions #play::before {
    display: none;
  }
}


[data-view="listener"] .listener-feedback #listener-captions {
  min-height: 44px;
  margin: .45rem .5rem 0 0;
  padding: .3rem .6rem;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  color: var(--vv-text);
  font-size: .85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

[data-view="listener"] #listener-live-actions button {
  min-width: 0;
}


/* Selected visual rules from Classic Publisher and Listener templates at
   312d350416cb21ff0370e6baabb6d1ff55e61770. Media and controls still use 2.0. */
@font-face {
  font-family: Inter;
  src: url("/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
body[data-view="publisher"] {
  --bg-base:#f3f4f6;--panel-bg:#fff;--panel-bg-light:#f9fafb;--panel-border:#e5e7eb;
  --brand-accent:#0891b2;--brand-accent-strong:#0e7490;--brand-danger:#e11d48;--brand-danger-strong:#be123c;
  --brand-accent-soft:rgba(8,145,178,.28);
  --text-primary:#111827;--text-secondary:#4b5563;--text-tertiary:#9ca3af;--text-inverse:#fff;
  --status-ok-text:#14532d;--status-ok-bg:rgba(74,222,128,.8);
  --status-err-text:#991b1b;--status-err-bg:rgba(248,113,113,.8);
  --status-idle-text:#1e40af;--status-idle-bg:rgba(147,197,253,.8);
  --toast-bg:rgba(255,255,255,.98);--toast-text:#111827;--toast-muted:#475569;--toast-border:rgba(15,23,42,.12);
  --toast-ok-bg:#f0fdf4;--toast-ok-text:#14532d;--toast-ok-border:rgba(21,128,61,.24);
  --toast-err-bg:#fef2f2;--toast-err-text:#991b1b;--toast-err-border:rgba(185,28,28,.24);
  --shadow-focus:0 0 0 3px rgba(8,145,178,.3);
  --shadow-soft:0 1px 3px 0 rgba(0,0,0,.07),0 1px 2px -1px rgba(0,0,0,.07);
  --shadow-lift:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);
  --radius-sm:6px;--radius-md:10px;--radius-lg:16px;
  --space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-8:32px;
  --font-family-sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --font-family-mono:"Fira Code",monospace;
  --transition-fast:all .2s cubic-bezier(.4,0,.2,1);
  --content-width:1360px;
  --safe-top:env(safe-area-inset-top, 0px);
  --safe-bottom:env(safe-area-inset-bottom, 0px);
}
body[data-view="publisher"] {
  margin:0;font-family:var(--font-family-sans);font-size:1rem;font-weight:500;line-height:1.5;color:var(--text-primary);
  background-color:var(--bg-base);padding:var(--space-6) 0;transition:background-color var(--transition-fast);
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  overflow-x: hidden;
  padding-top:max(var(--space-6), var(--safe-top));
  padding-bottom:max(var(--space-6), var(--safe-bottom));
  min-height:100vh;
  min-height:100dvh;
}
body[data-view="publisher"] .app-container {
  width:100%;
  max-width:var(--content-width);
  min-height:calc(100vh - max(var(--space-6), var(--safe-top)) - max(var(--space-6), var(--safe-bottom)));
  height:calc(100vh - max(var(--space-6), var(--safe-top)) - max(var(--space-6), var(--safe-bottom)));
  margin:0 auto;
  display:flex;
  flex-direction:column;
  background-color:var(--panel-bg);
  border:1px solid var(--panel-border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lift);
  transition:background-color var(--transition-fast),border-color var(--transition-fast),box-shadow var(--transition-fast);
  position:relative;
  overflow:hidden;
}
@supports (height: 100dvh){
  body[data-view="publisher"] .app-container {
    min-height:calc(100dvh - max(var(--space-6), var(--safe-top)) - max(var(--space-6), var(--safe-bottom)));
    height:calc(100dvh - max(var(--space-6), var(--safe-top)) - max(var(--space-6), var(--safe-bottom)));
  }
}
body[data-view="publisher"] .content-wrapper {width:100%;max-width:var(--content-width);margin:0 auto;padding:0 var(--space-6)}
body[data-view="publisher"] .veravox-site-nav {
  display:flex;align-items:center;gap:12px;flex:0 0 auto;
  padding:8px var(--space-6);border-bottom:1px solid var(--panel-border);
  background:var(--panel-bg-light);position:relative;z-index:50;
}
body[data-view="publisher"] .veravox-site-nav__brand {
  display:inline-flex;align-items:center;gap:8px;color:var(--text-primary);
  text-decoration:none;font-size:.98rem;font-weight:700;white-space:nowrap;
}
body[data-view="publisher"] .veravox-site-nav__brand img {width:28px;height:28px;object-fit:contain}
.veravox-site-nav__preview:not([hidden]) {
  display: block;
  color: var(--text-secondary);
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.2;
}
.veravox-site-nav__preview-name {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text-secondary);
  font-size: .8rem;
  overflow-wrap: anywhere;
}
body[data-view="publisher"] .veravox-site-nav__links {display:flex;align-items:center;gap:6px;margin-left:auto}
body[data-view="publisher"] .veravox-site-nav__link {
  display:inline-flex;align-items:center;justify-content:center;min-height:34px;
  padding:7px 11px;border-radius:999px;color:var(--text-secondary);text-decoration:none;
  font-size:.84rem;font-weight:700;border:1px solid transparent;white-space:nowrap;
}
body[data-view="publisher"] .veravox-site-nav__link:hover {
  color:var(--brand-accent-strong);border-color:var(--brand-accent-soft);background:var(--panel-bg);
}
body[data-view="publisher"] .veravox-site-nav__account {position:relative;flex:0 0 auto}
body[data-view="publisher"] .veravox-site-nav__account summary {
  list-style:none;display:inline-flex;align-items:center;gap:8px;min-height:34px;
  padding:5px 8px 5px 5px;border:1px solid var(--panel-border);border-radius:999px;
  color:var(--text-primary);background:rgba(15,23,42,.04);cursor:pointer;font-size:.84rem;font-weight:700;
}
body[data-view="publisher"] .veravox-site-nav__account summary::-webkit-details-marker {display:none}
body[data-view="publisher"] .veravox-site-nav__avatar {
  width:24px;height:24px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;
  background:rgba(37,181,212,.14);color:var(--brand-accent-strong);font-size:.78rem;font-weight:700;
  overflow:hidden;
}
body[data-view="publisher"] .veravox-site-nav__avatar img {width:100%;height:100%;object-fit:cover;display:block}
body[data-view="publisher"] .veravox-site-nav__avatar img[hidden], body[data-view="publisher"] .veravox-site-nav__avatar span[hidden] {display:none}
body[data-view="publisher"] .veravox-site-nav__account-label {
  max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
body[data-view="publisher"] .veravox-site-nav__menu {
  position:absolute;right:0;top:calc(100% + 12px);width:min(320px,88vw);
  padding:0;border:1px solid var(--panel-border);border-radius:16px;background:var(--panel-bg);
  box-shadow:0 18px 45px rgba(15,23,42,.14);display:flex;flex-direction:column;gap:0;z-index:90;
  overflow:visible;
}
body[data-view="publisher"] .veravox-site-nav__menu::before {
  content:"";position:absolute;right:28px;top:-9px;width:18px;height:18px;
  background:var(--panel-bg);border-left:1px solid var(--panel-border);border-top:1px solid var(--panel-border);
  transform:rotate(45deg);
}
body[data-view="publisher"] .veravox-site-nav__menu-link {
  position:relative;display:flex;align-items:center;gap:16px;color:var(--text-primary);
  text-decoration:none;font-size:1rem;font-weight:700;line-height:1.2;padding:18px 24px;
}
body[data-view="publisher"] .veravox-site-nav__menu-link:first-of-type {border-top-left-radius:16px;border-top-right-radius:16px}
body[data-view="publisher"] .veravox-site-nav__menu-link:last-child {border-bottom-left-radius:16px;border-bottom-right-radius:16px}
body[data-view="publisher"] .veravox-site-nav__menu-link:hover {background:var(--panel-bg-light);color:var(--brand-accent-strong)}
body[data-view="publisher"] .veravox-site-nav__menu-link i {
  width:20px;text-align:center;color:var(--text-secondary);font-size:1.1rem;transition:color .2s ease;
}
body[data-view="publisher"] .veravox-site-nav__menu-link:hover i {color:var(--brand-accent-strong)}
body[data-view="publisher"] .veravox-site-nav__menu-divider {height:1px;background:var(--panel-border);margin:0}
body[data-view="publisher"] .veravox-site-nav__menu-link-mobile {display:none}
body[data-view="publisher"] .veravox-site-nav__identity {
  padding:14px 24px 12px;border-bottom:1px solid var(--panel-border);margin-bottom:0;
  display:flex;flex-direction:column;gap:2px;color:var(--text-secondary);font-size:.75rem;
}
body[data-view="publisher"] .veravox-site-nav__identity strong {
  color:var(--text-primary);font-size:.84rem;overflow-wrap:break-word;font-weight:700;
}
body[data-view="publisher"] .publisher-header {padding:12px 0;border-bottom:1px solid var(--panel-border);background:var(--panel-bg-light);transition:background-color var(--transition-fast),border-color var(--transition-fast)}
body[data-view="publisher"] .header-content {--header-tile-height:72px;--header-tile-radius:12px;display:grid;grid-template-columns:max-content max-content;grid-template-areas:"controls metrics";align-items:center;justify-content:center;gap:var(--space-4);flex-wrap:nowrap;position:relative}
body[data-view="publisher"] .header-content > * {min-width:0}
body[data-view="publisher"] .session-controls {grid-area:controls;display:flex;align-items:center;justify-content:flex-start;gap:var(--space-3);flex-wrap:nowrap;min-width:0}
body[data-view="publisher"] .session-controls .btn {
  min-height:var(--header-tile-height);
  height:var(--header-tile-height);
  border-radius:var(--header-tile-radius);
}
body[data-view="publisher"] .header-info {
  grid-area:metrics;
  display:grid;
  align-items:stretch;
  gap:10px;
  justify-content:end;
  justify-self:end;
  width:max-content;
  max-width:100%;
  grid-template-columns:minmax(150px,180px) minmax(112px,124px) minmax(104px,112px) minmax(190px,240px) minmax(96px,108px) 36px;
  grid-template-areas:"status listeners usage alias delay theme";
  min-width:0;
  padding:6px;
  border:1px solid var(--panel-border);
  border-radius:14px;
  background:var(--panel-bg);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.28);
}
@media (min-width:769px){
  body[data-view="publisher"] .header-info #capture-state {
    grid-area:status;
    max-width:none;
  }
}
body[data-view="publisher"] #capture-state {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 16px;
  font-weight:700;
  font-size:.83rem;
  text-align:center;
  border-radius:var(--header-tile-radius);
  line-height:1.25;
  height:var(--header-tile-height);
  min-height:var(--header-tile-height);
  min-width:180px;
  max-width:260px;
  white-space:normal;
  overflow-wrap:break-word;
  hyphens:auto;
  overflow:hidden;
  transition:background-color .3s ease,color .3s ease,border-color .2s ease;
  color:var(--status-idle-text);
  background-color:rgba(147,197,253,.85);
  background-image:linear-gradient(180deg,rgba(147,197,253,.85),rgba(147,197,253,.68));
  border:1px solid rgba(30,64,175,.25);
  box-shadow:0 1px 2px rgba(0,0,0,.06);
}
body[data-view="publisher"] #capture-state.ok {
  color:var(--status-ok-text);
  background-color:rgba(74,222,128,.9);
  background-image:linear-gradient(180deg,rgba(74,222,128,.9),rgba(74,222,128,.72));
  border-color:rgba(21,128,61,.28);
}
body[data-view="publisher"] #capture-state.err {
  color:var(--status-err-text);
  background-color:rgba(248,113,113,.92);
  background-image:linear-gradient(180deg,rgba(248,113,113,.92),rgba(248,113,113,.75));
  border-color:rgba(185,28,28,.26);
}
body[data-view="publisher"] .quick-guide {
  position:relative;
  border-bottom:1px solid var(--panel-border);
  background:var(--panel-bg-light);
}
body[data-view="publisher"] .quick-guide.is-dismissed {
  display:none;
}
body[data-view="publisher"] .quick-guide__inner {
  display:grid;
  grid-template-columns:minmax(220px,.9fr) minmax(0,1.8fr);
  gap:var(--space-4);
  align-items:center;
  padding:12px calc(var(--space-6) + 44px) 12px var(--space-6);
}
body[data-view="publisher"] .quick-guide__text {
  margin:0;
  font-size:.88rem;
  color:var(--text-secondary);
  line-height:1.45;
  min-width:0;
}
body[data-view="publisher"] .quick-guide__text strong {color:var(--text-primary);}
body[data-view="publisher"] .quick-guide__dismiss {
  position:absolute;
  top:10px;
  right:12px;
  width:32px;
  height:32px;
  display:inline-grid;
  place-items:center;
  border:1px solid var(--panel-border);
  border-radius:999px;
  background:var(--panel-bg);
  color:var(--text-secondary);
  font-weight:700;
  font-size:.82rem;
  line-height:1;
  cursor:pointer;
  transition:background-color var(--transition-fast),color var(--transition-fast),border-color var(--transition-fast);
}
body[data-view="publisher"] .quick-guide__dismiss:hover {
  color:var(--text-primary);
  border-color:var(--brand-accent);
  background:var(--panel-bg-light);
}
body[data-view="publisher"] .setup-checklist {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:8px;
  min-width:0;
}
body[data-view="publisher"] .setup-step {
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
  padding:8px 10px;
  border:1px solid var(--panel-border);
  border-radius:10px;
  background:var(--panel-bg);
  color:var(--text-secondary);
  font-size:.76rem;
  font-weight:700;
  line-height:1.25;
}
body[data-view="publisher"] .setup-step__dot {
  flex:0 0 auto;
  width:9px;
  height:9px;
  border-radius:999px;
  background:var(--text-tertiary);
  box-shadow:0 0 0 3px rgba(148,163,184,.14);
}
body[data-view="publisher"] .setup-step__label {
  min-width:0;
  overflow-wrap:break-word;
  hyphens:auto;
  white-space:normal;
}
body[data-view="publisher"] .setup-step[data-state="active"] .setup-step__dot {background:#0ea5e9;box-shadow:0 0 0 3px rgba(14,165,233,.16)}
body[data-view="publisher"] .setup-step[data-state="done"] {color:var(--text-primary)}
body[data-view="publisher"] .setup-step[data-state="done"] .setup-step__dot {background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.16)}
body[data-view="publisher"] .setup-step[data-state="error"] {color:var(--status-err-text)}
body[data-view="publisher"] .setup-step[data-state="error"] .setup-step__dot {background:#ef4444;box-shadow:0 0 0 3px rgba(239,68,68,.16)}
body[data-view="publisher"] .tabs-container {border-bottom:1px solid var(--panel-border);transition:border-color var(--transition-fast)}
body[data-view="publisher"] .tabs {display:grid;grid-template-columns:repeat(3,1fr);padding:0}
body[data-view="publisher"] .tab-btn {
  position:relative;
  flex-grow:1;text-align:center;padding:14px 0;margin:0;border-bottom:2px solid transparent;cursor:pointer;font-weight:600;font-size:.9rem;color:var(--text-secondary);
  transition:color var(--transition-fast),border-color var(--transition-fast),background-color var(--transition-fast);background:transparent;border-top:none;border-left:none;border-right:none
}
body[data-view="publisher"] .tab-btn:hover:not(.active) {color:var(--text-primary);background-color:var(--panel-bg-light)}
body[data-view="publisher"] .tab-btn.active {border-color:var(--brand-accent);color:var(--text-primary)}
body[data-view="publisher"] .main-content {flex:1 1 auto;min-height:0;overflow-y:auto;padding:var(--space-8) 0;background-color:var(--panel-bg)}
body[data-view="publisher"] #ready-state-hero {display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--text-secondary);padding:var(--space-6) 0}
body[data-view="publisher"] .ready-state-icon {width:220px;max-width:100%;margin-bottom:var(--space-6);height:120px}
body[data-view="publisher"] .ready-state-icon .mic-icon {
  fill: var(--text-tertiary);
  animation: pulse 2.5s ease-in-out infinite;
}
body[data-view="publisher"] .ready-state-icon .doc-icon {
  fill: var(--text-tertiary);
}
body[data-view="publisher"] .ready-state-icon .arrows {
  fill: none;
  stroke: var(--brand-accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: dash 2.5s ease-in-out infinite;
}
body[data-view="publisher"] .ready-state-icon .text-line {
  stroke: var(--brand-accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  transform-origin: 0 50%;
  animation: write 2.5s ease-in-out infinite;
}
body[data-view="publisher"] .ready-state-icon .line-2 { animation-delay: -2.3s; }
body[data-view="publisher"] .ready-state-icon .line-3 { animation-delay: -2.1s; }
@keyframes pulse {
  50% { opacity: 0.7; transform: scale(0.98); }
}
@keyframes dash {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}
@keyframes write {
  0% { transform: scaleX(0); opacity: 0; }
  20%, 80% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}
body[data-view="publisher"] .ready-state-info {text-align:center;padding:var(--space-8) 0;margin-top:var(--space-6);border-top:1px solid var(--panel-border)}
body[data-view="publisher"] .ready-state-info h4 {color:var(--text-secondary);font-weight:600;font-size:1rem;margin:0 0 var(--space-6) 0}
body[data-view="publisher"] .info-cards-grid {display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-6)}
body[data-view="publisher"] .info-card {background-color:var(--panel-bg-light);border-radius:var(--radius-lg);padding:var(--space-6);text-align:left;border:1px solid transparent}
body[data-view="publisher"] .info-card__icon {display:flex;align-items:center;justify-content:center;width:40px;height:40px;background-color:var(--panel-bg);color:var(--brand-accent);border-radius:var(--radius-md);margin-bottom:var(--space-4)}
body[data-view="publisher"] .info-card__icon svg {width:24px;height:24px}
body[data-view="publisher"] .info-card__title {font-size:1rem;font-weight:600;color:var(--text-primary);margin:0 0 var(--space-3) 0}
body[data-view="publisher"] .info-card p {font-size:.9rem;color:var(--text-secondary);line-height:1.6;margin:0}
body[data-view="publisher"] .btn {
  position:relative;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:12px 28px;font-size:.95rem;font-weight:600;border-radius:var(--radius-md);
  color:var(--text-inverse);border:none;box-shadow:var(--shadow-soft);transition:all var(--transition-fast);
  background-image:linear-gradient(145deg,var(--brand-accent) 0%,#15b1d0 100%)
}
body[data-view="publisher"] .btn:hover:not(:disabled) {box-shadow:none;filter:brightness(1.05)}
body[data-view="publisher"] .btn:focus-visible {outline:3px solid var(--vv-focus);outline-offset:3px;box-shadow:none}
body[data-view="publisher"] .btn:disabled {cursor:not-allowed;box-shadow:none;filter:none}
body[data-view="publisher"] .btn.secondary {background:var(--panel-bg-light);background-image:none;color:var(--text-primary);border:1px solid var(--panel-border)}
body[data-view="publisher"] .btn.secondary:hover:not(:disabled) {background-color:var(--panel-border)}
body[data-view="publisher"] .btn.secondary:disabled {background-color:var(--panel-bg-light);color:var(--text-tertiary);opacity:1}
body[data-view="publisher"] .btn.danger {background-image:linear-gradient(145deg,var(--brand-danger) 0%,#f43f5e 100%);color:#fff}
body[data-view="publisher"] .btn.danger:hover:not(:disabled) {background:var(--brand-danger-strong);filter:brightness(1.05)}
body[data-view="publisher"] .btn-icon {width:18px;height:18px}
body[data-view="publisher"] .settings-title {
  margin:0 0 var(--space-4);
  text-align:center;
}
@media (max-width: 1320px) {
  body[data-view="publisher"] .session-controls .btn-text {
    display: none;
  }
  body[data-view="publisher"] .session-controls .btn {
    width:var(--header-tile-height);
    height:var(--header-tile-height);
    padding:0;
    border-radius:var(--header-tile-radius);
  }
}
@media (max-width:1180px){
  body[data-view="publisher"] .header-content {
    grid-template-columns:max-content max-content;
    grid-template-areas:"controls metrics";
  }
  body[data-view="publisher"] .session-controls {
    justify-content:flex-start;
  }
  body[data-view="publisher"] .header-info {
    grid-template-columns:minmax(132px,160px) minmax(104px,112px) minmax(96px,104px) minmax(170px,220px) minmax(92px,100px) 36px;
  }
  body[data-view="publisher"] .header-info #capture-state {
    min-width:0;
  }
  body[data-view="publisher"] .header-info .info-metric {
    min-width:0;
  }
}
@media (max-width:980px){
  body[data-view="publisher"] .header-content {
    grid-template-columns:max-content minmax(0,1fr);
    justify-content:stretch;
  }
  body[data-view="publisher"] .header-info {
    width:100%;
  }
}
@media (max-width:880px){
  body[data-view="publisher"] .header-content {
    --header-tile-height:72px;
    grid-template-columns:1fr;
    grid-template-areas:
      "controls"
      "metrics";
    gap:var(--space-4);
  }
  body[data-view="publisher"] .session-controls {order:1;justify-content:center}
  body[data-view="publisher"] .header-info {
	    order:2;width:100%;
	    max-width:none;
	    display:grid;
	    grid-template-columns:minmax(140px,180px) minmax(112px,132px) minmax(112px,132px) minmax(220px,1fr) minmax(104px,120px) 36px;
	    grid-template-areas:
	      "status listeners usage alias delay theme";
    align-items:stretch;
    justify-content:stretch;
    column-gap:var(--space-3);
    row-gap:0;
  }
  body[data-view="publisher"] .header-info #capture-state {
    grid-area:status;
    justify-self:stretch;
    max-width:none;
    min-width:0;
  }
  body[data-view="publisher"] .header-info .info-metric {
    flex:none;
    align-items:center;
    text-align:center;
    width:100%;
  }
  body[data-view="publisher"] .header-info .usage-popover {
    right:auto;
    left:0;
  }
}
@media (max-width:768px){
  body[data-view="publisher"] {padding:0;padding-top:var(--safe-top);padding-bottom:var(--safe-bottom)}
  body[data-view="publisher"] .app-container {
    border-radius:0;
    border:none;
    min-height:calc(100vh - var(--safe-top) - var(--safe-bottom));
    height:calc(100vh - var(--safe-top) - var(--safe-bottom));
  }
  @supports (height: 100dvh){
    body[data-view="publisher"] .app-container {
      min-height:calc(100dvh - var(--safe-top) - var(--safe-bottom));
      height:calc(100dvh - var(--safe-top) - var(--safe-bottom));
    }
  }
  body[data-view="publisher"] .veravox-site-nav {
    padding:8px var(--space-4);
    flex-wrap:nowrap;
    min-height:52px;
  }
  body[data-view="publisher"] .veravox-site-nav__links {
    display:none;
  }
  body[data-view="publisher"] .veravox-site-nav__account {
    margin-left:auto;
  }
  body[data-view="publisher"] .veravox-site-nav__account summary {
    width:40px;
    height:40px;
    min-height:40px;
    padding:0;
    justify-content:center;
  }
  body[data-view="publisher"] .veravox-site-nav__avatar {
    width:32px;
    height:32px;
    font-size:.86rem;
  }
  body[data-view="publisher"] .veravox-site-nav__account-label {
    display:none;
  }
  body[data-view="publisher"] .veravox-site-nav__menu-link-mobile {
    display:block;
  }
  body[data-view="publisher"] .content-wrapper {padding:0 var(--space-4)}
  body[data-view="publisher"] .publisher-header {padding:8px 0}
  body[data-view="publisher"] .header-content {--header-tile-height:60px;grid-template-columns:1fr;gap:8px}
  body[data-view="publisher"] .header-info {
    order:3;
    width:100%;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
	    grid-template-areas:
	      "status status"
	      "listeners usage"
	      "alias delay";
    gap:6px;
    justify-content:stretch;
    padding:0;
    border:none;
    background:transparent;
    box-shadow:none;
  }
  body[data-view="publisher"] .header-info .info-metric {
    align-items:flex-start;
    text-align:left;
    min-height:var(--header-tile-height);
    padding:8px 10px;
    border-radius:12px;
    background:var(--panel-bg-light);
  }
  body[data-view="publisher"] .header-info #capture-state {
    grid-area:status;
    max-width:none;
    justify-self:stretch;
    height:var(--header-tile-height);
    min-height:var(--header-tile-height);
  }
  body[data-view="publisher"] .header-info .session-link-value {
    max-width:100%;
    width:100%;
    justify-content:space-between;
  }
  body[data-view="publisher"] .session-controls {
    order:2;
    flex-wrap:nowrap;
    justify-content:center;
    gap:10px;
  }
  body[data-view="publisher"] #capture-state {max-width:100%;font-size:.8rem;padding:8px 12px}
  body[data-view="publisher"] .quick-guide {display:none}
  body[data-view="publisher"] .tabs {display:flex}
  body[data-view="publisher"] .tab-btn {flex-grow:1}
  body[data-view="publisher"] .tab-btn {padding:10px 0;font-size:.86rem}
  body[data-view="publisher"] .main-content {padding:10px 0}
  body[data-view="publisher"] #ready-state-hero {padding:10px 0}
  body[data-view="publisher"] .ready-state-icon {width:150px;height:82px;margin-bottom:10px}
  body[data-view="publisher"] #ready-state-hero h3 {font-size:1rem;margin:4px 0}
  body[data-view="publisher"] #ready-state-hero p {font-size:.86rem;margin:4px 0}
  body[data-view="publisher"] .ready-state-info {display:none}
  body[data-view="publisher"] .info-cards-grid {grid-template-columns:1fr}
  body[data-view="publisher"] .btn .btn-text {display:none}
  body[data-view="publisher"] .session-controls .btn {width:var(--header-tile-height);height:var(--header-tile-height);padding:0;border-radius:var(--header-tile-radius)}
}
@media (orientation:landscape) and (max-height:520px) and (max-width:980px){
  body[data-view="publisher"] {padding:0;padding-top:var(--safe-top);padding-bottom:var(--safe-bottom)}
  body[data-view="publisher"] .app-container {
    border-radius:0;
    border:none;
    min-height:calc(100vh - var(--safe-top) - var(--safe-bottom));
    height:calc(100vh - var(--safe-top) - var(--safe-bottom));
  }
  @supports (height:100dvh){
    body[data-view="publisher"] .app-container {
      min-height:calc(100dvh - var(--safe-top) - var(--safe-bottom));
      height:calc(100dvh - var(--safe-top) - var(--safe-bottom));
    }
  }
  body[data-view="publisher"] .veravox-site-nav {
    padding:6px 12px;
    min-height:44px;
    flex-wrap:nowrap;
  }
  body[data-view="publisher"] .veravox-site-nav__links {display:none}
  body[data-view="publisher"] .veravox-site-nav__account {margin-left:auto}
  body[data-view="publisher"] .veravox-site-nav__account summary {width:38px;height:38px;min-height:38px;padding:0;justify-content:center}
  body[data-view="publisher"] .veravox-site-nav__avatar {width:30px;height:30px;font-size:.82rem}
  body[data-view="publisher"] .veravox-site-nav__account-label {display:none}
  body[data-view="publisher"] .veravox-site-nav__menu-link-mobile {display:block}
  body[data-view="publisher"] .content-wrapper {padding:0 10px}
  body[data-view="publisher"] .publisher-header {padding:6px 0}
  body[data-view="publisher"] .header-content {
    --header-tile-height:52px;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:8px;
  }
  body[data-view="publisher"] .session-controls {
    flex:0 0 auto;
    order:0;
    width:auto;
    justify-content:flex-start;
    gap:8px;
  }
  body[data-view="publisher"] .session-controls .btn {
    width:var(--header-tile-height);
    height:var(--header-tile-height);
    padding:0;
    border-radius:var(--header-tile-radius);
  }
  body[data-view="publisher"] .session-controls .btn-text {display:none}
  body[data-view="publisher"] .header-info {
    order:0;
    flex:1 1 auto;
    width:auto;
    max-width:none;
    min-width:0;
    display:flex;
    align-items:stretch;
    gap:6px;
    padding:4px;
    border-radius:12px;
    overflow-x:auto;
    scrollbar-width:none;
  }
  body[data-view="publisher"] .header-info::-webkit-scrollbar {display:none}
  body[data-view="publisher"] .header-info #capture-state {
    flex:0 0 clamp(180px,26vw,220px);
    min-width:180px;
    min-height:var(--header-tile-height);
    height:var(--header-tile-height);
    max-width:none;
    padding:6px 10px;
    font-size:.76rem;
    line-height:1.18;
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    overflow-wrap:break-word;
  }
  body[data-view="publisher"] .header-info .info-metric {
    flex:0 0 96px;
    width:auto;
    min-width:0;
    min-height:var(--header-tile-height);
    padding:6px 8px;
    align-items:center;
    text-align:center;
    border-radius:10px;
  }
  body[data-view="publisher"] .quick-guide {display:none}
  body[data-view="publisher"] .tab-btn {padding:8px 0;font-size:.84rem}
  body[data-view="publisher"] .main-content {padding:8px 0}
  body[data-view="publisher"] #ready-state-hero {padding:8px 0}
  body[data-view="publisher"] .ready-state-icon {width:120px;height:64px;margin-bottom:6px}
  body[data-view="publisher"] #ready-state-hero h3 {font-size:.95rem;margin:3px 0}
  body[data-view="publisher"] #ready-state-hero p {font-size:.82rem;margin:3px 0}
  body[data-view="publisher"] .ready-state-info {display:none}
}
@media (max-width:560px){
  body[data-view="publisher"] .content-wrapper {padding:0 var(--space-4)}
  body[data-view="publisher"] .header-info {
	    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
	  }
  body[data-view="publisher"] .setup-checklist {grid-template-columns:1fr}
}
body[data-view="publisher"] {overflow-x:hidden}
body[data-view="publisher"] .content-wrapper {max-width:100%}
body[data-view="listener"] {
  --bg-base:#f3f4f6;--panel-bg:#fff;--panel-bg-light:#f9fafb;--panel-border:#e5e7eb;
  --brand-accent:#0891b2;--brand-accent-strong:#0e7490;
  --text-primary:#111827;--text-secondary:#4b5563;--text-tertiary:#9ca3af;--text-inverse:#fff;
  --status-ok-text:#14532d;--status-ok-bg:rgba(74,222,128,.8);
  --status-err-text:#991b1b;--status-err-bg:rgba(248,113,113,.8);
  --status-idle-text:#1e40af;--status-idle-bg:rgba(147,197,253,.8);
  --shadow-soft:0 1px 3px 0 rgba(0,0,0,.07),0 1px 2px -1px rgba(0,0,0,.07);
  --shadow-lift:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);
  --radius-md:10px;--radius-lg:16px;
  --space-sm:8px;--space-md:16px;--space-lg:24px;
  --font-family-sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --transition-fast:all .2s cubic-bezier(.4,0,.2,1);
  --transition-smooth:all .5s cubic-bezier(.25,.8,.25,1);
  --content-width:1200px;
  --safe-top:env(safe-area-inset-top, 0px);
  --safe-bottom:env(safe-area-inset-bottom, 0px);
  --telepad-top:var(--space-lg);
  --telepad-bottom:var(--space-lg);
}
body[data-view="listener"] {
  margin:0;font-family:var(--font-family-sans);font-size:1rem;font-weight:400;line-height:1.5;color:var(--text-primary);
  background-color:var(--bg-base);padding:var(--space-md);
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  transition:background-color var(--transition-fast);
  padding-top:max(var(--space-md), var(--safe-top));
  padding-bottom:max(var(--space-md), var(--safe-bottom));
  min-height:100vh;
  min-height:100dvh;
}
body[data-view="listener"] .app-container {
  width:100%;
  max-width:var(--content-width);
  min-height:calc(100vh - max(var(--space-md), var(--safe-top)) - max(var(--space-md), var(--safe-bottom)));
  height:calc(100vh - max(var(--space-md), var(--safe-top)) - max(var(--space-md), var(--safe-bottom)));
  margin:0 auto;
  display:flex;
  flex-direction:column;
  background-color:var(--panel-bg);
  border:1px solid var(--panel-border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lift);
  overflow:hidden;
  transition:background-color var(--transition-fast),
             border-color var(--transition-fast),
             box-shadow var(--transition-fast);
  position: relative;
}
@supports (height: 100dvh){
  body[data-view="listener"] .app-container {
    min-height:calc(100dvh - max(var(--space-md), var(--safe-top)) - max(var(--space-md), var(--safe-bottom)));
    height:calc(100dvh - max(var(--space-md), var(--safe-top)) - max(var(--space-md), var(--safe-bottom)));
  }
}
body[data-view="listener"] .veravox-site-nav {
  display:flex;align-items:center;gap:12px;flex:0 0 auto;
  padding:8px var(--space-lg);border-bottom:1px solid var(--panel-border);
  background:var(--panel-bg-light);position:relative;z-index:50;
}
body[data-view="listener"] .veravox-site-nav__brand {
  display:inline-flex;align-items:center;gap:8px;color:var(--text-primary);
  text-decoration:none;font-size:.98rem;font-weight:700;white-space:nowrap;
}
body[data-view="listener"] .veravox-site-nav__brand img {width:28px;height:28px;object-fit:contain}
body[data-view="listener"] .veravox-site-nav__links {display:flex;align-items:center;gap:6px;margin-left:auto}
body[data-view="listener"] .veravox-site-nav__link {
  display:inline-flex;align-items:center;justify-content:center;min-height:34px;
  padding:7px 11px;border-radius:999px;color:var(--text-secondary);text-decoration:none;
  font-size:.84rem;font-weight:700;border:1px solid transparent;white-space:nowrap;
}
body[data-view="listener"] .veravox-site-nav__link:hover {
  color:var(--brand-accent-strong);border-color:var(--panel-border);background:var(--panel-bg);
}
body[data-view="listener"] .veravox-site-nav__account {position:relative;flex:0 0 auto}
body[data-view="listener"] .veravox-site-nav__account summary {
  list-style:none;display:inline-flex;align-items:center;gap:8px;min-height:34px;
  padding:5px 8px 5px 5px;border:1px solid var(--panel-border);border-radius:999px;
  color:var(--text-primary);background:rgba(15,23,42,.04);cursor:pointer;font-size:.84rem;font-weight:700;
}
body[data-view="listener"] .veravox-site-nav__account summary::-webkit-details-marker {display:none}
body[data-view="listener"] .veravox-site-nav__avatar {
  width:24px;height:24px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;
  background:rgba(37,181,212,.14);color:var(--brand-accent-strong);font-size:.78rem;font-weight:700;
  overflow:hidden;
}
body[data-view="listener"] .veravox-site-nav__avatar img {width:100%;height:100%;object-fit:cover;display:block}
body[data-view="listener"] .veravox-site-nav__avatar img[hidden], body[data-view="listener"] .veravox-site-nav__avatar span[hidden] {display:none}
body[data-view="listener"] .veravox-site-nav__account-label {
  max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
body[data-view="listener"] .veravox-site-nav__menu {
  position:absolute;right:0;top:calc(100% + 12px);width:min(320px,88vw);
  padding:0;border:1px solid var(--panel-border);border-radius:16px;background:var(--panel-bg);
  box-shadow:0 18px 45px rgba(15,23,42,.14);display:flex;flex-direction:column;gap:0;z-index:90;
  overflow:visible;
}
body[data-view="listener"] .veravox-site-nav__menu::before {
  content:"";position:absolute;right:28px;top:-9px;width:18px;height:18px;
  background:var(--panel-bg);border-left:1px solid var(--panel-border);border-top:1px solid var(--panel-border);
  transform:rotate(45deg);
}
body[data-view="listener"] .veravox-site-nav__menu-link {
  position:relative;display:flex;align-items:center;gap:16px;color:var(--text-primary);
  text-decoration:none;font-size:1rem;font-weight:700;line-height:1.2;padding:18px 24px;
}
body[data-view="listener"] .veravox-site-nav__menu-link:first-of-type {border-top-left-radius:16px;border-top-right-radius:16px}
body[data-view="listener"] .veravox-site-nav__menu-link:last-child {border-bottom-left-radius:16px;border-bottom-right-radius:16px}
body[data-view="listener"] .veravox-site-nav__menu-link:hover {background:var(--panel-bg-light);color:var(--brand-accent-strong)}
body[data-view="listener"] .veravox-site-nav__menu-link i {
  width:20px;text-align:center;color:var(--text-secondary);font-size:1.1rem;transition:color .2s ease;
}
body[data-view="listener"] .veravox-site-nav__menu-link:hover i {color:var(--brand-accent-strong)}
body[data-view="listener"] .veravox-site-nav__menu-divider {height:1px;background:var(--panel-border);margin:0}
body[data-view="listener"] .veravox-site-nav__menu-link-mobile {display:none}
body[data-view="listener"] .veravox-site-nav__identity {
  padding:14px 24px 12px;border-bottom:1px solid var(--panel-border);margin-bottom:0;
  display:flex;flex-direction:column;gap:2px;color:var(--text-secondary);font-size:.75rem;
}
body[data-view="listener"] .veravox-site-nav__identity strong {
  color:var(--text-primary);font-size:.84rem;overflow-wrap:break-word;font-weight:700;
}
body[data-view="listener"] .listener-header {
  padding:10px var(--space-lg);border-bottom:1px solid var(--panel-border);
  background:var(--panel-bg-light);transition:background-color var(--transition-fast),border-color var(--transition-fast);
  display:grid;grid-template-columns:minmax(220px,1fr) auto;align-items:center;gap:var(--space-md);flex-shrink:0;
  position:relative;
}
body[data-view="listener"] .listener-page-intro {min-width:0;}
body[data-view="listener"] .listener-page-intro h2 {
  margin:0;color:var(--text-primary);font-size:1.02rem;line-height:1.2;font-weight:700;
}
body[data-view="listener"] .listener-page-intro p {
  margin:4px 0 0;color:var(--text-secondary);font-size:.86rem;line-height:1.35;
}
body[data-view="listener"] .header-controls {
  display:grid;
  grid-template-columns:minmax(160px,220px) max-content max-content 36px;
  align-items:stretch;
  gap:12px;
  justify-content:end;
  min-width:0;
}
body[data-view="listener"] #play-state {
  display:inline-flex;align-items:center;justify-content:center;
  padding:6px 10px;font-weight:700;font-size:.75rem;text-align:center;border-radius:999px;line-height:1.3;min-height:30px;
  max-width:220px;white-space:normal;overflow-wrap:anywhere;word-break:break-word;
  transition:background-color .3s ease,color .3s ease;color:var(--status-idle-text);background:var(--status-idle-bg);border:1px solid rgba(0,0,0,.05)
}
body[data-view="listener"] #play-state.ok {color:var(--status-ok-text);background:var(--status-ok-bg)}
body[data-view="listener"] #play-state.err {color:var(--status-err-text);background:var(--status-err-bg)}
body[data-view="listener"] .audio-gate {
  position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  padding:24px;
  background:
    radial-gradient(circle at 50% 18%, rgba(16,122,190,.28), transparent 38%),
    linear-gradient(180deg, rgba(15,23,42,.78), rgba(15,23,42,.58));
  z-index:20;
  backdrop-filter:blur(9px) saturate(145%);
  -webkit-backdrop-filter:blur(9px) saturate(145%);
}
body[data-view="listener"] .audio-gate.hidden {display:none;}
body[data-view="listener"] .audio-gate__content {
  position:relative;
  overflow:hidden;
  width:min(430px, 100%);
  background:color-mix(in srgb, var(--panel-bg) 88%, transparent);
  border-radius:22px;
  padding:30px 30px 28px;
  text-align:center;
  box-shadow:0 34px 80px rgba(0,0,0,.34), 0 0 0 1px rgba(255,255,255,.08) inset;
  border:1px solid rgba(255,255,255,.18);
}
body[data-view="listener"] .audio-gate__content::before {
  content:"";
  position:absolute;
  inset:-45%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.4), transparent 34%),
    radial-gradient(circle at 66% 70%, rgba(16,122,190,.32), transparent 45%);
  filter:blur(42px);
  opacity:.7;
  pointer-events:none;
}
body[data-view="listener"] .audio-gate__icon, body[data-view="listener"] .audio-gate__content h3, body[data-view="listener"] .audio-gate__content p, body[data-view="listener"] .audio-gate__hint, body[data-view="listener"] .audio-gate__content button {
  position:relative;
  z-index:1;
}
body[data-view="listener"] .audio-gate__icon {
  width:58px;
  height:58px;
  margin:0 auto 16px;
  display:grid;
  place-items:center;
  border-radius:50%;
  color:#fff;
  background:linear-gradient(135deg, #0e7490, #0891b2);
  box-shadow:0 14px 32px rgba(8,145,178,.34);
  animation:audio-gate-pulse 2.4s ease-in-out infinite;
}
body[data-view="listener"] .audio-gate__icon svg {width:30px;height:30px;display:block}
body[data-view="listener"] .audio-gate__content h3 {
  margin:0 0 10px;
  font-size:clamp(1.35rem, 4vw, 1.75rem);
  line-height:1.08;
  letter-spacing:0;
}
body[data-view="listener"] .audio-gate__content p {
  margin:0 auto 18px;
  max-width:32ch;
  color:var(--text-secondary);
  font-size:1rem;
  line-height:1.5;
}
body[data-view="listener"] .audio-gate__content button {
  min-width:min(240px, 100%);
  min-height:48px;
  font-size:1rem;
  box-shadow:0 14px 28px rgba(8,145,178,.2);
}
body[data-view="listener"] .audio-gate__hint {
  display:block;
  margin-top:14px;
  color:var(--text-secondary);
  font-size:.82rem;
  line-height:1.35;
}
@keyframes audio-gate-pulse{
  0%,100%{transform:scale(1);box-shadow:0 14px 32px rgba(8,145,178,.28);}
  50%{transform:scale(1.04);box-shadow:0 18px 42px rgba(8,145,178,.42);}
}
body[data-view="listener"] .listener-join__content {
  position:relative;overflow:hidden;
  background:var(--panel-bg);padding:28px 30px;border-radius:18px;
  border:1px solid rgba(255,255,255,0.08);box-shadow:0 35px 65px rgba(0,0,0,0.45),0 0 40px rgba(16,122,190,0.35);
  max-width:min(420px,92vw);width:100%;text-align:center;
}
body[data-view="listener"] .listener-join__content::before {
  content:"";position:absolute;inset:-40%;
  background:
    radial-gradient(circle at 30% 20%,rgba(255,255,255,0.45),transparent 55%),
    radial-gradient(circle at 70% 80%,rgba(16,122,190,0.55),transparent 60%);
  filter:blur(45px);opacity:.85;z-index:0;pointer-events:none;
}
body[data-view="listener"] .listener-join__content::after {
  content:"";position:absolute;inset:0;border-radius:inherit;
  border:1px solid rgba(255,255,255,0.12);mix-blend-mode:screen;pointer-events:none;z-index:1;
}
body[data-view="listener"] .listener-join__content>* {position:relative;z-index:2;}
body[data-view="listener"] .listener-join__close {
  position:absolute;top:10px;right:10px;width:30px;height:30px;border-radius:50%;
  border:1px solid var(--panel-border);background:var(--panel-bg-light);color:var(--text-secondary);
  cursor:pointer;font-size:1rem;line-height:1;
}
body[data-view="listener"] .listener-join__close:hover {color:var(--text-primary);}
body[data-view="listener"] .listener-join__form {display:grid;grid-template-columns:1fr;gap:10px;margin-top:14px}
body[data-view="listener"] .listener-join__form input {
  width:100%;min-width:0;padding:11px 12px;border:1px solid rgba(255,255,255,0.2);border-radius:10px;
  background:rgba(0,0,0,0.08);color:var(--text-primary);box-shadow:inset 0 0 0 1px rgba(255,255,255,0.03);
  font-size:16px;
}
body[data-view="listener"] .listener-join__form input:focus {
  outline:none;border-color:var(--brand-accent);box-shadow:0 0 0 2px rgba(26,140,216,0.35);
}
body[data-view="listener"] .listener-join__submit {margin-top:0;padding:11px 18px;width:100%;justify-content:center;}
body[data-view="listener"] .listener-join__status {margin-top:8px;font-size:.85rem;color:var(--status-err-text);}
body[data-view="listener"] .listener-join__dismiss {
  margin-top:10px;background:none;border:none;color:var(--text-secondary);font-weight:600;cursor:pointer;
}
body[data-view="listener"] .listener-join__dismiss:hover {color:var(--text-primary);}
body[data-view="listener"] .listener-tabs {
  display:flex;gap:8px;align-items:center;flex-wrap:nowrap;padding:10px var(--space-lg);border-bottom:1px solid var(--panel-border);
  background:var(--panel-bg);flex-shrink:0;
}
body[data-view="listener"] .listener-tab {
  border:1px solid var(--panel-border);background:var(--panel-bg);color:var(--text-secondary);
  border-radius:999px;padding:8px 14px;font-size:.82rem;font-weight:600;cursor:pointer;min-width:0;
  transition:var(--transition-fast);
}
body[data-view="listener"] .listener-tab-join {
  margin-left:auto;
  background:var(--panel-bg);
  border-style:dashed;
  color:var(--brand-accent-strong);
}
body[data-view="listener"] .listener-tab-join:hover {
  background:rgba(16,122,190,.08);
  border-color:rgba(16,122,190,.35);
}
body[data-view="listener"] .listener-tab:hover {color:var(--text-primary);box-shadow:var(--shadow-soft);}
body[data-view="listener"] .listener-tab.active {
  background:rgba(16,122,190,.16);color:var(--brand-accent-strong);border-color:rgba(16,122,190,.35);
}
body[data-view="listener"] .main-content {
  flex-grow:1;overflow-y:auto;text-align:center;display:flex;flex-direction:column;scroll-behavior:smooth;
  scroll-padding-top:var(--safe-top);scroll-padding-bottom:var(--safe-bottom);
  padding-top:var(--safe-top);padding-bottom:var(--safe-bottom);
  overflow-anchor:none;
}
body[data-view="listener"] .empty-state {
  display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--text-secondary);
  padding:var(--space-lg);flex-grow:1
}
body[data-view="listener"] .empty-state-icon {width:100px;height:100px;margin-bottom:var(--space-lg);opacity:.5}
body[data-view="listener"] .empty-state h3 {color:var(--text-primary);margin-bottom:var(--space-sm)}
body[data-view="listener"] .stream-log {
  display:none;flex-direction:column;justify-content:flex-start;
  padding:0 var(--space-lg);
  overflow-anchor:none;
}
body[data-view="listener"] .stream-log::before, body[data-view="listener"] .stream-log::after {
  content:"";
  display:block;
  flex:0 0 auto;
}
body[data-view="listener"] .stream-log::before {height:var(--telepad-top)}
body[data-view="listener"] .stream-log::after {height:var(--telepad-bottom)}
body[data-view="listener"] .chunk {
  padding:var(--space-md) 0;border-bottom:1px solid transparent;margin:var(--space-lg) 0;
  opacity:.3;filter:blur(3px);transform:scale(.9);transition:var(--transition-smooth);overflow-anchor:none
}
body[data-view="listener"] .chunk.playing {opacity:1;filter:blur(0);transform:scale(1);border-bottom-color:var(--brand-accent)}
body[data-view="listener"] .chunk.skipped {opacity:.45;filter:none;transform:none;border-bottom-color:rgba(245,158,11,.4)}
body[data-view="listener"] .chunk.skipped .es, body[data-view="listener"] .chunk.skipped .en {text-decoration:line-through}
body[data-view="listener"] .chunk .es {font-weight:500;color:var(--text-primary);display:block;font-size:1.2rem;line-height:1.6;transition:var(--transition-smooth)}
body[data-view="listener"] .chunk .en {font-size:.9rem;color:var(--text-secondary);transition:var(--transition-smooth)}
body[data-view="listener"] .chunk.transmission-transcript .en {display:block;font-size:1.2rem;font-weight:500;line-height:1.6;color:var(--text-primary)}
body[data-view="listener"] .chunk.transmission-transcript .en.is-revealing::after {
  content:"";
  display:inline-block;
  width:.42ch;
  height:.92em;
  margin-left:2px;
  border-right:2px solid currentColor;
  transform:translateY(.12em);
  animation:transcriptCaretBlink 1s steps(1,end) infinite;
}
@media (prefers-reduced-motion: reduce){
  body[data-view="listener"] .chunk.transmission-transcript .en.is-revealing::after {animation:none;opacity:0}
}
body[data-view="listener"] .chunk.playing .es {font-size:2.2rem;font-weight:600;line-height:1.3}
body[data-view="listener"] .chunk.playing .en {font-size:1.1rem;opacity:.8}
body[data-view="listener"] .chunk.playing.transmission-transcript .en {font-size:2.2rem;font-weight:600;line-height:1.3;opacity:1;color:var(--text-primary)}
body[data-view="listener"] .btn {
  display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:12px 28px;font-size:.95rem;font-weight:600;border-radius:var(--radius-md);
  color:var(--text-primary);border:1px solid var(--panel-border);box-shadow:var(--shadow-soft);transition:all var(--transition-fast);
  background-color:var(--panel-bg-light);cursor:pointer;margin-top:var(--space-md)
}
body[data-view="listener"] .btn:hover {background-color:var(--panel-border);box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)}
@media (max-width:980px){
  body[data-view="listener"] {padding:12px}
  body[data-view="listener"] .app-container {
    max-width:100%;
    min-height:calc(100vh - 24px);
    height:calc(100vh - 24px);
  }
  @supports (height:100dvh){
    body[data-view="listener"] .app-container {
      min-height:calc(100dvh - 24px);
      height:calc(100dvh - 24px);
    }
  }
  body[data-view="listener"] .veravox-site-nav {
    padding:10px 16px;
  }
  body[data-view="listener"] .listener-header {padding:8px 16px;}
  body[data-view="listener"] .listener-header {
    grid-template-columns:1fr;
    align-items:start;
  }
  body[data-view="listener"] .header-controls {
    grid-template-columns:minmax(180px,1fr) max-content max-content 36px;
    grid-template-areas:
      "status publisher delay theme";
    align-items:stretch;
  }
  body[data-view="listener"] #play-state {grid-area:status}
  body[data-view="listener"] .listener-tabs {
    padding:10px 16px;
    justify-content:flex-start;
  }
  body[data-view="listener"] .listener-tab {text-align:center}
  body[data-view="listener"] .listener-tab-join {margin-left:0}
}
@media (max-width:768px){
  body[data-view="listener"] .veravox-site-nav {
    flex-wrap:nowrap;
  }
  body[data-view="listener"] .veravox-site-nav__links {
    display:none;
  }
  body[data-view="listener"] .veravox-site-nav__account {
    margin-left:auto;
  }
  body[data-view="listener"] .veravox-site-nav__account summary {
    width:40px;
    height:40px;
    min-height:40px;
    padding:0;
    justify-content:center;
  }
  body[data-view="listener"] .veravox-site-nav__avatar {
    width:32px;
    height:32px;
    font-size:.86rem;
  }
  body[data-view="listener"] .veravox-site-nav__account-label {
    display:none;
  }
  body[data-view="listener"] .veravox-site-nav__menu-link-mobile {
    display:block;
  }
}
@media (max-width:640px){
  body[data-view="listener"] {padding:0;padding-top:var(--safe-top);padding-bottom:var(--safe-bottom)}
  body[data-view="listener"] .app-container {
    border-radius:0;
    border:none;
    min-height:calc(100vh - var(--safe-top) - var(--safe-bottom));
    height:calc(100vh - var(--safe-top) - var(--safe-bottom));
  }
  @supports (height:100dvh){
    body[data-view="listener"] .app-container {
      min-height:calc(100dvh - var(--safe-top) - var(--safe-bottom));
      height:calc(100dvh - var(--safe-top) - var(--safe-bottom));
    }
  }
  body[data-view="listener"] .veravox-site-nav {
    padding:8px var(--space-md);
    flex-wrap:nowrap;
    min-height:52px;
  }
  body[data-view="listener"] .veravox-site-nav__links {
    display:none;
  }
  body[data-view="listener"] .veravox-site-nav__account {
    margin-left:auto;
  }
  body[data-view="listener"] .veravox-site-nav__account summary {
    width:40px;
    height:40px;
    min-height:40px;
    padding:0;
    justify-content:center;
  }
  body[data-view="listener"] .veravox-site-nav__avatar {
    width:32px;
    height:32px;
    font-size:.86rem;
  }
  body[data-view="listener"] .veravox-site-nav__account-label {
    display:none;
  }
  body[data-view="listener"] .veravox-site-nav__menu-link-mobile {
    display:block;
  }
  body[data-view="listener"] .listener-page-intro {
    display:none;
  }
  body[data-view="listener"] .listener-header {padding:8px var(--space-md)}
  body[data-view="listener"] .header-controls {
    width:100%;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;
    grid-template-areas:
      "status status theme"
      "publisher delay delay";
    align-items:start;
    gap:6px;
  }
  body[data-view="listener"] #play-state {
    grid-area:status;
    flex:1 1 100%;
    max-width:100%;
    min-height:36px;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  body[data-view="listener"] .listener-tabs {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
    padding:8px var(--space-md);
  }
  body[data-view="listener"] .listener-tab {
    padding:6px;
    text-align:center;
    font-size:.78rem;
    line-height:1.2;
  }
  body[data-view="listener"] .listener-tab-join {margin-left:0}
  body[data-view="listener"] .stream-log {padding-left:var(--space-md);padding-right:var(--space-md)}
  body[data-view="listener"] .chunk.playing .es {font-size:1.8rem}
  body[data-view="listener"] .chunk.playing .en {font-size:1rem}
  body[data-view="listener"] .chunk.playing.transmission-transcript .en {font-size:1.8rem}
}
@media (orientation:landscape) and (max-height:520px) and (max-width:980px){
  body[data-view="listener"] {padding:0;padding-top:var(--safe-top);padding-bottom:var(--safe-bottom)}
  body[data-view="listener"] .app-container {
    border-radius:0;
    border:none;
    min-height:calc(100vh - var(--safe-top) - var(--safe-bottom));
    height:calc(100vh - var(--safe-top) - var(--safe-bottom));
  }
  @supports (height:100dvh){
    body[data-view="listener"] .app-container {
      min-height:calc(100dvh - var(--safe-top) - var(--safe-bottom));
      height:calc(100dvh - var(--safe-top) - var(--safe-bottom));
    }
  }
  body[data-view="listener"] .veravox-site-nav {
    padding:6px 12px;
    min-height:44px;
    flex-wrap:nowrap;
  }
  body[data-view="listener"] .veravox-site-nav__links {display:none}
  body[data-view="listener"] .veravox-site-nav__account {margin-left:auto}
  body[data-view="listener"] .veravox-site-nav__account summary {width:38px;height:38px;min-height:38px;padding:0;justify-content:center}
  body[data-view="listener"] .veravox-site-nav__avatar {width:30px;height:30px;font-size:.82rem}
  body[data-view="listener"] .veravox-site-nav__account-label {display:none}
  body[data-view="listener"] .veravox-site-nav__menu-link-mobile {display:block}
  body[data-view="listener"] .listener-header {padding:6px 12px}
  body[data-view="listener"] .listener-page-intro {display:none}
  body[data-view="listener"] .header-controls {
    width:100%;
    display:grid;
    grid-template-columns:minmax(140px,1fr) minmax(120px,1fr) minmax(100px,120px) 36px;
    grid-template-areas:"status publisher delay theme";
    align-items:stretch;
    gap:8px;
  }
  body[data-view="listener"] .listener-tabs {padding:7px 12px;align-self:center}
  body[data-view="listener"] .listener-tab {padding:6px 9px}
  body[data-view="listener"] #play-state {
    grid-area:status;
    max-width:none;
    min-height:36px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  body[data-view="listener"] .listener-tabs {gap:8px}
  body[data-view="listener"] .listener-tab {padding:7px 10px;font-size:.78rem}
  body[data-view="listener"] .stream-log {padding:8px 12px}
}
@media (max-width:430px){
  body[data-view="listener"] .listener-join__content {
    max-width:100%;
    padding:22px 16px 18px;
    border-radius:18px;
  }
}

/* Bridge the pinned Classic layout to the 2.0 controller's existing states. */
body:is([data-view="publisher"], [data-view="listener"]) .app-container {
  box-sizing: border-box;
  overflow: auto;
  scrollbar-width: thin;
}

body:is([data-view="publisher"], [data-view="listener"]) .veravox-site-nav {
  justify-content: space-between;
}

.veravox-site-nav .veravox-site-nav__menu-link {
  min-height: 44px;
}

.veravox-site-nav #publisher-nav {
  display: grid;
}

.veravox-site-nav #return-to-saved-room {
  width: 100%;
  text-align: start;
  font-weight: 600;
}

body[data-view="publisher"] .app-container > main,
body[data-view="listener"] .app-container > main {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body[data-view="publisher"] #publisher,
body[data-view="listener"] #listener {
  display: block;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body[data-view="publisher"] #publisher :is(.publisher-stage, .publisher-workspace),
body[data-view="publisher"] #publisher[data-live-capture] :is(.publisher-stage, .publisher-workspace) {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

body[data-view="publisher"] #publisher-stream {
  padding-inline: clamp(16px, 2vw, 24px);
}

body[data-view="publisher"] #publisher-stream > .content-wrapper {
  box-sizing: border-box;
  padding: 0;
}

body[data-view="publisher"] .publisher-workspace {
  margin-inline: auto;
  width: min(100%, 52rem);
}

body[data-view="publisher"] #publisher[data-event-active] :is(#ready-state, .quick-guide) {
  display: none;
}

body[data-view="publisher"] #publisher:has(#start:not([hidden])) #publisher-heading:not([dir="auto"]) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  clip-path: inset(50%);
  overflow: hidden;
}

body[data-view="publisher"] #publisher-setup-note {
  margin: 0 auto;
  text-align: center;
}

body[data-view="publisher"] #publisher .header-content {
  width: auto;
}

body[data-view="publisher"] #publisher .header-info {
  grid-template-columns: minmax(150px, 180px);
  grid-template-areas: "status";
}

body[data-view="publisher"] #publisher #publisher-capture-actions {
  display: flex;
  width: auto;
  margin: 0;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

body[data-view="publisher"] #publisher #publisher-start-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

body[data-view="publisher"] #publisher :is(#start, #pause, #resume, #stop, #classic-idle-stop) {
  display: inline-flex;
  justify-content: center;
  padding: 12px 28px;
  min-width: 0;
  max-width: 100%;
  font-size: .95rem;
}

body[data-view="publisher"] #publisher #start {
  background-image: linear-gradient(145deg, var(--brand-accent) 0%, #15b1d0 100%);
  border-color: transparent;
}

body[data-view="publisher"] #publisher #stop:not([data-buffer-recovery]):enabled,
body[data-view="publisher"] #publisher #classic-idle-stop {
  border-color: transparent;
  background-image: linear-gradient(145deg, var(--brand-danger) 0%, #f43f5e 100%);
  color: #fff;
}

body[data-view="publisher"] #publisher :is(#start, #pause, #resume, #stop, #classic-idle-stop)::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
  clip-path: polygon(22% 22%, 22% 78%, 78% 50%);
}

body[data-view="publisher"] #publisher :is(#stop, #classic-idle-stop)::before {
  clip-path: inset(22%);
}

body[data-view="publisher"] #publisher #pause::before {
  clip-path: polygon(22% 22%, 38% 22%, 38% 78%, 22% 78%, 22% 22%, 62% 22%, 78% 22%, 78% 78%, 62% 78%, 62% 22%);
}

body[data-view="publisher"] #publisher:has(#stop:not([hidden])) #classic-idle-stop,
body[data-view="publisher"] #publisher:has(#start[hidden]) #classic-idle-stop {
  display: none;
}

body[data-view="publisher"] #publisher #capture-state {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  min-height: var(--header-tile-height);
  max-width: none;
  width: auto;
  margin: 0;
  padding: .4rem .6rem;
  border-radius: var(--header-tile-radius);
  color: var(--status-idle-text);
  background: var(--status-idle-bg);
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
}

body[data-view="publisher"] #publisher #capture-state[data-tone="recording"] {
  color: var(--status-ok-text);
  background: var(--status-ok-bg);
}

body[data-view="publisher"] #publisher #capture-state[data-tone="attention"] {
  color: var(--status-err-text);
  background: var(--status-err-bg);
}

body[data-view="publisher"] #publisher #capture-state::before,
body[data-view="listener"] #listener #play-state::before {
  content: none;
}

body[data-view="publisher"] #publisher .tab-btn {
  text-decoration: none;
}

body[data-view="publisher"] #publisher .tab-btn[aria-selected="true"] {
  border-color: var(--brand-accent);
  color: var(--text-primary);
}

body[data-view="publisher"] #publisher .setup-checklist {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-view="publisher"] :is(#share-room, #listener, #account-archive) {
  box-sizing: border-box;
  width: min(100% - 32px, 52rem);
  margin: 16px auto;
}

body[data-view="publisher"] #listener .listener-header {
  display: block;
}

body[data-view="publisher"] #listener .listener-tabs {
  display: none;
}

body[data-view="publisher"] #listener .audio-gate__icon {
  display: none;
}

body[data-view="listener"] #listener .listener-intro {
  padding: 0;
  background: transparent;
}

body[data-view="listener"] #listener .listener-title {
  display: flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
}

body[data-view="listener"] #listener #listener-heading {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: normal;
}

body[data-view="listener"] #listener .header-controls {
  grid-template-columns: minmax(160px, 220px);
}

body[data-view="listener"] #listener #play-state {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  margin: 0;
  min-height: 54px;
  padding: 6px 10px;
  font-size: .75rem;
  line-height: 1.3;
}

body[data-view="listener"] #listener #play-state:empty {
  visibility: hidden;
}

body[data-view="listener"] #listener #play-state[data-state="ready"] {
  color: var(--status-ok-text);
  background: var(--status-ok-bg);
}

body[data-view="listener"] #listener .listener-tab {
  min-height: 32px;
}

body[data-view="listener"] #listener #switch-listener-room {
  justify-content: center;
  border-radius: 999px;
}

body[data-view="listener"] #listener .listener-transcript {
  box-sizing: border-box;
  padding-inline: var(--space-lg);
  text-align: center;
}

body[data-view="listener"] #listener .listener-transcript:has(#meaning:empty):not(:has(#caption-reader[role="region"])) {
  display: none;
}

body[data-view="listener"] #listener .chunk.playing {
  margin: var(--space-lg) 0;
}

body[data-view="listener"] #listener .chunk.playing #meaning {
  border-top: 0;
  max-width: none;
  font-size: clamp(1.25rem, 3.4vw, 2.25rem);
  font-weight: 600;
}

body[data-view="listener"] #listener .listener-join__content {
  box-sizing: border-box;
  width: min(100%, 32rem);
  margin: 24px auto;
}

body[data-view="listener"] #listener .listener-join__content h3 {
  grid-column: 1 / -1;
  margin: 0;
}

body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .audio-gate,
body[data-view="listener"] #listener:has(#selection[hidden]) .audio-gate {
  display: contents;
}

body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .audio-gate__icon {
  display: none;
}

body[data-view="listener"] #listener .audio-gate__content#selection {
  max-width: 100%;
  margin-inline: auto;
}

body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .audio-gate__content#selection {
  padding: min(30px, 5vw);
  border: 1px solid rgba(255, 255, 255, .18);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
}

body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .audio-gate__content#selection {
  overflow: visible;
  width: min(100%, 42rem);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .audio-gate__content#selection::before {
  display: none;
}

@media (max-width: 768px) {
  body[data-view="publisher"] #publisher .header-info {
    justify-self: stretch;
    width: 100%;
    grid-template-columns: 1fr;
  }

  body[data-view="publisher"] #publisher #publisher-capture-actions {
    justify-content: center;
  }

  body[data-view="publisher"] #publisher #capture-state {
    min-height: 42px;
  }

  body[data-view="listener"] #listener .listener-header {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-view="listener"] #listener .header-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-view="listener"] #listener #play-state {
    min-height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ready-state-icon :is(.mic-icon, .arrows, .text-line), .audio-gate__icon {
    animation: none;
  }
}

body[data-view="listener"] #listener :is(#selection, #listener-live-actions) {
  box-sizing: border-box;
  max-width: 100%;
}

body:is([data-view="publisher"], [data-view="listener"]) :is(
  .veravox-site-nav, .veravox-site-nav summary, .tab-btn, .listener-tab, .btn
) {
  box-sizing: border-box;
}

body[data-view="publisher"] #publisher {
  display: contents;
}

body[data-view="publisher"] #publisher .publisher-header {
  position: sticky;
  top: 0;
  z-index: 5;
}

body[data-view="publisher"] #publisher #publisher-start-actions {
  width: auto;
}

@media (min-width: 769px) {
  body[data-view="publisher"] #publisher .header-content {
    box-sizing: border-box;
    grid-template-columns: minmax(0, max-content) minmax(150px, 194px);
    grid-template-areas: "controls metrics";
    justify-content: start;
    padding-inline: clamp(24px, 4vw, 54px);
  }

  body[data-view="publisher"] #publisher #publisher-capture-actions {
    justify-content: flex-start;
  }

  body[data-view="publisher"] #publisher #publisher-capture-actions .btn {
    width: auto;
  }
}

body[data-view="publisher"] #publisher [id]:is(#publisher-stream, #publisher-settings, #publisher-save) {
  scroll-margin-block-start: 8rem;
}

body[data-view="publisher"] #publisher:has(#start:not([hidden])) #capture-state:empty::after {
  content: attr(data-ui-idle-label);
}

body[data-view="listener"] #listener .audio-gate__icon {
  grid-row: 1;
}

body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .audio-gate__content button {
  box-shadow: none;
}

@media (max-width: 768px) {
  body[data-view="publisher"] #publisher .publisher-header {
    position: static;
  }
}

@media (max-width: 480px) {
  body[data-view="publisher"] #publisher :is(#pause, #classic-idle-stop, #stop:not([data-buffer-recovery])) {
    padding: 0;
    width: var(--header-tile-height);
    font-size: 0;
  }

  body[data-view="publisher"] #publisher:has(#classic-idle-stop:not([hidden])) #start:not([aria-describedby]) {
    padding: 0;
    width: var(--header-tile-height);
    font-size: 0;
  }
}

/* In-room preference layout from the independent Classic Listener at 5304627c. */
body[data-view="listener"] #output-settings .listener-preferences {
  padding: var(--space-md) 20px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel-bg);
  text-align: start;
}

body[data-view="listener"] #output-settings .listener-preferences__choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

body[data-view="listener"] #output-settings .listener-preferences__choices label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .875rem;
  font-weight: 600;
  min-width: 0;
}

body[data-view="listener"] #output-settings .listener-preferences__choices select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--vv-control-border);
  border-radius: 8px;
  background: var(--panel-bg-light);
  color: var(--text-primary);
  font: inherit;
}

body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .listener-preferences__choices {
  grid-template-columns: minmax(0, 1fr);
}

body[data-view="publisher"] #publisher .publisher-workspace {
  box-sizing: border-box;
  width: min(100% - 32px, 52rem);
}

@media (max-width: 600px) {
  body[data-view="listener"] #output-settings .listener-preferences {
    padding: 18px 14px;
  }

  body[data-view="listener"] #output-settings .listener-preferences__choices {
    grid-template-columns: minmax(0, 1fr);
  }
}

#open-publisher-guide {
  min-height: 44px;
  margin-block-start: .75rem;
}

@media (min-width: 769px) and (max-height: 760px) {
  body[data-view="publisher"] #ready-state-hero {
    padding-block: .75rem;
  }

  body[data-view="publisher"] #ready-state-hero .ready-state-icon {
    width: 170px;
    height: 92px;
    margin-block-end: .5rem;
  }

  body[data-view="publisher"] #ready-state-hero :is(h3, p) {
    margin-block: .5rem;
  }
}

#publisher[data-restore] .publisher-prepare-action,
.publisher-prepare-action:has(#prepare-event[hidden]) {
  display: none;
}

.publisher-prepare-action {
  margin-block: .75rem;
}

#prepare-event-note {
  margin: .35rem 0 0;
  font-size: .85rem;
  color: var(--vv-muted);
}

#publisher-guide {
  box-sizing: border-box;
  width: min(33rem, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-lift);
  overflow: auto;
  overscroll-behavior: contain;
}

#publisher-guide::backdrop {
  background: rgb(15 23 42 / .52);
}

#publisher-guide :is(.publisher-guide-header, .publisher-guide-body, .publisher-guide-actions) {
  padding: clamp(.85rem, 4vw, 1.25rem);
}

.publisher-guide-header,
.publisher-guide-actions,
.publisher-guide-step-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.publisher-guide-header,
.publisher-guide-actions {
  justify-content: space-between;
  background: var(--panel-bg-light);
}

.publisher-guide-header {
  border-block-end: 1px solid var(--panel-border);
}

.publisher-guide-actions {
  flex-wrap: wrap;
  border-block-start: 1px solid var(--panel-border);
}

.publisher-guide-step-actions {
  margin-inline-start: auto;
}

#publisher-guide :is(h2, h3, #guide-progress) {
  margin: 0;
}

#publisher-guide h2 {
  font-size: clamp(1.15rem, 4vw, 1.4rem);
}

#publisher-guide h3 {
  font-size: 1.05rem;
}

#guide-progress {
  color: var(--brand-accent-strong);
  font-size: .8rem;
  font-weight: 700;
}

.publisher-guide-body section > p {
  margin: .5rem 0;
  color: var(--text-secondary);
}

#publisher-guide :is(button, select) {
  min-height: 44px;
}

#publisher-guide .publisher-guide-actions .btn {
  padding: .5rem .8rem;
}

#guide-close {
  width: 44px;
  padding: 0;
  font-size: 1.25rem;
}

#publisher-guide #check-microphone:not(:disabled) {
  border: 1px solid var(--vv-control-border);
  border-radius: var(--radius-md);
  background: var(--panel-bg);
  color: var(--text-primary);
  font-weight: 600;
}

#publisher-guide :is(#guide-next, #guide-done, #resume-microphone-check):not([aria-disabled="true"], :disabled) {
  background: var(--vv-action);
  color: var(--vv-action-ink);
}

#publisher-guide :is(button[aria-disabled="true"], button:disabled) {
  background: var(--vv-control-fill);
  color: var(--vv-muted);
}

.publisher-guide-monitor-choices {
  display: grid;
  gap: .4rem;
  margin-block: .85rem .25rem;
}

.publisher-guide-monitor-choices label {
  font-size: .88rem;
  font-weight: 600;
}

#publisher-guide select {
  box-sizing: border-box;
  max-width: 100%;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--radius-md);
  background: var(--panel-bg);
  color: var(--text-primary);
}

#guide-review:not(:empty) {
  margin-block: .75rem;
  padding: .75rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: var(--panel-bg-light);
  overflow-wrap: anywhere;
}

/* Room browsing uses the Classic Listener tabs and room-card layout. */
body[data-view="listener"] #listener .listener-tabs button {
  min-height: 44px;
}

body[data-view="listener"] #listener .listener-tabs button[aria-expanded="true"] {
  border-color: rgba(16, 122, 190, .35);
  background: rgba(16, 122, 190, .16);
  color: var(--brand-accent-strong);
}

body[data-view="listener"] #listener #switch-listener-room {
  min-height: 44px;
  margin-block: .45rem;
  border: 1px solid var(--panel-border);
}

body[data-view="listener"] #listener:has(:is(#galleryPanel, #listener-invite):not([hidden])) .audio-gate {
  display: none;
}

body[data-view="listener"] #listener:has(#galleryPanel:not([hidden])) {
  max-width: none;
}

/* Gallery layout from Classic's shipped Listener template. */
.gallery-panel{flex:1;overflow-y:auto;}
.gallery-controls{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,150px) auto auto;
  gap:8px;
  padding:10px var(--space-lg);
  border-bottom:1px solid var(--panel-border);
  background:var(--panel-bg);
}
.gallery-controls input,
.gallery-controls select{
  width:100%;
  min-height:36px;
  border:1px solid var(--panel-border);
  border-radius:10px;
  padding:8px 10px;
  font-size:.88rem;
  background:var(--panel-bg);
  color:var(--text-primary);
}
.gallery-controls input:focus,
.gallery-controls select:focus{
  outline:none;
  border-color:var(--brand-accent);
  box-shadow:0 0 0 2px rgba(8,145,178,.22);
}
#galleryPanel .gallery-controls .btn{
  margin-top:0;
  min-height:36px;
  padding:8px 14px;
  font-size:.85rem;
}
.room-gallery{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  padding:var(--space-md) var(--space-lg) var(--space-lg);
  align-items:stretch;
}
.room-card{
  width:100%;
  border:1px solid var(--panel-border);
  border-radius:12px;
  padding:14px;
  background:var(--panel-bg-light);
  box-shadow:var(--shadow-soft);
  cursor:pointer;
  transition:var(--transition-fast);
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr) auto;
  align-items:center;
  gap:18px;
  text-align:left;
}
.room-card:hover{box-shadow:var(--shadow-lift);transform:translateY(-2px);}
.room-card.is-current{
  border-color:rgba(8,145,178,.45);
  box-shadow:0 0 0 2px rgba(8,145,178,.18), var(--shadow-lift);
  background:
    linear-gradient(180deg, rgba(8,145,178,.08), rgba(8,145,178,.02)),
    var(--panel-bg-light);
}
.room-card__identity{display:flex;align-items:center;gap:10px;min-width:0}
.room-card__avatar{
  width:38px;height:38px;border-radius:999px;flex:0 0 auto;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(8,145,178,.12);color:var(--brand-accent-strong);
  font-size:.84rem;font-weight:700;overflow:hidden;
}
.room-card__copy{min-width:0;flex:1 1 auto}
.room-card__heading{display:flex;align-items:center;gap:8px;min-width:0;flex-wrap:wrap}
.room-card__title{
  margin:0;font-size:1rem;font-weight:700;color:var(--text-primary);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.room-card__current{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:5px;
  padding:3px 8px;
  border-radius:999px;
  background:rgba(8,145,178,.12);
  color:var(--brand-accent-strong);
  font-size:.72rem;
  font-weight:700;
}
.room-card__state{min-width:0;color:var(--text-secondary);font-size:.84rem;line-height:1.35}
.room-card__state strong{display:block;color:var(--text-primary);font-size:.9rem;line-height:1.25}
.room-card__actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  min-width:0;
  color:var(--text-secondary);
  font-size:.84rem;
  white-space:nowrap;
}
.room-card__join{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:7px 13px;
  border-radius:999px;
  border:1px solid rgba(8,145,178,.3);
  background:var(--panel-bg);
  color:var(--brand-accent-strong);
  font-size:.82rem;
  font-weight:700;
  box-shadow:var(--shadow-soft);
}
.room-card__badge{padding:4px 10px;border-radius:999px;font-weight:600;font-size:.75rem;}
.room-gallery__empty{
  min-height:170px;
  border:1px dashed var(--panel-border);
  border-radius:12px;
  background:var(--panel-bg-light);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:24px;
  color:var(--text-secondary);
  box-shadow:var(--shadow-soft);
}
.room-gallery__empty strong{display:block;margin-bottom:4px;color:var(--text-primary)}
.badge-live{background:rgba(16,122,190,.15);color:var(--brand-accent-strong);}
.badge-paused{background:rgba(251,191,36,.2);color:#92400e;}
.badge-wait{background:rgba(147,197,253,.25);color:#1e40af;}
html.dark-theme .badge-paused{background:rgba(251,191,36,.16);color:#fde68a;}
html.dark-theme .badge-wait{background:rgba(147,197,253,.18);color:#bfdbfe;}

#gallery-status {
  margin: var(--space-sm) var(--space-lg);
  color: var(--text-secondary);
  font-size: .875rem;
}

#gallery-status:empty, #roomGallery:empty {
  display: none;
}

#roomGallery .room-card {
  /* The main Listener shell has a shared button style. */
  max-width: none;
  color: var(--text-primary);
}

#roomGallery .room-card__title {
  max-width: 100%;
}

@media(max-width:980px) {
  .gallery-controls{padding:10px 16px;}
  .room-gallery{padding:12px 16px;}
  .room-card{
    gap:14px;
  }
}

@media(max-width:640px) {
  .gallery-controls{
    grid-template-columns:1fr;
    padding:8px var(--space-md);
    gap:8px;
  }
  .gallery-controls button,
  .gallery-controls input,
  .gallery-controls select{
    min-height:36px;
  }
  .room-card{
    grid-template-columns:1fr;
    gap:10px;
  }
  .room-card__actions{
    justify-content:space-between;
    min-width:0;
  }
}

.room-visibility-settings {
  display: grid;
  gap: .35rem;
  margin-block: .75rem;
}

.room-visibility-settings label,
.room-join-code-label {
  font-size: .88rem;
  font-weight: 600;
}

.room-visibility-settings p {
  margin: 0;
  color: var(--vv-muted);
  font-size: .85rem;
}

#room-join-code {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: .35rem 0 .75rem;
  padding: .45rem .65rem;
  border: 1px solid var(--vv-control-border);
  border-radius: var(--vv-control-radius);
  background: var(--vv-control-fill);
  color: var(--vv-text);
  font: inherit;
}

/* Keep the Classic controls rail mounted while one Publisher panel is shown. */
body[data-view="publisher"] #publisher:has(#publisher-stream[hidden]) .quick-guide,
body[data-view="publisher"] main:has(#publisher-stream[hidden]) > #listener {
  display: none;
}

#publisher .setup-step__label[data-open-publisher-panel] {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--vv-focus);
  text-align: start;
  text-decoration: underline;
}

.downloads-sections {
  display: grid;
  gap: var(--space-md);
}

body[data-view="publisher"] #publisher-save .downloads-section {
  padding: var(--space-md);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel-bg-light);
}

.downloads-section__title {
  margin: 0 0 .65rem;
  font-size: 1rem;
}

.publisher-download-placeholder {
  margin: 0;
  color: var(--text-secondary);
}

#publisher-save:has(#save:enabled) .publisher-download-placeholder,
.publisher-saved-originals:has(#account-archive[hidden]) {
  display: none;
}

body[data-view="publisher"] #publisher-save #account-archive {
  width: 100%;
  margin-inline: 0;
}

.settings-section {
  margin-block-end: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel-bg-light);
}

.settings-section h3 {
  margin: 0 0 .75rem;
  font-size: 1rem;
}

/* Classic Publisher stream rules from the shared Dev/Production template. */
#publisher-transcript.stream-log {
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 480px;
  max-height: 520px;
  padding-inline: var(--space-4);
}

#publisher-transcript-rows {
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;    /* the follow owns the scroll position: no anchoring lurch on each rebuild (S10 B2) */
}

#publisher-transcript .chunk {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--panel-border);
  transition: opacity .3s ease;
  min-width: 0;
}

#publisher-transcript .chunk:last-child { border-bottom: none; }
#publisher-transcript .chunk.pending { opacity: .5; }
#publisher-transcript .chunk.playing .es { color: var(--brand-accent); }

#publisher-transcript .chunk.skipped {
  opacity: .45;
  filter: grayscale(.2);
  border-left: 3px solid #f59e0b;
  padding-left: calc(var(--space-4) - 3px);
}

#publisher-transcript .chunk.skipped :is(.es, .en) { text-decoration: line-through; }

#publisher-transcript .stream-placeholder {
  margin: var(--space-4) 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(37, 181, 212, .18);
  border-radius: 10px;
  background: rgba(37, 181, 212, .06);
  color: var(--text-secondary);
  font-size: .92rem;
  line-height: 1.45;
}

#publisher-transcript .stream-placeholder:empty {
  margin: 0;
  padding: 0;
  border: 0;
}

#publisher-transcript .chunk.chunk-has-warning {
  border-left: 3px solid var(--brand-danger);
  padding-left: calc(var(--space-4) - 3px);
  background: rgba(225, 29, 72, .04);
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

#publisher-transcript .chunk-warning {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--brand-danger);
  text-transform: capitalize;
}

#publisher-transcript .chunk-warning-icon {
  width: 1em;
  height: 1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid currentColor;
  font-size: .65rem;
  padding: 1px;
}

#publisher-transcript .es {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#publisher-transcript .en {
  font-size: .9rem;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

#publisher-transcript-rows::-webkit-scrollbar { width: 8px; }
#publisher-transcript-rows::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 4px;
}

body[data-view="publisher"] #publisher .tabs .tab-btn {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-view="publisher"] #publisher .tabs .tab-btn[aria-selected="true"] {
  border-bottom-color: var(--brand-accent);
}

body[data-view="publisher"] #publisher-settings .settings-section {
  padding: var(--space-md, 16px);
}

body[data-view="listener"] #listener:has(#play-state:empty) .listener-header {
  display: none;
}

#microphone-test-playback {
  display: block;
  width: min(100%, 26rem);
  margin-block-start: .65rem;
}

#publisher-transcript .publisher-transcript-range {
  display: block;
  color: var(--text-secondary, #475569);
  font-size: .8rem;
}

/* Settings use the shipped Classic section structure and control grouping. */
body[data-view="publisher"] #publisher-settings {
  padding: 28px 24px 40px;
}
body[data-view="publisher"] #publisher-settings .settings-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(920px, 100%);
  margin: 0 auto;
}
#publisher-settings .settings-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#publisher-settings .settings-title {
  margin: 0 0 6px;
  text-align: left;
  font-size: 1.5rem;
  letter-spacing: -.025em;
}
#publisher-settings .settings-page-header p,
#publisher-settings .setting-helper {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: .875rem;
}
body[data-view="publisher"] #publisher-settings .settings-section {
  display: block;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: var(--panel-bg-light);
}
#publisher-settings .settings-section__header {
  margin-bottom: 20px;
}
#publisher-settings .settings-section h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}
#publisher-settings .settings-section__body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 18px 24px;
}
#publisher-settings .settings-section__body > :is(label, .setting-item),
#publisher-settings .microphone-setup > label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 600;
}
#publisher-settings :is(select, input[type="text"]),
#publisher-settings #publisher-source-language {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: .9rem;
}
#publisher-settings #publisher-source-language {
  display: block;
  border-style: dashed;
}
#publisher-settings .settings-section__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
#publisher-settings #publisher-monitor-status {
  flex: 1 1 240px;
  margin: 0;
  font-size: .85rem;
  color: var(--text-secondary);
}
#publisher-settings :is(#mode-description, #microphone-check-note) {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: .85rem;
  line-height: 1.5;
}
#publisher-settings .microphone-setup {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 12px 20px;
  margin-top: 18px;
}
#publisher-settings :is(#microphone-check-note, #microphone-preflight) {
  grid-column: 1 / -1;
}
#publisher-settings .microphone-check-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#publisher-settings :is(button, .btn) {
  min-height: 44px;
  margin-top: 0;
  padding: 10px 16px;
}
#publisher-settings :is(#microphone-test-playback, #microphone-preview-level) {
  width: 100%;
}
#publisher-settings #share-room,
#publisher-settings #publisher-monitor-settings #listener {
  box-sizing: border-box;
  width: 100%;
  margin: 20px 0 0;
  padding: 20px 0 0;
  border: 0;
  border-top: 1px solid var(--panel-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#publisher-settings #share-heading {
  font-size: .95rem;
  margin: 0 0 12px;
}
#publisher-settings #share-room p,
#publisher-settings .room-visibility-settings p {
  font-size: .85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
#publisher-settings #share-room .controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
#publisher-settings #event-name-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
}
#publisher-settings .room-visibility-settings {
  margin-top: 20px;
}
#publisher-settings .settings-developer summary {
  cursor: pointer;
  font-weight: 600;
}
#publisher-settings .settings-developer[open] > label {
  display: block;
  margin: 20px 0 8px;
}
body[data-view="publisher"] #publisher-stream #ready-state-hero {
  min-height: 160px;
  padding: var(--space-6) var(--space-4);
}
#publisher-stream #readyStateTitle {
  margin: 0 0 var(--space-2);
  font-size: 1.5rem;
}
#publisher-stream #ready-state-hero p {
  max-width: 32rem;
  margin: 0 0 20px;
  line-height: 1.6;
}
body[data-view="publisher"] #publisher-transcript.stream-log {
  min-height: 480px;
  max-height: none;
  height: calc(100dvh - 260px);
  padding-inline: 0;
}
#publisher-transcript .publisher-transcript-range {
  font-size: .75rem;
  color: var(--text-secondary);
}
@media(max-width:640px) {
  body[data-view="publisher"] #publisher-settings { padding: 20px 16px 32px; }
  body[data-view="publisher"] #publisher-settings .settings-section { padding: 18px 16px; }
  #publisher-settings .settings-section__body { grid-template-columns: minmax(0,1fr); }
  #publisher-settings .microphone-setup { grid-template-columns: minmax(0,1fr); }
  #publisher-settings .settings-section__actions { align-items: stretch; }
  #publisher-settings .settings-section__actions p:empty { display:none; }
  #publisher-settings #share-room .controls { gap: 8px; }
}

body[data-view="publisher"] #publisher-settings {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
}
#publisher-settings .microphone-setup {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body[data-view="publisher"] #publisher #classic-idle-stop:disabled {
  color: var(--text-secondary);
  background: var(--panel-bg);
  background-image: none;
  border: 1px solid var(--panel-border);
  box-shadow: none;
  opacity: .65;
}

#publisher-settings .setting-room__main,
#publisher-settings .setting-room__pin {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
#publisher-settings .setting-room__main > label,
#publisher-settings .setting-room__pin > label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
#publisher-settings .setting-room__controls {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
}
#publisher-settings .setting-room__controls > input,
#publisher-settings .private-pin-field {
  flex: 1 1 240px;
  min-width: 0;
}
#publisher-settings .private-pin-field {
  display: flex;
  gap: 8px;
}
#publisher-settings input[type="password"] {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--text-primary);
  font: inherit;
}
#publisher-settings #room-access-status {
  margin: 0;
  font-size: .85rem;
  line-height: 1.5;
}

body[data-view="publisher"] .content-wrapper,
body[data-view="publisher"] .app-container > main {
  box-sizing: border-box;
  min-width: 0;
}
body[data-view="publisher"] .app-container {
  overflow-x: clip;
}

#publisher-settings .setting-mic__gain {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) 48px;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
#publisher-settings .setting-mic__gain label {
  font-size: .85rem;
  font-weight: 600;
}
#microphone-gain {
  width: 100%;
  min-width: 0;
  accent-color: var(--brand-accent);
}
#microphone-gain-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#microphone-gain-note { grid-column: 1 / -1; }
:is(#listener-room-password, #switch-room-password) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border, #d1d5db);
  border-radius: 8px;
  background: var(--panel-bg, #fff);
  color: var(--text-primary, #111827);
  font: inherit;
}
:is(#listener-room-password-field, #switch-room-password-field) {
  width: 100%;
}
#publisher-transcript .transcript-diagnostics {
  margin-top: 8px;
  font-size: .75rem;
  color: var(--text-secondary);
}
#publisher-transcript .transcript-diagnostics summary {
  width: fit-content;
  cursor: pointer;
  padding-block: 4px;
}
#publisher-transcript .transcript-diagnostics[open] {
  padding-bottom: 4px;
}
#publisher-transcript .transcript-diagnostics .publisher-transcript-range {
  margin-top: 4px;
  line-height: 1.5;
}

body[data-view="publisher"] #publisher-monitor-settings :is(.listener-header, #change-output, #output-settings, .listener-transcript, .listener-notes, #view-transcript) {
  display: none;
}
body[data-view="publisher"] #publisher-monitor-settings #selection {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body[data-view="publisher"] #publisher-monitor-settings .listener-feedback {
  margin: 0 0 12px;
  padding: 0;
}
body[data-view="publisher"] #publisher-monitor-settings #play {
  width: auto;
  min-width: 160px;
}

/* Classic final-session cards, adapted to the durable 2.0 export actions. */
body[data-view="publisher"] #publisher-save {
  box-sizing: border-box;
  width: 100%;
  padding: 28px 24px 40px;
}
body[data-view="publisher"] #publisher-save .downloads-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: min(920px, 100%);
  margin: 0 auto;
}
body[data-view="publisher"] #publisher-save .downloads-section {
  padding: 24px;
}
body[data-view="publisher"] #publisher-save .downloads-section.latest {
  border-color: rgba(14,116,144,.3);
  background: linear-gradient(180deg, rgba(6,182,212,.06), var(--panel-bg-light));
}
#publisher-save .downloads-section__title {
  margin: 0 0 20px;
  font-size: 1.1rem;
  font-weight: 700;
}
#publisher-save .downloads-final-card__meta {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 20px;
  margin-bottom: 20px;
}
#publisher-save .downloads-final-card__meta span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: .8rem;
}
#publisher-save .downloads-final-card__meta strong {
  display: block;
  color: var(--text-primary);
  font-size: .95rem;
  overflow-wrap: anywhere;
}
#publisher-save .downloads-artifact-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
#publisher-save .downloads-artifact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#publisher-save .downloads-artifact-links a.text-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
  padding: 12px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--brand-accent-strong);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
#publisher-save .downloads-artifact-links a.text-link:hover {
  border-color: var(--brand-accent);
  background: rgba(6,182,212,.05);
}
#publisher-save .downloads-artifact small {
  padding-inline: 4px;
  color: var(--text-secondary);
  font-size: .8rem;
  line-height: 1.5;
}
#publisher-save .downloads-artifact-links p { margin: 0; }
#publisher-save .downloads-transcript-files { display: grid; gap: 8px; margin-top: 8px; }
#publisher-save .archive-status:empty { display: none; }
#publisher-save .downloads-placeholder {
  padding: 20px;
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  color: var(--text-secondary);
  background: var(--panel-bg);
  text-align: center;
}
#publisher-save .downloads-filters {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr)) auto auto;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}
#publisher-save .downloads-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: .85rem;
}
#publisher-save .downloads-filters input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font: inherit;
  background: var(--panel-bg);
  color: var(--text-primary);
}
#publisher-save .downloads-filters .btn {
  min-height: 44px;
  margin: 0;
  padding: 10px 14px;
}
#publisher-save #account-archive {
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  box-shadow: none;
  margin: 0;
}
#publisher-save:has(#account-archive:not([hidden])) #open-saved-originals {
  display: none;
}
#publisher-save #account-archive-details[open] > summary {
  pointer-events: none;
  list-style: none;
  padding: 0 0 20px;
  font-size: 1.1rem;
}
#publisher-save #account-archive-details[open] > summary::after,
#publisher-save #account-archive-details[open] > summary::marker { content: none; }
#publisher-save #account-archive-controls {
  padding: 0;
  margin: 0;
  border: 0;
}
#publisher-save #account-archive-controls legend { margin-bottom: 12px; }
#publisher-save .archive-body { padding: 0; }
@media(max-width:640px) {
  body[data-view="publisher"] #publisher-save { padding: 20px 16px 32px; }
  body[data-view="publisher"] #publisher-save :is(.downloads-section,#account-archive) { padding: 18px 16px; }
  #publisher-save .downloads-final-card__meta { grid-template-columns: 1fr; gap: 14px; }
  #publisher-save .downloads-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media(max-width:768px) {
  body[data-view="publisher"] #publisher .header-content {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
  }
  body[data-view="publisher"] #publisher .session-controls {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  body[data-view="publisher"] #publisher :is(#start,#pause,#resume,#stop,#classic-idle-stop) {
    width: auto;
    height: auto;
    min-height: 44px;
    padding: 10px 14px;
    font-size: .85rem;
    border-radius: 8px;
  }
  body[data-view="publisher"] #publisher:has(#classic-idle-stop:not([hidden])) #start:not([aria-describedby]) {
    width: auto;
    padding: 10px 14px;
    font-size: .85rem;
  }
  body[data-view="publisher"] #publisher #classic-idle-stop:disabled { display: none; }
  body[data-view="publisher"] #publisher .header-info {
    width: 100%;
    display: block;
    order: 2;
    padding: 0;
    overflow: visible;
  }
  body[data-view="publisher"] #publisher #capture-state {
    min-height: 0;
    height: auto;
    padding: 8px 10px;
    margin: 0;
    border: 0;
    border-radius: 6px;
    box-shadow: none;
    text-align: left;
    font-size: .8rem;
    line-height: 1.4;
  }
  body[data-view="publisher"] #publisher .header-info::before { display: none; }
}

body:not([data-stream-diagnostics]) .transcript-diagnostics {
  display: none;
}
#publisher-transcript-languages {
  color: var(--text-secondary);
  font-size: .8rem;
  margin: 12px 0 4px;
}
#publisher-saving-delay:not([hidden]) {
  display: flex;
  align-items: center;
  gap: .35rem;
  width: fit-content;
  color: var(--text-secondary);
  font-size: .8rem;
  margin: 0 var(--focus-publisher-text-inset, 0px) 4px;
}
#publisher-settings .stream-diagnostics-setting {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 8px;
  font-size: .875rem;
}
#show-stream-diagnostics { width: 18px; height: 18px; accent-color: var(--brand-accent); }

#publisher-save .downloads-final-card__meta {
  grid-template-columns: repeat(4,minmax(0,1fr));
}
#publisher-settings .setting-helper { font-weight: 400; }
#publisher-save #account-archive-details[open] > summary {
  background: transparent;
  border: 0;
  border-radius: 0;
}
#publisher-save .archive-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
#publisher-save .archive-tools {
  align-self: stretch;
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
}
@media(max-width:640px) {
  #publisher-save .downloads-final-card__meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #publisher-save .downloads-final-card__meta > div:nth-child(2) { overflow-wrap: anywhere; }
  body[data-view="publisher"] #publisher .header-content { padding-block: 10px; gap: 6px; }
  body[data-view="publisher"] #continue-event-note { margin: 4px 0 0; font-size: .75rem; }
  body[data-view="publisher"] #publisher #publisher-capture-actions { justify-content: flex-start; }
}

/* Preserve native select affordances after the Classic settings adaptation. */
body[data-view="publisher"] #publisher-settings select {
  appearance: auto;
  -webkit-appearance: auto;
  padding-inline-end: 12px;
}
body[data-view="publisher"] #publisher-settings label:has(select)::after { display: none; }
body[data-view="publisher"] #publisher-stream #publisher-heading {
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
@media(max-width:768px) {
  body[data-view="publisher"] #publisher #publisher-capture-actions :is(#pause,#stop:not([data-buffer-recovery]),#resume) {
    width: auto;
    height: auto;
    padding: 10px 14px;
    font-size: .85rem;
    min-height: 44px;
  }
}
body[data-view="publisher"] #listener-entry-context { display: none; }
body[data-view="listener"] #listener-entry-context {
  grid-column: 1 / -1;
  width: 100%;
  text-align: center;
}
body[data-view="listener"] #selection #listener-entry-title {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: -.02em;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
body[data-view="listener"] #selection #listener-entry-status {
  display: block;
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.5;
}
body[data-view="listener"] #selection #listener-entry-status:empty { display:none; }
body[data-view="listener"] #listener:has(#play[data-action="stop"]) #listener-entry-context { display: none; }

body[data-view="listener"] #selection #listener-entry-context {
  grid-row: 2;
  position: relative;
  z-index: 1;
}
#publisher-transcript .transcript-language {
  display: block;
  color: var(--text-secondary);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 5px;
}
#publisher-transcript .es + .transcript-language { margin-top: 12px; }
#publisher-transcript .chunk .en { display: block; }

/* Show event identity in its header before the broadcast begins. */
body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) #listener-entry-context { display: none; }
body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]):not(:has(#play-state[data-state="idle"])) .listener-page-intro { display: block; min-width: 0; }
body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]):not(:has(#play-state[data-state="idle"])) .listener-header {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(160px,260px);
  gap: 12px 20px;
  align-items: center;
  padding: 16px 24px;
}
body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]) #listener-heading {
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
  font-size: 1.15rem;
  line-height: 1.4;
}
@media(max-width:640px) {
  body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]):not(:has(#play-state[data-state="idle"])) .listener-header {
    grid-template-columns: minmax(0,1fr);
    gap: 12px;
    padding: 16px;
  }
  body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]) .header-controls { width: 100%; grid-template-columns: minmax(0,1fr); }
  body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]) #play-state {
    min-height: 36px;
    border-radius: 8px;
    text-align: left;
    justify-items: start;
    padding: 8px 12px;
  }
}

body[data-view="publisher"] #publisher-stream #recovery-microphone {
  display: grid;
  gap: 8px;
  max-width: 32rem;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel-bg-light);
  font-size: .875rem;
  font-weight: 600;
}
body[data-view="publisher"] #publisher-stream #recovery-microphone-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  appearance: auto;
  -webkit-appearance: auto;
  padding: 10px 12px;
  background: var(--panel-bg);
}
body[data-view="publisher"] #publisher-stream #recovery-microphone::after { display: none; }

/* Keep capture, personal listening, and event identity in their visible context. */
#publisher-settings .setting-source-language {
  align-self: start;
}
#publisher-settings #publisher-source-language {
  min-height: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
}
body[data-view="publisher"] #publisher .publisher-share-shortcut {
  margin-inline-start: 8px;
  font-weight: 600;
}
#publisher-listening-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 16px 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: var(--panel-bg-light);
  color: var(--text-primary);
  text-align: left;
}
#publisher-listening-controls :is(h2,h3,p) { margin: 0; }
#publisher-listening-controls :is(h2,h3) { font-size: .95rem; font-weight: 700; }
#publisher-listening-controls p { color: var(--text-secondary); font-size: .85rem; line-height: 1.5; }
#publisher-listening-controls label { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
#publisher-listening-controls input[type="range"] { width: 140px; min-height: 44px; accent-color: var(--brand-accent-strong); }
#publisher-listening-controls button { min-height: 44px; margin: 0; padding: 10px 16px; }
#publisher-listening-controls :is(button,input):focus-visible,
#publisher-share-link:focus-visible {
  outline: 3px solid var(--brand-accent-strong);
  outline-offset: 3px;
}
body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]) .listener-page-intro {
  display: block;
  min-width: 0;
}
body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]) .listener-header {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(160px,260px);
  align-items: center;
  gap: 12px 24px;
  padding: 18px 24px;
}
body[data-view="listener"] #listener #listener-output:not([hidden]) {
  display: block;
  margin-top: 6px;
  font-size: .875rem;
  color: var(--text-secondary);
}
body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .audio-gate {
  display: block;
  position: static;
  inset: auto;
  padding: 0 24px 24px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: auto;
}
body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .audio-gate__content#selection {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: var(--panel-bg-light);
  text-align: left;
  box-shadow: none;
}
body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) #selection #output-settings {
  flex-basis: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}
body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) #selection :is(#play,#change-output,#listener-captions,#source-captions) {
  width: auto;
  flex: 0 1 auto;
  min-height: 44px;
  margin: 0;
}
body[data-view="listener"] #listener #switch-output-status:empty { display: none; }
body[data-view="listener"] #listener #selection #switch-output-status:not(:empty) {
  margin: 0;
  font-size: .8rem;
  line-height: 1.4;
}
#output-apply:has(#switch-output[hidden]):has(#cancel-output-settings[hidden]):has(#switch-output-status:empty) { display: none; }
body[data-view="listener"] #output-apply {
  position: sticky;
  z-index: 2;
  bottom: env(safe-area-inset-bottom,0px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 8px;
  border-top: 1px solid var(--vv-border);
  background: var(--vv-surface);
}
body[data-view="listener"] #output-apply #switch-output {
  min-width: 44px;
  min-height: 44px;
  margin: 0;
}
body[data-view="listener"] #output-apply #switch-output-status {
  flex: 1 1 min(100%,16ch);
}
#output-draft-summary { flex: 1 0 100%; margin: 0; font-weight: 600; }
body[data-view="listener"] #output-apply #cancel-output-settings { min-height: 44px; margin: 0; }
@media(max-width:600px) {
  body[data-view="listener"] #output-apply #switch-output { width: 100%; }
}
body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .listener-feedback {
  box-sizing: border-box;
  width: min(100%, 768px);
  margin: 0 auto;
  padding: 16px 24px;
}
body[data-view="listener"] #listener:has(:is(#galleryPanel,#listener-invite):not([hidden])) .audio-gate,
body[data-view="listener"] #listener:has(#selection[hidden]) .audio-gate { display: none; }
@media(max-width:640px) {
  body[data-view="publisher"] #publisher .publisher-share-shortcut { margin-inline-start: 0; }
  #publisher-listening-controls { padding: 14px; gap: 10px 14px; }
  #publisher-listening-controls label { flex-wrap: wrap; }
  body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]) .listener-header {
    grid-template-columns: minmax(0,1fr);
    gap: 12px;
    padding: 16px;
  }
  body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .audio-gate { padding: 0 16px 20px; }
  body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .audio-gate__content#selection { padding: 16px; gap: 10px; }
  body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .listener-feedback { padding: 12px 16px; }
}

/* The 2.0 caption reader owns its content visibility; Classic's hidden log does not. */
body[data-view="listener"] #listener .listener-transcript.stream-log {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: min(100%, 768px);
  margin: 0 auto;
  text-align: left;
}
body[data-view="listener"] #listener .listener-transcript.stream-log:has(#meaning:empty):not(:has(#caption-reader[role="region"])) {
  display: none;
}
body[data-view="listener"] #listener .listener-transcript.stream-log::before,
body[data-view="listener"] #listener .listener-transcript.stream-log::after { display: none; }
body[data-view="listener"] #listener .listener-transcript #caption-reader {
  margin: 12px 0 20px;
  border-bottom: 0;
  transform: none;
}
body[data-view="listener"] #listener #play-state {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 0;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: .8rem;
  text-align: left;
  cursor: default;
}
body[data-view="listener"] #listener #play-state:is([data-state="paused"],[data-state="audio_paused"],[data-state="live_host_paused"]) {
  --vv-indicator: var(--vv-indicator-neutral);
  background: transparent;
  color: var(--text-secondary);
}
@media(max-height:500px) and (orientation:landscape) {
  body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]) .listener-header {
    grid-template-columns: minmax(0,1fr) minmax(140px,220px);
    gap: 8px 16px;
    padding: 10px 16px;
  }
  body[data-view="listener"] #listener .listener-tabs { padding-block: 4px; }
  body[data-view="listener"] #listener .listener-tabs button { min-height: 36px; }
  body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .listener-feedback { padding-block: 6px; }
  body[data-view="listener"] #listener #caption-reader[role="region"] { max-height: 45vh; }
  body[data-view="listener"] #listener .listener-transcript #caption-reader { margin-block: 8px; }
}

#publisher-listening-controls::before {
  content: attr(data-ui-listening-label);
  flex-basis: 100%;
  font-size: .9rem;
  font-weight: 700;
}
body[data-view="listener"] #listener #listener-listening-controls {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
  text-align: left;
}
#listener-listening-controls :is(p,label,output) {
  margin: 0;
  font-size: .85rem;
  line-height: 1.5;
}
#listener-listening-controls p { flex-basis: 100%; color: var(--text-secondary); }
#listener-listening-controls input[type="range"] {
  width: 140px;
  max-width: 100%;
  min-height: 44px;
  accent-color: var(--brand-accent-strong);
}
body[data-view="listener"] #listener #listener-listening-controls button { width: auto; min-height: 44px; margin: 0; padding: 10px 16px; }
#listener-listening-controls :is(input,button):focus-visible { outline: 3px solid var(--brand-accent-strong); outline-offset: 3px; }
#publisher-listening-controls #publisher-playback-status { flex-basis: 100%; }

/* Status text is distinct from the adjacent recording actions. */
body[data-view="publisher"] #publisher .header-info {
  align-self: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body[data-view="publisher"] #publisher #capture-state {
  min-height: 0;
  height: auto;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  text-align: left;
  justify-items: start;
}
body[data-view="publisher"] #publisher #capture-state[data-tone="recording"] {
  color: #147d42;
  background: transparent;
}
body[data-view="publisher"] #publisher:has(#resume:not([hidden])) #capture-state {
  color: var(--text-secondary);
  background: transparent;
}
@media(min-width:641px) {
  #publisher-listening-controls::before { flex-basis: auto; margin-inline-end: 8px; }
  #publisher-listening-controls { gap: 8px 16px; }
}

body[data-view="listener"] #listener #play-state:is([data-state="ready"],[data-state="captions_ready"]) {
  background: transparent;
  color: #147d42;
}
body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]) .header-controls {
  display: block;
  width: auto;
  grid-template-areas: none;
}
@media(max-width:640px) {
  #publisher-listening-controls input[type="range"],
  #listener-listening-controls input[type="range"] { width: 110px; }
  body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]) .listener-header { gap: 4px; }
}

/* Keep guide navigation visible while short screens scroll the current step. */
#publisher-guide[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#publisher-guide :is(.publisher-guide-header, .publisher-guide-actions) { flex: 0 0 auto; }
#publisher-guide .publisher-guide-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media(max-height:500px) {
  #publisher-guide :is(.publisher-guide-header, .publisher-guide-actions) { padding-block: 10px; }
}

.listening-delay, .listening-delay-details { grid-column: 1 / -1; margin: 0; font-size: .8rem; line-height: 1.45; color: var(--text-secondary); }
.listening-delay { font-weight: 600; }
.listening-delay-details summary { cursor: pointer; width: fit-content; }
.listening-delay-details p { max-width: 46rem; margin: 8px 0 0; font-weight: 400; }

/* Current host state stays separate from this device's playback and delay. */
body[data-view="listener"] #listener #listener-event-status:not([hidden]) {
  display: block;
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Translated capture actions need text-sized controls, not icon-sized tiles. */
body[data-view="publisher"] #publisher #publisher-capture-actions #publisher-share-link {
  flex: 0 1 auto;
  width: auto;
  height: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: .85rem;
  line-height: 1.35;
  text-align: center;
}
@media(max-width:980px) {
  body[data-view="publisher"] #publisher .header-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 10px 16px;
  }
  body[data-view="publisher"] #publisher #publisher-capture-actions {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }
  body[data-view="publisher"] #publisher .header-info {
    flex: 1 1 100%;
    width: 100%;
    justify-content: start;
  }
  body[data-view="publisher"] #publisher #capture-state { text-align: left; }
}
@media(max-width:640px) {
  body[data-view="publisher"] #publisher #publisher-capture-actions {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    align-items: stretch;
    gap: 8px;
  }
  body[data-view="publisher"] #publisher #publisher-start-actions:has(#start[hidden]) { display: none; }
  body[data-view="publisher"] #publisher #publisher-capture-actions .btn {
    width: 100%;
    height: auto;
    min-height: 44px;
    padding: 10px 12px;
    white-space: normal;
    line-height: 1.35;
  }
  body[data-view="publisher"] #publisher #publisher-capture-actions #publisher-share-link {
    grid-column: 1 / -1;
    width: 100%;
    margin-inline-start: 0;
  }
}

/* Long localized playback states wrap inside the landscape header column. */
body[data-view="listener"] #listener #play-state {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__language {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  flex: 0 1 auto;
  gap: 6px;
  min-width: 0;
  margin: 0 0 0 auto;
  color: var(--text-secondary);
}
.veravox-site-nav__language svg { flex: 0 0 18px; width: 18px; height: 18px; }
body:is([data-view="publisher"],[data-view="listener"]) #interface-language {
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  max-width: 9rem;
  min-height: 40px;
  margin: 0;
  padding: 8px;
  appearance: auto;
  -webkit-appearance: auto;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
}
#interface-language:focus-visible { outline: 3px solid var(--brand-accent-strong); outline-offset: 2px; }
.interface-language-status {
  margin: 0;
  padding: 8px 16px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel-bg-light);
  color: var(--text-secondary);
  font-size: .8rem;
  line-height: 1.45;
}
@media(max-width:980px) {
  body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav .veravox-site-nav__account { margin-inline-start: 0; }
}

/* Leave enough intrinsic width for translated Gallery filter names. */
#galleryPanel .gallery-controls {
  grid-template-columns: minmax(0,1fr) minmax(12.5rem,max-content) auto auto;
  align-items: center;
}
#galleryPanel .gallery-controls :is(input,select) { box-sizing: border-box; min-width: 0; }
#galleryPanel #galleryStateFilter { padding-inline-end: 30px; }
@media(max-width:640px) {
  #galleryPanel .gallery-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #galleryPanel .gallery-controls :is(input,select) { grid-column: 1 / -1; }
  #galleryPanel .gallery-controls :is(input,select,button) { min-height: 44px; }
}

/* Caption reading keeps compact controls and a comfortable first line. */
@media(max-width:640px), (max-height:500px) and (orientation:landscape) {
  body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .listener-feedback {
    padding-block: 8px;
  }
  body[data-view="listener"] #listener :is(#view-transcript,#switch-listener-room) { margin-block: 0; }
  body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .audio-gate { padding-bottom: 12px; }
  body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .audio-gate__content#selection {
    padding: 12px;
    gap: 8px;
  }
  body[data-view="listener"] #listener #listener-listening-controls { padding-top: 8px; gap: 6px 10px; }
  body[data-view="listener"] #listener #caption-history-controls { gap: 6px; padding-block: 8px 4px; }
  body[data-view="listener"] #listener #caption-reader {
    scroll-margin-block-start: calc(var(--listener-live-actions-height, 0px) + 12px);
  }
  body[data-view="listener"] #listener #caption-reader[role="region"] { min-height: min(34dvh,16rem); }
  body[data-view="listener"] #listener .listener-transcript #caption-reader { margin-block: 8px 12px; }
  body[data-view="listener"] #listener .chunk.playing #meaning { font-size: clamp(1.25rem, 4.8vw, 1.75rem); line-height: 1.5; }
}

/* Short landscape screens retain recording actions without oversized chrome. */
@media(max-height:500px) and (orientation:landscape) and (max-width:980px) {
  body[data-view="publisher"] .veravox-site-nav { min-height: 44px; padding-block: 4px; }
  body[data-view="publisher"] #publisher .publisher-header { padding-block: 0; }
  body[data-view="publisher"] #publisher .header-content { padding-block: 6px; gap: 2px 12px; }
  body[data-view="publisher"] #publisher #publisher-capture-actions .btn {
    min-height: 44px;
    height: auto;
    padding: 8px 14px;
    font-size: .85rem;
    line-height: 1.35;
  }
  body[data-view="publisher"] #publisher .header-info { display: block; }
  body[data-view="publisher"] #publisher #capture-state { padding-block: 2px; font-size: .75rem; }
  body[data-view="publisher"] #publisher .tabs .tab-btn { min-height: 44px; padding-block: 8px; }
  body[data-view="publisher"] #publisher-stream #publisher-heading { margin-bottom: 8px; font-size: 1.15rem; }
  body[data-view="publisher"] #publisher #input-feedback { margin-top: 6px; padding-top: 6px; gap: 3px 10px; }
  body[data-view="publisher"] #publisher #publisher-listening-controls { margin-block: 10px 14px; padding: 10px 12px; gap: 6px 12px; }
}

/* The sticky action strip must cover scrolling player and delay text. */
@media (max-height:500px) and (orientation:landscape), (max-width:480px) and (orientation:portrait) {
  body[data-view="listener"] #listener #listener-live-actions {
    z-index: 10;
    isolation: isolate;
    background: var(--panel-bg, #fff);
    box-shadow: 0 1px 0 var(--panel-border);
  }
}

/* Name the personal listening selector and retain recognizable navigation. */
body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__language-label {
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-secondary);
}
body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__account summary {
  width: auto;
  height: auto;
  min-height: 44px;
  padding: 8px;
  gap: 4px;
  border-radius: 8px;
}
body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__account-label { display: inline; }
.veravox-site-nav__menu-icon { width: 18px; height: 18px; flex: 0 0 18px; }
@media(max-width:980px) {
  body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav { gap: 10px; }
  body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__language {
    display: grid;
    grid-template-columns: 16px minmax(0,1fr);
    gap: 2px 4px;
    max-width: 9rem;
  }
  body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__language svg { width: 16px; height: 16px; }
  body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__language-label { font-size: .68rem; }
  body:is([data-view="publisher"],[data-view="listener"]) #interface-language {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
    padding-block: 8px;
  }
  body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__account-label { font-size: .8rem; }
}

/* Before Listen, choices and the action fit together in the existing gate. */
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .audio-gate {
  padding: 80px 16px 16px;
}
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .audio-gate__content#selection {
  width: min(100%, 440px);
  max-height: calc(100dvh - 96px);
  padding: 18px;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) #selection :is(.audio-gate__icon,#listener-entry-context,#output-settings,#listener-captions-note,#switch-output-status) {
  grid-column: 1 / -1;
  grid-row: auto;
}
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .audio-gate__icon { width: 42px; height: 42px; margin-bottom: 4px; }
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) #listener-entry-title { font-size: 1.2rem; margin-bottom: 6px; }
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) #listener-entry-status { margin-bottom: 6px; max-width: none; font-size: .875rem; line-height: 1.4; }
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) #output-settings { gap: 8px; }
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .listener-preferences { padding: 12px; }
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .listener-preferences__choices { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 10px; }
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .listener-preferences__choices:has(#voice-label[hidden]) { grid-template-columns: minmax(0,1fr); }
/* Voice names state gender and age ("Hombre, 40 años", "Hombre joven"): on a phone the voice gets the full width. */
@media (max-width: 480px) {
  body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .listener-preferences__choices { grid-template-columns: minmax(0,1fr); }
}
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) #selection button { min-width: 0; min-height: 44px; margin: 0; font-size: .875rem; }
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) #listener-options { margin: 0; text-align: left; }
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) #listener-options > summary { min-height: 30px; padding-block: 4px; font-size: .8rem; }
@media(max-height:500px) and (orientation:landscape) {
  body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .audio-gate { padding: 74px 16px 10px; }
  body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .audio-gate__content#selection {
    width: min(100%, 660px);
    max-height: calc(100dvh - 84px);
    padding: 12px 16px;
    gap: 8px;
  }
  body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .audio-gate__icon { display: none; }
  body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) #listener-entry-title { font-size: 1.1rem; margin-bottom: 4px; }
  body[data-view="listener"] #listener .listener-recovery { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 0; }
  body[data-view="listener"] #listener .listener-recovery:not(:has(button:not([hidden]))) { display: none; }
  body[data-view="listener"] #listener .listener-recovery button { width: auto; min-width: 0; min-height: 40px; padding: 8px 14px; font-size: .85rem; }
  body[data-view="listener"] #listener:not(:has(#play-state[data-state="idle"])) .listener-feedback { padding-block: 6px; }
}
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) #listener-listening-controls { grid-column: 1 / -1; }
@media(max-width:640px), (max-height:500px) and (orientation:landscape) {
  body[data-view="listener"] #listener .listener-recovery {
    display: inline-flex;
    flex-wrap: wrap;
    vertical-align: middle;
    gap: 8px;
    margin: 0 8px 6px 0;
  }
  body[data-view="listener"] #listener .listener-recovery:not(:has(button:not([hidden]))) { display: none; }
  body[data-view="listener"] #listener .listener-recovery button { width: auto; min-width: 0; min-height: 44px; padding: 8px 14px; font-size: .85rem; }
  body[data-view="listener"] #listener .listener-feedback :is(#caption-recovery-status,#play-notice,#source-caption-state):empty { display: none; }
}


/* R7: one shared control rhythm, retaining the Classic surfaces and palette. */
body:is([data-view="publisher"],[data-view="listener"]) {
  --radius-sm: 8px;
  --radius-md: 12px;
  --vv-control-radius: 8px;
  --vv-radius: 12px;
  --brand-danger: #be123c;
  --brand-danger-strong: #9f1239;
}
body:is([data-view="publisher"],[data-view="listener"]) :is(.btn,#selection button,.listener-recovery button,#switch-listener-room,#galleryPanel button,#caption-history-controls button,#publisher-guide button) {
  border-radius: 8px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
body:is([data-view="publisher"],[data-view="listener"]) :is(.btn.secondary,#selection button:not(#play),.listener-recovery button,#galleryPanel button,#caption-history-controls button) {
  border-color: var(--vv-control-border);
  background: var(--panel-bg, #fff);
  background-image: none;
  color: var(--text-primary, #111827);
}
body[data-view="publisher"] #publisher #stop:not([data-buffer-recovery]):enabled {
  background: var(--brand-danger);
  background-image: none;
  color: #fff;
}
body[data-view="listener"] #listener #selection #play:not([data-action="stop"]):enabled {
  background: var(--vv-action);
  background-image: none;
  color: #fff;
}
body:is([data-view="publisher"],[data-view="listener"]) :is(#publisher-settings,#galleryPanel,#publisher-guide,.listener-preferences) :is(select,input:not([type="checkbox"]):not([type="range"]),button) {
  min-height: 44px;
  border-radius: 8px;
}
body:is([data-view="publisher"],[data-view="listener"]) :is(#publisher-listening-controls,.listener-preferences) {
  border-radius: 12px;
  box-shadow: none;
}

/* Keep volume and its value together; Mute has a stable adjacent position. */
body[data-view="publisher"] #publisher #publisher-listening-controls,
body[data-view="listener"] #listener #listener-listening-controls {
  display: grid;
  grid-template-columns: max-content minmax(64px, 1fr) 4ch;
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
}
body[data-view="publisher"] #publisher #publisher-listening-controls::before {
  grid-column: 1 / -1;
  margin: 0 0 8px;
}
body[data-view="publisher"] #publisher-listening-controls > button { grid-column: 1; grid-row: 2 / 4; }
body[data-view="publisher"] #publisher-listening-controls > label { grid-column: 2 / -1; grid-row: 2; }
body[data-view="publisher"] #publisher-listening-controls > input { grid-column: 2; grid-row: 3; }
body[data-view="publisher"] #publisher-listening-controls > output { grid-column: 3; grid-row: 3; }
body[data-view="listener"] #listener #listener-listening-controls > button { grid-column: 1; grid-row: 1 / 3; }
body[data-view="listener"] #listener-listening-controls > label { grid-column: 2 / -1; grid-row: 1; }
body[data-view="listener"] #listener-listening-controls > input { grid-column: 2; grid-row: 2; }
body[data-view="listener"] #listener-listening-controls > output { grid-column: 3; grid-row: 2; }
.personal-pace-settings {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-block-start: 6px;
}
.personal-pace-settings select {
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--vv-control-border);
  border-radius: 8px;
  background: var(--vv-surface);
  color: var(--vv-text);
  font: inherit;
}
.personal-pace-settings p {
  margin: 0;
  color: var(--vv-muted);
  font-size: .8rem;
}
body:is([data-view="publisher"],[data-view="listener"]) :is(#publisher-listening-controls,#listener-listening-controls) > :is(label,output) {
  margin: 0;
  font-size: .8rem;
  line-height: 1.25;
  color: var(--text-secondary);
}
body:is([data-view="publisher"],[data-view="listener"]) :is(#publisher-listening-controls,#listener-listening-controls) > output {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
body:is([data-view="publisher"],[data-view="listener"]) :is(#publisher-listening-controls,#listener-listening-controls) > input[type="range"] {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
}
body:is([data-view="publisher"],[data-view="listener"]) :is(#publisher-listening-controls,#listener-listening-controls) > :is(p,details) {
  grid-column: 1 / -1;
  margin: 0;
  line-height: 1.5;
}
body:is([data-view="publisher"],[data-view="listener"]) :is(#publisher-listening-controls,#listener-listening-controls) > p:first-of-type { margin-top: 8px; }
body[data-view="listener"] #listener #listener-listening-controls:not(:has(> button:not([hidden]))) { grid-template-columns: minmax(64px,1fr) 4ch; }
body[data-view="listener"] #listener #listener-listening-controls:not(:has(> button:not([hidden]))) > label { grid-column: 1 / -1; }
body[data-view="listener"] #listener #listener-listening-controls:not(:has(> button:not([hidden]))) > input { grid-column: 1; }
body[data-view="listener"] #listener #listener-listening-controls:not(:has(> button:not([hidden]))) > output { grid-column: 2; }
@media(min-width:981px) {
  body[data-view="publisher"] #publisher #publisher-listening-controls { grid-template-columns: max-content minmax(100px,260px) 4ch; }
  body[data-view="listener"] #listener #listener-listening-controls { grid-template-columns: max-content minmax(100px,260px) 4ch; }
}
body[data-view="listener"] #listener .listener-tabs button { border-radius: 8px; }
body[data-view="listener"] #listener #switch-listener-room { padding: 8px 12px; border-radius: 8px; }
body[data-view="listener"] #listener #listener-output { margin-top: 4px; }
body[data-view="listener"] #listener #play-state { padding-block: 4px; }
body[data-view="listener"] #listener .listener-feedback { line-height: 1.5; }
@media(max-width:640px) {
  body[data-view="listener"] #listener:is([data-access="waiting"],[data-access="ready"]) .listener-header { gap: 4px; padding: 12px 16px; }
  body[data-view="listener"] #listener #play-state { padding: 4px 0; }
  body[data-view="publisher"] #publisher #publisher-listening-controls,
  body[data-view="listener"] #listener #listener-listening-controls { column-gap: 8px; }
}

/* Only user-opened panels move; captions and capture controls never animate. */
@keyframes vv-panel-enter {
  from { opacity: .7; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
body:is([data-view="publisher"],[data-view="listener"]) :is(#publisher-guide[open],#listener-options[open] > :not(summary),.listening-delay-details[open] > p) {
  animation: vv-panel-enter 150ms ease-out;
}
@media(prefers-reduced-motion: reduce) {
  body:is([data-view="publisher"],[data-view="listener"]) *,
  body:is([data-view="publisher"],[data-view="listener"]) *::before,
  body:is([data-view="publisher"],[data-view="listener"]) *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Entry remains part of the page, leaving room navigation accessible. */
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .audio-gate {
  position: static;
  inset: auto;
  display: block;
  padding: 12px 16px 24px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: auto;
}
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .audio-gate__content#selection {
  width: min(100%,660px);
  margin: 0 auto;
  max-height: none;
  overflow: visible;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel-bg-light);
  box-shadow: none;
}
body[data-view="listener"] #listener .audio-gate__content::before { display: none; }
body[data-view="listener"] #listener .audio-gate__icon { animation: none; box-shadow: none; }
body[data-view="publisher"] #publisher #start:enabled {
  background: var(--vv-action);
  background-image: none;
  color: #fff;
}
@media(max-height:500px) and (orientation:landscape) {
  body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .audio-gate { padding-block: 8px 16px; }
  body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) .audio-gate__content#selection { padding: 12px 16px; }
}

/* Capture actions share a baseline; color establishes the save/stop hierarchy. */
body[data-view="publisher"] #publisher #publisher-capture-actions :is(#start,#pause,#resume,#stop,#publisher-share-link) {
  height: auto;
  min-height: 48px;
  padding: 10px 16px;
  line-height: 1.35;
}
body[data-view="listener"] #listener #play-state[data-audibility="silent"] {
  color: var(--text-secondary);
  --vv-indicator: var(--vv-indicator-neutral);
}

/* Gallery is a room browser; the previous room header returns with Live. */
body[data-view="listener"] #listener[data-gallery-open] .listener-header {
  display: none !important;
}

/* Keep personal language and voice paired when the event mode is read-only. */
#publisher:is([data-event-active],[data-event-pending],[data-restore]) #publisher-language-fields > .setting-source-language {
  grid-column: 1 / -1;
}

/* Check recordings stay separate from the microphone controls for an open event. */
#publisher:is([data-event-active],[data-restore]) .setting-mic,
#publisher:is([data-event-active],[data-restore]) .microphone-setup { display: block; }
#publisher:is([data-event-active],[data-restore]) .microphone-setup :is(#check-microphone,#resume-microphone-check,#microphone-check-note) { display: none; }
#publisher:is([data-event-active],[data-restore]) .microphone-check-actions { margin-top: 8px; }
#publisher:is([data-event-active],[data-restore]) .setting-mic__gain { display: grid; margin-top: 12px; }
#publisher:is([data-event-active],[data-restore])[data-microphone-test-retained] #microphone-preflight { display: block; margin: 12px 0 0; }

/* Gallery owns discovery; returning to Live restores the room's caption view. */
body[data-view="listener"] #listener[data-gallery-open] :is(.listener-transcript,.listener-feedback,#listener-event-name-panel) {
  display: none !important;
}

/* Focus presentation adapted from Classic Listener 01a1a99a4fdb82f221c5d9cf0006c7799e2009e7,
   veravox-listener.html:471–635. Publisher is a role-specific adaptation.
   Original 2.0 readers, controls, stream state and bounded history remain in use. */
body[data-focus-role] {
  --focus-tools-width: min(42vw,360px);
  padding: 0;
  min-height: 100dvh;
  background: var(--panel-bg, #fff);
}
body[data-focus-role] .app-container {
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 100dvh;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body[data-focus-role] :is(.veravox-site-nav,.interface-language-status,#publisher-focus,#listener-focus) { display: none !important; }
body[data-focus-role="publisher"] #publisher :is(.publisher-header,.tabs-container,#ready-state,#publisher-setup-note) { display: none !important; }
body[data-focus-role="listener"] #listener :is(.listener-header,.listener-tabs,.listener-notes) { display: none !important; }
body[data-focus-role] .app-container > main,
body[data-focus-role] :is(#publisher,#listener) {
  min-height: 0;
  height: auto;
  overflow: visible;
}
body[data-focus-role] #focus-toolbar {
  position: sticky;
  top: 0;
  z-index: 60;
  isolation: isolate;
  box-sizing: border-box;
  width: 100%;
  padding: max(6px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left));
  background: var(--vv-surface);
  border-bottom: 1px solid var(--vv-border);
}
body[data-focus-role] #focus-summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,27%) minmax(0,23%) auto;
  grid-template-areas: "room state output exit" "name name name name";
  align-items: center;
  gap: 0 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px 8px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
}
body[data-focus-role] #focus-summary > div { min-width: 0; }
body[data-focus-role] #focus-summary :is(p,h1) {
  margin: 0;
  padding: 0;
  min-height: 0;
  width: auto;
  max-width: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  font-size: .75rem;
  line-height: 1.33;
  white-space: normal;
  overflow-wrap: anywhere;
}
body[data-focus-role] #focus-summary #focus-room {
  grid-area: room;
  display: flex;
  align-items: center;
  gap: 4px;
}
body[data-focus-role] #focus-summary #focus-room h1 {
  min-width: 0;
  flex: 0 1 auto;
  font-size: .9rem;
  font-weight: 700;
}
body[data-focus-role] #focus-summary #focus-room h1[dir="auto"] {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
body[data-focus-role] #focus-summary #focus-state { grid-area: state; font-weight: 600; }
body[data-focus-role="publisher"] #focus-state #capture-state {
  display: block;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  font-size: .75rem;
  text-align: start;
  overflow: visible;
}
body[data-focus-role] #focus-output { grid-area: output; color: #d1d5db; }
body[data-focus-role="publisher"] #focus-output #publisher-live-output {
  display: block;
  color: inherit;
  font: inherit;
}
body[data-focus-role="listener"] #focus-summary:has(#listener-output:not([hidden]):not(:empty)) #play-state[data-state="captions_ready"],
body[data-focus-role="listener"] #focus-state:has(#play-state:is([data-state="paused"],[data-state="live_host_paused"]))
  #listener-event-status[data-same-recording]:is([data-state="paused"],[data-state="recording"]) { display: none; }
body[data-focus-role] #focus-full-name { grid-area: name; }
body[data-focus-role] #focus-full-name p { padding-block: 8px; }
body[data-focus-role] #focus-state :is(#play-state,#capture-state)::before {
  display: inline-block;
  width: .5rem;
  vertical-align: middle;
  margin-inline-end: 6px;
}
body[data-focus-role="listener"] #focus-state #play-state[data-audibility="silent"] { --vv-indicator: #94a3b8; }
body[data-focus-role] :is(#focus-toolbar,#focus-reader-actions,#focus-output-editor) :is(button,summary,input,select):focus-visible {
  outline: 3px solid var(--vv-focus);
  outline-offset: 2px;
}
body[data-focus-role] #focus-summary :is(button,h1):focus-visible { outline-color: #67e8f9; }
body[data-focus-role] #focus-essential {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  max-width: 1120px;
  margin: 5px auto 0;
}
body[data-focus-role] #focus-actions,
body[data-focus-role] #focus-actions #publisher-capture-actions { display: contents; }
body[data-focus-role] :is(#focus-toolbar,#focus-reader-actions,#focus-output-editor) :is(button,select),
body[data-focus-role] #focus-options > summary {
  box-sizing: border-box;
  min-width: 44px;
  max-width: 100%;
  min-height: 44px;
  height: auto;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--vv-control-border);
  border-radius: 8px;
  background: var(--vv-surface);
  color: var(--vv-text);
  font: inherit;
  font-size: .77rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}
body[data-focus-role] #focus-toolbar #focus-exit {
  grid-area: exit;
  border-color: #94a3b8;
  background: #263244;
  color: #fff;
  white-space: nowrap;
}
body[data-focus-role] #focus-toolbar #listener-event-name-toggle {
  flex: 0 0 44px;
  width: 44px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #fff;
}
body[data-focus-role] #focus-summary #publisher-event-name { flex: 0 0 44px; }
body[data-focus-role] #focus-summary #publisher-event-name-summary {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  color: #fff;
  font-size: 0;
}
body[data-focus-role] #focus-summary #publisher-event-name-summary::before {
  content: "";
  width: 9px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}
body[data-focus-role] #focus-summary #publisher-event-name[open] #publisher-event-name-summary::before {
  transform: translateY(2px) rotate(225deg);
}
body[data-focus-role="publisher"] #focus-publisher-full-name {
  display: none;
  max-width: 1120px;
  margin: 5px auto 0;
}
body[data-focus-role="publisher"] #focus-toolbar:has(#publisher-event-name[open]) #focus-publisher-full-name {
  display: block;
}
body[data-focus-role="publisher"] #focus-publisher-full-name #publisher-event-name-full {
  position: static;
  width: auto;
  margin: 0;
  padding: 6px 8px;
  overflow-wrap: anywhere;
  color: #fff;
  background: #111827;
  border-radius: 6px;
}
body[data-focus-role] #focus-toolbar :is(#focus-downloads, #change-output, #play:is([data-action="listen"],[data-action="read"],[data-action="retry"])) {
  border-color: var(--vv-action);
  background: var(--vv-action);
  color: var(--vv-action-ink);
}
body[data-focus-role] #focus-toolbar button[aria-pressed="true"] { border-color: var(--vv-action); background: #e5f4f8; }
body[data-focus-role="publisher"] #focus-actions #classic-idle-stop,
body[data-focus-role="publisher"]:not(:has(#focus-audio #share-room)) #focus-actions #publisher-share-link {
  display: none !important;
}
body[data-focus-role="publisher"] #focus-audio #share-room {
  flex: 1 0 100%;
  min-width: 0;
  margin: 0;
}
.publisher-share-short,
body[data-focus-role="publisher"] .publisher-share-full { display: none; }
body[data-focus-role="publisher"] .publisher-share-short { display: inline; }
body[data-focus-role="publisher"] #focus-monitor-controls .setting-item {
  display: grid;
  gap: 4px;
  margin-block: 8px;
}
body[data-focus-role="publisher"] #focus-monitor-controls > summary {
  box-sizing: border-box;
  min-height: 44px;
  align-content: center;
  padding-block: 8px;
  cursor: pointer;
}
body[data-focus-role="publisher"] #focus-monitor-controls :is(select,button) {
  width: 100%;
}
body[data-focus-role="publisher"] #focus-actions #stop:not([data-buffer-recovery]) {
  background: var(--vv-danger);
  color: #fff;
  border-color: var(--vv-danger);
}
body[data-focus-role] #focus-options { min-width: 0; max-width: 100%; }
body[data-focus-role] #focus-options > summary { display: list-item; padding-block: 10px; cursor: pointer; }
body[data-focus-role] #focus-options[open] > summary { border-color: var(--vv-action); background: var(--vv-control-hover); }
body[data-focus-role="listener"] :is(#focus-publisher-options,#focus-microphone-options),
body[data-focus-role="publisher"] #focus-listener-options,
body[data-focus-role="publisher"] #focus-options:not(:has(#recovery-microphone:not([hidden]))) #focus-microphone-options,
body[data-focus-role="publisher"] #focus-options:has(#recovery-microphone:not([hidden])) #focus-publisher-options { display: none; }
body[data-focus-role] #focus-tools {
  position: absolute;
  inset-block-start: calc(100% + 5px);
  inset-inline-end: 0;
  box-sizing: border-box;
  width: var(--focus-tools-width);
  max-height: max(44px,calc(100dvh - var(--focus-toolbar-height,150px) - 12px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 10px;
  border: 1px solid var(--vv-border);
  border-radius: 8px;
  background: var(--vv-surface);
  box-shadow: 0 4px 18px #11182726;
}
body[data-focus-role] :is(#focus-audio,#focus-reading,#publisher-focus-reading) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
body[data-focus-role] #focus-reading { margin-top: 6px; }
body[data-focus-role] #focus-audio > :is(#publisher-listening-controls,#listener-listening-controls) {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 4px 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
body[data-focus-role] #focus-audio > #publisher-listening-controls::before { display: none; }
body[data-focus-role] #focus-audio :is(label,output,p,details) { font-size: .75rem; line-height: 1.35; }
body[data-focus-role] #focus-audio label { grid-column: 1 / -1; }
body[data-focus-role="publisher"] #focus-audio #recovery-microphone {
  display: grid;
  gap: 4px;
  width: 100%;
}
body[data-focus-role] #focus-audio input[type="range"] { width: 100%; min-width: 44px; min-height: 44px; margin: 0; accent-color: var(--vv-action); }
body[data-focus-role] #focus-audio output { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
body[data-focus-role] #focus-audio :is(p,details) { grid-column: 1 / -1; width: 100%; margin: 0; }
body[data-focus-role] #focus-tools :is(p:empty,#focus-delay:empty) { display: none; }
body[data-focus-role] #focus-delay { color: var(--vv-muted); margin-top: 6px; }
body[data-focus-role] #focus-delay p { font-size: .75rem; margin: 0; }
body[data-focus-role] #focus-reading #caption-history-controls { gap: 6px; width: 100%; margin: 0; padding: 0; border: 0; }
body[data-focus-role] #focus-reading #caption-history-heading { display: none; }
body[data-focus-role="listener"] #focus-audio #output-settings {
  flex: 1 0 100%;
  min-width: 0;
  margin: 0;
}
body[data-focus-role="listener"] #focus-output-editor {
  box-sizing: border-box;
  width: min(calc(100% - 20px),42rem);
  margin: 12px auto;
  padding: clamp(10px,2.5vw,20px);
  border: 1px solid var(--vv-control-border);
  border-radius: 10px;
  background: var(--vv-surface);
}
body[data-focus-role="listener"] #focus-output-editor :is(#output-settings, button, select, summary, label) {
  scroll-margin-block: 8px;
}
body[data-focus-role="listener"] #focus-output-editor #output-apply { position: static; margin-top: 8px; scroll-margin-block: 8px; }
body[data-focus-role="listener"] #focus-output-editor #switch-output {
  border-color: var(--vv-action);
  background: var(--vv-action);
  color: var(--vv-action-ink);
}
body[data-focus-role="listener"] #focus-output-editor #switch-output[aria-disabled="true"] { opacity: .65; }
body[data-focus-role="listener"]:has(#focus-output-editor:not([hidden])) #focus-tools { display: none; }
body[data-focus-role="listener"]:has(#focus-output-editor:not([hidden])) #focus-toolbar { position: relative; }
@media (max-width: 280px) {
  body[data-focus-role="listener"] #focus-output-editor .listener-preferences { padding-inline: 6px; }
  body[data-focus-role="listener"] #focus-output-editor select {
    padding-inline: 6px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}
body[data-view="listener"] :is(#retry-output,#go-live)[aria-disabled="true"] {
  opacity: .65;
  cursor: default;
}
body[data-focus-role="listener"] #focus-reading #caption-source-toggle::before {
  content: "";
  display: inline-block;
  box-sizing: border-box;
  width: .9em;
  height: .9em;
  margin-inline-end: .38em;
  vertical-align: -.08em;
  border: 1px solid currentColor;
  border-radius: 2px;
}
body[data-focus-role="listener"] #focus-reading #caption-source-toggle[aria-pressed="true"]::before {
  background: var(--vv-action);
  box-shadow: inset 0 0 0 2px #fff;
}
body[data-focus-role="listener"] #listener :is(.audio-gate,#view-transcript,#switch-listener-room) { display: none !important; }
body[data-focus-role="listener"] #listener .listener-feedback { padding-block: 0; }
body[data-focus-role="listener"] #listener .listener-feedback:not(:has( > :not([hidden]):not(:empty):not(#play-state-announcement):not(.listener-recovery))) {
  display: none;
}
body[data-focus-role="listener"] #listener .listener-transcript.stream-log {
  box-sizing: border-box;
  width: min(100%,1120px);
  margin: 0 auto;
  padding: 6px clamp(10px,3vw,48px) max(8px,env(safe-area-inset-bottom));
}
body[data-focus-role="listener"] #focus-reader-actions:not(:empty) { margin-bottom: 6px; }
body[data-focus-role="listener"] #listener #caption-reader[role="region"] {
  min-height: 96px;
  max-height: max(96px,calc(100dvh - var(--focus-toolbar-height,150px) - 32px));
  margin: 0;
  padding: 4px 8px;
  scroll-margin-top: calc(var(--focus-toolbar-height,150px) + 8px);
}
body[data-focus-role="listener"] #listener:has(#focus-reader-actions > button) #caption-reader[role="region"] {
  max-height: max(96px,calc(100dvh - var(--focus-toolbar-height,150px) - 96px));
}
body[data-focus-role="listener"] #listener #caption-reader #meaning {
  margin: 0;
  padding-block-start: .36em;
  font-size: clamp(1.5rem,3.8vw,3rem);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
body[data-focus-role="listener"] #listener .recovered-caption + .recovered-caption { margin-top: 1em; }
body[data-focus-role="listener"] #listener .recovered-caption small {
  margin-top: .3em;
  color: var(--vv-muted);
  font-size: clamp(1rem,1.8vw,1.25rem);
  font-weight: 400;
  line-height: 1.4;
}
body[data-focus-role="listener"][data-listener-captions-hidden] :is(.listener-transcript,#focus-reading,#follow-captions) { display: none !important; }
body[data-focus-role="publisher"] #publisher #publisher-stream { padding: 6px 0; overflow: visible; }
body[data-focus-role="publisher"] #publisher #input-feedback :is(#capture-input-device,label,meter) { display: none; }
body[data-focus-role="publisher"] #publisher #input-feedback:not(:has(#input-level-status:not(:empty),#capture-pending:not([hidden]))) { display: none; }
body[data-focus-role="publisher"] #publisher #input-feedback {
  box-sizing: border-box;
  width: min(calc(100% - 20px),1080px);
  margin: 4px auto;
  padding: 0;
  border: 0;
}
body[data-focus-role="publisher"] #publisher #input-feedback p {
  margin: 0;
  font-size: .72rem;
  line-height: 1.4;
}
body[data-focus-role="publisher"] #publisher #publisher-transcript {
  --focus-publisher-text-inset: clamp(10px,3vw,38px);
  box-sizing: border-box;
  width: min(100%,1120px);
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0 auto;
  padding: 2px 0 max(8px,env(safe-area-inset-bottom));
}
body[data-focus-role="publisher"] #publisher #publisher-transcript-rows {
  padding-inline: var(--focus-publisher-text-inset);
  position: relative;
  max-height: max(96px,calc(100dvh - var(--focus-toolbar-height,150px) - 60px));
  overflow-y: auto;
}
body[data-focus-role="publisher"] #publisher #publisher-transcript :is(#publisher-transcript-status,#publisher-transcript-languages) {
  min-height: 0;
  padding: 0;
  margin: 0 var(--focus-publisher-text-inset) 4px;
  font-size: .73rem;
  line-height: 1.4;
}
body[data-focus-role="publisher"] #publisher #publisher-transcript-status:is([data-input-routine],:empty) { display: none; }
body[data-focus-role="publisher"] #publisher #publisher-transcript .chunk { margin-block: 6px; padding-block: 5px; }
body[data-focus-role="publisher"] #publisher #publisher-transcript .chunk :is(.es,.transcription-only) {
  font-size: clamp(1.5rem,3.8vw,3rem);
  line-height: 1.35;
}
body[data-focus-role="publisher"] #publisher #publisher-transcript .chunk .en:not(.transcription-only) {
  font-size: clamp(1rem,1.8vw,1.25rem);
  line-height: 1.4;
}
body[data-focus-role="publisher"] #publisher #publisher-transcript .transcript-quiet {
  margin-block: 2px;
  padding-block: 2px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
body[data-focus-role="publisher"] #publisher #publisher-transcript .transcript-quiet .transcription-only {
  color: var(--vv-muted);
  font-size: .72rem;
  font-weight: 400;
  line-height: 1.4;
}
body[data-focus-role="publisher"][data-focus-captions-hidden] :is(#publisher-transcript-rows,#publisher-transcript-languages) { display: none !important; }
body[data-focus-role="publisher"][data-focus-source-hidden] #publisher-transcript .chunk:has(.es) :is(.en,.transcript-source-language) { display: none; }
@media(max-width: 980px) {
  body[data-focus-role] #focus-summary {
    grid-template-columns: minmax(0,1fr) minmax(0,auto) auto;
    grid-template-areas: "room room exit" "state output output" "name name name";
  }
}
@media (max-width: 600px) and (min-height: 256px) {
  body[data-focus-role] #focus-summary {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "room exit" "state state" "output output" "name name";
  }
}
@media (min-width: 601px), (min-width: 370px) and (max-height: 255px) {
  body[data-focus-role="listener"]:has(#focus-options[open]) #listener .listener-transcript.stream-log,
  body[data-focus-role="publisher"]:has(#focus-options[open]) #publisher #publisher-transcript {
    width: calc(min(100%,1120px) - var(--focus-tools-width) - 16px);
    margin-inline: max(0px,calc((100% - 1120px) / 2)) auto;
  }
}
@media (max-width: 600px) and (min-height: 256px), (max-width: 369px) {
  body[data-focus-role] #focus-options[open] { flex-basis: 100%; }
  body[data-focus-role] #focus-options > summary { width: fit-content; }
  body[data-focus-role] #focus-tools {
    position: static;
    width: 100%;
    max-height: 26dvh;
    margin-top: 4px;
    box-shadow: none;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  body[data-focus-role] #focus-summary { padding-block: 3px; }
  body[data-focus-role="publisher"] #focus-options:has(#recovery-microphone:not([hidden])) #focus-publisher-options { display: inline; }
  body[data-focus-role="publisher"] #focus-options #focus-microphone-options { display: none; }
  body[data-focus-role="listener"] #listener #caption-reader #meaning { font-size: clamp(1.5rem,3vw,2rem); }
  body[data-focus-role="publisher"] #publisher #publisher-transcript .transcript-language {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }
}
@media (max-height: 255px) {
  /* At browser zoom, three fixed rows can cover the entire viewport. */
  body[data-focus-role] #focus-toolbar { position: relative; padding-block: max(2px,env(safe-area-inset-top)) 2px; }
  body[data-focus-role] #focus-summary {
    grid-template-columns: minmax(0,1fr) minmax(0,37%) auto auto;
    grid-template-areas: "room room disclosure exit" "state output disclosure exit" "name name name name";
    padding-block: 1px;
    gap: 0 6px;
  }
  body[data-focus-role] #focus-summary #focus-room { display: contents; }
  body[data-focus-role] #focus-summary #focus-room h1 { grid-area: room; }
  body[data-focus-role] #focus-summary :is(#listener-event-name-toggle,#publisher-event-name) { grid-area: disclosure; }
  body[data-focus-role] #focus-summary :is(#listener-event-status,#play-state,#capture-state,#listener-output,#publisher-live-output) { line-height: 1.2; }
  body[data-focus-role] #focus-state :is(#play-state,#capture-state)::before { margin-inline-end: 4px; }
  body[data-focus-role] #focus-essential { margin-top: 2px; }
  body[data-focus-role] #focus-options > summary { padding-block: 6px; }
  body[data-focus-role="listener"] #listener .listener-transcript.stream-log { padding-block-start: 0; }
  body[data-focus-role="listener"] #listener #caption-reader[role="region"] {
    box-sizing: border-box;
    min-height: 0;
    max-height: max(56px,calc(100dvh - var(--focus-toolbar-height,100px) - 20px));
    padding-block: 0;
  }
  body[data-focus-role="listener"] #listener:has(#focus-reader-actions > button) #caption-reader[role="region"] {
    max-height: max(56px,calc(100dvh - var(--focus-toolbar-height,100px) - 68px));
  }
  body[data-focus-role="publisher"] #publisher #publisher-stream { padding-block-start: 2px; }
  body[data-focus-role="publisher"] #publisher #publisher-transcript #publisher-transcript-languages {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }
  body[data-focus-role="publisher"] #publisher #publisher-transcript-rows {
    max-height: max(60px,calc(100dvh - var(--focus-toolbar-height,100px) - 12px));
  }
}

/* Audience drawer adapted from Classic Publisher 5304627cb4fb3593d28ec1d6fb2946c65d4fb70f,
   veravox.html:846–885,998–1037. Data is supplied only by the 2.0 audience module. */
#publisher-audience { min-width: 0; }
#publisher-audience .audience-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--vv-control-border);
  border-radius: 8px;
  background: var(--panel-bg,#fff);
  color: var(--vv-text);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}
#publisher-audience .audience-trigger[aria-expanded="true"] { background: #e5f4f8; border-color: var(--vv-action); }
.audience-overlay { display: contents; }
.audience-overlay .listeners-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0f172a66;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.audience-overlay .listeners-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.audience-overlay .listeners-drawer {
  box-sizing: border-box;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  width: min(460px,100vw);
  height: 100dvh;
  max-height: 100dvh;
  padding: max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) 20px;
  border-left: 1px solid var(--vv-border);
  background: #fff;
  color: var(--vv-text);
  box-shadow: -12px 0 32px #0f172a26;
  transform: translateX(104%);
  transition: transform 150ms ease;
  text-align: left;
}
.audience-overlay .listeners-drawer.is-open { transform: translateX(0); }
.audience-overlay .listeners-drawer__header { display: flex; align-items: flex-start; gap: 12px; flex: 0 0 auto; padding-bottom: 16px; border-bottom: 1px solid var(--vv-border); }
.audience-overlay .listeners-drawer__header > :first-child { min-width: 0; flex: 1 1 auto; }
.audience-overlay .listeners-drawer__title { margin: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.audience-overlay .listeners-drawer__summary { margin: 8px 0 0; color: var(--vv-muted); font-size: .85rem; line-height: 1.5; overflow-wrap: anywhere; }
.audience-overlay .listeners-drawer__count { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 36px; height: 36px; padding: 0 6px; border: 1px solid var(--vv-border); border-radius: 18px; background: var(--vv-control-hover); color: var(--vv-text); font-size: 1rem; font-weight: 700; }
body[data-view="publisher"] .audience-overlay .listeners-drawer__close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 1px solid var(--vv-control-border); border-radius: 8px; background: #fff; color: var(--vv-text); font-size: 1.5rem; }
.audience-overlay .listeners-drawer__body { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; padding-top: 12px; overflow-y: auto; overscroll-behavior: contain; }
.audience-overlay .audience-updated { margin: 0; font-size: .8rem; line-height: 1.4; color: var(--vv-muted); }
.audience-overlay .listeners-search { display: grid; gap: 6px; }
.audience-overlay .listeners-search label { color: var(--vv-muted); font-size: .85rem; font-weight: 600; }
body[data-view="publisher"] .audience-overlay :is(input,select) { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--vv-control-border); border-radius: 8px; background: #fff; color: var(--vv-text); font: inherit; font-size: .875rem; }
.audience-overlay .listeners-drawer__list { display: flex; flex-direction: column; gap: 12px; }
.audience-overlay .listeners-drawer__empty { padding: 16px 0; font-size: .9rem; line-height: 1.5; color: var(--vv-muted); }
.audience-overlay .listener-presence-row { min-width: 0; padding: 12px 0; border-top: 1px solid var(--vv-border); }
.audience-overlay .listener-presence-row:first-child { border-top: 0; }
.audience-overlay .listener-presence-row__header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.audience-overlay .listener-presence-row__header strong { font-size: .9rem; overflow-wrap: anywhere; }
.audience-overlay .listener-presence-row__header span { font-size: .8rem; color: var(--vv-muted); }
.audience-overlay .listener-presence-row__details p { margin: 6px 0 0; color: var(--vv-muted); font-size: .85rem; line-height: 1.5; overflow-wrap: anywhere; }
.audience-overlay :focus-visible { outline: 3px solid var(--vv-focus); outline-offset: 3px; }
@media(prefers-reduced-motion:reduce) {
  .audience-overlay :is(.listeners-drawer,.listeners-drawer-backdrop) { transition: none !important; }
}

.audience-overlay .listeners-drawer__count {
  flex: 0 0 auto;
  max-width: 45%;
  min-height: 36px;
  height: auto;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: .875rem;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.audience-overlay .listeners-drawer__header { max-height: 45dvh; overflow-y: auto; }
.audience-overlay .listeners-drawer__close { position: sticky; top: 0; }
.audience-overlay .listeners-drawer__close:focus-visible { outline-offset: -4px; }
@media (max-width: 280px) {
  .audience-overlay .listeners-drawer { padding-inline: 8px; }
  .audience-overlay .listeners-drawer__header {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 6px;
    align-items: center;
  }
  .audience-overlay .listeners-drawer__count { grid-row: 2; grid-column: 1 / -1; justify-self: start; max-width: 100%; }
  .audience-overlay .listeners-drawer__close { grid-row: 1; grid-column: 2; }
  body[data-view="publisher"] .audience-overlay .listeners-drawer__body :is(input,select) {
    padding-inline: 6px;
    font-size: .8rem;
  }
}
@media (max-height: 320px) {
  .audience-overlay .listeners-drawer {
    padding-block: max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-bottom));
  }
  .audience-overlay .listeners-drawer__header { padding-bottom: 6px; }
  .audience-overlay .listeners-drawer__body { padding-top: 6px; gap: 8px; }
}
/* Focus entry and room options use the shared controls. */
:is(#listener-focus,#publisher-focus) {
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--vv-control-border);
  border-radius: 8px;
  background: #fff;
  color: var(--vv-text);
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.35;
}
:is(#listener-focus,#publisher-focus):focus-visible { outline: 3px solid var(--vv-focus); outline-offset: 3px; }
#listener-focus-home { display: contents; }
body[data-view="publisher"] #publisher:not([data-event-active],[data-recording-ended]) #classic-idle-stop:disabled { display: none; }
body[data-view="publisher"] #publisher:not([data-event-active],[data-recording-ended]) #publisher-focus {
  display: block;
  margin-inline: auto;
}
body[data-view="publisher"] #publisher:not([data-event-active],[data-recording-ended]) #publisher-listening-controls {
  width: min(100%,36rem);
  margin-inline: auto;
}
body[data-view="listener"] #listener-output-modes .listener-mode-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
#listener-output-mode-note { margin: 8px 0 0; color: var(--vv-muted); font-size: .85rem; line-height: 1.4; }
.voice-preview {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--vv-control-border);
  border-radius: 8px;
  background: var(--vv-surface);
  color: var(--vv-text);
  font: inherit;
  cursor: pointer;
}
.voice-preview:disabled { color: var(--vv-muted); cursor: default; }
#guide-voice-preview { margin-top: 8px; }
#listener-voice-preview { margin-block: 8px; }
/* Shared navigation targets remain usable by touch at every viewport. */
body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav :is(.veravox-site-nav__brand,.veravox-site-nav__link,#interface-language) {
  min-height: 44px;
  box-sizing: border-box;
}
body:is([data-view="publisher"],[data-view="listener"]) .app-container { box-shadow: none; }
body:is([data-view="publisher"],[data-view="listener"]) :is(.listening-delay-details,#listener-options) > summary {
  box-sizing: border-box;
  min-height: 44px;
  padding-block: var(--space-3);
}
body[data-view="listener"] #listener:has(#play-state[data-state="idle"]) #listener-options > summary {
  min-height: 44px;
  padding-block: var(--space-3);
}
#publisher-settings #room-alias-status:empty { display: none; }
#publisher-settings :is(#room-alias,#room-password)[aria-invalid="true"] { border-color: var(--vv-danger); }
#publisher-settings .setting-room__controls + .setting-room__controls { margin-top: var(--space-2); }
#publisher-settings .setting-room__controls button[aria-disabled="true"] {
  cursor: progress;
  opacity: .65;
}
@media (max-height:500px) and (orientation:landscape) {
  body[data-view="publisher"] #publisher:has(#publisher-save:not([hidden])) .publisher-header { position: static; }
}

#publisher-settings #microphone-gain { min-height: 44px; }
#publisher-save .downloads-artifact > details > summary {
  box-sizing: border-box;
  min-height: 44px;
  padding-block: 10px;
  cursor: pointer;
}
@media(max-width:640px) {
  #publisher-settings .setting-mic__gain { grid-template-columns: minmax(44px,1fr) auto; row-gap: 4px; }
  #publisher-settings .setting-mic__gain label { grid-column: 1 / -1; }
}

body[data-view="listener"] #listener .listener-tab { min-height: 44px; }

/* Text enlargement may need additional navigation rows instead of clipping. */
@media(max-width:640px) {
  body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav { flex-wrap: wrap; }
  body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__account {
    position: static;
  }
  body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__menu {
    inset-inline-end: 12px;
    top: 100%;
    width: min(320px, calc(100% - 24px));
  }
  body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__menu::before {
    display: none;
  }
  body:is([data-view="publisher"],[data-view="listener"]) .veravox-site-nav__language {
    min-width: min(8.75rem,100%);
    max-width: 100%;
  }
  body[data-view="publisher"] #publisher .tabs { flex-wrap: wrap; }
  body[data-view="publisher"] #publisher .tabs .tab-btn { flex: 1 1 7rem; white-space: normal; }
}

body[data-view="listener"] #listener .listener-tab.active { color: var(--vv-action-hover); }

/* ==========================================================================
   Finish line. Themes (Classic's light / dark / glass), one alert component,
   the Publisher header clock and delay, transcript-first Stream, and the
   phone Listener entry. Later rules on purpose: they adapt the layers above.
   ========================================================================== */

/* --- Themes: Classic's variables for both variable families ---------------- */
html.dark-theme, html.dark-theme body[data-view] {
  --bg-base:#111827;--panel-bg:#1f2937;--panel-bg-light:#273244;--panel-border:#3b4658;
  --brand-accent:#22b8d6;--brand-accent-strong:#67d8ee;--brand-accent-soft:rgba(125,211,252,.42);
  --text-primary:#f9fafb;--text-secondary:#cbd5e1;--text-tertiary:#94a3b8;--text-inverse:#111827;
  --status-ok-text:#86efac;--status-ok-bg:rgba(21,128,61,.34);
  --status-err-text:#fecaca;--status-err-bg:rgba(185,28,28,.34);
  --status-idle-text:#bfdbfe;--status-idle-bg:rgba(30,64,175,.34);
  --toast-bg:#111827;--toast-text:#f8fafc;--toast-muted:#cbd5e1;--toast-border:rgba(148,163,184,.42);
  --toast-ok-bg:#052e16;--toast-ok-text:#dcfce7;--toast-ok-border:rgba(134,239,172,.38);
  --toast-err-bg:#450a0a;--toast-err-text:#fee2e2;--toast-err-border:rgba(252,165,165,.4);
  --shadow-soft:0 1px 3px 0 rgba(0,0,0,.15),0 1px 2px -1px rgba(0,0,0,.15);
  --shadow-lift:0 10px 15px -3px rgba(0,0,0,.2),0 4px 6px -4px rgba(0,0,0,.2);
  --vv-page:#111827;--vv-surface:#1f2937;--vv-text:#f9fafb;--vv-muted:#cbd5e1;--vv-border:#3b4658;
  --vv-control-border:#7b8798;--vv-control-fill:#273244;--vv-control-hover:#164e63;
  --vv-accent:#22b8d6;--vv-action:#0e7490;--vv-action-hover:#155e75;--vv-action-ink:#fff;--vv-focus:#67e8f9;
  --vv-stage-background:#1f2937;--vv-indicator-neutral:#93c5fd;--vv-indicator-live:#86efac;
  --vv-indicator-attention:#fcd34d;--vv-warning:#fcd34d;--vv-danger:#e11d48;--vv-danger-hover:#be123c;
  --vv-shadow:0 1px 3px #0006, 0 6px 16px #0005;
  --alert-bad-bg:#3f1219;--alert-bad-text:#fecdd3;--alert-bad-border:#9f1239;
  --alert-warn-bg:#3a2a08;--alert-warn-text:#fde68a;--alert-warn-border:#a16207;
  --alert-ok-bg:#0b2e1c;--alert-ok-text:#bbf7d0;--alert-ok-border:#15803d;
  --accent-text:#67d8ee;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  /* The device setting applies before the script has run, and until a theme is chosen. */
  html:not(.light-theme):not(.glass-theme), html:not(.light-theme):not(.glass-theme) body[data-view] {
    --bg-base:#111827;--panel-bg:#1f2937;--panel-bg-light:#273244;--panel-border:#3b4658;
    --brand-accent:#22b8d6;--brand-accent-strong:#67d8ee;--brand-accent-soft:rgba(125,211,252,.42);
    --text-primary:#f9fafb;--text-secondary:#cbd5e1;--text-tertiary:#94a3b8;--text-inverse:#111827;
    --status-ok-text:#86efac;--status-ok-bg:rgba(21,128,61,.34);
    --status-err-text:#fecaca;--status-err-bg:rgba(185,28,28,.34);
    --status-idle-text:#bfdbfe;--status-idle-bg:rgba(30,64,175,.34);
    --toast-bg:#111827;--toast-text:#f8fafc;--toast-muted:#cbd5e1;--toast-border:rgba(148,163,184,.42);
    --shadow-soft:0 1px 3px 0 rgba(0,0,0,.15),0 1px 2px -1px rgba(0,0,0,.15);
    --shadow-lift:0 10px 15px -3px rgba(0,0,0,.2),0 4px 6px -4px rgba(0,0,0,.2);
    --vv-page:#111827;--vv-surface:#1f2937;--vv-text:#f9fafb;--vv-muted:#cbd5e1;--vv-border:#3b4658;
    --vv-control-border:#7b8798;--vv-control-fill:#273244;--vv-control-hover:#164e63;
    --vv-accent:#22b8d6;--vv-action:#0e7490;--vv-action-hover:#155e75;--vv-action-ink:#fff;--vv-focus:#67e8f9;
    --vv-stage-background:#1f2937;--vv-indicator-neutral:#93c5fd;--vv-indicator-live:#86efac;
    --vv-indicator-attention:#fcd34d;--vv-warning:#fcd34d;--vv-danger:#e11d48;--vv-danger-hover:#be123c;
    --vv-shadow:0 1px 3px #0006, 0 6px 16px #0005;
    --alert-bad-bg:#3f1219;--alert-bad-text:#fecdd3;--alert-bad-border:#9f1239;
    --alert-warn-bg:#3a2a08;--alert-warn-text:#fde68a;--alert-warn-border:#a16207;
    --alert-ok-bg:#0b2e1c;--alert-ok-text:#bbf7d0;--alert-ok-border:#15803d;
    --accent-text:#67d8ee;
    color-scheme: dark;
  }
}
html.glass-theme, html.glass-theme body[data-view] {
  --brand-accent:#005f73;--brand-accent-strong:#004c5c;--brand-accent-soft:rgba(0,95,115,.3);
  --panel-bg:rgba(255,255,255,.82);--panel-bg-light:rgba(255,255,255,.62);--panel-border:rgba(255,255,255,.55);
  --text-primary:#001219;--text-secondary:#1d2d44;--text-tertiary:#4b5563;--text-inverse:#fff;
  --shadow-lift:0 12px 40px rgba(0,0,0,.15);--shadow-soft:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.07);
  --vv-surface:rgba(255,255,255,.86);--vv-text:#001219;--vv-muted:#1d2d44;--vv-border:rgba(0,18,25,.16);
  --vv-control-fill:rgba(255,255,255,.75);--vv-stage-background:rgba(255,255,255,.6);
  --vv-accent:#005f73;--vv-action:#005f73;--vv-action-hover:#004c5c;--vv-focus:#005f73;
  --accent-text:#004c5c;
}
:root {
  --alert-bad-bg:#fdecec;--alert-bad-text:#7f1d1d;--alert-bad-border:#f1b5b5;
  --alert-warn-bg:#fff4dc;--alert-warn-text:#6b3f08;--alert-warn-border:#f0cf8e;
  --alert-ok-bg:#eaf7ee;--alert-ok-text:#14532d;--alert-ok-border:#a9d9b7;
  --accent-text:var(--vv-action);
}
@keyframes vv-glass-gradient {0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
html.glass-theme body {
  background:linear-gradient(-45deg,#ffbe0b,#e76f51,#005f73,#001219);background-size:400% 400%;
  animation:vv-glass-gradient 15s ease infinite;
}
@media (prefers-reduced-motion: reduce) { html.glass-theme body { animation: none; } }
html.glass-theme .app-container { backdrop-filter:blur(20px) saturate(150%);-webkit-backdrop-filter:blur(20px) saturate(150%); }
html.glass-theme .veravox-site-nav__menu { background:#fff;color:#001219;border-color:rgba(15,23,42,.12); }
html:is(.dark-theme,.glass-theme) body { background-color: var(--bg-base); color: var(--text-primary); }
html.dark-theme :is(dialog, .listeners-drawer, .veravox-site-nav__menu) { background: var(--panel-bg); color: var(--text-primary); border-color: var(--panel-border); }
html.dark-theme :is(input, select, textarea):not([type="range"]):not([type="radio"]):not([type="checkbox"]) {
  background-color: var(--vv-control-fill); color: var(--text-primary); border-color: var(--vv-control-border);
}
html.dark-theme :is(.btn.secondary, :is(#listener-focus,#publisher-focus), #publisher-audience-trigger, .listener-tab, #switch-listener-room,
    #selection button:not(#play), .listener-recovery button, #caption-history-controls button, #galleryPanel button, .room-card,
    #publisher-guide button:not(.btn:not(.secondary)), #publisher-listening-controls button, .downloads-artifact-links button) {
  background: var(--vv-control-fill); color: var(--text-primary); border-color: var(--vv-control-border);
}
/* Accent used as text needs a lighter tone on dark surfaces than it has as a button fill. */
html.dark-theme :is(#switch-listener-room, .invite-qr-actions button, .welcome-options :is(a, button), #caption-new,
    #listener-output-modes .listener-mode-options input:checked + label, #share-room #copy-invite, .listener-tab-join,
    .listener-tab.active, #guide-progress, .listener-tabs button[aria-expanded="true"], .room-card__avatar, .room-card__current,
    .room-card__join, .badge-live, #publisher-transcript .chunk.playing .es, .downloads-artifact-links a.text-link,
    .listeners-drawer__count, .veravox-site-nav__link:hover, .veravox-site-nav__menu-link:hover, a):where(:not(.welcome-action)) { color: var(--accent-text); }
html.dark-theme #listener-output-modes .listener-mode-options input:checked + label { background: #123a47; border-color: var(--accent-text); }
html.dark-theme :is(.audio-gate__content, .publisher-guide-header, .publisher-guide-actions, .settings-section, .downloads-final-card,
    .downloads-section, #publisher-listening-controls, .listener-preferences, .microphone-setup, .stream-placeholder, .chunk) {
  background-color: var(--panel-bg); background-image: none; color: var(--text-primary); border-color: var(--panel-border);
}
html.dark-theme body[data-view="listener"] #listener .audio-gate__content#selection::before { opacity: .15; }
html.dark-theme meter { background: #111827; }

.theme-toggle{position:relative;flex:0 0 auto;background:var(--panel-bg-light);border:1px solid var(--panel-border);border-radius:99px;width:40px;height:40px;min-height:40px;padding:0;display:inline-flex;align-items:center;justify-content:center;color:var(--text-secondary);cursor:pointer}
.theme-toggle:hover{color:var(--text-primary);background:var(--panel-border)}
.theme-toggle:focus-visible{outline:3px solid var(--vv-focus);outline-offset:2px}
.theme-toggle .icon{width:18px;height:18px}
.theme-toggle .icon svg{width:18px;height:18px;display:block}
.theme-toggle .icon-sun,.theme-toggle .icon-moon,.theme-toggle .icon-glass{display:none}
html:not(.dark-theme):not(.glass-theme) .theme-toggle .icon-moon{display:block}
html.dark-theme .theme-toggle .icon-glass{display:block}
html.glass-theme .theme-toggle .icon-sun{display:block}
body[data-focus-role] .theme-toggle { display: none; }

/* Home and Host lead to the same page. */
.veravox-site-nav [data-veravox-nav="home"] { display: none; }

/* --- One alert component --------------------------------------------------- */
.app-alert {
  box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  width: 100%; margin: 0; padding: 12px 16px; border: 1px solid var(--alert-warn-border); border-radius: 10px;
  background: var(--alert-warn-bg); color: var(--alert-warn-text);
  font-size: .95rem; font-weight: 600; line-height: 1.45; text-align: start;
}
.app-alert[data-tone="ok"] { border-color: var(--alert-ok-border); background: var(--alert-ok-bg); color: var(--alert-ok-text); }
.app-alert[data-tone="bad"] { border-color: var(--alert-bad-border); background: var(--alert-bad-bg); color: var(--alert-bad-text); }
.app-alert .btn { min-height: 40px; margin: 0; }
body[data-view="publisher"] #publisher .publisher-alerts { display: grid; gap: 8px; }
body[data-view="publisher"] #publisher .publisher-alerts:not(:has(> :not([hidden]))) { display: none; }
body[data-view="publisher"] #publisher .publisher-alerts:has(> :not([hidden])) { margin-top: 10px; }
body[data-view="publisher"] #publisher .publisher-alerts > #vf-pub-capture-notice { margin: 0; }
body[data-focus-role="publisher"] #publisher .publisher-alerts { display: none; }

/* A Publisher error is a full-width row under the buttons, not a small red block. */
body[data-view="publisher"]:not([data-focus-role]) #publisher .header-content:has(#capture-state[data-tone="attention"]:not(:empty)) {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher .header-content:has(#capture-state[data-tone="attention"]:not(:empty)) .header-info {
  flex: 1 1 100%; width: 100%; max-width: none; justify-content: flex-start; order: 2;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher #capture-state[data-tone="attention"]:not(:empty) {
  flex: 1 1 100%; display: block; box-sizing: border-box; width: 100%; max-width: none; height: auto; min-height: 0;
  padding: 12px 16px; border: 1px solid var(--alert-bad-border); border-radius: 10px; box-shadow: none;
  background: var(--alert-bad-bg); background-image: none; color: var(--alert-bad-text);
  font-size: .95rem; font-weight: 600; line-height: 1.45; text-align: start; overflow: visible; hyphens: manual;
}

/* --- Publisher header: status, clock, delay and audience on one row --------- */
body[data-view="publisher"]:not([data-focus-role]) #publisher .header-info {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; width: auto; max-width: 100%;
  grid-template-columns: none; padding: 6px 10px;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher #capture-state { min-width: 0; height: auto; min-height: 44px; padding: 8px 14px; }
body[data-view="publisher"] #publisher :is(#publisher-clock, #publisher-delay) {
  margin: 0; padding: 0; color: var(--text-secondary); font-size: .85rem; font-weight: 600; line-height: 1.3;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
body[data-view="publisher"] #publisher #publisher-clock { color: var(--text-primary); font-size: .95rem; }
body[data-view="publisher"] #publisher #publisher-audience { margin: 0; }
body[data-view="publisher"] #publisher #publisher-audience .audience-trigger { margin: 0; }

/* The reload case: one large way back, with the time lost in view. */
body[data-view="publisher"] #publisher[data-resume-here] #takeover {
  min-height: 56px; padding: 14px 22px; border-color: var(--vv-action); background: var(--vv-action); color: var(--vv-action-ink);
  font-size: 1.05rem; font-weight: 700;
}

/* --- Publisher Stream: the words first --------------------------------------- */
body[data-view="publisher"] #publisher .tabs-container > .content-wrapper { display: flex; align-items: center; gap: 12px; }
body[data-view="publisher"] #publisher .tabs-container .tabs { flex: 1 1 auto; min-width: 0; }
body[data-view="publisher"] #publisher .tabs-container #publisher-focus,
body[data-view="publisher"] #publisher:not([data-event-active],[data-recording-ended]) .tabs-container #publisher-focus {
  flex: 0 0 auto; display: inline-block; margin: 0; min-height: 40px; padding: 8px 14px;
}
body[data-view="publisher"] #publisher-stream #readyStateTitle,
body[data-view="publisher"] #publisher-stream #publisher-heading { text-align: center; }
body[data-view="publisher"] #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream #publisher-heading { text-align: start; }
body[data-view="publisher"] #publisher #publisher-readiness { margin: 0 0 14px; font-size: .9rem; font-weight: 600; color: var(--text-secondary); }
body[data-view="publisher"] #publisher #publisher-readiness::before {
  content: ""; display: inline-block; width: .6em; height: .6em; margin-inline-end: .5em; border-radius: 50%; background: #d97706;
}
body[data-view="publisher"] #publisher #publisher-readiness[data-state="ready"]::before { background: #16a34a; }
body[data-view="publisher"] #publisher :is(#start-original-only, #start-standard-voice) { margin: 0 0 14px; }

body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream {
  display: flex; flex-direction: column; padding-block: 10px; overflow-y: auto;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream[hidden] { display: none; }
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream > .content-wrapper {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream .publisher-stage {
  flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  grid-template-rows: auto auto auto minmax(0, 1fr); align-items: center; gap: 6px 20px;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream .publisher-stage > * { grid-column: 1 / -1; }
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream #publisher-heading {
  margin: 0; font-size: 1.15rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream #input-feedback {
  grid-column: 1; align-self: center; margin: 0; padding: 0; border: 0; gap: 2px 10px;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream #input-feedback[hidden] + #publisher-listening-controls,
body[data-view="publisher"]:not([data-focus-role]) #publisher[data-recording-ended] #publisher-stream #publisher-listening-controls { grid-column: 1 / -1; }
/* My listening: one line (mute, volume, status, delay) of fixed width. */
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream #publisher-listening-controls {
  grid-column: 2; box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; margin: 0; padding: 6px 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; border-radius: 10px;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-listening-controls::before { flex: 0 0 auto; margin: 0; font-size: .85rem; }
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-listening-controls > button { min-height: 40px; padding: 6px 12px; grid-area: auto; }
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-listening-controls :is(label, output, input) { grid-area: auto; margin: 0; }
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-listening-controls input[type="range"] { width: 110px; min-height: 40px; }
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-listening-controls :is(#publisher-playback-status, .listening-delay) {
  flex: 0 1 auto; margin: 0; font-size: .82rem; grid-area: auto;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-listening-controls #publisher-playback-status { min-width: 13.5em; }
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-listening-controls .listening-delay-details { display: none; }
body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream #publisher-transcript.stream-log {
  height: auto; min-height: 240px; max-height: none; align-self: stretch; margin: 0;
}
/* The transcript fills the rest of the screen and scrolls inside itself, so the newest rows stay in view while
   the Publisher watches; without a height it grew with every row and the newest ones fell below the fold. */
@media (min-width: 761px) {
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream #publisher-transcript.stream-log {
    /* The page above the transcript (header, tabs, input and My listening) is about 340 px at laptop sizes. */
    min-height: 240px; height: calc(100dvh - 360px); overflow: hidden;
  }
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream #publisher-transcript-rows {
    flex: 1 1 auto;
  }
}
body[data-view="publisher"]:not([data-focus-role]) #publisher #publisher-transcript-languages { margin: 4px 0; }
body[data-view="publisher"] #publisher #publisher-transcript-rows { padding-top: 6px; scroll-padding-top: 6px; }
body[data-view="publisher"] #publisher #publisher-transcript .chunk:first-child { padding-top: 10px; }
body[data-view="publisher"] #publisher-listening-controls { box-sizing: border-box; max-width: 100%; }
body[data-view="publisher"] #publisher .publisher-stream-actions #publisher-live-output { margin: 8px 0 0; color: var(--text-secondary); font-size: .82rem; }
@media (max-width: 760px) {
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream .publisher-stage { grid-template-columns: minmax(0, 1fr); }
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream :is(#input-feedback, #publisher-listening-controls) { grid-column: 1 / -1; }
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream { overflow-y: auto; }
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream .publisher-stage { grid-template-rows: none; }
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream #publisher-transcript.stream-log { min-height: 55vh; height: 75dvh; overflow: hidden; }
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active],[data-recording-ended]) #publisher-stream #publisher-transcript-rows { flex: 1 1 auto; }
}

/* --- Second device, storage, sizes, deletion --------------------------------- */
#open-room-dialog { max-width: min(34rem, calc(100vw - 2rem)); }
#open-room-choices { display: grid; gap: 8px; margin: 12px 0; }
#open-room-choices label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--panel-border, var(--vv-border)); border-radius: 10px; }
#open-room-choices label small { margin-inline-start: auto; color: var(--text-secondary, var(--vv-muted)); }
#open-room-choices:has(label:only-child) input { display: none; }
#open-room-dialog .controls { flex-wrap: wrap; }
.downloads-size { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.downloads-delete { margin-top: 12px; }
.downloads-delete__confirm { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--alert-bad-border); border-radius: 10px; background: var(--alert-bad-bg); color: var(--alert-bad-text); }
.downloads-delete__confirm p { margin: 0; font-weight: 600; }
.downloads-delete__confirm button { justify-self: start; }
#publisher-storage-free { margin: 0 0 12px; }
.listeners-drawer__totals { margin: 0 0 8px; font-weight: 600; font-size: .9rem; }
.listeners-drawer__status:not(:empty) { margin: 0 0 8px; color: var(--alert-bad-text); font-weight: 600; }
.listener-presence-row__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.listener-presence-row__actions p { flex: 1 1 100%; margin: 0; font-size: .85rem; font-weight: 600; }
.listener-presence-row__actions button { min-height: 40px; padding: 6px 12px; font-size: .85rem; }
.listeners-drawer__removed { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--panel-border, var(--vv-border)); }
.listeners-drawer__removed h4 { margin: 0 0 8px; font-size: .9rem; }
.listener-removed-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: .9rem; }
.listener-removed-row button { min-height: 40px; padding: 6px 12px; font-size: .85rem; }
#room-join-code-field { display: grid; gap: .3rem; }
#room-carry-note:not(:empty) { margin: 6px 0 0; }

/* --- Listener: notices, skipped text, the quiet line -------------------------- */
[data-view="listener"] #play-notice[data-kind] {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: .65rem 0 0; padding: 10px 14px;
  border: 1px solid var(--alert-warn-border); border-radius: 10px; background: var(--alert-warn-bg); color: var(--alert-warn-text);
  font-size: .92rem; font-weight: 600; line-height: 1.4; text-align: start;
}
[data-view="listener"] #play-notice[data-kind] span { flex: 1 1 14rem; }
[data-view="listener"] #play-notice[data-kind] button {
  min-height: 40px; margin: 0; padding: 6px 12px; border: 1px solid currentColor; border-radius: 8px; background: transparent; color: inherit;
  font: inherit; font-size: .88rem;
}
body[data-focus-role="listener"] #play-notice[data-kind] { margin: 6px 10px; }
#meaning .skipped-marker, #meaning .transcript-note {
  display: block; margin: 10px 0 4px; padding: 6px 10px; border-inline-start: 3px solid var(--alert-warn-border);
  background: var(--alert-warn-bg); color: var(--alert-warn-text); font-size: .85rem; font-weight: 600; line-height: 1.4;
}
#meaning .skipped-caption { opacity: .78; font-style: italic; }
#caption-reader { padding-top: 10px; scroll-padding-top: 10px; }
[data-view="listener"] #listener-device-note:not([hidden]) { margin: 6px 0 0; color: var(--vv-warning); font-size: .88rem; font-weight: 600; }

/* --- Listener entry on a phone: Listen stays in reach ------------------------- */
body[data-view="listener"] #listener[data-direct-link] :is(.listener-tabs, #switch-listener-room) { display: none; }
@media (max-width: 640px), (max-height: 500px) and (orientation: landscape) {
  body[data-view="listener"]:not([data-focus-role]) .veravox-site-nav { flex-wrap: nowrap; gap: 8px; padding-block: 6px; }
  body[data-view="listener"]:not([data-focus-role]) .veravox-site-nav .veravox-site-nav__brand span { display: none; }
  body[data-view="listener"]:not([data-focus-role]) .veravox-site-nav .veravox-site-nav__language { flex: 1 1 auto; min-width: 0; }
  body[data-view="listener"]:not([data-focus-role]) .veravox-site-nav .veravox-site-nav__account-label { display: none; }
  body[data-view="listener"]:not([data-focus-role]) #listener[data-entry] .listener-header { padding-block: 4px; }
  body[data-view="listener"]:not([data-focus-role]) #listener[data-entry] .listener-header :is(#listener-heading, #play-state:empty) { display: none; }
  body[data-view="listener"]:not([data-focus-role]) #listener[data-entry] .audio-gate { padding-block: 8px; }
  body[data-view="listener"]:not([data-focus-role]) #listener[data-entry] .audio-gate__icon { display: none; }
  body[data-view="listener"]:not([data-focus-role]) #listener[data-entry] .audio-gate__content#selection { gap: 8px; padding: 12px 14px 14px; }
  body[data-view="listener"]:not([data-focus-role]) #listener[data-entry] #listener-entry-context h2 { margin: 0; font-size: 1.2rem; line-height: 1.25; }
  body[data-view="listener"]:not([data-focus-role]) #listener[data-entry] #listener-entry-context p { margin: 2px 0 0; font-size: .9rem; }
  body[data-view="listener"]:not([data-focus-role]) #listener[data-entry] #listener-output-mode-note { display: none; }
  body[data-view="listener"]:not([data-focus-role]) #listener[data-entry] #output-settings { gap: 8px; }
  body[data-view="listener"]:not([data-focus-role]) #listener[data-entry] #selection #play {
    position: sticky; bottom: max(8px, env(safe-area-inset-bottom, 0px)); z-index: 3; order: 0;
    width: 100%; min-height: 52px; margin: 0; font-size: 1.05rem;
    box-shadow: 0 0 0 8px var(--panel-bg, #fff), 0 -8px 18px rgba(0, 0, 0, .12);
  }
}

/* --- Focus: delay beside the status, audio-only stage, chevron, reader edge --- */
body:not([data-focus-role]) :is(#focus-delay-chip, #focus-audio-stage) { display: none; }
body[data-focus-role] #focus-summary #focus-state { display: flex; flex-direction: column; }
body[data-focus-role] #focus-summary #focus-state #focus-delay-chip {
  order: 5; margin: 0; padding: 0; color: #cbd5e1; font-size: .78rem; font-weight: 600; line-height: 1.25; white-space: normal;
}
body[data-focus-role] #focus-toolbar #change-output { display: inline-flex; align-items: center; justify-content: center; gap: .55em; }
body[data-focus-role] #focus-toolbar #change-output::after { display: inline-block; box-sizing: content-box; }
body[data-focus-role="listener"] #focus-audio-stage:not([hidden]) {
  display: grid; gap: 10px; place-items: center; align-content: center; min-height: 46vh; padding: 24px 18px; text-align: center;
}
#focus-audio-stage h2 { margin: 0; font-size: clamp(1.4rem, 5vw, 2.2rem); line-height: 1.2; overflow-wrap: anywhere; }
#focus-audio-stage .focus-audio-stage__state { margin: 0; font-size: clamp(1.6rem, 7vw, 3rem); font-weight: 700; line-height: 1.2; color: var(--vv-indicator-live); }
#focus-audio-stage .focus-audio-stage__state:not([data-state="ready"]) { color: var(--vv-text); }
#focus-audio-stage .focus-audio-stage__delay { margin: 0; color: var(--vv-muted); font-size: 1.05rem; font-weight: 600; }
body[data-focus-role="listener"] #listener .listener-transcript #caption-reader { padding-top: 14px; }

.veravox-site-nav [data-veravox-nav="home"] { display: none !important; }
@media (min-width: 900px) {
  body[data-view="publisher"]:not([data-focus-role]) #publisher .header-content:not(:has(#capture-state[data-tone="attention"]:not(:empty))) .header-info {
    flex-wrap: nowrap; width: max-content;
  }
}
/* The line above the rows says which language is which; the rows stay words only. */
body[data-view="publisher"]:not([data-focus-role]) #publisher #publisher-transcript .transcript-language {
  position: absolute; inline-size: 1px; block-size: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher #publisher-transcript .chunk { padding-block: 10px; }
body[data-view="publisher"]:not([data-focus-role]) #publisher #publisher-transcript .es { margin-bottom: 2px; }
@media (max-width: 640px), (max-height: 500px) and (orientation: landscape) {
  body[data-view="listener"]:not([data-focus-role]) #listener[data-entry] #selection #play { flex: 1 1 100%; }
}
@media (min-width: 769px) {
  body[data-view="publisher"]:not([data-focus-role]) #publisher .header-content {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px;
  }
  body[data-view="publisher"]:not([data-focus-role]) #publisher .header-content .header-info { flex: 0 1 auto; width: auto; }
  body[data-view="publisher"]:not([data-focus-role]) #publisher .header-content .header-info > * { flex: 0 0 auto; }
  body[data-view="publisher"]:not([data-focus-role]) #publisher .header-content:not(:has(#capture-state[data-tone="attention"]:not(:empty))) #capture-state {
    width: auto; min-width: 7.5rem; white-space: nowrap;
  }
}

/* ==========================================================================
   Now reading (web/reading.js). Classic Listener 5304627 C1-C8, adapted: the
   phrase being heard keeps an accent bar and a soft tint from its first sound
   until the next phrase (pauses included); a thin underline ends inside the
   word being heard and stays as long as the line is marked; nothing changes size or weight, so the text never reflows. Focus
   dims the other lines, as Classic did, without its blur and scale.
   ========================================================================== */
@property --reading-sweep-color { syntax: "<color>"; inherits: true; initial-value: transparent; }
:root, body[data-view] {
  --reading-accent: var(--vv-accent);
  --reading-tint-share: 12%;
  --reading-tint: color-mix(in srgb, var(--reading-accent) var(--reading-tint-share), transparent);
  --reading-bar: 4px;
  /* The one switch for the moving underline: 0px turns it off everywhere (the bar and tint stay). */
  --reading-sweep-height: 2px;
  --reading-dim: .45;
}
html.dark-theme, html.dark-theme body[data-view] { --reading-tint-share: 18%; }
@media (prefers-color-scheme: dark) {
  html:not(.light-theme):not(.glass-theme), html:not(.light-theme):not(.glass-theme) body[data-view] { --reading-tint-share: 18%; }
}

[data-view="listener"] #caption-reader[role="region"] #meaning > .recovered-caption {
  padding: .18em .55em;
  border-radius: .5rem;
  transition: background-color .18s ease, box-shadow .18s ease, opacity .18s ease, color .18s ease;
}
#publisher-transcript-rows > .chunk {
  padding-inline: 12px;
  border-radius: 8px;
  transition: background-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}
#meaning > .recovered-caption[data-reading],
#publisher-transcript-rows > .chunk[data-reading] {
  background-color: var(--reading-tint);
  box-shadow: inset var(--reading-bar) 0 0 0 var(--reading-accent);
}
[data-view="listener"] #meaning > .recovered-caption[data-reading] { color: var(--vv-text); }

/* The underline runs across every wrapped line in reading order, up to the word being heard (--reading-mark). */
#meaning > .recovered-caption .reading-text,
#publisher-transcript-rows > .chunk .reading-text {
  background-image: linear-gradient(var(--reading-sweep-color), var(--reading-sweep-color));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: var(--reading-mark, 0px) var(--reading-sweep-height);
  -webkit-box-decoration-break: slice;
  box-decoration-break: slice;
  padding-block-end: .1em;
}
#meaning > .recovered-caption[data-sweep] .reading-text,
#publisher-transcript-rows > .chunk[data-sweep] .reading-text { --reading-sweep-color: var(--reading-accent); }

/* Focus while following: the other lines step back (Classic C2's dimming, at a readable level). */
body[data-focus-role="listener"] #caption-reader[data-reading-mode="follow"]:has(.recovered-caption[data-reading]) #meaning > .recovered-caption:not([data-reading]),
body[data-focus-role="publisher"] #publisher-transcript-rows[data-reading-mode="follow"]:has(> .chunk[data-reading="now"]) > .chunk:not([data-reading]) {
  opacity: var(--reading-dim);
}

/* Room below the newest line, so it can reach the reading line. */
[data-view="listener"] #caption-reader[role="region"] #meaning:not(:empty) { padding-block-end: var(--reading-end-pad, .35rem); }
#publisher-transcript-rows::after { content: ""; display: block; height: var(--reading-end-pad, 0px); }

/* Back to now: floats at the bottom of its reader (or of the window when the reader runs past it). */
/* Ids in the selector: the pages' generic button rules are (1,1,1). */
[data-view] .back-to-now:is(#listener-back-to-now, #publisher-back-to-now) {
  position: sticky;
  bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px));
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35em;
  box-sizing: border-box;
  width: fit-content;
  max-width: calc(100% - 24px);
  min-width: 44px;
  min-height: 44px;
  margin: -56px auto 12px;
  padding: .5rem 1.05rem;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--vv-action);
  color: var(--vv-action-ink);
  font: inherit;
  font-size: .92rem;
  font-weight: 650;
  line-height: 1.2;
  box-shadow: 0 6px 18px #0b1f2a40;
  cursor: pointer;
  transition: opacity .15s ease, transform .15s ease, background-color .15s ease;
}
@starting-style { [data-view] .back-to-now:is(#listener-back-to-now, #publisher-back-to-now) { opacity: 0; transform: translateY(8px); } }
[data-view] .back-to-now:is(#listener-back-to-now, #publisher-back-to-now):hover { background: var(--vv-action-hover); color: var(--vv-action-ink); }
.back-to-now:focus-visible { outline: 3px solid var(--vv-focus); outline-offset: 2px; }
.back-to-now-arrow { font-size: 1.05em; line-height: 1; }
.back-to-now-count { font-weight: 500; }
/* The time left before the page returns by itself. */
.back-to-now-fill {
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: currentColor;
  opacity: .55;
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}
.back-to-now[data-wait="button"] .back-to-now-fill { display: none; }

@media (prefers-reduced-motion: reduce) {
  #meaning > .recovered-caption, #publisher-transcript-rows > .chunk, .reading-text, .back-to-now { transition: none !important; }
  .back-to-now-fill { display: none; }
}

/* ==== S11 polish ==== */
/* Spec .evidence/handoff/steps/S11-polish-spec.md with its Critic corrections. Last in the file on purpose: these
   rules adapt the layers above (phone rules, finish-line rules, S10's reading block). */

/* --- 1.1 One scroller on computers: the card is fixed, its visible panel (or the rows) scrolls --------------- */
body:is([data-view="publisher"], [data-view="listener"]) { box-sizing: border-box; }
#publisher-transcript-rows { position: relative; }
#account-recordings { max-height: none; overflow: visible; }
@media (min-width: 761px) and (min-height: 620px) {
  body:is([data-view="publisher"], [data-view="listener"]):not([data-focus-role]) .app-container { overflow: hidden; }
  body:is([data-view="publisher"], [data-view="listener"]):not([data-focus-role]) .app-container > main {
    flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  }
  body[data-view="publisher"]:not([data-focus-role]) #publisher :is(.publisher-header, .tabs-container) { flex: 0 0 auto; }
  body[data-view="publisher"]:not([data-focus-role]) .main-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  body[data-view="listener"]:not([data-focus-role]) #listener,
  body:not([data-focus-role]) .app-container > main > #welcome { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active], [data-recording-ended]) #publisher-stream #publisher-transcript.stream-log {
    align-self: stretch; height: auto; min-height: 12rem; max-height: none;
  }
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active], [data-recording-ended]) #publisher-transcript-rows {
    flex: 1 1 auto; overscroll-behavior: contain;
  }
}
/* The Listener with its caption reader open (Audio + captions, Captions only): the reader is the one scroller while
   the card above it fits; #listener scrolls only when the window is too short for both (critic 10). */
@media (min-width: 761px) and (min-height: 620px) {
  body[data-view="listener"]:not([data-focus-role]) #listener:has(#caption-reader[role="region"]) { display: flex; flex-direction: column; }
  body[data-view="listener"]:not([data-focus-role]) #listener:has(#caption-reader[role="region"]) > * { flex: 0 0 auto; }
  body[data-view="listener"]:not([data-focus-role]) #listener:has(#caption-reader[role="region"]) > .listener-transcript {
    flex: 1 1 auto; min-height: 10rem; display: flex; flex-direction: column;
  }
  body[data-view="listener"]:not([data-focus-role]) #listener #caption-reader[role="region"] {
    flex: 1 1 auto; min-height: 0; max-height: none; overscroll-behavior: contain; margin-block-end: 8px;
  }
}

/* --- 1.2 Paused: one amber chip beside the clock, the microphone choice on one line ----------------------- */
body[data-view="publisher"]:not([data-focus-role]) #publisher-stream #recovery-microphone:not([hidden]) {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: none; margin: 8px 0;
  padding: 0; border: 0; background: none; box-shadow: none; font-weight: 600;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher-stream #recovery-microphone select { width: auto; min-width: 14rem; min-height: 44px; }

/* --- 2.4 (with 1.2 and 3.4) One status chip: Recording, Paused, Saved, neutral; an error keeps its full row -- */
body[data-view="publisher"]:not([data-focus-role]) #publisher #capture-state:not(:empty):not([data-tone="attention"]) {
  display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box; width: auto; min-width: 0;
  height: 36px; min-height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: 999px;
  font-size: .875rem; font-weight: 600; line-height: 1.2; white-space: normal; max-width: 100%; height: auto; padding-block: 6px;
  color: var(--text-secondary); background: var(--panel-bg-light); border-color: var(--panel-border);
}
body[data-view="publisher"]:not([data-focus-role]) #publisher #capture-state:not(:empty):not([data-tone="attention"])::before {
  content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin: 0; border-radius: 50%; background: currentColor;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher #capture-state[data-tone="recording"]:not(:empty) {
  color: var(--status-ok-text); background: var(--status-ok-bg); border-color: transparent;
}
body[data-view="publisher"]:not([data-focus-role]) #publisher #capture-state[data-tone="paused"]:not(:empty) {
  color: var(--alert-warn-text); background: var(--alert-warn-bg); border-color: var(--alert-warn-border);
}
/* 3.4: the status row keeps its height before the first message, so Start does not move the page. */
body[data-view="publisher"]:not([data-focus-role]) #publisher .header-info { min-height: 44px; }

/* (S36: the S11 1.3 phone nav/tabs block was left out: that header layout is replaced by the visual-first shell.) */
#publisher-focus { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#publisher-focus .focus-icon { width: 20px; height: 20px; flex: 0 0 20px; }
@media (min-width: 761px) and (min-height: 620px) { #publisher-focus .focus-icon { display: none; } }

/* --- 1.4 Focus: the pressed Captions / Source text toggles stay readable in every theme --------------------- */
body[data-focus-role] #focus-toolbar button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--vv-action) 16%, var(--panel-bg)); color: var(--text-primary);
}

/* --- 1.7 After Stop & Save: no disabled Stop, one line that points to the files ----------------------------- */
body[data-view="publisher"] #publisher[data-recording-ended] #classic-idle-stop { display: none; }
#publisher-saved-note[hidden] { display: none; }
body[data-view="publisher"] #publisher #publisher-saved-note {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px;
  margin: 0 auto; padding-block: 0 12px; color: var(--text-primary); font-weight: 600;
}
/* "Continue this event" keeps working (same link) but is the secondary action; Open Downloads is the primary. */
body[data-view="publisher"] #publisher #start.secondary:enabled {
  border: 1px solid var(--vv-control-border); background: var(--panel-bg); background-image: none; color: var(--text-primary);
}
body[data-view="publisher"] #publisher #open-downloads {
  border: 1px solid var(--vv-action); background: var(--vv-action); background-image: none; color: var(--vv-action-ink);
}
body[data-view="publisher"] #publisher #open-downloads:hover { background: var(--vv-action-hover); }
body[data-view="publisher"] #publisher #publisher-saved-note .btn { min-height: 44px; margin: 0; }
body[data-view="publisher"] #publisher #publisher-transcript-status:not(:empty) { flex-shrink: 0; margin-bottom: 12px; }

/* 1.1 (critic 3) The Stream panel stacks its parts; the transcript takes what is left, so nothing is drawn over
   the rows however many lines (microphone, languages, notes) sit above them. */
@media (min-width: 761px) and (min-height: 620px) {
  /* S36: a column of its parts (the S11 grid put the transcript in row 8, over anything listed after it, such as
     "Download unconfirmed audio", which then could not be clicked: tests/browser_recordings.py). */
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active], [data-recording-ended]) #publisher-stream .publisher-stage {
    display: flex; flex-direction: column; align-items: stretch; row-gap: 0;
  }
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active], [data-recording-ended]) #publisher-stream .publisher-stage > :not(#publisher-transcript) {
    flex: 0 0 auto; margin-block: 0 8px;
  }
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active], [data-recording-ended]) #publisher-stream .publisher-stage > #publisher-transcript {
    flex: 1 1 auto; min-height: 0;
  }
  /* The actions under the panel (Download unconfirmed audio, the full event name) keep their own height. */
  body[data-view="publisher"]:not([data-focus-role]) #publisher #publisher-stream > .publisher-stream-actions { flex: 0 0 auto; }
  /* The rows give way on a short window (they scroll inside) instead of being drawn over what follows. */
  body[data-view="publisher"]:not([data-focus-role]) #publisher:is([data-event-active], [data-recording-ended]) #publisher-stream .publisher-stage > #publisher-transcript.stream-log { min-height: 0; }
}

/* --- 2.2 One delay readout per screen: the header keeps it, My listening does not repeat it ---------------- */
body[data-view="publisher"]:not([data-focus-role]) #publisher-listening-delay { display: none; }

/* --- 2.3 One language picker on the Listener's entry card: "My language" (the top one returns once listening) - */
body[data-view="listener"]:not([data-focus-role]):has(#listener[data-entry]) .veravox-site-nav .veravox-site-nav__language { display: none; }

/* --- 2.6 One dialog look; the guide does not jump between steps --------------------------------------------- */
body :is(#listener-room-dialog, #invite-qr-dialog, #revoke-invite-dialog, #publisher-guide, #open-room-dialog)[open] {
  box-sizing: border-box; border: 1px solid var(--panel-border); border-radius: 16px; padding: 24px;
  background: var(--panel-bg); color: var(--text-primary); box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
  max-width: min(34rem, calc(100vw - 2rem));
}
body :is(#listener-room-dialog, #invite-qr-dialog, #revoke-invite-dialog, #publisher-guide, #open-room-dialog)::backdrop { background: rgba(15, 23, 42, .45); }
body :is(#listener-room-dialog, #invite-qr-dialog, #revoke-invite-dialog, #publisher-guide, #open-room-dialog) input[type="radio"] { accent-color: var(--vv-action); }
/* The guide keeps one height on every step (its body scrolls when a step is long), so Back/Next never jump. */
body #publisher-guide[open] .publisher-guide-body { flex: 1 1 auto; }
body #publisher-guide[open] :is(.publisher-guide-actions, .publisher-guide-step-actions) { align-items: flex-end; }
body :is(#revoke-invite-dialog, #invite-qr-dialog) .btn { min-height: 44px; }

/* --- 2.7 Settings while live -------------------------------------------------------------------------------- */
body[data-view="publisher"] #publisher[data-event-active] #publisher-settings .settings-page-header p { display: none; }
body:is([data-view="publisher"], [data-view="listener"]) #share-room .controls { display: flex; flex-wrap: wrap; gap: 8px; }
body:is([data-view="publisher"], [data-view="listener"]) #share-room .controls :is(#copy-invite, #share-invite, #invite, #show-invite-qr) {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0;
  padding: 10px 16px; border-radius: 8px; font-size: 1rem; font-weight: 600; line-height: 1.2; text-decoration: none;
}
body:is([data-view="publisher"], [data-view="listener"]) #share-room .controls :is(#copy-invite, #share-invite) {
  border: 1px solid var(--vv-action); background: var(--vv-action); background-image: none; color: var(--vv-action-ink);
}
body:is([data-view="publisher"], [data-view="listener"]) #share-room .controls :is(#invite, #show-invite-qr) {
  border: 1px solid var(--vv-control-border); background: var(--panel-bg); background-image: none; color: var(--text-primary);
}
body:is([data-view="publisher"], [data-view="listener"]) #share-room .controls :is(#copy-invite, #share-invite, #invite, #show-invite-qr)[hidden] { display: none; }
body:is([data-view="publisher"], [data-view="listener"]) :is(#revoke-invite, #confirm-revoke-invite, .downloads-delete > button) {
  border: 1px solid var(--alert-bad-border); background: var(--alert-bad-bg); background-image: none; color: var(--alert-bad-text);
  min-height: 44px; font-weight: 600;
}
body:is([data-view="publisher"], [data-view="listener"]) :is(#revoke-invite, #confirm-revoke-invite, .downloads-delete > button):hover:not(:disabled) {
  border-color: var(--brand-danger); background: var(--brand-danger); color: #fff;
}
#mode-locked-note[hidden], #room-password-note:empty { display: none; }
#mode-locked-note, #room-password-note { margin: 4px 0 0; }
#publisher-settings #mode-locked-note { grid-column: 1 / -1; }

/* --- 2.9 Listener entry and captions-only ------------------------------------------------------------------- */
body[data-view="listener"] #listener#listener #selection #play { box-shadow: none; }
/* With the top picker hidden on the entry card, the theme button joins Menu at the end of the bar. */
body[data-view="listener"]:not([data-focus-role]):has(#listener[data-entry]) .veravox-site-nav #themeToggle { margin-inline-start: auto; }
body[data-view="listener"]:not([data-focus-role]) #listener #listener-playback-status:empty,
body[data-view="listener"]:not([data-focus-role]) #listener #listener-listening-delay:empty { display: none; }
/* The transcript is already on screen: no "View transcript" above it. */
body[data-view="listener"]:not([data-focus-role]) #listener:has(#caption-reader[role="region"]) #view-transcript { display: none; }

/* --- 2.9 (and 1.1, critic 10) A compact Listener once it is listening: title and Focus on one row, the status
   lines under it, the card's controls in rows, so the captions get the screen. ----------------------------- */
body[data-view="listener"]:not([data-focus-role]) #listener#listener:not([data-entry]) header.listener-header {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 2px 12px; min-height: 0; padding-block: 8px;
}
body[data-view="listener"]:not([data-focus-role]) #listener#listener:not([data-entry]) header.listener-header > .listener-intro.listener-page-intro {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; margin: 0; padding: 0;
}
body[data-view="listener"]:not([data-focus-role]) #listener#listener:not([data-entry]) .listener-page-intro > .listener-title { grid-column: 1; grid-row: 1; margin: 0; }
body[data-view="listener"]:not([data-focus-role]) #listener#listener:not([data-entry]) .listener-page-intro #listener-focus { grid-column: 2; grid-row: 1; margin: 0; }
body[data-view="listener"]:not([data-focus-role]) #listener#listener:not([data-entry]) .listener-page-intro > p { grid-column: 1 / -1; margin: 0; }
body[data-view="listener"]:not([data-focus-role]) #listener#listener:not([data-entry]) header.listener-header > .header-controls { margin: 0; padding: 0; }
body[data-view="listener"]:not([data-focus-role]) #listener#listener:not([data-entry]) header.listener-header #play-state { min-height: 0; padding: 0; }
/* The card: buttons in one wrapping row; mute, volume and speed side by side when there is room. */
body[data-view="listener"]:not([data-focus-role]) #listener:not([data-entry]) #selection { flex-wrap: wrap; align-items: center; gap: 8px; }
body[data-view="listener"]:not([data-focus-role]) #listener:not([data-entry]) #selection > #keep-caption-screen-awake { flex: 0 1 auto; width: auto; }
@media (min-width: 641px) {
  body[data-view="listener"]:not([data-focus-role]) #listener#listener:not([data-entry]) #listener-listening-controls {
    grid-template-columns: max-content minmax(100px, 260px) 4ch minmax(11rem, 1fr); column-gap: 12px;
  }
  body[data-view="listener"]:not([data-focus-role]) #listener#listener:not([data-entry]) #listener-listening-controls > #listener-pace-settings { grid-column: 4; grid-row: 1 / 3; padding: 0; }
  body[data-view="listener"]:not([data-focus-role]) #listener#listener:not([data-entry]) #listener-listening-controls > #listener-listening-delay { grid-column: 1 / 4; }
  body[data-view="listener"]:not([data-focus-role]) #listener#listener:not([data-entry]) #listener-listening-controls > .listening-delay-details { grid-column: 4; }
}
/* Phones, captions on screen: no card frame around a single button, transcript buttons on one row. */
@media (max-width: 640px) {
  body[data-view="listener"]:not([data-focus-role]) #listener:has(#caption-reader[role="region"]) .audio-gate { padding-block: 0; }
  body[data-view="listener"]:not([data-focus-role]) #listener:has(#caption-reader[role="region"]) #selection:not(:has(#play)) {
    padding: 4px 0; border: 0; background: none; box-shadow: none;
  }
  body[data-view="listener"]:not([data-focus-role]) #listener:has(#caption-reader[role="region"]) .listener-feedback { padding-block: 4px; }
  body[data-view="listener"]:not([data-focus-role]) #listener #caption-history-controls { flex-wrap: nowrap; gap: 8px; padding-block: 4px; }
  body[data-view="listener"]:not([data-focus-role]) #listener #caption-history-controls #caption-history-heading {
    position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  body[data-view="listener"]:not([data-focus-role]) #listener #caption-history-controls button { flex: 1 1 auto; margin: 0; }
}

/* --- 3.4 The header keeps one height from Ready to Recording (it grew 4 px when the Listeners button appeared) --- */
body[data-view="publisher"]:not([data-focus-role]) #publisher .header-content .header-info { padding-block: 0; min-height: 48px; }
body[data-view="publisher"]:not([data-focus-role]) #publisher #publisher-transcript-status { min-height: 1.5em; }

/* Resume is the main action while paused (data-primary), as Start is before. */
body[data-view="publisher"] #publisher[data-primary="resume"] #resume:enabled {
  border-color: var(--vv-action); background: var(--vv-action); background-image: none; color: var(--vv-action-ink);
}
body[data-view="publisher"] #publisher[data-primary="resume"] #resume:enabled:hover { background: var(--vv-action-hover); }
/* Paused on a short laptop: the gap note is one quiet line, so the rows keep their room. */
body[data-view="publisher"]:not([data-focus-role]) #publisher[data-capture-recovery] #publisher-transcript-status:not(:empty) {
  padding: 6px 12px; font-size: .875rem;
}

/* --- 2.2 In Focus the delay shows once, beside the status (the options panel does not repeat it) ----------- */
body[data-focus-role] #focus-delay > :is(#publisher-listening-delay, #listener-listening-delay) { display: none; }

/* --- Dark theme: the Listeners drawer's close button was white on white -------------------------------------- */
body[data-view="publisher"] .audience-overlay .listeners-drawer__close { background: var(--panel-bg); color: var(--text-primary); }

/* --- 3.1 Touch targets on phones: theme, Menu and the logo link are 44 px -------------------------------------- */
@media (max-width: 760px), (max-height: 619px) {
  body:is([data-view="publisher"], [data-view="listener"]) .veravox-site-nav #themeToggle { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  body:is([data-view="publisher"], [data-view="listener"]) .veravox-site-nav .veravox-site-nav__account summary { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  body:is([data-view="publisher"], [data-view="listener"]) .veravox-site-nav .veravox-site-nav__brand { min-width: 44px; min-height: 44px; justify-content: center; }
}

/* --- 3.4 (rest) Start does not move things sideways: buttons stay left, status right; the languages line has its
   place before the first row arrives. ------------------------------------------------------------------------ */
@media (min-width: 769px) {
  body[data-view="publisher"]:not([data-focus-role]) #publisher .header-content:not(:has(#capture-state[data-tone="attention"]:not(:empty))) {
    justify-content: space-between;
  }
}
body[data-view="publisher"]:not([data-focus-role]) #publisher #publisher-transcript-languages { min-height: 1.3em; }

/* Glass: the Recording chip's green needs the darkest text to stay above 4.5:1 over the translucent card. */
html.glass-theme body[data-view="publisher"]:not([data-focus-role]) #publisher #capture-state[data-tone="recording"]:not(:empty) { color: var(--text-primary); }

/* 3.1 The guide's input-gain slider is a 44 px target. */
#publisher-guide input[type="range"], #publisher-settings #microphone-gain { min-height: 44px; }

/* --- 2.8 Downloads: the file id once (the selected row already shows it); delete stands apart --------------- */
body[data-view="publisher"] #publisher-save #account-download-target { display: none; }
body[data-view="publisher"] #publisher-save .downloads-delete { margin-top: 16px; }

/* --- 2.5 Focus: the line above the rows says which language is which; rows stay words only (as outside Focus) -- */
body[data-focus-role="publisher"] #publisher-transcript .transcript-language {
  position: absolute; inline-size: 1px; block-size: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* --- 1.1 (Listener) While "Change output" is open on a computer the card is the page: the transcript steps aside
   until the choice is applied or cancelled, so there is one scrollbar; it comes back following live. ---------- */
@media (min-width: 761px) and (min-height: 620px) {
  body[data-view="listener"]:not([data-focus-role]) #listener:has(#change-output[aria-expanded="true"]) .listener-transcript { display: none; }
}

/* ==========================================================================
   S36 visual-first shell (web/shell.js). The interpretation fills the screen; a thin bar carries
   play/stop, sound, language, Aa and Preferences; everything set once lives in one sheet.
   Mockups: deliverables/s31-visual-first/S31-mockup 01/02/06, s27-preferences, s22 read-along styles.
   Last in the file on purpose: it adapts every layer above for the Listener.
   ========================================================================== */
.vf-root { display: none; }
body[data-shell-role="listener"]:is([data-shell="entry"], [data-shell="listening"]) .app-container { display: none; }
body[data-shell-role="listener"]:is([data-shell="entry"], [data-shell="listening"]) { overflow: hidden; }
body[data-shell-role="listener"]:is([data-shell="entry"], [data-shell="listening"]) .vf-root {
  position: fixed; inset: 0; z-index: 1;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: var(--vv-page); color: var(--vv-text);
  font-family: "Inter", system-ui, "Segoe UI", sans-serif;
}
html.glass-theme body[data-shell-role="listener"] .vf-root { background: transparent; }
.vf-root button { font: inherit; color: inherit; }
.vf-root :focus-visible { outline: 3px solid var(--vv-focus); outline-offset: 2px; }

/* --- Top strip: logo, state badge, delay chip, screen-on --------------------------------------------------- */
.vf-top {
  display: flex; align-items: center; gap: 8px; min-height: 56px; box-sizing: border-box;
  padding: max(6px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--vv-border); background: var(--vv-control-fill);
}
.vf-logo { width: 30px; height: 30px; flex: 0 0 30px; }
.vf-spacer { flex: 1 1 auto; }
.vf-badge {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; box-sizing: border-box;
  padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: .95rem; line-height: 1.2; white-space: nowrap;
  color: var(--vv-text); background: color-mix(in srgb, var(--vv-text) 7%, transparent);
}
.vf-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: 0 0 10px; }
.vf-badge[data-tone="playing"], .vf-badge[data-tone="reading"] { color: var(--alert-ok-text); background: var(--alert-ok-bg); }
.vf-badge[data-tone="live"] { color: var(--vv-danger); background: color-mix(in srgb, var(--vv-danger) 12%, transparent); }
.vf-badge[data-tone="live"] .vf-dot { animation: vf-pulse 1.6s ease-in-out infinite; }
.vf-badge[data-tone="soon"] .vf-dot { animation: vf-breathe 3.2s ease-in-out infinite; }
.vf-badge[data-tone="reconnecting"], .vf-badge[data-tone="paused"] { color: var(--alert-warn-text); background: var(--alert-warn-bg); }
.vf-badge[data-reload-paused] { min-width: 0; padding-block: 6px; white-space: normal; }
.vf-badge[data-tone="paused"] .vf-dot { border-radius: 2px; width: 10px; background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65%); }
.vf-badge[data-tone="ended"] .vf-dot { border-radius: 2px; }
.vf-badge[data-tone="suggested"] { color: var(--vv-action); background: color-mix(in srgb, var(--vv-action) 14%, transparent); }
.vf-badge--tiny { min-height: 22px; padding: 0 8px; font-size: .72rem; }
@keyframes vf-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .55; } }
@keyframes vf-breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.vf-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.vf-eq i { width: 3px; border-radius: 1px; background: currentColor; animation: vf-eq 1s ease-in-out infinite; }
.vf-eq i:nth-child(1) { height: 6px; } .vf-eq i:nth-child(2) { height: 12px; animation-delay: -.3s; }
.vf-eq i:nth-child(3) { height: 9px; animation-delay: -.6s; } .vf-eq i:nth-child(4) { height: 14px; animation-delay: -.15s; }
@keyframes vf-eq { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
.vf-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; box-sizing: border-box; padding: 0 12px;
  border: 1px solid var(--vv-border); border-radius: 999px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.vf-chip__icon svg { width: 18px; height: 18px; display: block; }
.vf-room-sound { min-height: 32px; padding-inline: 9px; font-size: .85rem; white-space: nowrap; }
.vf-room-sound .vf-chip__icon svg { width: 16px; height: 16px; }
@media (max-width: 420px) {
  .vf-top:has(.vf-room-sound:not([hidden])) { column-gap: 5px; }
  .vf-top:has(.vf-room-sound:not([hidden])) :is(.vf-badge, .vf-chip) {
    gap: 4px; padding-inline: 7px; font-size: .8rem; white-space: nowrap;
  }
}
.vf-round {
  display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; flex: 0 0 44px;
  border: 1px solid var(--vv-border); border-radius: 50%; background: var(--vv-surface); color: var(--vv-text); cursor: pointer;
}
.vf-round svg { width: 22px; height: 22px; }
.vf-round[aria-pressed="true"] { color: #b45309; border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 16%, var(--vv-surface)); }
body[data-shell="listening"] #vf-top-prefs { display: none; }

/* --- Stage: the reading surface fills everything between the strips --------------------------------------- */
.vf-stage { position: relative; min-height: 0; overflow: hidden; }
body[data-shell="entry"] .vf-stage > .listener-transcript { display: none; }
body[data-shell="listening"] .vf-stage > .vf-entry { display: none; }
body[data-shell="listening"] .vf-stage > .listener-transcript {
  position: absolute; inset: 0; display: flex; flex-direction: column; margin: 0; padding: 0; border: 0;
  background: transparent; box-shadow: none; max-height: none;
}
body[data-shell-opening] .vf-stage > .listener-transcript { visibility: hidden; }
body[data-shell="listening"] .listener-transcript > :is(#caption-history-controls, #caption-history-limit, #focus-reader-actions, #source-line) { display: none !important; }
body[data-shell="listening"] .listener-transcript > #caption-screen-status:not([hidden]) {
  margin: 0; padding: 6px 16px; font-size: .85rem; color: var(--vv-muted); text-align: center;
}
body[data-shell="listening"] #listener-back-to-now { position: absolute; left: 50%; bottom: 14px; margin: 0; transform: translateX(-50%); }
body[data-shell="listening"] #caption-reader {
  flex: 1 1 auto; min-height: 0; max-height: none; height: auto; margin: 0; padding: 0;
  overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain; scrollbar-width: thin;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  -webkit-mask-image: linear-gradient(transparent 0, #000 28px); mask-image: linear-gradient(transparent 0, #000 28px);
}
body[data-shell="listening"] #caption-reader #meaning {
  box-sizing: border-box; width: 100%; max-width: 48rem; margin: 0 auto;
  padding: 20px max(12px, env(safe-area-inset-right)) var(--reading-end-pad, 24px) max(12px, env(safe-area-inset-left));
  --vf-base: 31px; --vf-weight: 600; --vf-line: 1.32;
  font-size: calc(var(--vf-base) * var(--vf-size, 1) * var(--vf-screen, 1)); font-weight: var(--vf-weight);
  line-height: var(--vf-line); letter-spacing: -.01em; color: var(--vv-text); text-align: start;
}
@media (min-width: 900px) { body[data-shell="listening"] #caption-reader #meaning { --vf-screen: 1.15; } }
body[data-reading-style="today"] #caption-reader #meaning { --vf-base: 24px; --vf-line: 1.35; }
body[data-reading-style="lyrics"] #caption-reader #meaning { --vf-base: 29px; --vf-weight: 750; --vf-line: 1.28; letter-spacing: -.012em; }
body[data-reading-style="chip"] #caption-reader #meaning { --vf-base: 24px; --vf-line: 1.4; }
body[data-shell="listening"] #meaning > .recovered-caption {
  display: block; position: relative; isolation: isolate; margin: 0; padding: .2em .5em .24em .6em;
  border-radius: .6rem; overflow-wrap: anywhere;
  transition: background-color .25s ease, box-shadow .25s ease, opacity .25s ease;
}
body[data-shell="listening"] #meaning > .recovered-caption + .recovered-caption { margin-top: .7em; }
body[data-shell="listening"] #meaning > .recovered-caption > small {
  display: block; margin-top: .25em; font-size: .55em; font-weight: 500; line-height: 1.4; color: var(--vv-muted);
}
body[data-shell="listening"] #meaning > :not(.recovered-caption) { font-size: .6em; color: var(--vv-muted); }
/* Lines already said step back; the one being heard is the focal point. */
body[data-shell="listening"] #caption-reader:has(.recovered-caption[data-reading]) #meaning > .recovered-caption:not([data-reading]) { opacity: .62; }
body[data-shell="listening"][data-reading-style="today"] #caption-reader:has(.recovered-caption[data-reading]) #meaning > .recovered-caption:not([data-reading]) { opacity: .45; }
body[data-shell="listening"][data-reading-style="chip"] #caption-reader:has(.recovered-caption[data-reading]) #meaning > .recovered-caption:not([data-reading]),
body[data-shell="listening"][data-reading-style="lyrics"] #caption-reader:has(.recovered-caption[data-reading]) #meaning > .recovered-caption:not([data-reading]) { opacity: .5; }
/* D Grande: box with a bar; spoken words turn from grey to full ink. */
body[data-shell="listening"][data-reading-style="calm"] #meaning > .recovered-caption[data-reading] {
  background-color: var(--reading-tint); box-shadow: inset 5px 0 0 0 var(--reading-accent);
}
body[data-shell="listening"][data-reading-style="calm"] #meaning > .recovered-caption[data-reading][data-words] .w { color: var(--vf-unsaid); transition: color .12s linear; }
body[data-shell="listening"][data-reading-style="calm"] #meaning > .recovered-caption[data-reading][data-words] .w[data-said] { color: var(--vv-text); }
body:is([data-shell-role="listener"], [data-shell-role="publisher"]) { --vf-unsaid: #4b5563; }
html.dark-theme body:is([data-shell-role="listener"], [data-shell-role="publisher"]) { --vf-unsaid: #8794a8; }
@media (prefers-color-scheme: dark) { html:not(.light-theme):not(.glass-theme) body:is([data-shell-role="listener"], [data-shell-role="publisher"]) { --vf-unsaid: #8794a8; } }
/* C Palabra: a soft box; a chip slides to the word being said. */
body[data-shell="listening"][data-reading-style="chip"] #meaning > .recovered-caption[data-reading] {
  background-color: color-mix(in srgb, var(--reading-accent) 7%, transparent); box-shadow: none;
}
.reading-chip { display: none; }
body[data-shell="listening"][data-reading-style="chip"] #meaning > .recovered-caption[data-reading][data-words] > .reading-chip {
  display: block; position: absolute; left: 0; top: 0; z-index: -1; border-radius: .32em; opacity: 0; pointer-events: none;
  background: color-mix(in srgb, var(--reading-accent) 26%, transparent);
  transition: transform .11s ease-out, width .11s ease-out, height .11s ease-out, opacity .2s ease; will-change: transform;
}
html.dark-theme body[data-shell="listening"][data-reading-style="chip"] .reading-chip { background: color-mix(in srgb, var(--reading-accent) 38%, transparent); }
body[data-shell="listening"][data-reading-style="chip"] #meaning > .recovered-caption[data-words] > .reading-chip[data-on] { opacity: 1; }
.reading-chip.reading-chip--jump { transition: none !important; }
/* B Letras: no box; each word fills from dim to bright as it is said. */
body[data-shell="listening"][data-reading-style="lyrics"] #meaning > .recovered-caption[data-reading] { background: none; box-shadow: none; }
body[data-shell="listening"][data-reading-style="lyrics"] #meaning > .recovered-caption[data-reading][data-words] .w {
  --lit: var(--vv-text); --unlit: color-mix(in srgb, var(--vv-text) 36%, var(--vv-page));
  color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(90deg, var(--lit) calc(var(--p, 0) * (100% + .8em) - .8em), var(--unlit) calc(var(--p, 0) * (100% + .8em)));
}
/* A Clásico keeps today's box and underline sweep (the reading block above). */
body[data-shell="listening"]:not([data-reading-style="today"]) #meaning > .recovered-caption .reading-text { background-image: none; }

/* --- Feedback (reconnecting, resume audio, notices): one quiet strip above the bar ------------------------ */
.vf-feedback { padding: 0 16px; }
.vf-feedback .listener-feedback { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; background: none; }
.vf-feedback :is(p, div):empty, .vf-feedback #play-state-announcement { display: none; }
.vf-feedback p { margin: 6px 0; font-size: .9rem; color: var(--vv-muted); text-align: center; }
.vf-feedback .listener-recovery { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.vf-feedback button:not([hidden]) {
  min-height: 44px; margin: 6px 0; padding: 0 16px; border-radius: 999px; border: 1px solid var(--vv-action);
  background: var(--vv-action); color: var(--vv-action-ink); font-weight: 650;
}
.vf-feedback :is(#switch-listener-room, #view-transcript) { display: none !important; }

/* --- Bottom bar: five big targets in the thumb zone ---------------------------------------------------- */
.vf-bar {
  display: none; align-items: center; justify-content: space-around; gap: 4px;
  padding: 6px max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  border-top: 1px solid var(--vv-border); background: var(--vv-control-fill);
}
body[data-shell="listening"] .vf-bar { display: flex; }
.vf-icon {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 56px; min-height: 56px; padding: 4px 6px; border: 0; border-radius: 14px; background: none; cursor: pointer;
  font-size: .78rem; font-weight: 650;
}
.vf-icon:hover { background: var(--vv-control-hover); }
.vf-icon__glyph { display: grid; place-items: center; }
.vf-icon__glyph svg { width: 26px; height: 26px; display: block; }
#vf-stop .vf-icon__glyph { color: var(--vv-danger); }
.vf-aa { font-size: 1.45rem; font-weight: 800; line-height: 26px; letter-spacing: -.02em; }
.vf-speaker { display: inline-flex; align-items: stretch; height: 52px; border: 1.5px solid var(--vv-control-border); border-radius: 999px; overflow: hidden; background: var(--vv-surface); }
.vf-speaker__main, .vf-speaker__more { display: grid; place-items: center; min-width: 52px; min-height: 44px; border: 0; background: none; cursor: pointer; position: relative; color: var(--vv-action); }
.vf-speaker__more { min-width: 40px; border-inline-start: 1px solid var(--vv-border); color: var(--vv-text); }
.vf-speaker__more svg { width: 20px; height: 20px; }
.vf-speaker[data-muted="true"] { border-color: var(--alert-bad-border); background: var(--alert-bad-bg); }
.vf-speaker[data-muted="true"] .vf-speaker__main { color: var(--vv-danger); }
.vf-live-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--vv-indicator-live); }
.vf-speaker[data-muted="true"] .vf-live-dot { display: none; }
.vf-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; max-width: 9.5rem; padding: 0 14px;
  border: 1.5px solid var(--vv-control-border); border-radius: 999px; background: var(--vv-surface); cursor: pointer; font-weight: 700;
}
.vf-pill svg { width: 20px; height: 20px; }
.vf-pill span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) {
  .vf-icon { min-width: 48px; }
  .vf-pill { max-width: 7.2rem; padding: 0 10px; }
  .vf-speaker__main { min-width: 46px; }
  .vf-speaker__more { min-width: 34px; }
}
@media (min-width: 900px) {
  .vf-bar { justify-content: center; gap: 18px; }
}

/* --- Sound popover (S26 option A) ------------------------------------------------------------------------ */
.vf-popover {
  position: fixed; z-index: 30; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(22rem, calc(100vw - 32px)); box-sizing: border-box; padding: 16px;
  border: 1px solid var(--vv-border); border-radius: 16px; background: var(--vv-surface); color: var(--vv-text);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .22);
}
.vf-popover__title { margin: 0 0 8px; font-weight: 700; }
.vf-switching { margin: 0 0 8px; color: var(--accent-text, var(--vv-action)); font-size: .9rem; font-weight: 700; }
.vf-volume { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.vf-volume svg { width: 22px; height: 22px; color: var(--vv-action); }
.vf-volume input { flex: 1 1 auto; min-height: 44px; accent-color: var(--vv-action); }
.vf-segment { display: flex; gap: 4px; margin: 10px 0; padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--vv-text) 6%, transparent); }
.vf-segment > button {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px;
  border: 0; border-radius: 9px; background: none; cursor: pointer; color: var(--vv-muted);
}
.vf-segment > button[aria-checked="true"] { background: var(--vv-surface); color: var(--vv-text); box-shadow: 0 1px 3px rgba(15, 23, 42, .18); }
.vf-segment small { font-size: .8rem; }
.vf-link { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent-text, var(--vv-action)); font-weight: 650; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }

/* --- Entry: one focal point, the round Listen button with the language on it ------------------------------ */
.vf-entry {
  box-sizing: border-box; height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 22px 16px 28px; text-align: center;
}
.vf-badge--big { min-height: 40px; font-size: 1.05rem; margin: 6px 0 0; }
.vf-entry__title { margin: 0; font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; max-width: 22ch; overflow-wrap: anywhere; }
.vf-play { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px; border: 0; background: none; cursor: pointer; }
.vf-play__disc {
  display: grid; place-items: center; width: clamp(140px, 42vw, 176px); aspect-ratio: 1; border-radius: 50%;
  background: var(--vv-action); color: var(--vv-action-ink);
  box-shadow: 0 0 0 12px color-mix(in srgb, var(--vv-action) 18%, transparent), 0 14px 32px rgba(14, 116, 144, .35);
  transition: transform .15s ease;
}
.vf-play:hover .vf-play__disc { transform: scale(1.03); }
.vf-play__disc svg { width: 44%; height: 44%; margin-inline-start: 8%; }
.vf-play[aria-pressed="true"] .vf-play__disc { background: var(--vv-indicator-live); }
.vf-play:disabled { opacity: .6; cursor: progress; }
.vf-play__label { font-size: clamp(1.45rem, 5.6vw, 2rem); font-weight: 800; line-height: 1.15; }
/* U10, the next-step hint (next-step.js): a ring on the button's own halo that breathes outward behind the label.
   Reduced motion: the same ring, wider and still. */
.vf-play__disc, body #publisher .vf-rec__disc { position: relative; --vv-next: var(--vv-action); }
body #publisher .vf-rec__disc { --vv-next: #be123c; }
.vv-next-halo { position: absolute; inset: -12px; box-sizing: border-box; border: 12px solid color-mix(in srgb, var(--vv-next) 52%, transparent);
  border-radius: 50%; opacity: 0; pointer-events: none; }
.vv-next-halo[data-still] { inset: -18px; border-width: 18px; border-color: color-mix(in srgb, var(--vv-next) 30%, transparent); opacity: 1; }
.vf-play__label, .vf-play__own { position: relative; z-index: 1; }
.vf-quiet { margin: 0; color: var(--vv-muted); font-size: .95rem; max-width: 30rem; }
.vf-also { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.vf-also__label { width: 100%; color: var(--vv-muted); font-size: .9rem; font-weight: 600; }
.vf-chip-button {
  min-height: 44px; padding: 0 18px; border: 1.5px solid var(--vv-control-border); border-radius: 999px;
  background: var(--vv-surface); font-weight: 650; cursor: pointer;
}
.vf-chip-button:hover { border-color: var(--vv-action); }
.vf-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 12px; width: 100%; max-width: 30rem; }
.vf-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 112px; padding: 14px 10px;
  border: 1.5px solid var(--vv-border); border-radius: 18px; background: var(--vv-surface); cursor: pointer;
}
.vf-tile[aria-checked="true"] { border: 3px solid var(--vv-action); padding: 12.5px 8.5px; background: color-mix(in srgb, var(--vv-action) 8%, var(--vv-surface)); }
.vf-tile:disabled { opacity: .45; cursor: not-allowed; }
.vf-tile__icon svg { width: 36px; height: 36px; color: var(--vv-action); }
.vf-tile__name { font-weight: 800; font-size: 1.1rem; }
.vf-tile__sub { color: var(--vv-muted); font-size: .9rem; }
.vf-tile__tick { display: none; }
:is(.vf-tile, .vf-style, .vf-theme)[aria-checked="true"] > .vf-tile__tick {
  display: grid; place-items: center; position: absolute; top: 8px; inset-inline-end: 8px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--vv-action); color: var(--vv-action-ink);
}
.vf-tile__tick svg { width: 16px; height: 16px; }
.vf-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 30rem; min-height: 64px;
  box-sizing: border-box; padding: 10px 16px; border: 1px solid var(--vv-border); border-radius: 16px; background: var(--vv-surface);
  cursor: pointer; text-align: start;
}
.vf-row__text { display: flex; flex-direction: column; }
.vf-row__text small { color: var(--vv-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .75rem; }
.vf-row__text b { font-size: 1.15rem; }
.vf-row__chev svg { width: 22px; height: 22px; transform: rotate(-90deg); }
.vf-card-slot { width: 100%; max-width: 30rem; }
.vf-card-slot:empty { display: none; }

/* --- The Preferences sheet ------------------------------------------------------------------------------- */
.vf-sheet {
  box-sizing: border-box; width: min(100%, 40rem); max-width: 100%; max-height: 90dvh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 22px 22px 0 0; background: var(--vv-page); color: var(--vv-text);
  box-shadow: 0 -10px 40px rgba(15, 23, 42, .25); overflow: hidden;
}
.vf-sheet[open] { display: flex; flex-direction: column; }
.vf-sheet::backdrop { background: rgba(15, 23, 42, .45); }
@media (min-width: 900px) { .vf-sheet { margin: auto; border-radius: 22px; max-height: 86dvh; } }
.vf-sheet__grab { width: 44px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--vv-control-border); opacity: .5; }
.vf-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 16px 8px 20px; }
.vf-sheet__head h2 { margin: 0; font-size: 1.6rem; font-weight: 800; }
.vf-sheet > .vf-switching { margin-inline: 20px; }
.vf-sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 0 16px max(20px, env(safe-area-inset-bottom)); }
.vf-group { padding: 6px 0 18px; }
/* The way to Account, first in Settings (F69): one row; signed in shows as a filled picture with a tick. */
.vf-group--account { padding: 2px 0 14px; }
.vf-account {
  box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 14px 8px 10px;
  border: 1px solid var(--vv-border); border-radius: 18px; background: var(--vv-surface); color: inherit; text-decoration: none;
}
/* As heavy as the dark theme's rule for every link (accent text): this row is a control, its name is plain text. */
html #vf-sheet #vf-account-link.vf-account { color: var(--vv-text); }
.vf-account:hover { border-color: var(--vv-action); }
.vf-account:focus-visible { outline: 3px solid var(--vv-action); outline-offset: 2px; }
.vf-account__avatar {
  position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--vv-action) 14%, var(--vv-surface)); color: var(--vv-action);
}
.vf-account__avatar > svg { width: 26px; height: 26px; }
.vf-account[data-signed-in="true"] .vf-account__avatar { background: var(--vv-action); color: #fff; }
.vf-account__tick {
  position: absolute; inset-inline-end: -3px; bottom: -3px; display: grid; place-items: center; width: 18px; height: 18px;
  border-radius: 50%; border: 2px solid var(--vv-surface); background: #15803d; color: #fff;
}
.vf-account__tick svg { width: 12px; height: 12px; }
.vf-account__text { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; text-align: start; }
.vf-account__text b { font-size: 1.08rem; font-weight: 750; }
.vf-account__text small { color: var(--vv-muted); font-size: .95rem; }
.vf-account__email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf-account__go { flex: 0 0 auto; display: grid; color: var(--vv-muted); }
.vf-account__go svg { width: 22px; height: 22px; }
.vf-account__hint { position: absolute; inline-size: 1px; block-size: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.vf-group + .vf-group { border-top: 1px solid var(--vv-border); padding-top: 16px; }
.vf-group__title { margin: 0 0 10px; font-size: 1.15rem; font-weight: 800; }
.vf-sub { margin: 16px 0 8px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--vv-muted); }
.vf-group .vf-tiles { max-width: none; }
.vf-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 8px; }
.vf-list--row { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
.vf-option {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  min-height: 56px; padding: 8px 40px 8px 14px; border: 1.5px solid var(--vv-border); border-radius: 14px;
  background: var(--vv-surface); cursor: pointer; text-align: start;
}
.vf-option__name { font-weight: 750; font-size: 1.08rem; }
.vf-option small { color: var(--vv-muted); font-size: .82rem; }
.vf-option[aria-checked="true"] { border: 2.5px solid var(--vv-action); padding: 7px 39px 7px 13px; background: color-mix(in srgb, var(--vv-action) 8%, var(--vv-surface)); }
.vf-option[aria-checked="true"] > .vf-tile__tick { display: grid; place-items: center; position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); color: var(--vv-action); }
.vf-option .vf-tile__tick svg { width: 22px; height: 22px; }
.vf-voice { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 4px; border: 1.5px solid var(--vv-border); border-radius: 14px; background: var(--vv-surface); }
.vf-voice[data-on="true"] { border-color: var(--vv-action); background: color-mix(in srgb, var(--vv-action) 8%, var(--vv-surface)); }
.vf-list:has(.vf-voice) { grid-template-columns: 1fr; }
.vf-voice__pick { flex: 1 1 auto; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 8px; border: 0; background: none; cursor: pointer; text-align: start; }
.vf-voice__pick span { display: flex; flex-direction: column; }
/* Who speaks, at a glance: a different drawing and colour for each kind of voice. */
.vf-person { display: block; flex: 0 0 44px; width: 44px; height: 44px; overflow: hidden; border-radius: 50%;
  --vv-person: #1d4ed8; --vv-person-face: color-mix(in srgb, var(--vv-person) 6%, var(--vv-surface));
  color: color-mix(in srgb, var(--vv-person) 78%, var(--vv-text));
  background: color-mix(in srgb, var(--vv-person) 18%, var(--vv-surface)); }
.vf-person svg { display: block; width: 100%; height: 100%; }
.vf-person[data-person="young-man"] { --vv-person: #0f9d8f; }
.vf-person[data-person="mature-man"] { --vv-person: #b45309; }
.vf-person[data-person="mature-woman"] { --vv-person: #a21caf; }
.vf-voice__pick b { font-size: 1.08rem; }
.vf-voice__pick small { color: var(--vv-muted); }
.vf-radio { width: 22px; height: 22px; flex: 0 0 22px; border: 2px solid var(--vv-control-border); border-radius: 50%; box-sizing: border-box; }
.vf-voice__pick[aria-checked="true"] .vf-radio { border: 7px solid var(--vv-action); }
.vf-preview { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border: 1.5px solid var(--vv-border); border-radius: 50%; background: var(--vv-surface); color: var(--vv-action); cursor: pointer; }
.vf-preview svg { width: 24px; height: 24px; }
.vf-preview[aria-pressed="true"] { background: var(--vv-action); color: var(--vv-action-ink); border-color: var(--vv-action); }
.vf-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vf-style {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 120px; padding: 10px 12px 12px;
  border: 1.5px solid var(--vv-border); border-radius: 16px; background: var(--vv-surface); cursor: pointer; text-align: start;
}
.vf-style[aria-checked="true"] { border: 3px solid var(--vv-action); padding: 8.5px 10.5px 10.5px; }
.vf-style .vf-badge--tiny { position: absolute; top: 8px; inset-inline-start: 8px; }
.vf-style__preview { align-self: stretch; display: block; min-height: 50px; margin: 18px 0 2px; padding: 6px 8px; border-radius: 10px; background: var(--vv-page); font-weight: 650; line-height: 1.25; }
.vf-style__preview[data-style="calm"] { font-size: 1.3rem; background: var(--reading-tint); box-shadow: inset 4px 0 0 var(--reading-accent); }
.vf-style__preview[data-style="calm"] .now, .vf-style__preview[data-style="calm"] .vf-style__line > :last-child, .vf-style__preview[data-style="calm"] .vf-style__line { color: var(--vf-unsaid); }
.vf-style__preview[data-style="calm"] .said, .vf-style__preview[data-style="calm"] .now { color: var(--vv-text); }
.vf-style__preview[data-style="chip"] { font-size: 1.05rem; background: color-mix(in srgb, var(--reading-accent) 7%, var(--vv-page)); }
.vf-style__preview[data-style="chip"] .now { border-radius: .3em; padding: 0 .12em; background: color-mix(in srgb, var(--reading-accent) 30%, transparent); }
.vf-style__preview[data-style="lyrics"] { font-size: 1.2rem; font-weight: 800; color: color-mix(in srgb, var(--vv-text) 36%, var(--vv-page)); background: none; }
.vf-style__preview[data-style="lyrics"] :is(.said, .now) { color: var(--vv-text); }
.vf-style__preview[data-style="today"] { font-size: 1.02rem; background: var(--reading-tint); box-shadow: inset 4px 0 0 var(--reading-accent); }
.vf-style__preview[data-style="today"] .vf-style__line { background-image: linear-gradient(var(--reading-accent), var(--reading-accent)); background-repeat: no-repeat; background-position: 0 100%; background-size: 55% 2px; }
.vf-style__preview[data-style="off"] { font-size: 1.02rem; font-weight: 600; }
.vf-style__name { font-weight: 800; font-size: 1.05rem; }
.vf-style__name b { color: var(--vv-action); }
.vf-style__about { color: var(--vv-muted); font-size: .85rem; line-height: 1.3; }
.vf-sizer { display: flex; align-items: center; gap: 10px; }
.vf-sizer .vf-round { font-weight: 800; }
.vf-sizer .vf-round:disabled { opacity: .4; }
.vf-sizer__track { flex: 1 1 auto; display: flex; justify-content: space-between; align-items: center; height: 44px; padding: 0 6px;
  background: linear-gradient(var(--vv-border), var(--vv-border)) center / calc(100% - 24px) 4px no-repeat; }
.vf-sizer__stop { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.vf-sizer__stop::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--vv-surface); border: 2px solid var(--vv-control-border); }
.vf-sizer__stop[aria-checked="true"]::before { width: 26px; height: 26px; background: var(--vv-action); border-color: var(--vv-action); }
.vf-themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.vf-theme { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 96px; padding: 8px 4px; border: 1.5px solid var(--vv-border); border-radius: 14px; background: var(--vv-surface); cursor: pointer; font-weight: 700; }
.vf-theme[aria-checked="true"] { border: 3px solid var(--vv-action); padding: 6.5px 2.5px; }
.vf-theme__thumb { display: flex; flex-direction: column; gap: 3px; width: 34px; height: 52px; box-sizing: border-box; padding: 6px 5px; border-radius: 7px; border: 1px solid #9ca3af; background: #f3f4f6; }
.vf-theme__thumb i { display: block; height: 5px; border-radius: 2px; background: #111827; }
.vf-theme__thumb i:nth-child(2) { width: 70%; background: #0891b2; }
.vf-theme[data-theme-tile="dark"] .vf-theme__thumb { background: #111827; } .vf-theme[data-theme-tile="dark"] .vf-theme__thumb i { background: #f9fafb; }
.vf-theme[data-theme-tile="dark"] .vf-theme__thumb i:nth-child(2) { background: #22b8d6; }
.vf-theme[data-theme-tile="glass"] .vf-theme__thumb { background: linear-gradient(135deg, #94d2bd, #0a9396 60%, #005f73); } .vf-theme[data-theme-tile="glass"] .vf-theme__thumb i { background: rgba(255,255,255,.9); }
.vf-theme[data-theme-tile="system"] .vf-theme__thumb { background: linear-gradient(90deg, #f3f4f6 50%, #111827 50%); }
.vf-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--vv-border); background: none; cursor: pointer; font-weight: 650; font-size: 1.02rem; text-align: start; }
.vf-switch__track { position: relative; width: 52px; height: 32px; flex: 0 0 52px; border-radius: 999px; background: var(--vv-control-border); transition: background-color .15s ease; }
.vf-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.vf-switch[aria-checked="true"] .vf-switch__track { background: var(--vv-action); }
.vf-switch[aria-checked="true"] .vf-switch__track::after { transform: translateX(20px); }
.vf-switch--mark { justify-content: flex-start; }
.vf-switch--mark .vf-switch__word { order: 2; min-width: 2.5em; margin-inline-start: 0; }
.vf-switch--mark .vf-switch__track { order: 1; }
.vf-switch--mark .vf-switch__track::after { content: "\2013"; display: grid; place-items: center; color: var(--vv-control-border); font-size: 18px; line-height: 26px; text-align: center; font-weight: 800; }
.vf-switch--mark[aria-checked="true"] .vf-switch__track::after { content: "\2713"; color: var(--vv-action); }
.vf-switch--mark:hover, .vf-switch--mark:active, .vf-switch--mark:focus { background: none; }   /* Off must never look filled (hover or press after a click) */
.vf-training__status { min-height: 1.2em; margin: 4px 0 0; color: var(--alert-bad-text); font-size: .9rem; }
.vf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 8px; }
.vf-button { min-height: 44px; padding: 0 16px; border: 1.5px solid var(--vv-control-border); border-radius: 12px; background: var(--vv-surface); font-weight: 650; cursor: pointer; }
.vf-button--danger { border-color: var(--alert-bad-border); background: var(--alert-bad-bg); color: var(--alert-bad-text); }
.vf-toast {
  display: flex; flex: 0 0 auto; align-items: center; gap: 12px; box-sizing: border-box; width: fit-content;
  max-width: calc(100% - 32px); min-height: 44px; margin: 8px auto; padding: 4px 12px; border-radius: 999px;
  background: #111827; color: #f9fafb; font-weight: 650;
}
.vf-toast[hidden] { display: none; }
.vf-toast .vf-link { color: #67e8f9; }
.vf-sheet > .vf-toast { margin-bottom: max(8px, env(safe-area-inset-bottom)); }

/* --- One card, only in dead time (spec 12) ---------------------------------------------------------------- */
.vf-card { box-sizing: border-box; width: 100%; padding: 14px; border: 1px solid var(--vv-border); border-radius: 18px; background: var(--vv-surface); text-align: start; }
.vf-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.vf-card__head b { font-size: 1.15rem; }
.vf-card__choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vf-card[data-card="rating"] .vf-card__choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vf-face { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 88px; border: 1.5px solid var(--vv-border); border-radius: 16px; background: var(--vv-page); cursor: pointer; font-weight: 700; }
.vf-face svg { width: 44px; height: 44px; }
.vf-face[data-face="bad"] svg { color: #be123c; } .vf-face[data-face="ok"] svg { color: #b45309; } .vf-face[data-face="good"] svg { color: #15803d; }

@media (prefers-reduced-motion: reduce) {
  .vf-root *, .vf-root *::before, .vf-root *::after, .vf-sheet * { animation: none !important; transition: none !important; }
  body[data-shell="listening"] #meaning > .recovered-caption, .reading-chip { transition: none !important; }
}
/* S36 shell: one column that never outgrows the window; listening controls of the old card live in the sheet. */
body[data-shell-role="listener"]:is([data-shell="entry"], [data-shell="listening"]) .vf-root { grid-template-columns: minmax(0, 1fr); }
.vf-feedback { min-width: 0; overflow: hidden; }
.vf-feedback :is(#listener-captions, #listener-captions-note, #keep-caption-screen-awake, #source-captions, #listener-focus,
  #change-output, #listener-listening-controls, #go-live[hidden]) { display: none !important; }
body[data-shell="entry"] #vf-badge { display: none; }
@media (max-width: 420px) {
  .vf-bar { justify-content: space-between; gap: 2px; padding-inline: 6px; }
  .vf-icon { min-width: 46px; padding-inline: 2px; font-size: .72rem; }
  .vf-pill { max-width: 6.6rem; min-height: 44px; padding: 0 12px; }
  .vf-pill .vf-icon__glyph { display: none; }
  .vf-speaker { height: 48px; }
}
.vf-sheet__body:not([data-section="all"]) .vf-group > .vf-group__title { display: none; }
.vf-group .vf-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vf-group .vf-tile { min-height: 96px; padding: 10px 6px; }
.vf-group .vf-tile[aria-checked="true"] { padding: 8.5px 4.5px; }
.vf-group .vf-tile__icon svg { width: 30px; height: 30px; }
.vf-group .vf-tile__name { font-size: 1rem; }
.vf-group .vf-tile__sub { font-size: .8rem; }

/* --- S36 Publisher: one large state (ready / live / paused / stopped), speaker chip, setup behind "?" ---- */
body #publisher .vf-pub { display: none; }
body[data-shell-role="publisher"]:not([data-focus-role]):is([data-pub-state="ready"], [data-pub-state="live"], [data-pub-state="paused"], [data-pub-state="stopped"]) #publisher .vf-pub {
  display: block; box-sizing: border-box; width: 100%; max-width: 64rem; margin: 0 auto; padding: 12px var(--vv-gutter) 8px;
}
body[data-shell-role="publisher"]:not([data-focus-role]):is([data-pub-state="ready"], [data-pub-state="live"], [data-pub-state="paused"], [data-pub-state="stopped"]) #publisher .publisher-header > .header-content,
body[data-shell-role="publisher"]:not([data-focus-role]):is([data-pub-state="ready"], [data-pub-state="live"], [data-pub-state="paused"], [data-pub-state="stopped"]) #publisher-saved-note,
body[data-shell-role="publisher"]:not([data-focus-role]):is([data-pub-state="ready"], [data-pub-state="live"], [data-pub-state="paused"], [data-pub-state="stopped"]) #publisher-stream :is(#ready-state, #publisher-setup-note, #publisher-listening-controls, #input-feedback, #publisher-heading) { display: none !important; }
/* Restore keeps only the access status available until the shell can draw the current room. */
body[data-shell-role="publisher"][data-pub-state="restoring"] :is(#publisher-capture-actions, #publisher-listening-controls) { display: none !important; }
body #publisher .vf-pub > :is(.vf-pub-ready, .vf-pub-live, .vf-pub-card--saved, .vf-band) { display: none; }
body[data-pub-state="ready"] #publisher .vf-pub-ready { display: flex; }
body:is([data-pub-state="live"], [data-pub-state="paused"]) #publisher .vf-pub-live { display: grid; }
body[data-pub-state="stopped"] #publisher .vf-pub-card--saved { display: grid; }
body[data-pub-state="paused"] #publisher .vf-band { display: flex; }
body #publisher .vf-pub button { font: inherit; color: inherit; }
body #publisher .vf-pub :focus-visible { outline: 3px solid var(--vv-focus); outline-offset: 2px; }

body #publisher .vf-reload-prompt[open] {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
  box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: safe center;
  gap: 16px; overflow: auto; text-align: center; border: 0; border-radius: 0;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  color: var(--vv-text); background: var(--vv-page);
}
body #publisher .vf-reload-prompt h2 { margin: 0; font-size: clamp(1.75rem, 5vw, 2.5rem); }
body #publisher .vf-reload-prompt .vf-band { margin: 0; }
body #publisher .vf-reload-prompt .vf-pub-live { display: block; width: 100%; max-width: 28rem; }
body #publisher .vf-reload-prompt .vf-pub-card, body #publisher .vf-reload-prompt #vf-pub-qr { display: none; }
body #publisher .vf-reload-prompt .vf-pub-live .vf-pub-actions { flex-wrap: wrap; justify-content: center; }
body #publisher .vf-reload-prompt #vf-pub-resume { flex: 2 1 auto; min-height: 56px; }
body #publisher .vf-reload-prompt #vf-pub-stop { flex: 0 1 auto; min-height: 56px; }
body #publisher .vf-reload-prompt .vf-pub-live .vf-act__label { overflow: visible; white-space: normal; }

/* Ready */
body #publisher .vf-pub-ready { flex-direction: column; align-items: center; gap: 16px; padding: 8px 0 12px; }
body #publisher .vf-pub-ready__head { position: relative; display: flex; justify-content: center; width: 100%; }
body #publisher .vf-pub-ready__head h2 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 800; }
body #publisher .vf-pub-ready__head h2[data-room-name] { min-width: 0; padding-inline: 3rem; text-align: center; overflow-wrap: anywhere; }
body #publisher .vf-pub-ready__head .vf-round { position: absolute; inset-inline-end: 0; top: 50%; transform: translateY(-50%); font-weight: 800; font-size: 1.3rem; }
body #publisher .vf-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 8.5rem)); gap: 12px; justify-content: center; width: 100%; }
body #publisher .vf-check {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 112px; padding: 12px 6px; border: 1.5px solid var(--vv-border); border-radius: 18px; background: var(--vv-surface); cursor: pointer;
}
body #publisher .vf-check__icon svg { width: 36px; height: 36px; color: var(--vv-action); }
body #publisher .vf-check__name { font-size: 1.05rem; }
body #publisher .vf-check__note { color: var(--vv-muted); font-size: .85rem; font-weight: 600; }
body #publisher .vf-check__mark { position: absolute; top: 8px; inset-inline-end: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
body #publisher .vf-check[data-state="ok"] .vf-check__mark { background: #15803d; }
body #publisher .vf-check[data-state="ok"] .vf-check__mark::after { content: ""; width: 11px; height: 6px; margin-top: -3px; border: solid #fff; border-width: 0 0 3px 3px; transform: rotate(-45deg); }
body #publisher .vf-check[data-state="warn"] { border-color: var(--alert-warn-border); background: var(--alert-warn-bg); }
body #publisher .vf-check[data-state="warn"] .vf-check__note { color: var(--alert-warn-text); }
body #publisher .vf-check[data-state="warn"] .vf-check__mark { width: 0; height: 0; border-radius: 0; border-inline: 13px solid transparent; border-bottom: 23px solid #b45309; }
body #publisher .vf-check[data-state="warn"] .vf-check__mark::after { content: "!"; position: absolute; top: 5px; left: -3px; color: #fff; font-weight: 900; font-size: 14px; line-height: 1; }
body #publisher .vf-check[data-state="bad"] { border-color: var(--alert-bad-border); background: var(--alert-bad-bg); }
body #publisher .vf-check[data-state="bad"] .vf-check__mark { background: var(--vv-danger); border-radius: 4px; }
body #publisher .vf-check[data-state="bad"] .vf-check__mark::after { content: "!"; color: #fff; font-weight: 900; }
body #publisher .vf-check[data-state="checking"] .vf-check__mark { border: 3px solid var(--vv-border); border-top-color: var(--vv-action); box-sizing: border-box; animation: vf-spin 1s linear infinite; }
@keyframes vf-spin { to { transform: rotate(360deg); } }
body #publisher .vf-rec { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; cursor: pointer; }
body #publisher .vf-rec__disc { display: grid; place-items: center; width: clamp(130px, 34vw, 160px); aspect-ratio: 1; border-radius: 50%; background: #be123c;
  box-shadow: 0 0 0 12px color-mix(in srgb, #be123c 16%, transparent), 0 14px 30px rgba(190, 18, 60, .3); transition: transform .15s ease; }
body #publisher .vf-rec__disc i { width: 32%; aspect-ratio: 1; border-radius: 50%; background: #fff; }
body #publisher .vf-rec:hover .vf-rec__disc { transform: scale(1.03); }
body #publisher .vf-rec:disabled { opacity: .55; cursor: progress; }

/* Live and paused */
body #publisher .vf-pub-live { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
body #publisher .vf-pub-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main ring" "chips chips"; gap: 8px 16px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--vv-border); border-radius: 20px; background: var(--vv-surface); box-shadow: var(--vv-shadow);
}
body #publisher .vf-pub-card__main { grid-area: main; }
body #publisher .vf-pub-card .vf-ring { grid-area: ring; }
body #publisher .vf-pub-card__chips { grid-area: chips; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body #publisher .vf-pub-state { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 800; color: var(--vv-danger); }
body #publisher .vf-pub-state[data-buffering] { color: var(--alert-warn-text); }
body #publisher .vf-dot--live { animation: vf-pulse 1.6s ease-in-out infinite; }
body #publisher .vf-pub-clock { margin: 0; font-size: clamp(2.6rem, 9vw, 3.4rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
body #publisher .vf-ring { --level: 0; position: relative; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%;
  background: conic-gradient(#15803d calc(var(--level) * 360deg), color-mix(in srgb, var(--vv-text) 10%, transparent) 0); }
body #publisher .vf-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--vv-surface); }
body #publisher .vf-ring__mic { position: relative; color: #15803d; }
body #publisher .vf-ring__mic svg { width: 28px; height: 28px; display: block; }
body #publisher .vf-ring[data-off="true"] .vf-ring__mic { color: var(--vv-muted); }
body #publisher .vf-ring[data-off="true"] .vf-ring__mic::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 2.5px; background: currentColor; transform: rotate(-45deg); }
body #publisher .vf-chip--button { background: var(--vv-surface); cursor: pointer; min-height: 44px; }
body #publisher .vf-speaker--small { height: 46px; }
body #publisher .vf-pub-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
body #publisher .vf-act { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 14px;
  border: 1.5px solid var(--vv-control-border); background: var(--vv-surface); font-weight: 800; font-size: 1.05rem; cursor: pointer; }
body #publisher .vf-act svg { width: 22px; height: 22px; display: block; }
body #publisher .vf-act--primary { border-color: var(--vv-action); background: var(--vv-action); color: var(--vv-action-ink) !important; }
body #publisher .vf-act--danger { border-color: #be123c; background: #be123c; color: #fff !important; }
body #publisher .vf-act:disabled { opacity: .5; cursor: not-allowed; }
body #publisher .vf-round--big { width: 52px; height: 52px; flex-basis: 52px; border-radius: 14px; }
body[data-pub-state="paused"] #publisher .vf-pub-card { border-color: var(--alert-warn-border); background: var(--alert-warn-bg); }
body[data-pub-state="paused"] #publisher .vf-pub-state { color: var(--alert-warn-text); }
body #publisher .vf-pause-bars svg { width: 18px; height: 18px; display: block; }
body #publisher .vf-band { align-items: center; justify-content: center; gap: 10px; margin: 0 0 12px; padding: 12px 16px; border-radius: 14px; font-weight: 800; font-size: 1.15rem;
  color: #422006; background: repeating-linear-gradient(-45deg, #fbbf24 0 18px, #f59e0b 18px 36px); }
body #publisher .vf-band svg { width: 22px; height: 22px; display: block; }
body #publisher .vf-pub-capture-notice {
  margin: 0.65rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
  overflow-wrap: anywhere;
}
body[data-pub-state="paused"] #publisher-transcript { opacity: .55; }
/* Stopped */
body #publisher .vf-pub-card--saved { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: none; align-items: center; gap: 12px 18px; }
body #publisher .vf-saved-tick { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; border: 4px solid #15803d; color: #15803d; background: color-mix(in srgb, #15803d 10%, var(--vv-surface)); }
body #publisher .vf-saved-tick svg { width: 40px; height: 40px; }
body #publisher .vf-pub-card--saved h2 { margin: 0; font-size: 2rem; font-weight: 800; }
body #publisher .vf-pub-saved-line { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: 1.15rem; font-weight: 700; color: var(--vv-muted); font-variant-numeric: tabular-nums; }
body #publisher .vf-square { width: 14px; height: 14px; border-radius: 3px; background: currentColor; }
body #publisher .vf-pub-actions--saved { justify-content: flex-start; }
#vf-pub-finishing { justify-self: start; }
body #publisher #vf-pub-saved-loss { grid-column: 1 / -1; }
body #publisher #vf-pub-autoend { grid-column: 1 / -1; }
@media (max-width: 760px) {
  body #publisher .vf-pub-live { grid-template-columns: minmax(0, 1fr); }
  body #publisher .vf-pub-actions { justify-content: stretch; }
  body #publisher .vf-pub-actions > .vf-act { flex: 1 1 0; }
  body #publisher .vf-pub-card--saved { grid-template-columns: auto minmax(0, 1fr); }
  body #publisher .vf-pub-card--saved > .vf-pub-actions, body #publisher .vf-pub-card--saved > #vf-pub-finishing { grid-column: 1 / -1; }
  body #publisher .vf-checks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Tabs: a picture before each word. */
body #publisher .vf-tab-icon { display: inline-grid; vertical-align: -5px; margin-inline-end: 6px; }
body #publisher .vf-tab-icon svg { width: 20px; height: 20px; }
body #publisher .vf-popover--pub { bottom: auto; top: 200px; }
@media (prefers-reduced-motion: reduce) { .vf-pub *, .vf-pub *::before, .vf-pub *::after { animation: none !important; transition: none !important; } }
body #publisher .vf-tab-short { display: none; }
@media (max-width: 560px) {
  body[data-shell-role="publisher"] #publisher .tabs-container > .content-wrapper { flex-wrap: nowrap; gap: 6px; align-items: center; }
  body[data-shell-role="publisher"] #publisher .tabs { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; }
  body[data-shell-role="publisher"] #publisher .tabs .tab-btn { flex: 1 1 0; min-width: 0; min-height: 48px; padding-inline: 4px; white-space: nowrap; }
  body #publisher .vf-tab-long { display: none; }
  body #publisher .vf-tab-short { display: inline; }
  body[data-shell-role="publisher"] #publisher #publisher-focus { flex: 0 0 48px; width: 48px; min-width: 48px; height: 48px; padding: 0; }
  body[data-shell-role="publisher"] #publisher #publisher-focus .focus-label { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
body #publisher .vf-speaker { padding: 0; }
body #publisher .vf-speaker > button { min-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
body #publisher .vf-speaker > .vf-speaker__more { border-inline-start: 1px solid var(--vv-border); }
body #publisher .vf-speaker[data-muted="true"] { border-color: var(--alert-bad-border); background: var(--alert-bad-bg); }
body #publisher .vf-chip--button { border: 1px solid var(--vv-border); border-radius: 999px; padding: 0 12px; min-height: 44px; background: var(--vv-surface); }
body #publisher .vf-popover--pub { bottom: auto; }
/* After the service: thanks and, later, one card, over the end of the reader. */
.vf-ended { display: none; }
body[data-shell-ended] .vf-ended {
  position: absolute; inset: auto 0 0 0; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 8px;
  max-height: 70%; overflow-y: auto; box-sizing: border-box; padding: 18px 16px 16px;
  border-top: 1px solid var(--vv-border); border-radius: 22px 22px 0 0; background: var(--vv-surface); box-shadow: 0 -10px 30px rgba(15, 23, 42, .12); text-align: center;
}
html.glass-theme body[data-shell-ended] .vf-ended { background: #fff; }
.vf-ended__tick { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #15803d; color: #15803d; }
.vf-ended__tick svg { width: 30px; height: 30px; }
.vf-ended h2 { margin: 0; font-size: 1.5rem; font-weight: 800; }
/* Contrast (S36 audit): accent text uses the theme's accent-text token; live red is lighter on dark. */
.vf-style__name b, .vf-badge[data-tone="suggested"] { color: var(--accent-text, var(--vv-action)); }
html.dark-theme :is(.vf-badge[data-tone="live"], .vf-pub-state) { color: #fb7185; }
@media (prefers-color-scheme: dark) { html:not(.light-theme):not(.glass-theme) :is(.vf-badge[data-tone="live"], .vf-pub-state) { color: #fb7185; } }
html.dark-theme body #publisher .vf-pub-state:not([data-buffering]) { color: #fb7185; }
@media (prefers-color-scheme: dark) { html:not(.light-theme):not(.glass-theme) body #publisher .vf-pub-state:not([data-buffering]) { color: #fb7185; } }
body #publisher .vf-speaker > .vf-speaker__more { min-width: 44px; }
/* The entry scrolls when it is taller than the window; its parts never shrink into each other. */
.vf-entry > * { flex-shrink: 0; }
.vf-entry__title:empty { display: none; }
.vf-entry[data-resting] > :not(#vf-entry-badge, #vf-entry-title, #vf-room-waiting, #voice-gallery-waiting) { display: none; }
.vf-entry:not([data-resting]) > #voice-gallery-waiting,
#listener:not([data-access="resting"]) #voice-gallery-classic-waiting { display: none; }
/* The voice row: open the list, or hear the voice right here. */
.vf-row { padding: 6px 8px 6px 4px; }
.vf-row__open { flex: 1 1 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 4px 12px;
  border: 0; background: none; cursor: pointer; text-align: start; }
.vf-play__own { color: var(--vv-muted); font-size: 1.05rem; font-weight: 600; }
.vf-card--thanks { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-weight: 700; color: var(--alert-ok-text); }
.vf-card--thanks svg { width: 22px; height: 22px; }
/* Glass: the shell sits on a frosted panel, so text keeps its contrast over the moving gradient. */
html.glass-theme body[data-shell-role="listener"] .vf-root { background: rgba(255, 255, 255, .9); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
html.glass-theme body[data-shell-role="listener"] :is(.vf-top, .vf-bar) { background: rgba(255, 255, 255, .7); }
html.glass-theme body[data-shell-role="listener"] .vf-badge[data-tone="live"] { color: #9f1239; background: rgba(190, 18, 60, .12); }
html.glass-theme body[data-shell-role="listener"] .vf-play__disc { box-shadow: 0 0 0 12px rgba(0, 95, 115, .22), 0 14px 32px rgba(0, 18, 25, .35); }
/* Publisher on a phone: the site bar keeps the logo, the language picker and the menu on one row. */
@media (max-width: 560px) {
  body[data-shell-role="publisher"] .veravox-site-nav { flex-wrap: nowrap; gap: 6px; padding-inline: 12px; }
  body[data-shell-role="publisher"] .veravox-site-nav__brand span,
  body[data-shell-role="publisher"] .veravox-site-nav__language-label,
  body[data-shell-role="publisher"] .veravox-site-nav__account-label,
  body[data-shell-role="publisher"] .veravox-site-nav__links { display: none !important; }
  body[data-shell-role="publisher"] .veravox-site-nav__language { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; }
  body[data-shell-role="publisher"] #interface-language { min-width: 0; width: 100%; max-width: 10rem; min-height: 44px; }
  body[data-shell-role="publisher"] .veravox-site-nav__account summary,
  body[data-shell-role="publisher"] .veravox-site-nav #themeToggle { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; }
}
/* --- S42 ------------------------------------------------------------------------------------------------- */
/* The app's language lives in the menu (set once); the site bar keeps the logo, the theme and the menu button. */
body[data-shell-role="publisher"] .veravox-site-nav #themeToggle { margin-inline-start: auto; }
body[data-view="publisher"] .veravox-site-nav .veravox-site-nav__account summary { min-width: 44px; }
@media (max-width: 760px), (max-height: 619px) {
  body[data-view="publisher"] .veravox-site-nav .veravox-site-nav__account summary {
    display: grid;
    place-items: center;
    padding: 0;
  }
  body[data-view="publisher"] .veravox-site-nav__account-label { display: none; }
}
body[data-shell-role="publisher"] .veravox-site-nav__menu .vf-menu-language {
  display: grid !important; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 6px 12px;
  max-width: none; min-width: 0; margin: 0; padding: 14px 20px; border-bottom: 1px solid var(--panel-border); color: var(--text-primary);
}
body[data-shell-role="publisher"] .veravox-site-nav__menu .vf-menu-language svg { width: 20px; height: 20px; }
body[data-shell-role="publisher"] .veravox-site-nav__menu .vf-menu-language .veravox-site-nav__language-label {
  display: inline !important; font-size: .95rem; font-weight: 700; color: var(--text-primary);
}
body[data-shell-role="publisher"] .veravox-site-nav__menu .vf-menu-language #interface-language {
  grid-column: 1 / -1; width: 100%; max-width: none; min-height: 44px; font-size: 1rem;
}
/* The microphone is chosen in Ajustes (and in setup), not in the paused text pane. */
body[data-shell-role="publisher"]:not([data-focus-role]):not([data-pub-state="classic"]) #publisher-stream #recovery-microphone { display: none !important; }
body :is(#publisher, #focus-toolbar) :is(#vf-pub-link-note, .publisher-echo-hint) {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--vv-muted);
  font-size: .9rem;
}
body #focus-toolbar .publisher-echo-hint { max-width: 1120px; margin: 4px auto 0; }
#vf-other-rooms { white-space: nowrap; }
/* Resume at work: the button keeps its colour, a spinner replaces the play sign, the label says so. */
body #publisher .vf-act[data-busy] { cursor: progress; }
body #publisher .vf-spinner { display: block; box-sizing: border-box; width: 20px; height: 20px; border: 3px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: vf-spin .9s linear infinite; }
/* The language pill while its switch runs: the new name at once, a quiet pulse until the new voice is confirmed. */
.vf-pill[data-switching] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--vv-action) 35%, transparent); animation: vf-switching 1s ease-in-out infinite alternate; }
@keyframes vf-switching { to { box-shadow: 0 0 0 6px color-mix(in srgb, var(--vv-action) 12%, transparent); } }
/* Hover keeps each action's own colour (the generic publisher button hover turned Resume and Stop pale with white text). */
body[data-view="publisher"] #publisher .vf-act--primary:is(:hover, [data-busy]):not(:disabled) { background: var(--vv-action); border-color: var(--vv-action); filter: brightness(1.06); }
body[data-view="publisher"] #publisher .vf-act--danger:hover:not(:disabled) { background: #be123c; border-color: #be123c; filter: brightness(1.08); }
body[data-view="publisher"] #publisher .vf-act[data-busy] { filter: none; }
body[data-view="publisher"] #publisher #vf-pub-resume[data-busy]:disabled {
  opacity: 1;
  background: var(--vv-action);
  border-color: var(--vv-action);
}
body[data-pub-why="mic"] #publisher #publisher-transcript-status[data-input-routine] { display: none; }
/* Phone: Resume, Stop and the QR code stay on one row in every moment ("Reanudando…" is wider than "Reanudar"). */
@media (max-width: 760px) {
  body #publisher .vf-pub-live .vf-pub-actions { flex-wrap: nowrap; gap: 8px; }
  body #publisher .vf-pub-live .vf-pub-actions > .vf-act { min-width: 0; padding-inline: 10px; gap: 6px; }
  body #publisher .vf-pub-live .vf-pub-actions > #vf-pub-resume { flex-grow: 1.35; }
  body #publisher .vf-pub-live .vf-act__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* --- S44: the moments of change -------------------------------------------------------------------------- */
/* Nothing shows until a layout claims the page (app.js sets data-shell-role, "classic" for the old layout), so the old
   layout never flashes before the shell. If the script never runs, the page appears after 2.5 s anyway. */
body:not([data-shell-role]) { visibility: hidden; animation: vf-boot-show 0s linear 2.5s forwards; }
@keyframes vf-boot-show { to { visibility: visible; } }
/* Old-layout lines that have no place in the shell: the captions state, the backlog note and its "go live" button. */
.vf-feedback :is(#source-caption-state, #play-backlog, #go-live) { display: none !important; }
/* The pill while a switch runs: "Cambiando a Français…"; on a phone "→ Français…" (the verb stays for readers). */
.vf-pill__verb { white-space: nowrap; }
@media (min-width: 900px) {
  .vf-pill[data-switching] { max-width: 16rem; }
}
@media (max-width: 420px) {
  .vf-pill[data-switching] { max-width: 8.4rem; }
  .vf-pill[data-switching] .vf-pill__verb { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .vf-pill[data-switching] #vf-language-name::before { content: "→ "; }
}
/* Stop while Resume works or after a reload: still there, plainly not pressable (it faded to nothing in light/glass). */
body[data-view="publisher"] #publisher .vf-act--danger:disabled {
  opacity: 1; border-color: color-mix(in srgb, #be123c 45%, var(--vv-surface)); background: color-mix(in srgb, #be123c 38%, var(--vv-surface));
  color: #fff !important; filter: saturate(.6);
}
/* The Publisher's sound menu: the same chosen look as the Listener's (a filled segment with a tick), solid in glass. */
body #publisher .vf-segment { display: flex; gap: 4px; margin: 10px 0; padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--vv-text) 8%, transparent); }
body #publisher .vf-segment > button {
  flex: 1 1 0; min-height: 52px; margin: 0; border: 0; border-radius: 9px; background: none; box-shadow: none; color: var(--vv-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
body #publisher .vf-segment > button[aria-checked="true"] { background: var(--vv-surface); color: var(--vv-text); box-shadow: 0 1px 3px rgba(15, 23, 42, .2); }
body #publisher .vf-segment > button[aria-checked="true"] b::before { content: "✓ "; color: var(--accent-text, var(--vv-action)); }
html.glass-theme body #publisher .vf-popover--pub { background: rgba(255, 255, 255, .97); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
/* After a reload the band already says how long nothing was recorded. */
body[data-pub-why] #publisher-resume-gap { display: none !important; }
/* The first moments of a Listener link (the invite being checked): blank rather than the old join screen. */
body[data-shell-role="listener"]:is(:not([data-shell]), [data-shell="boot"]) .app-container { visibility: hidden; }
/* S54: a Listener that is not in a room (link being checked, refused, or a known room resting): the heading on its
   own line with the note under it, at every width, and words never broken inside (it read "Room / unav / ailabl / e"
   at 390 because the note took the row and left the heading a 13 px column). */
body[data-view="listener"] #listener-heading,
body[data-view="listener"] #selection #listener-entry-title { overflow-wrap: break-word; word-break: normal; hyphens: manual; }
body[data-view="listener"]:not([data-focus-role]) #listener#listener:is([data-access="blocked"],[data-access="checking"],[data-access="resting"]):not([data-entry]) header.listener-header {
  grid-template-columns: minmax(0, 1fr); align-items: start; gap: 4px; padding-block: 14px 12px;
}
body[data-view="listener"]:not([data-focus-role]) #listener#listener:is([data-access="blocked"],[data-access="checking"],[data-access="resting"]):not([data-entry]) header.listener-header > .listener-intro.listener-page-intro {
  grid-template-columns: minmax(0, 1fr);
}
body[data-view="listener"] #listener:is([data-access="blocked"],[data-access="checking"],[data-access="resting"]) #listener-heading { font-size: 1.25rem; line-height: 1.25; }
body[data-view="listener"] #listener:is([data-access="blocked"],[data-access="checking"],[data-access="resting"]) .header-controls {
  grid-template-columns: minmax(0, 1fr); grid-template-areas: none; justify-content: stretch; width: 100%;
}
body[data-view="listener"] #listener:is([data-access="blocked"],[data-access="checking"],[data-access="resting"]) #play-state {
  grid-area: auto; margin: 0; width: auto; max-width: none; justify-self: stretch; justify-content: flex-start; text-align: start;
}
/* The resting room: a calm "off air" dot before its name, breathing slowly while the page waits for the host. */
body[data-view="listener"] #listener[data-access="resting"] .listener-title { align-items: center; gap: 10px; }
body[data-view="listener"] #listener[data-access="resting"] .listener-title::before {
  content: ""; flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--accent-text, #67d8ee); box-sizing: border-box; animation: vv-rest 3s ease-in-out infinite;
}
@keyframes vv-rest { 50% { opacity: .35; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { body[data-view="listener"] #listener[data-access="resting"] .listener-title::before { animation: none; } }
/* S54: the guest's "Host an event" page (/host): hosting first, joining as the way back; the account-check button
   belongs to signed-in hosts, so it is not offered here. */
body[data-host-info] #welcome .welcome-options { display: flex; flex-direction: column; }
body[data-host-info] #welcome .welcome-options > section:has(#welcome-host) { order: -1; }
body[data-host-info] #welcome :is(#host-access-note, #check-host-access, #host-access-status) { display: none; }
body[data-host-info] #publisher, body[data-host-info] #listener { display: none !important; }

/* Optional guided first run. Only the enabled flow mounts this dialog. */
#first-run {
  --fr-page: #edf3f8;
  --fr-card: #fff;
  --fr-ink: #152336;
  --fr-muted: #4e6072;
  --fr-line: #d7e2ec;
  --fr-soft: #f5f8fc;
  --fr-blue: #184cad;
  --fr-on-blue: #fff;
  --fr-tint: #e7f0ff;
  --fr-glow: #dcecff;
  --fr-ok: #17733f;
  --fr-warn: #b3261e;
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: clamp(12px, 4vh, 40px) 20px;
  overflow-y: auto;
  background: radial-gradient(ellipse at 50% 8%, var(--fr-glow), transparent 67%), var(--fr-page);
  color: var(--fr-ink);
  font: 400 1rem/1.45 Inter, system-ui, sans-serif;
  overscroll-behavior: contain;
}
html:is(.dark-theme, .glass-theme) #first-run {
  --fr-page: #0b111a;
  --fr-card: #151e2a;
  --fr-ink: #edf4ff;
  --fr-muted: #aebed1;
  --fr-line: #344356;
  --fr-soft: #1b2736;
  --fr-blue: #accbff;
  --fr-on-blue: #102849;
  --fr-tint: #233c60;
  --fr-glow: #172a46;
  --fr-ok: #84d9a3;
  --fr-warn: #ffb4ab;
  color-scheme: dark;
}
#first-run[open] { display: flex; }
#first-run::backdrop { background: var(--fr-page); }
body[data-first-run] { overflow: hidden; }
#first-run .fr-card {
  box-sizing: border-box;
  width: min(100%, 520px);
  margin: auto;
  padding: clamp(24px, 5vh, 42px) clamp(20px, 5vw, 52px) 18px;
  border: 1px solid var(--fr-line);
  border-radius: 30px;
  background: var(--fr-card);
  box-shadow: 0 24px 62px #10284916;
  text-align: center;
  animation: fr-appear 220ms cubic-bezier(.2, .7, .2, 1) both;
}
#first-run .fr-art {
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  margin: 0 auto 19px;
  border-radius: 32px;
  background: radial-gradient(circle at 25% 10%, var(--fr-card), transparent 74%), var(--fr-tint);
  color: var(--fr-blue);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fr-blue) 15%, transparent);
}
#first-run .fr-art svg { display: block; width: 51px; height: 51px; }
#first-run .fr-art.fr-qr { width: auto; height: auto; max-width: 130px; padding: 5px; border-radius: 14px; }
#first-run canvas { display: block; width: 120px; height: 120px; border-radius: 8px; image-rendering: pixelated; }
#first-run h1 {
  max-width: 15ch;
  margin: 0 auto;
  font-size: clamp(1.85rem, 6.8vw, 2.7rem);
  font-weight: 680;
  letter-spacing: -.048em;
  line-height: 1.08;
  text-wrap: balance;
}
#first-run h1:focus { outline: 0; }
#first-run-note { margin: 9px 0 0; color: var(--fr-muted); font-size: .98rem; text-wrap: pretty; }
#first-run .fr-form { display: block; margin: 14px 0 0; }
#first-run .fr-content { display: grid; gap: 9px; min-width: 0; }
#first-run .fr-content:empty, #first-run .fr-status:empty { display: none; }
#first-run .fr-status { margin: 8px 0 0; color: var(--fr-muted); font-size: .89rem; }
/* A setup name being saved, saved, or not saved: a spinner, a tick or an exclamation mark, each in its own colour. */
#first-run .fr-status[data-state] { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; }
#first-run .fr-status[data-state]::before {
  content: "";
  flex: none;
  box-sizing: border-box;
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  background: currentColor;
  -webkit-mask: var(--fr-state-mark) center / contain no-repeat;
  mask: var(--fr-state-mark) center / contain no-repeat;
}
#first-run .fr-status[data-state="saving"] { color: var(--fr-blue); }
#first-run .fr-status[data-state="saving"]::before {
  border: 3px solid color-mix(in srgb, currentColor 22%, transparent);
  border-top-color: currentColor;
  background: none;
  -webkit-mask: none;
  mask: none;
  animation: fr-spin .9s linear infinite;
}
#first-run .fr-status[data-state="saved"] {
  color: var(--fr-ok);
  --fr-state-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1.4 14.4-4.5-4.5 1.5-1.5 3 3 6.3-6.3 1.5 1.5Z'/%3E%3C/svg%3E");
}
#first-run .fr-status[data-state="failed"] {
  color: var(--fr-warn);
  --fr-state-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm1.2 15.5h-2.4v-2.4h2.4Zm0-4.3h-2.4V6.5h2.4Z'/%3E%3C/svg%3E");
}
#first-run .fr-form:has(.fr-status[data-state="failed"]) #fr-organisation { border-color: var(--fr-warn); }
/* Organisation keeps the status line's space, so Continue never moves (and a click on it is never lost) when
   "Saving…", "Saved" or "Name not saved" appears or goes. */
#first-run[data-step="organisation"] .fr-form { container-type: inline-size; }
#first-run[data-step="organisation"] .fr-status { display: flex; align-items: center; gap: 8px; font-size: .95rem; line-height: 1.3; min-height: 1.3em; }
/* Narrow card or large text: a status can wrap to two lines, so reserve both (sizes in em follow the text size). */
@container (max-width: 19em) { #first-run[data-step="organisation"] .fr-status { min-height: 2.6em; } }
@keyframes fr-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  #first-run .fr-status[data-state="saving"]::before { animation: none; }
}
#first-run button, #first-run input { font: inherit; }
#first-run button {
  box-sizing: border-box;
  min-height: 44px;
  margin: 0;
  padding: 7px 12px;
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
  font-size: .93rem;
  font-weight: 650;
  line-height: 1.25;
}
#first-run button[aria-disabled="true"] { opacity: .7; cursor: wait; }
#first-run :is(button, input, a):focus-visible, #first-run-settings:focus-visible {
  outline: 3px solid var(--vv-focus);
  outline-offset: 3px;
}
#first-run .fr-primary {
  width: min(100%, 320px);
  min-height: 49px;
  margin: 17px auto 0;
  border: 1px solid transparent;
  background: var(--fr-blue);
  color: var(--fr-on-blue);
}
#first-run .fr-primary:hover { background: color-mix(in srgb, var(--fr-blue) 91%, var(--fr-card)); }
#first-run .fr-provider, #first-run .fr-play {
  border: 1px solid var(--fr-line);
  background: var(--fr-soft);
  color: var(--fr-ink);
}
#first-run .fr-provider:hover, #first-run .fr-play:hover { border-color: var(--fr-blue); }
#first-run .fr-provider { width: min(100%, 320px); margin-inline: auto; }
#first-run .fr-secondary { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6px; margin: 5px 0 0; }
#first-run .fr-secondary:empty { display: none; }
#first-run .fr-link, #first-run-settings {
  border: 0;
  background: transparent;
  color: var(--fr-blue, var(--vv-action));
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: .21em;
}
#first-run .fr-footer {
  display: grid;
  justify-items: center;
  margin-top: 12px;
}
#first-run .fr-footer .fr-link { color: var(--fr-muted); font-size: .84rem; }
#first-run .fr-progress { display: flex; align-items: center; height: 15px; gap: 7px; }
#first-run .fr-progress span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 12px;
  background: var(--fr-line);
}
#first-run .fr-progress span[data-dot="current"] { width: 15px; background: var(--fr-blue); }
#first-run .fr-content > label { text-align: start; color: var(--fr-ink); font-size: .89rem; font-weight: 600; }
#first-run[data-step="room"] h1 { overflow-wrap: anywhere; }
#first-run input:not([type="radio"]) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--fr-line);
  border-radius: 11px;
  background: var(--fr-soft);
  color: var(--fr-ink);
}
#first-run input::placeholder { color: var(--fr-muted); opacity: 1; }
#first-run .fr-terms {
  padding: 12px 16px;
  border: 1px solid var(--fr-line);
  border-radius: 13px;
  background: var(--fr-soft);
  text-align: start;
}
#first-run .fr-terms p { margin: 0 0 8px; font-size: .87rem; }
#first-run .fr-terms { display: grid; gap: 12px; }
#first-run .fr-terms .fr-term { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; margin: 0; }
#first-run .fr-terms .fr-term > span:first-child { color: var(--fr-blue); line-height: 0; padding-top: 1px; }
#first-run .fr-terms .fr-term svg { width: 26px; height: 26px; }
#first-run .fr-terms-links { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 10px; }
#first-run .fr-terms-links a { color: var(--fr-blue); font-weight: 600; text-decoration: underline; text-underline-offset: .21em; }
#first-run .fr-terms-links .fr-accepted { color: var(--fr-ok); font-weight: 650; }
#first-run small, #first-run .fr-small { margin: 0; color: var(--fr-muted); font-size: .8rem; }
#first-run .fr-phrase { margin: 0; color: var(--fr-ink); font-size: 1.075rem; font-weight: 600; }
#first-run meter { width: 100%; height: 14px; }
#first-run meter::-webkit-meter-bar { border: 0; border-radius: 8px; background: var(--fr-line); }
#first-run meter::-webkit-meter-optimum-value { border-radius: 8px; background: var(--fr-blue); }
#first-run meter::-moz-meter-bar { border-radius: 8px; background: var(--fr-blue); }
#fr-room-link {
  display: block;
  padding: 8px 12px;
  border: 1px solid var(--fr-line);
  border-radius: 11px;
  background: var(--fr-soft);
  color: var(--fr-blue);
  overflow-wrap: anywhere;
  font-size: .88rem;
  line-height: 1.35;
  text-decoration: underline;
  text-underline-offset: .18em;
}
#first-run .fr-password { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
#first-run .fr-password .fr-link { max-width: 156px; }
#first-run .fr-options { display: grid; gap: 7px; }
#first-run .fr-option {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  min-height: 44px;
  min-width: 0;
  padding: 5px 12px;
  margin: 0;
  border: 1px solid var(--fr-line);
  border-radius: 11px;
  background: var(--fr-soft);
  color: var(--fr-ink);
  font-size: .94rem;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}
#first-run .fr-option:has(input:checked) { background: var(--fr-tint); border-color: var(--fr-blue); }
#first-run input[type="radio"] { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--fr-blue); }
#first-run .fr-voice { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 7px; }
#first-run .fr-play { display: grid; place-items: center; padding: 0; }
#first-run .fr-play svg { display: block; width: 23px; height: 23px; }
#first-run .fr-reading { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#first-run .fr-reading .fr-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  padding: 8px 10px;
}
#first-run .fr-example {
  grid-column: 1 / -1;
  color: var(--fr-muted);
  font-size: .75rem;
  line-height: 1.3;
  font-weight: 500;
}
#first-run .fr-example[data-style="today"] span { text-decoration: underline 2px var(--fr-blue); text-underline-offset: .2em; }
#first-run .fr-example[data-style="lyrics"] { color: var(--fr-blue); font-weight: 720; }
#first-run .fr-example[data-style="chip"] span { background: var(--fr-blue); color: var(--fr-on-blue); border-radius: 3px; padding: 1px 3px; }
#first-run .fr-example[data-style="calm"] { color: var(--fr-ink); font-size: .87rem; }
#first-run-settings { min-height: 44px; border-radius: 9px; font-weight: 650; }
/* The microphone step (mic-check.js): one compact device row, then the line to say, its level and hearing it back. */
#first-run[data-step="mic"] .fr-art { width: 56px; height: 56px; border-radius: 19px; margin-bottom: 10px; }
#first-run[data-step="mic"] .fr-art svg { width: 32px; height: 32px; }
#first-run .fr-glyph { display: grid; place-items: center; }
#first-run .fr-glyph svg { display: block; width: 22px; height: 22px; }
#first-run .fr-device { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--fr-muted); }
#first-run .fr-device[hidden], #first-run .fr-gain[hidden], #first-run .fr-take[hidden], #first-run .fr-take-private[hidden],
#first-run .fr-take-again[hidden] { display: none; }
#first-run select {
  box-sizing: border-box;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--fr-line);
  border-radius: 11px;
  background-color: var(--fr-soft);
  color: var(--fr-ink);
  font: inherit;
  font-size: .9rem;
  text-overflow: ellipsis;
}
#first-run select:focus-visible { outline: 3px solid var(--vv-focus); outline-offset: 3px; }
#first-run button.fr-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  padding: 0;
  border: 1px solid var(--fr-line);
  background: var(--fr-soft);
  color: var(--fr-ink);
}
#first-run button.fr-icon[aria-expanded="true"] { border-color: var(--fr-blue); background: var(--fr-tint); }
#first-run .fr-gain { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: var(--fr-muted); }
#first-run .fr-gain input[type="range"] { flex: 1; min-height: 44px; padding: 0; border: 0; background: transparent; accent-color: var(--fr-blue); }
#first-run .fr-gain output { min-width: 3.4ch; text-align: end; font-variant-numeric: tabular-nums; }
#first-run .fr-stage {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--fr-line);
  border-radius: 18px;
  background: var(--fr-soft);
}
#first-run[data-step="mic"] meter { height: 22px; border-radius: 11px; overflow: hidden; background: transparent; }
#first-run[data-step="mic"] meter::-webkit-meter-bar { height: 22px; border-radius: 11px; }
#first-run[data-step="mic"] meter::-webkit-meter-optimum-value { border-radius: 11px; transition: inline-size 80ms linear; }
#first-run .fr-take { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; min-height: 56px; }
#first-run button.fr-take-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid var(--fr-line);
  border-radius: 50%;
  background: var(--fr-card);
  color: var(--fr-blue);
}
#first-run .fr-take-button svg { width: 30px; height: 30px; }
#first-run .fr-take-button .fr-glyph { pointer-events: none; }
#first-run .fr-take[data-state="idle"] .fr-take-button { color: var(--fr-warn); }
#first-run .fr-take[data-state="recording"] .fr-take-button {
  border-color: transparent;
  background: linear-gradient(var(--fr-card), var(--fr-card)) padding-box,
    conic-gradient(var(--fr-warn) calc(var(--fr-take, 0) * 1turn), var(--fr-line) 0) border-box;
  border-width: 4px;
  color: var(--fr-warn);
}
#first-run .fr-take[data-state="ready"] .fr-take-button,
#first-run .fr-take[data-state="playing"] .fr-take-button { background: var(--fr-tint); border-color: var(--fr-blue); }
#first-run .fr-take-label { font-size: .93rem; font-weight: 650; font-variant-numeric: tabular-nums; text-align: start; }
#first-run .fr-take-again { min-height: 44px; font-size: .84rem; }
/* The speaker check (speaker-check.js), in the setup and under Settings' voice preview: a compact speaker row,
   the level of what the app sends out, and "I can't hear it" with only what is wrong. */
.vv-speaker { --vv-sp-blue: var(--fr-blue, var(--vv-action)); --vv-sp-muted: var(--fr-muted, currentColor);
  --vv-sp-line: var(--fr-line, color-mix(in srgb, currentColor 18%, transparent));
  --vv-sp-soft: var(--fr-soft, color-mix(in srgb, currentColor 5%, transparent)); box-sizing: border-box; min-width: 0; }
.vv-speaker[hidden], .vv-speaker [hidden], #publisher-speaker-check [hidden] { display: none !important; }
.vv-glyph { display: grid; place-items: center; flex: none; }
.vv-glyph svg { display: block; width: 22px; height: 22px; }
.vv-speaker-row { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 44px; }
.vv-speaker-icon { color: var(--vv-sp-muted); }
.vv-speaker-name { flex: 1; min-width: 0; overflow: hidden; text-align: start; text-overflow: ellipsis; white-space: nowrap;
  font-size: .93rem; font-weight: 600; }
.vv-speaker-select { flex: 1; min-width: 0; min-height: 44px; }
#publisher-speaker-check .vv-speaker-select, #publisher-speaker-check .vv-speaker-choose { font: inherit; }
.vv-speaker-choose, .vv-check-action { min-height: 44px; padding: 6px 12px; border: 1px solid var(--vv-sp-line);
  border-radius: 12px; background: var(--vv-sp-soft); color: inherit; font: inherit; font-weight: 650; cursor: pointer; }
.vv-speaker-how, .vv-speaker-note { margin: 2px 0 0; color: var(--vv-sp-muted); font-size: .8rem; line-height: 1.35; }
.vv-speaker-note { font-weight: 600; }
.vv-level { display: flex; align-items: center; justify-content: center; gap: 3px; height: 56px; color: var(--vv-sp-blue); }
.vv-level i { flex: 1; max-width: 7px; height: 100%; border-radius: 4px; background: currentColor; transform: scaleY(.08);
  opacity: .35; }
.vv-level[data-active="true"] i { opacity: 1; }
.vv-level meter { width: 100%; height: 18px; }
.vv-help { display: grid; justify-items: center; gap: 6px; }
button.vv-cant { min-height: 44px; border: 0; background: transparent; color: var(--vv-sp-muted); font: inherit;
  font-size: .87rem; text-decoration: underline; text-underline-offset: .21em; cursor: pointer; }
#first-run button.vv-cant { color: var(--fr-muted); }
.vv-allow, #first-run button.vv-allow { display: flex; align-items: center; justify-content: center; gap: 10px;
  width: min(100%, 320px); min-height: 56px; border: 2px solid var(--vv-sp-blue); border-radius: 16px;
  background: var(--vv-sp-soft); color: var(--vv-sp-blue); font: inherit; font-weight: 700; cursor: pointer; }
.vv-checks { display: grid; gap: 6px; width: 100%; margin: 0; padding: 0; list-style: none; text-align: start; }
.vv-checks li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border: 1px solid var(--vv-sp-line);
  border-inline-start: 4px solid #b45f06; border-radius: 12px; background: var(--vv-sp-soft); }
.vv-checks li > div { display: grid; gap: 2px; min-width: 0; font-size: .85rem; line-height: 1.35; }
.vv-checks li strong { font-size: .9rem; }
.vv-checks li span { color: var(--vv-sp-muted); overflow-wrap: anywhere; }
/* Not a fault, a thing to look at: its own edge and the shape of its icon say so. */
.vv-checks li[data-check="route"], .vv-checks li[data-check="volume"], .vv-checks li[data-check="checking"] {
  border-inline-start-color: var(--vv-sp-blue); }
.vv-checks li[data-check="route"] .vv-glyph, .vv-checks li[data-check="volume"] .vv-glyph { color: var(--vv-sp-blue); }
.vv-check-action { justify-self: start; margin-top: 5px; }
#publisher-speaker-check { display: grid; gap: 6px; max-width: 28rem; margin-top: 8px; }
#publisher-speaker-check button.vv-cant { min-width: 0; border: 0; background: transparent; box-shadow: none; font-weight: 600; }
#first-run .vv-speaker-device { color: var(--fr-ink); }
#first-run .vv-speaker-choose { flex: none; }
#first-run[data-step="publisher_voice"] .fr-art, #first-run[data-step="listener_voice"] .fr-art { width: 56px; height: 56px;
  border-radius: 19px; margin-bottom: 10px; }
#first-run[data-step="publisher_voice"] .fr-art svg, #first-run[data-step="listener_voice"] .fr-art svg { width: 32px; height: 32px; }
#first-run .fr-stage .fr-phrase { font-size: .95rem; }
#first-run button.fr-sample { background: var(--fr-tint); border-color: var(--fr-blue); color: var(--fr-blue); }
#first-run .fr-voice:not(:has(.fr-play)) { grid-template-columns: minmax(0, 1fr); }
#first-run .fr-voice-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
#first-run .fr-badge { padding: 1px 8px; border-radius: 999px; background: var(--fr-tint); color: var(--fr-blue);
  font-size: .72rem; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .vv-level i { transition: none; }
}
@keyframes fr-appear {
  from { opacity: .78; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-height: 740px) {
  #first-run .fr-card { padding-top: 20px; }
  #first-run .fr-art:not(.fr-qr) { width: 74px; height: 74px; border-radius: 25px; margin-bottom: 14px; }
  #first-run .fr-art:not(.fr-qr) svg { width: 43px; height: 43px; }
}
@media (max-width: 480px) {
  #first-run { padding-inline: 14px; }
  #first-run .fr-card { border-radius: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  #first-run .fr-card { animation: none; }
  #first-run[data-step="mic"] meter::-webkit-meter-optimum-value { transition: none; }
}
/* Optional signed audience cards. The normal presence drawer retains its layout. */
.audience-overlay .listeners-drawer--profiles {
  width: min(100%, 670px);
}
.audience-overlay .listeners-drawer--profiles .listeners-drawer__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr));
  gap: 8px;
  align-items: start;
}
.audience-overlay .listeners-drawer--profiles .listener-presence-row {
  padding: 0;
  min-width: 0;
  border-radius: 13px;
}
.audience-overlay .listeners-drawer--profiles .listener-card-toggle {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  text-align: start;
  font: inherit;
  color: var(--vv-text);
  background: transparent;
  border: 0;
  border-radius: 12px;
}
.audience-overlay .listener-card-toggle:hover { background: var(--vv-control-hover); }
.audience-overlay .listener-card-toggle:focus-visible { outline-offset: -3px; }
.audience-overlay .listener-card-labels { min-width: 0; }
.audience-overlay .listener-card-labels > * { display: block; overflow-wrap: anywhere; }
.audience-overlay .listener-card-labels strong { font-size: .92rem; line-height: 1.3; }
.audience-overlay .listener-card-route, .audience-overlay .listener-card-state {
  margin-top: 2px;
  font-size: .75rem;
  color: var(--vv-muted);
}
.audience-overlay .listener-card-state { color: var(--vv-focus); }
.audience-overlay .listener-card-chevron { font-size: 1.25rem; color: var(--vv-muted); }
.audience-overlay .listener-card-toggle[aria-expanded="true"] .listener-card-chevron { transform: rotate(90deg); }
.audience-overlay .listener-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 50%;
  background: var(--vv-control-hover);
  color: var(--vv-text);
  font-size: .82rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.audience-overlay .listener-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.audience-overlay .listener-avatar__initials:empty::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 50% 27%, currentColor 20%, transparent 22%),
    radial-gradient(ellipse at 50% 95%, currentColor 43%, transparent 46%);
}
.audience-overlay .listeners-drawer--profiles .listener-presence-row__details {
  border-top: 1px solid var(--vv-border);
  padding: 4px 12px 12px;
}
.audience-overlay .listener-departed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-block: 4px;
  overflow-wrap: anywhere;
}
.audience-overlay .listener-departed-row strong { flex: 1 1 120px; min-width: 0; font-size: .85rem; }
.audience-overlay .listener-departed-row > span:last-child { color: var(--vv-muted); font-size: .8rem; }
/* Listener voice gallery */
.vg-entry {
  display: inline-grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  width: min(100%, 25rem);
  min-height: 52px;
  padding: 8px 14px;
  border: 1px solid var(--vv-border);
  border-radius: 16px;
  background: var(--vv-surface);
  color: var(--vv-text);
  font-weight: 700;
  text-align: start;
}
.vg-entry:hover { background: var(--vv-control-hover); }
.vg-entry, #voice-gallery button { -webkit-tap-highlight-color: transparent; }
.vg-entry > svg { width: 100%; color: var(--accent-text, var(--vv-action)); }
#voice-gallery-lobby { margin-block-end: 12px; }

#voice-gallery {
  box-sizing: border-box;
  width: min(calc(100% - 24px), 30rem);
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--vv-border);
  border-radius: 28px;
  background: var(--vv-surface);
  color: var(--vv-text);
  box-shadow: 0 20px 64px #0004;
  overflow: hidden;
}
#voice-gallery::backdrop { background: #0f172a70; }
#voice-gallery svg { display: block; width: 24px; height: 24px; }
#voice-gallery .vg-panel { display: flex; flex-direction: column; max-height: inherit; }
.vg-header {
  position: relative;
  flex: none;
  padding: 20px 20px 14px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--vv-action) 13%, var(--vv-surface)), var(--vv-surface) 80%);
}
.vg-emblem {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-block-end: 12px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--vv-action) 15%, var(--vv-surface));
  color: var(--accent-text, var(--vv-action));
}
#voice-gallery .vg-close {
  position: absolute;
  inset: 14px 14px auto auto;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--vv-control-fill);
  color: var(--vv-text);
}
.vg-header h2 { margin: 0 0 6px; font-size: clamp(1.55rem, 7vw, 2rem); line-height: 1.12; }
.vg-header p { margin: 0; color: var(--vv-muted); line-height: 1.38; }
.vg-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 16px max(10px, env(safe-area-inset-bottom));
  scrollbar-gutter: stable;
}
#voice-gallery .vg-language {
  min-width: 9rem;
  max-width: 100%;
  margin: 0 4px 12px;
  border: 1px solid var(--vv-border);
  border-radius: 14px;
  background-color: var(--vv-control-fill);
  color: var(--vv-text);
  font-weight: 650;
}
.vg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 18px;
  background: var(--vv-control-fill);
}
.vg-list > li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 10px 12px;
}
.vg-list > li + li { border-block-start: 1px solid var(--vv-border); }
.vg-voice { min-width: 0; overflow-wrap: anywhere; }
.vg-voice strong { display: block; font-size: 1.06rem; line-height: 1.25; }
.vg-voice small { display: block; color: var(--vv-muted); font-size: .875rem; line-height: 1.35; }
#voice-gallery :is(.vg-play, .vg-pick) {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  touch-action: manipulation;
}
#voice-gallery .vg-play {
  width: 54px;
  height: 54px;
  background: var(--vv-action);
  color: var(--vv-action-ink);
}
#voice-gallery .vg-play:hover { background: var(--vv-action-hover); }
#voice-gallery .vg-pick { width: 48px; height: 48px; background: transparent; }
#voice-gallery .vg-pick:active { background: var(--vv-control-hover); }
.vg-pick > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  box-sizing: border-box;
  border: 1.5px solid var(--vv-control-border);
  border-radius: 50%;
  color: transparent;
}
.vg-pick[aria-pressed="true"] > span {
  background: var(--vv-action);
  border-color: var(--vv-action);
  color: var(--vv-action-ink);
}
#voice-gallery .vg-pick svg { width: 18px; height: 18px; }
.vg-status {
  min-height: 1.4em;
  margin: 8px 4px 0;
  color: var(--vv-muted);
  font-size: .875rem;
  line-height: 1.4;
}
@media (max-height: 490px) {
  .vg-header { padding-block-start: 12px; }
  .vg-emblem { display: none; }
  .vg-header h2 { padding-inline-end: 44px; }
}

/* The room's Spanish voice: two large choices told apart by icon and by the selected one's ring and tick, not by colour alone. */
#publisher-settings .setting-voice-engine {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}
#publisher-settings .setting-voice-engine[hidden] { display: none; }
.setting-voice-engine__label { font-weight: 600; }
.voice-engine-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.voice-engine-choice button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 14px;
  border: 2px solid var(--panel-border, rgba(127, 127, 127, 0.4));
  border-radius: 14px;
  background: var(--panel-bg, transparent);
  color: var(--text-primary, inherit);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.voice-engine-choice button[aria-checked="true"] {
  border-color: var(--brand-accent-strong, #2563eb);
  box-shadow: 0 0 0 2px var(--brand-accent-strong, #2563eb) inset;
}
.voice-engine-choice button[aria-checked="true"]::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 10px;
  font-size: 0.9em;
}
.voice-engine-choice button:disabled { opacity: 0.6; cursor: default; }
.voice-engine-choice button:focus-visible { outline: 3px solid var(--brand-accent-strong, #2563eb); outline-offset: 2px; }
.voice-engine-choice svg { flex: none; }
.pacing-tile__words { display: grid; gap: 2px; }
.pacing-tile__words small { font-weight: 400; font-size: 0.85em; line-height: 1.25; text-wrap: balance; }
@media (max-width: 520px) {
  .voice-engine-choice button { flex-direction: column; gap: 4px; min-height: 76px; text-align: center; }
}

/* ==== U4: the reading styles on the Publisher's transcript rows (the Listener's are in the S36 block above). The
   underline ("today", the default) is the "now reading" block; "off" sets no mark at all. ====================== */
#publisher-transcript-rows > .chunk { position: relative; isolation: isolate; }
body[data-view="publisher"]:is([data-reading-style="calm"], [data-reading-style="chip"], [data-reading-style="lyrics"]) #publisher-transcript-rows .reading-text { background-image: none; }
body[data-view="publisher"]:is([data-reading-style="calm"], [data-reading-style="chip"], [data-reading-style="lyrics"]) #publisher-transcript #publisher-transcript-rows > .chunk.playing .es { color: inherit; }
body[data-view="publisher"][data-reading-style="calm"] #publisher-transcript-rows > .chunk[data-reading] { box-shadow: inset 5px 0 0 0 var(--reading-accent); }
body[data-view="publisher"][data-reading-style="calm"] #publisher-transcript-rows > .chunk[data-reading][data-words] .w { color: var(--vf-unsaid); transition: color .12s linear; }
body[data-view="publisher"][data-reading-style="calm"] #publisher-transcript-rows > .chunk[data-reading][data-words] .w[data-said] { color: var(--vv-text); }
body[data-view="publisher"][data-reading-style="chip"] #publisher-transcript-rows > .chunk[data-reading] {
  background-color: color-mix(in srgb, var(--reading-accent) 7%, transparent); box-shadow: none;
}
body[data-view="publisher"][data-reading-style="chip"] #publisher-transcript-rows > .chunk[data-reading][data-words] > .reading-chip {
  display: block; position: absolute; left: 0; top: 0; z-index: -1; border-radius: .32em; opacity: 0; pointer-events: none;
  background: color-mix(in srgb, var(--reading-accent) 26%, transparent);
  transition: transform .11s ease-out, width .11s ease-out, height .11s ease-out, opacity .2s ease; will-change: transform;
}
html.dark-theme body[data-view="publisher"][data-reading-style="chip"] .reading-chip { background: color-mix(in srgb, var(--reading-accent) 38%, transparent); }
body[data-view="publisher"][data-reading-style="chip"] #publisher-transcript-rows > .chunk[data-words] > .reading-chip[data-on] { opacity: 1; }
body[data-view="publisher"][data-reading-style="lyrics"] #publisher-transcript-rows > .chunk[data-reading] { background: none; box-shadow: none; }
body[data-view="publisher"][data-reading-style="lyrics"] #publisher-transcript-rows:has(> .chunk[data-reading]) > .chunk:not([data-reading]) { opacity: .5; }
body[data-view="publisher"][data-reading-style="lyrics"] #publisher-transcript-rows > .chunk[data-reading][data-words] .w {
  --lit: var(--vv-text); --unlit: color-mix(in srgb, var(--vv-text) 36%, var(--vv-page));
  color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(90deg, var(--lit) calc(var(--p, 0) * (100% + .8em) - .8em), var(--unlit) calc(var(--p, 0) * (100% + .8em)));
}
#publisher-reading-style .vf-styles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (prefers-reduced-motion: reduce) {
  #publisher-transcript-rows .reading-chip, #publisher-transcript-rows .w { transition: none !important; }
}

/* ==== Microphone check polish (Setup guide step 1 and Publisher Settings, 3 Dec) ===========================
   One block, two homes: the guide moves .microphone-setup into #guide-microphone-slot, Settings keeps it in
   .setting-mic. The level meter is the focal point: a 10 px rounded bar in a well with a 3:1 ring, green for a
   signal and red while the status says the input is peaking (data-input-peak, held 1.5 s by app.js), so the
   colour does not flicker with every syllable. Quiet input is said in words by the status line. The test button is this step's primary action; Refresh is tertiary.
   Selectors carry two ids on purpose: older phone rules reach these controls through #publisher and :has().
   No data: images here: the app's CSP allows them only on some servers, so icons are inline SVG or CSS shapes. */
.microphone-setup {
  --mic-muted: #6b7280;
  --mic-label: var(--text-secondary, #4b5563);
  --mic-well: #e5e7eb;
  --mic-ring: #7c8696;
  --mic-good: #15803d;
  --mic-peak: #be123c;
  --mic-accent: var(--vv-action, #0e7490);
  --mic-accent-hover: var(--vv-action-hover, #155e75);
  --mic-tertiary: var(--accent-text, #0e7490);
}
html.dark-theme .microphone-setup {
  --mic-muted: #94a3b8;
  --mic-label: #cbd5e1;
  --mic-well: #111827;
  --mic-ring: #8291a7;
  --mic-good: #4ade80;
  --mic-peak: #fb7185;
}
@media (prefers-color-scheme: dark) {
  html:not(.light-theme):not(.glass-theme) .microphone-setup {
    --mic-muted: #94a3b8;
    --mic-label: #cbd5e1;
    --mic-well: #111827;
    --mic-ring: #8291a7;
    --mic-good: #4ade80;
    --mic-peak: #fb7185;
  }
}

/* Layout: one column on an 8-pt rhythm (an open event keeps its own block layout, set above). */
html body :is(#guide-microphone-slot, #publisher-settings) .microphone-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
  container: mic / inline-size;
}
/* An open or restored event hides the test controls but keeps the same rhythm for what stays. */
html body #publisher:is([data-event-active], [data-restore]) #publisher-settings .microphone-setup { display: grid; }
/* The guide: one calm card. Settings: no card inside the section card. */
html body #publisher-guide #guide-microphone-slot .microphone-setup {
  margin: 20px 0 0;
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel-bg-light);
  box-shadow: none;
}
html body #publisher #publisher-settings .setting-mic .microphone-setup {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
@media (min-width: 600px) {
  html body #publisher-guide #guide-microphone-slot .microphone-setup { padding: 24px; }
}

/* Field label above a full-width select with a soft accent focus ring. */
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup > label {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--mic-label);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-input {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--vv-control-border);
  border-radius: 10px;
  background-color: var(--panel-bg);
  background-image: none;
  color: var(--text-primary);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
  box-shadow: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-input:hover:enabled {
  border-color: var(--mic-label);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-input:focus-visible {
  border-color: var(--mic-accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent, #0891b2) 35%, transparent);
}

/* Actions: Refresh (tertiary, icon + text) and the test (primary, the wide target), one row, 48 px tall. */
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup .microphone-check-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 12px;
  margin: 0;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup :is(#check-microphone, #resume-microphone-check, #refresh-microphones) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-width: 48px;
  min-height: 48px;
  margin: 0;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  box-shadow: none;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup :is(#check-microphone, #resume-microphone-check) {
  flex: 1 1 auto;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup :is(#check-microphone, #resume-microphone-check):not(:disabled, [aria-disabled="true"]) {
  border: 1px solid var(--mic-accent);
  background: var(--mic-accent);
  background-image: none;
  color: var(--vv-action-ink, #fff);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup :is(#check-microphone, #resume-microphone-check):not(:disabled, [aria-disabled="true"]):hover {
  border-color: var(--mic-accent-hover);
  background: var(--mic-accent-hover);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #check-microphone:disabled {
  border: 1px solid var(--panel-border);
  background: var(--panel-bg-light);
  color: var(--mic-muted);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #refresh-microphones {
  flex: 0 0 auto;
  padding-inline: 12px 14px;
  border: 1px solid transparent;
  background: transparent;
  background-image: none;
  color: var(--mic-tertiary);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #refresh-microphones:hover {
  background: color-mix(in srgb, var(--brand-accent, #0891b2) 12%, transparent);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup :is(#check-microphone, #resume-microphone-check, #refresh-microphones):focus-visible {
  outline: 2px solid var(--brand-accent, #0891b2);
  outline-offset: 2px;
}
/* Icons: Refresh carries an inline SVG; the test button (app.js sets its text) draws a record dot that becomes a
   stop square while the level is live, so the state shows by shape as well as by the label. */
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup .microphone-action-icon {
  flex: none;
  width: 18px;
  height: 18px;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #check-microphone::before {
  content: "";
  content: "" / "";
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup:has(#microphone-preview-level:not([hidden])) #check-microphone::before {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}
/* Narrow cards (the guide at every width, Settings on a phone): Refresh keeps its name for screen readers and its
   tooltip, and shows only its icon, so longer translations of the test button stay on one line. */
@container mic (max-width: 479px) {
  html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #refresh-microphones {
    width: 48px;
    padding: 0;
    gap: 0;
    border-color: var(--panel-border);
    font-size: 0;
  }
  html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup :is(#check-microphone, #resume-microphone-check) {
    padding: 6px 10px;
    font-size: .875rem;
    line-height: 1.2;
  }
  html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup .microphone-check-actions { min-height: 60px; }
  /* With the test button hidden (an open event), Refresh is alone and shows its name again. */
  html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup .microphone-check-actions:not(:has(#check-microphone:not([hidden]))) #refresh-microphones {
    width: auto;
    padding-inline: 12px 14px;
    gap: 8px;
    font-size: .9375rem;
  }
}
/* Wide Settings: the pair sits at the end of the row instead of one very long button. */
@container mic (min-width: 560px) {
  html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup .microphone-check-actions { justify-content: flex-end; }
  html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup :is(#check-microphone, #resume-microphone-check) { flex: 0 1 16rem; }
}

/* An open event or a restore hides the test even if app.js has not set hidden yet. */
html body #publisher:is([data-event-active],[data-restore]) #publisher-settings .microphone-setup :is(#check-microphone, #resume-microphone-check) { display: none; }

/* Helper lines: softer, smaller, comfortable to read, and kept close to what they explain. */
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup :is(#microphone-check-note, #microphone-switch-status, #microphone-gain-note) {
  margin: 0;
  color: var(--mic-muted);
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.5;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup :is(#microphone-check-note, #microphone-switch-status) { margin-top: -8px; }

/* The live check: "Input level", then mic icon + meter, then the status and the device as one quiet group. */
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preflight {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
}
/* The preview's children join the grid above, so the status can sit between the meter and the device name. */
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview {
  display: contents;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup .microphone-preview-meter { order: 1; }
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup .microphone-preview-meter:has(#microphone-preview-level:not([hidden])) {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
  margin: 0;
  font-size: inherit;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup .microphone-preview-icon {
  grid-column: 1;
  grid-row: 2;
  width: 20px;
  height: 20px;
  color: var(--mic-label);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview-label {
  display: block;
  grid-column: 1 / -1;
  grid-row: 1;
  margin: 0;
  color: var(--mic-label);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview-level {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  grid-column: 2;
  grid-row: 2;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 12px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--mic-well);
  box-shadow: inset 0 0 0 1px var(--mic-ring);
  overflow: hidden;
}
/* Chrome lays the inner bar out at half the meter's height unless the inner element is a flex box. */
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview-level::-webkit-meter-inner-element {
  display: flex;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview-level::-webkit-meter-bar {
  box-sizing: border-box;
  height: 100%;
  border: 0;
  border-radius: 999px;
  background: var(--mic-well);
  box-shadow: inset 0 0 0 1px var(--mic-ring);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview-level::-webkit-meter-optimum-value {
  border-radius: 999px;
  background: var(--mic-good);
  transition: inline-size 90ms linear;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview-level::-moz-meter-bar {
  border-radius: 999px;
  background: var(--mic-good);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup:has(#microphone-preview-status[data-input-peak]) #microphone-preview-level::-webkit-meter-optimum-value {
  background: var(--mic-peak);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup:has(#microphone-preview-status[data-input-peak]) #microphone-preview-level::-moz-meter-bar {
  background: var(--mic-peak);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup:has(#microphone-preview-status[data-input-peak]) .microphone-preview-icon {
  color: var(--mic-peak);
}

html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup :is(#microphone-preview-device, #microphone-preview-status) {
  margin: 0;
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview-status {
  order: 2;
  color: var(--text-primary);
  font-size: .875rem;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview-device {
  order: 3;
  margin-top: 2px;
  color: var(--mic-muted);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-test-playback {
  order: 4;
  width: 100%;
  margin: 12px 0 0;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup:has(#microphone-preview-level:not([hidden])) #microphone-preview-status {
  margin-top: 12px;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup:has(#microphone-preview-level:not([hidden])):has(#microphone-preview-status:empty) #microphone-preview-device {
  margin-top: 12px;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup:has(#microphone-preview-level[hidden]):has(#microphone-preview-status:empty) #microphone-preview-device {
  margin-top: 0;
}
/* Peaking: a warning mark and the peak colour, never colour alone. */
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview-status[data-input-peak] {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--mic-peak);
  font-weight: 600;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview-status[data-input-peak]::before {
  content: "!";
  content: "!" / "";
  flex: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--mic-peak);
  color: var(--panel-bg);
  font-size: .6875rem;
  font-weight: 800;
  line-height: 1;
}

/* Input gain: label and value on one row, the slider full width below, the note under it. */
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup .setting-mic__gain {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--panel-border);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup .setting-mic__gain > label {
  display: block;
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  color: var(--mic-label);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-gain-value {
  grid-column: 2;
  grid-row: 1;
  min-width: 3.5ch;
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--brand-accent, #0891b2) 14%, transparent);
  color: var(--text-primary);
  font-size: .875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  text-align: center;
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-gain {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  accent-color: var(--brand-accent, #0891b2);
}
html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-gain-note {
  grid-column: 1 / -1;
  grid-row: 3;
}

/* The guide around it: one surface, even paddings, a calm eyebrow and title, a 44 px close button. */
html body #publisher-guide[open] { padding: 0; }
html body #publisher-guide :is(.publisher-guide-header, .publisher-guide-body, .publisher-guide-actions) {
  padding: 20px;
  background: var(--panel-bg);
  background-image: none;
}
html body #publisher-guide .publisher-guide-header { align-items: flex-start; gap: 16px; padding-block: 20px 16px; }
html body #publisher-guide .publisher-guide-actions { padding-block: 16px 20px; }
@media (min-width: 600px) {
  html body #publisher-guide :is(.publisher-guide-header, .publisher-guide-body, .publisher-guide-actions) { padding-inline: 24px; }
  html body #publisher-guide .publisher-guide-header { padding-block: 24px 20px; }
  html body #publisher-guide .publisher-guide-body { padding-block: 24px; }
  html body #publisher-guide .publisher-guide-actions { padding-block: 16px 24px; }
}
@media (max-height: 500px) {
  html body #publisher-guide :is(.publisher-guide-header, .publisher-guide-actions) { padding-block: 10px; }
}
html body #publisher-guide #guide-progress {
  margin: 0 0 4px;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.4;
}
html body #publisher-guide h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
html body #publisher-guide .publisher-guide-body h3 { font-size: 1.0625rem; font-weight: 650; line-height: 1.35; }
html body #publisher-guide .publisher-guide-body section > p {
  margin: 6px 0 12px;
  color: var(--text-secondary);
  font-size: .9375rem;
  line-height: 1.5;
}
html body #publisher-guide .publisher-guide-header #guide-close {
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: -4px -8px 0 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--panel-bg-light);
  color: var(--text-secondary);
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1;
}
/* The guide moves focus to each step's heading for screen readers; a heading is not a control, so no ring. */
html body #publisher-guide :is(h2, h3)[tabindex="-1"]:focus,
html body #publisher-guide :is(h2, h3)[tabindex="-1"]:focus-visible { outline: none; }
html body #publisher-guide .publisher-guide-header #guide-close:hover { background: var(--panel-border); color: var(--text-primary); }

@media (prefers-reduced-motion: reduce) {
  html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-preview-level::-webkit-meter-optimum-value,
  html body :is(#publisher-guide #guide-microphone-slot, #publisher #publisher-settings) .microphone-setup #microphone-input { transition: none; }
}

/* In the guide the step's own "Next" is the one solid action; the test button is tonal there (Settings keeps it solid). */
html body #publisher-guide #guide-microphone-slot .microphone-setup :is(#check-microphone, #resume-microphone-check):not(:disabled, [aria-disabled="true"]) {
  border: 1px solid color-mix(in srgb, var(--mic-accent) 55%, transparent);
  background: color-mix(in srgb, var(--mic-accent) 14%, transparent);
  color: var(--mic-tertiary);
}
html body #publisher-guide #guide-microphone-slot .microphone-setup :is(#check-microphone, #resume-microphone-check):not(:disabled, [aria-disabled="true"]):hover {
  border-color: var(--mic-accent);
  background: color-mix(in srgb, var(--mic-accent) 22%, transparent);
}

/* Auto-end prompt (index.html #autoend-prompt): one calm full-screen sheet over the Host page. The ring empties as
   the countdown runs (--autoend-left, 1 -> 0); Keep going is the big, close, single focal action. */
.autoend-prompt[open] {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
  box-sizing: border-box; display: flex; align-items: center; justify-content: center; overflow: auto; border: 0;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  color: var(--vv-text); background: var(--vv-page);
}
.autoend-prompt::backdrop { background: var(--vv-page); }
.autoend-prompt__card {
  display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 26rem; text-align: center;
}
.autoend-prompt__ring { position: relative; width: clamp(140px, 42vw, 180px); aspect-ratio: 1; }
.autoend-prompt__ring > svg:first-child { width: 100%; height: 100%; transform: rotate(-90deg); }
.autoend-prompt__track { fill: none; stroke: var(--vv-border); stroke-width: 8; }
.autoend-prompt__left {
  fill: none; stroke: var(--vv-indicator-attention); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: calc(100 - 100 * var(--autoend-left, 1)); transition: stroke-dashoffset .25s linear;
}
.autoend-prompt__inside { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; }
.autoend-prompt__glyph { width: 30%; height: 30%; color: var(--vv-indicator-attention); }
#autoend-countdown { color: var(--vv-text); font-size: clamp(1.9rem, 8vw, 2.4rem); font-weight: 800; line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.autoend-prompt__time { margin: -4px 0 0; color: var(--vv-muted); font-size: .95rem; font-weight: 600; }
.autoend-prompt h2 { margin: 0; font-size: clamp(1.75rem, 6vw, 2.4rem); font-weight: 800; }
#autoend-body { margin: 0; color: var(--vv-muted); font-size: 1rem; line-height: 1.4; }
.autoend-prompt__keep, .autoend-prompt__end {
  width: 100%; min-height: 60px; border-radius: 16px; font: inherit; font-size: 1.2rem; font-weight: 800; cursor: pointer;
}
.autoend-prompt__keep { margin-top: 8px; border: 0; background: var(--vv-action); color: var(--vv-action-ink); }
.autoend-prompt__keep:hover { background: var(--vv-action-hover); }
.autoend-prompt__end {
  min-height: 52px; font-size: 1.05rem; font-weight: 700; border: 1.5px solid var(--vv-border); background: transparent;
  color: var(--vv-text);
}
.autoend-prompt__keep:focus-visible, .autoend-prompt__end:focus-visible { outline: 3px solid var(--vv-focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .autoend-prompt__left { transition: none; } }

/* Gallery cards (autoend.js galleryCard): the state is read from the badge's shape and colour, not words alone.
   Only Live now looks live; an ended card is quiet and not joinable. */
.room-card__badge { display: inline-flex; align-items: center; gap: 6px; }
.room-card__badge::before { content: ""; width: 8px; height: 8px; flex: 0 0 auto; box-sizing: border-box; }
.room-card[data-state="live"] .room-card__badge::before { border-radius: 50%; background: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.18); }
.room-card[data-state="paused"] .room-card__badge::before { width: 8px; border-inline: 3px solid currentColor; }
.room-card[data-state="waiting"] .room-card__badge::before { border-radius: 50%; border: 2px solid currentColor; }
.room-card[data-state="reconnecting"] .room-card__badge::before { width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: vf-spin 1.2s linear infinite; }
.room-card[data-state="host_left"] .room-card__badge::before { width: 9px; height: 9px; border: solid currentColor;
  border-width: 2px 2px 0 0; transform: rotate(45deg); }
.room-card[data-state="ended"] .room-card__badge::before { background: currentColor; border-radius: 1px; }
.badge-away { background: rgba(251,191,36,.2); color: #92400e; }
.badge-ended { background: rgba(100,116,139,.16); color: #334155; }
html.dark-theme .badge-away { background: rgba(251,191,36,.16); color: #fde68a; }
html.dark-theme .badge-ended { background: rgba(148,163,184,.18); color: #cbd5e1; }
@media (prefers-color-scheme: dark) {
  html:not(.light-theme):not(.glass-theme) .badge-away { background: rgba(251,191,36,.16); color: #fde68a; }
  html:not(.light-theme):not(.glass-theme) .badge-ended { background: rgba(148,163,184,.18); color: #cbd5e1; }
}
.room-card[data-state="ended"] { cursor: default; box-shadow: none; opacity: .8; }
.room-card[data-state="ended"]:hover { transform: none; box-shadow: none; }
.room-card[data-state="ended"] .room-card__join { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .room-card[data-state="reconnecting"] .room-card__badge::before { animation: none; } }

/* The Host page after an automatic end: why and how to pick up again, in the saved card. */
body #publisher .vf-pub-autoend { margin: 0; padding: 10px 14px; border-radius: 12px; font-weight: 600; line-height: 1.4;
  border: 1px solid var(--alert-warn-border, #a16207); background: var(--alert-warn-bg, #fef3c7); color: var(--alert-warn-text, #78350f); }
