/* KUBE MIND — Sticky audio player + listen chips */

.listen-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 8px 14px 8px 10px;
  background: var(--phase-dim, rgba(0, 120, 212, 0.12));
  border: 1px solid var(--border2, rgba(255, 255, 255, 0.12));
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  transition: all 0.2s;
  max-width: 100%;
}
.listen-chip:hover {
  border-color: var(--phase-light, #50a8e8);
  transform: translateY(-1px);
}
.listen-chip.playing {
  border-color: var(--phase, #0078d4);
  box-shadow: 0 0 0 1px var(--phase);
}
.listen-chip-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--phase, #0078d4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}
.listen-chip-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #e8edf5);
}
.listen-chip-meta {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--text-muted, #8892a4);
  margin-left: auto;
  white-space: nowrap;
}

body.kube-tts-active {
  padding-bottom: 88px;
}
body.kube-tts-expanded {
  padding-bottom: 140px;
}

#kubeTtsBar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 450;
  background: rgba(17, 24, 39, 0.97);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}
#kubeTtsBar.visible {
  transform: translateY(0);
}

.kube-tts-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 20px 12px;
}

.kube-tts-row1 {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kube-tts-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--phase, #0078d4);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.kube-tts-play:hover {
  transform: scale(1.06);
}
.kube-tts-play svg {
  width: 16px;
  height: 16px;
}

.kube-tts-info {
  flex: 1;
  min-width: 0;
}
.kube-tts-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kube-tts-times {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--text-dim, #5a6478);
  margin-top: 2px;
}

.kube-tts-progress-wrap {
  flex: 2;
  min-width: 120px;
  max-width: 420px;
  padding: 0 8px;
}
.kube-tts-track {
  height: 5px;
  background: var(--bg4, #242d3f);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}
.kube-tts-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--phase), var(--phase-light, #50a8e8));
  border-radius: 3px;
  pointer-events: none;
  transition: width 0.08s linear;
}
.kube-tts-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 13px;
  height: 13px;
  background: var(--phase-light, #50a8e8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.kube-tts-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.kube-tts-icon-btn {
  background: var(--bg3, #1c2333);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: var(--font-mono);
  transition: all 0.15s;
}
.kube-tts-icon-btn:hover {
  color: var(--text);
  border-color: var(--phase);
}
.kube-tts-icon-btn.on {
  color: var(--phase-light);
  border-color: var(--phase);
  background: var(--phase-dim);
}

.kube-tts-speed-wrap {
  position: relative;
}
.kube-tts-speed-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  min-width: 72px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.kube-tts-speed-menu.open {
  display: block;
}
.kube-tts-speed-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
}
.kube-tts-speed-opt:hover,
.kube-tts-speed-opt.active {
  background: var(--phase-dim);
  color: var(--phase-light);
}

.kube-tts-voice-hint {
  font-size: 10px;
  color: var(--text-dim, #5a6478);
  margin: 4px 0 6px;
  line-height: 1.45;
}

.kube-tts-voice-menu {
  min-width: 220px;
  max-height: 240px;
  overflow-y: auto;
}

.kube-tts-cc {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  border-left: 3px solid var(--phase);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  min-height: 2.8em;
  max-height: 3.2em;
  overflow: hidden;
}
.kube-tts-cc .w {
  transition: color 0.12s, font-weight 0.12s;
}
.kube-tts-cc .w.spoken {
  color: var(--text);
}
.kube-tts-cc .w.current {
  color: var(--phase-light);
  font-weight: 600;
}
.kube-tts-cc.hidden {
  display: none;
}

.kube-tts-transcript {
  display: none;
  margin-top: 8px;
  max-height: 120px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--bg3);
  border-radius: 8px;
}
.kube-tts-transcript.open {
  display: block;
}

@media (max-width: 768px) {
  .kube-tts-progress-wrap {
    order: 10;
    flex: 1 1 100%;
    max-width: none;
    padding: 8px 0 0;
  }
  .kube-tts-row1 {
    flex-wrap: wrap;
  }
  body.kube-tts-active {
    padding-bottom: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kube-tts-cc .w {
    transition: none;
  }
  #kubeTtsBar {
    transition: none;
  }
}
