/* Text resilience
   Keeps the interface usable when Android system text is enlarged.
   We deliberately do not fight the system font scale; layouts grow instead. */

:root {
  --ll-nav-height: calc(60px + env(safe-area-inset-bottom, 0px));
}

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

body {
  overflow-wrap: break-word;
}

/* Phase 1: text may reflow instead of being clipped by fixed widths. */
.city-name,
.shelf__title,
.li-card__title,
.li-insight-head h3,
.li-editorial-lead,
.li-editorial-body,
.li-exp-title,
.li-quick-copy,
.li-ring-card h4,
.li-ring-card p,
.li-outlook-big,
.li-outlook-sub,
.li-outlook-meta,
.li-bar-label,
.li-climate-content,
.dest-name,
.dest-country,
.header-action .btn-label,
.li-provider-note,
.li-conv-field,
.li-conv-rate,
.li-conv-updated,
.passport-reward-card,
.passport-card {
  overflow-wrap: break-word;
}

.header-inner > *,
.header-actions > *,
.city-card > *,
.li-quick-fact > *,
.li-quick-copy,
.li-ring-copy,
.li-ring-foot,
.li-outlook-card,
.li-outlook-top,
.li-climate-content,
.li-climate-temp-row,
.li-editorial-sheet,
.li-exp-sheet,
.li-provider-item,
.li-conv-field,
.li-conv-box,
.dest-tab,
.bnav-tab,
.bnav-label,
.map-cat-pill,
.map-style-opt {
  min-width: 0;
}

/* Small labels that previously clipped when enlarged. */
.li-source-chip,
.li-provider-pill {
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

/* Phase 2: mobile chrome grows with its text. */
@media (max-width: 768px) {
  body {
    padding-bottom: var(--ll-nav-height);
  }
  .footer {
    margin-bottom: var(--ll-nav-height);
  }
  .essentials-modal,
  .overlay,
  #destiSocialOverlay {
    bottom: var(--ll-nav-height);
  }
  .dm-chat-view {
    bottom: var(--ll-nav-height) !important;
  }
  .viewport-progressive-blur {
    --bottom-nav-height: var(--ll-nav-height);
  }

  .bottom-nav {
    height: auto;
    min-height: 60px;
    align-items: stretch;
  }
  .bnav-tab {
    height: auto;
    padding: 6px 2px 8px;
  }
  .bnav-label {
    white-space: normal;
    line-height: 1.15;
    text-align: center;
  }
  .bnav-home {
    height: auto;
    min-height: 60px;
    align-self: stretch;
  }
  .bnav-home .bnav-label {
    white-space: normal;
    line-height: 1.15;
    text-align: center;
    max-width: 70px;
  }

  .header-inner,
  .header-actions {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .hero-search-input-wrap {
    height: auto;
    min-height: 52px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  body.search-focus-mode .hero-search-input-wrap {
    height: auto;
    min-height: 56px;
  }
}

/* Destination tab bar: labels may wrap; JS keeps the thumb sized to the bar. */
.dest-tabs {
  height: auto;
  align-items: stretch;
}
.dest-tab {
  height: auto;
  white-space: normal;
  line-height: 1.15;
  padding: 8px 5px;
  overflow-wrap: anywhere;
  text-align: center;
}

/* Five tabs (Guides added): keep every label on one line. Icons stay if they
   fit; on very narrow phones they collapse and hairlines keep the rhythm. */
.dest-tabs--many {
  justify-content: space-between;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.dest-tabs--many::-webkit-scrollbar { display: none; }
.dest-tabs--many .dest-tab {
  flex: 0 0 auto;
  height: auto;
  min-height: 44px;
  white-space: nowrap;
  overflow-wrap: normal;
  padding: 0 7px;
  font-size: 13px;
  line-height: 1;
  gap: 5px;
}
.dest-tabs--many .dest-tab:not(.active) .dest-tab-ico { display: none; }
.dest-tabs--many .dest-tab__label { overflow: visible; text-overflow: clip; }

/* Hairline separators only while inactive icons are hidden. */
.dest-tabs--many .dest-tab + .dest-tab::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 50%;
  width: 1px;
  height: 18px;
  transform: translateY(-50%);
  background: var(--line);
  opacity: .75;
  pointer-events: none;
}
.dest-tabs--many .dest-tab.active::before,
.dest-tabs--many .dest-tab.active + .dest-tab::before { display: none; }

/* Enough room for every icon: tighten instead of dropping them. */
@media (min-width: 360px) {
  .dest-tabs--many .dest-tab { font-size: 12.5px; padding: 0 5px; gap: 3px; }
  .dest-tabs--many .dest-tab:not(.active) .dest-tab-ico {
    display: block;
    width: 18px;
    height: 18px;
  }
  .dest-tabs--many .dest-tab + .dest-tab::before { display: none; }
}

@media (min-width: 390px) {
  .dest-tabs--many .dest-tab { font-size: 13px; padding: 0 6px; gap: 4px; }
  .dest-tabs--many .dest-tab .dest-tab-ico { width: 19px; height: 19px; }
}

/* Map controls: keep the labels readable instead of clipping them. */
.map-style-toggle {
  max-width: calc(100% - 60px);
}
.map-style-opt {
  height: auto;
  min-height: 30px;
  padding: 6px 10px;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
}
.map-cat-pills {
  align-items: center;
}
.map-cat-pill {
  height: auto;
  min-height: 44px;
  padding: 8px 12px;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
}

/* Phase 3: cards, rows and controls can grow with their labels. */
.shelf__item--city {
  height: auto;
  min-height: 180px;
}
.city-name {
  flex-wrap: wrap;
  line-height: 1.15;
}
.city-card {
  overflow-wrap: break-word;
}
.filter-chip,
.overlay-tab,
.ess-tab,
.social-tab,
.hotel-pill,
.price-option,
.cat-option,
.tip-category-pill,
.submit-btn,
.btn-request-city,
.p5-cat,
.p5-city,
.passport-segment,
.request-card-actions button,
.li-provider-pill {
  height: auto;
  white-space: normal;
  line-height: 1.2;
}
.price-option,
.cat-option {
  min-height: 38px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.tip-category-pill {
  min-height: 28px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.submit-btn {
  min-height: 50px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.p5-cats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
/* The category grids stay at 3+3 for normal system text. At very large
   text they become 2-2-2. This is a container query (not a media query) so
   the em threshold follows the actual rendered root font size, including
   in-app text scaling. */
#p5WherePage,
#tipCatPage {
  container-type: inline-size;
}
@container (max-width: 16em) {
  .p5-cats,
  .category-select {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.p5-cat,
.p5-city {
  padding-top: 10px;
  padding-bottom: 10px;
}
.p5-city__name,
.p5-review__city,
.p5-mini-card__country {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.2;
}
.p5-review__foot,
.p5-mini-card__place {
  flex-wrap: wrap;
}
.passport-segment {
  white-space: normal;
  line-height: 1.15;
}

/* Phase 4: sheets and modal actions wrap instead of clipping. */
.sheet-actions,
.tip-form-footer,
.modal-sticky-footer,
.p5-file-footer,
.p5-celebrate-actions,
.passport-levelup-btns {
  flex-wrap: wrap;
  row-gap: 8px;
}
.sheet-actions > *,
.tip-form-footer > *,
.p5-file-footer > * {
  min-width: 0;
}

/* Home shelves and search rows: allow names to grow instead of ellipsis. */
.shelf__cityname,
.shelf__country,
.result-title,
.card-v2__name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.2;
}
.shelf__place {
  flex-wrap: wrap;
}
.result-meta {
  overflow-wrap: anywhere;
}

.sheet-actions button,
.modal-sticky-footer button {
  height: auto;
  white-space: normal;
  line-height: 1.2;
}

/* Composer: let each step size the sheet to its own content. The body
   scrolls only when the content is genuinely taller than the viewport. */
#tipSheet .ll-stack-body {
  height: auto;
  min-height: 0;
  max-height: calc(94dvh - 170px);
  flex: 0 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}
#tipSheet .ll-page {
  position: static;
  inset: auto;
  overflow: visible;
}

/* The contribution stack overlays its pages in the body instead of stacking
   them in flow. That keeps a push/pop from summing the outgoing and incoming
   page heights (which made the sheet balloon, then snap back). The stack
   component sizes the body to the active page and animates the height. */
#tipSheet #llStackBody .ll-page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  height: auto;
  overflow: visible;
}

/* Do not let a translucent form footer cover the last fields when text grows. */
#tipSheet .ll-page .tip-form-footer {
  position: static;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-top: 0;
  padding-top: 12px;
}

/* Logout / goodbye flow: scroll the body, keep the actions reachable. */
.goodbye-flow__panel {
  overflow: hidden;
}
.goodbye-flow__body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 16px;
}
.goodbye-flow__nav {
  flex-wrap: wrap;
}
.goodbye-flow__nav .gb-primary,
.goodbye-flow__nav .gb-logout,
.goodbye-flow__nav .gb-quiet {
  height: auto;
  white-space: normal;
  line-height: 1.2;
}
.gb-board-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* The tip sheet sizes to its stack so short steps do not leave a bottom blank. */
#tipSheet .sheet {
  height: auto;
  max-height: 94dvh;
}

