/* v335 — one mobile presentation rail on every viewport, with roomy nearby speech. */
@keyframes v335TutorialFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

body[data-mobile-shell-release="335"] :is(
  #work-tutorial-modal,
  #first-buy-modal,
  #partial-sell-modal,
  #loss-cut-modal,
  #analyst-hire-modal,
  #daytrade-modal
).modal.dialog-modal.dialog-modal--tutorial:not(.hidden) > .modal-content.dialog-card {
  animation: v335TutorialFade 140ms ease-out both !important;
}

body[data-mobile-shell-release="335"][data-tutorial-pagination-release="332"][data-speech-layout-release="266"] :is(
  #work-tutorial-modal,
  #first-buy-modal,
  #partial-sell-modal,
  #loss-cut-modal,
  #analyst-hire-modal,
  #daytrade-modal
) .tutorial-ant-speech {
  box-sizing: border-box;
  width: min(272px, calc(100% - 24px)) !important;
  max-width: min(272px, calc(100% - 24px)) !important;
  min-height: 52px !important;
  max-height: 66px !important;
  padding: 9px 14px !important;
  row-gap: 2px;
  font-size: 16px !important;
  line-height: 22px !important;
}

html body[data-mobile-shell-release="335"]:has(#app[data-watch-guide-release="333"]) :is(
  #work-tutorial-modal,
  #first-buy-modal,
  #partial-sell-modal,
  #loss-cut-modal,
  #analyst-hire-modal,
  #daytrade-modal
) .tutorial-ant-speech {
  line-height: 22px !important;
}

body[data-mobile-shell-release="335"][data-first-buy-density-release="325"] #first-buy-modal .tutorial-ant-speech {
  top: var(--tutorial-speech-top, 8px) !important;
}

body[data-mobile-shell-release="335"][data-tutorial-pagination-release="332"] #analyst-hire-modal[data-story-growth-coach="true"] .tutorial-ant-speech {
  max-height: 66px !important;
  padding-block: 9px !important;
}

body[data-mobile-shell-release="335"][data-tutorial-pagination-release="332"][data-speech-layout-release="266"] :is(
  #work-tutorial-modal,
  #first-buy-modal,
  #partial-sell-modal,
  #loss-cut-modal,
  #analyst-hire-modal,
  #daytrade-modal
) .tutorial-ant-speech :is(.speech-line, .speech-number, .speech-glyph) {
  line-height: inherit !important;
}

body[data-mobile-shell-release="335"] [data-speech-mode="typewriter"] .speech-glyph {
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 90ms linear, transform 90ms ease-out;
}

