/* The Studio shell switches to this layout only on compact or touch screens. */
.editor-mobile-only { display: none !important; }

#mobile-studio-tip { display: none; }
.studio-mobile body:not(.portal-player):has(#create-screen.active, #studio-screen.active, #editor-screen.active) #mobile-studio-tip:not([hidden]) {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  max-width: 500px;
  margin-inline: auto;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  background: #111925;
  color: #e0eaf5;
  border: 1px solid #385165;
  border-radius: 14px;
  box-shadow: 0 12px 28px #03081199;
}
#mobile-studio-tip > div { flex: 1 1 200px; }
#mobile-studio-tip strong { display: block; font-size: 15px; line-height: 1.3; }
#mobile-studio-tip p { margin: 5px 0 0; color: #aabed0; font-size: 13px; line-height: 1.45; }
#mobile-studio-tip button {
  margin-left: auto;
  min-height: 44px;
  padding: 0 14px;
  color: #8fdef4;
  background: #162936;
  border: 1px solid #385f75;
  border-radius: 9px;
}
#mobile-studio-tip button:focus-visible { outline: 2px solid #8fdef4; outline-offset: 2px; }

.studio-mobile body:not(.portal-player):has(#studio-screen.active) {
  overflow: visible;
}

.studio-mobile body:has(#studio-screen.active, #editor-screen.active) .topbar {
  position: static;
  min-height: 0;
  height: auto;
  padding: 8px 10px;
  gap: 6px;
  flex-wrap: wrap;
}
.studio-mobile body:has(#studio-screen.active, #editor-screen.active) .topbar .brand { min-width: 0; gap: 8px; }
.studio-mobile body:has(#studio-screen.active, #editor-screen.active) .topbar .brand small { display: none; }
.studio-mobile body:has(#studio-screen.active, #editor-screen.active) .topbar .topbar-account { margin-left: auto; }
.studio-mobile body:has(#studio-screen.active, #editor-screen.active) .topbar .topbar-account > .nav-link {
  min-height: 40px;
  padding-inline: 9px;
  font-size: 12px;
}
.studio-mobile body:has(#studio-screen.active, #editor-screen.active) .topbar nav {
  order: 3;
  width: 100%;
  margin: 0;
  gap: 4px;
}
.studio-mobile body:has(#studio-screen.active, #editor-screen.active) .topbar nav .nav-link {
  min-height: 40px;
  padding: 4px 6px;
  flex: 1 1 0;
  white-space: normal;
}
.studio-mobile .topbar .studio-global-actions { order: 4; margin: 0; }
.studio-mobile .topbar .studio-global-actions > button { min-height: 38px !important; }

.studio-mobile body:not(.portal-player) #studio-screen.active {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  padding: 8px 10px 20px;
  grid-template-rows: auto auto !important;
  overflow: visible !important;
}
.studio-mobile #studio-screen .studio-workspace-shell {
  display: block;
  height: auto !important;
}
.studio-mobile body:not(.portal-player) #studio-screen .studio-main-stage {
  display: flex !important;
  flex-direction: column;
  height: auto !important;
  gap: 8px !important;
  overflow: visible !important;
}
.studio-mobile #studio-screen .studio-main-stage > .studio-main-label { display: none !important; }
.studio-mobile body:not(.portal-player) #studio-screen .studio-main-stage > .video-frame {
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  align-self: center;
}
.studio-mobile #studio-screen .studio-main-stage > .video-frame:fullscreen {
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  aspect-ratio: auto;
}
.studio-mobile #studio-screen .studio-main-stage > .studio-player {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  height: auto !important;
  min-height: 0 !important;
  gap: 8px 16px !important;
  padding: 7px 8px !important;
  overflow: visible !important;
}
.studio-mobile #studio-screen .studio-main-stage > .studio-player .studio-play-controls { gap: 8px; }
.studio-mobile #studio-screen .studio-main-stage > .studio-player .play { width: 44px !important; }
.studio-mobile #studio-screen .studio-main-stage > .studio-player :is(.play, .vocal-preview-toggle, .pitch-control, #open-player, #player-volume) {
  box-sizing: border-box;
  height: 44px !important;
  min-height: 44px;
}
.studio-mobile #studio-screen .studio-main-stage > .studio-player .player-now { display: none !important; }
.studio-mobile #studio-screen .studio-main-stage > .studio-player .player-actions {
  max-width: 100%;
  margin-inline-start: auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.studio-mobile #studio-screen .studio-main-stage > .studio-player .player-actions > * { flex-shrink: 0; }
