/* Header, ad slots, and mobile top navigation */
:root {
  --below-tabs-bg: #f5f9fc;
}

body,
.app,
.home-view,
.results-view {
  background: var(--below-tabs-bg);
}

.home-view:not(.is-hidden),
.results-view:not(.is-hidden),
.results-view.is-previewing {
  background: var(--below-tabs-bg);
}

@media (max-width: 720px) {
  :root {
    --mobile-header-bg: #ffffff;
  }

  .app {
    background: var(--mobile-header-bg);
  }

  .topbar {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    min-height: 56px;
    padding: 12px 16px 10px;
    border-bottom: 0;
    background: var(--mobile-header-bg);
    box-shadow: none;
    backdrop-filter: none;
  }

  .brand-home {
    padding: 0;
  }

  .mobile-top-stack {
    display: contents;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    background: var(--mobile-header-bg);
    overflow-x: clip;
    padding: 0;
  }

  .mobile-ad-banner {
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: calc(100vw - 32px);
    min-width: 0;
    height: 60px;
    min-height: 60px;
    margin: 8px 16px 0;
    border: 0;
    border-radius: 12px;
    background:
      linear-gradient(105deg, #fbfdff 0%, #f5f8fd 56%, #eaf2ff 100%);
    color: #1f2937;
    padding: 0;
    overflow: hidden;
    box-shadow: none;
    text-align: left;
  }

  .mobile-ad-track {
    position: relative;
    display: block;
    gap: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    border-radius: inherit;
    transform: none;
    animation: none;
    will-change: auto;
  }

  .mobile-ad-track.is-dragging {
    cursor: grabbing;
  }

  .mobile-ad-track.is-paused {
    animation-play-state: paused;
  }

  .mobile-ad-track.is-paused .mobile-ad-slide {
    animation-play-state: paused;
  }

  .mobile-ad-track::-webkit-scrollbar {
    display: none;
  }

  .mobile-ad-slide {
    position: absolute;
    inset: 0;
    isolation: isolate;
    width: 100%;
    height: 60px;
    min-height: 60px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 68px;
    grid-template-rows: 1fr;
    align-content: center;
    align-items: center;
    column-gap: 8px;
    row-gap: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 8px 9px 8px 12px;
    overflow: hidden;
    opacity: 1;
    transform: translate3d(100%, 0, 0);
    will-change: transform;
  }

  .mobile-ad-slide:nth-child(1) {
    animation: mobileAdSlotFirst 7.6s ease-in-out infinite;
  }

  .mobile-ad-slide:nth-child(2) {
    animation: mobileAdSlotSecond 7.6s ease-in-out infinite;
  }

  .mobile-ad-track.is-manual .mobile-ad-slide {
    animation: none;
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mobile-ad-track.is-manual .mobile-ad-slide:nth-child(1) {
    transform: translate3d(0, 0, 0);
  }

  .mobile-ad-track.is-manual .mobile-ad-slide:nth-child(2) {
    transform: translate3d(100%, 0, 0);
  }

  .mobile-ad-track.is-manual.is-showing-second .mobile-ad-slide:nth-child(1) {
    transform: translate3d(-100%, 0, 0);
  }

  .mobile-ad-track.is-manual.is-showing-second .mobile-ad-slide:nth-child(2) {
    transform: translate3d(0, 0, 0);
  }

  .mobile-ad-banner img {
    position: relative;
    z-index: 1;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    display: block;
    width: 68px;
    height: 42px;
    border: 0;
    border-radius: 7px;
    object-fit: cover;
    object-position: center;
    box-shadow: none;
    transform: none;
  }

  .mobile-ad-banner::before {
    content: none;
    display: none;
  }

  .mobile-ad-slide::before {
    content: none;
    display: none;
  }

  .mobile-ad-banner span {
    grid-column: 1;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    min-width: 28px;
    height: 18px;
    border: 1px solid #cfdbeb;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.78);
    color: #5d7290;
    padding: 0 5px;
    font-size: 9px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: 0;
  }

  .mobile-ad-banner strong {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
    color: #17243a;
    font-size: 13px;
    font-weight: 720;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-ad-banner em {
    display: none;
  }

  .mobile-ad-slide::after {
    content: none;
    display: none;
  }

  .auth-actions {
    top: 13px;
  }

  @keyframes mobileAdSlotFirst {
    0%,
    40% {
      transform: translate3d(0, 0, 0);
    }

    50% {
      transform: translate3d(-100%, 0, 0);
    }

    50.01%,
    90% {
      transform: translate3d(100%, 0, 0);
    }

    100% {
      transform: translate3d(0, 0, 0);
    }
  }

  @keyframes mobileAdSlotSecond {
    0%,
    40% {
      transform: translate3d(100%, 0, 0);
    }

    50%,
    90% {
      transform: translate3d(0, 0, 0);
    }

    100% {
      transform: translate3d(-100%, 0, 0);
    }
  }

  .mobile-main-tabs {
    position: sticky;
    top: 56px;
    z-index: 65;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    min-height: 64px;
    margin: 0;
    border: 0;
    border-top: 0;
    border-bottom: 0;
    background: var(--mobile-header-bg);
    padding: 10px 16px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-main-tabs::-webkit-scrollbar {
    display: none;
  }

  .mobile-main-tabs button {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #526176;
    padding: 0 14px;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
  }

  .mobile-main-tabs button.active,
  .mobile-main-tabs button[aria-expanded="true"] {
    border-color: var(--hybrid-blue, #256ef4);
    background: var(--hybrid-blue, #256ef4);
    color: #ffffff;
    font-weight: 720;
  }
}

@media (max-width: 380px) {
  .topbar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .mobile-ad-banner {
    width: calc(100% - 28px);
    max-width: calc(100vw - 28px);
    margin-right: 14px;
    margin-left: 14px;
  }

  .mobile-main-tabs {
    padding-right: 14px;
    padding-left: 14px;
  }

  .mobile-main-tabs button {
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (min-width: 721px) {
  .top-promo-banner {
    position: sticky;
    top: 0;
    z-index: 80;
    display: block;
    height: 36px;
    min-height: 36px;
    border: 0;
    border-bottom: 1px solid rgba(223, 230, 239, 0.75);
    background: #f3f6fb;
    color: #475467;
    padding: 0;
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: none;
  }

  .top-promo-track {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    height: 72px;
    margin: 0;
    animation: desktopPromoRotate 4.8s ease-in-out infinite;
    will-change: transform;
  }

  .top-promo-slide {
    position: relative;
    flex: 0 0 36px;
    min-height: 36px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0 clamp(24px, 4vw, 56px);
    overflow: hidden;
    box-shadow: none;
  }

  .top-promo-banner::before {
    display: none;
  }

  .top-promo-slide::before {
    content: none;
    display: none;
  }

  .top-promo-slide img {
    display: none;
  }

  .top-promo-ad-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 17px;
    min-width: 28px;
    border-radius: 4px;
    border: 1px solid currentColor;
    background: transparent;
    color: #475467;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0;
  }

  .top-promo-action {
    white-space: nowrap;
  }

  .top-promo-action {
    display: inline-flex;
    align-items: center;
    max-width: min(720px, calc(100vw - 120px));
    min-height: auto;
    border-radius: 0;
    background: transparent;
    color: #475467;
    padding: 0;
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: none;
  }

  .top-promo-action::after {
    content: none;
    display: none;
  }

  @keyframes desktopPromoRotate {
    0%,
    42% {
      transform: translateY(0);
    }

    50%,
    92% {
      transform: translateY(-36px);
    }

    100% {
      transform: translateY(0);
    }
  }

  .topbar {
    top: 36px;
    min-height: 64px;
  }

  .brand-group {
    display: inline-flex;
    align-items: center;
    gap: clamp(20px, 3vw, 38px);
  }

  .brand-home,
  .main-tabs {
    grid-column: auto;
    grid-row: auto;
  }

  .top-tab-ad-banner {
    display: none;
  }
}

@media (min-width: 721px) {
  .app {
    grid-template-rows: auto auto 1fr auto;
  }

  .top-promo-banner {
    display: block;
    height: 28px;
    min-height: 28px;
    font-size: 12px;
  }

  .top-promo-track {
    height: 56px;
  }

  .top-promo-slide {
    flex-basis: 28px;
    min-height: 28px;
  }

  .top-promo-ad-label {
    height: 15px;
    min-width: 25px;
    font-size: 9px;
  }

  .top-promo-action {
    font-size: 12px;
  }

  .topbar {
    align-self: start;
    top: 28px;
    height: 64px;
    max-height: 64px;
    min-height: 64px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .brand-group {
    display: flex;
    align-items: center;
    gap: 28px;
  }

  @keyframes desktopPromoRotate {
    0%,
    42% {
      transform: translateY(0);
    }

    50%,
    92% {
      transform: translateY(-28px);
    }

    100% {
      transform: translateY(0);
    }
  }
}
