/* Recipe UI ownership: Voice. Responsive rules stay with this owner. */
body.voice-modal-open {
  overflow: hidden;
}
.voice-evaluation-link {
  display: none;
  min-height: 2.25rem;
  border-radius: var(--builder-radius-status);
  padding: 0.32rem 0.78rem;
  font-size: var(--builder-font-metadata);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.voice-overlay-toggle {
  min-height: 2.25rem;
  border-radius: var(--builder-radius-status);
  padding: 0.32rem 0.78rem;
  font-size: var(--builder-font-metadata);
  font-weight: 800;
}
.voice-overlay-toggle:disabled {
  opacity: 0.45;
}
.voice-control-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  min-width: 0;
  border-radius: var(--builder-radius-status);
  border: 1px solid var(--line);
  background: var(--builder-surface);
  color: var(--charcoal);
  font-weight: 750;
  box-shadow: var(--builder-shadow-surface);
}
.voice-control-bubble:disabled {
  opacity: 0.42;
  box-shadow: none;
}
.voice-side-control {
  flex-direction: column;
  gap: 0.1rem;
  width: 4rem;
  height: 3.75rem;
  min-height: 3.75rem;
  padding: 0.35rem 0.35rem 0.3rem;
  line-height: 1;
}
.voice-side-control-icon {
  font-size: var(--builder-font-heading);
  line-height: 1;
}
.voice-side-control-label {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: var(--builder-font-metadata);
  font-weight: 800;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.voice-side-control--undo {
  justify-self: end;
}
.voice-side-control--replay {
  justify-self: start;
}
.voice-record-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(7rem, 62vw);
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: var(--builder-radius-status);
  border: 2px solid var(--builder-ink);
  background: var(--builder-ink);
  color: var(--builder-surface);
  font-size: var(--builder-font-heading);
  font-weight: 850;
  box-shadow: var(--builder-shadow-overlay);
}
.voice-realtime-audio {
  display: none;
}
.voice-record-btn--recording {
  border-color: var(--builder-danger);
  background: var(--builder-danger);
  color: var(--builder-surface);
}
@media  (max-width: 900px) {
.voice-evaluation-link {
    display: none;
  }
.voice-control-bubble {
    min-height: 2.55rem;
  }
.voice-side-control {
    width: 3.45rem;
    height: 3.15rem;
    min-height: 3.15rem;
    padding: 0.28rem 0.24rem 0.22rem;
  }
.voice-side-control-icon {
    font-size: var(--builder-font-subheading);
  }
.voice-side-control-label {
    font-size: var(--builder-font-metadata);
  }
.voice-record-btn {
    width: min(9rem, 44vw);
    font-size: var(--builder-font-subheading);
  }
}
.voice-record-btn--recording {
  border-color: color-mix(in srgb, var(--builder-surface) 68%, transparent);
  background: color-mix(in srgb, var(--builder-danger) 90%, transparent);
}
@media  (max-width: 768px) {
body.page-builder.voice-overlay-open,
  body.page-builder.voice-overlay-open:not(:has(#menu-manager-shell [data-menu-manager-state="active"])),
  body.page-builder.voice-overlay-open:has(#floating-menu .menu-manager-widget[data-menu-manager-state="active"]) {
    --page-footer-clearance: calc(var(--builder-mobile-voice-overlay-clearance, 225px) + env(safe-area-inset-bottom, 0px));
  }
}
@media  (min-width: 769px) and (max-width: 1100px) {
.builder-mobile-voice-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: 4.8rem;
    min-height: 2.2rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--ink);
    border-radius: var(--builder-radius-medium);
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: var(--builder-font-working);
    font-weight: 750;
    text-align: center;
  }
.builder-mobile-voice-launch:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
  }
