/* =========================================================
   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-panel-section,
  .journey-conversation-section,
  .journey-checkpoints-section,
  .journey-challenges-section {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .journey-conversation-section .journey-full-conversation-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }


  .journey-timeline-card {
    padding: 12px 10px !important;
  }

  .journey-timeline {
    overflow-x: hidden !important;
  }

  .journey-timeline-placeholder {
    min-width: 100% !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .journey-timeline-placeholder::before {
    top: 12px !important;
    left: 16px !important;
    right: 16px !important;
  }

  .journey-timeline-checkpoint {
    width: auto !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    gap: 3px !important;
  }

  .journey-timeline-marker {
    width: 13px !important;
    height: 13px !important;
    margin-bottom: 6px !important;
    border-width: 2px !important;
  }

  .journey-timeline-checkpoint strong {
    min-height: 28px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    word-break: break-word !important;
  }

  .journey-timeline-checkpoint small {
    font-size: 9px !important;
  }

  .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: 68px !important;
    padding: 9px 54px 8px 16px !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-eyebrow {
    margin-bottom: 3px !important;
    font-size: 8px !important;
    letter-spacing: .12em !important;
  }

  .qng-travel-log-title {
    font-size: clamp(22px, 4vw, 32px) !important;
    line-height: .94 !important;
  }

  .qng-travel-log-season-navigation {
    justify-self: end !important;
    min-width: 168px !important;
    grid-template-columns: 32px minmax(90px, 1fr) 32px !important;
  }

  .qng-travel-log-season-title {
    font-size: 12px !important;
  }

  .qng-travel-log-season-arrow {
    width: 32px !important;
    height: 32px !important;
    font-size: 23px !important;
  }

  .qng-travel-log-close {
    top: 9px !important;
    right: 10px !important;
    width: 34px !important;
    height: 34px !important;
    font-size: 22px !important;
  }

  .qng-travel-log-body {
    min-height: 0 !important;
    height: auto !important;
    padding: 7px 14px 12px !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: 40px !important;
    margin-bottom: 3px !important;
  }

  .qng-travel-log-journey-title {
    font-size: clamp(20px, 3.8vw, 29px) !important;
    line-height: .96 !important;
  }

  .qng-travel-log-swipe-hint {
    bottom: 5px !important;
    font-size: 7px !important;
  }

  .qng-travel-log-category-heading {
    min-height: 20px !important;
    margin: 0 0 5px !important;
    gap: 7px !important;
    font-size: 8px !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: min(1100px, calc(100vw - 48px)) !important;
    max-height: calc(100vh - 48px) !important;
    height: auto !important;
    margin: 0 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 {
    width: min(1100px, calc(100vw - 48px)) !important;
    height: auto !important;
    max-height: calc(100vh - 48px) !important;
    margin: 0 auto !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;
    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;
  }
}

/* =========================================================
   HOME — MOBILE LANDSCAPE FIX V1
   Restores a real left sidebar and lets the dashboard use the
   full horizontal viewport when the phone is lying down.
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  :root {
    --qng-sidebar-width: 82px;
  }

  body:has(.home-shell) {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .home-shell {
    width: 100% !important;
    min-height: 100dvh !important;
    display: grid !important;
    grid-template-columns: var(--qng-sidebar-width) minmax(0, 1fr) !important;
    align-items: start !important;
  }

  .home-shell > .qng-sidebar {
    width: var(--qng-sidebar-width) !important;
    min-width: var(--qng-sidebar-width) !important;
    min-height: 100dvh !important;
    height: 100dvh !important;
    position: sticky !important;
    inset: 0 auto auto 0 !important;
    top: 0 !important;
    align-self: start !important;
    padding: 6px 5px !important;
    overflow: hidden !important;
    border-top: 0 !important;
    border-right: 1px solid var(--qng-sidebar-line) !important;
  }

  .home-shell > .qng-sidebar .qng-sidebar-logo {
    width: 100% !important;
    height: 74px !important;
    display: flex !important;
    padding: 4px !important;
    overflow: hidden !important;
  }

  .home-shell > .qng-sidebar .qng-sidebar-logo img {
    width: 68px !important;
    max-width: 68px !important;
    height: 64px !important;
    max-height: 64px !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  .home-shell > .qng-sidebar .qng-sidebar-navigation {
    width: 100% !important;
    height: auto !important;
    margin-top: 4px !important;
    display: block !important;
    overflow: hidden !important;
    border: 1px solid var(--qng-sidebar-line) !important;
    border-radius: 12px !important;
  }

  .home-shell > .qng-sidebar .qng-sidebar-link,
  .home-shell > .qng-sidebar .qng-sidebar-link.exit {
    width: 100% !important;
    min-height: 72px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    border-left: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.06) !important;
  }

  .home-shell > .qng-sidebar .qng-sidebar-link.active {
    border-left: 4px solid var(--qng-sidebar-yellow) !important;
  }

  .home-shell > .qng-sidebar .qng-sidebar-label,
  .home-shell > .qng-sidebar .qng-sidebar-stamp {
    display: none !important;
  }

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

  .home-content-root,
  #qng-home,
  .home-main {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .home-main {
    padding: 0 14px 24px !important;
  }

  .qng-topbar {
    width: 100% !important;
    min-height: 78px !important;
    padding: 8px 0 !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .topbar-user {
    min-width: 150px !important;
    order: 1 !important;
    justify-self: start !important;
    gap: 9px !important;
  }

  .user-avatar {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    font-size: 20px !important;
  }

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

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

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

  .topbar-stat,
  .topbar-stat-button {
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 5px 7px !important;
    justify-content: center !important;
    gap: 5px !important;
    border: 1px solid rgba(255,255,255,.09) !important;
    border-radius: 10px !important;
  }

  .topbar-stat strong {
    font-size: 14px !important;
  }

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

  .stat-icon,
  .stat-icon.coin,
  .stat-icon.fire {
    width: auto !important;
    font-size: 18px !important;
  }

  .dashboard-layout {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr) !important;
    grid-template-areas:
      "current next"
      "map missions"
      "news missions" !important;
    gap: 12px !important;
    align-items: stretch !important;
  }

  .dashboard-current,
  .dashboard-next,
  .dashboard-map,
  .dashboard-missions,
  .dashboard-news {
    width: 100% !important;
    min-width: 0 !important;
  }

  .current-location-card,
  .next-destination-card {
    min-height: 360px !important;
    height: 360px !important;
  }

  .current-location-content {
    width: min(58%, 470px) !important;
    min-height: 0 !important;
    padding: 30px 24px 74px !important;
    justify-content: flex-start !important;
  }

  .current-location-content h1 {
    margin-bottom: 13px !important;
    font-size: clamp(35px, 5.1vw, 52px) !important;
    line-height: .94 !important;
  }

  .current-location-content p {
    max-width: 330px !important;
    font-size: 15px !important;
    line-height: 1.3 !important;
  }

  .continue-journey-button {
    width: min(100%, 250px) !important;
    min-height: 48px !important;
    margin-top: 16px !important;
    font-size: 13px !important;
  }

  .current-location-progress {
    min-height: 54px !important;
    padding: 0 18px !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
  }

  .progress-dots {
    gap: 7px !important;
  }

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

  .next-destination-card {
    padding: 15px !important;
  }

  .next-destination-header {
    margin-bottom: 10px !important;
  }

  .next-destination-header h2 {
    font-size: 14px !important;
  }

  .next-destination-image {
    height: 155px !important;
    min-height: 155px !important;
    object-fit: cover !important;
  }

  .next-destination-card h3 {
    margin-top: 11px !important;
    font-size: 21px !important;
  }

  .next-destination-card p {
    font-size: 12px !important;
    line-height: 1.3 !important;
  }

  .coming-next-button {
    min-width: 170px !important;
    min-height: 40px !important;
    padding-inline: 15px !important;
    font-size: 12px !important;
  }

  .adventure-map-card {
    width: 100% !important;
    min-width: 0 !important;
    padding: 16px 18px 18px !important;
  }

  .adventure-map-header {
    grid-template-columns: minmax(190px, auto) minmax(130px, 1fr) auto !important;
    gap: 10px !important;
  }

  .adventure-map-title h2 {
    font-size: 13px !important;
  }

  .campaign-switcher {
    min-width: 165px !important;
  }

  .adventure-map-phases,
  .adventure-phase-list,
  .adventure-map-track {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .adventure-phase-card {
    min-width: 0 !important;
  }

  .daily-itinerary-card,
  .news-section {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Extra-narrow landscape phones: stack dashboard cards, but keep the
   vertical sidebar so the page still uses the screen correctly. */
@media (orientation: landscape) and (max-height: 430px) and (max-width: 700px) {
  :root {
    --qng-sidebar-width: 72px;
  }

  .dashboard-layout {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "current"
      "next"
      "map"
      "missions"
      "news" !important;
  }

  .qng-topbar {
    grid-template-columns: 130px minmax(0, 1fr) !important;
  }

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

  .topbar-stat {
    padding-inline: 4px !important;
  }
}

