/* Sticky one-hand player — attaches to existing <audio>, does not restyle transcripts */
:root {
  --mp-bar-h: 88px;
  --mp-safe: env(safe-area-inset-bottom, 0px);
}

html body {
  padding-bottom: calc(var(--mp-bar-h) + var(--mp-safe) + 12px);
}

.mp-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  box-sizing: border-box;
  min-height: var(--mp-bar-h);
  padding: 8px 12px calc(8px + var(--mp-safe));
  background: linear-gradient(180deg, #1a1a2e 0%, #12121f 100%);
  color: #f5f0e8;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.28);
  font-family: -apple-system, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

.mp-bar[hidden] { display: none !important; }

.mp-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
}

.mp-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.mp-time {
  flex-shrink: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #c8c0b4;
  letter-spacing: 0.01em;
}

.mp-resume {
  flex-shrink: 0;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(240, 215, 140, 0.55);
  border-radius: 999px;
  background: rgba(240, 215, 140, 0.16);
  color: #f0d78c;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mp-resume:active { background: rgba(240, 215, 140, 0.3); }
.mp-resume[hidden] { display: none !important; }

.mp-seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 2px 0 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.mp-seek:focus { outline: none; }

.mp-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: #3a3a52;
}

.mp-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #f0d78c;
  border: 2px solid #1a1a2e;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.mp-seek::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: #3a3a52;
  border: none;
}

.mp-seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f0d78c;
  border: 2px solid #1a1a2e;
}

.mp-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.mp-btn {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mp-btn:active { background: rgba(255, 255, 255, 0.18); }

.mp-btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

.mp-play {
  min-width: 56px;
  min-height: 52px;
  border-radius: 50%;
  background: #c0392b;
  font-size: 18px;
  line-height: 1;
}

.mp-play:active { background: #a5281e; }

.mp-play.is-playing {
  background: #27ae60;
}

.mp-speed {
  min-width: 52px;
  color: #f0d78c;
  font-variant-numeric: tabular-nums;
}

.track.mp-current,
.segment.mp-current {
  box-shadow: inset 3px 0 0 #c0392b;
  background: rgba(192, 57, 43, 0.06);
  border-radius: 8px;
}

@media (min-width: 720px) {
  .mp-bar {
    left: 50%;
    right: auto;
    width: min(720px, 100%);
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }
}
