/* =========================================================
   QNG RESPONSIVE SYSTEM V1
   Breakpoints:
   - Large desktop: 1440+
   - Notebook: 1024–1439
   - Tablet: 768–1023
   - Mobile portrait: <=767
   - Mobile landscape: short landscape screens
========================================================= */

:root {
  --qng-responsive-gutter: clamp(14px, 3vw, 34px);
  --qng-responsive-radius: clamp(14px, 2vw, 24px);
  --qng-touch-target: 44px;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

/* =========================================================
   LARGE DESKTOP — breathing room without uncontrolled growth
========================================================= */
@media (min-width: 1440px) {
  .public-header,
  .hero-section,
  .preview-section {
    width: min(1510px, calc(100% - 80px));
  }

  .home-main,
  .journey-main {
    padding-left: 30px;
    padding-right: 30px;
  }

  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
  }

  .journey-layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
  }
}

/* =========================================================
   NOTEBOOK — 1024–1439
========================================================= */
@media (min-width: 1024px) and (max-width: 1439px) {
  .public-header,
  .hero-section,
  .preview-section {
    width: calc(100% - 44px);
  }

  .hero-section {
    gap: clamp(34px, 4vw, 58px);
    grid-template-columns: minmax(0, .92fr) minmax(500px, 1.08fr);
  }

  .hero-copy h1 {
    font-size: clamp(54px, 6vw, 78px);
  }

  .hero-carousel {
    min-height: 440px;
  }

  .preview-grid {
    grid-template-columns: minmax(0, 1fr) minmax(315px, 350px);
  }

  .home-main,
  .journey-main {
    padding-left: 18px;
    padding-right: 18px;
  }

  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 370px);
  }

  .journey-layout {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 370px);
  }

  .qng-topbar,
  .journey-topbar {
    gap: 20px;
  }
}

/* =========================================================
   TABLET — 768–1023
========================================================= */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --qng-sidebar-width: 76px;
  }

  /* Landing */
  .public-header,
  .hero-section,
  .preview-section {
    width: calc(100% - 36px);
  }

  .public-header {
    min-height: 78px;
  }

  .hero-section {
    padding: 42px 0 62px;
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-copy h1 {
    font-size: clamp(58px, 9vw, 82px);
  }

  .hero-product {
    width: 100%;
    max-width: 900px;
    margin-inline: auto;
  }

  .hero-carousel {
    min-height: 480px;
  }

  .device-stage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .device-art-desktop { width: min(210px, 100%); }
  .device-art-mobile { width: min(82px, 100%); }
  .device-art-vr { width: min(145px, 100%); }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .preview-result {
    grid-column: 1 / -1;
  }

  /* Auth */
  .auth-shell {
    display: grid;
    grid-template-columns: minmax(300px, .82fr) minmax(430px, 1.18fr);
  }

  .auth-visual {
    min-height: 100vh;
    padding: 24px 24px 30px;
  }

  .auth-logo {
    width: 132px;
    height: 75px;
  }

  .auth-visual-copy {
    margin-top: 28px;
  }

  .auth-kicker,
  .auth-eyebrow {
    font-size: clamp(13px, 2vw, 19px);
  }

  .auth-visual-copy h2 {
    font-size: clamp(38px, 5.8vw, 56px);
  }

  .auth-preview {
    height: clamp(230px, 29vh, 300px) !important;
  }

  .auth-form-side {
    padding-inline: 28px;
  }

  .auth-form-card {
    width: min(500px, 100%);
    min-height: auto !important;
  }

  /* Home */
  .home-main {
    padding: 0 16px 26px;
  }

  .qng-topbar {
    min-height: auto;
    padding: 20px 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
  }

  .topbar-stats {
    gap: 14px;
  }

  .topbar-stat {
    min-width: 70px;
    padding-left: 14px;
  }

  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
    gap: 14px;
  }

  .current-location-content {
    width: min(65%, 520px);
    padding-inline: 26px;
  }

  /* Journey */
  .journey-main {
    padding: 0 14px 22px;
  }

  .journey-layout {
    grid-template-columns: 1fr;
  }

  .journey-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .journey-panel > * {
    min-width: 0;
  }

  /* Game HUD */
  .singleplayer-hud {
    width: min(600px, calc(100vw - 190px));
  }

  #roomsGeral.rooms {
    padding-inline: 18px;
  }
}

/* =========================================================
   MOBILE PORTRAIT — <=767
========================================================= */
@media (max-width: 767px) {
  :root {
    --qng-sidebar-width: 100%;
  }

  /* Global mobile rhythm */
  .button,
  .auth-submit,
  .journey-checkpoint-action,
  .journey-free-practice-button {
    min-height: var(--qng-touch-target);
  }

  /* Landing header */
  .public-header {
    width: calc(100% - 24px);
    min-height: 68px;
    gap: 10px;
  }

  .public-logo {
    width: 104px;
    height: 58px;
  }

  .public-actions {
    gap: 8px;
  }

  .public-actions .button {
    min-height: 40px;
    padding-inline: 13px;
    font-size: 9px;
  }

  .public-actions .button-ghost {
    display: none;
  }

  .hero-section,
  .preview-section {
    width: calc(100% - 24px);
  }

  .hero-section {
    padding: 34px 0 52px;
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .hero-copy {
    text-align: center;
  }

  .eyebrow {
    font-size: clamp(20px, 7vw, 32px) !important;
    letter-spacing: .10em;
  }

  .hero-copy h1 {
    margin-top: 14px;
    font-size: clamp(43px, 14.5vw, 66px);
    line-height: .96;
  }

  .hero-lead {
    font-size: 17px;
  }

  .hero-support {
    max-width: 34rem;
    margin-inline: auto;
    font-size: 13px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-actions .button-large {
    width: min(100%, 340px);
  }

  .hero-background {
    opacity: .55;
  }

  .hero-flight-path,
  .flight-route {
    max-width: 45vw;
  }

  .hero-carousel {
    min-height: clamp(340px, 102vw, 470px);
  }

  .product-window,
  .devices-window {
    border-radius: 16px;
  }

  .product-window-bar {
    padding-inline: 12px;
  }

  .product-window-bar small {
    max-width: 62vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .product-window > img {
    min-height: 210px;
    max-height: 300px;
    object-fit: cover;
  }

  .product-window-caption {
    padding: 13px 14px;
    align-items: flex-start;
    gap: 10px;
  }

  .product-window-caption strong {
    font-size: 13px;
  }

  .devices-window {
    padding: 24px 14px 20px;
  }

  .devices-window h2 {
    font-size: 30px;
  }

  .device-stage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 8px;
  }

  .device-visual {
    min-height: 110px;
  }

  .device-art-desktop { width: 120px; }
  .device-art-mobile { width: 48px; }
  .device-art-vr { width: 82px; }
  .device strong { font-size: 9px; }

  .hero-carousel-dots {
    margin-top: 14px;
  }

  .preview-section {
    padding-bottom: 48px;
  }

  .preview-heading {
    gap: 12px;
  }

  .preview-heading h2 {
    font-size: clamp(30px, 10vw, 44px);
  }

  .preview-shell {
    padding: 9px;
    border-radius: 16px;
  }

  .preview-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .journey-video-card {
    border-radius: 12px;
  }

  .journey-video-controls {
    padding-inline: 9px;
  }

  .journey-volume-range,
  .journey-time-display {
    display: none;
  }

  .preview-panel {
    grid-template-columns: 1fr;
  }

  .preview-panel-heading {
    min-height: 46px;
  }

  .preview-checkpoint-row {
    min-height: 68px;
    grid-template-columns: 36px 36px minmax(0, 1fr) 30px;
    padding: 8px;
  }

  .preview-checkpoint-avatar {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .preview-overlay-action {
    width: calc(100% - 28px);
    max-width: 330px;
  }

  .preview-reward-modal {
    padding: 8px;
  }

  .preview-reward-card {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 22px 14px 16px;
  }

  .preview-reward-header h2 {
    font-size: clamp(28px, 9.5vw, 40px);
  }

  .preview-reward-grid {
    grid-template-columns: 1fr;
  }

  .preview-memory-card {
    min-height: auto;
  }

  .preview-access-card {
    grid-template-columns: 1fr;
  }

  .preview-boarding-ticket {
    grid-template-columns: 1fr 72px;
  }

  /* Auth mobile */
  body.auth-page {
    overflow-y: auto !important;
  }

  .auth-shell {
    display: block;
    min-height: 100dvh;
  }

  .auth-visual {
    min-height: auto;
    padding: 18px 18px 24px;
  }

  .auth-logo {
    width: 118px;
    height: 66px;
  }

  .auth-visual-copy {
    margin-top: 12px;
  }

  .auth-kicker {
    font-size: 14px;
  }

  .auth-visual-copy h2 {
    margin-top: 9px;
    font-size: clamp(34px, 11vw, 48px);
  }

  .auth-visual-copy p {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.45;
  }

  .auth-preview {
    display: block !important;
    width: 100%;
    height: clamp(190px, 54vw, 260px) !important;
    margin-top: 18px;
  }

  .auth-route {
    margin-top: 18px !important;
    padding-top: 0 !important;
    font-size: 10px;
  }

  .auth-form-side {
    min-height: auto;
    padding: 76px 12px 28px;
    justify-content: flex-start;
  }

  .auth-back {
    top: 18px;
    right: 14px;
    left: 14px;
    width: fit-content;
    min-height: 42px;
    font-size: 11px;
  }

  .auth-form-card {
    width: 100%;
    min-height: auto !important;
    padding: 24px 18px;
    border-radius: 18px;
  }

  .auth-eyebrow {
    font-size: 13px;
  }

  .auth-form-header h1 {
    font-size: clamp(29px, 9vw, 39px);
  }

  .auth-field-grid {
    grid-template-columns: 1fr;
  }

  .auth-input-wrap,
  .auth-input-wrap input {
    min-height: 50px;
  }

  .auth-recaptcha {
    max-width: 100%;
    justify-content: center;
    overflow: hidden;
  }

  .auth-recaptcha .g-recaptcha {
    transform-origin: center top;
  }

  .auth-legal {
    font-size: 11px !important;
  }

  /* Home mobile: sidebar becomes fixed bottom navigation */
  .home-shell {
    display: block;
    min-height: 100dvh;
  }

  .home-shell > .qng-sidebar {
    width: 100%;
    min-width: 0;
    min-height: 66px;
    height: 66px;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 9000;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--qng-sidebar-line);
  }

  .home-shell > .qng-sidebar .qng-sidebar-logo,
  .home-shell > .qng-sidebar .qng-sidebar-stamp {
    display: none;
  }

  .home-shell > .qng-sidebar .qng-sidebar-navigation {
    height: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 0;
    border-radius: 0;
  }

  .home-shell > .qng-sidebar .qng-sidebar-link {
    min-height: 52px;
    padding: 4px 2px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border: 0;
    border-left: 0;
  }

  .home-shell > .qng-sidebar .qng-sidebar-link.exit {
    margin-top: 0;
  }

  .home-shell > .qng-sidebar .qng-sidebar-label {
    display: block;
    font-size: 8px;
    white-space: nowrap;
  }

  .home-shell > .qng-sidebar .qng-sidebar-icon {
    width: auto;
    font-size: 20px;
  }

  .home-main {
    padding: 0 12px calc(88px + env(safe-area-inset-bottom));
  }

  .qng-topbar {
    min-height: auto;
    padding: 16px 0;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .topbar-user {
    min-width: 0;
  }

  .topbar-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .topbar-stat {
    min-width: 0;
    padding: 9px 7px;
    justify-content: center;
    border: 1px solid var(--qng-line);
    border-radius: 11px;
  }

  .topbar-stat strong { font-size: 17px; }
  .topbar-stat small { font-size: 8px; }

  .dashboard-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "current"
      "next"
      "missions"
      "map"
      "news";
    gap: 12px;
  }

  .current-location-card {
    min-height: 420px;
  }

  .current-location-overlay {
    background:
      linear-gradient(to top, rgba(3,11,20,.98) 0%, rgba(3,11,20,.72) 55%, rgba(3,11,20,.2) 100%);
  }

  .current-location-content {
    width: 100%;
    min-height: 420px;
    padding: 190px 20px 78px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .current-location-content h1 {
    font-size: clamp(38px, 13vw, 58px);
  }

  .next-destination-card,
  .dashboard-missions > *,
  .dashboard-map > *,
  .dashboard-news > * {
    width: 100%;
  }

  /* Journey mobile */
  .journey-shell {
    display: block;
  }

  .journey-shell > .qng-sidebar {
    width: 100%;
    min-width: 0;
    min-height: 66px;
    height: 66px;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 9000;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--qng-sidebar-line);
  }

  .journey-shell > .qng-sidebar .qng-sidebar-logo,
  .journey-shell > .qng-sidebar .qng-sidebar-stamp {
    display: none;
  }

  .journey-shell > .qng-sidebar .qng-sidebar-navigation {
    height: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 0;
  }

  .journey-shell > .qng-sidebar .qng-sidebar-link {
    min-height: 52px;
    padding: 4px 2px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border: 0;
  }

  .journey-shell > .qng-sidebar .qng-sidebar-label {
    display: block;
    font-size: 8px;
  }

  .journey-shell > .qng-sidebar .qng-sidebar-icon {
    width: auto;
    font-size: 20px;
  }

  .journey-main {
    padding: 0 10px calc(86px + env(safe-area-inset-bottom));
  }

  .journey-topbar {
    min-height: auto;
    padding: 14px 2px;
    gap: 10px;
  }

  .journey-phase-icon {
    width: 42px;
    height: 42px;
    font-size: 23px;
  }

  .journey-heading h1 {
    font-size: clamp(23px, 7vw, 34px);
  }

  .journey-currency-item span:last-child {
    display: none;
  }

  .journey-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .journey-panel {
    display: flex;
    flex-direction: column;
  }

  .journey-speech-bubble {
    max-width: min(72vw, 260px);
    top: 18%;
    left: 14%;
    padding: 12px 16px;
    font-size: clamp(18px, 6vw, 27px);
  }

  .journey-microphone-overlay {
    right: 10px;
    bottom: 62px;
  }

  .journey-checkpoint-item {
    min-width: 0;
  }

  .journey-checkpoint-content strong {
    white-space: normal;
  }

  .journey-checkpoint-action {
    min-width: 76px;
    padding-inline: 8px;
  }

  /* Singleplayer / Multiplayer mobile */
  .singleplayer-logo-toggle {
    top: max(8px, env(safe-area-inset-top));
    left: 8px;
    width: 66px;
    height: 52px;
    padding: 5px;
    border-radius: 13px;
  }

  .singleplayer-hud {
    top: max(8px, env(safe-area-inset-top));
    left: 82px;
    width: calc(100vw - 90px);
    min-height: 52px;
    padding: 7px 9px;
    gap: 8px;
    border-radius: 14px;
    transform: none;
  }

  .singleplayer-hud-location strong {
    font-size: 14px;
  }

  .singleplayer-hud-kicker,
  .singleplayer-hud-location > span:last-child {
    font-size: 7px;
  }

  .singleplayer-hud-grins {
    gap: 5px;
  }

  .singleplayer-hud-total,
  .singleplayer-hud-earned {
    min-width: 56px;
    padding: 6px;
    border-radius: 9px;
  }

  .singleplayer-hud-total strong,
  .singleplayer-hud-earned strong {
    font-size: 14px;
  }

  .singleplayer-hud-total small,
  .singleplayer-hud-earned small {
    font-size: 6px;
  }

  .singleplayer-mic-shell {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .singleplayer-mic-button {
    min-width: 62px;
    min-height: 62px;
  }

  #roomsGeral.rooms {
    padding: 76px 10px 12px;
    overflow-y: auto;
  }

  #roomsGeral .cont {
    width: 100%;
    min-height: 0;
    max-height: none;
    padding: 18px 12px;
    gap: 14px;
    overflow: visible;
    border-radius: 18px;
  }

  #roomsGeral .carrosselGame {
    flex-direction: column;
    gap: 12px;
  }

  #roomsGeral .gameMode {
    width: 100%;
    min-height: 0;
    grid-template-columns: 100px minmax(0, 1fr);
    grid-template-rows: 1fr;
  }

  #roomsGeral .imgGameMode {
    width: 100px;
    height: 100px;
    padding: 12px;
  }

  #roomsGeral .gameMode .label,
  #roomsGeral .label {
    display: grid;
    place-items: center;
    padding: 12px;
    text-align: left;
  }

  /* Shared modal/dialog safety */
  .qng-travel-log-backdrop,
  .journey-modal-backdrop,
  .season-map-backdrop {
    padding: 8px;
  }

  .qng-travel-log-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }
}

