.host-conversation{margin-top:10px;max-width:410px;text-shadow:none}
.host-conversation-buttons{display:flex;flex-wrap:wrap;gap:6px}
.host-conversation-buttons button{min-height:44px;padding:9px 12px;font-size:11px;line-height:1.3;background:#14242aeb;border-color:#daece345;white-space:normal}
#hostHud:not(.needs-source) #hostConversation [data-host-hold-talk],
body:has(#guestPanel:not([hidden])) #guestConversation [data-guest-hold-talk]{min-height:48px;touch-action:none;user-select:none}
.host-conversation-buttons button[data-host-hold-talk][aria-pressed=true],
.host-conversation-buttons button[data-guest-hold-talk][aria-pressed=true]{background:#285b53;border-color:#a7ffcf;color:#f5fff9}
.host-conversation-buttons button[data-host-hold-talk]:disabled,
.host-conversation-buttons button[data-guest-hold-talk]:disabled{opacity:.6}
.host-conversation-buttons button[aria-pressed=true],
.host-conversation-buttons button[data-listening=on]{background:#244349;border-color:#8aebef80}
.host-summary .host-conversation p{margin:7px 0 0;max-width:410px;font-size:11px;line-height:1.5;color:#f4d8b8;background:#18272ce8;padding:8px 10px;border-left:2px solid #edc3ae}
@media(min-width:761px) and (max-width:1099px){.host-summary:has(.host-conversation){flex-wrap:wrap}.host-conversation{flex-basis:100%;margin-top:0}}
@media(max-width:760px){.host-conversation{max-width:none}.host-conversation-buttons button{flex:1;min-width:100px;font-size:12px}}
@media(max-height:500px) and (min-width:521px){.host-summary:has(.host-conversation){flex-wrap:wrap}.host-conversation{flex-basis:100%;margin-top:0}.host-conversation-buttons button{min-height:40px}}

.guest-conversation{flex-basis:100%;width:100%;max-width:410px;margin:3px 0 0;pointer-events:auto}
.guest-conversation p{margin:7px 0 0;font-size:12px;line-height:1.4;color:#f4d8b8;background:#18272cf2;padding:8px 10px;border-left:2px solid #edc3ae}
@media(max-width:760px){.guest-conversation .host-conversation-buttons button{flex:1;min-width:120px}}

/* Keep the first conversation actions above the world-loading placeholder. */
.ride-top:has(.guest-conversation:not([hidden])){z-index:4}
body:has(.guest-conversation:not([hidden])) .route-waiting{top:max(235px,var(--ride-status-bottom,235px));transform:translateX(-50%);padding:12px}
body:has(.guest-conversation:not([hidden])) .route-waiting .eyebrow,
body:has(.guest-conversation:not([hidden])) .route-waiting>p{display:none}
body:has(.guest-conversation:not([hidden])) .route-waiting h2{font-size:18px;margin:0 0 10px}
@media(max-width:760px){
 body:has(.guest-conversation:not([hidden])) .route-waiting{top:max(265px,var(--ride-status-bottom,265px));transform:translateX(-50%);padding:12px}
 body:has(.guest-conversation:not([hidden])) .route-waiting .eyebrow,
 body:has(.guest-conversation:not([hidden])) .route-waiting>p{display:none}
 body:has(.guest-conversation:not([hidden])) .route-waiting h2{font-size:18px;margin:0 0 10px}
}

/* A 320px guest can receive recording disclosure and microphone recovery at
   once. The status stack must not take steering, brake or pedal touch targets
   away. Keep all actions reachable by scrolling this bounded status rail,
   rather than shrinking tap targets or silently hiding the consent notice. */
@media (max-width: 360px) and (max-height: 650px) {
  body:has(#guestPanel:not([hidden])):has(#recordingStatus:not([hidden])):has(#guestConversation:not([hidden])) .ride-top {
    max-height: max(90px, calc(100dvh - 375px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    pointer-events: auto;
    align-content: flex-start;
    scrollbar-width: thin;
    scrollbar-color: #77978a transparent;
    touch-action: pan-y;
  }
  body:has(#guestPanel:not([hidden])):has(#recordingStatus:not([hidden])):has(#guestConversation:not([hidden])) .recording-status {
    padding: 7px 9px;
    gap: 7px;
  }
  body:has(#guestPanel:not([hidden])):has(#recordingStatus:not([hidden])):has(#guestConversation:not([hidden])) .guest-conversation {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  body:has(#guestPanel:not([hidden])):has(#recordingStatus:not([hidden])):has(#guestConversation:not([hidden])) .guest-conversation [data-guest-audio-status] {
    order: -1;
    margin: 0;
    padding: 6px 8px;
  }
}

/* Recoverable microphone errors belong above the actions, not below volume.
   On short phones the inline status and ride controls must remain separately
   scrollable; do not put the error under Chat or on top of the road controls. */
@media(max-width:360px) and (max-height:650px){
 body:has(#guestPanel:not([hidden])):has(#guestConversation:not([hidden])) .ride-top{
  max-height:min(400px,calc(100dvh - 190px));
  overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
  scrollbar-width:thin;scrollbar-color:#77978a transparent;
 }
 body:has(#guestPanel:not([hidden])):has(#guestConversation:not([hidden])) .guest-conversation{
  display:flex;flex-direction:column;gap:4px;
 }
 body:has(#guestPanel:not([hidden])):has(#guestConversation:not([hidden])) .guest-conversation [data-guest-audio-status]:not([hidden]){
  order:-1;margin:0;padding:7px 9px;
 }
}
/* A waiting host picture is already named in the source badge; preserve its
   legible status without painting the full-screen caption over microphone
   recovery and live riding controls on a narrow phone. */
@media(max-width:360px) and (max-height:650px){
 body.guest-host-main:has(#guestPanel:not([hidden])):has(#guestConversation:not([hidden])) .stage>#hostInsetCaption.host-inset-waiting:not([hidden]){
  inset:max(calc(264px + env(safe-area-inset-top, 0px)), calc(var(--ride-status-bottom, 256px) + 8px)) 12px auto 12px;width:auto;min-height:40px;height:auto;z-index:8;
  box-sizing:border-box;padding:7px 10px;border:1px solid #b6e9d466;
  border-radius:10px;box-shadow:none;transform:none;
  background:rgba(14, 24, 30, 0.92);font-size:11px;line-height:1.2;letter-spacing:.2px;
 }
}
/* Both waiting labels otherwise land across the microphone buttons at 320×480.
   Keep the world state next to the rider count, not over controls. */
@media(max-width:360px) and (max-height:650px){
 body:has(#guestPanel:not([hidden])):has(#guestConversation:not([hidden])) #routeWaiting:not([hidden]){
  position:fixed;inset:max(calc(312px + env(safe-area-inset-top, 0px)), calc(var(--ride-status-bottom, 256px) + 56px)) 12px auto 12px;width:auto;
  width:132px;min-height:44px;height:auto;max-height:70px;
  box-sizing:border-box;padding:6px 8px;transform:none;
  display:flex;align-items:center;justify-content:center;
  border-radius:10px;text-align:center;overflow-y:auto;overflow-x:hidden;
 }
 body:has(#guestPanel:not([hidden])):has(#guestConversation:not([hidden])) #routeWaiting:not([hidden]) h2{
  margin:0;font-size:11px;line-height:1.25;font-weight:650;letter-spacing:0;
 }
}

/* Keep the live phone world in view: two primary voice actions and a disclosure
   for optional hold-to-talk and volume, without hiding audio recovery. */
.guest-audio-more{display:none}
@media(max-width:520px){
 body:has(#guestPanel:not([hidden])) #guestConversation:not([hidden]) .host-conversation-buttons{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 60px;
  align-items:stretch;gap:6px;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation .host-conversation-buttons button{
  min-width:0;min-height:44px;padding:8px 6px;font-size:11px;line-height:1.15;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation [data-guest-mic]{grid-column:1;grid-row:1}
 body:has(#guestPanel:not([hidden])) #guestConversation [data-guest-listen]{grid-column:2;grid-row:1}
 body:has(#guestPanel:not([hidden])) #guestConversation .guest-audio-more{
  display:block;grid-column:3;grid-row:1;white-space:nowrap;
  background:#233f40;color:#c5f7ed;border-color:#8bd3cb;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation[data-audio-expanded="false"] [data-guest-hold-talk],
 body:has(#guestPanel:not([hidden])) #guestConversation[data-audio-expanded="false"] #guestRideVolume:not([hidden]){
  display:none!important;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation[data-audio-expanded="true"] .host-conversation-buttons{
  grid-template-columns:repeat(2,minmax(0,1fr));
 }
 body:has(#guestPanel:not([hidden])) #guestConversation[data-audio-expanded="true"] .guest-audio-more{
  grid-column:2;grid-row:auto;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation .guest-audio-more:focus-visible{
  outline:3px solid #c7ffef;outline-offset:2px;
 }
}

/* A landscape phone is short even at 568–760 CSS pixels wide. Previously the
   optional talk button and open volume drawer stretched the status rail across
   the host picture while "More" was inaccessible (hidden above 520px). Keep
   consent and listening immediately reachable, with the same expandable audio
   controls used by portrait guests. */
@media (min-width:521px) and (max-width:1100px) and (max-height:500px) {
 body:has(#guestPanel:not([hidden])):has(#guestConversation:not([hidden])) .ride-top {
  max-height:min(180px,calc(100dvh - 130px));
  overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
  align-content:flex-start;touch-action:pan-y;
  scrollbar-width:thin;scrollbar-color:#77978a transparent;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation:not([hidden]) {
  width:min(100%,450px);max-width:none;margin:3px 0 0;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation .host-conversation-buttons {
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 58px;
  align-items:stretch;gap:6px;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation .host-conversation-buttons button {
  min-width:0;min-height:44px;padding:7px 6px;font-size:11px;line-height:1.15;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation [data-guest-mic]{grid-column:1;grid-row:1}
 body:has(#guestPanel:not([hidden])) #guestConversation [data-guest-listen]{grid-column:2;grid-row:1}
 body:has(#guestPanel:not([hidden])) #guestConversation .guest-audio-more {
  display:block;grid-column:3;grid-row:1;white-space:nowrap;
  background:#233f40;color:#c5f7ed;border-color:#8bd3cb;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation[data-audio-expanded="false"] [data-guest-hold-talk],
 body:has(#guestPanel:not([hidden])) #guestConversation[data-audio-expanded="false"] #guestRideVolume:not([hidden]) {
  display:none!important;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation[data-audio-expanded="true"] .host-conversation-buttons {
  grid-template-columns:repeat(2,minmax(0,1fr));
 }
 body:has(#guestPanel:not([hidden])) #guestConversation[data-audio-expanded="true"] .guest-audio-more {
  grid-column:2;grid-row:auto;
 }
 body:has(#guestPanel:not([hidden])) #guestConversation .guest-audio-more:focus-visible {
  outline:3px solid #c7ffef;outline-offset:2px;
 }
 /* A world-unavailable chip belongs opposite the guest's kit/chat strip,
    rather than across microphone and listening targets. */
 body.guest-host-main:has(#guestPanel:not([hidden])) #routeWaiting:not([hidden]):not(.host-offline) {
  position:fixed;top:auto;bottom:16px;left:18px;right:auto;
  transform:none;width:min(260px,calc(50vw - 26px));
  min-height:44px;padding:6px 10px;box-sizing:border-box;
 }
 body.guest-host-main:has(#guestPanel:not([hidden])) #routeWaiting:not([hidden]):not(.host-offline) h2 {
  font-size:12px;line-height:1.2;margin:0;
 }
}

/* Keep hostInsetCaption, guestConversation, and routeWaiting disjoint across desktop, portrait mobile, and landscape */
@media (min-width: 761px) and (min-height: 501px) {
  #guestConversation:not([hidden]) {
    max-width: min(420px, 100%);
  }
  body.guest-host-main #routeWaiting:not([hidden]):not(.host-offline),
  body.guest-host-main:has(.guest-conversation:not([hidden])) #routeWaiting:not([hidden]):not(.host-offline),
  body.guest-host-main:has(#hostInsetCaption:not([hidden])) #routeWaiting:not([hidden]):not(.host-offline) {
    inset: auto;
    top: max(calc(380px + env(safe-area-inset-top, 0px)), calc(var(--ride-status-bottom, 260px) + 24px));
    bottom: auto;
    left: 24px;
    right: auto;
    transform: none;
    width: min(390px, calc(100vw - 48px));
  }
}
@media (max-width: 760px) and (min-height: 501px) {
  body.guest-host-main:has(#guestPanel:not([hidden])):has(#routeWaiting:not([hidden]):not(.host-offline)) .stage > #hostInsetCaption:is(.media-trouble, .host-inset-waiting):not([hidden]) {
    inset: max(calc(264px + env(safe-area-inset-top, 0px)), calc(var(--ride-status-bottom, 256px) + 8px)) auto auto 12px;
    width: calc(50vw - 16px);
    min-height: 44px;
    height: auto;
    max-height: 140px;
    transform: none;
    padding: 8px 10px;
    font-size: 11px;
  }
  body.guest-host-main:has(#guestPanel:not([hidden])):has(#hostInsetCaption:not([hidden])) #routeWaiting:not([hidden]):not(.host-offline) {
    position: fixed;
    inset: max(calc(264px + env(safe-area-inset-top, 0px)), calc(var(--ride-status-bottom, 256px) + 8px)) 12px auto auto;
    width: calc(50vw - 16px);
    min-height: 44px;
    height: auto;
    max-height: 140px;
    transform: none;
    padding: 8px 10px;
    overflow-y: auto;
  }
}
@media (min-width: 521px) and (max-width: 1100px) and (max-height: 500px) {
  body.guest-host-main:has(#guestPanel:not([hidden])) #routeWaiting:not([hidden]):not(.host-offline) {
    top: auto;
    bottom: 16px;
    left: 18px;
    right: auto;
    transform: none;
    width: min(260px, calc(50vw - 26px));
  }
}
