.mobile-site-chrome {
  display: none;
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.mobile-home-page {
    padding-top: 46px;
  }

  body.mobile-sub-page {
    padding-top: 56px;
  }

  body.mobile-home-page.mobile-app-banner-closed {
    padding-top: 46px;
  }

  body.mobile-drawer-open {
    overflow: hidden;
  }

  .header,
  .nav-wrap {
    display: none !important;
  }

  .mobile-site-chrome {
    display: block;
    position: relative;
    z-index: 1600;
    font-family: Arial, "Microsoft JhengHei", "PingFang TC", sans-serif;
  }

  .mobile-app-banner {
    position: fixed;
    z-index: 1602;
    inset: 0 0 auto;
    height: 61px;
    display: grid;
    grid-template-columns: 32px 42px minmax(0, 1fr) 126px;
    align-items: center;
    gap: 8px;
    padding: 0 14px 0 10px;
    border-top: 3px solid #4b007f;
    background: #eee;
    color: #111;
  }

  .mobile-app-close {
    border: 0;
    padding: 0;
    background: transparent;
    color: #aaa;
    font: 700 29px/1 Arial, sans-serif;
  }

  .mobile-app-icon {
    width: 37px;
    height: 37px;
    border-radius: 7px;
    object-fit: cover;
  }

  .mobile-app-copy {
    min-width: 0;
    font-size: 13px;
    line-height: 1.22;
    white-space: nowrap;
  }

  .mobile-app-download {
    height: 31px;
    border: 0;
    border-radius: 8px;
    background: #50008c;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
  }

  .mobile-topbar {
    position: fixed;
    z-index: 1601;
    top: 61px;
    left: 0;
    right: 0;
    height: 46px;
    overflow: hidden;
    background: #071f82;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .22);
  }

  .mobile-topbar.without-app-banner {
    top: 0;
  }

  /* Homepage navigation stays flush to the viewport top. */
  .mobile-home .mobile-app-banner {
    display: none;
  }

  .mobile-home .mobile-topbar {
    top: 0;
  }

  .mobile-home .mobile-drawer {
    top: 46px;
  }

  .mobile-home .mobile-drawer-overlay {
    inset-block-start: 46px;
  }

  .mobile-site-chrome:has(.mobile-topbar.without-app-banner) .mobile-drawer {
    top: 46px;
  }

  .mobile-site-chrome:has(.mobile-topbar.without-app-banner) .mobile-drawer-overlay {
    inset-block-start: 46px;
  }

  .mobile-sub-page .mobile-app-banner {
    display: none;
  }

  .mobile-sub-page .mobile-topbar {
    top: 0;
    height: 56px;
  }

  .mobile-topbar-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
  }

  .mobile-topbar-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 50px 1fr 50px;
    align-items: center;
  }

  .mobile-menu-toggle,
  .mobile-back {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #fff;
  }

  .mobile-menu-toggle img {
    width: 23px;
    height: 23px;
    filter: brightness(0) invert(1);
  }

  .mobile-back {
    font: 300 36px/1 Arial, sans-serif;
    padding-bottom: 4px;
  }

  .mobile-brand-logo {
    justify-self: center;
    width: 145px;
    height: auto;
    max-height: 38px;
    object-fit: contain;
  }

  .mobile-page-title {
    justify-self: center;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  }

  .mobile-wheel-link {
    justify-self: center;
    width: 29px;
    height: 29px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, .75);
    border-radius: 50%;
    background: #db4c3e;
    color: #fff;
    font-size: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  }

  .mobile-drawer-overlay {
    position: fixed;
    z-index: 1603;
    inset: 107px 0 0;
    border: 0;
    background: rgba(0, 0, 0, .52);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
  }

  .mobile-sub-page .mobile-drawer-overlay {
    inset-block-start: 56px;
  }

  .mobile-drawer {
    position: fixed;
    z-index: 1604;
    top: 107px;
    bottom: 0;
    left: 0;
    width: min(326px, 86vw);
    overflow-y: auto;
    transform: translateX(-102%);
    transition: transform .24s ease;
    background: #fff;
    box-shadow: 7px 0 24px rgba(0, 0, 0, .24);
  }

  .mobile-sub-page .mobile-drawer {
    top: 56px;
  }

  .mobile-site-chrome.is-open .mobile-drawer {
    transform: translateX(0);
  }

  .mobile-site-chrome.is-open .mobile-drawer-overlay {
    opacity: 1;
    visibility: visible;
  }

  .mobile-drawer-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #eee;
    padding: 14px 12px;
  }

  .mobile-drawer-auth button {
    height: 42px;
    border: 0;
    color: #fff;
    font-size: 15px;
  }

  .mobile-drawer-auth .login {
    background: #51008e;
    border-radius: 6px 0 0 6px;
  }

  .mobile-drawer-auth .join {
    background: #d40000;
    border-radius: 0 6px 6px 0;
  }

  .mobile-drawer-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 16px 10px 22px;
    gap: 8px 4px;
  }

  .mobile-drawer-nav a {
    min-height: 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #3b3b3b;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
  }

  .mobile-drawer-nav a:active,
  .mobile-drawer-nav a.is-current {
    color: #540093;
    background: #f4e9ff;
  }

  .mobile-drawer-nav .drawer-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #5b1692;
    color: #fff;
    font-size: 14px;
  }

  .mobile-auth-strip {
    display: none;
  }

  .mobile-home-page .mobile-auth-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 10px;
    border-radius: 6px;
    overflow: hidden;
    background: #eee;
  }

  .mobile-auth-strip button {
    height: 43px;
    border: 0;
    color: #fff;
    font-size: 15px;
  }

  .mobile-auth-strip .login {
    background: #50008c;
  }

  .mobile-auth-strip .join {
    background: #d50000;
  }

  /* Existing desktop footer, rearranged to match the compact mobile footer. */
  .site-footer {
    font-size: 12px;
  }

  .site-footer .footer-inner {
    padding: 22px 18px !important;
  }

  .site-footer .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 18px !important;
  }

  .site-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0 !important;
  }

  .site-footer .footer-links a {
    padding: 0 9px;
    margin: 4px 0;
    border-right: 1px solid #bbb;
  }

  .site-footer .footer-links a:first-child {
    padding-left: 0;
  }
}

@media (max-width: 370px) {
  .mobile-app-banner {
    grid-template-columns: 28px 38px minmax(0, 1fr) 106px;
    gap: 6px;
    padding-inline: 7px;
  }

  .mobile-app-copy {
    font-size: 12px;
  }

  .mobile-app-download {
    font-size: 13px;
  }
}