/* =========================================================
   EXTRA-SMALL PORTRAIT — <=420
========================================================= */
@media (max-width: 420px) {
  .public-actions .button-yellow {
    padding-inline: 10px;
    font-size: 8px;
  }

  .eyebrow {
    font-size: 18px !important;
  }

  .hero-copy h1 {
    font-size: clamp(40px, 14vw, 54px);
  }

  .device-stage {
    gap: 4px;
  }

  .device-art-desktop { width: 102px; }
  .device-art-mobile { width: 42px; }
  .device-art-vr { width: 70px; }

  .auth-preview-label strong {
    font-size: 20px;
  }

  .auth-form-card {
    padding-inline: 14px;
  }

  .current-location-content {
    padding-inline: 16px;
  }
}

/* =========================================================
   MOBILE LANDSCAPE — short horizontal screens
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  /* Landing: keep content readable, allow normal page scroll */
  .public-header {
    min-height: 58px;
  }

  .public-logo {
    width: 92px;
    height: 50px;
  }

  .hero-section {
    padding: 20px 0 34px;
    grid-template-columns: minmax(0, .85fr) minmax(360px, 1.15fr);
    gap: 26px;
    align-items: center;
  }

  .hero-copy {
    text-align: left;
  }

  .eyebrow {
    font-size: 18px !important;
  }

  .hero-copy h1 {
    font-size: clamp(40px, 7vw, 60px);
  }

  .hero-lead {
    font-size: 14px;
  }

  .hero-support {
    display: none;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .hero-carousel {
    min-height: 310px;
  }

  .product-window > img {
    min-height: 185px;
    max-height: 210px;
  }

  .devices-window {
    min-height: 285px;
    padding: 18px;
  }

  .device-stage {
    margin-top: 16px;
  }

  /* Auth: keep two columns and scroll only if content genuinely needs it */
  .auth-shell {
    display: grid;
    grid-template-columns: .72fr 1.28fr;
  }

  .auth-visual {
    min-height: 100dvh;
    padding: 10px 18px;
  }

  .auth-logo {
    width: 88px;
    height: 48px;
  }

  .auth-visual-copy {
    margin-top: 4px;
  }

  .auth-kicker {
    font-size: 10px;
  }

  .auth-visual-copy h2 {
    margin-top: 4px;
    font-size: 30px;
  }

  .auth-visual-copy p,
  .auth-preview,
  .auth-route {
    display: none !important;
  }

  .auth-form-side {
    min-height: 100dvh;
    padding: 58px 18px 14px;
    overflow-y: auto;
  }

  .auth-back {
    top: 9px;
  }

  .auth-form-card {
    padding: 18px 22px;
  }

  .auth-form-header h1 {
    font-size: 28px;
  }

  .auth-form {
    margin-top: 12px;
    gap: 9px;
  }

  .auth-input-wrap,
  .auth-input-wrap input {
    min-height: 42px;
    height: 42px;
  }

  .auth-recaptcha {
    min-height: 66px;
  }

  /* Home/Journey: preserve horizontal content area, compact top bars */
  .qng-topbar,
  .journey-topbar {
    min-height: 64px;
    padding-block: 7px;
  }

  .home-main,
  .journey-main {
    padding-bottom: 76px;
  }

  .current-location-card {
    min-height: 330px;
  }

  .current-location-content {
    min-height: 330px;
    padding-top: 130px;
  }

  /* Games: maximize playable canvas */
  .singleplayer-logo-toggle {
    width: 54px;
    height: 42px;
  }

  .singleplayer-hud {
    left: 68px;
    width: calc(100vw - 76px);
    min-height: 42px;
    padding: 5px 8px;
  }

  .singleplayer-hud-location > span:last-child,
  .singleplayer-hud-total small,
  .singleplayer-hud-earned small {
    display: none;
  }

  .singleplayer-mic-button {
    min-width: 54px;
    min-height: 54px;
  }

  #roomsGeral.rooms {
    padding: 58px 10px 8px;
  }

  #roomsGeral .cont {
    width: min(760px, 100%);
    padding: 12px 16px;
  }

  #roomsGeral .carrosselGame {
    flex-direction: row;
  }

  #roomsGeral .gameMode {
    width: min(220px, calc(50% - 8px));
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  #roomsGeral .imgGameMode {
    width: 100%;
    height: 105px;
  }
}

/* =========================================================
   ACCESSIBILITY / MOTION
========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* =========================================================
   INDEX RESPONSIVE V2 — SCALE, NOT ONLY REARRANGE
   Fixes oversized typography, actions and preview cards.
========================================================= */

/* Notebook / small desktop, especially 1024–1120px */
@media (min-width: 1024px) and (max-width: 1120px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-copy .eyebrow {
    font-size: clamp(24px, 3vw, 32px);
  }

  .hero-copy h1 {
    font-size: clamp(56px, 7vw, 74px);
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    grid-template-columns: 1fr;
  }

  .preview-heading .eyebrow {
    font-size: 28px;
  }

  .preview-heading h2 {
    font-size: 40px;
  }

  .video-stage-action {
    min-width: 190px;
    min-height: 56px;
    padding-inline: 20px;
    font-size: 11px;
  }

  .video-stage-action-icon {
    width: 30px;
    height: 30px;
  }

  .preview-panel-heading {
    min-height: 46px;
  }

  .preview-panel-heading h3 {
    font-size: 12px;
  }

  .preview-mode-card {
    min-height: 82px;
  }

  .preview-checkpoint-row {
    min-height: 66px;
  }
}

/* Tablet portrait and landscape */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-copy .eyebrow {
    font-size: clamp(24px, 4.2vw, 34px);
    letter-spacing: .13em;
  }

  .hero-copy h1 {
    font-size: clamp(52px, 8vw, 72px);
  }

  .hero-lead {
    font-size: 16px;
  }

  .hero-support {
    font-size: 14px;
  }

  .button-large {
    min-height: 48px;
    padding-inline: 20px;
    font-size: 10px;
  }

  .preview-shell {
    padding: 18px;
  }

  .preview-heading {
    min-height: 78px;
  }

  .preview-heading .eyebrow {
    font-size: clamp(22px, 3.8vw, 30px);
    letter-spacing: .12em;
  }

  .preview-heading h2 {
    font-size: clamp(34px, 5vw, 44px);
  }

  .preview-progress span {
    width: 32px;
    height: 32px;
  }

  .preview-progress i {
    width: 44px;
  }

  .preview-panel {
    grid-template-columns: 1fr;
  }

  .video-stage-action {
    min-width: 182px;
    min-height: 54px;
    padding-inline: 18px;
    gap: 10px;
    font-size: 10px;
  }

  .video-stage-action-icon {
    width: 29px;
    height: 29px;
    font-size: 12px;
  }

  .journey-video-controls {
    min-height: 52px;
    gap: 8px;
  }

  .journey-control-button {
    width: 32px;
    height: 32px;
  }

  .journey-time {
    font-size: 11px;
  }

  .preview-panel-heading {
    min-height: 46px;
  }

  .preview-panel-heading h3 {
    font-size: 12px;
  }

  .preview-mode-card {
    min-height: 82px;
    grid-template-columns: 42px minmax(0,1fr);
  }

  .preview-mode-card-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .preview-mode-card-content strong {
    font-size: 13px;
  }

  .preview-checkpoint-row {
    min-height: 64px;
  }
}

