/* AMM v2.27.55: iPhone safe-area header and navigable history row.
   Public home, client access, and private client browser only. */
.amm-mobile-history{display:none}
@media(max-width:820px){
  body>.topbar:has(.amm-mobile-history){
    position:sticky;top:0;z-index:80;
    display:grid!important;grid-template-columns:minmax(0,1fr) auto;
    align-items:center;column-gap:8px;row-gap:5px;
    box-sizing:border-box;
    /* Give installed PWAs clear breathing room under the iOS status bar. */
    padding:calc(17px + env(safe-area-inset-top,0px)) 16px 10px!important;
  }
  body>.topbar:has(.amm-mobile-history)>.brand{grid-column:1;grid-row:1;min-width:0}
  body>.topbar:has(.amm-mobile-history)>.top-actions{grid-column:2;grid-row:1;min-width:0}
  body>.topbar:has(.amm-mobile-history)>.amm-mobile-history{grid-column:1/-1;grid-row:2}
  .amm-mobile-history{
    display:flex;align-items:center;gap:7px;box-sizing:border-box;
    width:100%;max-width:100%;min-width:0;
    padding:7px 0 1px;isolation:isolate;
  }
  .amm-history-btn{
    -webkit-appearance:none;appearance:none;display:inline-flex;align-items:center;
    justify-content:center;gap:6px;flex:0 0 auto;min-height:42px;
    padding:8px 11px;border:1px solid rgba(157,188,224,.25);border-radius:13px;
    color:#eef0ff;background:linear-gradient(130deg,rgba(38,45,69,.95),rgba(18,27,43,.95));
    box-shadow:inset 0 1px rgba(255,255,255,.10);font-family:inherit;
    font-weight:750;font-size:14px;letter-spacing:0;line-height:1.2;
    -webkit-tap-highlight-color:transparent;transition:background .16s,transform .16s;
  }
  .amm-history-btn svg{width:17px;height:17px;flex:none}
  .amm-history-btn:not(:disabled):active{transform:scale(.96)}
  .amm-history-btn:not(:disabled):hover{background:rgba(109,90,170,.3)}
  .amm-history-btn:focus-visible{outline:2px solid #bfe6ff;outline-offset:2px}
  .amm-history-btn:disabled{opacity:.42;cursor:not-allowed;box-shadow:none}
  .amm-history-context{min-width:0;flex:1;text-align:right;white-space:nowrap;
    overflow:hidden;text-overflow:ellipsis;font-size:12px;font-weight:700;line-height:1.2;
    color:#aabacf;letter-spacing:.01em}
  /* Header should be comfortable in standalone app mode but not waste a whole screen. */
  body.amm-screen-shell main>.section.amm-screen-active{scroll-margin-top:8px}
  #home.hero{padding-top:40px!important}
  /* On the private client pages, keep route history in normal document flow. */
  body:not(:has(>.topbar))>.amm-mobile-history{
    margin:0 auto;padding:8px 18px 12px;max-width:1120px;
    border-bottom:1px solid rgba(159,184,224,.12);
  }
  body:not(:has(>.topbar))>header{padding-top:calc(16px + env(safe-area-inset-top,0px))!important}
}
@media(max-width:370px){
  .amm-history-btn{padding:8px 9px;font-size:13px;gap:4px}
  .amm-history-btn svg{width:16px;height:16px}
  .amm-history-context{font-size:11px}
}
@media(prefers-reduced-motion:reduce){.amm-history-btn{transition:none!important}}
