* { box-sizing: border-box; }
body {
  margin: 0;
  background: #0d0d0d;
  color: white;
  font-family: Arial, sans-serif;
}
.creator {
  max-width: 620px;
  margin: 65px auto;
  padding: 24px;
}
.brand { font-size: 12px; letter-spacing: 3px; }
h1 { font-size: clamp(32px, 7vw, 54px); margin-bottom: 12px; }
.subtitle { color: #aaa; }
.upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 35px 0;
  padding: 45px 20px;
  border: 2px dashed #666;
  border-radius: 16px;
  cursor: pointer;
}
.upload span { font-size: 22px; font-weight: bold; }
.upload small { color: #aaa; }
#waveform {
  width: 100%;
  display: block;
  background: #181818;
  border-radius: 12px;
  margin: 20px 0;
}
input[type="range"] { width: 100%; accent-color: #36d6a0; }
.times { display: flex; justify-content: space-between; margin: 12px 0; }
button {
  width: 100%;
  padding: 17px;
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}
#preview { background: #36d6a0; color: #000; }
#purchase { background: #fff; color: #000; }
button:disabled { opacity: .45; cursor: not-allowed; }
.price { text-align: center; font-size: 28px; font-weight: bold; }
#status { color: #aaa; }

#waveform {
  height: 120px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#waveform:active { cursor: grabbing; }
.trim-hint {
  text-align: center;
  color: #aaa;
  font-size: 13px;
}

.fine-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.fine-controls button {
  margin: 0;
  padding: 12px 4px;
  background: #292929;
  color: #fff;
  font-size: 12px;
}
.fine-controls button:active { background: #36d6a0; color: #000; }

/* Thursday Is Thursday — precision trimmer */
.time-display {
  width: fit-content;
  margin: 25px auto 0;
  padding: 9px 17px;
  background: #303030;
  border-radius: 9px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.playhead-line {
  height: 22px;
  width: 2px;
  background: white;
  margin: 0 auto;
}

.timeline {
  position: relative;
  height: 120px;
  background: #242424;
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

#waveform {
  display: block;
  width: 100%;
  height: 120px;
  margin: 0;
  border-radius: 0;
  touch-action: none;
}

.trim-selection {
  position: absolute;
  top: 0;
  height: 100%;
  border: 3px solid #36d6a0;
  border-radius: 9px;
  background: rgba(54,214,160,.13);
  cursor: grab;
  touch-action: none;
}

.trim-handle {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 20px;
  background: #36d6a0;
  color: #071a13;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: bold;
  touch-action: none;
}

.trim-handle.left {
  left: -3px;
  border-radius: 8px 0 0 8px;
  cursor: ew-resize;
}

.trim-handle.right {
  right: -3px;
  border-radius: 0 8px 8px 0;
  cursor: ew-resize;
}

.times {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  gap: 8px;
}

#duration { color: #36d6a0; }

.trim-hint {
  text-align: center;
  color: #aaa;
  font-size: 12px;
  line-height: 1.6;
}

/* Compact Instagram-style trimmer */
.timeline-wrap {
  position: relative;
  padding-top: 54px;
  margin-top: 12px;
}

.timeline {
  height: 76px;
  overflow: visible;
  border-radius: 8px;
}

#waveform {
  height: 76px;
  border-radius: 8px;
}

.trim-selection {
  border-width: 2px;
  border-radius: 6px;
  z-index: 2;
}

.trim-handle {
  top: -2px;
  bottom: -2px;
  width: 14px;
  font-size: 10px;
}

.trim-handle.left { left: -2px; }
.trim-handle.right { right: -2px; }

.time-display {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-50%);
  margin: 0;
  padding: 7px 10px;
  font-size: 14px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

.playhead-line {
  position: absolute;
  top: 35px;
  left: 0;
  width: 2px;
  height: 95px;
  margin: 0;
  background: white;
  pointer-events: none;
  z-index: 4;
}

.times {
  margin-top: 14px;
}

/* Precision trimmer — compact, touch-friendly */
.timeline-wrap {
  position: relative;
  padding-top: 37px;
  margin-top: 12px;
}

.timeline {
  height: 64px;
  overflow: visible;
  border-radius: 7px;
  touch-action: none;
}

#waveform {
  height: 64px;
  margin: 0;
  border-radius: 7px;
  pointer-events: none;
}

.trim-selection {
  top: 0;
  height: 64px;
  border: 2px solid #36d6a0;
  border-radius: 5px;
  background: rgba(54,214,160,.09);
  touch-action: none;
  z-index: 2;
}

.trim-handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  touch-action: none;
  z-index: 4;
}

