/* ============================================================
   V-FORGE v9.1.2 — EDITOR UX & INTERACTIVE TIMELINE
   Mobile-first custom playback, full-frame preview, trim/split UI.
   ============================================================ */

#page-video-workspace {
  --v91-accent: #c6ff63;
  --v91-purple: #a974ff;
  --v91-cyan: #6bd8ff;
  --v91-danger: #ff626f;
  --v91-surface: #111116;
  --v91-surface-2: #191920;
  --v91-line: rgba(255,255,255,.09);
  --v91-text: #f7f7fb;
  --v91-muted: #94949f;
}

/* Editor proportions: preview remains dominant while timeline is usable. */
#page-video-workspace .v82-editor-shell {
  grid-template-rows: minmax(190px, 43%) clamp(154px, 22vh, 184px) minmax(0, 1fr) !important;
}

#page-video-workspace .v82-preview-stage {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  gap: 6px !important;
  padding: 7px 8px 5px !important;
}

#page-video-workspace .workspace-video-frame {
  position: relative !important;
  align-self: center;
  justify-self: center;
  overflow: hidden !important;
  background:
    linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.025) 75%),
    linear-gradient(45deg, rgba(255,255,255,.025) 25%, #050507 25%, #050507 75%, rgba(255,255,255,.025) 75%);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}

#page-video-workspace .workspace-video-frame video {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  background: #000;
  cursor: pointer;
}

#page-video-workspace .workspace-video-frame.v91-fill-mode video {
  object-fit: cover !important;
}

#page-video-workspace .workspace-video-frame:not(.v91-fill-mode) video {
  object-fit: contain !important;
}

/* Native controls are replaced with controls designed for the editor. */
#page-video-workspace #workspace-video::-webkit-media-controls {
  display: none !important;
}

.v91-preview-topbar {
  position: absolute;
  z-index: 12;
  top: 8px;
  right: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.v91-fit-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 12px;
  background: rgba(10,10,14,.72);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  pointer-events: auto;
}

.v91-fit-switch button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 54px;
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  color: rgba(255,255,255,.66);
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .02em;
}

.v91-fit-switch button .material-icons-round { font-size: 15px; }
.v91-fit-switch button.active {
  color: #15180c;
  background: linear-gradient(135deg, #d9ff89, var(--v91-accent));
  box-shadow: 0 5px 14px rgba(198,255,99,.22);
}

.v91-preview-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 27px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px;
  color: rgba(255,255,255,.82);
  background: rgba(10,10,14,.68);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .1em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.v91-preview-badge .material-icons-round { color: var(--v91-accent); font-size: 13px; }

.v91-preview-controls {
  position: absolute;
  z-index: 13;
  right: 8px;
  bottom: 8px;
  left: 8px;
  display: grid;
  grid-template-columns: 34px auto minmax(40px, 1fr) auto 32px;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 43px;
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: rgba(7,7,10,.72);
  box-shadow: 0 10px 30px rgba(0,0,0,.32);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  opacity: 0;
  transform: translateY(7px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

body.v91-editor-ready #page-video-workspace .v91-preview-controls {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.v91-play-button,
.v91-icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  color: white;
  background: rgba(255,255,255,.08);
}
.v91-play-button {
  color: #15180c;
  background: var(--v91-accent);
}
.v91-play-button .material-icons-round { font-size: 20px; }
.v91-icon-button .material-icons-round { font-size: 18px; }
.v91-play-button:active,.v91-icon-button:active { transform: scale(.92); }

.v91-time-label {
  color: rgba(255,255,255,.84);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#v91-seek-range {
  width: 100%;
  min-width: 0;
  height: 24px;
  accent-color: var(--v91-accent);
}

/* Existing metadata remains readable but no longer covers the frame. */
#page-video-workspace .v82-preview-meta {
  position: relative !important;
  inset: auto !important;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  width: 100%;
  min-width: 0;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#page-video-workspace .v82-preview-meta > button {
  min-width: 0;
  min-height: 32px !important;
  padding: 4px 8px !important;
  border-radius: 10px !important;
}
#page-video-workspace .v82-preview-meta > button strong {
  max-width: min(42vw, 210px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#page-video-workspace .v82-preview-meta > div { min-height: 32px !important; }
#page-video-workspace .v82-preview-meta small { font-size: 6px !important; }
#page-video-workspace .v82-preview-meta strong { font-size: 8px !important; }

/* Interactive timeline */
#page-video-workspace .v82-timeline {
  position: relative;
  display: grid !important;
  grid-template-rows: 38px minmax(0, 1fr);
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-top: 1px solid rgba(255,255,255,.075);
  border-bottom: 1px solid rgba(255,255,255,.075);
  background: #08080c !important;
  touch-action: pan-y;
}

.v91-timeline-header {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255,255,255,.065);
  background: #0d0d12;
}