.studio-mobile #studio-screen .studio-main-stage .player-actions #open-player {
  padding-inline: 6px;
  white-space: nowrap;
}
.studio-mobile #studio-screen .studio-main-stage .player-actions #player-volume { width: 44px; }
.studio-mobile #studio-screen .studio-player .pitch-control {
  gap: 5px;
  padding: 0 5px;
}
.studio-mobile #studio-screen .studio-player .pitch-control > span { display: inline; padding: 0 2px; }
.studio-mobile #studio-screen .studio-player .pitch-control button {
  min-height: 34px;
  width: 26px !important;
  font-size: 14px !important;
}
.studio-mobile #studio-screen .studio-player .pitch-control #transpose-reset {
  min-width: 29px !important;
  padding: 0 3px !important;
}
.studio-mobile #studio-screen .studio-main-stage > .studio-player .player-progress {
  order: 1;
  flex: 1 0 100%;
  min-width: 0;
}
.studio-mobile #studio-screen .studio-main-stage .player-progress input.timeline-progress {
  height: 22px !important;
  min-height: 22px;
  flex-shrink: 0;
}
.studio-mobile body:not(.portal-player) #studio-screen .studio-main-stage .player-actions #open-player {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 350px) {
  .studio-mobile #studio-screen .studio-main-stage > .studio-player .player-actions { gap: 6px; }
}
.studio-mobile #studio-screen .studio-workspace-head {
  height: auto !important;
  padding-block: 5px !important;
}
.studio-mobile #studio-screen .studio-project-identity { max-width: none; }
.studio-mobile #studio-screen .studio-project-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}
.studio-mobile #studio-screen .studio-project-line :is(h1, #project-meta) {
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.studio-mobile #studio-screen .studio-project-line h1 {
  font-size: 18px !important;
  line-height: 1.2;
}
.studio-mobile #studio-screen .studio-project-line #project-meta::before { content: none; }
.studio-mobile #studio-screen .studio-main-stage > .studio-tool-rail {
  display: flex;
  flex-direction: row;
  min-width: 0;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.studio-mobile #studio-screen .studio-main-stage > .studio-tool-rail button { flex: 1 0 72px; min-height: 54px !important; }
.studio-mobile #studio-screen .studio-main-stage > .studio-tool-rail button i { height: 25px !important; }
.studio-mobile #studio-screen .studio-main-stage > .studio-tool-rail button span { font-size: 11px !important; }
.studio-mobile #studio-screen .studio-main-stage > .studio-context-sidebar {
  display: none;
  width: 100%;
  min-width: 0;
  height: auto !important;
  max-height: none !important;
  overflow: visible;
}
.studio-mobile #studio-screen .studio-main-stage.mobile-tool-open > .studio-context-sidebar { display: block; }
.studio-mobile #studio-screen .studio-context-sidebar .studio-tool-panel {
  height: auto;
  max-height: none;
  overflow: visible;
}
.studio-mobile #studio-screen .studio-main-stage > .studio-word-timeline { height: auto !important; min-height: 0 !important; }
.studio-mobile #studio-screen .studio-main-stage .studio-timeline-head {
  display: flex !important;
  flex-wrap: wrap;
  height: auto !important;
  min-height: 0;
  gap: 5px 8px;
}
.studio-mobile #studio-screen .studio-main-stage .studio-timeline-edit { min-height: 38px; }
.studio-mobile #studio-screen .studio-main-stage .studio-timeline-zoom { order: 3; width: 100%; justify-content: flex-start; }
.studio-mobile #studio-screen .studio-main-stage .studio-timeline-scroll { overscroll-behavior-x: contain; }
.studio-mobile body.portal-player #studio-screen { height: 100dvh !important; }
.studio-mobile body.portal-player #studio-screen .studio-main-stage { grid-template-rows: minmax(0, 1fr) auto !important; }
.studio-mobile body.portal-player #studio-screen .studio-main-stage > .studio-player { grid-row: 2 !important; }

@media (orientation: landscape) {
  .studio-mobile body:not(.portal-player) #studio-screen .studio-main-stage > .video-frame {
    max-width: min(100%, 112dvh);
  }
}

