/* MotionGIF — GIF Splitter page styles.
   Loaded after site.css; uses the same design tokens. All classes are
   prefixed mgsp- so nothing collides with the shared stylesheet. */

.mgsp-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px 18px;
  text-align: center;
  margin-top: 20px;
}
.mgsp-dropzone.mgsp-over { border-color: var(--accent); background: var(--accent-soft); }
.mgsp-dropzone p { margin: 6px auto; color: var(--muted); }
.mgsp-dropzone .mgsp-big { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 auto; }
.mgsp-file-input { display: none; }

.mgsp-facts {
  background: var(--accent-soft);
  border: 1px solid #c3d3e6;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 15px;
}
.mgsp-facts p { margin: 4px 0; }
.mgsp-facts .mgsp-fname { font-weight: 700; word-break: break-all; }

/* Batch panel */
.mgsp-batch {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 12px 16px; margin-top: 16px;
}
.mgsp-batch h3 { margin: 0 0 8px; font-size: 16px; }
.mgsp-batch-row {
  border-top: 1px solid var(--border); padding: 8px 0; font-size: 14px;
}
.mgsp-batch-row:first-child { border-top: 0; }
.mgsp-batch-info { word-break: break-word; }
.mgsp-batch-info span { color: var(--muted); }
.mgsp-batch .mg-hint { color: var(--muted); font-size: 13px; }

.mgsp-modes { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.mgsp-mode-btn, .mgsp-clipmode-btn {
  min-height: 44px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.mgsp-mode-btn[aria-pressed="true"], .mgsp-clipmode-btn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

.mgsp-fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.mgsp-fieldset legend { font-weight: 700; font-size: 16px; margin-bottom: 8px; padding: 0; }
.mgsp-num, .mgsp-text {
  width: 100%; min-height: 44px; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-family: inherit;
}
.mgsp-error { color: #b91c1c; font-size: 14px; margin: 6px 0 0; }
.mgsp-readout {
  border-radius: var(--radius); padding: 12px 16px; margin: 16px 0 0;
  font-size: 15px; border: 1px solid var(--border); background: var(--surface);
}
.mgsp-readout p { margin: 4px 0; }
.mgsp-note-ok { border-color: #a7f3d0; background: #ecfdf5; }

.mgsp-limits {
  font-size: 14px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 10px 14px; margin-top: 16px;
}
.mgsp-limits p { margin: 4px 0; }
.mgsp-limits strong { color: var(--ink); }

/* Frame grid */
.mgsp-grid {
  display: grid; gap: 10px; margin-top: 12px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.mgsp-cell {
  border: 2px solid var(--border); border-radius: 10px; padding: 8px;
  background: var(--surface); cursor: pointer; text-align: center;
}
.mgsp-cell.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.mgsp-cell canvas {
  max-width: 100%; height: auto; border-radius: 4px;
  background-image:
    linear-gradient(45deg, #d7dde8 25%, transparent 25%),
    linear-gradient(-45deg, #d7dde8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d7dde8 75%),
    linear-gradient(-45deg, transparent 75%, #d7dde8 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #f1f5f9;
}
.mgsp-cell-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; margin-top: 6px; font-size: 13px;
}
.mgsp-cell-meta label { display: flex; align-items: center; gap: 5px; font-weight: 600; cursor: pointer; }
.mgsp-cell-meta input { width: 17px; height: 17px; accent-color: var(--accent); }
.mgsp-cell-meta .mgsp-delay { color: var(--muted); white-space: nowrap; }
.mgsp-frame-dl {
  margin-top: 8px; width: 100%; min-height: 36px; padding: 6px 8px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--accent-dark);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.mgsp-frame-dl:hover { border-color: var(--accent); }

/* Clip list */
.mgsp-cliplist { margin-top: 12px; display: grid; gap: 10px; }
.mgsp-cliprow {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  background: var(--surface);
}
.mgsp-cliprow .mgsp-clip-info { flex: 1 1 180px; font-size: 15px; }
.mgsp-cliprow .mgsp-clip-info span { color: var(--muted); font-size: 14px; }
.mgsp-cliprow button {
  min-height: 40px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--accent-dark); font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.mgsp-cliprow button:hover { border-color: var(--accent); }
.mgsp-thumbs { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.mgsp-thumbs figure { margin: 0; text-align: center; }
.mgsp-thumbs canvas {
  max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px;
  background-color: #f1f5f9;
}
.mgsp-thumbs figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
