/* dc-hub-pinned-chrome.css — shared pinned bar under app header (admin breadcrumb + user hub topbar) */

:root {
  --dc-hub-pinned-bar-h: 40px;
  --dc-hub-pinned-bar-gap: 8px;
}

@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --dc-hub-pinned-bar-h: 34px;
    --dc-hub-pinned-bar-gap: 6px;
  }
}

/* —— Fixed shell (position authority) —— */
.dc-hub-pinned-bar,
html body.admin-mode.admin-hub-page .admin-breadcrumb.admin-hub-breadcrumb,
html body.admin-mode.admin-hub-page .wrap > .admin-hub-breadcrumb,
html body.admin-mode.dashboard-hub-page .admin-breadcrumb.dashboard-breadcrumb,
html body.admin-mode.dashboard-hub-page .wrap > .dashboard-breadcrumb,
body.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contests-public-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contests-public-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contests-public-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contest-user-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contest-user-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contest-user-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contest-user-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.profile-user-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.profile-user-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.profile-user-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.profile-user-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome] {
  position: fixed !important;
  top: calc(var(--admin-header-height, 68px) + var(--dc-admin-vv-offset-top, 0px)) !important;
  left: max(12px, env(safe-area-inset-left, 0px)) !important;
  right: max(12px, env(safe-area-inset-right, 0px)) !important;
  width: auto !important;
  transform: none !important;
  z-index: 4995 !important;
  max-width: none !important;
  min-height: var(--dc-hub-pinned-bar-h, 40px) !important;
  margin: 0 !important;
  padding: 0 14px !important;
  box-sizing: border-box !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Хлебные крошки (эталон п.29): широкое ИНФОРМАЦИОННОЕ ПОЛЕ во всю ширину контента,
   закреплено, вплотную к шапке (без зазора), плоское (без тени/блюра). Кнопка меню —
   только на мобильной версии. Порядок «Текущее > Подраздел». */
html body.admin-mode.admin-hub-page .admin-breadcrumb.admin-hub-breadcrumb,
html body.admin-mode.admin-hub-page .wrap > .admin-hub-breadcrumb,
html body.admin-mode.dashboard-hub-page .admin-breadcrumb.dashboard-breadcrumb,
html body.admin-mode.dashboard-hub-page .wrap > .dashboard-breadcrumb {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px;
  padding: 0 14px !important;
  border: 1px solid var(--panel-bd) !important;
  border-radius: 12px !important;
  background: var(--panel) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  margin-top: 0 !important;
  font-size: 13px;
  pointer-events: auto;
}

/* СТАБИЛЬНАЯ ШАПКА админ-хаба (десктоп). Раньше высота шапки была «резиновой»
   (min-height + контент), из-за чего getBoundingClientRect().height «прыгала» на зуме,
   а app.js кэшировал это значение в --admin-header-height. Итог: крошки/сайдбар/контент
   меняли высоту при зуме и чинились только по Ctrl+Shift+R. Фиксируем высоту 72px —
   значение детерминировано при любом зуме, JS-замер больше не расшатывает раскладку.
   Заодно убираем скруглённый низ (border-radius) и тяжёлую тень — это была та самая
   «область под шапкой»; вместо неё тонкая линия-разделитель (единый холст, п.28). */
@media (min-width: 768px) {
  html body.admin-mode.admin-hub-page,
  html body.admin-mode.dashboard-hub-page,
  /* Пользовательская лента, открытая администратором, — такая же страница админ-панели:
     та же высота шапки, тот же плоский низ, та же тонкая линия вместо тяжёлой тени.
     Без этого она оставалась в пользовательском наборе правил и получала «грязную»
     тень 0 18px 48px под шапкой, которой нет ни на одной админ-странице. */
  html body.pub-feed-admin {
    --admin-header-height: 72px;
    /* Плоский низ шапки: правила радиуса читают эту переменную (fallback был «0 0 20px 20px»). */
    --dc-header-shell-radius: 0;
  }
  html body.admin-mode.admin-hub-page header.dc-app-header,
  html body.admin-mode.dashboard-hub-page header.dc-app-header,
  html body.pub-feed-admin header.dc-app-header {
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    border-radius: 0 !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18) !important;
  }
}

