/* One Back (assets/js/app.js "One Back"). Loaded last, so it wins over each section's older back styling.
   Every page that is not a tab shows one Back at the top left: in the breadcrumb row, in the Social header
   row (Social and Huddle pages) or in a full page's own header. 44px target, colour tokens only, no gradients. */
.nb-back { display:inline-flex; align-items:center; justify-content:center; gap:4px; flex:none; min-height:44px; min-width:44px; padding:0 12px 0 8px;
  border:0; border-radius:11px; background:transparent; color:var(--shot-text); font:inherit; font-size:var(--fs-small,14px); font-weight:700; line-height:1;
  text-decoration:none; cursor:pointer; }
.nb-back svg { width:20px; height:20px; }
.nb-back:hover { background:var(--shot-surface-hover); color:var(--shot-text); }
.nb-back:focus-visible { outline:2px solid var(--status-upcoming-text); outline-offset:-2px; }

/* Breadcrumb row: Back first, then the trail. A tab page, or a page whose Back lives elsewhere, hides the row's Back. */
.route-breadcrumbs { justify-content:flex-start; gap:8px; padding-block:4px; min-height:52px; }
.route-breadcrumbs .breadcrumb-back-btn.nb-back { margin-left:0; padding:0 12px 0 8px; border:0; background:transparent; font-size:var(--fs-small,14px); min-height:44px; min-width:44px; }
.route-breadcrumbs .breadcrumb-back-btn.nb-back:hover { background:var(--shot-surface-hover); }
.route-breadcrumbs .breadcrumb-back-btn svg { width:20px; height:20px; }
.breadcrumb-item { min-height:44px; min-width:44px; }
#main:is([data-nb="top"],[data-nb="header"],[data-nb="page"]) .route-breadcrumbs .breadcrumb-back-btn { display:none; }
/* Social and Huddle pages hide the row on phones; one with no Social header of its own (a calm or bare page) shows it. */
#main[data-nb="crumb"]:has(:is(.sc,.sch)) .route-breadcrumbs { display:flex; }
/* A link in the page that only repeats the shell Back steps aside for it. */
#main:is([data-nb="crumb"],[data-nb="header"],[data-nb="page"]) .main-inner .w-backlink[data-act="shell:back"] { display:none; }

/* Full pages (SHOT.screen): the header Back carries its word, like every other Back. */
.pg-head .pg-back.nb-back { width:auto; height:auto; border-radius:11px; margin-left:var(--s1,8px); }

/* Social header row: Back left of the tabs; the context row (chips, search) spans underneath. */
.sc-sticky:has(> .nb-back) { grid-template-columns:auto minmax(0,1fr); align-items:center; }
.sc-sticky > .nb-back { grid-column:1; grid-row:1; }
.sc-sticky:has(> .nb-back) > .sc-nav { grid-column:2; grid-row:1; }
.sc-sticky:has(> .nb-back) > :not(.nb-back):not(.sc-nav) { grid-column:1 / -1; }
@media (min-width:768px) { .sc-sticky:has(> .nb-back) { grid-template-columns:auto minmax(0,640px); justify-content:center; } }

/* Collapsed on scroll (phones): the tabs and chips slide away, the Back stays put in a row of its own. */
@media (max-width:767px) {
  .sc-sticky[data-away]:has(> .nb-back) { transform:none; }
  .sc-sticky:has(> .nb-back) > :not(.nb-back) { transition:opacity 200ms ease-out; }
  .sc-sticky[data-away]:has(> .nb-back):not(:focus-within) > :not(.nb-back) { opacity:0; visibility:hidden; }
  .sc-sticky[data-away]:has(> .nb-back):not(:focus-within) > :not(.nb-back):not(.sc-nav) { max-height:0; overflow:hidden; padding-block:0; }
}
@media (prefers-reduced-motion:reduce) { .sc-sticky:has(> .nb-back) > :not(.nb-back) { transition:none; } }

/* Huddle pages: the same row, with the page it belongs to beside the Back. */
.nb-head { position:sticky; top:0; z-index:4; display:flex; align-items:center; gap:var(--s1,8px); min-height:52px; min-width:0;
  margin-inline:calc(-1 * var(--s3,12px)); padding:4px var(--s3,12px) 4px var(--s1,8px); background:var(--shot-background); border-bottom:1px solid var(--shot-border); }
.nb-where { margin:0; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--shot-text-secondary); font-size:var(--fs-small,14px); font-weight:600; }
@media (min-width:541px) { .nb-head { top:var(--sc-crumb-h,53px); } }
