/* Header Back button (#ace-back-btn). Logic: static/js/utils/back-button.js.
   Desktop only: phones keep the hamburger + logo header and the OS back gesture. 701px
   matches the existing mobile breakpoint in index.css. */
#ace-back-btn { display: none; }

@media (min-width: 701px) {
  #ace-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: absolute;      /* .headernav is sticky, so it is the containing block */
    left: 60px;              /* clears the 20px hamburger at left:20px */
    top: calc(max(20px, env(safe-area-inset-top, 20px)) - 4px);
    box-sizing: border-box;
    height: 28px;
    padding: 0 12px 0 10px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: var(--ace-blue);
    color: var(--ace-navy);
    font-family: 'Point', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .2px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
    z-index: 1;
  }
  #ace-back-btn svg { width: 14px; height: 14px; flex: none; }
  #ace-back-btn:hover { background: var(--ace-blue-hover); }
  #ace-back-btn:focus-visible { outline: 2px solid var(--ace-navy); outline-offset: 2px; }
  #ace-back-btn.is-disabled {
    opacity: .35;
    cursor: default;
    box-shadow: none;
  }
  #ace-back-btn.is-disabled:hover { background: var(--ace-blue); }

  /* Rep view has no hamburger, so Back takes the left edge and the "Home" link moves
     right of it. */
  html[data-rep-no-sidebar="1"] #ace-back-btn {
    left: 16px;
    top: calc(max(20px, env(safe-area-inset-top, 20px)) + 2px);   /* level with the Home pill's 2px margin */
  }
  html[data-rep-no-sidebar="1"] #rep-home-link { margin-left: 100px; }

  /* Native shells (iOS WKWebView) hide the header and own their own back navigation. */
  html[data-embed="1"] #ace-back-btn { display: none; }
}
