/* ========================================================================
   ЛАБА v46.5.4 — action buttons + mobile spacing polish
   Incremental overrides for v46.5.x. Loaded after the existing site CSS.
   ======================================================================== */

/* Author profile: keep the action at the far edge, but give it the same
   confident visual scale as the mobile action. */
.author-profile-actions{
  justify-self:end!important;
  align-self:center!important;
  width:210px!important;
  margin-left:auto!important;
  margin-right:0!important;
}
.author-panel-v465 .author-profile-link{
  min-height:52px!important;
  padding:0 18px!important;
  border-radius:12px!important;
  font-size:15px!important;
}

/* Gallery hero actions: no decorative arrow; both actions are equal buttons. */
.submit-work .submit-arrow{display:none!important}

@media(max-width:760px){
  /* Equal action buttons in the gallery header. */
  .works-hero-actions{
    width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-items:stretch!important;
    gap:10px!important;
  }
  .works-hero-actions .authors-link,
  .works-hero-actions .submit-work{
    width:100%!important;
    min-width:0!important;
    min-height:50px!important;
    height:100%!important;
    margin:0!important;
    padding:0 11px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    border-radius:13px!important;
    font-size:12.5px!important;
    line-height:1.15!important;
    white-space:normal!important;
  }
  .works-hero-actions .submit-work>span:not(.submit-arrow){
    display:block!important;
    width:100%!important;
    text-align:center!important;
  }

  /* Author profile: mobile remains a clean full-width action beneath the hero. */
  .author-profile-actions{
    grid-column:1/-1!important;
    justify-self:stretch!important;
    width:100%!important;
    margin:5px 0 0!important;
  }
  .author-panel-v465 .author-profile-link{
    width:100%!important;
    min-height:50px!important;
    font-size:14px!important;
  }

  /* More robust modal safety: hide the persistent nav while any overlay is open.
     :has() is supported by the current mobile Chrome/Safari families; sibling
     selectors are kept as a fallback in the previous stylesheet. */
  body:has(.work-viewer.is-open) .mobile-bottom-nav,
  body:has(.author-modal.is-open) .mobile-bottom-nav,
  body:has(.group-modal.is-open) .mobile-bottom-nav{
    display:none!important;
  }
  body:has(.work-viewer.is-open),
  body:has(.author-modal.is-open),
  body:has(.group-modal.is-open){
    padding-bottom:0!important;
  }
  .work-viewer.is-open .viewer-copy{
    padding-bottom:max(48px,calc(28px + env(safe-area-inset-bottom)))!important;
  }

  /* Keep viewer controls in predictable tap zones on narrow screens. */
  .work-viewer.is-open .viewer-topline{
    grid-template-columns:minmax(0,1fr) auto auto!important;
    gap:7px!important;
  }
  .work-viewer.is-open .viewer-like,
  .work-viewer.is-open .viewer-share{
    min-height:44px!important;
  }
  .work-viewer.is-open .viewer-close{
    width:42px!important;
    height:42px!important;
    right:12px!important;
    top:12px!important;
  }
}

@media(max-width:430px){
  .works-hero-actions{gap:8px!important}
  .works-hero-actions .authors-link,
  .works-hero-actions .submit-work{
    min-height:52px!important;
    padding:0 8px!important;
    font-size:12px!important;
  }
}

/* Home page — use one rhythm between the mobile content blocks instead of
   accumulated margins from older revisions. */
@media(max-width:680px){
  .home-body .hero-stack{transform:translateY(2px)!important}
  .home-body .brand{margin:0 auto 12px!important}
  .home-body .home-grid{
    gap:12px!important;
    margin:0 auto!important;
  }
  .home-body .community-live-strip{
    margin:12px auto 0!important;
  }
  .home-body .landing-footer{
    margin:12px auto 0!important;
    padding-top:0!important;
    transform:none!important;
  }
}
