.audtrim-shell {
  width: 100%;
}

#audtrim-dropzone.is-dragging #audtrim-dropzone-panel {
  border-color: #111827;
  background: #fffef2;
}

.audtrim-editor {
  border: 1px solid #e5e7eb;
  width: 100%;
}

.audtrim-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.audtrim-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: #fff8cc;
  border: 1px solid #ffe16a;
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.audtrim-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.audtrim-main-panel,
.audtrim-config-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.audtrim-player-bar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.audtrim-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
}

.audtrim-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.audtrim-time-readout,
.audtrim-meta-readout {
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.audtrim-meta-readout {
  color: #6b7280;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audtrim-scrub-shell input[type="range"] {
  width: 100%;
  accent-color: #111827;
}

.audtrim-wave-shell {
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.audtrim-waveform {
  position: relative;
  min-width: 760px;
  min-height: 220px;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.05) 1px, transparent 1px) 0 0 / 48px 100%,
    linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  overflow: hidden;
}

.audtrim-wave-bars {
  position: absolute;
  inset: 0.9rem 0.8rem;
  display: grid;
  grid-template-columns: repeat(160, minmax(2px, 1fr));
  align-items: center;
  gap: 2px;
  pointer-events: none;
}

.audtrim-wave-bar {
  min-height: 6px;
  border-radius: 999px;
  background: #d1d5db;
}

.audtrim-waveform.is-ready .audtrim-wave-bar {
  background: #111827;
}

.audtrim-segments-layer {
  position: absolute;
  inset: 0;
}

.audtrim-segment {
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  min-width: 16px;
  border: 2px solid #ffd700;
  background: rgba(255, 215, 0, 0.22);
  border-radius: 0.65rem;
  cursor: grab;
}

.audtrim-segment.is-active {
  border-color: #111827;
  background: rgba(255, 215, 0, 0.36);
}

.audtrim-segment-label {
  position: absolute;
  left: 0.5rem;
  top: 0.45rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.audtrim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  border: 0;
  background: #111827;
  cursor: ew-resize;
}

.audtrim-handle.start {
  left: 0;
  border-radius: 0.5rem 0 0 0.5rem;
}

.audtrim-handle.end {
  right: 0;
  border-radius: 0 0.5rem 0.5rem 0;
}

.audtrim-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  transform: translateX(-1px);
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
}

.audtrim-timeline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.audtrim-secondary-btn,
.audtrim-ghost-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.5rem;
  padding: 0 0.9rem;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.audtrim-secondary-btn {
  background: #111827;
  color: #fff;
}

.audtrim-ghost-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
}

.audtrim-secondary-btn:disabled,
.audtrim-ghost-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.audtrim-section-list {
  display: grid;
  gap: 0.6rem;
}

.audtrim-section-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.7rem;
}

.audtrim-section-row strong {
  font-size: 0.8rem;
  color: #111827;
}

.audtrim-section-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: #6b7280;
}

.audtrim-section-row button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
}

.audtrim-export-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.audtrim-export-spinner {
  width: 44px;
  height: 44px;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.audtrim-export-spinner .material-symbols-outlined {
  font-size: 1.35rem;
  font-variation-settings: "FILL" 1;
}

.audtrim-success-card {
  border-radius: 0.75rem;
  background: #111827;
  color: #fff;
  padding: 1rem;
}

@media (max-width: 900px) {
  .audtrim-top-grid {
    grid-template-columns: 1fr;
  }

  .audtrim-editor-head,
  .audtrim-player-bar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .audtrim-player-bar {
    display: grid;
  }

  .audtrim-meta-readout {
    grid-column: 1 / -1;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .audtrim-waveform {
    min-width: 620px;
  }

  .audtrim-section-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .audtrim-section-row span {
    grid-column: 2 / -1;
  }
}
