/* Voice assistant (js/voice.js): the mic buttons in the search bars and
   its sheet (bottom sheet on phones, dialog from 768px, see .ui-panel). */

.va-inline {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-inline-end: -8px;
  border-radius: 10px;
  color: var(--green);
}

.va-inline:active {
  background: var(--green-soft);
}

@media (hover: hover) and (min-width: 768px) {
  .va-inline:hover {
    background: var(--green-soft);
  }
}

.va-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.va-sub {
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted-2);
}

.va-x {
  flex-shrink: 0;
  margin: -8px 0 0 -8px;
  color: var(--muted-2);
}

.va-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0 12px;
  text-align: center;
}

.va-mic {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.va-mic .icon {
  width: 30px;
  height: 30px;
}

/* Listening: a thin ring moves out from the button (no glow). */
.va-mic::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--green);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.va-mic.is-live::before {
  animation: va-ring 1.4s ease-out infinite;
}

.va-mic:active {
  transform: scale(0.96);
}

@media (hover: hover) and (min-width: 768px) {
  .va-mic:hover {
    background: var(--green-dark);
  }
}

@keyframes va-ring {
  from {
    opacity: 0.6;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .va-mic.is-live::before {
    animation: none;
    opacity: 0.5;
    transform: scale(1.2);
  }
}

.va-status {
  min-height: 22px;
  max-width: 34em;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
  color: var(--muted-2);
}

.va-status.is-error {
  color: var(--red);
}

.va-heard {
  max-width: 100%;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.6;
  color: var(--text);
  overflow-wrap: anywhere;
}

.va-heard.is-interim {
  color: var(--muted);
}

.va-reply {
  margin-bottom: 12px;
}

.va-reply:empty {
  display: none;
}

.va-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-soft);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text);
}

.va-msg .icon {
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--muted-2);
}

.va-msg--ok {
  background: var(--green-soft);
}

.va-msg--ok .icon {
  color: var(--green);
}

.va-msg--info {
  background: var(--blue-soft);
}

.va-msg--info .icon {
  color: var(--blue);
}

.va-msg--miss {
  background: var(--orange-soft);
}

.va-msg--miss .icon {
  color: var(--orange);
}

.va-opts {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.va-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: right;
}

.va-opt:active {
  background: var(--bg-soft);
}

@media (hover: hover) and (min-width: 768px) {
  .va-opt:hover {
    border-color: var(--green);
  }
}

.va-opt__n {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted-2);
}

.va-opt__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
}

.va-opt__text {
  flex: 1;
  min-width: 0;
}

.va-opt__text strong {
  display: block;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.va-opt__text small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted-2);
}

.va-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.va-examples[hidden] {
  display: none;
}

.va-examples small {
  font-size: 12px;
  color: var(--muted);
}

.va-chip {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--bg-soft);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.va-chip:active {
  border-color: var(--green);
}

@media (hover: hover) and (min-width: 768px) {
  .va-chip:hover {
    border-color: var(--green);
    color: var(--green);
  }
}

.va-type {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 14px 0 6px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
}

.va-type:focus-within {
  border-color: var(--green);
}

.va-type input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.va-type input::placeholder {
  color: var(--muted);
}

.va-send {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
}

.va-send .icon {
  transform: scaleX(-1);
}

.va-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-2);
}

@media (min-width: 768px) {
  .va-type input {
    font-size: 14px;
  }
}
