
.trimmer-page .hidden { display: none !important; }

.trimmer-page { padding-top: 1rem !important; padding-bottom: 2.5rem; }
.trimmer-wrapper { width: 90%; padding: 1rem; margin: 1.6rem auto 4rem; border-radius: 3rem; display: flex; background: #F9FAFE; }
.trimmer-field { width: 100%; background: #F9FAFE; padding: 3rem; display: flex; justify-content: center; align-items: center; border-radius: 2rem; border: 1px dashed #DADADA; }
.trimmer-field .upload-box { display: flex; justify-content: center; align-items: center; flex-direction: column; }
.trimmer-field .upload-title { font-size: 1.8rem; font-weight: 600; margin-bottom: 1rem; }
.trimmer-field .upload-title span { color: #5675ec; }
.trimmer-field .upload-sub { font-size: 0.875rem; color: #4a5568; margin-bottom: 1.5rem; text-align: center; }
.trimmer-field .upload-btn { align-items: center; justify-content: center; display: flex; background: #121522; border-radius: 0.9rem; color: #fff; font-weight: 500; font-size: 0.9rem; line-height: 0; margin: 0 auto; cursor: pointer; padding: 1.7rem 0.625rem; width: 10.625rem; }
#trimmerDropOverlay { position: fixed; inset: 0; z-index: 999; display: none; align-items: center; justify-content: center; flex-direction: column; background: #f9fafeba; backdrop-filter: blur(10px); text-align: center; }
#trimmerDropOverlay img { width: 5rem; margin-bottom: 1rem; }
#trimmerDropOverlay h3 { font-size: 1.7rem; }
#trimmerDropOverlay.show { display: flex; }
@media (max-width: 992px) {
  .main-content .container.trimmer-page > h1 { width: 100%; text-align: center !important; }
  .trimmer-wrapper { width: 100%; }
  .trimmer-field { padding: 2rem; }
  .trimmer-field .upload-title { text-align: center; line-height: 1.3; }
  .trimmer-field .upload-sub { font-size: 0.7rem; line-height: 1.4; }
  .trimmer-field .upload-btn { font-family: "Poppins", sans-serif; font-size: 0.7rem; border: none; padding: 1.3rem 0.625rem; width: 8.625rem; }
}

/* Dedicated Video Trimmer editor. */
.trimmer-editor[hidden], .trimmer-editor [hidden] { display: none !important; }
body.trimmer-editing { overflow: hidden; }
.trimmer-editor {
  position: fixed;
  inset: 10px;
  z-index: 10000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 20vw, 300px);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "preview sidebar" "timeline timeline";
  gap: 18px;
  padding: 16px;
  box-sizing: border-box;
  border-radius: 24px;
  background: #000000;
  color: #c8c9d1;
  font-family: "Poppins", sans-serif;
  overflow: hidden;
  box-shadow: 0 0 0 24px #fff;
}
.trimmer-editor *, .trimmer-editor *::before, .trimmer-editor *::after { box-sizing: border-box; }
.trimmer-editor__sidebar { grid-area: sidebar; min-width: 0; min-height: 0; padding: 12px; border-radius: 16px; background: #151515; overflow: auto; }
.trimmer-editor__save-actions { display: grid; grid-template-columns: minmax(0, 1fr) 50px; gap: 10px; }
.trimmer-editor__close { display: grid; place-items: center; width: 100%; min-height: 50px; padding: 0; border: 0; border-radius: 10px; background: #26262c; color: #606060; cursor: pointer; }
.trimmer-editor__close svg { width: 18px; height: 18px; }
.trimmer-editor__save {
  display: inline-grid;
  grid-template-columns: 20px minmax(0, auto);
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #7b75ff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.trimmer-editor__save svg { grid-column: 1; grid-row: 1; width: 20px; height: 20px; }
.trimmer-editor__save[aria-busy="true"] svg { visibility: hidden; }
.trimmer-editor__save-label, .trimmer-editor__save-sizer { grid-column: 2; grid-row: 1; min-width: 0; white-space: normal; }
.trimmer-editor__save[aria-busy="true"] .trimmer-editor__save-label { grid-column: 1 / -1; text-align: center; }
.trimmer-editor__save-sizer { display: grid; visibility: hidden; pointer-events: none; }
.trimmer-editor__save-sizer > span { grid-column: 1; grid-row: 1; }
.trimmer-editor__save:disabled { opacity: .55; cursor: wait; }
.trimmer-editor__download { grid-column: 1 / -1; color: #fff; font-size: 13px; text-decoration: underline; }
.trimmer-editor__preview { grid-area: preview; position: relative; min-width: 0; min-height: 0; padding: 32px; border-radius: 16px; overflow: hidden; background: #151515; }
/* Fit the video element itself to the picture, so its rounded corners are visible. */
.trimmer-editor__preview video { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: block; object-fit: contain; border-radius: 8px; overflow: hidden; }
.trimmer-editor__preview video.is-outside { visibility: hidden; }
.trimmer-editor__panel { grid-area: timeline; min-width: 0; padding: 0 26px 12px; border-radius: 16px; background: #151515; overflow: hidden; }
.trimmer-editor__controls { position: relative; display: flex; justify-content: center; align-items: center; min-height: 64px; padding: 0; }
.trimmer-editor__selection { min-width: 0; margin: 20px 0 0; padding: 20px; border: 0; border-radius: 15px; background: #242424; }
.trimmer-editor__selection:disabled { opacity: .55; }
.trimmer-editor__selection-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 12px; padding: 0 5px 0 1px; }
.trimmer-editor__selection-heading > span { display: inline-flex; align-items: center; gap: 8px; }
.trimmer-editor__selection-heading svg { width: 18px; height: 18px; }
.trimmer-editor__selection-heading output { color: #e7d35a; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trimmer-editor__time-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.trimmer-editor__time-field { display: flex; min-width: 0; height: 40px; border: 1px solid #242428; border-radius: 10px; background: #343434; overflow: hidden; }
.trimmer-editor__time-field:focus-within { border-color: #7b75ff; }
.trimmer-editor__time-field input { min-width: 0; width: 100%; height: 100%; padding: 0 14px; margin: 0; border: 0; border-radius: 0; outline: none; background: transparent; color: #e7d35a; font: inherit; font-size: 11px; font-variant-numeric: tabular-nums; box-shadow: none; }
.trimmer-editor__time-steppers { display: flex; flex: 0 0 16px; flex-direction: column; padding: 5px 0; }
.trimmer-editor__time-steppers button { display: grid; flex: 1; place-items: center; width: 30px; min-height: 0; padding: 0; border: 0; background: transparent; color: #777780; cursor: pointer; }
.trimmer-editor__time-steppers button:not(:disabled):hover,
.trimmer-editor__time-steppers button:not(:disabled):active { color: #fff; background: transparent; }
.trimmer-editor__time-steppers button:disabled { cursor: wait; }
.trimmer-editor__time-steppers svg { width: 10px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.trimmer-editor__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* 38px buttons contain 18px icons: offset the 10px inset to align with the timeline. */
.trimmer-editor__history { position: absolute; left: -10px; display: flex; align-items: center; gap: 10px; }
.trimmer-editor__transport, .trimmer-editor__zoom { display: flex; align-items: center; gap: 16px; }
.trimmer-editor__transport time { flex: 0 0 76px; width: 76px; min-width: 76px; font-variant-numeric: tabular-nums; font-size: 12px; color: #777; white-space: nowrap; }
.trimmer-editor__transport time:first-child { text-align: right; }
.trimmer-editor__time-digit, .trimmer-editor__time-separator { display: inline-block; text-align: center; }
.trimmer-editor__time-digit { width: 0.7em; }
.trimmer-editor__time-separator { width: 0.35em; }
.trimmer-editor__controls button { display: grid; place-items: center; width: 38px; height: 38px; padding: 5px; background: none; border: 0; color: #c8c9d1; cursor: pointer; }
.trimmer-editor__controls button:disabled { opacity: .35; cursor: wait; }
.trimmer-editor__history button:disabled { cursor: default; }
.trimmer-editor__controls svg { width: 18px; height: 18px; fill: currentColor; }
#trimmerPlay { width: 38px; }
#trimmerPlay svg { width: 20px; height: 20px; }
.trimmer-editor__pause-icon, #trimmerPlay.is-playing .trimmer-editor__play-icon { display: none; }
#trimmerPlay.is-playing .trimmer-editor__pause-icon { display: block; }
.trimmer-editor__zoom { position: absolute; right: -10px; gap: 8px; }
.trimmer-editor__zoom svg { fill: none; stroke: currentColor; stroke-width: 1.4; }
.trimmer-editor__zoom input { width: 110px; height: 16px; margin: 0; padding: 0; border: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.trimmer-editor__zoom input::-webkit-slider-runnable-track { height: 2px; border: 0; border-radius: 2px; background: linear-gradient(to right, #fff 0 var(--trimmer-zoom-progress, 0%), #555 var(--trimmer-zoom-progress, 0%) 100%); }
.trimmer-editor__zoom input::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -7px; border: 0; border-radius: 50%; appearance: none; -webkit-appearance: none; background: #fff; box-shadow: none; }
.trimmer-editor__zoom input::-moz-range-track { height: 2px; border: 0; border-radius: 2px; background: #555; }
.trimmer-editor__zoom input::-moz-range-progress { height: 2px; border: 0; border-radius: 2px; background: #fff; }
.trimmer-editor__zoom input::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; box-shadow: none; }
.trimmer-editor__viewport { overflow-x: scroll; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #444 #1a1a1a; }
.trimmer-editor__viewport::-webkit-scrollbar { height: 8px; }
.trimmer-editor__viewport::-webkit-scrollbar-track { background: #1a1a1a; }
.trimmer-editor__viewport::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
.trimmer-editor__viewport::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
@supports selector(::-webkit-scrollbar) {
  .trimmer-editor__viewport { scrollbar-width: auto; scrollbar-color: auto; }
}
.trimmer-editor__timeline { position: relative; min-width: 100%; padding-bottom: 4px; user-select: none; touch-action: pan-x; }
.trimmer-editor__ruler { height: 34px; border-top: 1px solid #303030; cursor: crosshair; }
.trimmer-editor__tick { position: absolute; top: 0; padding-top: 10px; font-size: 10px; color: #626262; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.trimmer-editor__tick::before { content: ""; position: absolute; top: 0; left: 50%; height: 7px; width: 1px; background: #363636; }
.trimmer-editor__track-row { position: relative; height: 60px; margin: 8px 0 0; }
.trimmer-editor__source-track { position: absolute; left: 24px; top: 2px; height: 46px; background: #292929; filter: grayscale(1) brightness(.3); pointer-events: none; }
.trimmer-editor__clip {
  position: absolute;
  top: 0;
  height: 50px;
  min-width: 2px;
  border-top: 2px solid var(--trimmer-clip-color);
  border-bottom: 2px solid var(--trimmer-clip-color);
  background: #292929;
  cursor: crosshair;
  touch-action: none;
}
.trimmer-editor__clip:active { cursor: crosshair; }
.trimmer-editor__clip--video { --trimmer-clip-color: #ffdc49; }
.trimmer-editor__clip canvas { display: block; width: 100%; height: 46px; pointer-events: none; }
.trimmer-editor__filename { position: absolute; top: 0; left: 0; max-width: 100%; padding: 3px 8px; background: #0008; color: #fff; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; }
.trimmer-editor__clip-duration { position: absolute; left: 0; top: 50%; width: 100%; transform: translateY(-50%); color: var(--trimmer-clip-color); font-size: 12px; text-align: center; pointer-events: none; }
.trimmer-editor__handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 18px;
  border: 0;
  padding: 0;
  cursor: ew-resize;
  touch-action: none;
  background: linear-gradient(#260521, #260521) calc(50% - 1.6px) 50% / 1.6px 40% no-repeat,
    linear-gradient(#260521, #260521) calc(50% + 1.6px) 50% / 1.6px 40% no-repeat,
    var(--trimmer-clip-color);
}
.trimmer-editor__handle[data-edge="start"] { left: -18px; border-radius: 6px 0 0 6px; }
.trimmer-editor__handle[data-edge="end"] { right: -18px; border-radius: 0 6px 6px 0; }
.trimmer-editor__playhead { position: absolute; top: 8px; bottom: 12px; width: 2px; background: #ff327e; z-index: 5; pointer-events: none; }
.trimmer-editor__playhead span { position: absolute; top: -6px; left: -7px; width: 16px; height: 16px; border-radius: 50%; background: #ff327e; cursor: ew-resize; pointer-events: auto; touch-action: none; }
.trimmer-editor button:not([role="slider"]):focus { outline: none; }
.trimmer-editor a:focus-visible, .trimmer-editor button:focus-visible, .trimmer-editor [role="slider"]:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.trimmer-editor.is-exporting .trimmer-editor__panel { opacity: .5; pointer-events: none; }
@media (max-width: 900px) {
  .trimmer-editor { inset: 8px; padding: 12px; gap: 12px; border-radius: 20px; }
  .trimmer-editor__preview { padding: 20px; }
  .trimmer-editor__controls { flex-wrap: wrap; justify-content: space-between; gap: 4px; padding: 8px 0; }
  .trimmer-editor__history { position: static; margin-left: -10px; }
  .trimmer-editor__zoom { position: static; margin-right: -10px; }
  .trimmer-editor__transport { order: 1; justify-content: center; width: 100%; gap: 8px; }
}
@media (max-width: 700px) {
  .trimmer-editor { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(100px, 1fr) auto auto; grid-template-areas: "preview" "sidebar" "timeline"; }
  .trimmer-editor__sidebar { padding: 10px; overflow: visible; }
  .trimmer-editor__selection { margin-top: 10px; padding: 10px 12px; }
  .trimmer-editor__selection-heading { margin-bottom: 10px; }
  .trimmer-editor__time-field input { font-size: 12px; }
}
@media (max-width: 560px) {
  .trimmer-editor { inset: 0; border-radius: 0; padding: 12px; gap: 12px; }
  .trimmer-editor__save { font-size: 12px; padding: 10px 12px; min-height: 40px; border-radius: 8px; }
  .trimmer-editor__save-actions { grid-template-columns: minmax(0, 1fr) 40px; }
  .trimmer-editor__close { min-height: 40px; border-radius: 8px; }
  .trimmer-editor__download { font-size: 11px; }
  .trimmer-editor__panel { border-radius: 16px; padding: 0 12px 8px; }
  .trimmer-editor__controls { flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px 0 10px; }
  .trimmer-editor__transport { order: 1; justify-content: center; width: 100%; gap: 8px; }
  .trimmer-editor__zoom { margin-left: auto; }
  .trimmer-editor__transport time { flex-basis: 66px; width: 66px; min-width: 66px; font-size: 12px; }
  .trimmer-editor__zoom input { width: 100px; }
  .trimmer-editor__preview { padding: 12px; }
}
@media (max-height: 540px) and (min-width: 561px) {
  .trimmer-editor { inset: 4px; padding: 10px; gap: 10px; grid-template-columns: minmax(0, 1fr) 210px; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "preview sidebar" "timeline timeline"; }
  .trimmer-editor__preview { padding: 12px; }
  .trimmer-editor__sidebar { padding: 10px; }
  .trimmer-editor__time-field input { padding: 0 4px; font-size: 10px; }
  .trimmer-editor__save { min-height: 34px; padding: 6px 12px; }
  .trimmer-editor__save-actions { grid-template-columns: minmax(0, 1fr) 34px; }
  .trimmer-editor__close { min-height: 34px; border-radius: 8px; }
  .trimmer-editor__save { font-size: 11px; gap: 6px; }
  .trimmer-editor__controls { min-height: 40px; }
  .trimmer-editor__panel { padding-top: 0; }
}
@media (max-height: 540px) and (min-width: 701px) {
  .trimmer-editor__controls { flex-wrap: nowrap; }
  .trimmer-editor__transport { order: 0; width: auto; }
  .trimmer-editor__zoom input { width: 80px; }
}