/* =========================================================
   HOME — MOBILE LANDSCAPE REFINEMENT V2
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .current-location-content h1 {
    font-size: clamp(28px, 4.1vw, 41px) !important;
    letter-spacing: .025em !important;
  }

  .adventure-map-card {
    padding: 13px 14px 11px !important;
  }

  .adventure-map-header {
    margin-bottom: 8px !important;
    grid-template-columns: minmax(170px, auto) minmax(105px, 1fr) minmax(155px, auto) !important;
    gap: 7px !important;
  }

  .adventure-map-title {
    gap: 5px !important;
  }

  .adventure-map-title > span {
    font-size: 16px !important;
  }

  .adventure-map-title h2 {
    font-size: 11px !important;
  }

  .adventure-map-progress {
    grid-template-columns: minmax(60px, 1fr) auto !important;
    gap: 5px !important;
  }

  .adventure-map-progress-track {
    height: 6px !important;
  }

  .adventure-map-progress strong {
    font-size: 9px !important;
  }

  .campaign-switcher {
    min-width: 0 !important;
    grid-template-columns: 28px minmax(92px, 1fr) 28px !important;
    gap: 4px !important;
  }

  .campaign-switch-button {
    width: 28px !important;
    height: 28px !important;
  }

  .campaign-current {
    min-width: 0 !important;
    min-height: 30px !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    gap: 5px !important;
    overflow: visible !important;
  }

  .campaign-current-icon {
    font-size: 13px !important;
  }

  .campaign-current-name {
    display: block !important;
    min-width: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: hidden !important;
    font-size: 11px !important;
    letter-spacing: .035em !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  .adventure-map-track {
    gap: 10px !important;
    padding: 1px 3px 1px !important;
  }

  .adventure-phase-card {
    flex: 0 0 106px !important;
    min-height: 124px !important;
    padding: 8px 6px 8px !important;
  }

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

  .adventure-phase-number {
    top: 6px !important;
    left: 7px !important;
    font-size: 9px !important;
  }

  .adventure-phase-icon {
    margin-top: 16px !important;
    font-size: 25px !important;
  }

  .adventure-phase-card h3 {
    min-height: 27px !important;
    margin: 5px 0 2px !important;
    font-size: 9px !important;
    line-height: 1.08 !important;
  }

  .adventure-phase-status {
    font-size: 8px !important;
  }

  .daily-itinerary-card {
    padding: 16px !important;
  }

  .daily-itinerary-header {
    padding-bottom: 10px !important;
  }

  .daily-itinerary-header h2 {
    font-size: 16px !important;
  }

  .daily-itinerary-icon {
    font-size: 22px !important;
  }

  .itinerary-overall-progress {
    margin: 3px 0 9px !important;
  }

  .daily-itinerary-list {
    gap: 6px !important;
    margin-top: 10px !important;
  }

  .itinerary-mission {
    min-height: 68px !important;
    padding: 8px 9px !important;
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    gap: 6px !important;
  }

  .itinerary-mission.completed {
    grid-template-columns: 28px minmax(0, 1fr) !important;
  }

  .itinerary-mission-status {
    width: 28px !important;
    height: 28px !important;
    font-size: 9px !important;
  }

  .itinerary-mission.completed .itinerary-mission-status {
    font-size: 14px !important;
  }

  .itinerary-mission-content h3 {
    font-size: 10px !important;
  }

  .itinerary-mission-content p {
    margin-top: 2px !important;
    font-size: 9px !important;
    line-height: 1.18 !important;
  }

  .itinerary-progress-row {
    margin-top: 5px !important;
  }

  .itinerary-progress-track {
    height: 4px !important;
  }

  .itinerary-progress-row strong {
    font-size: 9px !important;
  }

  .itinerary-mission-action {
    min-width: 54px !important;
    min-height: 30px !important;
    padding-inline: 8px !important;
    font-size: 8px !important;
  }

  .daily-itinerary-footer {
    padding-top: 10px !important;
  }
}

/* =========================================================
   HOME — JOURNEY ADVENTURE MAP LANDSCAPE HEADER ALIGNMENT
   Keeps the season selector below the title and moves progress right.
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .adventure-map-header {
    display: grid !important;
    grid-template-columns: minmax(250px, 1fr) minmax(150px, 210px) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas:
      "title progress"
      "switch switch" !important;
    align-items: center !important;
    column-gap: 14px !important;
    row-gap: 5px !important;
  }

  .adventure-map-title {
    grid-area: title !important;
    justify-self: start !important;
    min-width: 0 !important;
  }

  .campaign-switcher {
    grid-area: switch !important;
    justify-self: center !important;
    width: min(230px, 100%) !important;
    min-width: 0 !important;
    grid-template-columns: 28px minmax(120px, 1fr) 28px !important;
  }

  .adventure-map-progress {
    grid-area: progress !important;
    justify-self: end !important;
    align-self: center !important;
    width: 172px !important;
    min-width: 0 !important;
    max-width: 172px !important;
    margin-left: 0 !important;
    margin-right: 38px !important;
    transform: translateX(-12px) !important;
  }

  .adventure-map-progress-track {
    min-width: 0 !important;
  }

  .adventure-map-progress strong {
    white-space: nowrap !important;
  }
}

/* =========================================================
   SCRAPBOOK — LANDSCAPE V2
   Compact typography + vertical scroll inside modal body.
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .qng-travel-log-dialog {
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .qng-travel-log-header {
    flex: 0 0 auto !important;
    min-height: 58px !important;
    padding: 7px 52px 6px 14px !important;
    gap: 9px !important;
  }

  .qng-travel-log-eyebrow {
    margin-bottom: 2px !important;
    font-size: 7px !important;
    line-height: 1 !important;
  }

  .qng-travel-log-title {
    font-size: clamp(19px, 3.4vw, 28px) !important;
    line-height: .92 !important;
  }

  .qng-travel-log-season-navigation {
    min-width: 150px !important;
    grid-template-columns: 28px minmax(82px, 1fr) 28px !important;
    gap: 5px !important;
  }

  .qng-travel-log-season-title {
    font-size: 11px !important;
  }

  .qng-travel-log-season-arrow {
    width: 28px !important;
    height: 28px !important;
    font-size: 20px !important;
  }

  .qng-travel-log-close {
    top: 7px !important;
    right: 9px !important;
    width: 31px !important;
    height: 31px !important;
    font-size: 20px !important;
  }

  .qng-travel-log-body {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 5px 14px 24px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-gutter: stable !important;
  }

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

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

  .qng-travel-log-journey-title {
    font-size: clamp(15px, 2.7vw, 21px) !important;
    line-height: .94 !important;
  }

  .qng-travel-log-swipe-hint {
    font-size: 6px !important;
  }

  .qng-travel-log-category-heading {
    min-height: 17px !important;
    margin: 0 0 4px !important;
    gap: 5px !important;
    font-size: 8px !important;
    line-height: 1 !important;
  }

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

  .qng-travel-log-card-grid {
    height: auto !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: 52px !important;
    gap: 6px 8px !important;
    overflow: visible !important;
  }

  .qng-travel-log-card,
  .qng-travel-log-card-grid .qng-travel-log-card {
    min-height: 52px !important;
    height: 52px !important;
    padding: 5px 9px !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 7px !important;
    border-radius: 11px !important;
  }

  .qng-travel-log-card-icon,
  .qng-travel-log-card-grid .qng-travel-log-card-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
    font-size: 17px !important;
  }

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

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

  .qng-travel-log-category-dots,
  .qng-travel-log-page-counter {
    margin-top: 4px !important;
    margin-bottom: 3px !important;
  }
}


/* ---------------------------------------------------------
   SCRAPBOOK EMPTY STATE — LANDSCAPE TIGHTENING
   Reduce the empty-state box and headline without touching
   the rest of the Scrapbook layout.
--------------------------------------------------------- */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .qng-travel-log-card.empty,
  .qng-travel-log-empty-state {
    width: min(520px, 100%) !important;
    min-height: 120px !important;
    padding: 14px 18px !important;
    gap: 8px !important;
    border-radius: 16px !important;
  }

  .qng-travel-log-card.empty .qng-travel-log-card-content,
  .qng-travel-log-empty-state .qng-travel-log-card-content {
    max-width: 420px !important;
  }

  .qng-travel-log-card.empty h4,
  .qng-travel-log-empty-state h4 {
    font-size: clamp(16px, 2.8vw, 22px) !important;
    line-height: 1.06 !important;
  }

  .qng-travel-log-card.empty p,
  .qng-travel-log-empty-state p {
    margin-top: 6px !important;
    font-size: clamp(10px, 1.8vw, 13px) !important;
    line-height: 1.28 !important;
  }
}


