.gifeur {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gifeur input,
.gifeur select,
.gifeur button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: thin solid currentColor;
  padding: .3rem .5rem;
}

.gifeur button {
  cursor: pointer;
}

.gifeur button:disabled {
  opacity: .5;
  cursor: wait;
}

.gif-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

.gif-row input[type="url"] {
  flex: 1;
  min-width: 0;
}

.gif-drop {
  border: thin dashed currentColor;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
}

.gif-drop.gif-over {
  border-style: solid;
  opacity: .7;
}

.gif-drop input {
  display: none;
}

.gif-status {
  min-height: 1.2em;
}

.gif-error {
  color: #e0605a;
}

.gif-picker {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.gif-picker button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .3rem;
}

.gif-picker img {
  max-width: 120px;
  max-height: 120px;
}

.gif-result img {
  max-width: 100%;
  max-height: 60vh;
  display: block;
  margin: 0 auto;
}

.gif-settings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .7rem 1rem;
}

.gif-settings label {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.gif-settings label.gif-check {
  flex-direction: row;
  align-items: center;
}

.gif-settings input[type="number"] {
  width: 6rem;
}

.gifeur progress {
  width: 100%;
}

.gif-big {
  font-size: 1.3em;
  padding: .5rem 1.5rem;
}

[hidden] {
  display: none !important;
}

.gif-preview-box canvas {
  display: block;
  max-width: 100%;
  max-height: 55vh;
  margin: 0 auto;
  background: repeating-conic-gradient(#8884 0 25%, transparent 0 50%) 0 0 / 16px 16px;
}

.gif-preview-box .gif-row input[type="range"] {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
}

.gif-clips {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.gif-clip {
  border: thin solid currentColor;
  padding: .7rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.gif-clip-head {
  display: flex;
  gap: .7rem;
  align-items: center;
}

.gif-clip-media video,
.gif-clip-media canvas {
  display: block;
  width: 160px;
  max-height: 120px;
  object-fit: contain;
}

.gif-clip-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}

.gif-clip-tools {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gif-transition {
  border-top: thin dashed currentColor;
  padding-top: .6rem;
}

.gif-transition input {
  width: 4.5rem;
}

@media (max-width: 520px) {
  .gif-clip-head {
    flex-wrap: wrap;
  }
  .gif-clip-media video,
  .gif-clip-media canvas {
    width: 100%;
    max-height: 200px;
  }
}

.gif-clip-name {
  font: inherit;
  font-weight: bold;
  width: 100%;
  box-sizing: border-box;
}

.gif-result {
  text-align: center;
}

/* Progress / scrub bars: filled part = text color, remaining track = site bg */
#gif-scrub {
  -webkit-appearance: none;
  appearance: none;
  height: 10px;
  border: thin solid var(--primary-text-color);
  background: linear-gradient(to right, var(--primary-text-color) var(--fill, 0%), var(--bg-color) var(--fill, 0%));
}

#gif-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary-text-color);
  border: 2px solid #000;
  border-radius: 50%;
  box-sizing: border-box;
}

#gif-scrub::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--primary-text-color);
  border: 2px solid #000;
  border-radius: 50%;
  box-sizing: border-box;
}

#gif-progress {
  -webkit-appearance: none;
  appearance: none;
  height: 10px;
  border: thin solid var(--primary-text-color);
  background: var(--bg-color);
  color: var(--primary-text-color);
}

#gif-progress::-webkit-progress-bar { background: var(--bg-color); }
#gif-progress::-webkit-progress-value { background: var(--primary-text-color); }
#gif-progress::-moz-progress-bar { background: var(--primary-text-color); }
