/* PlumNet app shell — постоянная оболочка, контент в iframe */

html.plumnet-app-shell,
body.plumnet-app-shell {
  height: 100%;
  overflow: hidden;
}

body.plumnet-app-shell .layout {
  display: block;
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* Header на всю ширину экрана (как в base.css), вне колонки .main */
body.plumnet-app-shell .layout > .header.plumnet-shell-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
}

body.plumnet-app-shell .plumnet-shell-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100vh - var(--header-height));
  max-height: calc(100vh - var(--header-height));
  overflow: hidden;
  margin-left: 100px;
  margin-top: var(--header-height);
  width: calc(100% - 100px);
  padding-top: 0;
  box-sizing: border-box;
}

body.plumnet-app-shell .plumnet-call-dock-root {
  flex-shrink: 0;
  position: relative;
  z-index: 30;
}

@media (max-width: 900px) {
  body.plumnet-app-shell .plumnet-shell-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.plumnet-app-shell .sidebar {
    position: fixed;
    left: 0;
    width: 100px;
    z-index: 200;
    transform: translateX(-100%);
  }

  body.plumnet-app-shell .sidebar.active {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
  }

  body.plumnet-app-shell .sidebar:not(.active) .menu-rail-decor,
  body.plumnet-app-shell .sidebar:not(.active) .menu-rail-close {
    display: none !important;
  }
}

body.plumnet-app-shell .plumnet-content-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}

body.plumnet-app-shell .plumnet-content-frame.is-loading {
  opacity: 0.35;
  pointer-events: none;
}

/* Embed (iframe) — общая база */
html.plm-embed-root {
  height: 100%;
}

html.plm-embed-root body.plm-embed-body {
  margin: 0;
}

body.plm-embed-body .plm-embed-layout {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

body.plm-embed-body .plm-embed-main {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding-top: 0 !important;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body.plm-embed-body .plm-embed-content {
  display: flex;
  flex-direction: column;
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

/* split-страницы в iframe — фиксированная высота, без обрезки */
body.plm-embed-body.page-split-layout {
  height: 100%;
  overflow: hidden;
}

body.plm-embed-body.page-split-layout .plm-embed-main {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.plm-embed-body.page-split-layout .plm-embed-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 16px 16px;
  overflow: hidden;
}

body.plm-embed-body.page-split-layout .split-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

/* Профиль и настройки — прокрутка, контент не обрезается */
body.plm-embed-body.page-profile,
body.plm-embed-body.page-settings {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

html.plm-embed-root:has(body.page-profile),
html.plm-embed-root:has(body.page-settings) {
  height: auto;
  min-height: 100%;
}

body.plm-embed-body.page-profile .plm-embed-main,
body.plm-embed-body.page-settings .plm-embed-main {
  height: auto;
  min-height: 100%;
  overflow: visible;
}

body.plm-embed-body.page-profile .plm-embed-content,
body.plm-embed-body.page-settings .plm-embed-content {
  flex: 1 0 auto;
  min-height: auto;
  overflow: visible;
  padding: 16px;
}

body.plm-embed-body.page-profile .profile,
body.plm-embed-body.page-profile .container-fot,
body.plm-embed-body.page-profile .container-music,
body.plm-embed-body.page-profile .container-clip,
body.plm-embed-body.page-profile .profile-feed {
  width: 100%;
  max-width: 990px;
}

body.plm-embed-body.page-settings .settings-layout {
  flex: 1 1 auto;
}

body.plm-embed-body.page-profile .footer,
body.plm-embed-body.page-settings .footer {
  flex-shrink: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  margin-top: auto;
  padding: 0;
}

body.plm-embed-body.page-profile .footer .line2,
body.plm-embed-body.page-settings .footer .line2 {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  margin-top: 0;
  box-sizing: border-box;
}

/* moduls и прочие */
body.plm-embed-body.page-moduls {
  height: 100%;
  overflow-y: auto;
}

body.plm-embed-body.page-moduls .plm-embed-main {
  height: auto;
  min-height: 100%;
}

body.plm-embed-body.page-moduls .plm-embed-content {
  padding: 16px;
  flex: 1 0 auto;
  overflow: visible;
}
