.order-media-fields {
  display: grid;
  gap: 0;
  width: 100%;
}

.order-photo-upload {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid #edf1f5;
}

.order-photo-upload__button-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: left;
}

.order-photo-upload__button-title {
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.order-photo-upload__button-subtitle,
.order-photo-upload__status {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.order-photo-upload__count {
  color: #667085;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  line-height: 1;
  text-align: center;
}

.order-photo-upload__add {
  width: 100%;
  min-height: 54px;
  padding: 6px 8px 6px 0;
  border: 0;
  border-radius: 14px;
  color: #1f2937;
  background: transparent;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.order-photo-upload__add:hover {
  background: #f6faf7;
}

.order-photo-upload__add:disabled {
  cursor: default;
  opacity: 0.55;
}

.order-photo-upload__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #00a83a;
  background: #eef9f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.order-photo-upload__icon .material-icons-round {
  font-size: 20px;
}

.order-photo-upload__chevron {
  color: #98a2b3;
  font-size: 18px;
}

/* Reuse the photo row's trailing action column so the voice duration aligns
   with the right edge of the complete count-and-chevron group. */
.order-media-fields .voice-note-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  gap: 11px;
  padding-right: 8px;
}

.order-media-fields .voice-note-timer {
  grid-column: 3 / 5;
  justify-self: end;
}

/* Chat-style recording composer shared by the order options and disposal
   wizard. The waveform bars receive their live height from Web Audio. */
.voice-note-composer {
  display: none;
  width: 100%;
  min-width: 0;
  min-height: 66px;
  grid-template-columns: minmax(72px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 8px 14px;
  overflow: hidden;
  border-radius: 20px;
  color: #ffffff;
  background: linear-gradient(135deg, #18233b 0%, #263b75 58%, #3154a5 100%);
  box-shadow: 0 12px 28px rgba(30, 52, 105, 0.22);
}

.voice-note.is-recording > .voice-note-main,
.voice-note.is-recording > .voice-note-player {
  display: none !important;
}

.voice-note.is-recording > .voice-note-composer {
  display: grid;
}

.voice-note--disposal {
  margin-top: 10px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.voice-note--disposal[hidden] {
  display: none !important;
}

.disposal-wizard-panel.is-voice-recording .disposal-media-actions,
.disposal-wizard-panel.is-voice-recording .disposal-photo-source-actions,
.disposal-wizard-panel.is-voice-recording .disposal-media-status {
  display: none !important;
}

.voice-note-waveform {
  display: flex;
  min-width: 0;
  height: 34px;
  align-items: center;
  gap: 3px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 100%);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 100%);
}

.voice-note-waveform-bar {
  width: 3px;
  height: calc(var(--voice-level, 0.22) * 30px);
  min-height: 3px;
  flex: 0 0 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  transform-origin: center;
  transition: height 80ms linear, opacity 120ms ease;
}

.voice-note-composer-timer {
  min-width: 42px;
  color: rgba(255, 255, 255, 0.96);
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-align: right;
}

.voice-note-composer-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.voice-note-composer-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.voice-note-composer-btn:active {
  transform: scale(0.94);
}

.voice-note-composer-btn--stop,
.voice-note-composer-btn--send {
  color: #16213a;
  background: #ffffff;
}

.voice-note-composer-btn--stop .material-icons-round {
  font-size: 20px;
}

.voice-note-composer-btn--send .material-icons-round {
  font-size: 27px;
  font-weight: 700;
}

.voice-note-composer-btn--cancel .material-icons-round {
  font-size: 27px;
}

.voice-note-player {
  grid-template-columns: minmax(0, 1fr) 44px !important;
  gap: 10px !important;
}

.voice-note-player > audio {
  display: none !important;
}

.voice-note-player-controls {
  display: grid;
  min-width: 0;
  min-height: 48px;
  grid-template-columns: 38px auto minmax(42px, 1fr) auto 38px;
  align-items: center;
  gap: 7px;
  padding: 5px 6px;
  border-radius: 999px;
  background: #f4f5f7;
}

.voice-note-play-toggle,
.voice-note-volume-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #111827;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.voice-note-play-toggle .material-icons-round,
.voice-note-volume-toggle .material-icons-round {
  font-size: 22px;
}

.voice-note-playback-time,
.voice-note-playback-duration {
  min-width: 34px;
  color: #111827;
  font-size: 12.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-align: center;
}

.voice-note-playback-duration {
  color: #667085;
}

.voice-note-progress {
  width: 100%;
  min-width: 42px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: #111827;
  cursor: pointer;
}

.voice-note-progress::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #111827 0 var(--voice-progress, 0%), #cfd4dc var(--voice-progress, 0%) 100%);
}

.voice-note-progress::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #111827;
  -webkit-appearance: none;
  appearance: none;
}

.voice-note-progress::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: #cfd4dc;
}

.voice-note-progress::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: #111827;
}

.voice-note-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #111827;
}

@media (max-width: 420px) {
  .voice-note-composer {
    grid-template-columns: minmax(48px, 1fr) auto auto;
    gap: 7px;
    padding-left: 10px;
    padding-right: 7px;
  }

  .voice-note-waveform {
    gap: 2px;
  }

  .voice-note-waveform-bar {
    width: 2px;
    flex-basis: 2px;
  }

  .voice-note-composer-btn {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .voice-note-player-controls {
    grid-template-columns: 34px auto minmax(34px, 1fr) auto 34px;
    gap: 4px;
    padding-inline: 4px;
  }

  .voice-note-play-toggle,
  .voice-note-volume-toggle {
    width: 34px;
    height: 34px;
  }

  .voice-note-playback-time,
  .voice-note-playback-duration {
    min-width: 31px;
    font-size: 11.5px;
  }
}

.order-photo-upload__previews {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.order-photo-upload__previews[hidden] {
  display: none;
}

.order-photo-upload__preview {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #e1e7ee;
  border-radius: 13px;
  background: #eef2f6;
}

.order-photo-upload__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-photo-upload__preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #64748b;
  background: linear-gradient(135deg, #eef2f6, #f8fafc);
}

.order-photo-upload__preview-placeholder .material-icons-round {
  font-size: 30px;
}

.order-photo-upload__preview.is-uploading img {
  opacity: 0.68;
}

.order-photo-upload__preview-state {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(5px);
}

.order-photo-upload__preview-state .material-icons-round {
  font-size: 15px;
}

.order-photo-upload__preview.is-ready .order-photo-upload__preview-state {
  background: #00a83a;
}

.order-photo-upload__preview-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 5px;
}

.order-photo-upload__preview-action {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #111827;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.order-photo-upload__preview-action--delete {
  color: #dc2626;
}

.order-photo-upload__preview-action .material-icons-round {
  font-size: 17px;
}

.order-photo-upload__status {
  grid-column: 1 / -1;
  margin: 0;
}

.order-photo-upload__status[hidden] {
  display: none;
}

.order-photo-upload__status.is-error {
  color: #c2410c;
}

@media (max-width: 420px) {
  .order-photo-upload__add {
    grid-template-columns: 40px minmax(0, 1fr) auto 16px;
    gap: 9px;
  }

  .order-media-fields .voice-note-main {
    grid-template-columns: 42px minmax(0, 1fr) auto 16px;
    gap: 9px;
    padding-right: 6px;
  }

  .order-photo-upload__icon {
    width: 40px;
    height: 40px;
  }

  .order-photo-upload__previews {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .order-photo-upload__add {
    transition: none;
  }

  .voice-note-waveform-bar,
  .voice-note-composer-btn {
    transition: none;
  }
}
