/* Tourappi mobile UI correction 2026-11-28. Layout-only: never change route geometry or event identifiers. */
@media (max-width:900px) {
  /* The global floating menu must never obscure campsite detail headings and actions. */
  html body.tg-home-page:has(#detail.detailbar.open) #touring-global-toggle {
    display:none!important;visibility:hidden!important;pointer-events:none!important;
  }
  #detail.detailbar.open{
    box-sizing:border-box!important;left:8px!important;right:8px!important;width:auto!important;
    max-width:calc(100vw - 16px)!important;
    border-radius:17px!important;overflow-x:hidden!important;overflow-y:auto!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
  #detail.detailbar.open .site-body, #detail.detailbar.open .inner{
    box-sizing:border-box!important;min-width:0!important;max-width:100%!important;
  }
  #detail.detailbar.open .site-body > h3 {
    padding-right:62px!important;min-width:0!important;overflow-wrap:anywhere!important;line-height:1.18!important;
  }
  #detail.detailbar.open :is(.tourer-site-mapframe,.tourer-site-location-card,.tourer-site-find){
    box-sizing:border-box!important;max-width:100%!important;min-width:0!important;
  }
  #detail.detailbar.open .close{z-index:50!important}
}
@media (max-width:700px) {
  /* The old navigation brand is generated separately by premium nav; cover its visual area only. */
  body.tg-nav-route .tourora-original-horizontal-header-v3{isolation:isolate!important}
  body.tg-nav-route .tourora-original-horizontal-header-v3 .tourappi-nav-brand-overlay{
    position:absolute!important;top:0!important;left:0!important;bottom:0!important;
    z-index:20!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;
    box-sizing:border-box!important;width:clamp(82px,24vw,104px)!important;gap:4px!important;
    padding:5px 4px 5px 7px!important;background:#0d3b30!important;
    color:#fff!important;border-radius:14px 0 0 14px!important;text-decoration:none!important;
    white-space:nowrap!important;overflow:hidden!important;box-shadow:none!important;
    font-family:Outfit,"DM Sans",sans-serif!important;
  }
  body.tg-nav-route .tourappi-nav-brand-overlay > img{
    display:block!important;flex:0 0 27px!important;width:27px!important;height:27px!important;
    min-width:27px!important;object-fit:cover!important;border-radius:8px!important;
  }
  body.tg-nav-route .tourappi-nav-brand-overlay > span{
    font:800 clamp(10px,3.2vw,13px)/1 Outfit,"DM Sans",sans-serif!important;
    letter-spacing:-.45px!important;text-transform:none!important;color:#fff!important;
  }
  /* Search stays above route planning widgets until destination search is dismissed. */
  body.tg-nav-route:not(.driving).nav-search-expanded #tourora-journey-rail,
  body.tg-nav-route:not(.driving).tourora-destination-editing #tourora-journey-rail,
  body.tg-nav-route:not(.driving):has(#nav-dest-search:focus) #tourora-journey-rail,
  body.tg-nav-route:not(.driving).nav-search-expanded #tourora-route-actions-v3,
  body.tg-nav-route:not(.driving).tourora-destination-editing #tourora-route-actions-v3,
  body.tg-nav-route:not(.driving):has(#nav-dest-search:focus) #tourora-route-actions-v3{
    visibility:hidden!important;pointer-events:none!important;opacity:0!important;
  }
  body.tg-nav-route:not(.driving).nav-search-expanded .chapter,
  body.tg-nav-route:not(.driving).tourora-destination-editing .chapter,
  body.tg-nav-route:not(.driving):has(#nav-dest-search:focus) .chapter{
    z-index:3200!important;max-width:calc(100vw - 18px)!important;min-width:0!important;
  }
  body.tg-nav-route:not(.driving) .chapter .dest-search-row{
    box-sizing:border-box!important;max-width:100%!important;min-width:0!important;
  }
  body.tg-nav-route:not(.driving) .chapter #nav-dest-search{
    min-width:0!important;max-width:100%!important;font-size:16px!important;
  }
  /* Bottom navigation route card: make distance / time values readable, not clipped. */
  body.tg-nav-route:not(.driving) #tn-ui .tourappi-route-summary {
    box-sizing:border-box!important;max-width:calc(100vw - 16px)!important;min-width:0!important;
    gap:6px!important;overflow:visible!important;align-items:stretch!important;
  }
  body.tg-nav-route:not(.driving) #tn-ui .tourappi-route-summary *,
  body.tg-nav-route:not(.driving) #tn-ui .tourappi-route-summary > *{
    box-sizing:border-box!important;min-width:0!important;
  }
  body.tg-nav-route:not(.driving) #tn-ui .tourappi-route-summary.tourappi-summary-flat{
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-auto-flow:row!important;gap:6px!important;height:auto!important;
    max-height:none!important;padding:7px!important;
  }
  body.tg-nav-route:not(.driving) #tn-ui .tourappi-route-summary.tourappi-summary-flat > *{
    width:auto!important;max-width:100%!important;min-width:0!important;flex:none!important;
    text-align:center!important;line-height:1.25!important;
  }
  body.tg-nav-route:not(.driving) #tn-ui .tourappi-route-summary.tourappi-summary-flat > .tourappi-summary-start{
    grid-column:span 2!important;
  }
  body.tg-nav-route:not(.driving) #tn-ui .tourappi-route-summary.tourappi-summary-nested{
    display:flex!important;flex-wrap:wrap!important;gap:6px!important;height:auto!important;
    padding:7px!important;
  }
  body.tg-nav-route:not(.driving) #tn-ui .tourappi-route-summary.tourappi-summary-nested > *{
    box-sizing:border-box!important;flex:1 1 100%!important;min-width:0!important;
  }
  body.tg-nav-route:not(.driving) #tn-ui .tourappi-route-summary .tourappi-summary-stat{
    min-width:0!important;overflow:visible!important;
  }
  body.tg-nav-route:not(.driving) #tn-ui .tourappi-route-summary .tourappi-summary-stat :is(strong,b,[class*="value"]){
    font-size:clamp(12px,3.5vw,17px)!important;line-height:1.2!important;white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  body.tg-nav-route:not(.driving) #tn-ui .tourappi-route-summary :is(#tn-start,.tourappi-summary-start button){
    width:100%!important;min-width:0!important;max-width:100%!important;
    font-size:clamp(12px,3.5vw,15px)!important;white-space:normal!important;
  }
}
@media (max-width:360px){
  body.tg-nav-route .tourora-original-horizontal-header-v3 .tourappi-nav-brand-overlay{
    width:80px!important;padding-left:4px!important;
  }
  body.tg-nav-route .tourappi-nav-brand-overlay > img{width:24px!important;height:24px!important;flex-basis:24px!important}
  body.tg-nav-route .tourappi-nav-brand-overlay > span{font-size:10px!important}
}
/* Cross Farm detail-overlay top-edge fix: occupy the whole webview's top edge, not 8px below it. */
@media (max-width:900px){
 #detail.detailbar.open{
  top:0!important;bottom:auto!important;height:auto!important;
  max-height:calc(100dvh - 4px)!important;min-height:0!important;
  margin-top:0!important;overflow-y:auto!important;overflow-x:hidden!important;
  z-index:33000!important;-webkit-overflow-scrolling:touch!important;
 }
 #detail.detailbar.open > :first-child{margin-top:0!important}
}
#tourappi-voice-mode-btn,#tourappi-voice-test-btn{
 display:block;box-sizing:border-box;width:100%;min-height:45px;margin:7px 0;
 padding:10px 13px;border:1px solid #9ecf8b;border-radius:10px;
 background:#265c46;color:#fff;text-align:left;font-family:inherit;font-size:13px;font-weight:800;
}
#tourappi-voice-test-btn{background:#e4fbb7;color:#124534}
#tourappi-voice-status{display:block;margin:7px 2px 2px;color:#daeddd;font-size:12px;line-height:1.4}