.v91-history-controls,.v91-zoom-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}
.v91-history-controls button,.v91-zoom-controls button {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  color: var(--v91-text);
  background: rgba(255,255,255,.055);
}
.v91-history-controls button:disabled { opacity: .28; }
.v91-history-controls .material-icons-round,.v91-zoom-controls .material-icons-round { font-size: 16px; }
.v91-zoom-controls span {
  min-width: 34px;
  color: var(--v91-muted);
  font-size: 7px;
  font-weight: 800;
  text-align: center;
}

.v91-timeline-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.v91-timeline-title strong {
  color: var(--v91-text);
  font-size: 9px;
}
.v91-timeline-title small {
  overflow: hidden;
  color: var(--v91-muted);
  font-size: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v91-timeline-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  touch-action: pan-x;
}
.v91-timeline-viewport::-webkit-scrollbar { display: none; }

.v91-timeline-canvas {
  position: relative;
  display: grid;
  grid-template-rows: 20px 61px 30px;
  min-width: 100%;
  height: 100%;
  padding-top: 1px;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(255,255,255,.025) calc(100% - 1px));
  background-size: 22px 100%;
}

.v91-ruler {
  position: relative;
  height: 20px;
  border-bottom: 1px solid rgba(255,255,255,.055);
}
.v91-ruler > span {
  position: absolute;
  top: 0;
  height: 100%;
  color: rgba(255,255,255,.38);
  font-size: 6px;
  transform: translateX(-1px);
}
.v91-ruler > span i {
  display: block;
  width: 1px;
  height: 5px;
  margin-bottom: 1px;
  background: rgba(255,255,255,.25);
}

.v91-clip-row {
  display: flex;
  align-items: center;
  min-width: max-content;
  height: 61px;
  padding: 5px 0;
}

.v91-clip {
  position: relative;
  flex: 0 0 auto;
  height: 51px;
  min-width: 52px;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  color: white;
  background: #22222a;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.22);
}
.v91-clip + .v91-clip { margin-left: 3px; }
.v91-clip.selected {
  z-index: 4;
  border-color: var(--v91-accent);
  box-shadow: 0 0 0 2px rgba(198,255,99,.22), 0 7px 20px rgba(0,0,0,.3);
}
.v91-clip-thumbs {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
  border-radius: inherit;
}
.v91-clip-thumbs img,.v91-thumb-placeholder {
  flex: 1 1 0;
  width: 0;
  min-width: 34px;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}
.v91-thumb-placeholder {
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.25);
  background: linear-gradient(135deg,#292936,#15151d);
}
.v91-thumb-placeholder .material-icons-round { font-size: 14px; }
.v91-clip-shade {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(0,0,0,.02), rgba(0,0,0,.72));
  pointer-events: none;
}
.v91-clip-copy {
  position: absolute;
  right: 7px;
  bottom: 4px;
  left: 7px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 5px;
  pointer-events: none;
}
.v91-clip-copy strong {
  overflow: hidden;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v91-clip-copy small {
  flex: 0 0 auto;
  color: rgba(255,255,255,.72);
  font-size: 6px;
  font-variant-numeric: tabular-nums;
}

.v91-trim-handle {
  position: absolute;
  z-index: 8;
  top: -3px;
  bottom: -3px;
  width: 19px;
  border-radius: 7px;
  background: var(--v91-accent);
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
  touch-action: none;
}
.v91-trim-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 16px;
  border-right: 1px solid rgba(15,18,8,.6);
  border-left: 1px solid rgba(15,18,8,.6);
  transform: translate(-50%,-50%);
}
.v91-trim-handle.left { left: -7px; }
.v91-trim-handle.right { right: -7px; }

.v91-audio-row {
  display: grid;
  grid-template-columns: 24px minmax(0,1fr);
  align-items: center;
  height: 27px;
  margin-top: 1px;
  border-top: 1px solid rgba(255,255,255,.045);
  color: var(--v91-cyan);
  background: rgba(107,216,255,.025);
}
.v91-audio-row > .material-icons-round { padding-left: 5px; font-size: 13px; }
.v91-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  overflow: hidden;
}
.v91-waveform i {
  width: 2px;
  min-height: 3px;
  border-radius: 99px;
  background: rgba(107,216,255,.58);
}

