/* Shared consent and first-party browser-voice controls. */

.voice-dialog {
  width: min(680px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 10px;
  box-shadow: 0 32px 90px -28px rgba(21, 33, 30, .58);
  overflow: hidden;
}
.voice-dialog::backdrop {
  background: rgba(21, 33, 30, .58);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.voice-dialog-shell {
  max-height: calc(100dvh - 34px);
  padding: 28px;
  overflow: auto;
  overscroll-behavior: contain;
}
.voice-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.voice-dialog-head h2 {
  margin: .45rem 0 0;
  font-size: 2.1rem;
  line-height: 1.12;
}
.voice-ai-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .2rem .52rem;
  color: var(--teal);
  background: var(--teal-wash);
  border: 1px solid #BFD7E3;
  border-radius: var(--r-pill);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.voice-dialog-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  margin: -6px -6px 0 0;
  padding: 0;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.voice-dialog-close:hover {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--hair);
}
.voice-dialog-intro {
  max-width: 58ch;
  margin: .9rem 0 1rem;
  color: var(--ink-2);
  font-size: .92rem;
  line-height: 1.55;
}
.voice-disclosure {
  padding: 1rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 10px;
}
.voice-disclosure > strong {
  font-size: .83rem;
}
.voice-disclosure p {
  margin: .45rem 0 0;
  color: var(--ink-2);
  font-size: .78rem;
  line-height: 1.58;
}
.voice-disclosure .voice-privacy-note {
  padding-top: .7rem;
  margin-top: .75rem;
  color: var(--ink-3);
  border-top: 1px solid var(--hair);
  font-size: .72rem;
}
.voice-disclosure a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.voice-consent {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: .75rem;
  margin: 1rem 0;
  padding: .85rem 1rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid #C7D5D2;
  border-radius: 10px;
  font-size: .8rem;
  line-height: 1.5;
  cursor: pointer;
}
.voice-consent:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(44, 94, 122, .14);
}
.voice-consent input {
  width: 18px;
  height: 18px;
  margin: .05rem 0 0;
  accent-color: var(--teal);
}
.voice-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}
.voice-dialog-actions .btn {
  min-height: 46px;
}
.voice-dialog-actions .btn:disabled {
  color: var(--ink-3);
  background: #E5E7EB;
  border-color: #E5E7EB;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}
.voice-dialog-actions svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.voice-fallback {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hair);
}
.voice-fallback[hidden] {
  display: none;
}
.voice-fallback > div {
  min-width: 0;
}
.voice-fallback strong {
  display: block;
  color: var(--ink);
  font-size: .83rem;
}
.voice-fallback p {
  margin: .22rem 0 0;
  color: var(--ink-2);
  font-size: .75rem;
  line-height: 1.45;
}
.voice-fallback .btn {
  min-height: 42px;
  padding: .6rem 1rem;
  white-space: nowrap;
}
.voice-fallback[data-kind="limit"] strong {
  color: #8A4B08;
}
.voice-fallback[data-kind="allowance"] strong,
.voice-fallback[data-kind="provider-limit"] strong {
  color: #8A4B08;
}
.voice-fallback[data-kind="resting"] strong,
.voice-fallback[data-kind="configuration"] strong,
.voice-fallback[data-kind="microphone"] strong,
.voice-fallback[data-kind="session"] strong,
.voice-fallback[data-kind="unavailable"] strong {
  color: #7C2D12;
}
.voice-status {
  min-height: 1.3rem;
  margin: .75rem 0 0;
  color: var(--ink-3);
  font-size: .75rem;
  line-height: 1.45;
}
.voice-status[data-kind="ready"] {
  color: var(--teal);
}
.voice-status[data-kind="error"] {
  color: #9A3412;
}
.voice-stage {
  position: relative;
  min-height: 92px;
  margin-top: .75rem;
  padding: .6rem;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 10px;
}
.voice-stage[hidden] {
  display: none;
}
.voice-session-panel {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  min-height: 72px;
}
.voice-session-signal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 48px;
  height: 48px;
  color: var(--teal);
  background: var(--teal-wash);
  border: 1px solid #BFD7E3;
  border-radius: 50%;
}
.voice-session-signal span {
  width: 3px;
  height: 10px;
  background: currentColor;
  border-radius: 3px;
  animation: voice-signal 1.05s ease-in-out infinite;
}
.voice-session-signal span:nth-child(2) {
  height: 18px;
  animation-delay: .12s;
}
.voice-session-signal span:nth-child(3) {
  animation-delay: .24s;
}
.voice-session-panel[data-state="speaking"] .voice-session-signal span {
  animation-duration: .68s;
}
.voice-session-copy {
  min-width: 0;
}
.voice-session-copy strong {
  display: block;
  color: var(--ink);
  font-size: .9rem;
}
.voice-session-copy p {
  margin: .25rem 0 0;
  color: var(--ink-2);
  font-size: .74rem;
  line-height: 1.45;
}
.voice-session-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .45rem;
}
.voice-session-controls .btn {
  min-height: 40px;
  padding: .55rem .8rem;
  font-size: .73rem;
}
.home-page .voice-session-mute {
  transition: none;
}
.home-page .voice-session-mute:not([aria-pressed="true"]) {
  color: var(--blue-deep);
  background: transparent;
  border-color: #C9D4D0;
}
.home-page .voice-session-mute[aria-pressed="true"] {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
  transition: none;
}
@keyframes voice-signal {
  0%, 100% { transform: scaleY(.62); opacity: .55; }
  50% { transform: scaleY(1); opacity: 1; }
}

@media (max-width: 560px) {
  .voice-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }
  .voice-dialog-shell {
    max-height: calc(100dvh - 22px);
    padding: 16px;
  }
  .voice-dialog-head h2 {
    font-size: 1.3rem;
  }
  .voice-dialog-intro {
    margin: .65rem 0;
    font-size: .78rem;
  }
  .voice-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .voice-dialog-actions .btn {
    width: 100%;
    min-height: 44px;
  }
  .voice-fallback {
    grid-template-columns: 1fr;
    gap: .7rem;
    margin-top: .7rem;
    padding-top: .7rem;
  }
  .voice-fallback .btn {
    width: 100%;
  }
  .voice-session-panel {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .voice-session-signal {
    width: 40px;
    height: 40px;
  }
  .voice-session-controls {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .voice-session-controls .btn {
    width: 100%;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .voice-dialog::backdrop {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-session-signal span {
    animation: none;
  }
}
