/* Mobile-first respondent overrides: maximize map space and simplify interaction. */
@media (max-width: 760px){
  html,body{min-height:100%;overflow-x:hidden}
  body.survey-modern{background-attachment:scroll!important}

  .respondent-topbar{
    height:56px!important;
    padding:0 10px!important;
    gap:8px!important;
  }
  .respondent-brand{gap:8px!important;min-width:0!important}
  .respondent-brand-mark{width:30px!important;height:30px!important;font-size:13px!important}
  .respondent-brand-logo{height:30px!important;max-width:88px!important}
  .respondent-brand-title{font-size:13px!important;max-width:34vw!important}
  .respondent-brand-sub{display:none!important}
  .respondent-step-label{display:none!important}
  .respondent-language{margin-left:auto!important;max-width:118px!important;flex:none!important}
  .respondent-language select{max-width:100px!important;font-size:12px!important;text-overflow:ellipsis!important}
  .experience-progress{top:56px!important;height:2px!important}

  /* Welcome screen: vertically balanced and much less card-heavy. */
  body.survey-modern .survey-page{padding:0 12px 28px!important}
  .experience-stage{min-height:calc(100svh - 58px)!important;padding:0!important;align-items:flex-start!important}
  .survey-modern .survey-head{
    width:100%!important;
    min-height:calc(100svh - 86px)!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    margin:0!important;
    padding:28px 18px 34px!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    backdrop-filter:none!important;
  }
  .survey-modern .survey-head.experience-hidden{display:none!important}
  .survey-modern .survey-logo{max-height:54px!important;max-width:160px!important;margin-bottom:20px!important}
  .survey-kicker{font-size:11px!important;letter-spacing:.08em!important;margin-bottom:10px!important}
  .survey-modern .survey-title{font-size:clamp(32px,10vw,42px)!important;line-height:1.08!important;letter-spacing:-.02em!important;margin-bottom:14px!important}
  .survey-modern .survey-desc{font-size:16px!important;line-height:1.55!important;max-width:100%!important}
  .survey-intro-meta{gap:6px!important;margin-top:20px!important}
  .survey-intro-meta span{font-size:11px!important;padding:6px 8px!important}
  .survey-start-row{margin-top:28px!important;width:100%!important}
  .survey-start-row .btn{width:100%!important;min-height:52px!important;font-size:16px!important}

  /* Ordinary questions: one clear block, one column, large touch targets. */
  .survey-modern .survey-question,.survey-modern .section-block{
    width:100%!important;
    margin:16px 0 0!important;
    padding:24px 18px!important;
    border-radius:18px!important;
    box-shadow:0 10px 30px rgba(17,35,25,.07)!important;
  }
  .survey-modern .survey-question h3{font-size:26px!important;line-height:1.16!important;margin-bottom:10px!important}
  .survey-modern .qdesc{font-size:15px!important;line-height:1.5!important;margin-bottom:18px!important}
  .survey-modern .option-list{grid-template-columns:1fr!important;gap:9px!important}
  .survey-modern .option-label{min-height:54px!important;padding:14px 15px!important;border-radius:14px!important;font-size:16px!important}
  .survey-modern .answer-slot>input,.survey-modern .answer-slot>textarea,.survey-modern .answer-slot>select{min-height:52px!important;font-size:16px!important}
  .experience-nav{position:sticky!important;bottom:0!important;width:calc(100% + 24px)!important;margin:14px -12px -28px!important;padding:10px 12px calc(10px + env(safe-area-inset-bottom))!important;background:rgba(248,250,248,.94)!important;border-top:1px solid rgba(215,224,217,.9)!important;backdrop-filter:blur(12px)!important;z-index:100!important}
  .experience-nav .btn{min-height:48px!important;min-width:94px!important;padding:10px 15px!important}

  /* Map questions become a map workspace rather than a bottom-sheet form. */
  .map-page-active .respondent-topbar{height:56px!important}
  .map-page-active .experience-progress{top:56px!important}
  .map-page-active .experience-stage{inset:58px 0 0!important}
  .map-page-active .survey-page{padding:0!important}
  .survey-modern .map-page-card{touch-action:auto!important}
  .map-page-canvas,.map-page-canvas .map-box{inset:0!important;height:100%!important;width:100%!important}

  .map-floating-panel{
    top:8px!important;
    right:8px!important;
    bottom:auto!important;
    left:8px!important;
    width:auto!important;
    max-height:none!important;
    overflow:visible!important;
    padding:11px 12px!important;
    border-radius:16px!important;
    background:rgba(255,255,255,.94)!important;
    box-shadow:0 8px 24px rgba(9,30,18,.16)!important;
    backdrop-filter:blur(16px)!important;
  }
  .map-panel-handle,.map-floating-panel .step-kicker-modern,.map-floating-panel .qdesc{display:none!important}
  .map-floating-panel h3{
    font-size:18px!important;
    line-height:1.2!important;
    margin:0 0 5px!important;
    display:-webkit-box!important;
    -webkit-line-clamp:2!important;
    -webkit-box-orient:vertical!important;
    overflow:hidden!important;
  }
  .map-point-limit{
    margin:0!important;
    padding:0!important;
    background:transparent!important;
    color:#526158!important;
    font-size:12.5px!important;
    line-height:1.35!important;
  }
  .map-count{
    margin-top:7px!important;
    padding:5px 8px!important;
    font-size:11px!important;
  }
  .map-floating-panel .error-text{margin-top:6px!important;font-size:12px!important}

  /* Hide secondary controls until the tools button is opened. */
  .map-floating-panel:not(.mobile-tools-open) .map-search-row,
  .map-floating-panel:not(.mobile-tools-open) .map-city-results,
  .map-floating-panel:not(.mobile-tools-open) .map-actions-row,
  .map-floating-panel:not(.mobile-tools-open) .map-location-status{display:none!important}
  .map-floating-panel.mobile-tools-open{
    max-height:min(56svh,430px)!important;
    overflow:auto!important;
    padding-bottom:14px!important;
  }
  .map-floating-panel.mobile-tools-open .map-search-row{display:grid!important;margin-top:10px!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important}
  .map-floating-panel.mobile-tools-open .map-city-results{display:grid!important}
  .map-floating-panel.mobile-tools-open .map-actions-row{display:flex!important;margin-top:8px!important;gap:6px!important}
  .map-floating-panel.mobile-tools-open .map-location-status{display:block!important;margin-top:8px!important;font-size:12px!important}
  .map-search-row input{min-height:44px!important;padding:9px 10px!important;font-size:16px!important}
  .map-search-button,.map-action{min-height:44px!important;padding:8px 11px!important;font-size:12px!important;touch-action:manipulation!important}

  .map-mobile-tools-toggle{
    display:grid!important;
    place-items:center!important;
    position:fixed!important;
    left:12px!important;
    bottom:calc(12px + env(safe-area-inset-bottom))!important;
    z-index:1250!important;
    width:50px!important;
    height:50px!important;
    border-radius:50%!important;
    border:1px solid rgba(255,255,255,.92)!important;
    background:rgba(255,255,255,.96)!important;
    color:#18251d!important;
    box-shadow:0 10px 26px rgba(9,30,18,.2)!important;
    font-size:22px!important;
    font-weight:700!important;
    line-height:1!important;
    touch-action:manipulation!important;
  }
  .map-floating-panel.mobile-tools-open .map-mobile-tools-toggle{background:var(--accent)!important;color:#fff!important}

  .map-page-active .experience-nav{
    position:fixed!important;
    right:12px!important;
    bottom:calc(12px + env(safe-area-inset-bottom))!important;
    top:auto!important;
    width:auto!important;
    margin:0!important;
    padding:4px!important;
    border-radius:999px!important;
    background:rgba(255,255,255,.96)!important;
    z-index:1240!important;
  }
  .map-page-active .experience-nav .btn{min-height:46px!important;min-width:auto!important;padding:9px 13px!important;font-size:13px!important}

  /* Keep Leaflet's own controls clear of the compact instruction card. */
  .map-page-active .leaflet-top.leaflet-left{top:112px!important;left:4px!important}
  .map-page-active .leaflet-control-zoom a{width:40px!important;height:40px!important;line-height:40px!important;font-size:22px!important}
  .map-page-active .leaflet-control-attribution{max-width:58vw!important;white-space:normal!important;line-height:1.15!important}
  .map-page-active .leaflet-container{direction:ltr!important;touch-action:pan-x pan-y!important}

  [dir="rtl"] .map-floating-panel{text-align:right!important}
  [dir="rtl"] .map-mobile-tools-toggle{left:auto!important;right:12px!important}
  [dir="rtl"] .map-page-active .experience-nav{right:auto!important;left:12px!important}
}

@media (max-width: 380px){
  .respondent-brand-title{display:none!important}
  .respondent-language{max-width:108px!important}
  .map-floating-panel h3{font-size:17px!important}
  .map-point-limit{font-size:12px!important}
}