.v91-playhead {
  position: absolute;
  z-index: 12;
  top: 16px;
  bottom: 0;
  width: 17px;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translateX(-8px);
  touch-action: none;
}
.v91-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 8px;
  width: 1.5px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,.75);
}
.v91-playhead span {
  position: absolute;
  top: -2px;
  left: 3px;
  width: 11px;
  height: 9px;
  border-radius: 3px 3px 5px 5px;
  background: #fff;
}

/* Clip actions inside Edit sheet */
.v91-quick-tools {
  display: grid;
  gap: 9px;
  margin: 0 0 12px;
  padding: 11px;
  border: 1px solid rgba(198,255,99,.12);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(198,255,99,.055), rgba(169,116,255,.035));
}
.v91-quick-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.v91-quick-title span { display: flex; flex-direction: column; }
.v91-quick-title small {
  color: var(--v91-accent);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: .13em;
}
.v91-quick-title strong { margin-top: 2px; color: var(--v91-text); font-size: 11px; }
.v91-quick-title em { color: var(--v91-muted); font-size: 7px; font-style: normal; font-variant-numeric: tabular-nums; }
.v91-quick-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 6px;
}
.v91-quick-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 50px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 12px;
  color: var(--v91-text);
  background: rgba(255,255,255,.045);
}
.v91-quick-grid button .material-icons-round { font-size: 18px; }
.v91-quick-grid button small { font-size: 7px; }
.v91-quick-grid button.danger { color: #ff8b94; }
.v91-quick-grid button:disabled { opacity: .32; }
.v91-quick-grid button:active { transform: scale(.94); }
.v91-trim-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--v91-muted);
  font-size: 7px;
  line-height: 1.35;
}
.v91-trim-hint .material-icons-round { color: var(--v91-accent); font-size: 14px; }

@media (max-height: 700px) and (orientation: portrait) {
  #page-video-workspace .v82-editor-shell {
    grid-template-rows: minmax(174px, 41%) 148px minmax(0,1fr) !important;
  }
  .v91-preview-controls { min-height: 38px; }
  #page-video-workspace .v82-preview-meta > div { display: none !important; }
  #page-video-workspace .v82-preview-meta { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 350px) {
  .v91-preview-controls {
    grid-template-columns: 32px auto minmax(30px,1fr) auto;
  }
  .v91-preview-controls .v91-icon-button { display: none; }
  .v91-preview-badge { display: none; }
  .v91-fit-switch button { min-width: 48px; padding: 0 7px; }
  .v91-quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (orientation: landscape) and (max-height: 520px) {
  #page-video-workspace .v82-editor-shell {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr) !important;
    grid-template-rows: minmax(0, 1fr) 132px !important;
  }
  #page-video-workspace .v82-preview-stage { grid-column: 1; grid-row: 1; }
  #page-video-workspace .v82-timeline { grid-column: 1; grid-row: 2; }
  #page-video-workspace .v82-tool-sheet { grid-column: 2; grid-row: 1 / span 2; }
  .v91-timeline-canvas { grid-template-rows: 18px 49px 25px; }
  .v91-clip-row { height: 49px; }
  .v91-clip { height: 41px; }
}

@media (prefers-reduced-motion: reduce) {
  .v91-preview-controls,.v91-fit-switch button,.v91-timeline-viewport { transition: none !important; scroll-behavior: auto !important; }
}

.v91-export-notice {
  display: grid;
  grid-template-columns: 32px minmax(0,1fr);
  align-items: start;
  gap: 9px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid rgba(107,216,255,.14);
  border-radius: 13px;
  color: var(--v91-text);
  background: rgba(107,216,255,.055);
}
.v91-export-notice > .material-icons-round {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--v91-cyan);
  background: rgba(107,216,255,.09);
}
.v91-export-notice > span { display: flex; flex-direction: column; min-width: 0; }
.v91-export-notice strong { font-size: 9px; }
.v91-export-notice small { margin-top: 3px; color: var(--v91-muted); font-size: 7px; line-height: 1.45; }

/* ============================================================
   V-FORGE v9.1.1 — NAVIGATION + IMMERSIVE EDITOR HOTFIX
   Prevents the global app navigation from leaking into the editor
   and makes the fullscreen button expand the entire editor workspace.
   ============================================================ */

