/* Studio focus / fullscreen layout (route: /studio/) */

html.motionlinq-studio-focus,
html.motionlinq-studio-focus body {
  height: 100%;
  overflow: hidden;
}

html.motionlinq-studio-focus #ml-global-footer {
  display: none !important;
}

html.motionlinq-studio-focus .app-shell {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

html.motionlinq-studio-focus .app-shell__main {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html.motionlinq-studio-focus .app-shell__main > .mobile-topbar {
  display: none !important;
}

html.motionlinq-studio-focus .app-shell__main > .app {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.5rem 1rem 0.75rem;
  box-sizing: border-box;
  overflow: hidden;
}

html.motionlinq-studio-focus #page-studio.is-active {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

html.motionlinq-studio-focus #page-studio .studio-focus-sticky {
  position: sticky;
  top: 0;
  z-index: 25;
  margin: 0 -1rem 0.5rem;
  padding: 0.35rem 1rem 0.5rem;
  background: color-mix(in srgb, var(--bg, #0b0f1a) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

html.motionlinq-studio-focus #page-studio .studio-focus-chrome__row-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

html.motionlinq-studio-focus #page-studio .studio-focus-bar__menu {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm, 8px);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

html.motionlinq-studio-focus #page-studio .studio-focus-bar__menu:hover {
  background: rgba(255, 255, 255, 0.1);
}

html.motionlinq-studio-focus #page-studio .studio-focus-bar__menu svg {
  flex-shrink: 0;
}

html.motionlinq-studio-focus #page-studio .studio-focus-bar__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

html.motionlinq-studio-focus #studio-app-root {
  flex: 1 1 0;
  min-height: 0;
  /* Skrollytan för hela Studio-vyn: dashboarden (utan egen höjd) växer och
     skrollar här; editorn sätter height:100% och skrollar internt. */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--brand-purple) 45%, transparent) rgba(10, 8, 16, 0.92);
}

html.motionlinq-studio-focus #studio-app-root > * {
  /* basis auto: dashboarden får innehållshöjd (→ skroll i föräldern),
     editorn (height:100%) fyller exakt utan yttre skroll. */
  flex: 1 0 auto;
  min-height: 0;
}

html.motionlinq-studio-focus #studio-app-root::-webkit-scrollbar {
  width: 8px;
}

html.motionlinq-studio-focus #studio-app-root::-webkit-scrollbar-track {
  background: rgba(10, 8, 16, 0.92);
}

html.motionlinq-studio-focus #studio-app-root::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand-purple) 44%, rgba(255, 255, 255, 0.06));
  border-radius: 999px;
  border: 2px solid rgba(10, 8, 16, 0.92);
}

html.motionlinq-studio-focus .app-shell.studio-sidebar-collapsed .app-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(288px, 88vw);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  flex-shrink: 0;
  transform: translateX(-100%);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: none;
}

html.motionlinq-studio-focus .app-shell.sidebar-open .app-sidebar {
  transform: translateX(0);
  box-shadow: 16px 0 48px rgba(0, 0, 0, 0.5);
}

html.motionlinq-studio-focus .app-shell.studio-sidebar-collapsed .app-sidebar__close {
  display: inline-flex;
}

@media (min-width: 960px) {
  html.motionlinq-studio-focus .app-shell.studio-sidebar-collapsed .app-sidebar {
    width: var(--sidebar-width, 262px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.motionlinq-studio-focus .app-shell.studio-sidebar-collapsed .app-sidebar,
  html.motionlinq-studio-focus .sidebar-backdrop {
    transition: none;
  }
}

#page-studio .studio-focus-sticky {
  display: none;
}

html.motionlinq-studio-focus #page-studio .studio-focus-sticky {
  display: block;
}

html.motionlinq-studio-focus .app-shell.sidebar-open .sidebar-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}
