.media-preview-actions { flex-wrap: wrap; }
.media-preview-video-frame { position: relative; width: 100%; height: 100%; overflow: hidden; }
.media-preview-video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.video-crop-dialog { width: min(800px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto; border: 1px solid #395064; border-radius: 16px; color: #f3f7fa; background: #121922; box-shadow: 0 28px 100px rgba(0,0,0,.8), 0 0 0 1px rgba(110,205,230,.05) inset; scrollbar-width: thin; scrollbar-color: #456072 transparent; }
.video-crop-dialog::backdrop { background: rgba(3, 7, 11, .8); backdrop-filter: blur(6px); }
.video-crop-dialog [hidden] { display: none !important; }
.video-crop-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 9px 16px; }
.video-crop-heading { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.video-crop-heading h2 { margin: 0; font-size: 16px; line-height: 1.25; }
.video-crop-heading span { display: block; min-width: 0; max-width: 100%; overflow: hidden; color: #9aafbb; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.video-crop-header > button { display: grid; place-items: center; width: 29px; height: 29px; flex: 0 0 29px; padding: 0; border: 1px solid #425463; border-radius: 8px; color: #dce5e9; background: #26333d; cursor: pointer; }
.video-crop-header > button svg { display: block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.video-crop-header > button:hover { border-color: #80d9ef; color: white; background: #304858; }
.video-crop-stage { display: grid; place-items: center; height: min(48vh, 430px); min-height: 220px; margin: 0 14px; overflow: hidden; border: 1px solid #354b5b; border-radius: 11px; background: radial-gradient(circle at 50% 50%, #182936, #080e15 72%); }
.video-crop-surface { position: relative; overflow: hidden; min-width: 1px; min-height: 1px; background: #05080b; cursor: crosshair; touch-action: none; }
.video-crop-surface video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.video-crop-selection { position: absolute; z-index: 2; box-sizing: border-box; border: 2px solid #eaf9ff; box-shadow: 0 0 0 100vmax rgba(0,0,0,.62), inset 0 0 0 1px rgba(0,0,0,.3); cursor: move; touch-action: none; outline: none; }
.video-crop-dialog.is-drawing .video-crop-selection { display: none; }
.video-crop-selection:focus-visible { border-color: #93e7ff; }
.video-crop-grid { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent calc(33.33% - .5px), rgba(255,255,255,.4) 33.33%, transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.4) 66.66%, transparent calc(66.66% + .5px)), linear-gradient(0deg, transparent calc(33.33% - .5px), rgba(255,255,255,.4) 33.33%, transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.4) 66.66%, transparent calc(66.66% + .5px)); }
.video-crop-selection button { position: absolute; z-index: 3; width: 13px; height: 13px; padding: 0; border: 2px solid #fff; border-radius: 3px; background: #76cfec; box-shadow: 0 1px 6px rgba(0,0,0,.5); transform: translate(-50%,-50%); touch-action: none; }
.video-crop-selection [data-crop-handle="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.video-crop-selection [data-crop-handle="n"] { left: 50%; top: 0; cursor: ns-resize; }
.video-crop-selection [data-crop-handle="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.video-crop-selection [data-crop-handle="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.video-crop-selection [data-crop-handle="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.video-crop-selection [data-crop-handle="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.video-crop-selection [data-crop-handle="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.video-crop-selection [data-crop-handle="w"] { left: 0; top: 50%; cursor: ew-resize; }
.video-crop-dialog.is-preview .video-crop-selection { display: none; }
.video-crop-body { padding: 9px 14px 14px; }
.video-crop-guidance { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 33px; margin-bottom: 8px; padding: 6px 10px; border: 1px solid #294455; border-radius: 8px; color: #b5d6e2; background: #172632; font-size: 11px; font-weight: 700; }
.video-crop-guidance > span:first-child { min-width: 0; line-height: 1.35; }
.video-crop-size { flex: 0 0 auto; padding-inline-start: 8px; border-inline-start: 1px solid #355267; color: #8cdef2; font: 700 10px ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.video-crop-playback { display: flex; align-items: center; gap: 9px; direction: ltr; }
html[dir="rtl"] .video-crop-playback, html[dir="rtl"] #videoCropSeek { direction: rtl; }
.video-crop-playback button { width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid #72bccc; border-radius: 9px; color: #fff; background: #277b94; cursor: pointer; }
.video-crop-playback button:hover { background: #3298b2; }
.video-crop-playback span { min-width: 48px; color: #cedae0; font: 700 11px ui-monospace, Consolas, monospace; text-align: center; }
.video-crop-playback input { min-width: 0; flex: 1; accent-color: #6ecde6; cursor: pointer; }
.video-crop-toolbar { display: grid; gap: 8px; min-width: 0; margin-top: 10px; padding-top: 10px; border-top: 1px solid #293844; }
.video-crop-ratio-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #e3edf1; font-size: 11px; font-weight: 800; }
.video-crop-ratio-heading button { padding: 2px 0; border: 0; color: #82d8ee; background: transparent; font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.video-crop-ratio-heading button:hover { color: #c7f3ff; }
.video-crop-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; min-width: 0; }
.video-crop-presets button { min-width: 0; height: 32px; padding: 5px 3px; border: 1px solid #3b4b59; border-radius: 7px; color: #c3d0d8; background: #1e2a35; font-family: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.video-crop-presets button.active, .video-crop-presets button:hover { border-color: #74cee5; color: #ebfbff; background: #255064; }
.video-crop-status { margin: 8px 0 0; color: #ffc6c6; font-size: 11px; text-align: center; }
.video-crop-actions { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.1fr) minmax(0, 1.5fr); gap: 6px; margin-top: 3px; padding-top: 10px; border-top: 1px solid #293844; }
.video-crop-actions button { min-width: 0; min-height: 34px; padding: 5px 6px; border: 1px solid #435462; border-radius: 7px; color: #dce5ea; background: #25323c; font-family: inherit; font-size: 11px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.video-crop-actions button[aria-pressed="true"] { border-color: #78d2e8; color: #eafbff; background: #225368; }
.video-crop-actions button:last-child { border-color: #73cce5; color: #09202a; background: #8ad8ec; }
.video-crop-actions button:hover { filter: brightness(1.12); }
.video-crop-actions button:disabled { opacity: .5; cursor: not-allowed; filter: none; }

@media (max-width: 580px) {
  .video-crop-stage { height: min(40vh, 300px); min-height: 160px; margin-inline: 10px; }
  .video-crop-header { padding-inline: 10px; }
  .video-crop-body { padding-inline: 10px; }
  .video-crop-playback { gap: 4px; }
  .video-crop-playback span { min-width: 40px; font-size: 10px; }
  .video-crop-guidance { font-size: 10px; }
}

@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  .video-crop-dialog[open] {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    width: min(900px, calc(100vw - 16px));
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    overflow: hidden;
  }
  .video-crop-header { grid-column: 1 / -1; min-height: 44px; padding: 6px 12px; border-bottom: 1px solid #293844; }
  .video-crop-header > button { width: 27px; height: 27px; flex-basis: 27px; }
  .video-crop-stage { grid-column: 1; grid-row: 2; height: auto; min-height: 0; margin: 9px 5px 9px 10px; }
  html[dir="rtl"] .video-crop-stage { margin: 9px 10px 9px 5px; }
  .video-crop-body { grid-column: 2; grid-row: 2; min-height: 0; padding: 9px 10px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #456072 transparent; }
  .video-crop-guidance { margin-bottom: 8px; }
  .video-crop-toolbar { margin-top: 8px; padding-top: 8px; }
}