/* A translated navigation could remain partly visible in desktop mode.
   Hide the wrapper completely whenever the editor is active. */
body.v911-editor-open #bottom-navigation,
body.vf-editor-open #bottom-navigation,
body.hide-nav #page-video-workspace.active ~ #bottom-navigation,
#page-video-workspace.active ~ #bottom-navigation,
#bottom-navigation[hidden] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: none !important;
}

/* True immersive editor: the fullscreen target is the whole editor page,
   not only the video preview. Timeline, tools, header, and dock remain usable. */
#page-video-workspace:fullscreen,
#page-video-workspace:-webkit-full-screen,
#page-video-workspace.v911-immersive {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: #050507 !important;
}

#page-video-workspace:fullscreen .v82-editor-header,
#page-video-workspace:-webkit-full-screen .v82-editor-header,
#page-video-workspace.v911-immersive .v82-editor-header {
  min-height: calc(58px + env(safe-area-inset-top)) !important;
  padding-top: max(7px, env(safe-area-inset-top)) !important;
}

#page-video-workspace:fullscreen,
#page-video-workspace:-webkit-full-screen,
#page-video-workspace.v911-immersive {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

#page-video-workspace:fullscreen .v82-editor-shell,
#page-video-workspace:-webkit-full-screen .v82-editor-shell,
#page-video-workspace.v911-immersive .v82-editor-shell {
  width: 100% !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  align-self: stretch !important;
}

#page-video-workspace:fullscreen .v82-editor-dock,
#page-video-workspace:-webkit-full-screen .v82-editor-dock,
#page-video-workspace.v911-immersive .v82-editor-dock {
  bottom: max(6px, env(safe-area-inset-bottom)) !important;
}

#page-video-workspace:fullscreen .v91-icon-button,
#page-video-workspace:-webkit-full-screen .v91-icon-button,
#page-video-workspace.v911-immersive .v91-icon-button {
  color: #15180c;
  background: var(--v91-accent);
}

/* Desktop mode keeps the editor dock compact instead of stretching like
   the mobile navigation. */
@media (min-width: 700px) {
  #page-video-workspace .v82-editor-dock {
    right: 50% !important;
    left: auto !important;
    width: min(620px, calc(100vw - 32px)) !important;
    max-width: min(620px, calc(100vw - 32px)) !important;
    transform: translateX(50%) !important;
  }
}

/* Fullscreen portrait uses the available height without browser chrome. */
@media (orientation: portrait) {
  #page-video-workspace:fullscreen .v82-editor-shell,
  #page-video-workspace:-webkit-full-screen .v82-editor-shell,
  #page-video-workspace.v911-immersive .v82-editor-shell {
    grid-template-rows: minmax(190px, 44%) clamp(148px, 21vh, 184px) minmax(0, 1fr) !important;
  }
}

/* Fullscreen landscape uses the same two-column editor composition as
   modern mobile editors. */
@media (orientation: landscape) and (max-height: 620px) {
  #page-video-workspace:fullscreen .v82-editor-shell,
  #page-video-workspace:-webkit-full-screen .v82-editor-shell,
  #page-video-workspace.v911-immersive .v82-editor-shell {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr) !important;
    grid-template-rows: minmax(0, 1fr) 132px !important;
  }

  #page-video-workspace:fullscreen .v82-preview-stage,
  #page-video-workspace:-webkit-full-screen .v82-preview-stage,
  #page-video-workspace.v911-immersive .v82-preview-stage {
    grid-column: 1;
    grid-row: 1;
  }

  #page-video-workspace:fullscreen .v82-timeline,
  #page-video-workspace:-webkit-full-screen .v82-timeline,
  #page-video-workspace.v911-immersive .v82-timeline {
    grid-column: 1;
    grid-row: 2;
  }

  #page-video-workspace:fullscreen .v82-tool-sheet,
  #page-video-workspace:-webkit-full-screen .v82-tool-sheet,
  #page-video-workspace.v911-immersive .v82-tool-sheet {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}



/* ============================================================
   V-FORGE v9.1.2 — RESPONSIVE CANVAS + DESKTOP WORKSPACE
   Keeps portrait sources readable on phones, prevents editor controls
   from overwhelming narrow canvases, and replaces the stretched desktop
   bottom bar with a compact navigation rail.
   ============================================================ */

/* V9.1.0 reduced the preview back to 43%. Restore preview priority so
   portrait videos remain useful while the timeline stays reachable. */
