/* v168: ant-first home, dismissible feature panels, and reward-ad clarity. */

body.feature-panel-open {
  overflow: hidden;
}

body.feature-panel-open #main-screen {
  z-index: 100;
}

body.feature-panel-open #bottom-nav {
  z-index: 101;
}

.feature-panel-backdrop[hidden] {
  display: none !important;
}

.feature-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: grid;
  padding: max(54px, env(safe-area-inset-top)) 0 calc(72px + env(safe-area-inset-bottom));
  place-items: end center;
  background: rgba(25, 31, 40, 0.34);
}

.feature-panel-shell {
  position: relative;
  display: grid;
  width: min(100%, 480px);
  height: min(84dvh, 820px);
  min-height: 360px;
  grid-template-rows: 56px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #d1d6db;
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: #f2f4f6;
  box-shadow: 0 -12px 34px rgba(25, 31, 40, 0.16);
}

.feature-panel-header {
  position: relative;
  z-index: 3;
  display: grid;
  min-width: 0;
  padding: 6px 10px 6px 20px;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e5e8eb;
  background: #fff;
}

#feature-panel-title {
  overflow: hidden;
  color: #191f28;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: clip;
  white-space: nowrap;
}

#feature-panel-close {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #f2f4f6;
  color: #333d4b;
  font-family: inherit;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

#feature-panel-close:active {
  background: #e5e8eb;
}

.feature-panel-scroll {
  min-height: 0;
  padding: 12px 20px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.feature-panel-scroll > .panel.active {
  display: block;
}

.feature-panel-scroll .milestone-view-tabs {
  position: static;
}

body[data-starter-phase="work"] #panel-home #daytrade-btn,
body[data-starter-phase="work"] #panel-home #free-cash-btn,
body[data-starter-phase="work"] #panel-home #boost-btn,
body[data-starter-phase="buy"] #panel-home #daytrade-btn,
body[data-starter-phase="buy"] #panel-home #free-cash-btn,
body[data-starter-phase="buy"] #panel-home #boost-btn,
body[data-starter-phase="sell"] #panel-home #daytrade-btn,
body[data-starter-phase="sell"] #panel-home #free-cash-btn,
body[data-starter-phase="sell"] #panel-home #boost-btn,
body[data-starter-phase="analyst"] #panel-home #daytrade-btn,
body[data-starter-phase="analyst"] #panel-home #free-cash-btn,
body[data-starter-phase="analyst"] #panel-home #boost-btn,
body[data-starter-phase="daytrade"] #panel-home #free-cash-btn,
body[data-starter-phase="daytrade"] #panel-home #boost-btn {
  display: none !important;
}

#feature-panel-shell > .sticky-sellall-bar {
  position: absolute !important;
  top: 56px !important;
  left: 0 !important;
  z-index: 4 !important;
  width: 100% !important;
  min-height: 58px;
  transform: none !important;
  border: 0 !important;
  border-bottom: 1px solid #e5e8eb !important;
  border-radius: 0 !important;
  padding: 7px 12px !important;
  background: #fff !important;
  box-shadow: 0 8px 18px rgba(25, 31, 40, 0.10) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

#feature-panel-shell > .sticky-sellall-bar.hidden {
  display: none !important;
}

#feature-panel-shell > .sticky-sellall-bar #sticky-sellall-btn {
  min-width: 104px;
  min-height: 42px;
  border: 0 !important;
  background: #f04452 !important;
  color: #fff !important;
  box-shadow: none !important;
}

.boost-choice-thumb {
  position: relative;
  display: block;
  width: 72px;
  height: 56px;
  flex: 0 0 72px;
  overflow: hidden;
  border-radius: 8px;
  background: #f2f4f6;
}

.boost-choice-thumb > img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.boost-choice-thumb > .feature-character-avatar {
  position: absolute;
  z-index: 2;
  bottom: -13%;
  left: var(--fa-l, 4%);
  width: var(--fa-w, 38%);
  height: 108%;
  pointer-events: none;
}

.boost-choice-thumb > .feature-character-avatar > * {
  width: 100%;
  height: 100%;
}

.bonus-confirm-visual .story-image-actor {
  max-width: 46%;
}

body.has-open-modal #ant-avatar-wrap,
body.has-open-modal #ant-action-cue {
  visibility: hidden !important;
}

