/* Mhare Maps v0.5 — familiar map-app layout (floating search, chips, bottom sheet, round controls).
   Loaded after styles.css; everything here overrides the older layout. */
:root{
  --gm-surface:#ffffff;
  --gm-text:#202124;
  --gm-subtle:#5f6368;
  --gm-chip-line:#dadce0;
  --gm-shadow:0 1px 2px rgba(60,64,67,.3),0 2px 6px 2px rgba(60,64,67,.15);
  --gm-shadow-soft:0 1px 3px rgba(60,64,67,.28);
  --gm-brand:#102c43;          /* Mhare navy */
  --gm-gold:#d6a146;           /* Mhare gold */
  --gm-active:#e3ebf2;         /* navy tint for active states */
  --gm-dot:#1a73e8;            /* "you are here" blue */
  --gm-nav-h:64px;
  --gm-font:Roboto,"Segoe UI",system-ui,-apple-system,Arial,sans-serif;
}
body{font-family:var(--gm-font);color:var(--gm-text);background:#e8eaed}

/* Old map-top pieces are gone; hide any leftovers */
.map-hint,.map-top,.devnotice{display:none!important}

/* ---------- Floating search bar ---------- */
.gtop{position:absolute;z-index:30;top:calc(env(safe-area-inset-top,0px) + 10px);left:max(12px,env(safe-area-inset-left,0px));right:max(12px,env(safe-area-inset-right,0px));pointer-events:none}
.gtop>*{pointer-events:auto}
.gsearch{display:flex;align-items:center;height:48px;background:var(--gm-surface);border-radius:24px;box-shadow:var(--gm-shadow);padding:0 4px 0 6px;gap:2px}
.gs-brand{flex:none;width:40px;height:40px;border:0;background:none;border-radius:50%;display:grid;place-items:center;padding:0;cursor:pointer}
.gs-brand img{width:30px;height:30px;border-radius:8px;display:block}
.gs-form{flex:1;min-width:0;display:flex;align-items:center;margin:0;border:0;background:none;box-shadow:none;padding:0;height:auto}
.gs-form input{flex:1;min-width:0;border:0;outline:0;background:none;font:400 16px/1.2 var(--gm-font);color:var(--gm-text);padding:0 6px;height:44px}
.gs-form input::placeholder{color:var(--gm-subtle)}
.gs-form input::-webkit-search-cancel-button{display:none}
.gs-icon{flex:none;width:40px;height:40px;border:0;background:none;border-radius:50%;display:grid;place-items:center;color:var(--gm-subtle);cursor:pointer;padding:0}
.gs-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.gs-icon:hover,.gs-brand:hover{background:#f1f3f4}
.gs-icon:focus-visible,.gs-brand:focus-visible,.chip:focus-visible,.fab:focus-visible,.mobile-nav button:focus-visible{outline:2px solid var(--gm-dot);outline-offset:2px}

/* ---------- Category chips ---------- */
.chips{display:flex!important;gap:8px;margin-top:10px;overflow-x:auto;scrollbar-width:none;padding:2px 2px 6px;-webkit-overflow-scrolling:touch;grid-template-columns:none}
.chips::-webkit-scrollbar{display:none}
.chip.category{flex:none;display:inline-flex;flex-direction:row;align-items:center;gap:6px;height:32px;min-height:0;padding:0 14px 0 10px;border-radius:16px;border:0;background:var(--gm-surface);box-shadow:var(--gm-shadow-soft);color:#3c4043;font:500 14px/1 var(--gm-font);white-space:nowrap;cursor:pointer;transform:none}
.chip.category .emoji{font-size:15px;line-height:1}
.chip.category span:last-child{font-size:14px;font-weight:500}
.chip.category:hover{background:#f8f9fa;transform:none}
.chip.category.active{background:var(--gm-brand);color:#fff;border:0}

/* ---------- Round map buttons ---------- */
.map-controls{position:absolute;z-index:12;right:max(12px,env(safe-area-inset-right,0px));top:calc(env(safe-area-inset-top,0px) + 112px);display:flex;flex-direction:column;gap:10px}
.map-controls .floating,.zoom-group .floating{width:40px;height:40px;border-radius:50%;border:0;background:var(--gm-surface);box-shadow:var(--gm-shadow);color:var(--gm-subtle);font-size:22px}
.map-controls .floating svg{width:20px;height:20px}
.map-controls .floating.compass .needle{width:30px;height:30px}
.floating.compass.active{background:var(--gm-brand)}
.zoom-group{display:none}
.fabs{position:absolute;z-index:12;right:max(14px,env(safe-area-inset-right,0px));bottom:calc(var(--gm-nav-h) + env(safe-area-inset-bottom,0px) + 18px);display:flex;flex-direction:column-reverse;gap:14px;align-items:center}
.fab{width:56px;height:56px;border-radius:16px;border:0;display:grid;place-items:center;cursor:pointer;box-shadow:var(--gm-shadow);padding:0}
.fab svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.fab-locate{background:var(--gm-surface);color:var(--gm-dot);border-radius:50%;width:52px;height:52px}
.fab-go{background:var(--gm-brand);color:#fff}
.fab-go .fill{fill:var(--gm-gold);stroke:none}
.fab-go svg path:last-child{stroke:var(--gm-brand);stroke-width:2.2}

/* ---------- "You are here" dot ---------- */
.me-dot{position:relative;width:22px;height:22px}
.me-core{position:absolute;inset:0;border-radius:50%;background:var(--gm-dot);border:3px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,.35)}
.me-halo{position:absolute;left:50%;top:50%;width:64px;height:64px;margin:-32px 0 0 -32px;border-radius:50%;background:rgba(26,115,232,.18);animation:mePulse 2.4s ease-out infinite}
@keyframes mePulse{0%{transform:scale(.35);opacity:.9}100%{transform:scale(1);opacity:0}}
@media (prefers-reduced-motion:reduce){.me-halo{animation:none;opacity:.5;transform:scale(.6)}}

/* ---------- Sheet / panel contents ---------- */
.sheet-handle{display:none}
.sidebar{background:var(--gm-surface)}
.sheet-title{font:500 20px/1.3 var(--gm-font);margin:4px 0 4px;color:var(--gm-text)}
.panel h2{font:500 22px/1.25 var(--gm-font);letter-spacing:0;margin:6px 0 4px}
.panel .eyebrow{font-size:11px}
.panel .muted{font-size:14px}
.brandbar{min-height:0}
.toast{background:#323232;border-radius:8px;font:400 14px/1.4 var(--gm-font);z-index:40}
.maplibregl-ctrl-scale{border-color:#5f6368;color:#3c4043;background:rgba(255,255,255,.8)}

/* ---------- Phones ---------- */
@media (max-width:760px){
  .app{display:block;position:relative;height:100dvh;overflow:hidden}
  /* absolute (not fixed) so the map layer doesn't trap the bottom bar under the dimming layer */
  .maparea{position:absolute;inset:0;width:100%;height:100%}
  .mobile-menu,.mobile-close{display:none!important}
  .tabbar,.searcharea{display:none}
  .sidefooter{display:none}

  /* Bottom sheet */
  .sidebar{position:fixed;left:0;right:0;top:auto;bottom:calc(var(--gm-nav-h) + env(safe-area-inset-bottom,0px));width:100%;min-width:0;
    height:min(72dvh,640px);border-radius:16px 16px 0 0;box-shadow:0 -2px 10px rgba(0,0,0,.18);z-index:25;
    transform:translateY(calc(100% + var(--gm-nav-h) + 40px));transition:transform .28s cubic-bezier(.2,.8,.2,1);display:flex;flex-direction:column}
  .sidebar.open{transform:translateY(0)}
  .sheet-handle{display:block;flex:none;width:100%;height:22px;border:0;background:none;cursor:pointer;position:relative;padding:0}
  .sheet-handle::before{content:"";position:absolute;left:50%;top:8px;width:36px;height:4px;margin-left:-18px;border-radius:2px;background:#dadce0}
  .brandbar{padding:2px 16px 10px;gap:10px;min-height:0}
  .brand-icon{width:40px;height:40px}
  .brandname{font-size:18px}
  .panel{padding-left:16px;padding-right:16px}
  .sidebar-backdrop{background:rgba(0,0,0,.18);z-index:24}

  /* Bottom navigation */
  .mobile-nav{display:flex!important;position:fixed;left:0;right:0;bottom:0;z-index:28;height:calc(var(--gm-nav-h) + env(safe-area-inset-bottom,0px));padding:0 max(8px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(8px,env(safe-area-inset-left,0px));
    background:var(--gm-surface);box-shadow:0 -1px 3px rgba(60,64,67,.2);border:0;align-items:center;justify-content:space-around}
  .mobile-nav button{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;background:none;border:0;color:var(--gm-subtle);font:500 12px/1 var(--gm-font);padding:6px 0;cursor:pointer}
  .mobile-nav button i{display:grid;place-items:center;width:56px;height:30px;border-radius:15px;transition:background .2s}
  .mobile-nav button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  .mobile-nav button span{font-size:12px;font-weight:500}
  .mobile-nav button.active{color:var(--gm-brand)}
  .mobile-nav button.active i{background:var(--gm-active)}

  .toast{bottom:calc(var(--gm-nav-h) + env(safe-area-inset-bottom,0px) + 90px);width:auto;max-width:calc(100% - 32px)}
  .maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right{bottom:calc(var(--gm-nav-h) + env(safe-area-inset-bottom,0px))}
  .nav-overlay{z-index:35}
}

/* ---------- Tablets and computers ---------- */
@media (min-width:761px){
  .sidebar{width:408px;min-width:408px;padding-top:68px;box-shadow:0 0 16px rgba(0,0,0,.18);z-index:20;position:relative;transform:none}
  .sheet-handle,.mobile-nav,.fab-go{display:none!important}
  .gtop{position:fixed;top:12px;left:12px;right:12px;display:flex;align-items:center;gap:12px}
  .gsearch{width:384px;flex:none}
  .chips{margin-top:0;flex:1;min-width:0}
  .map-controls{top:72px;right:16px}
  .zoom-group{display:flex;flex-direction:column;position:absolute;z-index:12;right:16px;bottom:96px;background:var(--gm-surface);border-radius:20px;box-shadow:var(--gm-shadow);overflow:hidden}
  .zoom-group .floating{box-shadow:none;border-radius:0;width:40px;height:40px}
  .zoom-group .floating+.floating{border-top:1px solid #e8eaed}
  .fabs{right:16px;bottom:28px}
  .fab-locate{width:40px;height:40px}
  .fab-locate svg{width:20px;height:20px}
  .toast{bottom:32px}
}

/* ---------- Clean air zones (v0.6) ---------- */
:root{--z-charge:#d93025;--z-banned:#a50e0e;--z-check:#e37400;--z-free:#188038}
.chip.chip-zones{background:#e6f4ea;color:#0d652d}
.chip.chip-zones.active{background:#188038;color:#fff}
.zone-alert{border-radius:12px;padding:12px 14px;margin:0 0 14px;font:400 14px/1.45 var(--gm-font);display:flex;flex-direction:column;gap:8px;border:1px solid}
.zone-alert>b{font-weight:500;font-size:15px}
.zone-alert small{color:var(--gm-subtle);font-size:12px}
.zone-alert.ok{background:#e6f4ea;border-color:#ceead6;color:#0d652d}
.zone-alert.check{background:#fef7e0;border-color:#feefc3;color:#7a4100}
.zone-alert.charge{background:#fce8e6;border-color:#fad2cf;color:#a50e0e}
.zone-alert.banned{background:#fce8e6;border-color:#f6aea9;color:#7f0b0b}
.zone-row{display:flex;gap:10px;align-items:flex-start;color:var(--gm-text)}
.zone-row a,.zone-foot a,.vb-note a{color:#1a5fb4}
.zone-dot{flex:none;width:12px;height:12px;border-radius:50%;margin-top:4px;background:var(--z-free)}
.lvl-charge .zone-dot{background:var(--z-charge)}.lvl-banned .zone-dot{background:var(--z-banned)}.lvl-check .zone-dot{background:var(--z-check)}
.zone-when{color:var(--gm-subtle);font-size:12px}
.zone-msg{font-size:13px;color:#3c4043}
.zone-setveh{align-self:flex-start;border:1px solid #dadce0;background:#fff;border-radius:16px;padding:6px 12px;font:500 13px/1 var(--gm-font);color:var(--gm-brand);cursor:pointer}
.zone-intro{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:14px;color:#3c4043;margin:4px 0 10px}
.zone-item{width:100%;display:flex;gap:12px;align-items:flex-start;text-align:left;background:#fff;border:0;border-bottom:1px solid #f1f3f4;padding:12px 2px;cursor:pointer;font-family:var(--gm-font)}
.zone-item:hover{background:#f8f9fa}
.zone-body{display:flex;flex-direction:column;gap:2px;min-width:0}
.zone-body b{font-weight:500;font-size:15px;color:var(--gm-text)}
.zone-body span{font-size:13px;color:var(--gm-subtle)}
.zone-body em{font-size:12px;color:#9aa0a6;font-style:normal}
.lvl-charge .zone-body span,.lvl-banned .zone-body span{color:var(--z-charge)}
.zone-foot{font-size:12px;color:var(--gm-subtle);line-height:1.5;margin:12px 0 4px}
.vehicle-box{border:1px solid #dadce0;border-radius:14px;padding:14px;margin:6px 0 18px;display:flex;flex-direction:column;gap:8px}
.vb-head{font:500 12px/1 var(--gm-font);letter-spacing:.8px;color:var(--gm-brand)}
.vb-note{font-size:12.5px;color:var(--gm-subtle);margin:0}
.veh-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}
.veh-grid .fieldstack{min-width:0}
.veh-grid select,.veh-grid input{width:100%}
@media (max-width:380px){.veh-grid{grid-template-columns:1fr}}
.vehstatus{margin:0;font-size:13px;border-radius:10px;padding:9px 11px;background:#f1f3f4;color:#3c4043}
.vehstatus.ok{background:#e6f4ea;color:#0d652d}.vehstatus.bad{background:#fce8e6;color:#a50e0e}.vehstatus.warn{background:#fef7e0;color:#7a4100}
