/* Phone composition. Desktop and tablet rules remain owned by their existing styles. */
@media (max-width: 600px) {
  html { scroll-padding-top: 92px; }
  .app-shell { padding: 16px; }
  .topbar {
    top: max(12px, env(safe-area-inset-top));
    left: 16px;
    right: 16px;
    padding: 8px 10px;
    min-height: 60px;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    grid-template-rows: 44px;
    gap: 4px;
    border-radius: 20px;
  }
  .topbar .brand-mark { min-width: 0; gap: 6px; font-size: 15px; }
  .topbar .brand-symbol { width: 32px; }
  .topbar .nav-toggle,
  .topbar .topbar-lang-slot,
  .topbar .topbar-lang-slot .gotripcn-language-trigger {
    width: 44px; min-width: 44px; height: 44px; min-height: 44px;
  }
  .topbar .nav-toggle { display: flex; grid-column: 2; grid-row: 1; }
  .topbar .brand-mark { grid-column: 1; grid-row: 1; }
  .topbar .topbar-end { display: contents; }
  .topbar .topbar-lang-slot { grid-column: 3; grid-row: 1; }
  .topbar .gotripcn-language-trigger > * { display: none !important; }
  .topbar .gotripcn-language-trigger::after { content: 'EN'; font: 700 12px/1.2 Inter,system-ui,sans-serif; }
  html[lang^="zh"] .topbar .gotripcn-language-trigger::after { content: '中'; }
  html[lang="es"] .topbar .gotripcn-language-trigger::after { content: 'ES'; }
  .topbar .auth-area { display: none !important; }
  .topbar .site-nav {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    grid-column: auto; grid-row: auto; grid-template-columns: repeat(2,minmax(0,1fr));
    width: 100%; max-width: none; margin: 0; padding: 10px; gap: 5px; border-radius: 18px;
    transform: none; translate: none; zoom: 1; justify-self: stretch;
    background: rgba(250,250,255,.98); box-shadow: 0 18px 38px rgba(64,72,122,.16);
  }
  body.nav-open .topbar .site-nav { display: grid; opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; }
  .topbar .site-nav a { min-height: 46px; padding: 10px 12px; font-size: 14px; }
  .topbar .mobile-account-link { grid-column: auto !important; border-color: #d8d2f4 !important; background: #eeebff !important; }
  .topbar nav a[href$="#become-guide"] { grid-column: 1 / -1; }
  body:has(.app-shell.is-guide-route) .topbar {
    top: max(12px, env(safe-area-inset-top));
    left: 16px; right: 16px; padding: 8px 10px;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    grid-template-rows: 44px;
  }
  body:has(.app-shell.is-guide-route) .guide-nav-back {
    min-height: 44px; font-size: 13px; padding: 0 8px; letter-spacing: 0;
  }

  /* A clear introduction followed immediately by city choices. */
  .overview-stage {
    padding: calc(72px + env(safe-area-inset-top)) 0 24px;
    gap: 24px;
  }
  .overview-stage .landing-hero {
    width: 100%;
    min-height: clamp(320px, calc(70svh - 84px), 460px);
    padding: 30px 24px;
    align-items: stretch;
    justify-content: center;
    border-radius: 22px;
    text-align: left;
  }
  .landing-hero .landing-title {
    width: 100%; max-width: 100%;
    font-size: clamp(27px, 7.7vw, 34px);
    line-height: 1.13; letter-spacing: -.045em;
    text-align: left; text-wrap: balance;
  }
  .landing-title .landing-slogan-line { display: none; }
  .landing-title .landing-slogan-mobile-line { display: inline; white-space: normal; }
  .landing-title .landing-slogan-mobile-line:nth-last-child(2) { display: block; margin-top: 8px; }
  /* Chinese has no word spaces: the first mobile line carries the whole phrase, so drop the inline second half and its gap. */
  html[lang^="zh"] .landing-title .landing-slogan-mobile-line:nth-child(4) { display: none; }
  .landing-hero .hero-actions { width: 100%; margin-top: 24px; }
  .landing-hero .hero-cta { width: 100%; min-height: 52px; font-size: 15px; padding: 12px 24px; }
  .landing-hero .hero-proof-strip {
    width: 100%; margin-top: 20px; justify-content: space-between;
    gap: 8px; font-size: 11px; line-height: 1.4; flex-wrap: wrap;
  }
  .landing-hero .hero-proof-item { gap: 4px; }
  .landing-hero .hero-proof-icon { width: 14px; height: 14px; }
  .landing-hero .hero-proof-dot { display: none; }
  .landing-followup { width: 100%; margin-top: 0; gap: 38px; }
  .city-section { width: 100%; gap: 16px; scroll-margin-top: 94px; }
  .city-section .hero-title {
    width: 100%; max-width: 100%; font-size: clamp(24px, 6.5vw, 29px);
    line-height: 1.15; text-align: left; letter-spacing: -.035em;
  }
  .city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .city-grid .city-card { min-height: 190px; border-radius: 18px; }
  .city-card .city-card-inner { padding: 14px; }
  .city-card .city-name { font-size: clamp(15px, 4.1vw, 19px); letter-spacing: -.035em; overflow-wrap: anywhere; }
  .city-card .city-meta { font-size: 11px; line-height: 1.4; }
  .city-card .city-index { width: 30px; height: 30px; font-size: 11px; }
  .how-section, .stories-section { width: 100%; }
  .how-section { padding: 22px 18px; border-radius: 22px; gap: 24px; }
  .how-title, .stories-title { font-size: 29px; line-height: 1.15; }
  .story-card { padding: 20px; border-radius: 20px; }

  /* Locals: keep the face, identity, fee and both actions in a readable card. */
  #panel-explore { padding: 88px 16px 28px; }
  .explore-stage { width: 100%; gap: 18px; }
  .explore-header { padding: 20px; gap: 12px; border-radius: 20px; }
  .explore-city { font-size: clamp(28px, 8.2vw, 40px); line-height: 1.1; letter-spacing: -.035em; overflow-wrap: anywhere; }
  .explore-meta { margin: 0; font-size: 11px; text-align: left; letter-spacing: .06em; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .guide-grid .guide-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px; padding: 16px; border-radius: 22px;
    min-height: 0; box-shadow: 0 12px 30px rgba(52, 57, 98, .09);
  }
  .guide-card .avatar-placeholder { grid-column: 1; grid-row: 1 / span 2; width: 88px; aspect-ratio: 4 / 5; align-self: start; border-radius: 15px; }
  .guide-card .guide-content { display: contents; }
  .guide-card .guide-head { display: grid; grid-column: 2; grid-row: 1; grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .guide-card .guide-identity { grid-template-columns: minmax(0, max-content) 18px; gap: 4px 6px; }
  .guide-card .guide-name { font-size: 21px; line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
  .guide-card .guide-location { font-size: 10px; line-height: 1.4; letter-spacing: .06em; }
  .guide-card .guide-rate { display: flex; align-items: baseline; gap: 5px; padding: 0; font-size: 23px; text-align: left; }
  .guide-card .guide-rate-unit { display: inline; font-size: 11px; line-height: 1.4; }
  .guide-card .guide-languages { grid-column: 2; grid-row: 2; display: block; padding: 9px 0 0; font-size: 9px; letter-spacing: .04em; }
  .guide-card .guide-languages strong { display: block; margin-top: 3px; white-space: normal; font-size: 12px; }
  .guide-card .guide-bio { grid-column: 1 / -1; grid-row: 3; display: -webkit-box; -webkit-box-orient: vertical; min-height: 0; max-height: none; height: auto; padding: 0; font-size: 13px; line-height: 1.55; -webkit-line-clamp: 3; }
  .guide-card .guide-bio::before { display: none; }
  .guide-card .guide-actions { display: grid; grid-column: 1 / -1; grid-row: 4; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 0; }
  .guide-card[data-virtual-test] .avatar-placeholder { grid-row: 1; }
  .guide-card[data-virtual-test] .guide-bio { grid-row: 2; }
  .guide-card[data-virtual-test] .guide-actions { grid-row: 3; }
  .guide-card .message-button, .guide-card .guide-profile-link { min-height: 44px; width: 100%; justify-content: center; padding: 10px 8px; font-size: 12px; }
  .guide-card .guide-profile-link { border: 1px solid #dcd8f5; border-radius: 12px; background: rgba(255,255,255,.7); }
  .guide-routes-modal { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
  .guide-routes-dialog { width: 100%; max-height: calc(100dvh - 24px); border-radius: 22px; }
  .guide-routes-toolbar { padding: 18px; }
  .guide-routes-toolbar button { min-height: 44px; }

  /* Application: the form follows the introduction; process and benefits follow it. */
  .app-shell.is-guide-route { padding: 0; }
  .app-shell.is-guide-route #panel-become-guide { padding: calc(88px + env(safe-area-inset-top)) 16px 28px; }
  .become-guide-stage {
    width: 100%; grid-template-columns: minmax(0, 1fr); gap: 24px;
    padding: 24px 20px; border-radius: 24px; min-height: 0;
  }
  .become-guide-stage .become-guide-rail { display: none; }
  .become-guide-copy { padding: 0; gap: 14px; min-width: 0; }
  .become-kicker { font-size: 11px; letter-spacing: .12em; }
  .become-title { margin: 0; font-size: clamp(27px, 7.7vw, 34px); line-height: 1.1; letter-spacing: -.035em; overflow-wrap: anywhere; }
  .become-title .become-title-line { white-space: normal; }
  html[lang="en"] .become-title > .become-title-city-line { width: auto; white-space: normal; }
  .become-title .become-city-landmark { max-width: 1.7em; }
  .become-lede { font-size: 14px; line-height: 1.65; }
  .become-guide-stage .guide-apply-card { width: 100%; padding: 20px 16px; border-radius: 20px; max-height: none; overflow: visible; }
  .guide-apply-head { margin-bottom: 22px; align-items: flex-start; gap: 10px; }
  .guide-apply-eyebrow { font-size: 10px; letter-spacing: .1em; }
  .guide-apply-title { font-size: 26px; line-height: 1.2; }
  .guide-route-close { width: 44px; height: 44px; }
  .guide-application-form { gap: 17px; }
  .guide-field { gap: 7px; }
  .guide-field label { font-size: 12px; line-height: 1.4; letter-spacing: .04em; }
  .guide-field input, .guide-field textarea { min-height: 50px; padding: 12px; font-size: 16px; line-height: 1.45; border-radius: 12px; }
  .guide-field textarea { min-height: 112px; resize: vertical; }
  .guide-field input::placeholder, .guide-field textarea::placeholder { color: #868d9f; }
  .guide-upload-zone { min-height: 100px; padding: 18px 12px; }
  .guide-upload-zone strong { font-size: 13px; letter-spacing: .04em; }
  .guide-terms { gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.6; color: #5b6175; }
  .guide-terms input { width: 20px; height: 20px; flex-shrink: 0; margin: 1px 0 0; }
  .guide-submit { min-height: 52px; font-size: 15px; }
  .become-interview-steps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .become-interview-step { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 14px; min-height: 0; border-radius: 16px; box-shadow: none; }
  .become-interview-step .become-interview-step__index {
    width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0;
    align-self: start; justify-self: start; display: grid; place-items: center;
    border: 1px solid rgba(107,105,232,.12); border-radius: 50%;
    background: rgba(107,105,232,.1); color: #6556d8;
    font-size: 12px; font-weight: 800; line-height: 1; letter-spacing: 0;
    font-variant-numeric: tabular-nums;
  }
  .become-interview-step strong { font-size: 13px; line-height: 1.4; letter-spacing: 0; }
  .become-interview-step span { font-size: 12px; line-height: 1.6; }
  .become-proof { margin-top: 0; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .become-proof-item { min-height: 0; padding: 14px 0; background: none; border: 0; border-top: 1px solid #e4e4ef; border-radius: 0; box-shadow: none; }

  /* City editorial pages share the same phone scale across every language. */
  .city-page .topbar { min-height: 60px !important; margin: 12px 16px !important; padding: 8px 10px !important; gap: 4px !important; grid-template-columns: minmax(0,1fr) 44px 44px !important; border-radius: 20px !important; }
  .city-page .topbar .brand { padding-right: 0 !important; gap: 6px !important; }
  .city-page .topbar .brand span { font-size: 14px; }
  .city-page .topbar .brand-symbol { width: 32px !important; height: auto; }
  .city-page .site-mobile-nav-toggle, .city-page .gotripcn-language-trigger { width: 44px; min-width: 44px; height: 44px; }
  .city-page .gotripcn-language-trigger > span:last-child { display: none; }
  .city-page .shell { padding: 8px 16px 40px; }
  .city-page .hero { margin-top: 8px; gap: 16px; }
  .city-page .hero-copy { padding: 24px; border-radius: 22px; }
  .city-page .hero-copy .eyebrow { max-width: 100%; font-size: 9px; letter-spacing: .06em; line-height: 1.5; margin-bottom: 14px; }
  html[lang] .city-page .hero h1.city-title-english { font-size: clamp(26px, 8.2cqw, 34px) !important; line-height: 1.12; margin-bottom: 16px; letter-spacing: -.035em; }
  .city-page .hero-copy .tagline { font-size: 14px; line-height: 1.65; margin-bottom: 22px; }
  .city-page .hero-copy .cta-row { gap: 10px; }
  .city-page .hero-copy .cta-row .btn-primary { min-height: 52px; min-width: 0; width: 100%; font-size: 15px; }
  .city-page .hero-copy .cta-row .btn-secondary { min-height: 44px; font-size: 13px; }
  .city-page .proof-line { margin-top: 16px; font-size: 11px; line-height: 1.6; }
  .city-page .hero-visual { min-height: 180px; }
  .city-page .section-nav { margin-top: 16px; padding: 8px; gap: 6px; border-radius: 16px; }
  .city-page .section-nav a { min-height: 44px; padding: 10px 12px; font-size: 12px; }
  .city-page .content-section { margin-top: 32px; scroll-margin-top: 24px; }
  .city-page .section-heading { gap: 10px; margin-bottom: 18px; }
  .city-page .section-heading h2 { font-size: 25px; line-height: 1.2; letter-spacing: -.035em; }
  .city-page .section-heading p { font-size: 13px; line-height: 1.65; }
  .city-page .city-blog-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .city-page .city-blog-grid > a { min-height: 0; padding: 20px; border-radius: 20px; }
  .city-page .city-blog-grid h3 { font-size: 20px; line-height: 1.3; }
  .city-page .city-blog-grid p { font-size: 13px; line-height: 1.65; }
  .city-page .city-local-blog-cover { aspect-ratio: 16/9; margin-bottom: 16px; border-radius: 13px; }
  .city-page .attraction-grid { gap: 16px; }
  .city-page .attraction-photo { aspect-ratio: 16/10; min-height: 0; }
  .city-page .areas-panel, .city-page .panel, .city-page .final-cta { padding: 22px; border-radius: 22px; }
  .gotripcn-footer { padding-inline: 20px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .gotripcn-footer-heading { font-size: 14px; }
  .gotripcn-footer-link { display: inline-flex; align-items: center; min-height: 36px; font-size: 12px; }
}

@media (max-width: 360px) {
  .overview-stage .landing-hero { padding-inline: 20px; }
  .landing-hero .hero-proof-strip { gap: 4px; font-size: 10px; }
  .guide-grid .guide-card { grid-template-columns: 72px minmax(0,1fr); padding: 14px; gap: 12px; }
  .guide-card .avatar-placeholder { width: 72px; }
  .guide-card .guide-name { font-size: 19px; }
  .become-guide-stage { padding: 22px 16px; }
}

/* Keep every phone navigation destination visible above the page content. */
@media (max-width: 600px) {
  html { scroll-padding-top: 16px; }
  .city-section, .how-section { scroll-margin-top: 16px; }
  .topbar,
  .city-page .topbar,
  body:has(.app-shell.is-guide-route) .topbar {
    position: relative !important;
    top: auto !important; left: auto !important; right: auto !important;
    width: calc(100% - 32px) !important; max-width: none;
    height: auto !important; max-height: none !important;
    margin: max(12px, env(safe-area-inset-top)) 16px 0 !important;
    padding: 8px 10px !important;
    grid-template-columns: minmax(0,1fr) 44px !important;
    grid-template-rows: 44px auto !important;
    gap: 8px !important;
  }
  .topbar .nav-toggle,
  .topbar .site-mobile-nav-toggle { display: none !important; }
  .topbar .topbar-end { display: contents; }
  .topbar .topbar-lang-slot,
  .city-page .topbar .topbar-actions { grid-column: 2 !important; grid-row: 1 !important; }
  .topbar .topbar-lang-slot,
  .city-page .topbar .topbar-lang-slot,
  .city-page .topbar .topbar-actions { position: relative !important; z-index: 60 !important; }
  .topbar > nav,
  .city-page .topbar > nav,
  body.nav-open .topbar .site-nav {
    position: static !important;
    display: flex !important; flex-wrap: wrap !important;
    grid-column: 1 / -1 !important; grid-row: 2 !important;
    width: 100% !important; max-width: none !important;
    margin: 0 !important; padding: 8px 0 0 !important; gap: 6px !important;
    transform: none !important; translate: none; zoom: 1;
    opacity: 1 !important; visibility: visible !important; pointer-events: auto !important;
    overflow: visible !important; justify-self: stretch;
    z-index: 1 !important;
    border: 0 !important; border-top: 1px solid rgba(17,19,29,.07) !important;
    border-radius: 0 !important; background: transparent !important;
    box-shadow: none !important; backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .topbar > nav a,
  .city-page .topbar > nav a {
    display: flex !important; flex: 1 0 auto;
    align-items: center !important; justify-content: center !important;
    min-width: 0; max-width: 100%; min-height: 36px !important;
    padding: 8px !important; font-size: 12px !important; line-height: 16px !important;
    letter-spacing: 0; white-space: nowrap !important;
    border: 1px solid rgba(94,84,232,.08) !important;
    border-radius: 10px !important; background: rgba(94,84,232,.045) !important;
  }
  .topbar > nav .mobile-account-link { background: #eeebff !important; }
  .topbar:has(.user-session) .mobile-account-link { display: none !important; }
  .topbar .sharp-button.back-button {
    position: static !important; grid-column: 1; grid-row: 1;
    margin: 0; min-height: 44px; padding: 0 8px;
  }
  .overview-stage { padding-top: 0; }
  .overview-stage .landing-hero {
    min-height: min(440px, max(0px, calc(100svh - var(--mobile-navigation-height, 190px) - var(--mobile-city-title-height, 30px) - 116px)));
  }
  #panel-explore { padding-top: 16px; }
  .app-shell.is-guide-route #panel-become-guide { padding-top: 16px; }
}

@media (max-width: 600px) and (max-height: 680px) {
  .overview-stage .landing-hero { padding: 16px 20px; }
  .landing-hero .landing-title { font-size: clamp(23px,6.8vw,27px); line-height: 1.1; }
  .landing-title .landing-slogan-mobile-line:nth-last-child(2) { margin-top: 6px; }
  .landing-hero .hero-actions { margin-top: 16px; }
  .landing-hero .hero-cta { min-height: 48px; }
  .landing-hero .hero-proof-strip { margin-top: 12px; gap: 4px; font-size: 10px; }
}
