.speech-controls {
  position: fixed;
  right: 14px;
  top: 55%;
  transform: translateY(-50%);
  display: none;
  z-index: 1000;
}

.speech-controls[data-visible="true"] {
  display: flex;
}

.speech-controls__toggle {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(3, 20, 45, 0.9);
  color: #f4f8ff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.speech-controls__toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: 0.92;
}

.speech-controls__panel {
  /* position: absolute; */
  right: 52px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(3, 20, 45, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f4f8ff;
  font-family: Inter, "Segoe UI", sans-serif;
}

.speech-controls[data-expanded="true"] .speech-controls__panel {
  display: inline-flex;
}

.speech-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.speech-control span {
  color: rgba(244, 248, 255, 0.74);
  font-size: 11px;
}

.speech-control select {
  max-width: 130px;
  height: 28px;
  padding: 0 24px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f8ff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(244, 248, 255, 0.85) 50%),
    linear-gradient(135deg, rgba(244, 248, 255, 0.85) 50%, transparent 50%);
  background-position: calc(100% - 14px) 11px, calc(100% - 9px) 11px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.speech-control select:focus {
  border-color: rgba(39, 211, 187, 0.85);
  box-shadow: 0 0 0 2px rgba(39, 211, 187, 0.18);
}

.speech-control select option {
  background: rgba(3, 20, 45, 0.98);
}

.speech-filter-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 320px;
}

.speech-filter-group__label {
  color: rgba(244, 248, 255, 0.74);
  font-size: 11px;
  font-weight: 600;
  line-height: 28px;
  white-space: nowrap;
}

.speech-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.speech-filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.speech-filter-chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.speech-filter-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f8ff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.speech-filter-chip input:checked + span {
  background: rgba(39, 211, 187, 0.18);
  border-color: rgba(39, 211, 187, 0.45);
}

.speech-filter-chip input:not(:checked) + span {
  opacity: 0.55;
}

.speech-filter-chip input:focus-visible + span {
  box-shadow: 0 0 0 2px rgba(39, 211, 187, 0.18);
}

@media (max-width: 760px) {
  .speech-controls {
    right: 10px;
    top: 160px !important;
  }

  .speech-controls__panel {
    top: -90px;
    right: 0;
    bottom: auto;
    transform: none;
    width: min(220px, calc(100vw - 20px));
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .speech-control {
    width: 100%;
    justify-content: space-between;
  }

  .speech-control select {
    max-width: 118px;
  }

  .speech-filter-group {
    width: 100%;
    flex-wrap: wrap;
  }
}