#ant-avatar[data-character-render^="tier-raster-"] {
  --ant-tier-filter: none !important;
}

#topbar .tier-ant-img,
#asset-title .tier-ant-img {
  filter: none !important;
}

.partial-sell-content {
  width: min(calc(100vw - 32px), 430px) !important;
  padding: 22px 20px 18px !important;
  gap: 12px !important;
}

.partial-sell-content h2,
.partial-sell-content p {
  margin: 0;
  text-align: center;
}

.partial-sell-content h2 {
  color: #191f28;
  font-size: 24px;
  font-weight: 850;
  line-height: 1.25;
}

.partial-sell-content p {
  color: #4e5968;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

.partial-sell-flow {
  display: grid;
  padding: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-radius: 8px;
  background: #f2f4f6;
}

.partial-sell-flow > span {
  display: grid;
  min-width: 0;
  gap: 3px;
  text-align: center;
}

.partial-sell-flow small {
  color: #6b7684;
  font-size: 12px;
  font-weight: 650;
}

.partial-sell-flow strong {
  color: #191f28;
  font-size: 20px;
  font-weight: 850;
}

#sell-sheet-backdrop:has(.sell-portion-chips .onboarding-focus) .sell-portion-chips {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#sell-sheet-backdrop:has(.sell-portion-chips .onboarding-focus) .sell-portion-chips button:not(.onboarding-focus) {
  opacity: 0.38;
}

#buy-sheet-backdrop,
#sell-sheet-backdrop {
  padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important;
}

#panel-home #action-buttons button,
#panel-home #action-buttons button.action-primary {
  min-height: 66px !important;
  grid-template-rows: 32px 18px 14px !important;
}

#panel-home #action-buttons {
  padding-bottom: 7px !important;
}

#panel-home #action-buttons .action-label {
  font-size: 15px !important;
  font-weight: 800 !important;
}

#panel-home #action-buttons .action-status {
  font-size: 11px !important;
}

@media (min-width: 700px) {
  .feature-panel-backdrop {
    padding: 24px;
    place-items: center;
  }

  .feature-panel-shell {
    width: min(calc(100vw - 48px), 820px);
    height: min(calc(100dvh - 48px), 860px);
    border-bottom: 1px solid #d1d6db;
    border-radius: 20px;
  }

  .feature-panel-scroll {
    padding: 16px 22px 32px;
  }
}

@media (min-width: 1280px) {
  .feature-panel-backdrop {
    padding-right: 124px;
  }
}

@media (min-width: 720px) and (max-width: 799px) {
  .feature-panel-backdrop {
    padding: 4px;
  }

  .feature-panel-shell {
    width: calc(100vw - 8px);
    height: calc(100dvh - 8px);
  }

  .feature-panel-scroll {
    padding: 12px 10px 24px;
  }
}

@media (max-width: 360px) {
  .feature-panel-scroll {
    padding-right: 12px;
    padding-left: 12px;
  }

}

#ant-avatar[data-motion-frame="talk"] #ant-character-b,
#ant-avatar[data-motion-frame="step-left"] #ant-character-b,
#ant-avatar[data-motion-frame="step-right"] #ant-character-b {
  animation: antSpriteActionV168 620ms ease-in-out both !important;
}

#ant-avatar[data-motion-frame="celebrate"] #ant-character-b {
  animation: antSpriteCelebrateV168 700ms cubic-bezier(.2, .8, .2, 1) both !important;
}

@keyframes antSpriteActionV168 {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-5px) scale(1.035); }
}

@keyframes antSpriteCelebrateV168 {
  0%, 100% { transform: translateY(0) scale(1); }
  38% { transform: translateY(-10px) scale(1.055); }
  68% { transform: translateY(-4px) scale(1.025); }
}

@media (orientation: landscape) and (max-height: 520px) {
  .feature-panel-backdrop {
    padding: 8px 72px 8px 8px;
  }

  .feature-panel-shell {
    width: min(100%, 760px);
    height: calc(100dvh - 16px);
    border: 1px solid #d1d6db;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feature-panel-shell {
    scroll-behavior: auto;
  }

  #ant-avatar[data-motion-frame] #ant-character-b {
    animation: none !important;
  }
}
