/**
 * Упрощённый мобильный режим /task6/py/ — dock, бургер, lite chrome Python + turtle.
 * Общие стили dock и меню: kumir_online_mobile.css
 */

@media (max-width: 768px) {
  body.neuroege-task6-py-page #task-sidebar {
    width: 0;
    overflow: visible;
    pointer-events: none;
  }

  body.neuroege-task6-py-page #task-sidebar .task-sidebar__panel {
    display: none !important;
  }

  body.neuroege-task6-py-page .task-sidebar__toggle {
    display: none !important;
  }

  body.neuroege-task6-py-page .task-sidebar ~ .neuroege-hf-task-root,
  body.neuroege-task6-py-page .task-sidebar ~ .page.task-solve-page,
  body.neuroege-task6-py-page .task-sidebar--open ~ .neuroege-hf-task-root,
  body.neuroege-task6-py-page .task-sidebar--open ~ .page.task-solve-page {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  body.neuroege-task6-py-page .neuroege-hf-task-root,
  body.neuroege-task6-py-page .libreoffice-task9-page.task-solve-page {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box;
  }

  body.neuroege-task6-py-page .header--task-hf,
  body.neuroege-task6-py-page .task-solve__right,
  body.neuroege-task6-py-page .task-solve-main {
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  body.neuroege-task6-py-page {
    overflow-x: hidden;
  }
}

@media (max-width: 768px) {
  body.neuroege-task6-py-page.task6-py-mobile-mode .kumir-header-burger--premium {
    display: inline-flex;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .header--task-hf .hf-task-layout-grid__right--dual-toolbar {
    display: none;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .header--task-hf .hf-task-layout-grid__split {
    display: none;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .header--task-hf .hf-task-layout-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .header--task-hf .hf-variants-shell__toggle {
    display: none;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode #mobile-immersive-hint {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .neuroege-ai-chat__fab {
    display: none !important;
  }
}

@media (max-width: 768px) and (pointer: coarse) {
  body.neuroege-task6-py-page.task6-py-mobile-mode .canvas-bg {
    display: none;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .neuroege-hf-task-root,
  body.neuroege-task6-py-page.task6-py-mobile-mode .libreoffice-task9-page.task-solve-page {
    padding-bottom: calc(4.15rem + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    min-height: 100dvh;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .libreoffice-task9-page.task-solve-page {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    min-height: 0;
    overflow: hidden;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .libreoffice-task9-col-resizer {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode #task-answer-section {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode:not(.task6-py-mobile-pane-statement):not(.task6-py-variants-open) .hf-variants-shell--body {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-statement .hf-variants-shell--body,
  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-variants-open .hf-variants-shell--body {
    display: flex !important;
    flex: 0 0 auto;
    flex-direction: column;
    max-height: min(42vh, 14rem);
    min-height: 0;
    overflow: hidden;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-statement .hf-variants-nav,
  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-variants-open .hf-variants-nav {
    opacity: 1 !important;
    pointer-events: auto !important;
    height: auto !important;
    min-height: 4.5rem !important;
    max-height: min(38vh, 12rem) !important;
    flex: 1 1 auto !important;
    flex-basis: auto !important;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-statement .hf-variants-nav .libreoffice-task9-chip,
  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-variants-open .hf-variants-nav .libreoffice-task9-chip {
    min-height: 2.35rem;
    touch-action: manipulation;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .hf-variants-shell__head-center,
  body.neuroege-task6-py-page.task6-py-mobile-mode .hf-variants-shell__variant-row {
    cursor: pointer;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .task-solve__right,
  body.neuroege-task6-py-page.task6-py-mobile-mode .task-solve-main {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-statement .task-solve-main {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-statement .task-solve__right {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-code .task-solve__right,
  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field .task-solve__right {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-code .task-solve-main,
  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field .task-solve-main {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .task-solve__statement,
  body.neuroege-task6-py-page.task6-py-mobile-mode #libreoffice-task9-statement-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .task-solve__left,
  body.neuroege-task6-py-page.task6-py-mobile-mode #sandbox-view {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .python-sandbox-win-container,
  body.neuroege-task6-py-page.task6-py-mobile-mode #python-sandbox {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Python lite chrome */
  body.neuroege-task6-py-page.task6-py-mobile-mode .python-sandbox-idle-menubar,
  body.neuroege-task6-py-page.task6-py-mobile-mode .python-sandbox-idle-titlebar {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .python-sandbox__toolbar-right,
  body.neuroege-task6-py-page.task6-py-mobile-mode .python-sandbox__toolbar .python-sandbox__run {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .python-sandbox__split-root {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-code #python-sandbox-editor-pane {
    flex: 1 1 auto;
    min-height: 0;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-code #python-sandbox-output-stack {
    flex: 0 0 auto;
    max-height: 22vh;
    min-height: 2.5rem;
    overflow: hidden;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-code #python-sandbox-splitter {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field #python-sandbox-editor-pane,
  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field #python-sandbox-splitter,
  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field #python-sandbox-output-stack {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-code #python-sandbox-turtle-modal {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field #sandbox-view {
    position: relative;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field #python-sandbox-turtle-modal {
    position: absolute !important;
    inset: 0 !important;
    z-index: 20;
    display: flex !important;
    align-items: stretch;
    justify-content: stretch;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field #python-sandbox-turtle-modal[hidden] {
    display: flex !important;
    visibility: hidden;
    pointer-events: none;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field .python-sandbox__turtle-modal-scrim {
    display: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field .python-sandbox__turtle-modal-panel {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    max-width: none !important;
    max-height: none !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    box-shadow: none;
    flex: 1 1 auto;
    min-height: 0;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field .python-sandbox__turtle-modal-panel--maximized {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field .python-sandbox__turtle-modal-header {
    flex: 0 0 auto;
    min-height: 2rem;
    padding: 0.25rem 0.5rem;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field .python-sandbox__turtle-modal-title {
    font-size: 0.75rem;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode.task6-py-mobile-pane-field .python-sandbox__turtle-modal-chrome-btn[data-turtle-modal-close] {
    display: none;
  }

  body.neuroege-task6-py-page.task6-py-mobile-mode .python-sandbox__editor,
  body.neuroege-task6-py-page.task6-py-mobile-mode .CodeMirror {
    font-size: 0.8125rem;
    line-height: 1.45;
  }

  @media (orientation: landscape) {
    body.neuroege-task6-py-page.task6-py-mobile-mode .libreoffice-task9-page.task-solve-page {
      grid-template-columns: minmax(0, 38fr) 4px minmax(0, 62fr) !important;
    }

    body.neuroege-task6-py-page.task6-py-mobile-mode .libreoffice-task9-col-resizer {
      display: block !important;
    }

    body.neuroege-task6-py-page.task6-py-mobile-mode .task-solve__right,
    body.neuroege-task6-py-page.task6-py-mobile-mode .task-solve-main {
      display: flex !important;
    }

    body.neuroege-task6-py-page.task6-py-mobile-mode .task-solve__right {
      grid-column: 1 !important;
    }

    body.neuroege-task6-py-page.task6-py-mobile-mode .task-solve-main {
      grid-column: 3 !important;
    }

    body.neuroege-task6-py-page.task6-py-mobile-mode .libreoffice-task9-col-resizer {
      grid-column: 2 !important;
    }

    body.neuroege-task6-py-page.task6-py-mobile-mode .task6-py-mobile-dock [data-task6-py-pane="statement"] {
      display: none;
    }

    body.neuroege-task6-py-page.task6-py-mobile-mode .neuroege-hf-task-root,
    body.neuroege-task6-py-page.task6-py-mobile-mode .libreoffice-task9-page.task-solve-page {
      padding-bottom: calc(3.35rem + env(safe-area-inset-bottom, 0px));
    }
  }
}

body.task6-py-header-menu-open {
  overflow: hidden;
}

.task6-py-tasks-backdrop {
  position: fixed;
  inset: 0;
  z-index: 205;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.task6-py-tasks-backdrop[hidden] {
  display: none;
}

body.neuroege-task6-py-page.task6-py-tasks-open #task-sidebar {
  width: auto;
  pointer-events: auto;
  z-index: 210;
}

body.neuroege-task6-py-page.task6-py-tasks-open #task-sidebar .task-sidebar__panel {
  display: flex !important;
  position: fixed;
  left: 0;
  top: 0;
  width: min(88vw, var(--sidebar-width, 260px)) !important;
  max-width: min(88vw, var(--sidebar-width, 260px));
  transform: translateX(0);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
}

body.neuroege-task6-py-page.task6-py-tasks-open .task-sidebar__toggle {
  display: none !important;
}

body.task6-py-tasks-open {
  overflow: hidden;
}

[data-palette="pink"] body.neuroege-task6-py-page.task6-py-mobile-mode .task6-py-mobile-dock {
  border-top-color: rgba(236, 72, 153, 0.32);
}
