/* =========================================================
   Ю047 — 5E6D
   Compact progress topbar
   ========================================================= */

:root{
  --yu047-progress-topbar-height:56px;
  --yu047-progress-shell:980px;
}

.yu047-fixed-progress-topbar{
  position:fixed!important;
  z-index:10000!important;
  top:0!important;
  left:0!important;
  right:0!important;

  width:100%!important;
  min-height:var(--yu047-progress-topbar-height)!important;

  display:block!important;

  padding:
    env(safe-area-inset-top,0px)
    max(18px,env(safe-area-inset-right,0px))
    0
    max(18px,env(safe-area-inset-left,0px))!important;

  background:rgba(247,249,255,.97)!important;
  border-bottom:1px solid rgba(198,209,239,.68)!important;

  -webkit-backdrop-filter:blur(10px) saturate(1.08);
  backdrop-filter:blur(10px) saturate(1.08);

  box-shadow:0 3px 12px rgba(25,43,92,.025)!important;
}

.yu047-progress-topbar-inner{
  width:min(100%,var(--yu047-progress-shell))!important;
  min-height:56px!important;
  margin:0 auto!important;

  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
}

.yu047-progress-topbar-inner > a:first-child{
  flex:0 0 auto!important;
}

.yu047-progress-topbar-inner .progress-top-actions{
  margin-left:auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
}

/* Badge больше НЕ живёт в фиксированной шапке */
.yu047-progress-topbar-inner .progress-top-actions .badge{
  display:none!important;
}

/* Компенсация fixed-шапки */
html.yu047-has-fixed-progress-topbar body{
  padding-top:calc(
    var(--yu047-progress-topbar-height) +
    env(safe-area-inset-top,0px)
  )!important;
}

/*
  Сильно уменьшаем лишнюю пустоту до первого блока.
*/
html.yu047-has-fixed-progress-topbar .progress-shell,
html.yu047-has-fixed-progress-topbar .help-shell{
  padding-top:10px!important;
}

/*
  Маленькая подпись над первым блоком.
  JS переносит туда уже существующий badge.
*/
.yu047-progress-context-badge{
  width:min(100%,var(--yu047-progress-shell));
  margin:0 auto 8px!important;
  padding-top:0!important;

  color:#6e7a98!important;
  font-size:10px!important;
  line-height:1.3!important;
  font-weight:850!important;
  letter-spacing:.01em!important;
}

.yu047-progress-context-badge .badge{
  display:inline!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:inherit!important;
  font:inherit!important;
}

html.yu047-has-fixed-progress-topbar{
  scroll-padding-top:calc(
    var(--yu047-progress-topbar-height) +
    env(safe-area-inset-top,0px) +
    8px
  );
}

@media(max-width:700px){
  :root{
    --yu047-progress-topbar-height:54px;
  }

  .yu047-fixed-progress-topbar{
    padding-left:max(12px,env(safe-area-inset-left,0px))!important;
    padding-right:max(12px,env(safe-area-inset-right,0px))!important;
  }

  .yu047-progress-topbar-inner{
    min-height:54px!important;
    gap:8px!important;
  }

  .yu047-progress-topbar-inner > a:first-child{
    min-width:0!important;
    font-size:15px!important;
    white-space:nowrap!important;
  }

  .yu047-progress-topbar-inner .help-link{
    padding:7px 11px!important;
    font-size:10px!important;
    white-space:nowrap!important;
  }

  html.yu047-has-fixed-progress-topbar .progress-shell,
  html.yu047-has-fixed-progress-topbar .help-shell{
    padding-top:8px!important;
  }

  .yu047-progress-context-badge{
    margin-bottom:6px!important;
    padding:0 0 0 0!important;
    font-size:9px!important;
  }
}

@media(max-width:360px){
  .yu047-progress-topbar-inner > a:first-child{
    font-size:14px!important;
  }

  .yu047-progress-topbar-inner .help-link{
    padding:6px 9px!important;
  }
}

@media(prefers-reduced-transparency:reduce){
  .yu047-fixed-progress-topbar{
    background:#f7f9ff!important;
    -webkit-backdrop-filter:none;
    backdrop-filter:none;
  }
}

/* =========================================================
   Ю047 — 5E6E
   Tight spacing under fixed progress topbar
   ========================================================= */

/*
  5E6D уже уменьшил padding самого shell.
  Но у hero-блоков остаётся собственный большой верхний отступ.
  Убираем именно его.
*/

html.yu047-has-fixed-progress-topbar .progress-hero,
html.yu047-has-fixed-progress-topbar .help-hero{
  padding-top:14px!important;
  margin-top:0!important;
}

/*
  На progress.html перед hero может стоять маленькая подпись
  «Секретное сохранение Ю047». Между ней и hero тоже не нужен
  большой воздух.
*/
html.yu047-has-fixed-progress-topbar .yu047-progress-context-badge{
  margin-top:0!important;
  margin-bottom:4px!important;
}

/* Мобильный — ещё плотнее */
@media(max-width:700px){
  html.yu047-has-fixed-progress-topbar .progress-shell,
  html.yu047-has-fixed-progress-topbar .help-shell{
    padding-top:4px!important;
  }

  html.yu047-has-fixed-progress-topbar .progress-hero,
  html.yu047-has-fixed-progress-topbar .help-hero{
    padding-top:10px!important;
    margin-top:0!important;
  }

  html.yu047-has-fixed-progress-topbar .yu047-progress-context-badge{
    margin-bottom:2px!important;
  }
}

/* Очень узкий экран — максимально компактно, но не вплотную */
@media(max-width:390px){
  html.yu047-has-fixed-progress-topbar .progress-hero,
  html.yu047-has-fixed-progress-topbar .help-hero{
    padding-top:8px!important;
  }
}