/* Featured crew-favourite card: give the city name the full card width,
   then place the tips pill underneath at the right. No mid-word breaks. */
.shelf__fbottom {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 7px;
  margin-bottom: 3px;
}
.shelf__fcity {
  width: 100%;
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

/* Names and short labels should never split mid-word when text is enlarged. */
.shelf__cityname,
.city-name,
.dest-name,
.p5-city__name,
.p5-mini-card__city,
.li-ring-card h4,
.li-quick-copy strong,
.li-exp-title,
.li-editorial-lead {
  overflow-wrap: normal;
  word-break: normal;
}

/* Fixed-size FAB plus: independent of the system font scale and optically centred. */
.bnav-addtip-plus {
  width: 24px;
  height: 24px;
  display: block;
  font-size: 0;
  line-height: 0;
  color: transparent;
}
.bnav-addtip-plus::before,
.bnav-addtip-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--gold-deep, #6B4E16);
  border-radius: 2px;
  transform: translate(-50%, -50%);
}
.bnav-addtip-plus::before {
  width: 22px;
  height: 3px;
}
.bnav-addtip-plus::after {
  width: 3px;
  height: 22px;
}

/* French labels are longer; keep five destination tabs on one line. */
html[lang="fr"] .dest-tabs--many .dest-tab{font-size:12px;padding:0 4px;gap:2px}
@media (max-width:399px){
  html[lang="fr"] .dest-tabs--many .dest-tab:not(.active) .dest-tab-ico{display:none}
  html[lang="fr"] .dest-tabs--many .dest-tab + .dest-tab::before{display:block}
}
@media (min-width:400px){
  html[lang="fr"] .dest-tabs--many .dest-tab:not(.active) .dest-tab-ico{display:block;width:18px;height:18px}
  html[lang="fr"] .dest-tabs--many .dest-tab + .dest-tab::before{display:none}
}

/* Gear category pills must stay on one line */
.essentials-tabs .ess-tab{white-space:nowrap;flex:none}
