/* TRL AI mobile navigation — shared across the public website. */
@media (max-width: 1023px) {
  #mobile-header {
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 0 !important;
  }

  #mobile-header > div {
    position: relative;
    z-index: 2;
    min-height: 58px;
    padding: 7px 8px 7px 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: #151820 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 32px rgba(4, 6, 9, 0.28) !important;
  }

  #mobile-header > div > a {
    display: grid !important;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 3px !important;
    background: #f3f4f6 !important;
    border-color: rgba(255, 255, 255, 0.26) !important;
  }

  #mobile-header > div > a img {
    width: 32px !important;
    height: 32px !important;
  }

  #mobile-header > div > label {
    position: relative;
    width: 44px !important;
    height: 44px !important;
    color: rgba(255, 255, 255, 0.92);
    background: #20242d !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  #mobile-header .backdrop {
    z-index: 0;
    background: rgba(6, 8, 11, 0.88) !important;
  }

  #mobile-menu {
    position: fixed !important;
    inset: calc(env(safe-area-inset-top, 0px) + 82px) 12px calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
    z-index: 1;
    display: flex;
    flex-direction: column;
    max-height: none !important;
    padding: 20px !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(255, 255, 255, 0.13) !important;
    border-radius: 28px !important;
    background: #11141a !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 24px 60px rgba(3, 5, 8, 0.48) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    transform: translateY(-8px) scale(0.985);
    transition: opacity 240ms cubic-bezier(.16, 1, .3, 1), transform 240ms cubic-bezier(.16, 1, .3, 1) !important;
  }

  #mobile-menu::before {
    content: "";
    position: absolute;
    top: 0;
    left: 22px;
    width: 72px;
    height: 2px;
    border-radius: 999px;
    background: #6f97de;
  }

  #mobile-menu > .mb-2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 14px !important;
  }

  #mobile-menu > .mb-2::after {
    content: "TRL AI / NAVIGATION";
    color: rgba(255, 255, 255, 0.34);
    font: 600 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.14em;
  }

  #mobile-menu > .mb-2 > div {
    color: rgba(255, 255, 255, 0.72) !important;
    font-size: 10px !important;
    letter-spacing: 0.2em !important;
  }

  #mobile-menu > .flex.flex-col {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
    text-align: left !important;
  }

  #mobile-menu > .flex.flex-col > a {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-width: 0;
    min-height: 68px;
    padding: 13px 14px !important;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 17px;
    background: #181c23;
    color: rgba(255, 255, 255, 0.86) !important;
    font-size: 15px !important;
    font-weight: 620 !important;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: transform 200ms cubic-bezier(.16, 1, .3, 1), border-color 200ms, background-color 200ms !important;
  }

  #mobile-menu > .flex.flex-col > a::after {
    position: absolute;
    top: 11px;
    right: 12px;
    color: rgba(255, 255, 255, 0.3);
    font: 600 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.08em;
  }

  #mobile-menu > .flex.flex-col > a:nth-child(1)::after { content: "01"; }
  #mobile-menu > .flex.flex-col > a:nth-child(2)::after { content: "02"; }
  #mobile-menu > .flex.flex-col > a:nth-child(3)::after { content: "03"; }
  #mobile-menu > .flex.flex-col > a:nth-child(4)::after { content: "04"; }
  #mobile-menu > .flex.flex-col > a:nth-child(5)::after { content: "05"; }
  #mobile-menu > .flex.flex-col > a:nth-child(6)::after { content: "06"; }

  #mobile-menu > .flex.flex-col > a.is-current {
    color: #f7f9fc !important;
    border-color: rgba(126, 166, 229, 0.48);
    background: #202a38;
    box-shadow: inset 3px 0 0 #7ea6e5;
  }

  #mobile-menu > .flex.flex-col > a:active {
    transform: scale(0.98);
  }

  #mobile-menu > .mt-5 {
    margin-top: auto !important;
    padding-top: 16px !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    gap: 9px !important;
  }

  #mobile-menu > .mt-5 > a {
    min-height: 52px;
    border-radius: 16px !important;
  }

  #mobile-menu > .mt-5 > a[href="login.html"] {
    background: #191d24 !important;
    border-color: rgba(255, 255, 255, 0.13) !important;
  }

  #mobile-menu > .mt-5 > a[href="signup.html"] {
    color: #d9e7ff !important;
    background: #182334 !important;
    border-color: rgba(126, 166, 229, 0.26) !important;
  }

  #mobile-menu > .mt-5 > a[href="demo.html"],
  #mobile-menu > .mt-5 > a[href="sign-in.html"] {
    color: #11141a !important;
    background: #f4f6f9 !important;
    border: 1px solid #f4f6f9 !important;
    box-shadow: none !important;
  }

  #mobile-menu .site-account-mobile {
    min-height: 52px;
    border-radius: 16px;
    background: #191d24;
  }

  html:has(#nav-toggle:checked),
  body:has(#nav-toggle:checked) {
    overflow: hidden !important;
  }
}

@media (max-width: 359px) {
  #mobile-menu > .flex.flex-col {
    grid-template-columns: 1fr;
  }

  #mobile-menu > .flex.flex-col > a {
    min-height: 48px;
    align-items: center;
  }
}

@media (max-height: 720px) and (max-width: 1023px) {
  #mobile-menu {
    padding: 15px !important;
  }

  #mobile-menu > .mb-2 {
    margin-bottom: 9px !important;
  }

  #mobile-menu > .flex.flex-col > a {
    min-height: 50px;
    padding: 10px 12px !important;
  }

  #mobile-menu > .mt-5 {
    padding-top: 10px !important;
  }

  #mobile-menu > .mt-5 > a,
  #mobile-menu .site-account-mobile {
    min-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mobile-menu,
  #mobile-menu a {
    transition-duration: 0.01ms !important;
  }
}
