/* Compact map controls. Scoped to the map; account/admin forms keep their size. */
.map-shell{--map-glass:rgba(14,30,23,.89);--map-edge:rgba(174,202,173,.18)}
.map-shell .map-control{position:relative;min-height:36px;height:36px;padding:0 12px;gap:8px;border:1px solid var(--map-edge);border-radius:22px;background:var(--map-glass);box-shadow:0 2px 8px #0002;backdrop-filter:blur(8px);color:#f1f5ed;font-size:12px;font-weight:500;letter-spacing:0}
.map-shell .map-control::before{content:"";position:absolute;inset:-4px;border-radius:inherit}
.map-shell .map-control:hover,.map-shell .tray-item:hover{background:#263d30}
.map-shell .map-control:focus-visible,.map-shell .tray-item:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.map-shell .map-control .icon{width:18px;height:18px;stroke-width:1.7}
.map-shell .map-top{top:calc(env(safe-area-inset-top,0px) + 14px);left:14px;right:14px;gap:12px;align-items:flex-start}
.map-group{display:grid;gap:5px;min-width:0;max-width:48%}
.map-shell .group-chip{max-width:100%;padding:0 11px;gap:8px}
.group-chip #active-team{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:120px}
.group-chip .icon:last-child{width:14px;height:14px}
.map-top-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.map-shell .share-chip{padding:0 12px;gap:7px;white-space:nowrap}
.share-chip .dot{width:7px;height:7px;box-shadow:none}
.map-shell .share-chip.live{color:#e9f8e8;border-color:#78c27955}
.map-shell .map-icon{width:36px;min-width:36px;padding:0;border-radius:50%}
.map-shell .connection-status{display:flex;align-items:center;gap:5px;font-size:9px;line-height:12px;font-weight:500;letter-spacing:0;color:#eff4e8;padding-left:9px;text-shadow:0 1px 3px #000}
.connection-dot{width:5px;height:5px;flex-shrink:0;border-radius:50%;background:#e6bc69}
.connection-status.realtime .connection-dot{background:#71f076}
.connection-status.disconnected .connection-dot{background:#ed927d}
.map-shell .map-left{top:calc(env(safe-area-inset-top,0px) + 82px);left:18px}
.map-shell .compass{width:20px;min-height:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;font-size:9px;line-height:14px;color:#eaf4e5;text-shadow:0 1px 3px #0008}
.map-shell .compass span{font-size:20px;line-height:22px;color:#edf7e7}
.map-shell .map-right{right:14px;top:calc(env(safe-area-inset-top,0px) + 78px);gap:12px;max-height:calc(100% - 270px);overflow:visible}
.map-shell .map-bottom{left:50%;right:auto;bottom:calc(env(safe-area-inset-bottom,0px) + 46px);width:calc(100% - 28px);max-width:480px;transform:translateX(-50%);display:block}
.map-tray{height:44px;display:grid;grid-template-columns:1.25fr 1fr 1.15fr .7fr;align-items:center;border:1px solid var(--map-edge);border-radius:25px;background:var(--map-glass);box-shadow:0 2px 8px #0002;backdrop-filter:blur(8px);padding:0 6px;pointer-events:auto}
.map-shell .tray-item{position:relative;min-height:44px;height:44px;border:0;border-radius:0;background:none;box-shadow:none;padding:0 9px;gap:7px;font-size:11px;font-weight:500;letter-spacing:0;white-space:nowrap;color:#eef3e8}
.map-shell .tray-item+.tray-item::before{content:"";position:absolute;width:1px;height:16px;left:0;top:14px;background:#8c9e8a66}
.map-shell .tray-item .icon{height:20px;width:20px}
.map-shell .tray-item.active{color:#77f083}
.map-shell .tray-item.active .icon{filter:drop-shadow(0 0 3px #61e77755)}
.map-shell .chat-item .icon{height:20px;width:20px}
.map-shell .quick-marker{position:absolute;z-index:400;right:16px;bottom:calc(env(safe-area-inset-bottom,0px) + 104px);width:44px;min-height:44px;height:44px;padding:0;border:0;border-radius:50%;color:#172015;background:var(--accent);box-shadow:0 2px 8px #0003}
.map-shell .quick-marker:hover{background:#ffd260}
.map-shell .quick-marker .icon{width:25px;height:25px;stroke-width:1.6}
.map-shell .coords{bottom:calc(env(safe-area-inset-bottom,0px) + 20px);left:50%;padding:2px 6px;background:#102015a8;border-radius:12px;border:0;box-shadow:none;font-size:9px;font-weight:400;line-height:13px;letter-spacing:0;color:#e8eee4}
.map-shell .leaflet-bottom{bottom:env(safe-area-inset-bottom,0px)}
.map-shell .leaflet-control-scale{margin-left:14px;margin-bottom:4px}
.map-shell .leaflet-control-scale-line{font-size:9px;line-height:11px;background:#12241766;border-width:0 1px 1px;text-shadow:none;box-shadow:none;padding:1px 4px}
.map-shell .leaflet-control-attribution{font-size:7px!important;line-height:12px;padding:0 4px!important;background:#10201599!important;max-width:55vw}
.map-shell .map-failure{top:calc(env(safe-area-inset-top,0px) + 66px);max-width:55%;padding:7px 10px;font-size:10px}
.person-icon{width:32px!important;height:32px!important}
.person-body{position:relative;width:32px;height:32px;--person-color:#76f087;--person-fill:#153b22c7}
.person-body.person-self{--person-color:#60c2ff;--person-fill:#143950c7}
.person-body .person-arrow{position:absolute;left:0;top:0;width:32px;height:32px;font-size:0;line-height:0;color:var(--person-color);text-shadow:none;transform-origin:16px 16px;filter:drop-shadow(0 1px 2px #07160b99)}
.person-arrow svg{display:block;width:32px;height:32px;fill:var(--person-fill);stroke:var(--person-color);stroke-width:2.5;stroke-linejoin:round}
.person-body .person-label{left:35px;top:7px;border:0;border-radius:9px;padding:2px 6px;background:#102015c9;color:#f1f5ed;font-size:9px;line-height:14px;font-weight:500;box-shadow:none;letter-spacing:.02em}
.person-body .person-dot{left:10px;top:10px;width:12px;height:12px;border:2px solid var(--person-color);background:var(--person-fill);box-shadow:0 0 0 3px #73e87916}
.person-body.stale{filter:grayscale(1);opacity:.6}
@media(min-width:1000px){
 .map-shell.has-sidebar .map-top{left:310px}
 .map-shell.has-sidebar .map-left{left:314px}
 .map-shell.has-sidebar .map-bottom{left:calc(50% + 145px);width:calc(100% - 330px);right:auto}
 .map-shell.has-sidebar .coords{left:calc(50% + 145px)}
 .map-shell.has-sidebar .leaflet-control-scale{margin-left:304px}
}
@media(max-width:350px){
 .map-shell .map-top{left:10px;right:10px;gap:8px}
 .map-top-actions{gap:8px}.map-shell .group-chip{padding:0 9px;gap:6px}
 .group-chip #active-team{max-width:80px}.map-shell .share-chip{padding:0 10px}
 .map-shell .map-bottom{width:calc(100% - 20px)}.map-shell .tray-item{font-size:10px;padding:0 5px;gap:5px}
}
@media(max-height:480px){
 .map-shell .map-right{top:calc(env(safe-area-inset-top,0px) + 66px);gap:10px}
 .map-shell .map-left{top:calc(env(safe-area-inset-top,0px) + 66px)}
 .map-shell .quick-marker{right:62px;bottom:calc(env(safe-area-inset-bottom,0px) + 104px)}
}

/* Each marker keeps its group's color, including the current user's marker. */
.person-arrow svg .person-outline{stroke:#fff;stroke-width:5;fill:none}
.person-body.person-self .person-dot{box-shadow:0 0 0 2px #fff}
.person-body.person-self .person-label{border:1px solid #ffffff99;background:#102015d9}
.team-color-dot{display:inline-block;width:8px;height:8px;flex:0 0 8px;border-radius:50%;box-shadow:0 0 0 1px #ffffff26}
.group-chip{max-width:100%}.group-chip #active-team{min-width:0}
.team-title{display:flex;align-items:center;gap:9px}
.team-color-control{margin:0 0 20px;padding:14px;border:1px solid var(--line);border-radius:10px}
.team-color-control label{margin-bottom:9px}
.team-color-control input[type=color]{display:inline-block;margin:0;width:48px;height:40px;min-height:40px;padding:3px;cursor:pointer}
#team-color-value{font:12px monospace;color:var(--text)}
.team-color-preview{margin-left:auto;display:flex;align-items:center;gap:5px;font-size:11px}
.team-color-swatches{display:flex;gap:8px;flex-wrap:wrap;margin:13px 0}
.team-color-swatches .team-color-swatch{position:relative;width:30px;height:30px;min-height:30px;padding:0;border:2px solid transparent;border-radius:50%;box-shadow:inset 0 0 0 1px #0002}
.team-color-swatches .team-color-swatch::before{content:"";position:absolute;inset:-4px}
.team-color-swatches .team-color-swatch.selected{outline:2px solid var(--text);outline-offset:2px}

/* 0.4.4: screen containment, mobile focus, compact fixed-pixel markers. */
html,body{width:100%;max-width:100%;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{position:fixed;inset:0;touch-action:manipulation}
#app{position:absolute;left:0;top:var(--viewport-top,0px);width:100%;max-width:100%;height:var(--app-height,100dvh);min-width:0;overflow:hidden}
#app>*{max-width:100%;min-width:0}
.auth-shell{height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;padding:24px 18px;align-items:safe center}
.auth-card{width:min(100%,410px);min-width:0;max-width:100%;overflow-wrap:anywhere}
.brand{min-width:0}.brand>div:last-child{min-width:0}.brand-name{font-size:clamp(14px,4.5vw,18px);overflow-wrap:anywhere}
.page-shell{height:100%;min-height:0;overflow-y:auto;overflow-x:hidden}.page-body{min-width:0;max-width:100%}.page-grid>*{min-width:0}
.sheet-backdrop{top:var(--viewport-top,0px);bottom:auto;width:100%;max-width:100%;height:var(--app-height,100dvh);padding:12px;overflow:hidden}
.sheet{max-width:100%;max-height:calc(var(--app-height,100dvh) - 24px);min-width:0;overflow:auto;overscroll-behavior:contain;overflow-wrap:anywhere}
input,select,textarea{min-width:0;max-width:100%;font-size:16px}
.map-tray{overflow:hidden;isolation:isolate}
.map-shell .tray-item,.map-shell .tray-item:hover,.map-shell .tray-item:active,.map-shell .tray-item:focus{background:transparent!important;-webkit-tap-highlight-color:transparent;box-shadow:none}
.map-shell .tray-item.active{color:#77f083;background:transparent!important}
.map-shell .tray-item:focus-visible{outline-offset:-4px;border-radius:20px}
.map-shell .compass{display:block;width:30px;height:42px;min-height:42px;padding:0;border:0;border-radius:15px;background:transparent;box-shadow:none;color:#eaf4e5;font-size:9px}
.map-shell .compass span{display:block;transform-origin:50% 50%}
.person-icon,.person-body{width:22px!important;height:22px!important}
.person-body .person-arrow,.person-body .person-arrow svg{width:22px;height:22px}
.person-body .person-arrow{transform-origin:11px 11px}
.person-body .person-label{left:25px;top:3px;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;padding:1px 5px}
.person-body .person-dot{left:6px;top:6px;width:10px;height:10px}
.light .notice.good{color:#205b2b;background:#e0efdd;border-color:#7da174}
.light .good{color:#276432}.light .notice.danger{color:#893c2f;background:#f9e9e4;border-color:#b77e72}
.light .sheet small,.light .sheet .muted{color:#465844}
@media(max-width:650px){.page-top{gap:8px}.page-top h1{max-width:100%;overflow-wrap:anywhere}.page-top .badge{font-size:9px}.auth-card .brand{margin-bottom:28px}.date-inline{min-width:0}}

.light .map-shell .quick-marker{color:#172015}

/* Standstill changes only the marker symbol, retaining the last known bearing. */
.person-body.has-heading:not(.stationary) .person-dot{display:none}
.person-body.stationary .person-arrow{display:none}
.person-body.person-self .person-dot{border-color:#fff;box-shadow:0 0 0 2px var(--person-color)}

/* Controls cannot select text on long press; editable fields keep text selection. */
.leaflet-container,.sheet-header,.sheet button,.map-shell button{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.sheet input,.sheet textarea,.page-body input,.page-body textarea{user-select:text;-webkit-user-select:text;-webkit-touch-callout:default}
.grid2{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.grid2>*{min-width:0}.grid2 input,.grid2 select{width:100%;min-width:0;max-width:100%;min-inline-size:0;max-inline-size:100%}
.map-shell .map-control.following{border-color:#76f087;color:#76f087;background:#193425}
#drawing-bar{position:absolute;z-index:600;left:14px;right:14px;bottom:calc(env(safe-area-inset-bottom,0px) + 100px);padding:10px;border:1px solid var(--line);border-radius:14px;background:var(--panel);display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
#drawing-bar small{font-size:11px}#drawing-bar button{min-height:36px;padding:6px 10px}
@media(min-width:1000px){.has-sidebar #drawing-bar{left:310px}}

/* Variant 04. SVG glyph, short stem, coordinate dot; no backing badge. */
.quick-symbol{--quick-ink:#f9fbff;--quick-halo:#101922;display:block;flex-shrink:0;width:24px;height:34px;overflow:visible;pointer-events:none}
.quick-symbol .quick-halo{stroke:var(--quick-halo);stroke-width:4}
.quick-symbol .quick-ink{stroke:var(--quick-ink);stroke-width:1.7}
.quick-symbol .quick-dot-halo{fill:var(--quick-halo);stroke:var(--quick-halo);stroke-width:.8}
.quick-symbol .quick-coordinate-dot{fill:var(--quick-dot);stroke:var(--quick-ink);stroke-width:1}
.quick-point-icon{background:none!important;border:0!important;box-shadow:none!important;border-radius:0!important;outline-offset:3px}
.quick-point-icon::after{content:"";position:absolute;inset:-5px;pointer-events:auto}
.quick-point-icon .quick-symbol{width:24px;height:34px}
.quick-point-icon:focus-visible{outline:2px solid #FFBA24}
.quick-markers-light .quick-symbol,.light .marker-choice .quick-symbol{--quick-ink:#101922;--quick-halo:#fff}
.marker-choice .quick-symbol{margin:0 auto;width:24px;height:34px}
