/* An opaque reading panel; the native backdrop dims the moving room. */
#voice-choice-dialog {
  box-sizing: border-box;
  width: min(27rem, calc(100vw - 2rem));
  max-height: calc(100svh - 2rem);
  margin: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  overflow-y: auto;
  border: 1px solid var(--es-dialog-edge);
  border-radius: var(--es-radius-m);
  background: var(--es-dialog-surface);
  color: var(--es-ink);
  backdrop-filter: none;
  font: 400 var(--es-text-body) / var(--es-line-body) var(--es-font-body);
  box-shadow: var(--es-dialog-shadow);
}
#voice-choice-dialog[open] {
  display: grid;
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 0.75rem;
}
#voice-choice-dialog::backdrop {
  background: var(--es-dialog-backdrop);
}
#voice-choice-brand {
  grid-area: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
#voice-choice-brand > span:not(#voice-choice-mark) {
  color: var(--es-muted);
  font-size: var(--es-text-small);
  letter-spacing: 0.08em;
}
#voice-choice-mark {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  background: url("../brand/ursly-icon.svg") center / contain no-repeat;
}
#voice-choice-title {
  grid-area: auto;
  margin: 0;
  max-width: none;
  font: var(--es-dialog-title-weight) clamp(1.25rem, 3vw, 1.5rem) / 1.2
    var(--es-font-display);
  letter-spacing: -0.02em;
  color: var(--es-ink);
}
#voice-choice-description {
  grid-column: 1 / -1;
  margin: 0.75rem 0 1.5rem;
  color: var(--es-muted);
  font: 400 var(--es-text-body) / 1.5 var(--es-font-body);
}
#voice-choice-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
#voice-choice-actions button {
  flex: 1 1 5rem;
  min-width: 44px;
  min-height: max(44px, 2.75rem);
  padding: 0.45rem 1rem;
  border: 1px solid var(--es-dialog-edge);
  border-radius: var(--es-radius-s);
  background: var(--es-dialog-control-surface);
  color: var(--es-ink);
  font: inherit;
  font-weight: var(--es-dialog-title-weight);
  text-shadow: inherit;
  cursor: pointer;
}
#voice-choice-actions button:hover {
  text-decoration: underline;
  text-decoration-color: var(--es-pore);
  text-underline-offset: 0.3em;
}
#voice-choice-actions button:focus-visible {
  outline: 2px solid var(--es-ink);
  outline-offset: 2px;
}

/* Start with sound (owner request, October 14, 2026): language for text and
   voice, a sound check, then sound on as the first, filled action. */
#voice-choice-dialog {
  width: min(27rem, calc(100vw - 2rem));
}
#voice-choice-languages {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0.25rem;
  border: 1px solid var(--es-dialog-edge);
  border-radius: var(--es-radius-pill);
}
.voice-choice-language {
  flex: 1 1 0;
  min-height: 44px;
  padding: 0.35rem 0.9rem;
  border: 0;
  border-radius: var(--es-radius-pill);
  background: transparent;
  color: var(--es-muted);
  font: 500 var(--es-text-body) / 1.2 var(--es-font-body);
  cursor: pointer;
}
.voice-choice-language[aria-pressed="true"] {
  background: var(--es-dialog-control-surface);
  color: var(--es-ink);
  box-shadow: inset 0 0 0 1px var(--es-pore);
}
.voice-choice-language:focus-visible,
#voice-choice-check:focus-visible {
  outline: 2px solid var(--es-ink);
  outline-offset: 2px;
}
#voice-choice-check {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.35rem 0.9rem 0.35rem 0.6rem;
  border: 1px solid var(--es-dialog-edge);
  border-radius: var(--es-radius-pill);
  background: transparent;
  color: var(--es-ink);
  font: 500 var(--es-text-body) / 1.2 var(--es-font-body);
  cursor: pointer;
}
#voice-choice-check::before {
  content: "";
  width: 1.25rem;
  height: 1.25rem;
  background: var(--es-pore);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.5h3.5L12 5.5v13l-4.5-4H4zM15.5 9a4 4 0 0 1 0 6M18 6.5a7.5 7.5 0 0 1 0 11'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
#voice-choice-check-status {
  grid-column: 1 / -1;
  min-height: 1.5em;
  margin: 0.4rem 0 0.6rem;
  color: var(--es-muted);
  font: 400 var(--es-text-small) / 1.5 var(--es-font-body);
}
#voice-choice-actions #voice-choice-yes {
  background: var(--es-pore);
  color: var(--es-pore-ink);
  border-color: var(--es-pore);
}
#voice-choice-actions #voice-choice-no {
  background: transparent;
}
#voice-choice-actions button:hover {
  border-color: var(--es-pore);
}
@media (max-width: 360px) {
  #voice-choice-actions {
    flex-direction: column;
  }
  #voice-choice-actions button {
    flex-basis: auto;
  }
}

/* Short landscape screens: language and sound check share a row and the
   brand line steps aside, so the whole choice fits without scrolling. */
@media (max-height: 500px) {
  #voice-choice-dialog {
    width: min(36rem, calc(100vw - 2rem));
    padding: 1rem 1.25rem;
  }
  #voice-choice-dialog[open] {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  #voice-choice-brand {
    display: none;
  }
  #voice-choice-description {
    margin: 0.4rem 0 0.75rem;
  }
  #voice-choice-languages {
    grid-column: 1;
    margin: 0;
  }
  #voice-choice-check {
    grid-column: 2;
    align-self: center;
  }
  #voice-choice-check-status {
    min-height: 0;
    margin: 0.35rem 0;
  }
}