@media (min-width: 700px) and (orientation: landscape) {
  .studio-mobile body:has(#studio-screen.active, #editor-screen.active) .topbar { flex-wrap: nowrap; }
  .studio-mobile body:has(#studio-screen.active, #editor-screen.active) .topbar nav { order: 0; width: auto; flex: 1; }
  .studio-mobile .topbar .studio-global-actions { order: 0; }
}

.studio-mobile #editor-screen { min-width: 0; padding-inline: 10px; }
.studio-mobile #editor-screen .editor-grid { grid-template-columns: minmax(0, 1fr) !important; }
.studio-mobile #editor-screen .editor-grid > .panel,
.studio-mobile #editor-screen .timeline-workbench { min-width: 0; }
.studio-mobile #editor-screen .editor-grid > .panel:first-child .editor-line-list {
  height: clamp(210px, 41dvh, 410px);
  min-height: 0;
}
.studio-mobile #editor-screen .editor-line-item {
  height: auto !important;
  min-height: 48px !important;
}
.studio-mobile #editor-screen .editor-detail-panel #editor-word-list {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0;
  overflow: visible !important;
}
.studio-mobile #editor-screen .editor-word-table-head,
.studio-mobile #editor-screen .editor-word > strong { display: none !important; }
.studio-mobile #editor-screen .editor-word {
  height: auto !important;
  min-height: 0 !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
}
.studio-mobile #editor-screen .editor-word .editor-touch-word {
  display: block !important;
  grid-column: 1 / -1;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: inherit;
  background: #1a2532;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 6px 8px;
}
.studio-mobile #editor-screen :is(.editor-touch-word, #editor-multi-select)[aria-pressed="true"] {
  border-color: #62cfff !important;
  background: #163342;
}
.studio-mobile #editor-screen .editor-word-field { min-width: 0; }
.studio-mobile #editor-screen .editor-word-field:last-child { grid-column: 1 / -1; }
.studio-mobile #editor-screen .editor-word-caption { display: block !important; color: #aebdca; font-size: 12px; }
.studio-mobile #editor-screen .editor-word .editor-word-field :is(input, select) {
  width: 100%;
  height: 42px !important;
  font-size: 16px !important;
}
.studio-mobile #editor-screen .editor-line-list :is(input, textarea) { font-size: 16px !important; }
.studio-mobile #editor-screen .editor-word-field .fvoice-select-trigger { width: 100%; min-width: 0; }
.studio-mobile #editor-screen .editor-desktop-help { display: none; }
.studio-mobile #editor-screen .editor-help .editor-mobile-only { display: inline !important; }
.studio-mobile #editor-screen #editor-mobile-word-tools {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.studio-mobile #editor-screen #editor-mobile-word-tools button {
  min-height: 42px;
  padding: 6px 9px;
  border: 1px solid #3e5367;
  border-radius: 8px;
  background: #14202b;
  color: #dce8f3;
  font: inherit;
}
.studio-mobile #editor-screen #editor-mobile-word-tools button:disabled { opacity: .5; }
.studio-mobile #editor-screen #editor-multi-select { display: inline-flex !important; align-items: center; }
.studio-mobile #editor-screen .timeline-edit-controls > button { min-height: 42px !important; }
.studio-mobile #editor-screen .editor-timeline-scroll { overscroll-behavior-x: contain; }
.studio-mobile #editor-screen :is(.editor-timeline-scroll, .editor-timeline-canvas, .timeline-word) { touch-action: pan-x pan-y; }
.studio-mobile #editor-screen .timeline-resize-handle { display: none; }
.studio-mobile #editor-screen .editor-video-preview {
  max-width: calc(100% - 24px);
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 24px);
  resize: none;
  grid-template-rows: 44px auto;
}
.studio-mobile #editor-screen .editor-video-preview .video-frame {
  height: auto;
  aspect-ratio: 16 / 9;
}
.studio-mobile #editor-screen .editor-line-list { grid-auto-rows: max-content; }
.studio-mobile #editor-screen .editor-line-item {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 7px;
  overflow-wrap: anywhere;
}
.studio-mobile #editor-screen .editor-line-item.editing { grid-template-columns: 42px minmax(0, 1fr); }
.studio-mobile #editor-screen .editor-line-item.editing .line-inline-actions { grid-column: 2; }

@media (max-width: 600px) {
  #create-screen .create-workspace {
    padding-inline: 9px;
  }
  #create-screen .create-block {
    min-width: 0;
    padding: 20px 0 18px;
  }
  #create-screen .create-block-head {
    margin-inline: 10px;
    margin-bottom: 14px;
  }
  #create-screen .create-processing-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  #create-screen .create-processing-fields > div {
    min-width: 0;
  }
  #create-screen .create-lyrics-field .lyrics-audio-check,
  #create-screen .create-lyrics-field .lyrics-review-reminder {
    margin-inline: 9px;
  }
  #create-screen .create-action {
    margin-inline: 0;
    padding-inline: 12px;
  }
  #create-screen .create-action .primary {
    min-width: 0;
  }
  #create-screen #recognizer-current,
  #create-screen .recognizer-current:has(#recognizer-change[hidden]),
  #create-screen .create-field-label {
    display: none;
  }
  #create-screen .create-dropzone {
    min-height: 0;
    padding: 12px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    border-radius: 16px;
  }
  #create-screen .create-dropzone .upload-orb {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 23px;
  }
  #create-screen .create-dropzone .upload-copy {
    gap: 4px;
    overflow-wrap: anywhere;
  }
  #create-screen .create-dropzone .upload-copy strong {
    font-size: 16px;
    line-height: 1.2;
  }
  #create-screen .create-dropzone .upload-copy small {
    line-height: 1.3;
  }
  #create-screen .create-dropzone > b {
    grid-column: 1 / -1;
    justify-self: stretch;
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 6px 12px;
    text-align: center;
  }
}