/* ---------------------------------------------------------
   SCRAPBOOK LANDSCAPE — FINAL FIT WITHOUT SCROLL
   Keep all content visible in landscape so the internal
   scroll is no longer needed.
--------------------------------------------------------- */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .qng-travel-log-dialog {
    overflow: hidden !important;
  }

  .qng-travel-log-body {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    padding: 4px 14px 8px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  .qng-travel-log-body::-webkit-scrollbar {
    display: none !important;
  }

  .qng-travel-log-journey-stage {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

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

  .qng-travel-log-journey-title {
    font-size: clamp(14px, 2.5vw, 20px) !important;
    line-height: 0.94 !important;
  }

  .qng-travel-log-category-heading {
    min-height: 16px !important;
    margin: 0 0 2px !important;
    gap: 4px !important;
    font-size: 9px !important;
  }

  .qng-travel-log-card-stage {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
  }

  .qng-travel-log-card-grid {
    grid-auto-rows: 48px !important;
    gap: 6px 8px !important;
  }

  .qng-travel-log-card,
  .qng-travel-log-card-grid .qng-travel-log-card {
    min-height: 48px !important;
    height: 48px !important;
    padding: 5px 8px !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 7px !important;
  }

  .qng-travel-log-card-icon,
  .qng-travel-log-card-grid .qng-travel-log-card-icon {
    width: 30px !important;
    height: 30px !important;
    font-size: 16px !important;
  }

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

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

  .qng-travel-log-card.empty,
  .qng-travel-log-empty-state {
    width: min(500px, 100%) !important;
    min-height: 102px !important;
    padding: 12px 16px !important;
    gap: 8px !important;
    border-radius: 16px !important;
  }

  .qng-travel-log-card.empty .qng-travel-log-card-icon,
  .qng-travel-log-empty-state .qng-travel-log-card-icon {
    width: 50px !important;
    height: 50px !important;
    font-size: 22px !important;
  }

  .qng-travel-log-card.empty h4,
  .qng-travel-log-empty-state h4 {
    font-size: clamp(15px, 2.7vw, 21px) !important;
    line-height: 1.04 !important;
  }

  .qng-travel-log-category-dots {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-self: center !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
    padding-top: 8px !important;
  }
}


/* =========================================================
   JOURNEY — MOBILE LANDSCAPE FINAL STRUCTURE
   - Sidebar stays fixed at the left and fits the viewport.
   - Conversation / Checkpoints / Challenges stack vertically.
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  :root {
    --qng-sidebar-width: 82px;
  }

  body:has(.journey-shell) {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .journey-shell {
    width: 100% !important;
    min-height: 100dvh !important;
    display: grid !important;
    grid-template-columns: var(--qng-sidebar-width) minmax(0, 1fr) !important;
    align-items: start !important;
  }

  .journey-shell > .qng-sidebar {
    width: var(--qng-sidebar-width) !important;
    min-width: var(--qng-sidebar-width) !important;
    min-height: 100dvh !important;
    height: 100dvh !important;
    position: sticky !important;
    inset: 0 auto auto 0 !important;
    top: 0 !important;
    align-self: start !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 4px 5px !important;
    overflow: hidden !important;
    border-top: 0 !important;
    border-right: 1px solid var(--qng-sidebar-line) !important;
  }

  .journey-shell > .qng-sidebar .qng-sidebar-logo {
    width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    display: flex !important;
    padding: 2px !important;
    overflow: hidden !important;
  }

  .journey-shell > .qng-sidebar .qng-sidebar-logo img {
    width: 62px !important;
    max-width: 62px !important;
    height: 58px !important;
    max-height: 58px !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  .journey-shell > .qng-sidebar .qng-sidebar-navigation {
    width: 100% !important;
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin-top: 4px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border: 1px solid var(--qng-sidebar-line) !important;
    border-radius: 12px !important;
  }

  .journey-shell > .qng-sidebar .qng-sidebar-link,
  .journey-shell > .qng-sidebar .qng-sidebar-link.exit {
    width: 100% !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    border-left: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.06) !important;
  }

  .journey-shell > .qng-sidebar .qng-sidebar-link.active {
    border-left: 4px solid var(--qng-sidebar-yellow) !important;
  }

  .journey-shell > .qng-sidebar .qng-sidebar-label,
  .journey-shell > .qng-sidebar .qng-sidebar-stamp {
    display: none !important;
  }

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

  .journey-main {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 14px 24px !important;
  }

  /* Keep the player shorter in mobile landscape without touching the
     hidden reaction videos used by Jess/canvas. */
  .journey-video-card {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: clamp(220px, 46vh, 300px) !important;
    overflow: hidden !important;
  }

  /* IMPORTANT: target ONLY the main scene video.
     Do not use `.journey-video-card video` here: the Jess reaction sources
     are videos too and must remain hidden for the canvas compositor. */
  #journey-main-video,
  .journey-main-video {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #000 !important;
  }

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

  .journey-layout {
    width: 100% !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .journey-panel {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    align-items: stretch !important;
    gap: 12px !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }

  .journey-panel-section,
  .journey-conversation-section,
  .journey-checkpoints-section,
  .journey-challenges-section {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-column: auto !important;
    box-sizing: border-box !important;
  }

  /* Jess — mobile landscape: start 35% smaller without changing
     the canvas dimensions or disturbing the video/compositor logic. */
  .journey-reaction-canvas {
    transform: scale(1.0) !important;
    transform-origin: right bottom !important;
  }
}


/* =========================================================
   JOURNEY — MOBILE FIXED PLAYER + SCROLLABLE CONTENT PANEL
   Structure:
   journey-layout
   ├─ journey-stage          -> player stays visible
   └─ journey-content-panel  -> timeline + option panels scroll
========================================================= */

/* Preserve the current two-column desktop composition after introducing
   the journey-content-panel wrapper. */
@media (min-width: 1024px) {
  .journey-layout {
    grid-template-rows: auto auto !important;
    row-gap: 0 !important;
  }

  .journey-stage {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .journey-content-panel {
    display: contents !important;
  }

  .journey-content-panel > .journey-timeline-card {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .journey-content-panel > .journey-panel {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
  }
}

/* Mobile portrait: keep the bottom navigation outside the Journey viewport.
   Only journey-content-panel scrolls. */
@media (max-width: 767px) and (orientation: portrait) {
  html,
  body:has(.journey-shell) {
    height: 100dvh !important;
    overflow: hidden !important;
  }

  .journey-shell {
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  .journey-main {
    height: calc(100dvh - 66px) !important;
    min-height: 0 !important;
    padding-bottom: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .journey-topbar {
    flex: 0 0 auto !important;
  }

  .journey-layout {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  .journey-stage {
    flex: 0 0 auto !important;
    min-height: 0 !important;
  }

  .journey-content-panel {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin-top: 10px !important;
    padding: 0 2px 12px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
  }

  .journey-content-panel > .journey-timeline-card {
    flex: 0 0 auto !important;
    margin-top: 0 !important;
  }

  .journey-content-panel > .journey-panel {
    flex: 0 0 auto !important;
    overflow: visible !important;
  }
}

/* Mobile landscape: the left sidebar and player stay fixed in the viewport;
   timeline + Conversation/Checkpoints/Challenges scroll below the player. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  html,
  body:has(.journey-shell) {
    height: 100dvh !important;
    overflow: hidden !important;
  }

  .journey-shell {
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    grid-template-columns: var(--qng-sidebar-width) minmax(0, 1fr) !important;
  }

  .journey-shell > .qng-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
  }

  .journey-main {
    grid-column: 2 !important;
    height: 100dvh !important;
    min-height: 0 !important;
    padding-bottom: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .journey-topbar {
    flex: 0 0 auto !important;
  }

  .journey-layout {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  .journey-stage {
    flex: 0 0 auto !important;
    min-height: 0 !important;
  }

  .journey-content-panel {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin-top: 10px !important;
    padding: 0 2px 10px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
  }

  .journey-content-panel > .journey-timeline-card {
    flex: 0 0 auto !important;
    margin-top: 0 !important;
  }

  .journey-content-panel > .journey-panel {
    flex: 0 0 auto !important;
    width: 100% !important;
    overflow: visible !important;
  }
}

/* =========================================================
   JOURNEY — MOBILE LANDSCAPE RIGHT CONTENT PANEL
   Final landscape composition:
   sidebar | fixed video | independently scrollable content
   Portrait rules remain untouched.
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  html,
  body:has(.journey-shell) {
    height: 100dvh !important;
    overflow: hidden !important;
  }

  .journey-shell {
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  .journey-main {
    height: 100dvh !important;
    min-height: 0 !important;
    padding: 0 12px 8px !important;
    overflow: hidden !important;
  }

  .journey-topbar {
    flex: 0 0 auto !important;
  }

  /* Player and content panel share the available area side by side. */
  .journey-layout {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1.58fr) minmax(285px, .92fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 12px !important;
    overflow: hidden !important;
  }

  .journey-stage {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    align-self: start !important;
    overflow: visible !important;
  }

  /* This is the ONLY vertical scrolling region in Journey landscape. */
  .journey-content-panel {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 8px 7px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(94,230,215,.45) transparent !important;
    background: rgba(5,18,30,.52) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  .journey-content-panel::-webkit-scrollbar {
    width: 5px !important;
  }

  .journey-content-panel::-webkit-scrollbar-thumb {
    background: rgba(94,230,215,.45) !important;
    border-radius: 999px !important;
  }

  .journey-content-panel > .journey-timeline-card,
  .journey-content-panel > .journey-panel {
    width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
  }

  /* No nested vertical scroll: the wrapper above owns all scrolling. */
  .journey-content-panel .journey-panel,
  .journey-content-panel .journey-checkpoint-list {
    max-height: none !important;
    overflow: visible !important;
  }

  .journey-content-panel .journey-panel {
    gap: 9px !important;
    padding-right: 0 !important;
  }

  /* ---------- Compact timeline for the narrow right column ---------- */
  .journey-content-panel .journey-timeline-card {
    margin: 0 !important;
    padding: 10px 8px 8px !important;
    border-radius: 12px !important;
  }

  .journey-content-panel .journey-timeline {
    width: 100% !important;
    overflow-x: hidden !important;
  }

  .journey-content-panel .journey-timeline-placeholder {
    width: 100% !important;
    min-width: 100% !important;
    gap: 2px !important;
  }

  .journey-content-panel .journey-timeline-placeholder::before {
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
  }

  .journey-content-panel .journey-timeline-checkpoint {
    width: auto !important;
    min-width: 0 !important;
    flex: 1 1 0 !important;
    gap: 2px !important;
  }

  .journey-content-panel .journey-timeline-marker {
    width: 10px !important;
    height: 10px !important;
    margin-bottom: 4px !important;
    border-width: 2px !important;
  }

  .journey-content-panel .journey-timeline-checkpoint strong {
    min-height: 18px !important;
    font-size: 8px !important;
    line-height: 1.04 !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  .journey-content-panel .journey-timeline-checkpoint small {
    font-size: 7px !important;
    line-height: 1 !important;
  }

  /* ---------- Compact option cards / typography ---------- */
  .journey-content-panel .journey-panel-section {
    border-radius: 12px !important;
  }

  .journey-content-panel .journey-panel-heading,
  .journey-content-panel .journey-progress-heading {
    min-height: 38px !important;
    padding: 0 10px !important;
    gap: 7px !important;
  }

  .journey-content-panel .journey-panel-heading h2,
  .journey-content-panel .journey-progress-heading h2 {
    font-size: 10.5px !important;
    line-height: 1.05 !important;
  }

  .journey-content-panel .journey-panel-heading-actions {
    gap: 4px !important;
  }

  .journey-content-panel .journey-section-mode-indicator {
    width: 12px !important;
    height: 12px !important;
    font-size: 8px !important;
  }

  .journey-content-panel .journey-standard-completion-check {
    font-size: 16px !important;
  }

  .journey-content-panel .journey-mode-card {
    min-height: 68px !important;
    padding: 9px 28px 9px 9px !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 8px !important;
    border-radius: 9px !important;
  }

  .journey-content-panel .journey-mode-card-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
  }

  .journey-content-panel .journey-mode-card-label {
    margin-bottom: 1px !important;
    font-size: 7px !important;
    line-height: 1 !important;
  }

  .journey-content-panel .journey-mode-card h3 {
    font-size: 11.5px !important;
    line-height: 1.05 !important;
  }

  .journey-content-panel .journey-mode-card p {
    margin: 3px 0 5px !important;
    font-size: 8.5px !important;
    line-height: 1.18 !important;
  }

  .journey-content-panel .journey-mode-requirement {
    gap: 5px !important;
    font-size: 8px !important;
  }

  .journey-content-panel .journey-modes-section {
    padding: 7px !important;
    gap: 7px !important;
  }

  /* ---------- Compact Journey Checkpoint rows ---------- */
  .journey-content-panel .journey-checkpoint-list {
    padding: 7px !important;
    gap: 6px !important;
  }

  .journey-content-panel .journey-checkpoint-item {
    min-height: 50px !important;
    padding: 6px 7px !important;
    grid-template-columns: 31px 30px minmax(0, 1fr) auto !important;
    gap: 5px !important;
    border-radius: 8px !important;
  }

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

  .journey-content-panel .journey-checkpoint-avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
    border-radius: 7px !important;
  }

  .journey-content-panel .journey-checkpoint-content {
    gap: 1px !important;
  }

  .journey-content-panel .journey-checkpoint-content small {
    font-size: 7px !important;
  }

  .journey-content-panel .journey-checkpoint-content strong {
    font-size: 9.5px !important;
  }

  .journey-content-panel .journey-checkpoint-status {
    width: 22px !important;
    height: 22px !important;
    font-size: 9px !important;
  }

  .journey-content-panel .journey-checkpoint-action {
    min-width: 58px !important;
    min-height: 26px !important;
    padding-inline: 6px !important;
    font-size: 7px !important;
  }

  .journey-content-panel .journey-free-practice-button {
    width: calc(100% - 14px) !important;
    min-height: 48px !important;
    margin: 0 7px 7px !important;
    padding: 7px 9px !important;
    gap: 8px !important;
  }

  .journey-content-panel .journey-free-practice-icon {
    font-size: 18px !important;
  }

  .journey-content-panel .journey-free-practice-button strong {
    font-size: 10px !important;
  }

  .journey-content-panel .journey-free-practice-button small {
    font-size: 8px !important;
  }
}

/* Narrower landscape phones: give the content panel enough usable width. */
@media (orientation: landscape) and (max-height: 430px) and (max-width: 760px) {
  .journey-layout {
    grid-template-columns: minmax(0, 1.48fr) minmax(270px, .92fr) !important;
    gap: 9px !important;
  }

  .journey-content-panel {
    padding: 6px 5px 10px !important;
    gap: 7px !important;
    border-radius: 13px !important;
  }

  .journey-content-panel .journey-panel-heading h2,
  .journey-content-panel .journey-progress-heading h2 {
    font-size: 9.5px !important;
  }

  .journey-content-panel .journey-mode-card h3 {
    font-size: 10.5px !important;
  }

  .journey-content-panel .journey-mode-card p {
    font-size: 8px !important;
  }
}


/* =========================================================
   JOURNEY — MOBILE LANDSCAPE RIGHT PANEL FINE TUNING
   Compact cards and typography without changing the layout.
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .journey-content-panel {
    padding: 7px 6px 10px !important;
    gap: 7px !important;
  }

  .journey-content-panel .journey-panel {
    gap: 7px !important;
  }

  .journey-content-panel .journey-panel-heading,
  .journey-content-panel .journey-progress-heading {
    min-height: 34px !important;
    padding: 0 9px !important;
  }

  .journey-content-panel .journey-panel-heading h2,
  .journey-content-panel .journey-progress-heading h2 {
    font-size: 9.5px !important;
    line-height: 1 !important;
  }

  .journey-content-panel .journey-section-mode-indicator {
    width: 10px !important;
    height: 10px !important;
    font-size: 7px !important;
  }

  .journey-content-panel .journey-standard-completion-check {
    font-size: 14px !important;
  }

  /* Travel Challenge cards */
  .journey-content-panel .journey-modes-section {
    padding: 6px !important;
    gap: 6px !important;
  }

  .journey-content-panel .journey-mode-card {
    min-height: 58px !important;
    padding: 7px 24px 7px 7px !important;
    grid-template-columns: 29px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 7px !important;
    border-radius: 8px !important;
  }

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

  .journey-content-panel .journey-mode-card-label {
    margin-bottom: 1px !important;
    font-size: 6.5px !important;
    line-height: 1 !important;
    letter-spacing: .045em !important;
  }

  .journey-content-panel .journey-mode-card h3 {
    font-size: 10.5px !important;
    line-height: 1 !important;
  }

  .journey-content-panel .journey-mode-card p {
    margin: 2px 0 4px !important;
    font-size: 7.5px !important;
    line-height: 1.12 !important;
  }

  .journey-content-panel .journey-mode-lock {
    top: 8px !important;
    right: 8px !important;
    font-size: 12px !important;
  }

  .journey-content-panel .journey-role-requirements {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 5px !important;
  }

  .journey-content-panel .journey-role-requirement {
    min-width: 0 !important;
    min-height: 21px !important;
    padding: 0 7px !important;
    gap: 4px !important;
    font-size: 7.5px !important;
    white-space: nowrap !important;
  }

  /* Journey Checkpoints — keep status/check on the same row. */
  .journey-content-panel .journey-checkpoint-list {
    padding: 6px !important;
    gap: 5px !important;
  }

  .journey-content-panel .journey-checkpoint-group {
    border-radius: 10px !important;
  }

  .journey-content-panel .journey-checkpoint-row {
    grid-template-columns: minmax(0, 1fr) 34px !important;
  }

  .journey-content-panel .journey-checkpoint-item {
    min-height: 46px !important;
    padding: 5px 6px !important;
    grid-template-columns: 27px 28px minmax(0, 1fr) 12px 22px !important;
    gap: 4px !important;
    border-radius: 0 !important;
  }

  .journey-content-panel .journey-checkpoint-time {
    font-size: 7px !important;
  }

  .journey-content-panel .journey-checkpoint-avatar {
    width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
    font-size: 14px !important;
    border-radius: 6px !important;
  }

  .journey-content-panel .journey-checkpoint-content {
    gap: 1px !important;
  }

  .journey-content-panel .journey-checkpoint-content small {
    font-size: 6.2px !important;
    line-height: 1 !important;
  }

  .journey-content-panel .journey-checkpoint-content strong {
    font-size: 8.5px !important;
    line-height: 1.05 !important;
  }

  .journey-content-panel .journey-checkpoint-alert {
    font-size: 12px !important;
  }

  .journey-content-panel .journey-checkpoint-status {
    width: 20px !important;
    height: 20px !important;
    font-size: 8px !important;
  }

  .journey-content-panel .journey-checkpoint-dropdown-toggle {
    min-width: 34px !important;
    font-size: 8px !important;
  }
}

/* =========================================================
   JOURNEY — MOBILE LANDSCAPE PRACTICE TARGETS TUNE
   Make phrase-practice rows fit better inside the right panel.
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  .journey-content-panel .journey-checkpoint-targets {
    padding: 4px 5px 6px !important;
  }

  .journey-content-panel .journey-target-practice {
    grid-template-columns: 8px minmax(0, 1fr) 56px !important;
    align-items: center !important;
    gap: 6px !important;
    min-height: 34px !important;
    padding: 6px 6px !important;
    border-radius: 8px !important;
  }

  .journey-content-panel .journey-target-status-dot {
    width: 6px !important;
    height: 6px !important;
    box-shadow: 0 0 0 1px rgba(239, 248, 255, 0.04) !important;
  }

  .journey-content-panel .journey-target-practice-phrase {
    min-width: 0 !important;
    font-size: 7.6px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .journey-content-panel .journey-target-practice-stars {
    width: 56px !important;
    justify-self: end !important;
    justify-content: flex-end !important;
    text-align: right !important;
    gap: 0 !important;
    font-size: 0.58rem !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
  }

  .journey-content-panel .journey-target-star {
    line-height: 1 !important;
  }

  .journey-content-panel .journey-target-practice small {
    display: none !important;
  }
}

@media (orientation: landscape) and (max-height: 430px) and (max-width: 760px) {
  .journey-content-panel .journey-target-practice {
    grid-template-columns: 7px minmax(0, 1fr) 50px !important;
    gap: 5px !important;
    min-height: 31px !important;
    padding: 5px 5px !important;
  }

  .journey-content-panel .journey-target-practice-phrase {
    font-size: 7px !important;
  }

  .journey-content-panel .journey-target-practice-stars {
    width: 50px !important;
    font-size: 0.54rem !important;
  }
}

/* =========================================================
   JOURNEY — MOBILE PORTRAIT CARD REFINEMENT
   Compact the lower option cards to match the intended
   portrait composition. Landscape rules remain untouched.
========================================================= */
@media (max-width: 767px) and (orientation: portrait) {
  .journey-content-panel {
    gap: 9px !important;
  }

  .journey-content-panel > .journey-panel,
  .journey-content-panel .journey-panel {
    gap: 9px !important;
  }

  .journey-content-panel .journey-panel-heading,
  .journey-content-panel .journey-progress-heading {
    min-height: 42px !important;
    padding: 0 12px !important;
  }

  .journey-content-panel .journey-panel-heading h2,
  .journey-content-panel .journey-progress-heading h2 {
    font-size: 12px !important;
    line-height: 1 !important;
  }

  .journey-content-panel .journey-modes-section {
    padding: 7px !important;
    gap: 7px !important;
  }

  .journey-content-panel .journey-mode-card {
    min-height: 68px !important;
    padding: 8px 30px 8px 9px !important;
    grid-template-columns: 36px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 9px !important;
    border-radius: 10px !important;
  }

  .journey-content-panel .journey-mode-card-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 17px !important;
    border-radius: 8px !important;
  }

  .journey-content-panel .journey-mode-card-label {
    margin-bottom: 1px !important;
    font-size: 7.5px !important;
    line-height: 1 !important;
  }

  .journey-content-panel .journey-mode-card h3 {
    font-size: 13px !important;
    line-height: 1.05 !important;
  }

  .journey-content-panel .journey-mode-card p {
    margin: 3px 0 5px !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
  }

  .journey-content-panel .journey-role-requirements {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .journey-content-panel .journey-role-requirement {
    min-height: 23px !important;
    padding: 0 8px !important;
    font-size: 8px !important;
    white-space: nowrap !important;
  }

  .journey-content-panel .journey-standard-completion-check {
    font-size: 18px !important;
  }

  /* The base sidebar gives Exit a desktop margin-top. In the bottom
     portrait navigation every item must occupy the same grid cell. */
  .journey-shell > .qng-sidebar .qng-sidebar-link.exit {
    margin: 0 !important;
    padding: 4px 2px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .journey-shell > .qng-sidebar .qng-sidebar-link.exit .qng-sidebar-icon {
    margin: 0 !important;
    transform: none !important;
  }
}

/* =========================================================
   JOURNEY SCRAPBOOK — MOBILE LANDSCAPE FIT
   Match the compact Home Scrapbook composition inside Journey.
   Journey-only override; portrait and Home remain untouched.
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  body:has(.journey-shell) .qng-travel-log-backdrop {
    padding: 6px !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  body:has(.journey-shell) .qng-travel-log-dialog {
    width: calc(100vw - 12px) !important;
    height: calc(100dvh - 12px) !important;
    max-width: none !important;
    max-height: calc(100dvh - 12px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: 16px !important;
  }

  body:has(.journey-shell) .qng-travel-log-header {
    flex: 0 0 auto !important;
    min-height: 54px !important;
    padding: 6px 48px 5px 13px !important;
    gap: 8px !important;
  }

  body:has(.journey-shell) .qng-travel-log-eyebrow {
    margin-bottom: 1px !important;
    font-size: 6.5px !important;
    line-height: 1 !important;
  }

  body:has(.journey-shell) .qng-travel-log-title {
    font-size: clamp(18px, 3.2vw, 25px) !important;
    line-height: .95 !important;
  }

  body:has(.journey-shell) .qng-travel-log-season-navigation {
    gap: 5px !important;
  }

  body:has(.journey-shell) .qng-travel-log-season-title {
    font-size: 9px !important;
    letter-spacing: .07em !important;
  }

  body:has(.journey-shell) .qng-travel-log-season-arrow {
    width: 24px !important;
    height: 24px !important;
    font-size: 14px !important;
  }

  body:has(.journey-shell) .qng-travel-log-close {
    width: 30px !important;
    height: 30px !important;
    right: 10px !important;
    font-size: 17px !important;
  }

  body:has(.journey-shell) .qng-travel-log-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 3px 13px 7px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  body:has(.journey-shell) .qng-travel-log-journey-stage {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: 27px 16px minmax(0, 1fr) auto auto !important;
    align-content: stretch !important;
    overflow: hidden !important;
  }

  body:has(.journey-shell) .qng-travel-log-journey-name-wrap {
    min-height: 27px !important;
    height: 27px !important;
    margin: 0 !important;
  }

  body:has(.journey-shell) .qng-travel-log-journey-title {
    margin: 0 !important;
    font-size: clamp(13px, 2.4vw, 19px) !important;
    line-height: 1 !important;
  }

  body:has(.journey-shell) .qng-travel-log-swipe-hint {
    display: none !important;
  }

  body:has(.journey-shell) .qng-travel-log-category-heading {
    min-height: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    gap: 4px !important;
    font-size: 8px !important;
    line-height: 1 !important;
  }

  body:has(.journey-shell) .qng-travel-log-card-stage {
    min-height: 0 !important;
    height: auto !important;
    padding: 3px 0 2px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  body:has(.journey-shell) .qng-travel-log-card-grid {
    width: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    grid-auto-rows: 44px !important;
    gap: 5px 7px !important;
    align-content: center !important;
  }

  body:has(.journey-shell) .qng-travel-log-card,
  body:has(.journey-shell) .qng-travel-log-card-grid .qng-travel-log-card {
    min-height: 44px !important;
    height: 44px !important;
    padding: 4px 7px !important;
    grid-template-columns: 29px minmax(0, 1fr) !important;
    gap: 6px !important;
    border-radius: 10px !important;
  }

  body:has(.journey-shell) .qng-travel-log-card-icon,
  body:has(.journey-shell) .qng-travel-log-card-grid .qng-travel-log-card-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
  }

  body:has(.journey-shell) .qng-travel-log-card-label {
    margin-bottom: 1px !important;
    font-size: 5px !important;
    line-height: 1 !important;
  }

  body:has(.journey-shell) .qng-travel-log-card h4 {
    font-size: 8.8px !important;
    line-height: 1 !important;
  }

  body:has(.journey-shell) .qng-travel-log-card p,
  body:has(.journey-shell) .qng-travel-log-card time,
  body:has(.journey-shell) .qng-travel-log-card-counter {
    font-size: 6px !important;
    line-height: 1.05 !important;
  }

  /* Empty categories: keep the whole card visible instead of clipping its base. */
  body:has(.journey-shell) .qng-travel-log-card.empty,
  body:has(.journey-shell) .qng-travel-log-empty-state {
    width: min(460px, 78%) !important;
    min-height: 82px !important;
    height: 82px !important;
    max-height: 82px !important;
    padding: 8px 14px !important;
    gap: 5px !important;
    align-self: center !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  body:has(.journey-shell) .qng-travel-log-card.empty .qng-travel-log-card-icon,
  body:has(.journey-shell) .qng-travel-log-empty-state .qng-travel-log-card-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 19px !important;
  }

  body:has(.journey-shell) .qng-travel-log-card.empty .qng-travel-log-card-label,
  body:has(.journey-shell) .qng-travel-log-empty-state .qng-travel-log-card-label {
    font-size: 5.5px !important;
  }

  body:has(.journey-shell) .qng-travel-log-card.empty h4,
  body:has(.journey-shell) .qng-travel-log-empty-state h4 {
    font-size: clamp(13px, 2.25vw, 18px) !important;
    line-height: 1 !important;
  }

  body:has(.journey-shell) .qng-travel-log-page-counter {
    min-height: 10px !important;
    margin: 0 !important;
    font-size: 6px !important;
    line-height: 1 !important;
  }

  body:has(.journey-shell) .qng-travel-log-category-dots {
    width: 100% !important;
    min-height: 20px !important;
    margin: 0 !important;
    padding: 2px 0 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 7px !important;
  }

  body:has(.journey-shell) .qng-travel-log-category-dot {
    width: 8px !important;
    height: 8px !important;
  }

  body:has(.journey-shell) .qng-travel-log-category-dot.active {
    width: 34px !important;
  }
}

/* =========================================================
   HOME SCRAPBOOK — MOBILE LANDSCAPE FIT
   Mirror the proven Journey Scrapbook composition inside Home.
   Home-only override; portrait and Journey remain untouched.
========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  body:has(.home-shell) .qng-travel-log-backdrop {
    padding: 6px !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  body:has(.home-shell) .qng-travel-log-dialog {
    width: calc(100vw - 12px) !important;
    height: calc(100dvh - 12px) !important;
    max-width: none !important;
    max-height: calc(100dvh - 12px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: 16px !important;
  }

  body:has(.home-shell) .qng-travel-log-header {
    flex: 0 0 auto !important;
    min-height: 54px !important;
    padding: 6px 48px 5px 13px !important;
    gap: 8px !important;
  }

  body:has(.home-shell) .qng-travel-log-eyebrow {
    margin-bottom: 1px !important;
    font-size: 6.5px !important;
    line-height: 1 !important;
  }

  body:has(.home-shell) .qng-travel-log-title {
    font-size: clamp(18px, 3.2vw, 25px) !important;
    line-height: .95 !important;
  }

  body:has(.home-shell) .qng-travel-log-season-navigation {
    gap: 5px !important;
  }

  body:has(.home-shell) .qng-travel-log-season-title {
    font-size: 9px !important;
    letter-spacing: .07em !important;
  }

  body:has(.home-shell) .qng-travel-log-season-arrow {
    width: 24px !important;
    height: 24px !important;
    font-size: 14px !important;
  }

  body:has(.home-shell) .qng-travel-log-close {
    width: 30px !important;
    height: 30px !important;
    right: 10px !important;
    font-size: 17px !important;
  }

  body:has(.home-shell) .qng-travel-log-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 3px 13px 7px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  body:has(.home-shell) .qng-travel-log-journey-stage {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: 27px 16px minmax(0, 1fr) auto auto !important;
    align-content: stretch !important;
    overflow: hidden !important;
  }

  body:has(.home-shell) .qng-travel-log-journey-name-wrap {
    min-height: 27px !important;
    height: 27px !important;
    margin: 0 !important;
  }

  body:has(.home-shell) .qng-travel-log-journey-title {
    margin: 0 !important;
    font-size: clamp(13px, 2.4vw, 19px) !important;
    line-height: 1 !important;
  }

  body:has(.home-shell) .qng-travel-log-swipe-hint {
    display: none !important;
  }

  body:has(.home-shell) .qng-travel-log-category-heading {
    min-height: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    gap: 4px !important;
    font-size: 8px !important;
    line-height: 1 !important;
  }

  body:has(.home-shell) .qng-travel-log-card-stage {
    min-height: 0 !important;
    height: auto !important;
    padding: 3px 0 2px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  body:has(.home-shell) .qng-travel-log-card-grid {
    width: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    grid-auto-rows: 44px !important;
    gap: 5px 7px !important;
    align-content: center !important;
  }

  body:has(.home-shell) .qng-travel-log-card,
  body:has(.home-shell) .qng-travel-log-card-grid .qng-travel-log-card {
    min-height: 44px !important;
    height: 44px !important;
    padding: 4px 7px !important;
    grid-template-columns: 29px minmax(0, 1fr) !important;
    gap: 6px !important;
    border-radius: 10px !important;
  }

  body:has(.home-shell) .qng-travel-log-card-icon,
  body:has(.home-shell) .qng-travel-log-card-grid .qng-travel-log-card-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
  }

  body:has(.home-shell) .qng-travel-log-card-label {
    margin-bottom: 1px !important;
    font-size: 5px !important;
    line-height: 1 !important;
  }

  body:has(.home-shell) .qng-travel-log-card h4 {
    font-size: 8.8px !important;
    line-height: 1 !important;
  }

  body:has(.home-shell) .qng-travel-log-card p,
  body:has(.home-shell) .qng-travel-log-card time,
  body:has(.home-shell) .qng-travel-log-card-counter {
    font-size: 6px !important;
    line-height: 1.05 !important;
  }

  /* Empty categories: keep the whole card visible instead of clipping its base. */
  body:has(.home-shell) .qng-travel-log-card.empty,
  body:has(.home-shell) .qng-travel-log-empty-state {
    width: min(460px, 78%) !important;
    min-height: 82px !important;
    height: 82px !important;
    max-height: 82px !important;
    padding: 8px 14px !important;
    gap: 5px !important;
    align-self: center !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  body:has(.home-shell) .qng-travel-log-card.empty .qng-travel-log-card-icon,
  body:has(.home-shell) .qng-travel-log-empty-state .qng-travel-log-card-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 19px !important;
  }

  body:has(.home-shell) .qng-travel-log-card.empty .qng-travel-log-card-label,
  body:has(.home-shell) .qng-travel-log-empty-state .qng-travel-log-card-label {
    font-size: 5.5px !important;
  }

  body:has(.home-shell) .qng-travel-log-card.empty h4,
  body:has(.home-shell) .qng-travel-log-empty-state h4 {
    font-size: clamp(13px, 2.25vw, 18px) !important;
    line-height: 1 !important;
  }

  body:has(.home-shell) .qng-travel-log-page-counter {
    min-height: 10px !important;
    margin: 0 !important;
    font-size: 6px !important;
    line-height: 1 !important;
  }

  body:has(.home-shell) .qng-travel-log-category-dots {
    width: 100% !important;
    min-height: 20px !important;
    margin: 0 !important;
    padding: 2px 0 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 7px !important;
  }

  body:has(.home-shell) .qng-travel-log-category-dot {
    width: 8px !important;
    height: 8px !important;
  }

  body:has(.home-shell) .qng-travel-log-category-dot.active {
    width: 34px !important;
  }
}

/* =========================================================
   HOME — MOBILE PAGE SCROLL
   Keep the Home document scrollable whenever no Home modal is
   intentionally locking the background.
========================================================= */
@media (max-width: 1023px) {
  body:has(.home-shell):not(.qng-travel-log-open):not(.season-map-open):not(.progression-modal-open) {
    height: auto !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body:has(.home-shell):not(.qng-travel-log-open):not(.season-map-open):not(.progression-modal-open) .home-shell,
  body:has(.home-shell):not(.qng-travel-log-open):not(.season-map-open):not(.progression-modal-open) .home-content-root,
  body:has(.home-shell):not(.qng-travel-log-open):not(.season-map-open):not(.progression-modal-open) .home-main {
    height: auto !important;
    max-height: none !important;
  }
}

/* =========================================================
   HOME — FINAL MOBILE SCROLL + NAVIGATION FIX
   Portrait: bottom nav fixed; Home content itself scrolls.
   Landscape: left sidebar fixed; Home content scrolls beside it.
   Journey selectors are intentionally untouched.
========================================================= */

/* ---------- HOME PORTRAIT ---------- */
@media (max-width: 767px) and (orientation: portrait) {
  html:has(.home-shell),
  body:has(.home-shell) {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  body:has(.home-shell) .home-shell {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    display: block !important;
    overflow: hidden !important;
  }

  body:has(.home-shell) .home-content-root,
  body:has(.home-shell) #qng-home {
    width: 100% !important;
    height: calc(100dvh - 66px - env(safe-area-inset-bottom)) !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  body:has(.home-shell) .home-main {
    width: 100% !important;
    height: auto !important;
    min-height: max-content !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 22px !important;
  }

  body:has(.home-shell) .home-shell > .qng-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    height: calc(66px + env(safe-area-inset-bottom)) !important;
    min-height: calc(66px + env(safe-area-inset-bottom)) !important;
    position: fixed !important;
    inset: auto 0 0 0 !important;
    z-index: 9000 !important;
  }
}

/* ---------- HOME LANDSCAPE ---------- */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  :root {
    --qng-sidebar-width: 82px;
  }

  html:has(.home-shell),
  body:has(.home-shell) {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  body:has(.home-shell) .home-shell {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    display: grid !important;
    grid-template-columns: var(--qng-sidebar-width) minmax(0, 1fr) !important;
    align-items: stretch !important;
    overflow: hidden !important;
  }

  body:has(.home-shell) .home-shell > .qng-sidebar {
    width: var(--qng-sidebar-width) !important;
    min-width: var(--qng-sidebar-width) !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    z-index: 9000 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 4px 5px !important;
    overflow: hidden !important;
    border-top: 0 !important;
    border-right: 1px solid var(--qng-sidebar-line) !important;
  }

  body:has(.home-shell) .home-shell > .qng-sidebar .qng-sidebar-logo {
    width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    display: flex !important;
    padding: 2px !important;
    overflow: hidden !important;
  }

  body:has(.home-shell) .home-shell > .qng-sidebar .qng-sidebar-logo img {
    width: 62px !important;
    max-width: 62px !important;
    height: 58px !important;
    max-height: 58px !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  body:has(.home-shell) .home-shell > .qng-sidebar .qng-sidebar-navigation {
    width: 100% !important;
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 4px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border: 1px solid var(--qng-sidebar-line) !important;
    border-radius: 12px !important;
  }

  body:has(.home-shell) .home-shell > .qng-sidebar .qng-sidebar-link,
  body:has(.home-shell) .home-shell > .qng-sidebar .qng-sidebar-link.exit {
    width: 100% !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    border-left: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.06) !important;
  }

  body:has(.home-shell) .home-shell > .qng-sidebar .qng-sidebar-link.active {
    border-left: 4px solid var(--qng-sidebar-yellow) !important;
  }

  body:has(.home-shell) .home-shell > .qng-sidebar .qng-sidebar-label,
  body:has(.home-shell) .home-shell > .qng-sidebar .qng-sidebar-stamp {
    display: none !important;
  }

  body:has(.home-shell) .home-shell > .qng-sidebar .qng-sidebar-icon {
    width: auto !important;
    font-size: 21px !important;
  }

  body:has(.home-shell) .home-content-root,
  body:has(.home-shell) #qng-home {
    grid-column: 2 !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  body:has(.home-shell) .home-main {
    width: 100% !important;
    height: auto !important;
    min-height: max-content !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 20px !important;
  }
}

/* =========================================================
   GAME MOBILE LANDSCAPE — HUD / CONTROL CHOOSER / MIC LOAD GATE
   2026-08-08
   Applies to the modern Singleplayer + Multiplayer surfaces only.
========================================================= */

/* The mic must never sit on top of the loading ceremony. */
body:has(#loadingScreen) #overMicrofone.singleplayer-mic-shell {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  /* Center the game HUD on the viewport and keep the journey/mode copy visible. */
  body:has(#roomsGeral) .singleplayer-hud {
    top: 8px !important;
    left: 50% !important;
    right: auto !important;
    width: min(500px, calc(100vw - 150px)) !important;
    min-width: 0 !important;
    max-width: 500px !important;
    min-height: 50px !important;
    height: 50px !important;
    padding: 5px 8px 5px 12px !important;
    gap: 10px !important;
    transform: translateX(-50%) !important;
    border-radius: 13px !important;
  }

  body:has(#roomsGeral) .singleplayer-hud-location {
    display: flex !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  body:has(#roomsGeral) .singleplayer-hud-kicker {
    display: block !important;
    font-size: 8px !important;
    line-height: 1 !important;
    letter-spacing: .11em !important;
    white-space: nowrap !important;
  }

  body:has(#roomsGeral) .singleplayer-hud-location strong {
    display: block !important;
    margin-top: 2px !important;
    font-size: 15px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:has(#roomsGeral) .singleplayer-hud-location > span:last-child,
  body:has(#roomsGeral) .singleplayer-hud-role-empty {
    display: block !important;
    margin-top: 2px !important;
    font-size: 8px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:has(#roomsGeral) .singleplayer-hud-grins {
    width: auto !important;
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  body:has(#roomsGeral) .singleplayer-hud-total,
  body:has(#roomsGeral) .singleplayer-hud-earned {
    min-width: 74px !important;
    width: auto !important;
    height: 38px !important;
    padding: 4px 8px !important;
    border-radius: 10px !important;
  }

  body:has(#roomsGeral) .singleplayer-hud-total strong,
  body:has(#roomsGeral) .singleplayer-hud-earned strong {
    font-size: 15px !important;
  }

  body:has(#roomsGeral) .singleplayer-hud-total small,
  body:has(#roomsGeral) .singleplayer-hud-earned small {
    display: none !important;
  }

  /* Smaller control-style chooser so it floats comfortably inside landscape. */
  body:has(#roomsGeral) #roomsGeral.rooms {
    padding: 70px 16px 14px !important;
    place-items: center !important;
    overflow: hidden !important;
  }

  body:has(#roomsGeral) #roomsGeral .cont {
    width: min(650px, calc(100vw - 72px)) !important;
    height: min(270px, calc(100dvh - 92px)) !important;
    min-height: 0 !important;
    max-height: 270px !important;
    margin: auto !important;
    padding: 11px 14px !important;
    gap: 8px !important;
    overflow: hidden !important;
    border-radius: 16px !important;
  }

  body:has(#roomsGeral) #roomsGeral .tituloGame,
  body:has(#roomsGeral) #roomsGeral .tituloGame.font-medium {
    font-size: 11px !important;
    line-height: 1.05 !important;
  }

  body:has(#roomsGeral) #roomsGeral .carrosselGame {
    gap: 9px !important;
    padding: 2px !important;
  }

  body:has(#roomsGeral) #roomsGeral .gameMode {
    grid-template-rows: 36px minmax(0, 1fr) !important;
    border-radius: 12px !important;
  }

  body:has(#roomsGeral) #roomsGeral .gameMode .label,
  body:has(#roomsGeral) #roomsGeral .label {
    padding: 6px 4px !important;
    font-size: 10px !important;
    line-height: 1.05 !important;
  }

  body:has(#roomsGeral) #roomsGeral .imgGameMode {
    padding: 7px !important;
  }
}

/* =========================================================
   GAME MOBILE LANDSCAPE — HUD STABILITY + MIC/CONTROL PANEL STATE
   2026-08-08 follow-up
   Keeps HUD centered even after fullscreen changes the viewport height.
========================================================= */

/* If the control chooser is on screen, the microphone must not compete with it. */
body:has(#roomsGeral > #conte) #overMicrofone.singleplayer-mic-shell,
body:has(#roomsGeral > .cont) #overMicrofone.singleplayer-mic-shell {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (orientation: landscape) and (max-width: 1023px) {
  /* Override older modern-game landscape rules that anchor the HUD at left:82px. */
  body.singleplayer-modern .singleplayer-hud,
  body.multiplayer-modern .singleplayer-hud,
  body:has(#roomsGeral) .singleplayer-hud {
    top: 8px !important;
    left: 50% !important;
    right: auto !important;
    width: min(610px, calc(100vw - 170px)) !important;
    max-width: 610px !important;
    min-width: 0 !important;
    min-height: 50px !important;
    height: 50px !important;
    padding: 5px 9px 5px 13px !important;
    gap: 10px !important;
    transform: translateX(-50%) !important;
    border-radius: 13px !important;
  }

  /* One readable horizontal line: SINGLEPLAYER · IMMIGRATION · OFFICER MODE. */
  body.singleplayer-modern .singleplayer-hud-location,
  body.multiplayer-modern .singleplayer-hud-location,
  body:has(#roomsGeral) .singleplayer-hud-location {
    display: flex !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    align-items: center !important;
    gap: 9px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }

  body.singleplayer-modern .singleplayer-hud-kicker,
  body.multiplayer-modern .singleplayer-hud-kicker,
  body:has(#roomsGeral) .singleplayer-hud-kicker {
    display: block !important;
    flex: 0 0 auto !important;
    font-size: 8px !important;
    line-height: 1 !important;
    letter-spacing: .11em !important;
    white-space: nowrap !important;
  }

  body.singleplayer-modern .singleplayer-hud-location strong,
  body.multiplayer-modern .singleplayer-hud-location strong,
  body:has(#roomsGeral) .singleplayer-hud-location strong {
    display: block !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.singleplayer-modern .singleplayer-hud-location > span:last-child,
  body.multiplayer-modern .singleplayer-hud-location > span:last-child,
  body.multiplayer-modern .singleplayer-hud-role-empty,
  body:has(#roomsGeral) .singleplayer-hud-location > span:last-child,
  body:has(#roomsGeral) .singleplayer-hud-role-empty {
    display: block !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    font-size: 8px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.singleplayer-modern .singleplayer-hud-grins,
  body.multiplayer-modern .singleplayer-hud-grins,
  body:has(#roomsGeral) .singleplayer-hud-grins {
    width: auto !important;
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  body.singleplayer-modern .singleplayer-hud-total,
  body.singleplayer-modern .singleplayer-hud-earned,
  body.multiplayer-modern .singleplayer-hud-total,
  body.multiplayer-modern .singleplayer-hud-earned,
  body:has(#roomsGeral) .singleplayer-hud-total,
  body:has(#roomsGeral) .singleplayer-hud-earned {
    min-width: 74px !important;
    width: auto !important;
    height: 38px !important;
    padding: 4px 8px !important;
    border-radius: 10px !important;
  }

  body.singleplayer-modern .singleplayer-hud-total strong,
  body.singleplayer-modern .singleplayer-hud-earned strong,
  body.multiplayer-modern .singleplayer-hud-total strong,
  body.multiplayer-modern .singleplayer-hud-earned strong,
  body:has(#roomsGeral) .singleplayer-hud-total strong,
  body:has(#roomsGeral) .singleplayer-hud-earned strong {
    font-size: 15px !important;
  }

  body.singleplayer-modern .singleplayer-hud-total small,
  body.singleplayer-modern .singleplayer-hud-earned small,
  body.multiplayer-modern .singleplayer-hud-total small,
  body.multiplayer-modern .singleplayer-hud-earned small,
  body:has(#roomsGeral) .singleplayer-hud-total small,
  body:has(#roomsGeral) .singleplayer-hud-earned small {
    display: none !important;
  }
}

/* ==========================================================
   QNG 2026-08-08 — MULTIPLAYER PANELS + MIC VISIBILITY
   Mobile landscape only. Keep the mic out of every setup/room
   panel and compact the room browser/create-room views so the
   full content remains reachable inside a short viewport.
   ========================================================== */

/* Any visible setup/room workflow owns the screen: the mic must not compete. */
body:has(#roomsGeral > #conte) #overMicrofone.singleplayer-mic-shell,
body:has(#chooseRoom) #overMicrofone.singleplayer-mic-shell,
body:has(#createNewRoom) #overMicrofone.singleplayer-mic-shell {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (orientation: landscape) and (max-width: 1023px) {
  /* ---------- Multiplayer: choose / join room ---------- */
  body.multiplayer-modern #chooseRoom.qng-room-browser {
    top: 58px !important;
    left: 50% !important;
    width: min(720px, calc(100vw - 110px)) !important;
    height: calc(100dvh - 66px) !important;
    max-height: calc(100dvh - 66px) !important;
    min-height: 0 !important;
    transform: translateX(-50%) !important;
    padding: 11px 14px 10px !important;
    gap: 7px !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }

  body.multiplayer-modern .qng-room-browser__heading {
    gap: 2px !important;
  }

  body.multiplayer-modern .qng-room-browser__eyebrow,
  body.multiplayer-modern .qng-room-browser__label,
  body.multiplayer-modern .qng-room-browser__rooms-header h3 {
    font-size: 9px !important;
    line-height: 1.05 !important;
    letter-spacing: .13em !important;
  }

  body.multiplayer-modern .qng-room-browser__title {
    font-size: 21px !important;
    line-height: 1 !important;
  }

  body.multiplayer-modern .qng-room-browser__description,
  body.multiplayer-modern .qng-room-browser__rooms-header span {
    font-size: 10px !important;
    line-height: 1.15 !important;
  }

  body.multiplayer-modern .qng-room-browser__search {
    gap: 4px !important;
  }

  body.multiplayer-modern .qng-room-browser__controls {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    gap: 6px !important;
  }

  body.multiplayer-modern .qng-room-browser__input {
    height: 36px !important;
    padding: 0 10px !important;
    border-radius: 9px !important;
    font-size: 11px !important;
  }

  body.multiplayer-modern .qng-room-browser__button {
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 11px !important;
    border-radius: 9px !important;
    font-size: 9px !important;
    white-space: nowrap !important;
  }

  body.multiplayer-modern .qng-room-browser__rooms-header {
    min-height: 14px !important;
    padding-top: 0 !important;
    align-items: center !important;
  }

  body.multiplayer-modern .qng-room-browser__list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    padding: 1px 4px 1px 1px !important;
  }

  body.multiplayer-modern .qng-available-room {
    min-height: 58px !important;
    padding: 8px 9px !important;
    gap: 8px !important;
    border-radius: 12px !important;
  }

  body.multiplayer-modern .qng-available-room__copy {
    gap: 2px !important;
  }

  body.multiplayer-modern .qng-available-room__eyebrow {
    font-size: 7px !important;
  }

  body.multiplayer-modern .qng-available-room__name {
    font-size: 13px !important;
  }

  body.multiplayer-modern .qng-available-room__waiting {
    gap: 4px !important;
    font-size: 9px !important;
  }

  body.multiplayer-modern .qng-available-room__icon {
    width: 22px !important;
    height: 22px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
  }

  body.multiplayer-modern .qng-available-room__join {
    min-width: 104px !important;
    min-height: 30px !important;
    padding: 0 8px !important;
    border-radius: 8px !important;
    font-size: 8px !important;
  }

  body.multiplayer-modern .qng-room-browser__empty {
    min-height: 62px !important;
    gap: 2px !important;
    border-radius: 11px !important;
  }

  body.multiplayer-modern .qng-room-browser__empty > span {
    font-size: 17px !important;
  }

  body.multiplayer-modern .qng-room-browser__empty strong {
    font-size: 10px !important;
  }

  body.multiplayer-modern .qng-room-browser__empty p {
    font-size: 8px !important;
  }

  /* ---------- Multiplayer: create room ---------- */
  body.multiplayer-modern #createNewRoom.qng-create-room {
    top: 58px !important;
    left: 50% !important;
    width: min(700px, calc(100vw - 110px)) !important;
    height: calc(100dvh - 66px) !important;
    max-height: calc(100dvh - 66px) !important;
    min-height: 0 !important;
    transform: translateX(-50%) !important;
    padding: 10px 14px !important;
    gap: 6px !important;
    border-radius: 18px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  body.multiplayer-modern .qng-create-room__heading {
    gap: 2px !important;
  }

  body.multiplayer-modern .qng-create-room__eyebrow,
  body.multiplayer-modern .qng-create-room__label,
  body.multiplayer-modern .qng-create-room__roles-title {
    font-size: 8px !important;
    line-height: 1.05 !important;
    letter-spacing: .13em !important;
  }

  body.multiplayer-modern .qng-create-room__title {
    font-size: 20px !important;
    line-height: 1 !important;
  }

  body.multiplayer-modern .qng-create-room__description {
    font-size: 9px !important;
    line-height: 1.15 !important;
  }

  body.multiplayer-modern .qng-create-room__field {
    gap: 4px !important;
  }

  body.multiplayer-modern .qng-create-room__input {
    height: 34px !important;
    padding: 0 10px !important;
    border-radius: 9px !important;
    font-size: 11px !important;
  }

  body.multiplayer-modern .qng-create-room__message {
    min-height: 10px !important;
    font-size: 8px !important;
  }

  body.multiplayer-modern .qng-create-room__roles {
    gap: 5px !important;
  }

  body.multiplayer-modern .qng-create-room__role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.multiplayer-modern .qng-create-room__role-card {
    min-height: 76px !important;
    padding: 7px 10px !important;
    gap: 4px !important;
    border-radius: 12px !important;
  }

  body.multiplayer-modern .qng-create-room__role-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
    font-size: 18px !important;
  }

  body.multiplayer-modern .qng-create-room__role-name {
    font-size: 13px !important;
  }

  body.multiplayer-modern .qng-create-room__actions {
    margin-top: 0 !important;
  }

  body.multiplayer-modern .qng-create-room__back {
    min-width: 140px !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 14px !important;
    border-radius: 9px !important;
    font-size: 10px !important;
  }
}


/* ==========================================================
   QNG 2026-08-08 — MOBILE MIC POSITION FINE-TUNE
   Singleplayer + Multiplayer. Landscape only.
   Nudge the mic slightly left and down without changing size/state.
   ========================================================== */
@media (orientation: landscape) and (max-width: 1023px) {
  body.singleplayer-modern #overMicrofone.singleplayer-mic-shell,
  body.multiplayer-modern #overMicrofone.singleplayer-mic-shell {
    right: 5% !important;
    bottom: max(10%, env(safe-area-inset-bottom)) !important;
  }
}

/* ==========================================================
   QNG 2026-08-08 — JOURNEY MOBILE MIC SIZE + POSITION
   Portrait + landscape.
   - 70% of current rendered size
   - 5% inset from the video right edge
   - 10% inset from the video bottom edge
   ========================================================== */
@media (max-width: 1023px) {
  body:has(.journey-shell) .journey-video-card .journey-microphone-overlay {
    right: 5% !important;
    bottom: 20% !important;
    width: clamp(42px, 10%, 66px) !important;
    transform: none !important;
    transform-origin: right bottom !important;
    overflow: visible !important;
  }

  body:has(.journey-shell) .journey-video-card .journey-microphone-size-wrapper {
    width: 100% !important;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    container-type: inline-size;
  }

  body:has(.journey-shell) .journey-video-card .journey-microphone-button {
    width: 100% !important;
    height: 100% !important;
  }

  body:has(.journey-shell) .journey-video-card .journey-microphone-symbol {
    font-size: 45cqw !important;
    line-height: 1 !important;
  }

  body:has(.journey-shell) .journey-video-card .journey-microphone-label {
    width: max-content !important;
    max-width: none !important;
    white-space: nowrap !important;
    flex: 0 0 auto;
  }
}


/* ==========================================================
   QNG 2026-08-09 — INDEX SCROLL + AUTH LANDSCAPE V3 (SAFE)
   IMPORTANT:
   - Scoped to the public landing page and auth pages only.
   - Does NOT alter any Journey selector/rule.
   ========================================================== */

/* INDEX ONLY — override the global html lock only while the landing page is open. */
@media (max-width: 1023px) {
  html:has(body.public-landing-page),
  body.public-landing-page {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* INDEX — keep Entrar visible in portrait. */
@media (max-width: 767px) and (orientation: portrait) {
  body.public-landing-page .public-actions .button-ghost {
    display: inline-flex !important;
  }

  body.public-landing-page .public-actions {
    flex-shrink: 0 !important;
    gap: 6px !important;
  }

  body.public-landing-page .public-actions .button {
    min-height: 38px !important;
    padding-inline: 9px !important;
    font-size: 8px !important;
    white-space: nowrap !important;
  }
}

/* AUTH ONLY — landscape back action participates in the layout instead of floating over the card. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1023px) {
  body.auth-page .auth-form-side {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    overflow-y: auto !important;
  }

  body.auth-page .auth-back {
    position: static !important;
    z-index: auto !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    align-self: flex-end !important;
    flex: 0 0 auto !important;
    min-height: 32px !important;
    margin: 0 0 7px !important;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    color: #d6e2e8 !important;
    background: rgba(6, 23, 36, .92) !important;
    border: 1px solid rgba(126, 169, 190, .28) !important;
    border-radius: 999px !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24) !important;
    backdrop-filter: blur(10px) !important;
    font-size: 8px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.auth-page .auth-form-card,
  body.auth-page.auth-forgot .auth-form-card,
  body.auth-page.auth-reset .auth-form-card {
    flex: 0 0 auto !important;
  }
}

/* =========================================================
   BOARDING GROUP — V17 MOBILE-ONLY RESPONSIVE OVERRIDES
   These rules must live here because qngResponsive.css was still
   overriding the mobile tier cards.
========================================================= */

@media (orientation: landscape) and (max-height: 650px) and (max-width: 1100px) {
  .priority-travel-tiers {
    grid-template-rows: repeat(3, 19px) !important;
    gap: 2px !important;
    align-content: start !important;
    min-height: 0 !important;
  }

  .priority-tier-card {
    height: 19px !important;
    min-height: 19px !important;
    max-height: 19px !important;
    padding: 1px 4px !important;
    grid-template-columns: 12px minmax(0, 1fr) auto !important;
    grid-template-rows: 1fr !important;
    gap: 3px !important;
    border-radius: 9px !important;
    overflow: hidden !important;
    align-items: center !important;
  }

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

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

  .priority-tier-card > div small {
    margin-top: 0 !important;
    font-size: 3.1px !important;
    line-height: 1 !important;
  }

  .priority-tier-card > strong {
    font-size: 8px !important;
    line-height: 1 !important;
  }

  .priority-tier-card > strong small {
    margin-top: 0 !important;
    font-size: 3px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}

/* =========================================================
   BOARDING GROUP — V18 MOBILE OVERRIDES FOR RESPONSIVE FILE
   Keeps desktop unchanged; reinforces landscape tier-card sizing.
========================================================= */
@media (orientation: landscape) and (max-height: 650px) and (max-width: 1100px) {
  .boarding-how-panel {
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr) !important;
    grid-template-rows: minmax(0, 1fr) 20px !important;
    gap: 6px 8px !important;
  }

  .priority-travel-tiers {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 4px !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  .priority-tier-card {
    flex: 0 0 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    padding: 2px 5px !important;
    grid-template-columns: 14px minmax(0, 1fr) auto !important;
    gap: 4px !important;
    border-radius: 9px !important;
    overflow: hidden !important;
    align-items: center !important;
  }

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

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

  .priority-tier-card > div small {
    margin-top: 0 !important;
    font-size: 3.4px !important;
    line-height: 1 !important;
  }

  .priority-tier-card > strong {
    font-size: 8px !important;
    line-height: 1 !important;
  }

  .priority-tier-card > strong small {
    margin-top: 0 !important;
    font-size: 3.2px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}

/* =========================================================
   BOARDING GROUP — V19 MOBILE POLISH ONLY
   Reinforces portrait + landscape mobile sizing from responsive file.
========================================================= */

@media (max-width: 720px) and (orientation: portrait) {
  .boarding-queue {
    padding: 0 8px !important;
  }

  .boarding-queue-stop,
  .boarding-queue-stop.current {
    min-height: 238px !important;
    padding: 0 0 78px !important;
  }

  .boarding-character-wrap {
    height: 126px !important;
    margin-bottom: 14px !important;
  }

  .boarding-queue-stop .boarding-character,
  .boarding-queue-stop.current .boarding-character,
  .group-newcomer .boarding-character,
  .group-explorer .boarding-character,
  .group-navigator .boarding-character,
  .group-insider .boarding-character,
  .group-vip .boarding-character {
    width: auto !important;
    height: 110px !important;
    max-width: none !important;
    max-height: none !important;
  }

  .boarding-queue::before {
    left: 8% !important;
    right: 8% !important;
    bottom: 62px !important;
    height: 2px !important;
  }

  .boarding-queue-node {
    bottom: 53px !important;
    width: 18px !important;
    height: 18px !important;
  }

  .boarding-queue-stop > small {
    bottom: 24px !important;
    font-size: 7px !important;
  }

  .boarding-you-are-here {
    bottom: -8px !important;
    padding: 5px 11px !important;
    font-size: 7px !important;
  }

  .boarding-how-heading > div > span {
    font-size: 13px !important;
    line-height: 1.08 !important;
  }

  .boarding-how-heading p {
    font-size: 10.5px !important;
    line-height: 1.34 !important;
    margin-top: 8px !important;
  }
}

@media (orientation: landscape) and (max-height: 650px) and (max-width: 1100px) {
  .boarding-queue {
    padding: 0 14px 0 18px !important;
  }

  .boarding-queue-stop,
  .boarding-queue-stop.current {
    min-height: 146px !important;
    padding: 0 0 54px !important;
  }

  .boarding-character-wrap {
    height: 80px !important;
    margin-bottom: 6px !important;
  }

  .boarding-queue-stop .boarding-character,
  .boarding-queue-stop.current .boarding-character,
  .group-newcomer .boarding-character,
  .group-explorer .boarding-character,
  .group-navigator .boarding-character,
  .group-insider .boarding-character,
  .group-vip .boarding-character {
    width: auto !important;
    height: 70px !important;
    max-width: none !important;
    max-height: none !important;
  }

  .boarding-queue::before {
    left: 11.5% !important;
    right: 8.5% !important;
    bottom: 42px !important;
    height: 2px !important;
  }

  .boarding-queue-node {
    bottom: 34px !important;
    width: 15px !important;
    height: 15px !important;
  }

  .boarding-queue-stop > small {
    bottom: 10px !important;
    font-size: 7px !important;
  }

  .boarding-you-are-here {
    bottom: -12px !important;
    padding: 4px 10px !important;
    font-size: 6px !important;
  }

  .boarding-how-heading > div > span {
    font-size: 8.6px !important;
    line-height: 1.1 !important;
  }

  .boarding-how-heading p {
    font-size: 6.2px !important;
    line-height: 1.2 !important;
    margin-top: 4px !important;
  }

  .priority-travel-tiers {
    gap: 5px !important;
  }

  .priority-tier-card {
    flex: 0 0 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 3px 6px !important;
    grid-template-columns: 16px minmax(0, 1fr) auto !important;
    gap: 5px !important;
    border-radius: 10px !important;
  }

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

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

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

  .priority-tier-card > strong {
    font-size: 9.5px !important;
    line-height: 1 !important;
  }

  .priority-tier-card > strong small {
    font-size: 3.7px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .boarding-climb-note {
    height: 22px !important;
    min-height: 22px !important;
  }
}

/* =========================================================
   BOARDING GROUP — V20
   KEEP DESKTOP UNCHANGED. MOBILE PORTRAIT + LANDSCAPE ONLY.
========================================================= */

@media (max-width: 720px) and (orientation: portrait) {
  .boarding-queue {
    padding: 0 6px !important;
    height: 100% !important;
  }

  .boarding-queue-stop,
  .boarding-queue-stop.current {
    display: grid !important;
    position: relative !important;
    width: 92% !important;
    max-width: 92% !important;
    justify-self: center !important;
    align-items: center !important;
    justify-items: center !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 0 2px !important;
    grid-template-rows: 15px 75px 70px 2px 5px !important;
  }

  .boarding-rank-label {
    position: static !important;
    grid-row: 1 !important;
    align-self: end !important;
    margin-top: 0 !important;
    margin-bottom: 2px !important;
    gap: 2px !important;
  }

  .boarding-rank-label strong {
    font-size: 7.2px !important;
    letter-spacing: -.02em !important;
  }

  .boarding-rank-icon {
    font-size: 11px !important;
  }

  .boarding-character-wrap {
    position: static !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 122px !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .boarding-queue-stop .boarding-character,
  .boarding-queue-stop.current .boarding-character,
  .group-newcomer .boarding-character,
  .group-explorer .boarding-character,
  .group-navigator .boarding-character,
  .group-insider .boarding-character,
  .group-vip .boarding-character {
    width: auto !important;
    height: 75px !important;
    max-width: none !important;
    max-height: none !important;
  }

  .boarding-queue::before {
    top: auto !important;
    bottom: 100px !important;
    left: 10% !important;
    right: 15% !important;
    height: 2px !important;
  }

  .boarding-queue-node {
    position: relative !important;
    grid-row: 3 !important;
    left: auto !important;
    bottom: auto !important;
    align-self: center !important;
    transform: none !important;
    width: 14px !important;
    height: 14px !important;
    border-width: 2px !important;
  }

  .boarding-queue-stop > small {
    position: static !important;
    grid-row: 4 !important;
    bottom: auto !important;
    transform: none !important;
    align-self: start !important;
    margin: 0 !important;
    font-size: 7.4px !important;
    line-height: 1 !important;
  }

  .boarding-you-are-here {
    position: relative !important;
    grid-row: 5 !important;
    left: auto !important;
    bottom: -200% !important;
    transform: none !important;
    align-self: start !important;
    margin-top: 2px !important;
    padding: 4px 8px !important;
    font-size: 5px !important;
    line-height: 1 !important;
  }

  .boarding-you-are-here::before {
    top: -6px !important;
  }

  .boarding-how-heading > div > span {
    font-size: 15px !important;
    line-height: 1.08 !important;
    letter-spacing: .08em !important;
  }

  .boarding-how-heading p {
    margin-top: 10px !important;
    font-size: 11.4px !important;
    line-height: 1.4 !important;
  }
}

@media (orientation: landscape) and (max-height: 650px) and (max-width: 1100px) {
  .boarding-queue {
    padding: 0 8px !important;
    height: 100% !important;
  }

  .boarding-queue-stop,
  .boarding-queue-stop.current {
    display: grid !important;
    position: relative !important;
    width: 94% !important;
    max-width: 94% !important;
    justify-self: center !important;
    align-items: center !important;
    justify-items: center !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 0 1px !important;
    grid-template-rows: 13px 65px 40px 12px 18px !important;
  }

  .boarding-rank-label {
    position: static !important;
    grid-row: 1 !important;
    align-self: end !important;
    margin-top: 0 !important;
    margin-bottom: 2px !important;
    gap: 1px !important;
  }

  .boarding-rank-label strong {
    font-size: 6px !important;
    letter-spacing: -.03em !important;
  }

  .boarding-rank-icon {
    font-size: 8.7px !important;
  }

  .boarding-character-wrap {
    position: static !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 76px !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .boarding-queue-stop .boarding-character,
  .boarding-queue-stop.current .boarding-character,
  .group-newcomer .boarding-character,
  .group-explorer .boarding-character,
  .group-navigator .boarding-character,
  .group-insider .boarding-character,
  .group-vip .boarding-character {
    width: auto !important;
    height: 65px !important;
    max-width: none !important;
    max-height: none !important;
  }

  .boarding-queue::before {
    top: auto !important;
    bottom: 40px !important;
    left: 13% !important;
    right: 7% !important;
    height: 2px !important;
  }

  .boarding-queue-node {
    position: relative !important;
    grid-row: 3 !important;
    left: auto !important;
    bottom: auto !important;
    align-self: center !important;
    transform: none !important;
    width: 11px !important;
    height: 11px !important;
    border-width: 2px !important;
  }

  .boarding-queue-stop > small {
    position: static !important;
    grid-row: 4 !important;
    bottom: auto !important;
    transform: none !important;
    align-self: start !important;
    margin: 0 !important;
    font-size: 5.8px !important;
    line-height: 1 !important;
  }

  .boarding-you-are-here {
    position: relative !important;
    grid-row: 5 !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    align-self: start !important;
    margin-top: 1px !important;
    padding: 2px 6px !important;
    font-size: 5.2px !important;
    line-height: 1 !important;
  }

  .boarding-you-are-here::before {
    top: -5px !important;
  }

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

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

  .priority-tier-card > strong {
    font-size: 10.4px !important;
    line-height: .95 !important;
  }

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

/* =========================================================
   BOARDING GROUP — GATE + CURRENT PRIORITY POINTS
   Responsive reinforcement for the approved Home layout.
========================================================= */

@media (max-width: 767px) and (orientation: portrait) {
  .boarding-current-points {
    margin-top: 4px !important;
    gap: 5px !important;
    font-size: 8.5px !important;
    letter-spacing: .04em !important;
  }

  .boarding-current-points-icon {
    font-size: 9px !important;
  }

  .boarding-queue {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  .boarding-queue::before {
    left: 8.333% !important;
    right: 25% !important;
  }

  .boarding-gate-stop {
    position: relative !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-rows: 70px 48px 18px 10px 10px !important;
    align-items: center !important;
    justify-items: center !important;
    overflow: visible !important;
  }

  .boarding-gate-wrap {
    grid-row: 1 / 3 !important;
    width: 100% !important;
    height: 140px !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
  }

  .boarding-gate-image {
    width: auto !important;
    height: 110px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center bottom !important;
  }
}

@media (orientation: landscape) and (max-height: 650px) and (max-width: 1100px) {
  .boarding-current-points {
    margin-top: 2px !important;
    gap: 4px !important;
    font-size: 6px !important;
    letter-spacing: .03em !important;
  }

  .boarding-current-points-icon {
    font-size: 6.5px !important;
  }

  .boarding-queue {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  .boarding-queue::before {
    left: 8.333% !important;
    right: 25% !important;
  }

  .boarding-gate-stop {
    position: relative !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-rows: 13px 76px 12px 12px 18px !important;
    align-items: center !important;
    justify-items: center !important;
    overflow: visible !important;
  }

  .boarding-gate-wrap {
    grid-row: 1 / 3 !important;
    width: 100% !important;
    height: 89px !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
  }

  .boarding-gate-image {
    width: auto !important;
    height: 100px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center bottom !important;
  }
}

/* =========================================================
   BOARDING GROUP — QUEUE SPACING FIX 2026-08-23
   Mobile only. Final responsive authority for nodes / scores / YOU ARE HERE.
========================================================= */

@media (max-width: 767px) and (orientation: portrait) {
  .boarding-queue-stop,
  .boarding-queue-stop.current {
    grid-template-rows: 15px 101px 40px 16px 24px !important;
  }

  .boarding-queue::before {
    top: 135px !important;
    bottom: auto !important;
  }

  .boarding-queue-node {
    grid-row: 3 !important;
    align-self: center !important;
  }

  .boarding-queue-stop > small {
    grid-row: 4 !important;
    align-self: center !important;
    margin: 0 !important;
  }

  .boarding-you-are-here {
    grid-row: 5 !important;
    position: relative !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    align-self: start !important;
    margin-top: 1px !important;
  }

  .boarding-you-are-here::before {
    top: -6px !important;
  }
}

@media (orientation: landscape) and (max-height: 650px) and (max-width: 1100px) {
  .boarding-queue-stop,
  .boarding-queue-stop.current {
    grid-template-rows: 13px 78px 14px 12px 18px !important;
  }

  .boarding-queue::before {
    top: 98px !important;
    bottom: auto !important;
  }

  .boarding-queue-node {
    grid-row: 3 !important;
    align-self: center !important;
  }

  .boarding-queue-stop > small {
    grid-row: 4 !important;
    align-self: center !important;
    margin: 0 !important;
  }

  .boarding-you-are-here {
    grid-row: 5 !important;
    position: relative !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    align-self: start !important;
    margin-top: 1px !important;
  }

  .boarding-you-are-here::before {
    top: -5px !important;
  }
}

/* =========================================================
   BOARDING GROUP — FINAL HEADER TWEAKS
   Responsive reinforcement for the combined Priority Points row.
========================================================= */
@media (max-width: 720px) and (orientation: portrait) {
  .boarding-progress-meta {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 8px !important;
  }

  .boarding-progress-meta-icon {
    width: 48px !important;
    height: 48px !important;
    flex: 0 0 48px !important;
    margin: 0 !important;
    font-size: 17px !important;
  }

  .boarding-progress-meta-copy {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    grid-template-areas:
      "points points"
      "star summary" !important;
    column-gap: 8px !important;
    row-gap: 5px !important;
    align-items: center !important;
  }

  .boarding-progress-meta .boarding-current-points {
    grid-area: points !important;
    margin: 0 !important;
    font-size: 20px !important;
    line-height: 1 !important;
  }

  .boarding-progress-separator {
    grid-area: star !important;
    color: var(--qng-yellow) !important;
    font-size: 15px !important;
    line-height: 1 !important;
  }

  .boarding-progress-meta .boarding-group-summary {
    grid-area: summary !important;
    margin: 0 !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 5px !important;
    white-space: nowrap !important;
    font-size: 10px !important;
    line-height: 1.12 !important;
  }

  .boarding-progress-meta .boarding-group-summary strong {
    font-size: 16px !important;
  }
}

@media (orientation: landscape) and (max-height: 650px) and (max-width: 1100px) {
  .boarding-progress-meta {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 4px !important;
  }

  .boarding-progress-meta-icon {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    margin: 0 !important;
    font-size: 11px !important;
  }

  .boarding-progress-meta-copy {
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
  }

  .boarding-progress-meta .boarding-current-points {
    margin: 0 !important;
    font-size: 9px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .boarding-progress-separator {
    color: var(--qng-yellow) !important;
    font-size: 10px !important;
    line-height: 1 !important;
  }

  .boarding-progress-meta .boarding-group-summary {
    margin: 0 !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 4px !important;
    font-size: 8.7px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .boarding-progress-meta .boarding-group-summary strong {
    font-size: 10px !important;
  }
}

/* =========================================================
   QNG PWA — STANDALONE VIEWPORT STABILIZATION V5
   PWA detection stays in JS, but orientation is controlled ONLY by
   native CSS media queries so rotation cannot leave stale classes behind.
========================================================= */

/* ---------- PWA PORTRAIT ---------- */
@media (orientation: portrait) and (max-width: 767px) {
  html.qng-pwa-standalone body:has(.home-shell) .home-content-root,
  html.qng-pwa-standalone body:has(.home-shell) #qng-home {
    height: calc(var(--qng-pwa-vh, 100dvh) - 66px - env(safe-area-inset-bottom)) !important;
  }

  html.qng-pwa-standalone body:has(.home-shell) .home-main {
    padding-bottom: calc(58px + env(safe-area-inset-bottom)) !important;
  }

  html.qng-pwa-standalone body:has(.journey-shell) .journey-main {
    height: calc(var(--qng-pwa-vh, 100dvh) - 66px - env(safe-area-inset-bottom)) !important;
    padding-bottom: 2dvh !important;
  }
}

/* ---------- PWA LANDSCAPE ---------- */
@media (orientation: landscape) and (max-height: 650px) and (max-width: 1100px) {
  html.qng-pwa-standalone {
    --qng-sidebar-width: 82px;
  }

  html.qng-pwa-standalone,
  html.qng-pwa-standalone body {
    width: 100% !important;
    height: var(--qng-pwa-vh, 100dvh) !important;
    min-height: var(--qng-pwa-vh, 100dvh) !important;
    overflow: hidden !important;
  }

  html.qng-pwa-standalone body:has(.home-shell) .home-shell,
  html.qng-pwa-standalone body:has(.journey-shell) .journey-shell {
    width: 100% !important;
    height: var(--qng-pwa-vh, 100dvh) !important;
    min-height: var(--qng-pwa-vh, 100dvh) !important;
    display: grid !important;
    grid-template-columns: var(--qng-sidebar-width) minmax(0, 1fr) !important;
    align-items: stretch !important;
    overflow: hidden !important;
  }

  html.qng-pwa-standalone body:has(.home-shell) .home-shell > .qng-sidebar,
  html.qng-pwa-standalone body:has(.journey-shell) .journey-shell > .qng-sidebar {
    width: var(--qng-sidebar-width) !important;
    min-width: var(--qng-sidebar-width) !important;
    height: var(--qng-pwa-vh, 100dvh) !important;
    min-height: var(--qng-pwa-vh, 100dvh) !important;
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 9000 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 4px 5px !important;
    overflow: hidden !important;
    border-top: 0 !important;
    border-right: 1px solid var(--qng-sidebar-line) !important;
  }

  html.qng-pwa-standalone body:has(.home-shell) .qng-sidebar-logo,
  html.qng-pwa-standalone body:has(.journey-shell) .qng-sidebar-logo {
    width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    display: flex !important;
    padding: 2px !important;
    overflow: hidden !important;
  }

  html.qng-pwa-standalone body:has(.home-shell) .qng-sidebar-logo img,
  html.qng-pwa-standalone body:has(.journey-shell) .qng-sidebar-logo img {
    width: 62px !important;
    max-width: 62px !important;
    height: 58px !important;
    max-height: 58px !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  html.qng-pwa-standalone body:has(.home-shell) .qng-sidebar-navigation,
  html.qng-pwa-standalone body:has(.journey-shell) .qng-sidebar-navigation {
    width: 100% !important;
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 4px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border: 1px solid var(--qng-sidebar-line) !important;
    border-radius: 12px !important;
  }

  html.qng-pwa-standalone body:has(.home-shell) .qng-sidebar-link,
  html.qng-pwa-standalone body:has(.home-shell) .qng-sidebar-link.exit,
  html.qng-pwa-standalone body:has(.journey-shell) .qng-sidebar-link,
  html.qng-pwa-standalone body:has(.journey-shell) .qng-sidebar-link.exit {
    width: 100% !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    border-left: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.06) !important;
  }

  html.qng-pwa-standalone body:has(.home-shell) .qng-sidebar-link.active,
  html.qng-pwa-standalone body:has(.journey-shell) .qng-sidebar-link.active {
    border-left: 4px solid var(--qng-sidebar-yellow) !important;
  }

  html.qng-pwa-standalone body:has(.home-shell) .qng-sidebar-label,
  html.qng-pwa-standalone body:has(.home-shell) .qng-sidebar-stamp,
  html.qng-pwa-standalone body:has(.journey-shell) .qng-sidebar-label,
  html.qng-pwa-standalone body:has(.journey-shell) .qng-sidebar-stamp {
    display: none !important;
  }

  html.qng-pwa-standalone body:has(.home-shell) .qng-sidebar-icon,
  html.qng-pwa-standalone body:has(.journey-shell) .qng-sidebar-icon {
    width: auto !important;
    font-size: 21px !important;
  }

  html.qng-pwa-standalone body:has(.home-shell) .home-content-root,
  html.qng-pwa-standalone body:has(.home-shell) #qng-home {
    grid-column: 2 !important;
    width: 100% !important;
    height: var(--qng-pwa-vh, 100dvh) !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  html.qng-pwa-standalone body:has(.journey-shell) .journey-main {
    grid-column: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: var(--qng-pwa-vh, 100dvh) !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 24px !important;
  }

  html.qng-pwa-standalone body:has(.journey-shell) .journey-layout {
    width: 100% !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  html.qng-pwa-standalone body:has(.journey-shell) .journey-panel {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    align-items: stretch !important;
    gap: 12px !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }
}

/* =========================================================
   JOURNEY — PORTRAIT WIDTH MATCH
   Make journey-content-panel use the same visible width as
   journey-video-card. Portrait only; landscape/desktop untouched.
========================================================= */
@media (max-width: 767px) and (orientation: portrait) {
  .journey-video-card,
  .journey-content-panel {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .journey-content-panel {
    padding-left: 0 !important;
    padding-right: 0 !important;
    scrollbar-width: none !important;
  }

  .journey-content-panel::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }

  .journey-content-panel > .journey-timeline-card,
  .journey-content-panel > .journey-panel {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }
}

