/* Map-first controls: desktop keeps its panels; phones open one panel on demand. */
body.iti-commentary-off #chat,
body.iti-commentary-off .nt-comment,
body.iti-commentary-off #caption { display:none!important; }
.nt-collapse, #tour-options-toggle, #tour-details { display:none; }
#tour-options, #tour-options-content { display:flex; align-items:center; gap:.7vw; }
body.tour.iti-commentary-off #ttl { max-width:88vw; }
body.tour.iti-commentary-off .maplibregl-ctrl-bottom-right { right:12px; }
.map-options button[aria-pressed=true] { background:var(--mc-teal,#315f59);color:white;border-color:var(--mc-teal,#315f59); }

@media(max-width:759px) {
  body.atlas { --mobile-bar:60px; }
  body.atlas .navbar { padding:0 8px; }
  body.atlas .navbar-brand { font-size:16px;padding-right:10px; }
  body.atlas .navbar-nav a { padding:0 10px;font-size:13px; }
  body.atlas .panel { top:auto;bottom:calc(72px + env(safe-area-inset-bottom));left:8px;right:8px;width:auto;max-height:62dvh;border:1px solid #dbe3dc;border-radius:12px;box-shadow:0 4px 24px #17332e20; }
  body.atlas .panel header { min-height:48px;padding:3px 6px 3px 14px;border-radius:12px 12px 0 0; }
  body.atlas .panel h1 { font:600 15px/1.3 system-ui,sans-serif; }
  body.atlas .collapse { width:44px;height:44px;min-width:44px; }
  body.atlas .body { overscroll-behavior:contain; }
  body.atlas .chips button { min-height:44px;padding:8px 10px;font-size:13px; }
  body.atlas .tools,body.atlas.nt-active .tools { top:auto;bottom:calc(8px + env(safe-area-inset-bottom));left:8px;right:8px;display:flex;gap:6px;box-shadow:none; }
  body.atlas .tools button { flex:1;min-width:0;min-height:48px;margin:0;padding:7px 8px;border-radius:8px;font:600 12px/1.2 system-ui,sans-serif;white-space:normal;box-shadow:0 2px 8px #17332e15; }
  body.atlas #atlas-language,body.atlas.nt-active #atlas-language { top:calc(var(--nav-h) + 8px);right:8px;min-height:44px;min-width:44px;padding:6px 10px; }
  body.atlas .maplibregl-ctrl-bottom-right,body.atlas.nt-active .maplibregl-ctrl-bottom-right { bottom:calc(136px + env(safe-area-inset-bottom));right:4px; }
  body.atlas .card { bottom:calc(132px + env(safe-area-inset-bottom));max-height:55dvh;z-index:7; }
  body.atlas .note { max-width:calc(100vw - 96px);font-size:12px; }

  .nt-sidebar { top:auto;bottom:calc(72px + env(safe-area-inset-bottom));left:8px;right:8px;max-height:55dvh; }
  .nt-head { min-height:58px;padding:7px 10px 7px 14px;align-items:center; }
  .nt-head h1 { font-size:18px;margin:3px 0; }
  .nt-head .nt-eyebrow { font-size:8px;letter-spacing:.8px; }
  .nt-head button { min-height:44px;min-width:44px; }
  .nt-head .nt-collapse { display:block;border:1px solid var(--nt-rule);font:600 12px/1.2 system-ui,sans-serif;padding:7px 9px; }
  .nt-compact .nt-sidebar .nt-scroll { display:none; }
  .nt-analysis-open .nt-sidebar { display:none; }
  .nt-sidebar .nt-scroll { overscroll-behavior:contain; }
  .nt-workspace .nt-stepnav button,.nt-workspace .nt-stepnav select,.nt-workspace .nt-stepbar button { min-height:44px; }
  .nt-drawer { top:auto;bottom:calc(72px + env(safe-area-inset-bottom));left:8px;right:8px;width:auto;max-height:72dvh; }
  .nt-drawer>header { min-height:58px;padding:10px 14px;align-items:center; }
  .nt-drawer>header button { min-height:44px;min-width:44px; }
  .nt-drawer-content { overscroll-behavior:contain; }
  .nt-tabs button { min-height:44px; }

  body.tour { font-size:14px; }
  body.tour .tour-brand { top:14px;left:14px;width:150px; }
  body.tour #ttl,body.tour.iti-commentary-off #ttl { left:14px;right:14px;bottom:calc(160px + env(safe-area-inset-bottom));max-width:none; }
  body.tour #ttl b { font-size:30px;line-height:1.05; }
  body.tour #ttl span { font-size:14px; }
  body.tour:not(.iti-commentary-off) #ttl { bottom:calc(min(40dvh,360px) + 94px); }
  body.tour #bar { height:calc(64px + env(safe-area-inset-bottom));min-height:64px;padding:8px 10px calc(8px + env(safe-area-inset-bottom));gap:6px;flex-wrap:nowrap;box-sizing:border-box; }
  body.tour #bar button,body.tour #bar .back { height:44px;min-height:44px;min-width:44px;padding:0 9px;font-size:13px;box-sizing:border-box; }
  body.tour #bar .back { flex:none; }
  body.tour #dots,body.tour #nextUp { display:none!important; }
  body.tour #tour-options { margin-left:auto; }
  body.tour #tour-options-toggle { display:inline-flex; }
  body.tour #tour-options-content { display:none;position:fixed;right:10px;bottom:calc(72px + env(safe-area-inset-bottom));width:min(330px,calc(100vw - 20px));max-height:65dvh;overflow:auto;background:#315f59;border:1px solid #7f9774;border-radius:12px;padding:12px;box-sizing:border-box;box-shadow:0 8px 32px #17332e44; }
  body.tour.tour-options-open #tour-options-content { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
  body.tour #tour-details { display:inline-flex; }
  body.tour #tour-options-content .spd { grid-column:1/-1;display:flex;gap:8px;padding:10px 0; }
  body.tour #tour-options-content .spd input { flex:1;min-width:80px;width:auto; }
  body.tour #tour-insights { display:none;position:fixed;top:70px;left:12px;right:12px;max-height:26dvh;overflow:auto;z-index:6;background:rgba(255,255,255,.97);border:1px solid #dbe3dc;border-radius:10px;box-shadow:0 4px 20px #17332e20; }
  body.tour.tour-details-open #tour-insights { display:block; }
  body.tour #metrics { position:static;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px; }
  body.tour #metrics[hidden],body.tour #source[hidden] { display:none; }
  body.tour #metrics div { min-width:0;padding:8px; }
  body.tour #metrics span { max-width:none;font-size:11px; }
  body.tour #metrics b { font-size:24px; }
  body.tour #source { position:static;max-width:none;padding:8px 12px;font-size:11px; }
  body.tour #chat { top:auto;bottom:calc(76px + env(safe-area-inset-bottom));left:12px;right:12px;width:auto;height:40dvh;max-height:360px;border-radius:10px;box-shadow:0 4px 24px #17332e25; }
  body.tour #chat header { padding:10px 14px; }
  body.tour #log { padding:10px 14px; }
  body.tour #chat footer { padding:8px 14px;font-size:10px; }
  body.tour .maplibregl-ctrl-bottom-right { bottom:calc(76px + env(safe-area-inset-bottom));right:4px; }
}
