.hdk-tts-player {
  position: fixed;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(84, 207, 214, 0.2);
  padding: 12px 16px;
  z-index: 9999;
  transform: translateY(150%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  -webkit-transform: translateY(150%);
  -moz-transform: translateY(150%);
  -ms-transform: translateY(150%);
  -o-transform: translateY(150%);
}
.hdk-tts-player.visible {
  transform: translateY(0);
  -webkit-transform: translateY(0);
  -moz-transform: translateY(0);
  -ms-transform: translateY(0);
  -o-transform: translateY(0);
}
.hdk-tts-player-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.hdk-tts-player-info {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}
.hdk-tts-player-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--hdk-primary, #54cfd6), #3db8c1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hdk-tts-player-icon iconify-icon {
  font-size: 20px;
  color: #fff;
}
.hdk-tts-player-text {
  overflow: hidden;
}
.hdk-tts-player-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hdk-text-primary, #e7e9ea);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.hdk-tts-player-subtitle {
  font-size: 11px;
  color: var(--hdk-text-secondary, #71767b);
  margin-top: 2px;
}
.hdk-tts-player-controls,
.hdk-tts-volume {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hdk-tts-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: 0 0;
  color: var(--hdk-text-primary, #e7e9ea);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
#textToSpeechBtn.active,
.hdk-tts-btn-play {
  background: linear-gradient(135deg, var(--hdk-primary, #54cfd6), #3db8c1);
}
.hdk-tts-btn:hover,
.hdk-tts-progress-bar {
  background: rgba(255, 255, 255, 0.1);
}
.hdk-tts-btn iconify-icon {
  font-size: 20px;
}
.hdk-tts-btn-play {
  width: 44px;
  height: 44px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(84, 207, 214, 0.4);
}
.hdk-tts-btn-play:hover {
  background: linear-gradient(135deg, #3db8c1, #2da5ad);
  transform: scale(1.05);
}
.hdk-tts-btn-play iconify-icon {
  font-size: 22px;
}
.hdk-tts-player-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}
.hdk-tts-time {
  font-size: 11px;
  color: var(--hdk-text-secondary, #71767b);
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  min-width: 40px;
}
.hdk-tts-time-current {
  text-align: right;
}
.hdk-tts-progress-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: visible;
  touch-action: none;
}
.hdk-tts-progress-bar:hover,
.hdk-tts-progress-bar.seeking {
  height: 6px;
}
.hdk-tts-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--hdk-primary, #54cfd6), #3db8c1);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}
.hdk-tts-progress-bar.seeking .hdk-tts-progress-fill {
  transition: none;
}
.hdk-tts-progress-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
  left: 0;
}
.hdk-tts-speed-dropdown,
.hdk-tts-voice-dropdown {
  transform: translateX(-50%);
  left: 50%;
  position: absolute;
  bottom: 100%;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.hdk-tts-speed-btn,
.hdk-tts-speed-option,
.hdk-tts-voice-btn,
.hdk-tts-voice-option {
  cursor: pointer;
  transition: 0.2s;
}
.hdk-tts-progress-bar:hover .hdk-tts-progress-handle,
.hdk-tts-progress-bar.seeking .hdk-tts-progress-handle {
  opacity: 1;
}
.hdk-tts-volume-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
}
.hdk-tts-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}
.hdk-tts-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
.hdk-tts-speed,
.hdk-tts-voice-select,
.hdk-tts-autonext {
  position: relative;
}
.hdk-tts-autonext-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--hdk-text-secondary, #71767b);
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: 0.2s;
  position: relative;
  overflow: hidden;
}
.hdk-tts-autonext-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0,
    rgba(255, 255, 255, 0.25) 25%,
    transparent 45%,
    transparent 55%,
    rgba(255, 255, 255, 0.25) 75%,
    rgba(255, 255, 255, 0.9) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.hdk-tts-autonext-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--hdk-text-primary, #e7e9ea);
}
.hdk-tts-autonext-btn.is-on {
  background: linear-gradient(135deg, var(--hdk-primary, #54cfd6), #3db8c1);
  color: #fff;
}
.hdk-tts-autonext-btn iconify-icon {
  font-size: 18px;
}
.hdk-tts-autonext-label {
  display: inline;
}

@supports not (
  (-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))
) {
  .hdk-tts-autonext-btn {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
  }
  .hdk-tts-autonext-btn::before {
    display: none;
  }
}
@media (max-width: 768px) {

  .hdk-tts-autonext-btn {
    padding: 8px;
  }
}
.hdk-tts-speed-btn {
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--hdk-text-primary, #e7e9ea);
  font-size: 12px;
  font-weight: 600;
}
.hdk-tts-speed-btn:hover,
.hdk-tts-voice-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.hdk-tts-speed-dropdown {
  background: var(--hdk-card, #17181c);
  border: 1px solid var(--hdk-border, #242628);
  border-radius: 8px;
  padding: 4px;
  display: none;
  min-width: 80px;
}
.hdk-tts-speed-dropdown.visible,
.hdk-tts-voice-dropdown.visible {
  display: block;
}
.hdk-tts-speed-option {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--hdk-text-secondary, #71767b);
  border-radius: 4px;
  text-align: center;
}
.hdk-tts-speed-option:hover,
.hdk-tts-voice-btn,
.hdk-tts-voice-option:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--hdk-text-primary, #e7e9ea);
}
.hdk-tts-speed-option.active {
  background: var(--hdk-primary, #54cfd6);
  color: #fff;
}
.hdk-tts-voice-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--hdk-text-primary, #e7e9ea);
  font-size: 12px;
  font-weight: 600;
}
.hdk-tts-btn-close,
.hdk-tts-voice-option {
  color: var(--hdk-text-secondary, #71767b);
  transition: 0.2s;
}
.hdk-tts-voice-dropdown {
  bottom: 100%;
  margin-bottom: 8px;
  background: var(--hdk-card, #17181c);
  border: 1px solid var(--hdk-border, #242628);
  border-radius: 8px;
  padding: 4px;
  display: none;
  min-width: 120px;
  max-height: 200px;
  overflow-y: auto;
}
.hdk-tts-voice-option {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 4px;
}
.hdk-tts-btn-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}
.hdk-tts-player {
  bottom: 8px;
  left: 8px;
  right: 8px;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(4px) saturate(195%) brightness(1.08);
  backdrop-filter: url(#liquid-distortion) blur(3px) saturate(195%)
    brightness(1.08);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.42),
    inset 0 1px 2px rgba(255, 255, 255, 0.55),
    inset 0 -1px 3px rgba(255, 255, 255, 0.15),
    inset 0 0 24px rgba(255, 255, 255, 0.08);
  border: none;
}
.hdk-tts-btn:not(.hdk-tts-btn-play),
.hdk-tts-speed-btn,
.hdk-tts-voice-btn,
html.dark .hdk-tts-btn-play,
html.dark .hdk-tts-player-icon {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.14),
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -1px 2px rgba(255, 255, 255, 0.12),
    inset 0 0 14px rgba(255, 255, 255, 0.06);
}
.hdk-tts-btn:not(.hdk-tts-btn-play)::before,
.hdk-tts-player::before,
.hdk-tts-speed-btn::before,
.hdk-tts-voice-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0,
    rgba(255, 255, 255, 0.25) 25%,
    transparent 45%,
    transparent 55%,
    rgba(255, 255, 255, 0.25) 75%,
    rgba(255, 255, 255, 0.9) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.hdk-tts-btn:not(.hdk-tts-btn-play),
.hdk-tts-speed-btn,
.hdk-tts-voice-btn {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}
.hdk-tts-btn:not(.hdk-tts-btn-play) {
  -webkit-backdrop-filter: blur(1px) saturate(185%) brightness(1.12);
  backdrop-filter: url(#liquid-distortion) blur(1px) saturate(185%)
    brightness(1.12);
}
.hdk-tts-speed-btn,
.hdk-tts-voice-btn {
  -webkit-backdrop-filter: blur(1px) saturate(185%) brightness(1.12);
  backdrop-filter: url(#liquid-distortion) blur(1px) saturate(185%)
    brightness(1.12);
  border: none;
}
html:not(.dark):not(.dark-mode) .hdk-tts-player {
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(4px) saturate(195%) brightness(1.08);
  backdrop-filter: url(#liquid-distortion) blur(4px) saturate(195%)
    brightness(1.08);
}
html:not(.dark):not(.dark-mode) .hdk-tts-btn:not(.hdk-tts-btn-play),
html:not(.dark):not(.dark-mode) .hdk-tts-speed-btn,
html:not(.dark):not(.dark-mode) .hdk-tts-voice-btn {
  background: rgba(255, 255, 255, 0.06);
}
@supports not (
  (-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))
) {
  .hdk-tts-player {
    background: linear-gradient(
      180deg,
      rgba(23, 24, 28, 0.95) 0,
      rgba(23, 24, 28, 0.98) 100%
    );
    border-top: 1px solid rgba(84, 207, 214, 0.2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
  }
  .hdk-tts-btn:not(.hdk-tts-btn-play)::before,
  .hdk-tts-player::before,
  .hdk-tts-speed-btn::before,
  .hdk-tts-voice-btn::before {
    display: none;
  }
  .hdk-tts-btn:not(.hdk-tts-btn-play) {
    background: 0 0;
    box-shadow: none;
  }
  .hdk-tts-speed-btn,
  .hdk-tts-voice-btn {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
  }
}
.hdk-tts-player-row {
  display: contents;
}
html.dark .hdk-tts-player {
  background: rgba(0, 0, 0, 0.7);
}
html.dark .hdk-tts-btn-play,
html.dark .hdk-tts-player-icon {
  background: var(--black-color);
}
@media (max-width: 768px) {
  .hdk-tts-player-wrapper {
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
  }
  .hdk-tts-player-row {
    display: flex;
    align-items: center;
    width: 100%;
  }
  .hdk-tts-player-row-top {
    justify-content: space-between;
    gap: 8px;
  }
  .hdk-tts-player-info,
  .hdk-tts-player-progress {
    flex: 1;
    min-width: 0;
    gap: 8px;
  }
  .hdk-tts-player-text {
    flex: 1;
    min-width: 0;
  }
  .hdk-tts-player-title {
    max-width: none;
    font-size: 14px;
  }
  .hdk-tts-player-subtitle {
    font-size: 12px;
  }
  .hdk-tts-player-controls {
    flex: 0 0 auto;
    gap: 6px;
  }
  .hdk-tts-btn-close {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
  }
  .hdk-tts-player-row-bottom {
    gap: 10px;
  }
  .hdk-tts-speed,
  .hdk-tts-volume,
  .hdk-tts-autonext {
    flex: 0 0 auto;
  }
  .hdk-tts-volume-slider {
    width: 60px;
    display: none;
  }
  .hdk-tts-voice-select {
    display: none;
  }
  .hdk-tts-btn,
  .hdk-tts-player-icon {
    width: 40px;
    height: 40px;
  }
  .hdk-tts-btn iconify-icon,
  .hdk-tts-player-icon iconify-icon {
    font-size: 20px;
  }
  .hdk-tts-btn-play {
    width: 48px;
    height: 48px;
  }
  .hdk-tts-btn-play iconify-icon {
    font-size: 24px;
  }
  .hdk-tts-player {
    padding: 8px 8px max(6px, env(safe-area-inset-bottom));
    border-radius: 12px;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    -ms-border-radius: 12px;
    -o-border-radius: 12px;
  }
  html.dark .hdk-tts-player {
    background: rgba(0, 0, 0, 0.95) !important;
  }
  html:not(.dark):not(.dark-mode) .hdk-tts-player {
    background: rgba(255, 255, 255, 0.95) !important;
  }
}

html.dark .hdk-tts-autonext-btn,
html.dark .hdk-tts-time,
html.dark .hdk-tts-time-current {
  --hdk-text-secondary: #ffffff;
}