.builder-mobile-voice-launch:disabled {
    cursor: wait;
    opacity: 0.68;
  }
}
@media  (max-width: 768px) {
.page-builder .builder-mobile-voice-launch {
    min-width: 4.25rem;
    min-height: 2rem;
    padding: 0.28rem 0.5rem;
  }
}
.voice-fab {
  display: none;
}
@media  (max-width: 768px) {
body.page-builder:not(.voice-overlay-open):not(.voice-modal-open):not(.menu-manager-modal-open):not(:has(#menu-manager-shell [data-menu-manager-state="active"])),
  body.page-builder:not(.voice-overlay-open):not(.voice-modal-open):not(.menu-manager-modal-open):has(#floating-menu .menu-manager-widget[data-menu-manager-state="active"]) {
    --page-footer-clearance: calc(
      var(--floating-menu-height, 56px)
      + var(--builder-mobile-voice-scroll-clearance, 1.5rem)
      + env(safe-area-inset-bottom, 0px)
    );
  }
.voice-fab {
    /* Voice lives beside Menu Manager, leaving writing fields unobscured. */
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: auto;
    left: 50%;
    bottom: calc(var(--floating-menu-height, 56px) + env(safe-area-inset-bottom, 0px) + var(--builder-mobile-voice-menu-gap, 1.45rem));
    width: var(--builder-mobile-voice-fab-size, 68px);
    height: var(--builder-mobile-voice-fab-size, 68px);
    border-radius: var(--builder-radius-status);
    background: color-mix(in srgb, var(--builder-surface) 98%, transparent);
    color: var(--ink);
    border: 1px solid var(--line-strong);
    box-shadow: var(--builder-shadow-overlay);
    font-size: var(--builder-font-display);
    cursor: pointer;
    z-index: 940;
    transform: translateX(-50%);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
body.page-builder:has(#completeness-modal:not([hidden])) .voice-fab {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 0.9rem);
    z-index: 2120;
  }
.voice-fab::before {
    content: "";
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: var(--builder-radius-status);
    background: var(--paint-1);
    opacity: 0.22;
    pointer-events: none;
  }
.voice-fab:active {
    transform: translateX(-50%) scale(0.94);
    box-shadow: var(--builder-shadow-surface);
  }
.voice-fab:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
  }
.voice-fab.voice-fab--hidden,
  body.menu-manager-modal-open .voice-fab {
    display: none;
  }
body.page-builder.voice-overlay-open,
  body.page-builder.voice-overlay-open:not(:has(#menu-manager-shell [data-menu-manager-state="active"])),
  body.page-builder.voice-overlay-open:has(#floating-menu .menu-manager-widget[data-menu-manager-state="active"]) {
    --page-footer-clearance: calc(var(--builder-mobile-voice-overlay-clearance, 225px) + env(safe-area-inset-bottom, 0px));
  }
body.voice-overlay-open #floating-menu {
    display: none;
  }
}
.direction-card.voice-context-selected {
  outline: 2px solid var(--recipe-accent);
  outline-offset: 2px;
}
.direction-card .dir-chip.voice-context-selected-tag {
box-shadow: var(--builder-shadow-focus);
}
.voice-context-handoff {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  margin-bottom: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--recipe-line);
  background: var(--recipe-surface);
}
.voice-context-handoff > div {
  display: flex;
  gap: var(--s-2);
  margin-left: auto;
}
.builder-voice-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin: 0 0 var(--s-2);
  padding: var(--s-1) var(--s-2);
  border: 1px solid var(--recipe-line);
  border-radius: var(--recipe-radius-small);
  background: var(--recipe-surface-muted);
  color: var(--recipe-muted);
  font-size: var(--recipe-font-metadata);
}
/* Context targeting belongs to an active voice session, not the blank builder. */
.voice-context-select { display: none; }
body.voice-modal-open .voice-context-select,
body.voice-overlay-open .voice-context-select,
body.voice-dock-open .voice-context-select,
.direction-card.voice-context-selected .voice-context-select { display: inline-flex; }