.trim-handle.left {
  left: -16px;
  border-radius: 0;
}

.trim-handle.right {
  right: -16px;
  border-radius: 0;
}

.handle-mark {
  display: block;
  width: 6px;
  height: 38px;
  background: #36d6a0;
  border-radius: 4px;
  pointer-events: none;
}

.time-display {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 7px;
  background: rgba(36,36,36,.94);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  color: #fff;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 6;
}

.playhead-line {
  position: absolute;
  top: 27px;
  width: 1px;
  height: 74px;
  background: rgba(255,255,255,.85);
  pointer-events: none;
  z-index: 5;
}

/* Prevent text selection while scrubbing on iPhone */
.timeline-wrap,
.timeline-wrap *,
.times,
.trim-hint {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none;
}

.timeline,
.trim-selection,
.trim-handle {
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

/* Smooth precision interaction */
.timeline {
  touch-action: none;
  overscroll-behavior: contain;
}

.trim-selection {
  will-change: left, width;
}

.trim-handle {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.time-display {
  font-variant-numeric: tabular-nums;
}


/* Stable zoom viewport */
.timeline {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#waveform {
  display: block;
  width: 100%;
  height: 64px;
  margin: 0;
  border-radius: 0;
  pointer-events: none;
  image-rendering: auto;
}

.trim-selection {
  transition: none !important;
}

.trim-handle {
  transition: none !important;
}

/* Compact audio preview button */
#preview {
  display: block;
  width: fit-content;
  min-width: 160px;
  max-width: 220px;
  margin: 16px auto;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}


/* Matching preview and purchase buttons */
#preview,
#purchase {
  display: block;
  width: fit-content;
  min-width: 180px;
  max-width: 220px;
  margin: 16px auto;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}


/* Matching pill-shaped buttons */
#preview,
#purchase {
  box-sizing: border-box;
  display: block;
  width: 220px;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  margin: 16px auto;
  padding: 11px 20px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}



/* Step 94: compact export controls */
.export-tools {
  text-align: center;
  margin: 12px auto;
}
.export-tools[hidden] {
  display: none !important;
}
.export-tools button {
  display: block;
  box-sizing: border-box;
  width: 220px;
  max-width: 100%;
  min-height: 44px;
  margin: 10px auto;
  padding: 11px 20px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.export-tools button:disabled {
  opacity: 0.5;
  cursor: wait;
}
#exportStatus {
  font-size: 12px;
}
.export-tools small {
  display: block;
  opacity: 0.65;
  font-size: 11px;
}


/* Ringtone installation guide */
.ringtone-guide {
  max-width: 360px;
  margin: 32px auto 24px;
  padding: 0 20px;
  text-align: left;
}
.ringtone-guide h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}
.ringtone-guide p {
  font-size: 12px;
  line-height: 1.7;
  color: #bdbdbd;
  margin: 12px 0;
}
.ringtone-guide p span {
  display: inline;
  color: #36d6a0;
  font-weight: 700;
  margin-right: 8px;
}

/* align wrapped ringtone instructions */
.ringtone-guide p {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
}

.ringtone-guide p span {
  display: block;
  margin: 0;
}

