/* MapToNap · Site Analysis (2D) on phones.
   One scrolling column: search → map → analysis list, with Generate pinned to the bottom.
   Scoped to the 2D app (html.mtn-2d, set by mtn-mobile.js) and never to the 3D view. */
@media (max-width:760px){
  html.mtn-2d body.mtn-site:not(.threed-studio){--m-top:0px;--m-pad:16px;--m-safe:env(safe-area-inset-bottom,0px);padding:0!important}
  html.mtn-2d body.mtn-site.mtn-standalone:not(.threed-studio){--m-top:56px}

  /* shell: compact top bar, no side rail */
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-shell-rail{display:none!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-shell-top{height:56px!important;gap:10px!important;padding:0 14px!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-shell-top>button.mtn-btn.ghost,
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-shell-top>.mtn-meta{display:none!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-shell-top>span:not(.mtn-meta){flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700;font-size:15px;writing-mode:horizontal-tb}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-shell-top .mtn-brand-link{font-size:16px}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-shell-top .mtn-brand-link img{width:28px;height:28px}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-shell-top>a.mtn-btn{margin-left:auto;flex:none;height:38px;padding:0 14px;display:inline-flex;align-items:center;border-radius:12px}

  /* the column */
  html.mtn-2d body.mtn-site:not(.threed-studio) .app{position:fixed!important;top:var(--m-top)!important;left:0;right:0;bottom:0;height:auto!important;margin:0!important;
    display:flex!important;flex-direction:column!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;
    padding-bottom:calc(92px + var(--m-safe))!important;background:var(--mtn-bg,#f5f5f3)}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .app{padding-bottom:calc(28px + var(--m-safe))!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .app>.main{order:1;flex:none!important;display:block!important;min-height:0!important;height:auto!important;overflow:visible!important;padding:0!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .app>.sb{order:2;position:static!important;display:flex!important;flex-direction:column;flex:none!important;width:auto!important;height:auto!important;max-height:none!important;
    overflow:visible!important;border:0!important;box-shadow:none!important;border-radius:0!important;background:transparent!important;inset:auto!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .app>.sb{display:none!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .sbar,
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-drawer-toggle,
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-mobile-generate,
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-mobile-header{display:none!important}

  /* 1 · where */
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-location{padding:18px var(--m-pad) 12px!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-location-header{margin:0 0 12px!important;padding:0!important;align-items:flex-start}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-location-header h1{font-size:24px!important;line-height:1.15;letter-spacing:-.01em;font-weight:800}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-location-header .mtn-step-label{font-size:12px!important;margin-top:4px;white-space:normal}
  html.mtn-2d body.mtn-site:not(.threed-studio) #mtnPanel{display:none!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-location>.sec{padding:0!important;display:flex;flex-direction:column;gap:12px}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-location-search{display:flex!important;gap:8px;flex-wrap:nowrap!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-location-search .loc-in{flex:1 1 auto!important;min-width:0;height:48px!important;font-size:16px!important;border-radius:14px!important;padding:0 14px!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-location-search .srch-btn{flex:none;height:48px!important;min-width:68px;border-radius:14px!important;font-size:15px!important;font-weight:700}
  html.mtn-2d body.mtn-site:not(.threed-studio) #mtnImpBox{margin:0!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #mtnImpBox .imp-btn{min-height:48px;border-radius:14px!important;padding:8px 12px!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-area-shape{display:flex!important;align-items:center;justify-content:space-between;gap:12px;margin:0!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-area-shape select{height:42px!important;min-width:140px;font-size:16px!important;border-radius:12px!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-location .rr{display:flex!important;align-items:center;gap:12px;margin:0!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-location .rr input[type=range]{flex:1 1 auto;min-width:0;width:auto!important;height:28px}
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-location .rr .rv{flex:none;min-width:64px;text-align:right;font-size:13px!important}

  /* 2 · the map */
  html.mtn-2d body.mtn-site:not(.threed-studio):not(.mtn-results) #mwrap.mw{display:block!important;height:min(58vh,480px)!important;min-height:300px!important;max-height:none!important;
    margin:4px var(--m-pad) 0!important;border:1px solid var(--mtn-line,#e4e1db)!important;border-radius:18px!important;overflow:hidden!important;position:relative!important;flex:none!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #mwrap #map{border-radius:inherit}
  html.mtn-2d body.mtn-site:not(.threed-studio) #mwrap .leaflet-control-zoom a{width:36px;height:36px;line-height:36px;font-size:20px}
  html.mtn-2d body.mtn-site:not(.threed-studio) #mwrap #hint{display:none!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #mwrap .hud{top:12px!important;left:58px!important;right:auto!important;max-width:calc(100% - 70px);align-items:flex-start}
  html.mtn-2d body.mtn-site:not(.threed-studio) #mwrap .hud>.hp:empty{display:none!important}

  /* 3 · what */
  html.mtn-2d body.mtn-site:not(.threed-studio) .sb-top{display:flex!important;align-items:center;gap:8px;flex-wrap:wrap;padding:20px var(--m-pad) 4px!important;border:0!important;background:transparent!important;height:auto!important;min-height:0}
  html.mtn-2d body.mtn-site:not(.threed-studio) .sb-top>.sb-mark,
  html.mtn-2d body.mtn-site:not(.threed-studio) .sb-top>div:not(.sb-sub){display:none!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .sb-top #proBtn{height:38px!important;padding:0 16px!important;border-radius:12px!important;font-size:12px!important;animation:none!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .sb-top .mtn-utility:not([style*="display:none"]){width:38px!important;height:38px!important;border-radius:12px!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .sb-mid{flex:none!important;overflow:visible!important;padding:0!important;min-height:0!important;max-height:none!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .sb-mid>.sec{padding:14px var(--m-pad) 6px!important;border:0!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #secTypes{display:grid!important;grid-template-columns:1fr auto;align-items:center;column-gap:10px;row-gap:6px}
  html.mtn-2d body.mtn-site:not(.threed-studio) #secTypes>.lbl{grid-column:1;font-size:18px!important;font-weight:800!important;letter-spacing:0!important;text-transform:none!important;color:var(--mtn-ink,#181818)!important;margin:0!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #secTypes>#mtnSelected{grid-column:1;font-size:12px!important;margin:0!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #secTypes>.sr{grid-column:2;grid-row:1 / span 2;display:flex!important;gap:6px;margin:0!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #secTypes>.sr .sb2{height:36px;padding:0 12px;border-radius:12px;font-size:12px}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist{grid-column:1 / -1;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai{position:relative;display:flex!important;align-items:center;gap:8px;margin:0!important;padding:8px 8px 8px 10px!important;min-height:62px;
    background:#fff;border:1px solid var(--mtn-line,#e6e3dd)!important;border-radius:14px!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai.on{border-color:#1a1917!important;box-shadow:inset 0 0 0 1px #1a1917}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai .ad{flex:none}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai .mtn-analysis-preview{width:40px!important;height:40px!important;flex:none;border-radius:8px}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai .an{font-size:13px!important;font-weight:700!important;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai .as{display:none!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai{display:grid!important;grid-template-columns:auto 40px minmax(0,1fr);grid-template-rows:auto auto;align-content:center;column-gap:8px;row-gap:3px}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai>.ad,
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai>.mtn-analysis-preview{grid-row:1 / span 2;align-self:center}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai>div[style]{grid-column:3;grid-row:1;align-self:end}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai>.abg{grid-column:3;grid-row:2;justify-self:start;align-self:start;font-size:9px!important;padding:1px 5px!important;line-height:1.35;margin:0!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai:not(.locked)>.abg{display:none!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #alist .ai:not(.locked)>div[style]{grid-row:1 / span 2;align-self:center}
  html.mtn-2d body.mtn-site:not(.threed-studio) .sb-mid>details.mtn-options,
  html.mtn-2d body.mtn-site:not(.threed-studio) .sb-bot>details.mtn-options{margin:10px var(--m-pad) 0!important;background:#fff;border:1px solid var(--mtn-line,#e6e3dd);border-radius:14px;padding:4px 14px!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) details.mtn-options>summary{min-height:44px;display:flex;align-items:center;font-size:14px!important;font-weight:700}
  html.mtn-2d body.mtn-site:not(.threed-studio) .sb-bot{position:static!important;padding:0 0 8px!important;border:0!important;background:transparent!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) .sb-bot .exp-row .ebtn{min-height:42px;display:flex;align-items:center;border-radius:12px}

  /* Generate, always within reach */
  html.mtn-2d body.mtn-site:not(.threed-studio):not(.mtn-results) #genMain{position:fixed!important;left:var(--m-pad);right:var(--m-pad);bottom:calc(14px + var(--m-safe));z-index:1300;width:auto!important;
    height:56px;margin:0!important;border-radius:16px!important;font:800 15px/1 Inter,system-ui,sans-serif!important;letter-spacing:.01em!important;box-shadow:0 14px 34px rgba(20,18,16,.24)}
  html.mtn-2d body.mtn-site:not(.threed-studio) #mtn-trial-entry{bottom:calc(82px + var(--m-safe))!important;left:50%!important;right:auto!important;transform:translateX(-50%);z-index:1290;height:40px!important;min-height:0!important;padding:0 16px!important;border-radius:999px!important;background:#fff!important;color:#c8372d!important;border:1px solid #f0c9c4!important;box-shadow:0 8px 22px rgba(20,18,16,.14)!important;font-size:13px!important}
  html.mtn-2d body.mtn-site:not(.threed-studio) #legEditWrap{display:none!important}

  /* 4 · results */
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .mtn-result-bar{display:flex!important;flex-direction:column;align-items:stretch!important;gap:12px;margin:0!important;padding:18px var(--m-pad) 6px!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .mtn-result-bar h2{font-size:24px!important;font-weight:800}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .mtn-result-actions{display:flex!important;flex-wrap:nowrap!important;gap:8px;overflow-x:auto;scrollbar-width:none;margin:0 calc(-1 * var(--m-pad))!important;padding:0 var(--m-pad) 2px!important;justify-content:flex-start!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .mtn-result-actions::-webkit-scrollbar{display:none}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .mtn-result-actions>*{flex:none!important;height:44px!important;border-radius:14px!important;white-space:nowrap;font-size:14px!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) #mtnDownloadPNG{order:-3}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) #mtnCompose{order:-2}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) #mtnDownloadSVG{order:-1}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) #mtnGrid,
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) #mtnList{display:none!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .mtn-context-control{width:100%!important;display:flex!important;align-items:center;gap:10px}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .mtn-context-control input{flex:1 1 auto;width:auto!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .res{display:block!important;flex:none!important;overflow:visible!important;height:auto!important;padding:8px var(--m-pad) 0!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) #statBar{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:0!important;border-radius:16px!important;overflow:hidden;margin-bottom:14px!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) #statBar>div{min-width:0!important;padding:10px 12px!important;border:0!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) #statBar>div>div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) #statBar>div>div:first-child{font-size:9px!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) #statBar>div>div:last-child{font-size:17px!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .res .grid,
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .res .grid.mtn-list{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:14px!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .res .grid .card{display:flex!important;flex-direction:column!important;border-radius:18px!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .res .grid .card .cbody{aspect-ratio:1/1!important;border-radius:18px 18px 0 0!important;grid-row:auto!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .res .grid .card .ch{min-height:54px;padding:10px 40px 10px 14px!important}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .res .grid .card .ct{font-size:15px!important;font-weight:700}
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .res .grid .card .toStrat,
  html.mtn-2d body.mtn-site.mtn-results:not(.threed-studio) .res .grid .card .mtn-view-3d{min-height:34px!important;font-size:11px!important;padding:0 8px!important;border-radius:10px!important}

  /* one-click board dialog: a sheet, preview on top */
  html.mtn-2d .mtn-output{width:100vw!important;max-width:100vw!important;height:calc(100dvh - 18px)!important;max-height:none!important;margin:18px 0 0!important;border:0!important;border-radius:20px 20px 0 0!important}
  html.mtn-2d .mtn-output form{padding:12px 16px!important}
  html.mtn-2d .mtn-output-body{display:flex!important;flex-direction:column;height:calc(100% - 66px)!important;overflow-y:auto;-webkit-overflow-scrolling:touch}
  html.mtn-2d .mtn-output .out-preview{order:-1;flex:none;height:44dvh;padding:12px!important;overflow:auto}
  html.mtn-2d .mtn-output aside{flex:none;border-right:0!important;border-top:1px solid #e6e3dd;padding:16px 16px calc(20px + env(safe-area-inset-bottom,0px))!important;overflow:visible!important}
  html.mtn-2d .mtn-output select{height:46px!important;font-size:16px!important;border-radius:12px!important}
  html.mtn-2d .mtn-output .mtn-btn{min-height:46px;border-radius:14px!important}

  /* loader sits under the top bar */
  html.mtn-2d body.mtn-site.mtn-standalone:not(.threed-studio) #loader{top:56px!important}
}
@media (max-width:400px){
  html.mtn-2d body.mtn-site:not(.threed-studio) .mtn-shell-top>span:not(.mtn-meta){display:none!important}
}
