/* ===========================================================================
   SpamShield Mail — phone chrome.

   Everything here is inside a phone media query, so the desktop UI is untouched. The
   mailbox layout itself (list, reading pane, toolbar) lives in mail.css and already
   collapses to one pane at a time; this file carries what only a phone has — the fixed
   bottom bar in the thumb zone, the folder drawer, and the sign-in screen.
   =========================================================================== */

@media (max-width: 767.98px) {

  :root {
    /* Height of the fixed bottom bar plus the iPhone home-indicator inset, so content can
       reserve exactly the right amount of space and no more. */
    --ss-bottombar: 58px;
    --ss-safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  body {
    /* Stops iOS inflating font sizes unpredictably in landscape. */
    -webkit-text-size-adjust: 100%;
  }

  /* 16px inputs stop iOS zooming the page on focus. */
  .form-control, .form-select, .ss-top .ss-gsearch input { font-size: 16px; }

  /* ---------- Bottom navigation ----------
     Fixed, thumb-reachable, and the only navigation you need for triage. */
  .ss-bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--ss-chrome, #0b2545);
    padding-bottom: var(--ss-safe-bottom);
    box-shadow: 0 -1px 0 rgba(255,255,255,.08), 0 -8px 24px rgba(11,37,69,.18);
  }
  .ss-bottomnav a, .ss-bottomnav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-height: var(--ss-bottombar);
    background: none; border: 0; text-decoration: none;
    color: rgba(255,255,255,.66); font-size: .68rem; line-height: 1;
    -webkit-tap-highlight-color: transparent;
  }
  .ss-bottomnav a.active { color: #fff; }
  .ss-bottomnav a.active svg { stroke: #3f92ff; }
  .ss-bottomnav svg { width: 22px; height: 22px; }

  /* Unread/spam counts, kept small so they never obscure the icon. */
  .ss-bottomnav .ss-dot {
    position: absolute; transform: translate(12px, -12px);
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
    background: #e5484d; color: #fff; font-size: .62rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
  }
  .ss-bottomnav .ss-navitem { position: relative; }

  /* Compose is the one creative action; it reads as primary. */
  .ss-bottomnav .ss-compose-tab { color: #fff; }
  .ss-bottomnav .ss-compose-tab svg {
    background: var(--ss-blue, #1f6feb); border-radius: 999px;
    padding: 4px; width: 26px; height: 26px; stroke: #fff;
  }

  /* ---------- Folder drawer ---------- */
  .ss-drawer .offcanvas-body { padding-top: .25rem; }
  .ss-drawer .btn-close { width: 44px; height: 44px; background-size: 16px; margin-right: -.25rem; }
  .ss-drawer .ss-navlink { min-height: 44px; }
  .ss-drawer .btn { min-height: 44px; }

  /* Alerts are informational, not a wall. */
  .alert { font-size: .9rem; padding: .6rem .8rem; }

  /* ---------- Sign-in ----------
     The first screen anyone sees on a phone, and the one where a mistyped character costs
     the most. */
  .ss-auth .card-body { padding: 1.5rem !important; }
  .ss-auth .form-control { min-height: 46px; font-size: 16px; }
  .ss-auth .btn { min-height: 46px; font-size: 1rem; }
  .ss-auth-logo { max-width: 200px; }
}

/* The drawer is phone-and-tablet: the rail is hidden below lg, so the drawer carries the folders there. */
@media (min-width: 768px) and (max-width: 991.98px) {
  .ss-drawer { width: 320px; }
}

/* Installed (home-screen) mode: no browser chrome, so the top bar is the status bar's
   neighbour and needs the notch inset itself. */
@media (display-mode: standalone) {
  .ss-top { padding-top: calc(env(safe-area-inset-top, 0px)); }
}