#page-video-workspace .v82-editor-shell {
  grid-template-rows: minmax(300px, 56%) clamp(148px, 20vh, 184px) minmax(0, 1fr) !important;
}

/* Reassert the ratio-aware dimensions calculated by v9.0.2. These rules
   intentionally override older 100% x 100% editor declarations. */
#page-video-workspace .workspace-video-frame {
  width: var(--v902-canvas-width, 100%) !important;
  height: var(--v902-canvas-height, 100%) !important;
  max-width: calc(100% - 2px) !important;
  max-height: 100% !important;
  aspect-ratio: var(--v902-preview-ratio, auto) !important;
}

/* Portrait sources can be much narrower than 9:16. Keep controls compact
   instead of allowing Fit/Play buttons to cover the actual picture. */
@media (max-width: 899px) {
  #page-video-workspace .workspace-video-frame[data-preview-orientation="portrait"] .v91-preview-topbar {
    right: 5px;
    left: 5px;
    justify-content: center;
  }

  #page-video-workspace .workspace-video-frame[data-preview-orientation="portrait"] .v91-preview-badge {
    display: none !important;
  }

  #page-video-workspace .workspace-video-frame[data-preview-orientation="portrait"] .v91-fit-switch {
    gap: 2px;
    padding: 2px;
    border-radius: 10px;
  }

  #page-video-workspace .workspace-video-frame[data-preview-orientation="portrait"] .v91-fit-switch button {
    min-width: 32px;
    width: 32px;
    min-height: 27px;
    padding: 0;
    font-size: 0;
    border-radius: 8px;
  }

  #page-video-workspace .workspace-video-frame[data-preview-orientation="portrait"] .v91-fit-switch button .material-icons-round {
    font-size: 15px;
  }

  #page-video-workspace .workspace-video-frame[data-preview-orientation="portrait"] .v91-preview-controls {
    right: 5px;
    bottom: 5px;
    left: 5px;
    grid-template-columns: 30px minmax(38px, 1fr) 30px;
    gap: 4px;
    min-height: 38px;
    padding: 4px 5px;
    border-radius: 12px;
  }

  #page-video-workspace .workspace-video-frame[data-preview-orientation="portrait"] .v91-preview-controls .v91-time-label {
    display: none !important;
  }

  #page-video-workspace .workspace-video-frame[data-preview-orientation="portrait"] .v91-play-button,
  #page-video-workspace .workspace-video-frame[data-preview-orientation="portrait"] .v91-icon-button {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  #page-video-workspace .workspace-video-frame[data-preview-orientation="portrait"] #v91-seek-range {
    height: 20px;
  }
}

/* Short phones need a balanced compromise: preview remains dominant,
   timeline remains touchable, and the active tool sheet can still scroll. */
@media (max-width: 899px) and (max-height: 740px) {
  #page-video-workspace .v82-editor-shell {
    grid-template-rows: minmax(250px, 50%) 140px minmax(0, 1fr) !important;
  }
}

/* Desktop editor: preview + timeline on the left, inspector on the right.
   This prevents the preview from consuming the whole page in desktop mode. */
@media (min-width: 900px) and (min-height: 560px) {
  #page-video-workspace .v82-editor-shell,
  #page-video-workspace:fullscreen .v82-editor-shell,
  #page-video-workspace:-webkit-full-screen .v82-editor-shell,
  #page-video-workspace.v911-immersive .v82-editor-shell {
    grid-template-columns: minmax(0, 1fr) clamp(320px, 31vw, 430px) !important;
    grid-template-rows: minmax(0, 1fr) clamp(170px, 23vh, 220px) !important;
    column-gap: 1px;
    background: #07070a;
  }

  #page-video-workspace .v82-preview-stage,
  #page-video-workspace:fullscreen .v82-preview-stage,
  #page-video-workspace:-webkit-full-screen .v82-preview-stage,
  #page-video-workspace.v911-immersive .v82-preview-stage {
    grid-column: 1 !important;
    grid-row: 1 !important;
    padding: 14px 18px 9px !important;
  }

  #page-video-workspace .v82-timeline,
  #page-video-workspace:fullscreen .v82-timeline,
  #page-video-workspace:-webkit-full-screen .v82-timeline,
  #page-video-workspace.v911-immersive .v82-timeline {
    grid-column: 1 !important;
    grid-row: 2 !important;
    min-height: 0 !important;
  }

  #page-video-workspace .v82-tool-sheet,
  #page-video-workspace:fullscreen .v82-tool-sheet,
  #page-video-workspace:-webkit-full-screen .v82-tool-sheet,
  #page-video-workspace.v911-immersive .v82-tool-sheet {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    padding: 15px 18px calc(84px + env(safe-area-inset-bottom)) !important;
    border-left: 1px solid rgba(255,255,255,.075) !important;
    background: #101015 !important;
  }

  #page-video-workspace .v82-tool-sheet > .v82-sheet-handle {
    display: none !important;
  }

  #page-video-workspace .workspace-video-frame {
    max-width: min(100%, 760px) !important;
    max-height: 100% !important;
  }

  #page-video-workspace .v82-preview-meta {
    max-width: 900px;
    margin-inline: auto !important;
  }

  #page-video-workspace .v82-editor-dock {
    right: 50% !important;
    left: auto !important;
    width: min(720px, calc(100vw - 36px)) !important;
    max-width: min(720px, calc(100vw - 36px)) !important;
    transform: translateX(50%) !important;
  }
}