/* Mobile portrait */
@media (max-width: 767px) and (orientation: portrait) {
  .public-header,
  .hero-section,
  .preview-section {
    width: calc(100% - 22px);
  }

  .public-header {
    min-height: 64px;
  }

  .public-logo {
    width: 96px;
    height: 54px;
  }

  .public-actions .button-yellow {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 8px;
  }

  .hero-section {
    padding: 30px 0 48px;
    gap: 34px;
  }

  .hero-copy .eyebrow {
    font-size: clamp(18px, 6.2vw, 25px);
    letter-spacing: .11em;
    line-height: 1.15;
  }

  .hero-copy h1 {
    margin-top: 12px;
    font-size: clamp(42px, 13vw, 55px);
    line-height: .98;
  }

  .hero-lead {
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.4;
  }

  .hero-support {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.55;
  }

  .hero-actions {
    margin-top: 22px;
  }

  .button-large {
    min-height: 44px;
    padding-inline: 17px;
    font-size: 9px;
  }

  .hero-carousel {
    min-height: 330px;
  }

  .product-window {
    grid-template-rows: 38px minmax(0,1fr) auto;
    border-radius: 16px;
  }

  .product-window-bar {
    padding-inline: 12px;
  }

  .product-window-bar small {
    font-size: 7px;
  }

  .product-window > img {
    min-height: 210px;
  }

  .product-window-caption {
    min-height: 64px;
    padding: 11px 12px;
    gap: 8px;
  }

  .product-window-caption strong {
    font-size: 12px;
  }

  .product-window-caption > span {
    display: none;
  }

  .devices-window {
    padding: 22px 14px;
    border-radius: 16px;
  }

  .devices-window h2 {
    font-size: 30px;
  }

  .device-stage {
    margin-top: 20px;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 8px;
  }

  .device {
    grid-template-rows: 100px auto;
    gap: 8px;
  }

  .device-visual {
    height: 100px;
  }

  .device-art-desktop { width: 116px; }
  .device-art-mobile { width: 48px; }
  .device-art-vr { width: 78px; }

  .device strong {
    min-height: 26px;
    font-size: 8px;
  }

  .devices-window > p {
    margin-top: 18px;
    font-size: 10px;
  }

  .preview-section {
    padding-bottom: 48px;
  }

  .preview-shell {
    padding: 10px;
    border-radius: 17px;
  }

  .preview-heading {
    min-height: 0;
    margin-bottom: 16px;
    gap: 14px;
  }

  .preview-heading .eyebrow {
    font-size: clamp(16px, 5.4vw, 21px);
    letter-spacing: .07em;
    line-height: 1.18;
  }

  .preview-heading h2 {
    margin-top: 8px;
    font-size: clamp(30px, 10vw, 40px);
    line-height: 1.02;
  }

  .preview-progress {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .preview-progress span {
    width: 38px;
    height: 38px;
    font-size: 10px;
  }

  .preview-progress i {
    width: min(42px, 10vw);
  }

  .journey-video-card {
    border-radius: 13px;
  }

  .video-stage-action {
    min-width: 0;
    width: min(74%, 230px);
    min-height: 50px;
    padding: 0 14px;
    gap: 9px;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0,0,0,.34), 0 0 0 5px rgba(255,189,24,.07);
    font-size: 9px;
  }

  .video-stage-action-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    font-size: 11px;
  }

  .journey-video-controls {
    min-height: 44px;
    padding: 5px 7px;
    gap: 5px;
  }

  .journey-control-button {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 11px;
  }

  .journey-time {
    font-size: 9px;
  }

  .journey-volume-button,
  #journey-volume-button {
    display: none;
  }

  .preview-panel {
    gap: 9px;
  }

  .preview-panel-section {
    border-radius: 13px;
  }

  .preview-panel-heading {
    min-height: 43px;
    padding-inline: 12px;
  }

  .preview-panel-heading h3 {
    font-size: 11px;
  }

  .preview-section-check {
    font-size: 18px;
  }

  .preview-mode-card {
    min-height: 72px;
    padding: 10px 36px 10px 10px;
    grid-template-columns: 38px minmax(0,1fr);
    gap: 10px;
  }

  .preview-mode-card-icon {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .preview-mode-card-content span {
    font-size: 7px;
  }

  .preview-mode-card-content strong {
    font-size: 12px;
  }

  .preview-mode-card-content small {
    font-size: 9px;
  }

  .preview-card-status {
    right: 11px;
    font-size: 14px;
  }

  .preview-checkpoint-list {
    padding: 7px;
    gap: 7px;
  }

  .preview-checkpoint-row {
    min-height: 58px;
    padding: 7px 8px;
    grid-template-columns: 34px 34px minmax(0,1fr) 28px;
    gap: 6px;
  }

  .preview-checkpoint-time {
    font-size: 9px;
  }

  .preview-checkpoint-avatar {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .preview-checkpoint-content small {
    font-size: 7px;
  }

  .preview-checkpoint-content strong {
    font-size: 11px;
  }

  .preview-checkpoint-status {
    width: 26px;
    height: 26px;
    font-size: 10px;
  }
}

/* Mobile landscape — prioritize video and keep controls compact */
@media (max-height: 560px) and (orientation: landscape) {
  .public-header {
    min-height: 54px;
  }

  .public-logo {
    width: 88px;
    height: 48px;
  }

  .hero-section {
    padding: 22px 0 36px;
  }

  .hero-copy .eyebrow {
    font-size: 18px;
  }

  .hero-copy h1 {
    font-size: 44px;
  }

  .preview-heading {
    min-height: 58px;
  }

  .preview-heading .eyebrow {
    font-size: 18px;
  }

  .preview-heading h2 {
    font-size: 30px;
  }

  .preview-progress span {
    width: 30px;
    height: 30px;
  }

  .video-stage-action {
    min-height: 44px;
    min-width: 170px;
    font-size: 9px;
  }

  .video-stage-action-icon {
    width: 26px;
    height: 26px;
  }

  .journey-video-controls {
    min-height: 40px;
  }

  .preview-panel-heading {
    min-height: 40px;
  }

  .preview-mode-card {
    min-height: 66px;
  }
}


/* =========================================================
   HOME RESPONSIVE REFINEMENT V3
   Topbar, Adventure Map and Current Location
========================================================= */

/* Tablet / small notebook: keep the topbar compact in one row. */
@media (min-width: 768px) and (max-width: 1150px) {
  .qng-topbar {
    min-height: 86px;
    padding: 10px 0;
    display: grid;
    grid-template-columns: minmax(150px, .72fr) minmax(0, 2.28fr);
    align-items: center;
    gap: 12px;
  }

  .topbar-user {
    min-width: 0;
    order: -1;
    gap: 9px;
  }

  .user-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    font-size: 18px;
  }

  .user-info strong {
    overflow: hidden;
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .topbar-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .topbar-stat,
  .topbar-stat.priority-stat {
    min-width: 0;
    min-height: 52px;
    padding: 7px 6px;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--qng-line);
    border-radius: 10px;
  }

  .stat-icon,
  .stat-icon.fire {
    font-size: 19px;
  }

  .topbar-stat strong,
  .topbar-stat.priority-stat strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .topbar-stat small {
    font-size: 7px;
  }

  .adventure-map-card {
    padding: 18px;
  }

  .adventure-map-header {
    grid-template-columns: minmax(190px, 1fr) minmax(150px, 220px) auto;
    gap: 12px;
  }

  .adventure-map-title h2 {
    font-size: 14px;
  }

  .campaign-switcher {
    min-width: 190px;
    grid-template-columns: 32px minmax(110px, auto) 32px;
  }

  .campaign-switch-button {
    width: 32px;
    height: 32px;
  }

  .campaign-current-name {
    font-size: 13px;
  }
}

