.media-tool-card .drop-zone {
  min-height: 180px;
  margin-bottom: 16px;
}

.media-tool-card .drop-zone.hidden {
  display: none;
}

.media-section {
  margin-top: 24px;
  padding-top: 8px;
}

.media-section.hidden {
  display: none;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  color: #374151;
}

.settings-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-row input[type="number"] {
  width: 88px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

.settings-row input[type="range"] {
  width: 120px;
  vertical-align: middle;
}

.settings-label {
  font-weight: 600;
  width: 100%;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.radio-group label {
  font-weight: normal;
}

.advanced-block {
  margin: 12px 0;
  font-size: 13px;
  color: #4b5563;
}

.advanced-block summary {
  cursor: pointer;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 8px;
}

.video-container {
  max-width: 720px;
  margin: 0 auto 16px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: #000;
}

.video-container video {
  width: 100%;
  display: block;
}

.frames-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  width: 100%;
  max-height: min(520px, 60vh);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}

.frame-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  background: #fff;
}

.frame-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

.frame-item img.has-alpha {
  background-image:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}

.frame-number {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.frame-checkbox {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.animation-container {
  max-width: 720px;
  min-height: 200px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}

.animation-container img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.animation-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s, opacity 0.25s;
  max-width: min(90vw, 420px);
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.zoom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.zoom-modal .zoom-inner {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
}

.zoom-modal img {
  max-width: 92vw;
  max-height: 80vh;
  object-fit: contain;
}

.zoom-modal .zoom-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

.zoom-modal .zoom-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
}

.zoom-modal .zoom-prev { left: -56px; }
.zoom-modal .zoom-next { right: -56px; }

.zoom-modal .zoom-info {
  text-align: center;
  color: #fff;
  font-size: 14px;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .frames-container {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .zoom-modal .zoom-prev { left: 8px; }
  .zoom-modal .zoom-next { right: 8px; }
}