/* Desktop navigation rail. The four destinations keep their order with
   the create button occupying the central spacer row. */
@media (min-width: 900px) {
  body:not(.hide-nav):not(.vf-editor-open):not(.v911-editor-open) #bottom-navigation.v82-bottom-nav-wrapper {
    position: fixed !important;
    z-index: 900 !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    left: 18px !important;
    display: block !important;
    width: 86px !important;
    height: auto !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-50%) !important;
    pointer-events: auto !important;
  }

  body:not(.hide-nav):not(.vf-editor-open):not(.v911-editor-open) #bottom-navigation .v82-bottom-nav {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(5, 64px) !important;
    gap: 5px !important;
    width: 86px !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 6px !important;
    border-radius: 27px !important;
    background: color-mix(in srgb, var(--v9-surface, #15151b) 94%, transparent) !important;
    box-shadow: 0 20px 54px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.08) !important;
  }

  #bottom-navigation .v82-bottom-nav .nav-item {
    width: 74px !important;
    height: 64px !important;
    min-height: 64px !important;
    border-radius: 20px !important;
  }

  #bottom-navigation .v82-bottom-nav .nav-item:hover {
    color: var(--v9-text, #fff) !important;
    background: rgba(255,255,255,.055) !important;
  }

  #bottom-navigation .v82-bottom-nav .nav-item.active {
    color: var(--v9-text, #fff) !important;
    background: linear-gradient(145deg, rgba(198,255,99,.15), rgba(169,116,255,.11)) !important;
    box-shadow: inset 0 0 0 1px rgba(198,255,99,.12) !important;
  }

  #bottom-navigation .v82-bottom-nav .nav-icon {
    font-size: 23px !important;
  }

  #bottom-navigation .v82-bottom-nav .nav-text {
    margin-top: 2px;
    font-size: 8px !important;
  }

  #bottom-navigation .v82-bottom-nav .nav-spacer {
    display: block !important;
    grid-row: 3 !important;
    width: 100%;
    height: 64px;
  }

  body:not(.hide-nav):not(.vf-editor-open):not(.v911-editor-open) #bottom-navigation .center-cta-wrapper {
    position: absolute !important;
    z-index: 4;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    width: 62px !important;
    height: 62px !important;
    transform: translate(-50%, -50%) !important;
  }

  #bottom-navigation .v82-center-cta {
    width: 62px !important;
    height: 62px !important;
    border-width: 5px !important;
    border-radius: 21px !important;
  }

  body:not(.hide-nav):not(.vf-editor-open):not(.v911-editor-open) #page-home.active,
  body:not(.hide-nav):not(.vf-editor-open):not(.v911-editor-open) #page-enhancer.active,
  body:not(.hide-nav):not(.vf-editor-open):not(.v911-editor-open) #page-search.active,
  body:not(.hide-nav):not(.vf-editor-open):not(.v911-editor-open) #page-profile.active {
    padding-left: 106px !important;
  }
}

html[data-theme="light"] #bottom-navigation .v82-bottom-nav {
  background: rgba(255,255,255,.92) !important;
  box-shadow: 0 20px 50px rgba(51,39,73,.16), inset 0 1px 0 #fff !important;
}

@media (min-width: 900px) and (min-height: 560px) {
  #page-video-workspace .v82-editor-dock,
  #page-video-workspace:fullscreen .v82-editor-dock,
  #page-video-workspace:-webkit-full-screen .v82-editor-dock,
  #page-video-workspace.v911-immersive .v82-editor-dock {
    right: 16px !important;
    left: 16px !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
  }
}
