/* Липкий низ: при коротком контенте навбар прижат к низу экрана. Едино для просмотра с уровня Проектов и Разделов. */
body.shared-view.shared-has-sequence-nav {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.shared-view.shared-has-sequence-nav:not(.shared-has-compare) {
  min-height: 100dvh;
  overflow-x: hidden;
}
body.shared-has-compare.shared-has-sequence-nav {
  height: 100vh;
  height: 100dvh;
}
body.shared-view.shared-has-sequence-nav #shared-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.shared-view.shared-has-sequence-nav #shared-content .shared-view-theme {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
body.shared-view.shared-has-sequence-nav #shared-content .shared-compare-wrap {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.shared-view.shared-has-sequence-nav #shared-sequence-nav-wrap {
  flex-shrink: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  box-sizing: border-box;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Обёртка нижнего навбара: ограничение ширины при просмотре из раздела */
.shared-sequence-nav-wrap {
  display: flex;
  justify-content: center;
}
.shared-sequence-nav-wrap .sequence-nav {
  max-width: 720px;
  width: 100%;
  box-sizing: border-box;
}

/* Меню раздела: выезжающая панель слева (скрыта по умолчанию) */
.shared-section-menu {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 99;
}
.shared-section-menu-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: var(--longread-surface, #fff);
  border-right: 1px solid var(--longread-accent-pale, #e0e0e0);
  box-shadow: 4px 0 16px rgba(0,0,0,0.08);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.shared-section-menu.is-open .shared-section-menu-panel {
  transform: translateX(0);
}
.shared-section-menu-tab {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 72px;
  background: var(--longread-surface, #fff);
  border: 1px solid var(--longread-accent-pale, #e0e0e0);
  border-left: none;
  border-radius: 0 6px 6px 0;
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--longread-accent, #1f3249);
  pointer-events: auto;
  flex-shrink: 0;
}
.shared-section-menu.is-open .shared-section-menu-tab {
  left: 260px;
}
.shared-section-menu-tab:hover {
  background: var(--longread-important-bg, #f5f5f5);
}
.shared-section-menu-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--longread-accent-pale, #e0e0e0);
  background: var(--longread-important-bg, #f8f8f8);
}
.shared-section-menu-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  flex: 1;
  min-width: 0;
}
.shared-section-menu-title-link {
  color: var(--longread-accent, #1f3249);
  text-decoration: none;
  display: block;
}
.shared-section-menu-title-link:hover {
  text-decoration: underline;
}
.shared-section-menu-hide {
  padding: 4px 8px;
  font-size: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--longread-accent, #1f3249);
  line-height: 1;
}
.shared-section-menu-hide:hover {
  color: var(--longread-text, #222);
}
.shared-section-menu-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.shared-section-menu-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  font-size: 13px;
  color: var(--longread-accent, #1f3249);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.15s;
}
.shared-section-menu-item:hover {
  background: var(--longread-important-bg, #f5f5f5);
}
.shared-section-menu-item.current {
  font-weight: 600;
  background: var(--longread-important-bg, #eee);
}
/* Иерархия в меню (режим проекта: разделы и прототипы) */
.shared-section-menu-group {
  margin-top: 4px;
}
.shared-section-menu-group:first-child {
  margin-top: 0;
}
.shared-section-menu-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--longread-accent, #1f3249);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1.3;
  font-family: inherit;
  transition: background 0.15s;
}
.shared-section-menu-group-title:hover {
  background: var(--longread-important-bg, #f5f5f5);
}
.shared-section-menu-group-toggle {
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1;
  color: var(--longread-accent-pale, #888);
  transition: transform 0.2s ease;
}
.shared-section-menu-group.is-expanded .shared-section-menu-group-toggle {
  transform: rotate(90deg);
}
.shared-section-menu-group.is-collapsed .shared-section-menu-group-children {
  display: none;
}
.shared-section-menu-group-children {
  padding-left: 8px;
}
.shared-section-menu-group-children .shared-section-menu-item {
  padding: 6px 14px 6px 10px;
  font-size: 13px;
}

/* SequenceNav: полоса Назад | К списку | Вперёд/Завершить. Переиспользуется в shared-оверлее и SCORM-плеере. */
.sequence-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--longread-surface, #fff);
  color: var(--longread-text, #222);
  flex-shrink: 0;
}
.sequence-nav-left,
.sequence-nav-center,
.sequence-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sequence-nav-left { flex: 1; justify-content: flex-start; }
.sequence-nav-center { flex: 0 0 auto; }
.sequence-nav-right { flex: 1; justify-content: flex-end; }
.sequence-nav-btn {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--longread-accent, #1f3249);
  background: transparent;
  border: 1px solid var(--longread-accent-pale, #e0e0e0);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sequence-nav-btn:hover:not(.sequence-nav-disabled) {
  background: var(--longread-important-bg, #f5f5f5);
  border-color: var(--longread-accent, #1f3249);
}
.sequence-nav-btn.sequence-nav-disabled {
  opacity: 0.5;
  cursor: default;
}
.sequence-nav-btn.sequence-nav-finish {
  font-weight: 600;
}

/* Оверлей проекта: дерево + полоса Назад/Вперёд */
.project-nav-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  box-sizing: border-box;
}
.project-nav-tree-panel {
  padding: 12px 16px;
  background: var(--longread-important-bg, #f8f8f8);
  border-top: 1px solid var(--longread-accent-pale, #e0e0e0);
  max-height: 50vh;
  overflow-y: auto;
}
.project-nav-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.project-nav-tree-root {
  font-weight: 600;
  color: var(--longread-accent, #1f3249);
  text-decoration: none;
  padding: 4px 0;
}
.project-nav-tree-root:hover {
  text-decoration: underline;
}
.project-nav-tree-item {
  display: block;
  color: var(--longread-accent, #1f3249);
  text-decoration: none;
  padding: 4px 0;
}
.project-nav-tree-item:hover {
  text-decoration: underline;
}
.project-nav-tree-material {
  padding-left: 12px;
}
.project-nav-tree-section {
  margin-top: 6px;
}
.project-nav-tree-section-title {
  display: block;
  width: 100%;
  padding: 4px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--longread-accent, #1f3249);
  background: none;
  border: none;
  cursor: pointer;
}
.project-nav-tree-section-title:hover {
  text-decoration: underline;
}
.project-nav-tree-section-children {
  padding-left: 16px;
  margin-top: 2px;
}
.project-nav-tree-child {
  display: block;
  padding: 2px 0;
  font-weight: normal;
}
.project-nav-toggle {
  margin-left: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--longread-accent, #1f3249);
  background: transparent;
  border: 1px solid var(--longread-accent-pale, #e0e0e0);
  border-radius: 4px;
  cursor: pointer;
}
.project-nav-toggle:hover {
  background: var(--longread-important-bg, #f5f5f5);
}
