/*
 * Stage 4 of docs/design-unification-plan.md: «Мой Храм24».
 * Loaded on every page (templates/element/ui/next_styles.php).
 *
 * Phones keep the fixed bottom bar. From 900px the same four sections become a
 * bar under the site header, so nothing floats over the text.
 */
@media (min-width: 900px) {
  html:root body.has-personal-space-nav .wrapper {
    padding-bottom: 0;
  }

  html:root .personal-space-nav {
    position: sticky;
    top: 0;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none;
    display: flex;
    gap: var(--h24-space-xxs);
    justify-content: flex-start;
    box-sizing: border-box;
    width: calc(100% - 2 * var(--h24-space-md));
    max-width: 1020px;
    min-height: 0;
    margin: var(--h24-space-sm) auto var(--h24-space-md);
    padding: var(--h24-space-xxs);
    background: var(--h24-color-surface);
    border: 1px solid var(--h24-color-border);
    border-radius: var(--h24-radius-md);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html:root .personal-space-nav__item {
    flex-direction: row;
    gap: var(--h24-space-xs);
    min-height: 44px;
    padding: 0 var(--h24-space-md);
    border-radius: var(--h24-radius-sm);
    font-size: 15px;
  }

  html:root .personal-space-nav__item.is-active {
    background: var(--h24-color-primary-container);
    color: var(--h24-color-on-primary-container);
  }

  html:root .personal-space-nav__item.is-active .personal-space-nav__icon {
    background: transparent;
  }

  /* Floating controls no longer need room for the bottom bar. */
  html:root body.has-personal-space-nav .reader-settings-btn {
    bottom: 10px;
  }

  html:root body.has-personal-space-nav .hr24-dia._question {
    bottom: 5px;
  }

  html:root body.has-personal-space-nav .hr24-dia-text-wrapper {
    padding-bottom: 50px;
  }

  html:root body.has-personal-space-nav .lk-wrapper .lk__keys .plus-box {
    bottom: 0;
  }
}