body[data-mobile-shell-release="335"] [data-speech-mode="typewriter"] .speech-glyph[data-speech-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

html body[data-mobile-shell-release="335"]:has(#app[data-watch-guide-release="333"]) :is(
  #work-tutorial-modal,
  #first-buy-modal,
  #partial-sell-modal,
  #loss-cut-modal,
  #analyst-hire-modal,
  #daytrade-modal,
  #milestone-modal
) :is(
  #work-tutorial-next-btn,
  #first-buy-next-btn,
  #partial-sell-next-btn,
  #loss-cut-next-btn,
  #analyst-hire-next-btn,
  #daytrade-start-btn,
  #milestone-modal-confirm-btn
)[data-tutorial-sequence-action] {
  box-shadow: 0 2px 0 #1769e5 !important;
}

html body[data-mobile-shell-release="335"]:has(#app[data-watch-guide-release="333"]) :is(
  #life-preview-confirm.tutorial-focus,
  .life-preview-confirm[data-complete-life-preview]
) {
  box-shadow: 0 2px 0 #1769e5 !important;
}

html body[data-mobile-shell-release="335"]:has(#app[data-watch-guide-release="333"]) :is(
  #work-tutorial-modal,
  #first-buy-modal,
  #partial-sell-modal,
  #loss-cut-modal,
  #analyst-hire-modal,
  #daytrade-modal,
  #milestone-modal
) :is(
  #work-tutorial-next-btn,
  #first-buy-next-btn,
  #partial-sell-next-btn,
  #loss-cut-next-btn,
  #analyst-hire-next-btn,
  #daytrade-start-btn,
  #milestone-modal-confirm-btn
)[data-tutorial-sequence-action]:disabled {
  box-shadow: none !important;
}

@media (min-width: 700px) {
  html {
    background: #e5e8eb;
  }

  body[data-mobile-shell-release="335"] {
    width: 480px;
    max-width: 480px;
    min-height: 100dvh;
    margin-inline: auto;
    overflow-x: hidden;
    background: #f2f4f6;
    box-shadow: 0 0 36px rgb(25 31 40 / 18%);
  }

  body[data-mobile-shell-release="335"] :is(#app, #topbar, #main-screen) {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 480px !important;
  }

  body[data-mobile-shell-release="335"] #main-screen {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-mobile-shell-release="335"] #bottom-nav {
    display: none !important;
    left: 50% !important;
    right: auto !important;
    width: 480px !important;
    max-width: 100vw !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    transform: translateX(-50%) !important;
  }

  body[data-mobile-shell-release="335"] #home-feature-nav {
    display: grid;
    width: 100%;
    max-width: none;
    margin: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding-inline: 12px;
  }

  body[data-mobile-shell-release="335"] #bottom-nav .nav-btn {
    min-width: 0 !important;
    padding: 8px 4px !important;
  }

  body[data-mobile-shell-release="335"] #bottom-nav .nav-btn .nav-badge {
    inset: -5px 0 auto auto !important;
  }

  body[data-mobile-shell-release="335"] :is(.modal:not(#splash), .feature-panel-backdrop) {
    left: 50% !important;
    right: auto !important;
    width: 480px !important;
    max-width: 100vw !important;
    transform: translateX(-50%);
  }

  body[data-mobile-shell-release="335"] :is(
    .dialog-modal,
    #help-modal,
    #utility-modal,
    #save-modal,
    #ranking-modal
  ) {
    align-items: flex-end !important;
  }

  body[data-mobile-shell-release="335"] :is(
    .dialog-modal,
    #help-modal,
    #utility-modal,
    #save-modal,
    #ranking-modal
  ) > .modal-content {
    width: min(calc(100% - 20px), 480px) !important;
    border-radius: 16px 16px 8px 8px !important;
    box-shadow: 0 18px 42px rgb(25 31 40 / 22%) !important;
  }

  body[data-mobile-shell-release="335"] :is(
    .dialog-modal,
    #help-modal,
    #utility-modal,
    #save-modal,
    #ranking-modal
  ) > .modal-content::before {
    display: block;
  }

  body[data-mobile-shell-release="335"] .feature-panel-backdrop {
    box-sizing: border-box;
    place-items: end center !important;
    padding: max(54px, env(safe-area-inset-top)) 0 0 !important;
  }

  body[data-mobile-shell-release="335"] .feature-panel-shell {
    width: 100% !important;
    max-width: 480px !important;
    height: min(84dvh, 820px) !important;
    border-radius: 20px 20px 0 0 !important;
  }

  body[data-mobile-shell-release="335"] #avatar-scene {
    width: calc(100% - 12px) !important;
    max-width: none !important;
  }

  body[data-mobile-shell-release="335"] #avatar-scene .ant-scene-dialogue:not([data-dialogue-kind="growth"]) strong {
    font-size: 18px !important;
    line-height: 23px !important;
  }

  body[data-mobile-shell-release="335"] #avatar-scene .ant-scene-dialogue:not([data-dialogue-kind="growth"]) small {
    font-size: 15px !important;
    line-height: 21px !important;
  }

  body[data-mobile-shell-release="335"] #avatar-scene .ant-action-cue strong {
    font-size: 15px !important;
    line-height: 20px !important;
  }

  body[data-mobile-shell-release="335"] #daytrade-modal[data-practice="true"]:not(.is-intro) > .daytrade-content:has(#daytrade-result.hidden) {
    width: min(calc(100% - 20px), 480px) !important;
    max-width: 480px !important;
  }

  body[data-mobile-shell-release="335"] #daytrade-modal[data-practice="true"]:not(.is-intro) #daytrade-field {
    height: clamp(260px, 42dvh, 360px);
    min-height: 260px;
    flex-basis: clamp(260px, 42dvh, 360px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-mobile-shell-release="335"] [data-speech-mode="typewriter"] .speech-glyph {
    transform: none;
    transition: none;
  }
}
