.tt-audio-player {
  position: relative;
  min-height: 70px;
  max-width: 550px;
  margin: 20px auto;
  padding: 8px 10px;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(13, 81, 145, 0.08);
  background: #f6f9fc;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.tt-audio-top {
  width: 100%;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
  flex-wrap: nowrap;
}

.tt-audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-height: 36px;
  min-width: 240px;
  padding: 6px 12px;
  border-radius: 5px;
  background: #0d5191 !important;
  color: #fff !important;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: none;
}

.tt-audio-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.tt-audio-controls {
  width: 100%;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f6f9fc;
  border-radius: 5px;
}

.tt-audio-play {
  min-width: 42px;
  width: 42px;
  height: 36px;
  border: 0;
  border-radius: 5px;
  background: #0d5191 !important;
  color: #fff !important;
  cursor: pointer;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.tt-audio-play::before {
  content: "";
  display: block;
  margin: 0 auto;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #fff;
}

.tt-audio-play.is-pause::before {
  width: 4px;
  height: 12px;
  border: 0;
  border-left: 3px solid #fff;
  border-right: 3px solid #fff;
}

.tt-audio-play.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: tt-audio-spin 0.7s linear infinite;
}

.tt-audio-play.is-loading {
  pointer-events: none;
}

.tt-audio-play:disabled {
  opacity: 0.65;
  cursor: wait;
}

@keyframes tt-audio-spin {
  to {
    transform: rotate(360deg);
  }
}

.tt-audio-play:focus-visible,
.tt-audio-btn:focus-visible {
  outline: 2px solid #0b6dcc;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 0 6px rgba(13, 81, 145, 0.35);
}

.tt-audio-progress {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #9aa3ad;
  border-radius: 999px;
  outline: none;
}

.tt-audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0d5191 !important;
  border: 0;
  cursor: pointer;
}

.tt-audio-progress::-moz-range-track {
  height: 6px;
  background: #9aa3ad;
  border: 0;
  border-radius: 999px;
}

.tt-audio-progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0d5191 !important;
  border: 0;
  cursor: pointer;
}

.tt-audio-speed-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: #1f3040;
  font-size: 13px !important;
  font-weight: 700;
  white-space: nowrap;
}

.tt-audio-speed {
  -webkit-appearance: none;
  appearance: none;
  height: 26px;
  border: 1px solid #9aa3ad;
  border-radius: 5px;
  background: #f6f9fc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%230d5191' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px 6px;
  color: #1f3040;
  font-size: 13px !important;
  font-weight: 400 !important;
  padding: 0 22px 0 6px;
  text-align: center;
  text-align-last: center;
}

.tt-audio-speed option {
  font-size: 13px !important;
  font-weight: 400 !important;
  text-align: center;
}

.tt-audio-voice-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  margin-left: 6px;
  margin-right: 0;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid #e6edf5;
  background: #f7fafe;
  color: #4a6078;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tt-audio-voice-pill[hidden] {
  display: none !important;
}

.tt-audio-time {
  min-width: 100px;
  color: #1f3040;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  text-align: right;
  white-space: nowrap;
}

.tt-audio-player audio {
  display: none;
}

.tt-audio-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .tt-audio-player {
    max-width: 100%;
  }

  .tt-audio-top {
    flex-wrap: wrap;
    gap: 8px;
  }

  .tt-audio-speed-wrap {
    margin-left: auto;
  }

  .tt-audio-btn {
    min-width: 210px;
  }

  .tt-audio-voice-pill {
    margin-left: 0;
    margin-right: 0;
    margin-top: 2px;
    padding: 1px 7px;
    font-weight: 600;
    font-size: 11px;
    max-width: 100%;
    white-space: normal;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: anywhere;
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tt-audio-play,
  .tt-audio-btn {
    transition: none !important;
  }

  .tt-audio-play.is-loading::before {
    animation: none !important;
  }
}