@media (max-width: 767px) {
  /* -------------------------
     Topbar: one single line
  ------------------------- */
  .qng-topbar {
    width: 100%;
    min-height: 78px;
    padding: 10px 0;
    display: grid;
    grid-template-columns: minmax(74px, .9fr) minmax(0, 3.1fr);
    align-items: center;
    gap: 7px;
  }

  .topbar-user {
    min-width: 0;
    order: -1;
    gap: 6px;
  }

  .user-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    font-size: 14px;
    border-width: 2px;
  }

  .user-info {
    min-width: 0;
  }

  .user-info strong {
    overflow: hidden;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .topbar-stats {
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .topbar-stat,
  .topbar-stat.priority-stat {
    min-width: 0;
    min-height: 46px;
    padding: 5px 2px;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    gap: 2px;
    border: 1px solid var(--qng-line);
    border-radius: 9px;
    text-align: center;
  }

  .topbar-stat > div {
    min-width: 0;
    width: 100%;
  }

  .stat-icon,
  .stat-icon.fire {
    font-size: 15px;
    line-height: 1;
  }

  .topbar-stat strong,
  .topbar-stat.priority-stat strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .topbar-stat small {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0;
  }

  /* -------------------------
     Current Location
  ------------------------- */
  .current-location-card {
    min-height: 455px;
    height: auto;
    border-radius: 15px;
  }

  .current-location-image {
    height: 100%;
    object-position: center top;
  }

  .current-location-overlay {
    background:
      linear-gradient(to top,
        rgba(3, 11, 20, .99) 0%,
        rgba(3, 11, 20, .96) 37%,
        rgba(3, 11, 20, .58) 67%,
        rgba(3, 11, 20, .12) 100%);
  }

  .current-location-content {
    width: 100%;
    min-height: 455px;
    padding: 220px 18px 82px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
  }

  .current-location-label {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .current-location-content h1 {
    max-width: 100%;
    margin: 0 0 11px;
    font-size: clamp(31px, 10.5vw, 43px);
    line-height: .98;
    letter-spacing: .015em;
    overflow-wrap: anywhere;
  }

  .current-location-content p {
    max-width: 100%;
    margin: 0;
    font-size: 14px;
    line-height: 1.38;
  }

  .continue-journey-button {
    width: min(100%, 285px);
    min-height: 48px;
    margin-top: 16px;
    padding-inline: 17px;
    font-size: 12px;
  }

  .current-location-progress {
    min-height: 64px;
    padding: 9px 14px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .current-location-progress > strong {
    font-size: 10px;
  }

  .progress-dots {
    min-width: 0;
    justify-content: center;
    gap: 5px;
  }

  .progress-dot {
    width: 10px;
    height: 10px;
  }

  .progress-result {
    width: auto;
    margin: 0;
    gap: 3px;
  }

  .progress-result b {
    font-size: 13px;
  }

  .progress-result span {
    display: none;
  }

  /* -------------------------
     Adventure Map
  ------------------------- */
  .adventure-map-card {
    min-width: 0;
    padding: 16px 12px 15px;
    overflow: hidden;
  }

  .adventure-map-header {
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title progress"
      "switch switch";
    align-items: center;
    gap: 10px 8px;
  }

  .adventure-map-title {
    grid-area: title;
    min-width: 0;
    gap: 6px;
  }

  .adventure-map-title > span {
    font-size: 15px;
  }

  .adventure-map-title h2 {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .adventure-map-progress {
    grid-area: progress;
    min-width: 72px;
    display: grid;
    grid-template-columns: 55px;
    gap: 4px;
    justify-items: end;
  }

  .adventure-map-progress-track {
    width: 55px;
    height: 6px;
  }

  .adventure-map-progress strong {
    font-size: 8px;
  }

  .campaign-switcher {
    grid-area: switch;
    min-width: 0;
    width: 100%;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    justify-self: stretch;
    gap: 7px;
  }

  .campaign-switch-button {
    width: 32px;
    height: 32px;
  }

  .campaign-current {
    min-width: 0;
    min-height: 34px;
  }

  .campaign-current-name {
    overflow: hidden;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .adventure-map-carousel {
    width: 100%;
    overflow: visible;
  }

  .adventure-map-track {
    width: 100%;
    gap: 10px;
    padding: 2px 2px 7px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }

  .adventure-phase-card {
    flex: 0 0 min(42vw, 145px);
    min-height: 154px;
    padding: 10px 8px 12px;
    scroll-snap-align: start;
    cursor: pointer;
  }

  .adventure-phase-card::after {
    width: 10px;
    right: -11px;
  }

  .adventure-phase-number {
    top: 8px;
    left: 8px;
    font-size: 10px;
  }

  .adventure-phase-icon {
    margin-top: 23px;
    font-size: 31px;
  }

  .adventure-phase-card h3 {
    min-height: 31px;
    margin: 8px 0 4px;
    font-size: 10px;
  }

  .adventure-phase-status {
    font-size: 9px;
  }
}

/* Very narrow phones. */
@media (max-width: 380px) {
  .qng-topbar {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 5px;
  }

  .user-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .user-info strong {
    font-size: 8px;
  }

  .topbar-stat,
  .topbar-stat.priority-stat {
    min-height: 43px;
  }

  .topbar-stat strong,
  .topbar-stat.priority-stat strong {
    font-size: 12px;
  }

  .topbar-stat small {
    font-size: 5px;
  }

  .current-location-content {
    padding-inline: 15px;
  }
}

/* Mobile landscape: preserve one-line topbar and a compact location card. */
@media (max-height: 560px) and (orientation: landscape) and (max-width: 950px) {
  .qng-topbar {
    min-height: 58px;
    padding-block: 6px;
  }

  .topbar-stat,
  .topbar-stat.priority-stat {
    min-height: 38px;
  }

  .current-location-card,
  .current-location-content {
    min-height: 340px;
  }

  .current-location-content {
    padding: 130px 18px 68px;
  }

  .current-location-content h1 {
    font-size: clamp(28px, 6vw, 40px);
  }
}


/* =========================================================
   HOME RESPONSIVE REFINEMENT V4
   Current Location vertical position + topbar border polish
========================================================= */

@media (max-width: 767px) {
  /* Grins and Day Streak are informational, so they stay visually lighter. */
  .topbar-stats > .topbar-stat:first-child,
  .topbar-stats > .topbar-stat:last-child {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  /* Lift the location copy as a group without changing the card/footer height. */
  .current-location-content {
    padding-top: 185px;
    padding-bottom: 112px;
  }

  .current-location-label {
    margin-bottom: 5px;
  }

  .current-location-content h1 {
    margin-bottom: 9px;
  }

  .continue-journey-button {
    width: min(100%, 238px);
    min-height: 46px;
    margin-top: 14px;
    padding-inline: 15px;
  }
}

@media (max-width: 380px) {
  .current-location-content {
    padding-top: 170px;
    padding-bottom: 108px;
  }

  .continue-journey-button {
    width: min(100%, 220px);
  }
}

@media (max-height: 560px) and (orientation: landscape) and (max-width: 950px) {
  .topbar-stats > .topbar-stat:first-child,
  .topbar-stats > .topbar-stat:last-child {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .current-location-content {
    padding-top: 96px;
    padding-bottom: 82px;
  }

  .continue-journey-button {
    width: min(100%, 225px);
    min-height: 42px;
    margin-top: 11px;
  }
}


/* =========================================================
   HOME RESPONSIVE REFINEMENT V5
   Compact single-row topbar matching the approved mockup
========================================================= */

@media (max-width: 767px) {
  .qng-topbar {
    min-height: 68px;
    padding: 8px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
  }

  .topbar-user {
    flex: 0 1 112px;
    min-width: 78px;
    gap: 6px;
  }

  .user-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    font-size: 13px;
  }

  .user-info {
    min-width: 0;
  }

  .user-info strong {
    display: block;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.05;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .topbar-stats {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    display: grid;
    grid-template-columns: .85fr .9fr 1.45fr .95fr;
    align-items: center;
    gap: 5px;
  }

  .topbar-stat,
  .topbar-stat.priority-stat,
  .topbar-stats > .topbar-stat:first-child,
  .topbar-stats > .topbar-stat:last-child {
    min-width: 0;
    min-height: 44px;
    padding: 2px 1px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
  }

  .topbar-stat-button:hover,
  .topbar-stat-button:focus-visible {
    background: rgba(255,255,255,.035);
    border-radius: 8px;
  }

  .topbar-stat > div {
    min-width: 0;
    width: auto;
    display: grid;
    align-content: center;
  }

  .stat-icon,
  .stat-icon.fire {
    flex: 0 0 auto;
    font-size: 19px;
    line-height: 1;
  }

  .topbar-stat strong,
  .topbar-stat.priority-stat strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.05;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .topbar-stat small {
    margin-top: 2px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.05;
    letter-spacing: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

@media (max-width: 430px) {
  .qng-topbar {
    gap: 5px;
  }

  .topbar-user {
    flex-basis: 96px;
    min-width: 70px;
  }

  .user-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 12px;
  }

  .user-info strong {
    font-size: 8px;
  }

  .topbar-stats {
    grid-template-columns: .82fr .88fr 1.35fr .95fr;
    gap: 3px;
  }

  .topbar-stat,
  .topbar-stat.priority-stat {
    gap: 3px;
  }

  .stat-icon,
  .stat-icon.fire {
    font-size: 17px;
  }

  .topbar-stat strong,
  .topbar-stat.priority-stat strong {
    font-size: 10px;
  }

  .topbar-stat small {
    font-size: 5px;
  }
}

@media (max-width: 360px) {
  .topbar-user {
    flex-basis: 78px;
  }

  .user-avatar {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .stat-icon,
  .stat-icon.fire {
    font-size: 15px;
  }

  .topbar-stat strong,
  .topbar-stat.priority-stat strong {
    font-size: 10px;
  }

  .topbar-stat small {
    font-size: 4.5px;
  }
}


/* =========================================================
   HOME RESPONSIVE REFINEMENT V6
   Extra-small screens: icon-only stats with hover/focus tooltips
========================================================= */

@media (max-width: 430px) {
  .qng-topbar {
    overflow: visible;
  }

  .topbar-user {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar-stats {
    flex: 0 0 auto;
    width: auto;
    display: flex;
    align-items: center;
    gap: 7px;
    overflow: visible;
  }

  .topbar-stat,
  .topbar-stat.priority-stat,
  .topbar-stats > .topbar-stat:first-child,
  .topbar-stats > .topbar-stat:last-child {
    width: 34px;
    min-width: 34px;
    height: 40px;
    min-height: 40px;
    position: relative;
    display: grid;
    place-items: center;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 9px;
    background: transparent;
    box-shadow: none;
  }

  .topbar-stat > div {
    width: max-content;
    max-width: min(210px, calc(100vw - 24px));
    position: absolute;
    z-index: 40;
    top: calc(100% + 8px);
    left: 50%;
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    color: #fff;
    background: rgba(4, 19, 31, .98);
    border: 1px solid rgba(48, 220, 211, .36);
    border-radius: 9px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .34);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -4px);
    transition:
      opacity .16s ease,
      transform .16s ease,
      visibility .16s ease;
  }

  .topbar-stat > div::before {
    content: "";
    width: 8px;
    height: 8px;
    position: absolute;
    top: -5px;
    left: 50%;
    background: rgba(4, 19, 31, .98);
    border-left: 1px solid rgba(48, 220, 211, .36);
    border-top: 1px solid rgba(48, 220, 211, .36);
    transform: translateX(-50%) rotate(45deg);
  }

  .topbar-stat:hover > div,
  .topbar-stat:focus-visible > div,
  .topbar-stat:focus-within > div {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }

  .topbar-stat strong,
  .topbar-stat.priority-stat strong {
    max-width: none;
    overflow: visible;
    font-size: 12px;
    line-height: 1.05;
    white-space: nowrap;
    text-overflow: clip;
  }

  .topbar-stat small {
    max-width: none;
    overflow: visible;
    font-size: 8px;
    line-height: 1.1;
    white-space: nowrap;
    text-overflow: clip;
  }

  .stat-icon,
  .stat-icon.fire {
    margin: 0;
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .24));
  }

  .topbar-stat:hover,
  .topbar-stat:focus-visible,
  .topbar-stat:focus-within {
    background: rgba(255, 255, 255, .045);
    outline: none;
  }

  /* Keep edge tooltips inside the viewport. */
  .topbar-stats > .topbar-stat:first-child > div {
    left: 0;
    transform: translate(0, -4px);
  }

  .topbar-stats > .topbar-stat:first-child:hover > div,
  .topbar-stats > .topbar-stat:first-child:focus-visible > div,
  .topbar-stats > .topbar-stat:first-child:focus-within > div {
    transform: translate(0, 0);
  }

  .topbar-stats > .topbar-stat:first-child > div::before {
    left: 17px;
  }

  .topbar-stats > .topbar-stat:last-child > div {
    right: 0;
    left: auto;
    transform: translate(0, -4px);
  }

  .topbar-stats > .topbar-stat:last-child:hover > div,
  .topbar-stats > .topbar-stat:last-child:focus-visible > div,
  .topbar-stats > .topbar-stat:last-child:focus-within > div {
    transform: translate(0, 0);
  }

  .topbar-stats > .topbar-stat:last-child > div::before {
    right: 13px;
    left: auto;
  }
}

@media (max-width: 360px) {
  .topbar-stats {
    gap: 4px;
  }

  .topbar-stat,
  .topbar-stat.priority-stat,
  .topbar-stats > .topbar-stat:first-child,
  .topbar-stats > .topbar-stat:last-child {
    width: 31px;
    min-width: 31px;
  }

  .stat-icon,
  .stat-icon.fire {
    font-size: 20px;
  }
}


/* =========================================================
   HOME POPUPS RESPONSIVE V10
   Souvenir arrows, Journey card spacing, Scrapbook landscape,
   and one-scroll Priority Group landscape.
========================================================= */

/* Souvenirs — keep the chevrons perfectly centered in the circles. */
.progression-season-arrow {
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  text-align: center !important;
  line-height: 1 !important;
  font-family: Arial, sans-serif !important;
}

.progression-season-arrow::before,
.progression-season-arrow::after {
  line-height: 1 !important;
}

/* ---------------------------------------------------------
   JOURNEY / SEASON MAP — mobile portrait
   Prevent cards from sharing the same vertical space.
--------------------------------------------------------- */
@media (max-width: 767px) and (orientation: portrait) {
  .season-map-dialog {
    width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    padding: 18px 12px 16px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .season-map-layout {
    display: block !important;
    margin-top: 18px !important;
  }

  .season-map-route {
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 8px !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(112px, auto) !important;
    align-items: stretch !important;
    align-content: start !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  .season-map-route-line {
    display: none !important;
  }

  .season-map-stop {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 112px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 10px 7px 9px !important;
    align-self: stretch !important;
    transform: none !important;
  }

  .season-map-stop:not(:disabled):hover,
  .season-map-stop:not(:disabled):focus-visible {
    transform: none !important;
  }

  .season-map-stop-number {
    top: 7px !important;
    left: 8px !important;
    font-size: 8px !important;
  }

  .season-map-stop-icon {
    font-size: 25px !important;
  }

  .season-map-stop-title {
    max-width: 100% !important;
    font-size: 10px !important;
    line-height: 1.08 !important;
    text-align: center !important;
    overflow-wrap: anywhere !important;
  }

  .season-map-stop-state {
    font-size: 7px !important;
    line-height: 1 !important;
  }

  .season-map-preview {
    display: none !important;
  }
}

/* Very short portrait screens: preserve card separation while scrolling. */
@media (max-width: 430px) and (max-height: 700px) and (orientation: portrait) {
  .season-map-route {
    grid-auto-rows: minmax(106px, auto) !important;
    gap: 8px !important;
  }

  .season-map-stop {
    min-height: 106px !important;
  }
}

/* ---------------------------------------------------------
   SCRAPBOOK — mobile landscape
   Let the content define its height instead of compressing cards
   into a fixed-height stage.
--------------------------------------------------------- */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .qng-travel-log-backdrop {
    padding: 8px !important;
  }

  .qng-travel-log-dialog {
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    display: block !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border-radius: 18px !important;
  }

  .qng-travel-log-header {
    min-height: 82px !important;
    padding: 12px 58px 10px 18px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .qng-travel-log-heading {
    min-width: 0 !important;
  }

  .qng-travel-log-title {
    font-size: clamp(28px, 5vw, 42px) !important;
    line-height: .96 !important;
  }

  .qng-travel-log-season-navigation {
    justify-self: end !important;
    min-width: 190px !important;
  }

  .qng-travel-log-close {
    top: 11px !important;
    right: 11px !important;
    width: 38px !important;
    height: 38px !important;
  }

  .qng-travel-log-body {
    min-height: 0 !important;
    height: auto !important;
    padding: 10px 16px 14px !important;
    overflow: visible !important;
  }

  .qng-travel-log-journey-stage {
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
    overflow: visible !important;
  }

  .qng-travel-log-journey-name-wrap {
    min-height: 54px !important;
    margin-bottom: 5px !important;
  }

  .qng-travel-log-journey-title {
    font-size: clamp(25px, 5vw, 38px) !important;
  }

  .qng-travel-log-category-heading {
    min-height: 25px !important;
    margin: 0 0 8px !important;
    font-size: 10px !important;
  }

  .qng-travel-log-card-stage {
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
    overflow: visible !important;
  }

  .qng-travel-log-card-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(68px, auto) !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .qng-travel-log-card,
  .qng-travel-log-card-grid .qng-travel-log-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 68px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: 10px !important;
    border-radius: 13px !important;
    transform: none !important;
  }

  .qng-travel-log-card-icon,
  .qng-travel-log-card-grid .qng-travel-log-card-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 11px !important;
    font-size: 22px !important;
  }

  .qng-travel-log-card-label {
    margin-bottom: 2px !important;
    font-size: 7px !important;
  }

  .qng-travel-log-card h4 {
    font-size: 13px !important;
    line-height: 1.08 !important;
  }

  .qng-travel-log-card p,
  .qng-travel-log-card time,
  .qng-travel-log-card-counter {
    display: none !important;
  }

  .qng-travel-log-page-counter {
    margin-top: 8px !important;
  }

  .qng-travel-log-category-dots {
    margin-top: 7px !important;
  }
}

/* Narrow landscape: use one card per row rather than overlap. */
@media (orientation: landscape) and (max-height: 430px) and (max-width: 700px) {
  .qng-travel-log-card-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ---------------------------------------------------------
   PRIORITY GROUP — mobile landscape
   One scrollbar belongs to the whole dialog, not each column.
--------------------------------------------------------- */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .progression-modal-dialog.priority-dialog,
  .progression-modal-dialog.priority-travel-dialog {
    width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    height: auto !important;
    padding: 18px 18px 16px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .priority-travel-layout,
  .priority-modal-layout {
    min-height: 0 !important;
    height: auto !important;
    align-items: start !important;
    overflow: visible !important;
  }

  .priority-rank-ladder,
  .priority-steps,
  .priority-points-panel,
  .priority-how-to {
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
  }

  .priority-travel-heading {
    margin-bottom: 12px !important;
  }

  .priority-step {
    min-height: 66px !important;
  }

  .priority-tier-card {
    min-height: 64px !important;
  }
}


/* =========================================================
   HOME POPUPS RESPONSIVE V11
   Compact Priority cards, restore Souvenir scrolling,
   and fit every Scrapbook category in landscape.
========================================================= */

/* ---------------------------------------------------------
   SOUVENIRS — restore vertical scrolling on short screens
--------------------------------------------------------- */
@media (max-width: 767px),
       (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .progression-modal-dialog.souvenirs-dialog,
  .souvenirs-dialog {
    max-height: calc(100dvh - 16px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .souvenirs-dialog .progression-souvenir-grid {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  .souvenirs-dialog .progression-carousel-footer {
    position: relative !important;
    bottom: auto !important;
    margin-top: 12px !important;
    padding-bottom: 4px !important;
  }
}

/* ---------------------------------------------------------
   PRIORITY GROUP — horizontal compact cards like approved ref
--------------------------------------------------------- */
@media (max-width: 767px) {
  .priority-rank-ladder {
    padding-left: 0 !important;
    gap: 7px !important;
  }

  .priority-rank-ladder::before,
  .priority-rank-node {
    display: none !important;
  }

  .priority-rank-card {
    min-height: 58px !important;
    padding: 7px 10px !important;
    grid-template-columns: 38px minmax(0, 1fr) 76px !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    gap: 7px !important;
    border-radius: 13px !important;
  }

  .priority-rank-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
  }

  .priority-rank-copy {
    grid-column: 2 !important;
    min-width: 0 !important;
  }

  .priority-rank-copy > strong {
    overflow: hidden !important;
    font-size: 13px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  .priority-you-are-here {
    margin-top: 2px !important;
    font-size: 6px !important;
  }

  .priority-rank-score,
  .priority-rank-score.current-has-ribbon {
    grid-column: 3 !important;
    min-width: 0 !important;
    padding-right: 0 !important;
    text-align: center !important;
  }

  .priority-rank-score b {
    font-size: 16px !important;
  }

  .priority-rank-score small {
    margin-top: 2px !important;
    font-size: 6px !important;
    line-height: 1 !important;
  }

  .priority-current-ribbon {
    top: -1px !important;
    right: 6px !important;
    width: 28px !important;
    height: 35px !important;
    font-size: 14px !important;
  }

  .priority-tier-card {
    min-height: 60px !important;
    padding: 7px 10px !important;
    grid-template-columns: 40px minmax(0, 1fr) 76px !important;
    grid-template-rows: 1fr !important;
    align-items: center !important;
    gap: 8px !important;
    border-radius: 13px !important;
  }

  .priority-tier-medal {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
  }

  .priority-tier-card > div {
    grid-column: 2 !important;
    min-width: 0 !important;
  }

  .priority-tier-card > div b {
    font-size: 13px !important;
    line-height: 1 !important;
  }

  .priority-tier-card > div small {
    margin-top: 2px !important;
    font-size: 7px !important;
    line-height: 1.08 !important;
  }

  .priority-tier-card > strong {
    grid-column: 3 !important;
    min-width: 0 !important;
    text-align: center !important;
    font-size: 22px !important;
  }

  .priority-tier-card > strong small {
    margin-top: 2px !important;
    font-size: 6px !important;
    line-height: 1 !important;
  }
}

/* Landscape priority: one dialog scrollbar and denser cards. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .progression-modal-dialog.priority-dialog,
  .progression-modal-dialog.priority-travel-dialog {
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .priority-travel-layout,
  .priority-modal-layout {
    grid-template-columns: minmax(270px, .9fr) minmax(330px, 1.1fr) !important;
    gap: 10px !important;
  }

  .priority-rank-ladder,
  .priority-steps,
  .priority-points-panel,
  .priority-how-to {
    overflow: visible !important;
    max-height: none !important;
  }

  .priority-rank-card {
    min-height: 55px !important;
  }

  .priority-tier-card {
    min-height: 56px !important;
  }

  .priority-points-panel {
    padding: 10px !important;
  }

  .priority-points-heading {
    margin-bottom: 7px !important;
  }

  .priority-travel-note {
    margin-top: 7px !important;
    font-size: 8px !important;
  }
}

/* ---------------------------------------------------------
   SCRAPBOOK — all categories use compact two-column cards
   and the dots sit directly under the card grid.
--------------------------------------------------------- */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .qng-travel-log-dialog {
    overflow: hidden !important;
  }

  .qng-travel-log-header {
    min-height: 72px !important;
    padding-top: 9px !important;
    padding-bottom: 7px !important;
  }

  .qng-travel-log-body {
    height: calc(100dvh - 96px) !important;
    min-height: 0 !important;
    padding: 7px 16px 8px !important;
    overflow: hidden !important;
  }

  .qng-travel-log-journey-stage {
    height: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: auto auto minmax(0, 1fr) auto !important;
    align-content: stretch !important;
    overflow: hidden !important;
  }

  .qng-travel-log-journey-name-wrap {
    min-height: 44px !important;
    margin-bottom: 2px !important;
  }

  .qng-travel-log-journey-title {
    font-size: clamp(23px, 4vw, 34px) !important;
  }

  .qng-travel-log-category-heading {
    min-height: 20px !important;
    margin-bottom: 5px !important;
  }

  .qng-travel-log-card-stage {
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
  }

  .qng-travel-log-card-grid {
    width: 100% !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: 58px !important;
    align-content: start !important;
    gap: 7px 9px !important;
  }

  .qng-travel-log-card,
  .qng-travel-log-card-grid .qng-travel-log-card {
    min-height: 58px !important;
    height: 58px !important;
    padding: 6px 10px !important;
    grid-template-columns: 38px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 8px !important;
    overflow: hidden !important;
    border-radius: 12px !important;
  }

  .qng-travel-log-card-icon,
  .qng-travel-log-card-grid .qng-travel-log-card-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    font-size: 19px !important;
  }

  .qng-travel-log-card-copy,
  .qng-travel-log-card > div:last-child {
    min-width: 0 !important;
  }

  .qng-travel-log-card-label {
    margin-bottom: 1px !important;
    font-size: 6px !important;
    line-height: 1 !important;
  }

  .qng-travel-log-card h4 {
    overflow: hidden !important;
    font-size: 11px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  .qng-travel-log-card p,
  .qng-travel-log-card time,
  .qng-travel-log-card-counter {
    display: none !important;
  }

  .qng-travel-log-category-dots,
  .qng-travel-log-page-counter {
    align-self: end !important;
    margin-top: 5px !important;
    margin-bottom: 0 !important;
  }
}

/* 651x390 and similarly narrow landscape still keeps two columns. */
@media (orientation: landscape) and (max-height: 430px) and (min-width: 560px) and (max-width: 700px) {
  .qng-travel-log-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: 54px !important;
    gap: 6px 8px !important;
  }

  .qng-travel-log-card,
  .qng-travel-log-card-grid .qng-travel-log-card {
    min-height: 54px !important;
    height: 54px !important;
  }
}


/* =========================================================
   HOME JOURNEY POPUP — SCRAPBOOK-STYLE CAROUSEL V13
   Mobile only: 4 compact cards per page, 2x2 grid, dots below.
   The large preview panel is removed on mobile so the popup
   follows the same visual rhythm as the Scrapbook.
========================================================= */

.season-map-carousel-footer {
  display: none;
}

@media (max-width: 767px) {
  .season-map-modal {
    padding: 8px !important;
  }

  .season-map-dialog {
    width: calc(100vw - 16px) !important;
    height: min(620px, calc(100dvh - 16px)) !important;
    max-height: calc(100dvh - 16px) !important;
    padding: 18px 14px 14px !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    overflow: hidden !important;
    border-radius: 20px !important;
  }

  .season-map-close {
    top: 13px !important;
    right: 13px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 22px !important;
  }

  .season-map-heading {
    min-height: 104px !important;
    padding: 4px 48px 10px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    text-align: left !important;
    border-bottom: 1px solid rgba(255,255,255,.09) !important;
  }

  .season-map-eyebrow {
    font-size: 9px !important;
    letter-spacing: .16em !important;
  }

  .season-map-season-switcher {
    width: min(100%, 310px) !important;
    margin: 8px 0 0 !important;
    grid-template-columns: 36px minmax(0, 1fr) 36px !important;
    justify-content: start !important;
    gap: 7px !important;
  }

  .season-map-season-switcher h2 {
    min-width: 0 !important;
    margin: 0 !important;
    font-size: clamp(27px, 9vw, 36px) !important;
    line-height: 1 !important;
    text-align: center !important;
  }

  .season-map-season-arrow {
    width: 34px !important;
    height: 34px !important;
    font-size: 22px !important;
  }

  .season-map-heading p {
    display: none !important;
  }

  .season-map-layout {
    min-height: 0 !important;
    height: 100% !important;
    margin-top: 12px !important;
    display: block !important;
    overflow: hidden !important;
  }

  .season-map-preview {
    display: none !important;
  }

  .season-map-route {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    align-content: stretch !important;
    overflow: hidden !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .season-map-route-line {
    display: none !important;
  }

  .season-map-stop {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 10px 8px 9px !important;
    display: grid !important;
    grid-template-rows: auto 1fr auto !important;
    place-items: center !important;
    align-content: center !important;
    gap: 4px !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  .season-map-stop[hidden] {
    display: none !important;
  }

  .season-map-stop-number {
    top: 7px !important;
    left: 8px !important;
    font-size: 8px !important;
  }

  .season-map-stop-icon {
    align-self: end !important;
    font-size: clamp(22px, 7vw, 30px) !important;
    line-height: 1 !important;
  }

  .season-map-stop-title {
    width: 100% !important;
    align-self: center !important;
    overflow: hidden !important;
    font-size: clamp(9px, 3vw, 12px) !important;
    line-height: 1.08 !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
  }

  .season-map-stop-state {
    align-self: start !important;
    font-size: 7px !important;
    line-height: 1 !important;
  }

  .season-map-carousel-footer:not([hidden]) {
    min-height: 38px !important;
    margin-top: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .season-map-page-dots {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  .season-map-page-dot {
    width: 10px !important;
    height: 10px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.26) !important;
  }

  .season-map-page-dot.active {
    width: 34px !important;
    border-radius: 999px !important;
    background: var(--qng-teal) !important;
  }

  .season-map-page-indicator {
    display: none !important;
  }
}

/* Match the Scrapbook composition in short landscape screens. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .season-map-dialog {
    width: min(790px, calc(100vw - 16px)) !important;
    height: calc(100dvh - 16px) !important;
    padding: 12px 16px 9px !important;
    grid-template-rows: 72px minmax(0, 1fr) 30px !important;
  }

  .season-map-heading {
    min-height: 72px !important;
    padding: 1px 48px 7px 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    column-gap: 16px !important;
  }

  .season-map-eyebrow {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .season-map-season-switcher {
    grid-column: 2 !important;
    grid-row: 1 / 3 !important;
    width: 270px !important;
    margin: 0 44px 0 0 !important;
  }

  .season-map-season-switcher h2 {
    font-size: 24px !important;
  }

  .season-map-layout {
    margin-top: 8px !important;
  }

  .season-map-route {
    gap: 8px 10px !important;
  }

  .season-map-stop {
    padding: 6px 10px !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    grid-template-rows: 1fr 1fr !important;
    justify-items: start !important;
    align-items: center !important;
    gap: 1px 9px !important;
    text-align: left !important;
  }

  .season-map-stop-number {
    top: 5px !important;
    left: 7px !important;
  }

  .season-map-stop-icon {
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    align-self: center !important;
    justify-self: center !important;
    font-size: 24px !important;
  }

  .season-map-stop-title {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: end !important;
    font-size: 11px !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  .season-map-stop-state {
    grid-column: 2 !important;
    grid-row: 2 !important;
    align-self: start !important;
    font-size: 7px !important;
    text-align: left !important;
  }

  .season-map-carousel-footer:not([hidden]) {
    min-height: 30px !important;
    margin-top: 4px !important;
  }

  .season-map-page-dot {
    width: 8px !important;
    height: 8px !important;
  }

  .season-map-page-dot.active {
    width: 28px !important;
  }
}


/* =========================================================
   HOME POPUPS V14 — SCRAPBOOK ICON + JOURNEY PROPORTIONS
========================================================= */

/* Keep souvenir artwork inside its own icon box. */
@media (max-width: 767px) {
  .qng-travel-log-card.souvenirs {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    align-items: center !important;
  }

  .qng-travel-log-card.souvenirs .qng-travel-log-card-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: grid !important;
    place-items: center !important;
    align-self: center !important;
    overflow: visible !important;
    border-radius: 11px !important;
    line-height: 1 !important;
  }

  .qng-travel-log-card.souvenirs .qng-travel-log-card-icon > span {
    width: 100% !important;
    height: 100% !important;
    display: grid !important;
    place-items: center !important;
    font-size: 24px !important;
    line-height: 1 !important;
    transform: none !important;
  }

  .qng-travel-log-card.souvenirs .qng-souvenir-lock {
    right: -5px !important;
    bottom: -5px !important;
    font-size: 12px !important;
  }

  /* Journey popup should size from its content, like Scrapbook. */
  .season-map-dialog {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 16px) !important;
    grid-template-rows: auto auto auto !important;
    align-content: start !important;
  }

  .season-map-layout {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .season-map-route {
    height: auto !important;
    min-height: 0 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, 128px) !important;
    align-content: start !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  .season-map-stop {
    height: 128px !important;
    min-height: 128px !important;
    padding: 10px 8px 9px !important;
    grid-template-rows: 32px minmax(0, 1fr) 18px !important;
    align-content: stretch !important;
    justify-content: stretch !important;
    place-items: center !important;
  }

  .season-map-stop-icon {
    align-self: center !important;
    font-size: 27px !important;
  }

  .season-map-stop-title {
    align-self: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 34px !important;
    font-size: 10px !important;
    line-height: 1.08 !important;
    white-space: normal !important;
    text-align: center !important;
  }

  .season-map-stop-state {
    align-self: end !important;
    font-size: 7px !important;
  }

  .season-map-carousel-footer:not([hidden]) {
    min-height: 30px !important;
    margin-top: 8px !important;
  }
}

@media (max-width: 380px) {
  .season-map-route {
    grid-template-rows: repeat(2, 116px) !important;
    gap: 8px !important;
  }

  .season-map-stop {
    height: 116px !important;
    min-height: 116px !important;
  }

  .season-map-stop-title {
    font-size: 9px !important;
  }
}

/* Landscape: same compact 2x2 language used by Scrapbook. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .qng-travel-log-card.souvenirs {
    grid-template-columns: 40px minmax(0, 1fr) !important;
  }

  .qng-travel-log-card.souvenirs .qng-travel-log-card-icon {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 9px !important;
  }

  .qng-travel-log-card.souvenirs .qng-travel-log-card-icon > span {
    font-size: 20px !important;
  }

  .season-map-dialog {
    height: calc(100dvh - 16px) !important;
    grid-template-rows: 72px auto 28px !important;
    align-content: start !important;
  }

  .season-map-layout {
    height: auto !important;
    margin-top: 7px !important;
  }

  .season-map-route {
    height: auto !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, 62px) !important;
    gap: 7px 9px !important;
    align-content: start !important;
  }

  .season-map-stop {
    height: 62px !important;
    min-height: 62px !important;
    padding: 6px 10px !important;
    grid-template-columns: 38px minmax(0, 1fr) !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 0 8px !important;
  }

  .season-map-stop-icon {
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    align-self: center !important;
    justify-self: center !important;
    font-size: 22px !important;
  }

  .season-map-stop-title {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-height: 0 !important;
    align-self: end !important;
    justify-content: flex-start !important;
    font-size: 10px !important;
    white-space: nowrap !important;
    text-align: left !important;
  }

  .season-map-stop-state {
    grid-column: 2 !important;
    grid-row: 2 !important;
    align-self: start !important;
    justify-self: start !important;
    font-size: 7px !important;
    text-align: left !important;
  }

  .season-map-carousel-footer:not([hidden]) {
    min-height: 28px !important;
    margin-top: 4px !important;
  }
}

/* =========================================================
   HOME POPUPS V15 — JOURNEY STOP NUMBER
   Larger phase number without overlapping the icon
========================================================= */

@media (max-width: 767px) {
  .season-map-stop-number {
    top: 9px !important;
    left: 10px !important;
    z-index: 2 !important;
    min-width: 24px !important;
    min-height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    font-size: 12px !important;
    line-height: 1 !important;
    letter-spacing: .02em !important;
  }

  /* Keep the icon visually centered while reserving room for the number. */
  .season-map-stop-icon {
    transform: translateY(4px) !important;
  }
}

@media (max-width: 380px) {
  .season-map-stop-number {
    top: 8px !important;
    left: 8px !important;
    font-size: 11px !important;
  }

  .season-map-stop-icon {
    transform: translateY(5px) !important;
  }
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .season-map-stop {
    position: relative !important;
    padding-left: 42px !important;
    grid-template-columns: 30px minmax(0, 1fr) !important;
  }

  .season-map-stop-number {
    top: 50% !important;
    left: 8px !important;
    width: 25px !important;
    min-width: 25px !important;
    min-height: 22px !important;
    justify-content: center !important;
    font-size: 11px !important;
    transform: translateY(-50%) !important;
  }

  .season-map-stop-icon {
    grid-column: 1 !important;
    transform: none !important;
    font-size: 22px !important;
  }
}


/* =========================================================
   HOME POPUPS V16 — JOURNEY CAROUSEL MATCHES SCRAPBOOK
   Portrait: one compact horizontal card per row
   Landscape: 2x2 compact horizontal cards
========================================================= */

@media (max-width: 767px) {
  .season-map-dialog {
    width: calc(100vw - 16px) !important;
    height: auto !important;
    min-height: min(650px, calc(100dvh - 16px)) !important;
    max-height: calc(100dvh - 16px) !important;
    padding: 20px 20px 14px !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    align-content: stretch !important;
    overflow: hidden !important;
  }

  .season-map-heading {
    min-height: 150px !important;
    padding: 0 54px 18px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    align-content: start !important;
    gap: 14px !important;
  }

  .season-map-heading > p {
    display: none !important;
  }

  .season-map-eyebrow {
    font-size: 11px !important;
    letter-spacing: .16em !important;
  }

  .season-map-season-switcher {
    width: 100% !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .season-map-season-switcher h2 {
    font-size: clamp(30px, 10vw, 42px) !important;
    text-align: center !important;
  }

  .season-map-season-arrow {
    width: 42px !important;
    height: 42px !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    line-height: 1 !important;
  }

  .season-map-layout {
    min-height: 0 !important;
    height: auto !important;
    margin-top: 18px !important;
    display: block !important;
    overflow: hidden !important;
  }

  .season-map-preview,
  .season-map-route-line {
    display: none !important;
  }

  .season-map-route {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(4, 78px) !important;
    align-content: start !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  .season-map-stop {
    width: 100% !important;
    height: 78px !important;
    min-height: 78px !important;
    position: relative !important;
    padding: 10px 14px !important;
    display: grid !important;
    grid-template-columns: 30px 44px minmax(0, 1fr) !important;
    grid-template-rows: 1fr 1fr !important;
    align-items: center !important;
    justify-items: start !important;
    gap: 0 10px !important;
    border-radius: 16px !important;
    text-align: left !important;
  }

  .season-map-stop-number {
    position: static !important;
    width: 30px !important;
    min-width: 30px !important;
    min-height: 0 !important;
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    align-self: center !important;
    justify-self: start !important;
    display: block !important;
    font-size: 13px !important;
    line-height: 1 !important;
    transform: none !important;
  }

  .season-map-stop-icon {
    grid-column: 2 !important;
    grid-row: 1 / 3 !important;
    align-self: center !important;
    justify-self: center !important;
    font-size: 26px !important;
    line-height: 1 !important;
    transform: none !important;
  }

  .season-map-stop-title {
    width: 100% !important;
    min-height: 0 !important;
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: end !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
    font-size: 13px !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
  }

  .season-map-stop-state {
    grid-column: 3 !important;
    grid-row: 2 !important;
    align-self: start !important;
    justify-self: start !important;
    font-size: 8px !important;
    line-height: 1 !important;
    text-align: left !important;
  }

  .season-map-carousel-footer:not([hidden]) {
    min-height: 44px !important;
    margin-top: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

@media (max-width: 380px) {
  .season-map-dialog {
    padding-inline: 14px !important;
  }

  .season-map-route {
    grid-template-rows: repeat(4, 72px) !important;
    gap: 8px !important;
  }

  .season-map-stop {
    height: 72px !important;
    min-height: 72px !important;
    padding-inline: 10px !important;
    grid-template-columns: 26px 38px minmax(0, 1fr) !important;
    gap: 0 8px !important;
  }

  .season-map-stop-number {
    width: 26px !important;
    min-width: 26px !important;
    font-size: 12px !important;
  }

  .season-map-stop-icon {
    font-size: 23px !important;
  }

  .season-map-stop-title {
    font-size: 11px !important;
  }
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .season-map-dialog {
    width: min(800px, calc(100vw - 16px)) !important;
    height: calc(100dvh - 16px) !important;
    min-height: 0 !important;
    padding: 12px 20px 10px !important;
    grid-template-rows: 88px minmax(0, 1fr) 34px !important;
  }

  .season-map-heading {
    min-height: 88px !important;
    padding: 0 54px 10px 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 290px !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    column-gap: 18px !important;
  }

  .season-map-eyebrow {
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    align-self: start !important;
    padding-top: 8px !important;
  }

  .season-map-season-switcher {
    grid-column: 2 !important;
    grid-row: 1 / 3 !important;
    width: 290px !important;
    margin: 0 !important;
    grid-template-columns: 42px minmax(0, 1fr) 42px !important;
  }

  .season-map-season-switcher h2 {
    font-size: 25px !important;
  }

  .season-map-layout {
    margin-top: 14px !important;
  }

  .season-map-route {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, 68px) !important;
    gap: 10px !important;
  }

  .season-map-stop {
    height: 68px !important;
    min-height: 68px !important;
    padding: 8px 12px !important;
    grid-template-columns: 28px 40px minmax(0, 1fr) !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 0 8px !important;
    border-radius: 14px !important;
  }

  .season-map-stop-number {
    width: 28px !important;
    min-width: 28px !important;
    font-size: 12px !important;
  }

  .season-map-stop-icon {
    font-size: 23px !important;
  }

  .season-map-stop-title {
    font-size: 11px !important;
  }

  .season-map-stop-state {
    font-size: 7px !important;
  }

  .season-map-carousel-footer:not([hidden]) {
    min-height: 34px !important;
    margin-top: 5px !important;
  }
}


/* =========================================================
   INDEX RESPONSIVE V17
   Mobile landscape proportions — compact, balanced hero
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 900px) {
  .public-header,
  .hero-section,
  .preview-section {
    width: calc(100% - 20px) !important;
  }

  .public-header {
    min-height: 48px !important;
    padding-block: 4px !important;
  }

  .public-logo {
    width: 78px !important;
    height: 44px !important;
  }

  .public-actions {
    gap: 6px !important;
  }

  .public-actions .button {
    min-height: 34px !important;
    padding-inline: 10px !important;
    font-size: 7px !important;
  }

  .hero-section {
    min-height: 0 !important;
    padding: 14px 0 24px !important;
    grid-template-columns: minmax(0, .72fr) minmax(350px, 1.28fr) !important;
    align-items: center !important;
    gap: 20px !important;
  }

  .hero-copy {
    min-width: 0 !important;
    text-align: left !important;
  }

  .hero-copy .eyebrow {
    font-size: clamp(12px, 2.4vw, 16px) !important;
    line-height: 1.12 !important;
    letter-spacing: .11em !important;
  }

  .hero-copy h1 {
    margin-top: 9px !important;
    font-size: clamp(34px, 6vw, 44px) !important;
    line-height: .93 !important;
    letter-spacing: -.045em !important;
  }

  .hero-lead {
    margin-top: 14px !important;
    font-size: clamp(10px, 1.8vw, 13px) !important;
    line-height: 1.26 !important;
  }

  .hero-support {
    display: none !important;
  }

  .hero-actions {
    margin-top: 18px !important;
    justify-content: flex-start !important;
  }

  .hero-actions .button-large {
    width: auto !important;
    min-height: 38px !important;
    padding-inline: 16px !important;
    font-size: 8px !important;
  }

  .hero-background {
    opacity: .38 !important;
  }

  .flight-route,
  .flight-plane {
    display: none !important;
  }

  .hero-product {
    width: 100% !important;
    min-width: 0 !important;
    align-self: center !important;
  }

  .hero-carousel {
    min-height: 260px !important;
    height: 260px !important;
  }

  .product-window,
  .devices-window {
    border-radius: 15px !important;
  }

  .product-window {
    grid-template-rows: 30px minmax(0, 1fr) 46px !important;
  }

  .product-window-bar {
    min-height: 30px !important;
    padding-inline: 10px !important;
  }

  .product-window-bar small {
    font-size: 6px !important;
  }

  .product-window > img {
    min-height: 0 !important;
    height: 184px !important;
    max-height: 184px !important;
    object-fit: cover !important;
  }

  .product-window-caption {
    min-height: 46px !important;
    padding: 7px 10px !important;
    gap: 8px !important;
  }

  .product-window-caption small {
    font-size: 6px !important;
  }

  .product-window-caption strong {
    font-size: 9px !important;
  }

  .product-window-caption > span {
    font-size: 7px !important;
  }

  .devices-window {
    min-height: 260px !important;
    height: 260px !important;
    padding: 15px 16px 12px !important;
    align-content: start !important;
  }

  .devices-kicker {
    font-size: 6px !important;
  }

  .devices-window h2 {
    margin-top: 5px !important;
    font-size: clamp(23px, 4.3vw, 30px) !important;
    line-height: 1 !important;
  }

  .device-stage {
    margin-top: 13px !important;
    grid-template-columns: 1.3fr .72fr 1fr !important;
    gap: 9px !important;
    align-items: start !important;
  }

  .device {
    grid-template-rows: 104px 24px !important;
    gap: 5px !important;
  }

  .device-visual {
    height: 104px !important;
    min-height: 104px !important;
  }

  .device-art-desktop {
    width: 132px !important;
  }

  .device-art-mobile {
    width: 49px !important;
  }

  .device-art-vr {
    width: 88px !important;
  }

  .device strong {
    min-height: 24px !important;
    font-size: 7px !important;
    line-height: 1.05 !important;
  }

  .devices-window > p {
    margin-top: 9px !important;
    font-size: 7px !important;
    line-height: 1.25 !important;
  }

  .hero-carousel-dots {
    margin-top: 8px !important;
    gap: 6px !important;
  }

  .hero-carousel-dots button {
    width: 7px !important;
    height: 7px !important;
  }

  .hero-carousel-dots button.active {
    width: 28px !important;
  }
}

/* Extra-short phones such as 667 × 375. */
@media (orientation: landscape) and (max-height: 410px) and (max-width: 760px) {
  .hero-section {
    padding-top: 10px !important;
    padding-bottom: 18px !important;
    grid-template-columns: minmax(0, .68fr) minmax(330px, 1.32fr) !important;
    gap: 16px !important;
  }

  .hero-copy h1 {
    font-size: clamp(31px, 5.7vw, 39px) !important;
  }

  .hero-lead {
    margin-top: 11px !important;
    font-size: 10px !important;
  }

  .hero-actions {
    margin-top: 14px !important;
  }

  .hero-actions .button-large {
    min-height: 36px !important;
  }

  .hero-carousel,
  .devices-window {
    min-height: 244px !important;
    height: 244px !important;
  }

  .devices-window {
    padding-top: 12px !important;
  }

  .devices-window h2 {
    font-size: 25px !important;
  }

  .device-stage {
    margin-top: 9px !important;
  }

  .device {
    grid-template-rows: 94px 20px !important;
  }

  .device-visual {
    height: 94px !important;
    min-height: 94px !important;
  }

  .device-art-desktop { width: 120px !important; }
  .device-art-mobile { width: 44px !important; }
  .device-art-vr { width: 79px !important; }

  .devices-window > p {
    margin-top: 6px !important;
  }
}

/* =========================================================
   INDEX PREVIEW V18 — COMPACT TYPOGRAPHY + LANDSCAPE FIT
   Keeps the preview title and video visible together.
========================================================= */

/* Mobile portrait: reduce the oversized heading, step circles and CTA. */
@media (max-width: 767px) and (orientation: portrait) {
  .preview-heading {
    margin-bottom: 12px !important;
    gap: 10px !important;
  }

  .preview-heading .eyebrow {
    font-size: clamp(13px, 4.2vw, 17px) !important;
    letter-spacing: .075em !important;
    line-height: 1.12 !important;
  }

  .preview-heading h2 {
    margin-top: 7px !important;
    font-size: clamp(25px, 8vw, 33px) !important;
    line-height: 1.02 !important;
  }

  .preview-progress {
    gap: 6px !important;
  }

  .preview-progress span {
    width: 32px !important;
    height: 32px !important;
    font-size: 9px !important;
  }

  .preview-progress i {
    width: min(34px, 8vw) !important;
  }

  .video-stage-action,
  .preview-overlay-action {
    width: min(68%, 205px) !important;
    min-height: 44px !important;
    padding-inline: 12px !important;
    gap: 8px !important;
    border-radius: 11px !important;
    font-size: 8px !important;
  }

  .video-stage-action-icon {
    width: 25px !important;
    height: 25px !important;
    font-size: 10px !important;
  }
}

/* Mobile landscape: title + progress + complete video fit in the first viewport. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .preview-section {
    width: calc(100% - 18px) !important;
    padding-block: 8px 24px !important;
  }

  .preview-shell {
    padding: 8px !important;
    border-radius: 14px !important;
  }

  .preview-heading {
    min-height: 0 !important;
    margin: 0 0 8px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .preview-heading .eyebrow {
    font-size: clamp(11px, 2vw, 14px) !important;
    letter-spacing: .07em !important;
    line-height: 1.05 !important;
  }

  .preview-heading h2 {
    margin-top: 4px !important;
    font-size: clamp(20px, 3.6vw, 27px) !important;
    line-height: 1 !important;
  }

  .preview-progress {
    width: auto !important;
    justify-content: flex-end !important;
    gap: 5px !important;
  }

  .preview-progress span {
    width: 26px !important;
    height: 26px !important;
    font-size: 8px !important;
  }

  .preview-progress i {
    width: 24px !important;
  }

  .preview-grid {
    display: block !important;
  }

  .journey-video-card {
    width: 100% !important;
    max-width: none !important;
    border-radius: 11px !important;
    overflow: hidden !important;
  }

  .journey-video-card video,
  .journey-video-stage video {
    width: 100% !important;
    height: min(49vh, 225px) !important;
    min-height: 0 !important;
    object-fit: cover !important;
  }

  .video-stage-action,
  .preview-overlay-action {
    width: auto !important;
    min-width: 150px !important;
    min-height: 38px !important;
    padding-inline: 12px !important;
    gap: 7px !important;
    border-radius: 10px !important;
    font-size: 7px !important;
  }

  .video-stage-action-icon {
    width: 23px !important;
    height: 23px !important;
    font-size: 9px !important;
  }

  .journey-video-controls {
    min-height: 36px !important;
    height: 36px !important;
    padding: 3px 6px !important;
    gap: 5px !important;
  }

  .journey-control-button {
    width: 27px !important;
    height: 27px !important;
    min-width: 27px !important;
    min-height: 27px !important;
    font-size: 9px !important;
  }

  .journey-time {
    font-size: 8px !important;
  }

  .preview-panel {
    margin-top: 10px !important;
  }
}

/* Very short landscape phones such as 667 × 375. */
@media (orientation: landscape) and (max-height: 410px) and (max-width: 760px) {
  .preview-section {
    padding-top: 4px !important;
  }

  .preview-shell {
    padding: 7px !important;
  }

  .preview-heading {
    margin-bottom: 6px !important;
  }

  .preview-heading .eyebrow {
    font-size: 10px !important;
  }

  .preview-heading h2 {
    font-size: 20px !important;
  }

  .preview-progress span {
    width: 24px !important;
    height: 24px !important;
    font-size: 7px !important;
  }

  .preview-progress i {
    width: 20px !important;
  }

  .journey-video-card video,
  .journey-video-stage video {
    height: min(47vh, 178px) !important;
  }

  .video-stage-action,
  .preview-overlay-action {
    min-width: 136px !important;
    min-height: 34px !important;
    font-size: 6.5px !important;
  }

  .video-stage-action-icon {
    width: 21px !important;
    height: 21px !important;
  }

  .journey-video-controls {
    min-height: 32px !important;
    height: 32px !important;
  }
}

/* =========================================================
   INDEX PREVIEW V19 — COMPACT JOURNEY PANEL IN LANDSCAPE
   Fits Conversation, Journey Checkpoints and Travel Challenge
   inside one short landscape viewport without crushing the text.
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .preview-panel {
    margin-top: 7px !important;
    gap: 6px !important;
  }

  .preview-panel-section {
    border-radius: 10px !important;
  }

  .preview-panel-heading {
    min-height: 30px !important;
    height: 30px !important;
    padding-inline: 10px !important;
    gap: 7px !important;
  }

  .preview-panel-heading h3 {
    font-size: 9px !important;
    line-height: 1 !important;
  }

  .preview-panel-heading-actions {
    gap: 5px !important;
  }

  .preview-section-indicator {
    width: 12px !important;
    height: 12px !important;
    font-size: 7px !important;
  }

  .preview-section-check {
    font-size: 14px !important;
  }

  .preview-mode-card {
    min-height: 44px !important;
    height: 44px !important;
    padding: 5px 28px 5px 8px !important;
    grid-template-columns: 30px minmax(0, 1fr) !important;
    gap: 7px !important;
  }

  .preview-mode-card-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px !important;
    font-size: 14px !important;
  }

  .preview-mode-card-content span {
    font-size: 6px !important;
    line-height: 1 !important;
  }

  .preview-mode-card-content strong {
    margin-top: 2px !important;
    font-size: 9px !important;
    line-height: 1 !important;
  }

  .preview-mode-card-content small {
    margin-top: 2px !important;
    font-size: 7px !important;
    line-height: 1.15 !important;
  }

  .preview-card-status {
    right: 9px !important;
    font-size: 11px !important;
  }

  .preview-checkpoint-list {
    padding: 5px 7px !important;
    gap: 4px !important;
  }

  .preview-checkpoint-row {
    min-height: 40px !important;
    height: 40px !important;
    padding: 4px 7px !important;
    grid-template-columns: 30px 28px minmax(0, 1fr) 24px !important;
    gap: 5px !important;
    border-radius: 8px !important;
  }

  .preview-checkpoint-time {
    font-size: 7px !important;
  }

  .preview-checkpoint-avatar {
    width: 27px !important;
    height: 27px !important;
    border-radius: 7px !important;
    font-size: 13px !important;
  }

  .preview-checkpoint-content small {
    font-size: 6px !important;
    line-height: 1 !important;
  }

  .preview-checkpoint-content strong {
    margin-top: 2px !important;
    font-size: 8.5px !important;
    line-height: 1 !important;
  }

  .preview-checkpoint-status {
    width: 22px !important;
    height: 22px !important;
    font-size: 8px !important;
  }
}

/* Extra tightening for phones around 667 × 375. */
@media (orientation: landscape) and (max-height: 410px) and (max-width: 760px) {
  .preview-panel {
    margin-top: 6px !important;
    gap: 5px !important;
  }

  .preview-panel-heading {
    min-height: 27px !important;
    height: 27px !important;
  }

  .preview-panel-heading h3 {
    font-size: 8px !important;
  }

  .preview-mode-card {
    min-height: 39px !important;
    height: 39px !important;
  }

  .preview-checkpoint-row {
    min-height: 36px !important;
    height: 36px !important;
  }

  .preview-mode-card-content small {
    display: none !important;
  }
}

/* =========================================================
   AUTH MOBILE POPUP V20
   Login / Register / Forgot password / Reset password
   Mobile shows only the form card, as a modal over a QNG/index-like page.
========================================================= */

@media (max-width: 767px) {
  body.auth-page {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden !important;
    background:
      radial-gradient(circle at 18% 8%, rgba(40, 217, 209, .12), transparent 28%),
      radial-gradient(circle at 88% 92%, rgba(255, 189, 24, .08), transparent 24%),
      linear-gradient(145deg, #020b13 0%, #041522 54%, #020a11 100%);
  }

  body.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .22;
    background-image:
      radial-gradient(circle, rgba(40, 217, 209, .45) 1px, transparent 1.5px),
      linear-gradient(115deg, transparent 54%, rgba(40, 217, 209, .045) 55%, transparent 56%);
    background-size: 13px 13px, 100% 100%;
    mask-image: radial-gradient(ellipse at 18% 25%, #000, transparent 64%);
  }

  body.auth-page::after {
    content: "";
    position: fixed;
    width: min(72vw, 360px);
    aspect-ratio: 1;
    right: -24vw;
    bottom: -26vw;
    pointer-events: none;
    border: 1px solid rgba(40, 217, 209, .08);
    border-radius: 50%;
    box-shadow:
      0 0 0 40px rgba(40, 217, 209, .025),
      0 0 0 86px rgba(40, 217, 209, .018);
  }

  .auth-shell {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    position: relative;
    z-index: 1;
    display: grid !important;
    place-items: center;
    padding:
      max(56px, calc(14px + env(safe-area-inset-top)))
      12px
      max(12px, env(safe-area-inset-bottom));
  }

  .auth-visual {
    display: none !important;
  }

  .auth-form-side {
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    position: static;
    padding: 0 !important;
    display: grid;
    place-items: center;
    overflow: visible;
  }

  .auth-back {
    min-height: 38px;
    position: fixed;
    z-index: 5;
    top: max(10px, env(safe-area-inset-top));
    right: 12px;
    left: auto;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(126, 169, 190, .23);
    border-radius: 999px;
    background: rgba(6, 23, 36, .88);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
    backdrop-filter: blur(10px);
    font-size: 10px;
  }

  .auth-form-card,
  .auth-forgot .auth-form-card,
  .auth-reset .auth-form-card {
    width: min(100%, 460px);
    max-width: 460px;
    min-height: 0 !important;
    max-height: calc(100dvh - 78px - env(safe-area-inset-bottom));
    margin: 0;
    padding: clamp(18px, 5vw, 26px);
    overflow: hidden;
    border-color: rgba(40, 217, 209, .30);
    border-radius: 20px;
    box-shadow:
      0 28px 75px rgba(0, 0, 0, .48),
      0 0 0 1px rgba(255, 255, 255, .025) inset,
      0 0 35px rgba(40, 217, 209, .055);
  }

  .auth-form-header {
    text-align: left;
  }

  .auth-eyebrow {
    font-size: 10px;
    letter-spacing: .15em;
  }

  .auth-form-header h1 {
    margin-top: 7px;
    font-size: clamp(25px, 8vw, 34px);
    line-height: 1;
  }

  .auth-form-header p {
    margin-top: 8px;
    font-size: 10.5px;
    line-height: 1.4;
  }

  .auth-message {
    margin-top: 10px;
    padding: 8px 10px;
    font-size: 9.5px;
  }

  .auth-form {
    margin-top: 14px;
    gap: 10px;
  }

  .auth-field,
  .auth-field-grid {
    gap: 6px;
  }

  .auth-field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auth-field label,
  .auth-label-row a {
    font-size: 9px;
  }

  .auth-input-wrap,
  .auth-input-wrap input {
    min-height: 43px;
    height: 43px;
  }

  .auth-input-wrap {
    border-radius: 9px;
  }

  .auth-input-icon {
    width: 37px;
    font-size: 11px;
  }

  .auth-input-wrap input {
    padding-right: 38px;
    font-size: 11px;
  }

  .auth-password-toggle {
    width: 36px;
    height: 36px;
    right: 3px;
  }

  .auth-info-box {
    padding: 10px;
    gap: 9px;
  }

  .auth-info-box > span {
    width: 28px;
    height: 28px;
  }

  .auth-info-box p {
    font-size: 9.5px;
    line-height: 1.4;
  }

  .auth-recaptcha {
    min-height: 64px;
    height: 64px;
    justify-content: center;
    overflow: visible;
  }

  .auth-recaptcha .g-recaptcha {
    transform: scale(.82);
    transform-origin: center center;
  }

  .auth-submit {
    min-height: 44px;
    height: 44px;
    border-radius: 9px;
    font-size: 9px;
  }

  .auth-submit span {
    font-size: 14px;
  }

  .auth-card-footer {
    margin-top: 12px;
    padding-top: 11px;
    font-size: 9px;
  }

  .auth-legal {
    display: none;
  }
}

/* Narrow portrait phones: preserve comfortable fields without page scrolling. */
@media (max-width: 390px) and (orientation: portrait) {
  .auth-shell {
    padding-inline: 9px;
  }

  .auth-form-card,
  .auth-forgot .auth-form-card,
  .auth-reset .auth-form-card {
    padding: 18px 14px;
    border-radius: 17px;
  }

  .auth-form-header h1 {
    font-size: clamp(24px, 8vw, 31px);
  }

  .auth-form-header p {
    font-size: 9.5px;
  }

  .auth-form {
    margin-top: 12px;
    gap: 8px;
  }

  .auth-field-grid {
    gap: 7px;
  }

  .auth-input-wrap,
  .auth-input-wrap input {
    min-height: 41px;
    height: 41px;
  }

  .auth-recaptcha .g-recaptcha {
    transform: scale(.78);
  }
}

/* Mobile landscape: make the whole form card fit in one viewport. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  body.auth-page {
    overflow: hidden !important;
  }

  .auth-shell {
    height: 100dvh;
    min-height: 100dvh;
    padding: 8px 58px 8px 12px;
  }

  .auth-back {
    min-height: 32px;
    top: 8px;
    right: 8px;
    padding-inline: 10px;
    font-size: 8px;
  }

  .auth-form-card,
  .auth-forgot .auth-form-card,
  .auth-reset .auth-form-card {
    width: min(660px, 100%);
    max-width: 660px;
    max-height: calc(100dvh - 16px);
    padding: 12px 18px;
    border-radius: 16px;
  }

  .auth-form-header {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(180px, 1fr);
    grid-template-areas:
      "eyebrow title"
      "eyebrow description";
    align-items: end;
    column-gap: 14px;
  }

  .auth-eyebrow {
    grid-area: eyebrow;
    align-self: center;
    max-width: 120px;
    font-size: 8px;
  }

  .auth-form-header h1 {
    grid-area: title;
    margin: 0;
    font-size: 22px;
  }

  .auth-form-header p {
    grid-area: description;
    margin-top: 3px;
    font-size: 8px;
    line-height: 1.25;
  }

  .auth-message {
    margin-top: 6px;
    padding: 6px 8px;
    font-size: 8px;
  }

  .auth-form {
    margin-top: 8px;
    gap: 6px;
  }

  .auth-field-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .auth-field {
    gap: 3px;
  }

  .auth-field label,
  .auth-label-row a {
    font-size: 7.5px;
  }

  .auth-input-wrap,
  .auth-input-wrap input {
    min-height: 34px;
    height: 34px;
  }

  .auth-input-icon {
    width: 31px;
    font-size: 9px;
  }

  .auth-input-wrap input {
    padding-right: 34px;
    font-size: 9px;
  }

  .auth-password-toggle {
    width: 31px;
    height: 31px;
  }

  .auth-info-box {
    padding: 7px 9px;
  }

  .auth-info-box > span {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .auth-info-box p {
    font-size: 8px;
    line-height: 1.25;
  }

  .auth-recaptcha {
    min-height: 54px;
    height: 54px;
  }

  .auth-recaptcha .g-recaptcha {
    transform: scale(.68);
  }

  .auth-submit {
    min-height: 35px;
    height: 35px;
    font-size: 8px;
  }

  .auth-card-footer {
    margin-top: 7px;
    padding-top: 6px;
    font-size: 8px;
  }

  /* Register has the most content: use two columns for its first two fields. */
  .auth-register .auth-form {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .auth-register .auth-form > .auth-field:nth-child(1),
  .auth-register .auth-form > .auth-field:nth-child(2) {
    grid-column: span 1;
  }

  .auth-register .auth-form > .auth-field-grid,
  .auth-register .auth-form > .auth-recaptcha,
  .auth-register .auth-form > .auth-submit {
    grid-column: 1 / -1;
  }

  .auth-register .auth-card-footer {
    margin-top: 5px;
  }
}

/* Very short landscape phones, e.g. 667 × 375. */
@media (orientation: landscape) and (max-height: 410px) and (max-width: 760px) {
  .auth-shell {
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .auth-form-card,
  .auth-forgot .auth-form-card,
  .auth-reset .auth-form-card {
    max-height: calc(100dvh - 10px);
    padding: 9px 14px;
  }

  .auth-form-header h1 {
    font-size: 19px;
  }

  .auth-form-header p {
    display: none;
  }

  .auth-form {
    margin-top: 6px;
    gap: 5px;
  }

  .auth-input-wrap,
  .auth-input-wrap input {
    min-height: 31px;
    height: 31px;
  }

  .auth-recaptcha {
    min-height: 48px;
    height: 48px;
  }

  .auth-recaptcha .g-recaptcha {
    transform: scale(.62);
  }

  .auth-submit {
    min-height: 32px;
    height: 32px;
  }

  .auth-card-footer {
    margin-top: 4px;
    padding-top: 4px;
  }
}

/* =========================================================
   QNG PRODUCTION MOBILE UX PATCH — 2026-08-05
   Journey fullscreen, Scrapbook empty state and game overlays
========================================================= */

/* Prevent Android/iOS text-selection callouts on press-and-hold UI. */
.journey-microphone-overlay,
.journey-microphone-overlay *,
.journey-microphone-button,
.journey-microphone-button *,
#journey-microphone-button,
#journey-microphone-button *,
#journey-main-microphone,
#journey-main-microphone *,
#preview-microphone-button,
#preview-microphone-button * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  touch-action: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Journey fullscreen must use the whole viewport without creating a black
   band between the media and its control bar after orientation changes. */
.journey-video-card:fullscreen,
.journey-video-card:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  display: block !important;
  overflow: hidden !important;
  background: #000 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.journey-video-card:fullscreen .journey-main-video,
.journey-video-card:-webkit-full-screen .journey-main-video {
  position: absolute !important;
  inset: 0 0 58px 0 !important;
  width: 100% !important;
  height: calc(100% - 58px) !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #000 !important;
}

.journey-video-card:fullscreen .journey-video-controls,
.journey-video-card:-webkit-full-screen .journey-video-controls {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  min-height: 58px !important;
  height: 58px !important;
  margin: 0 !important;
}

.journey-video-card:fullscreen .journey-jess-overlay,
.journey-video-card:-webkit-full-screen .journey-jess-overlay {
  bottom: 58px !important;
  height: calc(100% - 58px) !important;
}

@media (orientation: landscape) and (max-height: 540px) {
  .journey-video-card:fullscreen .journey-main-video,
  .journey-video-card:-webkit-full-screen .journey-main-video {
    inset-bottom: 46px !important;
    height: calc(100% - 46px) !important;
  }

  .journey-video-card:fullscreen .journey-video-controls,
  .journey-video-card:-webkit-full-screen .journey-video-controls {
    min-height: 46px !important;
    height: 46px !important;
    padding-block: 4px !important;
  }

  .journey-video-card:fullscreen .journey-jess-overlay,
  .journey-video-card:-webkit-full-screen .journey-jess-overlay {
    bottom: 46px !important;
    height: calc(100% - 46px) !important;
  }
}

/* Scrapbook error/empty states must stay readable at every width. */
.qng-travel-log-card.empty,
.qng-travel-log-empty-state {
  width: min(680px, 100%) !important;
  min-height: 180px !important;
  height: auto !important;
  margin: auto !important;
  padding: clamp(22px, 4vw, 38px) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  text-align: center !important;
}

.qng-travel-log-card.empty .qng-travel-log-card-content,
.qng-travel-log-empty-state .qng-travel-log-card-content {
  width: 100% !important;
  max-width: 520px !important;
  min-width: 0 !important;
}

.qng-travel-log-card.empty h4,
.qng-travel-log-empty-state h4 {
  margin: 0 !important;
  max-width: none !important;
  font-size: clamp(22px, 5vw, 34px) !important;
  line-height: 1.08 !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.qng-travel-log-card.empty p,
.qng-travel-log-empty-state p {
  margin: 8px auto 0 !important;
  max-width: 42ch !important;
  font-size: clamp(14px, 3vw, 17px) !important;
  line-height: 1.45 !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

@media (max-width: 520px) {
  .qng-travel-log-dialog {
    grid-template-rows: auto minmax(0, 1fr) !important;
  }

  .qng-travel-log-card.empty,
  .qng-travel-log-empty-state {
    min-height: 220px !important;
    padding: 24px 20px !important;
  }
}
