/* Auxiliary pages keep one clear route back to the storefront. */
:root { --aux-rail-width: 108px; }

body.has-return-rail { padding-left: var(--aux-rail-width); }

.page-back-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--aux-rail-width);
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background: rgba(14, 15, 12, 0.97);
}

.page-back-button {
  width: calc(100% - 18px);
  min-height: 72px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: rgba(241, 242, 233, 0.025);
  color: var(--muted);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.page-back-button__icon {
  min-width: 34px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  transition: transform 180ms ease;
}

.page-back-button:hover {
  border-color: var(--line-strong);
  background: rgba(215, 214, 64, 0.06);
  color: var(--text);
}

.page-back-button:hover .page-back-button__icon { transform: translateX(-3px); }
.page-back-button:active { transform: translateY(1px) scale(0.98); }
.page-back-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }

html[data-theme="light"] .page-back-rail { background: rgba(243, 244, 237, 0.96); }
html[data-theme="light"] .page-back-button { background: rgba(32, 34, 25, 0.025); }
html[data-theme="light"] .page-back-button:hover { background: rgba(119, 121, 22, 0.08); }

@media (max-width: 760px) {
  body.has-return-rail { padding-left: 0; }

  .page-back-rail {
    inset: 0 auto auto 0;
    width: 64px;
    height: 68px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .page-back-button {
    width: 52px;
    min-height: 52px;
    gap: 0;
  }

  .page-back-button__icon { height: 34px; font-size: 25px; }
  .page-back-button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .has-return-rail .check-header__inner,
  .has-return-rail .status-header__inner {
    justify-content: flex-end;
    padding-left: 58px;
  }
  .has-return-rail .check-brand,
  .has-return-rail .status-brand { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .page-back-button,
  .page-back-button__icon { transition-duration: 0.01ms !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .page-back-rail { background: var(--bg); }
}
