/* aimalaysia.io: the phone tab bar. Five raised block keys fixed to the bottom of the screen below 900px: Island, For you, Ask, Wiki, News.
   The key for the open page is lit yellow and sits pressed in. The island and the wiki link this file after /site.css; the Worker
   injects it, with the same markup, into the news app. So it stands alone: plain colours and fonts with fallbacks, no site.css variables. */
.am-tabs{display:none}
@media (max-width:899px){
  :root{--am-tabs-h:70px}
  html{scroll-padding-bottom:calc(var(--am-tabs-h) + env(safe-area-inset-bottom,0px))}
  body{padding-bottom:calc(var(--am-tabs-h) + env(safe-area-inset-bottom,0px))}
  /* the bar carries the top links on phones, so the top bar keeps only the lockup and the official link */
  .am-bar .am-nav{display:none}
  .am-bar .am-ext{margin-left:auto}
  /* the bar now covers the notch area at the bottom, so the yellow strip no longer has to */
  .am-strip{padding-bottom:0}

  .am-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;position:fixed;left:0;right:0;bottom:0;z-index:60;box-sizing:border-box;
    min-height:calc(var(--am-tabs-h) + env(safe-area-inset-bottom,0px));margin:0;
    padding:12px max(10px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));
    background:#14212b;-webkit-tap-highlight-color:transparent}
  /* the same hoarding edge as the yellow strip, so the bar reads as part of the site on sky, sea and the dark wiki alike */
  .am-tabs::before{content:"";position:absolute;left:0;right:0;top:0;height:4px;background:repeating-linear-gradient(90deg,#14212b 0 8px,#ffcc00 8px 16px)}

  /* a raised key: a slate face on a darker side. Pressing pushes the face down onto its side */
  .am-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:46px;padding:4px 6px;box-sizing:border-box;
    background:#2a3f52;color:#f3ead8;border:2px solid #0a1218;box-shadow:inset 0 2px 0 rgba(255,255,255,.14),0 4px 0 #0a1218;
    font:600 12px/1.1 "IBM Plex Sans",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;letter-spacing:.01em;text-decoration:none;
    transition:transform .08s ease,box-shadow .08s ease}
  .am-tab > span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .am-tab-icon{display:block;width:22px;height:22px;fill:currentColor;shape-rendering:crispEdges}
  .am-tab:active{transform:translateY(3px);box-shadow:inset 0 2px 0 rgba(255,255,255,.14),0 1px 0 #0a1218}
  /* the open page: lit and pressed in */
  .am-tab[aria-current="page"]{background:#ffcc00;color:#14212b;transform:translateY(2px);box-shadow:inset 0 2px 0 rgba(255,255,255,.55),0 2px 0 #0a1218}
  .am-tab:focus-visible{outline:3px solid #ffcc00;outline-offset:3px;box-shadow:inset 0 2px 0 rgba(255,255,255,.14),0 4px 0 #0a1218}
  .am-tab[aria-current="page"]:focus-visible{outline-color:#f3ead8}
}
/* five keys on the narrowest phones (320px): a little less padding and type, so "For you" fits whole */
@media (max-width:359px){.am-tabs{gap:4px;padding-left:max(6px,env(safe-area-inset-left,0px));padding-right:max(6px,env(safe-area-inset-right,0px))}.am-tab{padding:4px 2px;font-size:11px}}
@media (max-width:899px) and (prefers-reduced-motion:reduce){.am-tab{transition:none}}
@media print{.am-tabs{display:none!important}}