/* Крошки — ряд контента поля (без своей пилюли/фона) */
html body.admin-mode .admin-breadcrumb .dc-crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}
/* Кнопка меню: скрыта на десктопе, видна только на мобильной версии */
html body.admin-mode .admin-breadcrumb .dc-crumb .ash-burger {
  display: none !important;
}
@media (max-width: 767px) {
  html body.admin-mode .admin-breadcrumb .dc-crumb .ash-burger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 24px !important;
    height: 24px !important;
    min-height: 0 !important;
    margin: 0 8px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    color: var(--muted) !important;
    font-size: 15px;
    line-height: 1;
    flex: none;
    cursor: pointer;
  }
  html body.admin-mode .admin-breadcrumb .dc-crumb .ash-burger:hover {
    color: var(--ink) !important;
    background: none !important;
  }
}
html body.admin-mode .admin-breadcrumb .dc-crumb a {
  color: var(--muted) !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
html body.admin-mode .admin-breadcrumb .dc-crumb a:hover {
  color: var(--ink) !important;
}
html body.admin-mode .admin-breadcrumb .dc-crumb .current {
  color: var(--ink) !important;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html body.admin-mode .admin-breadcrumb .dc-crumb__sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: none;
}
html body.admin-mode .admin-breadcrumb .dc-crumb__sep svg {
  display: block;
  width: 14px;
  height: 14px;
}

/* User contests: single nav bar — mobile full bleed like admin (no wrapper) */
body.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contests-public-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contest-user-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contest-user-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.profile-user-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.profile-user-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome] {
  padding: 0 !important;
  pointer-events: auto !important;
  overflow: hidden !important;
  max-height: var(--dc-hub-pinned-bar-h, 40px) !important;
}

/* Legacy wrapper markup (if cached): inner nav paints the box */
body.contests-public-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav),
body.contests-public-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav),
body.contest-user-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav),
body.contest-user-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav),
body.profile-user-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav),
body.profile-user-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav) {
  padding: 0 !important;
  background: transparent;
  pointer-events: none;
}

body.contests-public-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav) .cp-topbar,
body.contests-public-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav) .cp-topbar,
body.contest-user-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav) .cp-topbar,
body.contest-user-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav) .cp-topbar,
body.profile-user-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav) .cp-topbar,
body.profile-user-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav) .cp-topbar {
  pointer-events: auto;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  html body.admin-mode.admin-hub-page:not(.accounts-hub-page) .admin-breadcrumb.admin-hub-breadcrumb,
  html body.admin-mode.admin-hub-page:not(.accounts-hub-page) .wrap > .admin-hub-breadcrumb,
  html body.admin-mode.dashboard-hub-page .admin-breadcrumb.dashboard-breadcrumb,
  html body.admin-mode.dashboard-hub-page .wrap > .dashboard-breadcrumb,
  html body.user-chrome-outside-wrap.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  html body.user-chrome-outside-wrap.contest-user-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  html body.user-chrome-outside-wrap.profile-user-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contest-user-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.profile-user-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contest-user-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.profile-user-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome] {
    left: 50% !important;
    right: auto !important;
    width: min(calc(100% - 24px), var(--cp-hub-max, 767px)) !important;
    max-width: min(calc(100% - 24px), var(--cp-hub-max, 767px)) !important;
    transform: translateX(-50%) !important;
  }
}

/* Phone landscape (~844×390): full bleed pinned bar */
@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) {
  html body.admin-mode.admin-hub-page:not(.accounts-hub-page) .admin-breadcrumb.admin-hub-breadcrumb,
  html body.admin-mode.admin-hub-page:not(.accounts-hub-page) .wrap > .admin-hub-breadcrumb,
  html body.admin-mode.dashboard-hub-page .admin-breadcrumb.dashboard-breadcrumb,
  html body.admin-mode.dashboard-hub-page .wrap > .dashboard-breadcrumb,
  html body.user-chrome-outside-wrap.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  html body.user-chrome-outside-wrap.contest-user-open:not(.contest-user-hub-page) > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  html body.user-chrome-outside-wrap.profile-user-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contest-user-open:not(.contest-user-hub-page) > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.profile-user-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contest-user-open:not(.contest-user-hub-page) > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.profile-user-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contest-user-open:not(.contest-user-hub-page) .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.profile-user-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contest-user-open:not(.contest-user-hub-page) .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.profile-user-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome] {
    left: max(12px, env(safe-area-inset-left, 0px)) !important;
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
  }
}
