
:root{font:14px/1.4 system-ui,sans-serif;color:#183c31;background:#203d30}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer}button,input,select{border:1px solid #c1cec2;border-radius:8px;background:#fffef6;color:#183c31;min-height:44px;padding:8px 12px}button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #2488ee;outline-offset:2px}[hidden]{display:none!important}#map-panel{position:fixed;inset:0;height:100dvh}#map{width:100%;height:100%;background:#314638}.topbar{position:absolute;z-index:800;top:max(10px,env(safe-area-inset-top));left:12px;right:12px;display:flex;align-items:center;gap:12px;padding:6px 8px 6px 15px;border-radius:12px;background:#fffef5f5;box-shadow:0 2px 14px #0003;min-height:58px}.topbar strong{white-space:nowrap;font-size:17px}.topbar strong span{font-weight:400}.topbar #live-status{margin-left:auto;font-size:12px}.icon-button{width:46px;height:46px;padding:0;display:grid;place-items:center;font-size:24px;font-weight:700;background:#fffef6;box-shadow:0 2px 8px #0002}.icon-button[aria-pressed=true]{background:#166ec4;color:white;border-color:#fff}.map-actions{position:absolute;z-index:800;left:12px;top:85px;display:flex;flex-direction:column;gap:9px}.leaflet-top.leaflet-right{top:80px;right:2px}.leaflet-control-zoom a{width:44px!important;height:44px!important;line-height:44px!important}.map-menu{position:absolute;z-index:1000;right:12px;top:80px;width:min(370px,calc(100vw - 24px));max-height:calc(100dvh - 110px);overflow:auto;padding:16px;background:#fffef8;border-radius:12px;box-shadow:0 5px 30px #0005;overscroll-behavior:contain}.menu-title,.input-row,.menu-actions{display:flex;align-items:center;gap:8px}.menu-title{justify-content:space-between}.menu-title h2{font-size:18px;margin:0}.map-menu label,dialog label{display:block;font-size:12px;font-weight:700;margin:16px 0 5px}.map-menu select{width:100%}.input-row input{width:100%;min-width:0}.map-menu p{font-size:12px;color:#65796c}.map-menu h3{margin-top:24px}.menu-actions{margin-top:10px;flex-wrap:wrap}.logout{margin-top:15px}.legend{display:flex;gap:8px;align-items:center;font-size:11px;margin-top:14px}.legend i{height:6px;flex:1;border-radius:4px;background:linear-gradient(90deg,#e66a0f,#ffed5c)}.map-messages{position:absolute;bottom:max(55px,env(safe-area-inset-bottom));left:12px;right:70px;z-index:650;pointer-events:none;display:flex;flex-direction:column;align-items:flex-start;gap:5px}.map-messages p{margin:0;padding:7px 10px;border-radius:7px;background:#fffef5ee;color:#183c31;font-size:12px;max-width:430px}.map-messages p:empty{display:none}.map-messages #map-error{background:#fff4d7;color:#895417}.map-messages button{pointer-events:auto;min-height:32px;padding:4px 8px;margin-left:8px}.person-pin,.dog-pin{display:grid;place-items:center;width:38px;height:38px;border:3px solid white;border-radius:50%;box-shadow:0 0 0 2px #152c23,0 3px 10px #0007;background:#1475df;color:white;position:relative}.person-pin svg,.dog-pin svg{width:25px;height:25px;fill:currentColor}.dog-pin{background:#ffda3e;color:#173a2b}.dog-direction{position:absolute;inset:-13px;pointer-events:none;transform:rotate(var(--heading))}.dog-direction:before{content:'';position:absolute;left:calc(50% - 7px);top:-1px;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:13px solid #ffda3e;filter:drop-shadow(0 -1px 1px #10251c)}.dog-pin.old{background:#dba34b}.dog-popup{min-width:210px;color:#183c31}.dog-popup h2{font-size:18px;margin:0 0 8px}.dog-popup dl{display:grid;grid-template-columns:1fr auto;gap:6px 15px;margin:0}.dog-popup dt{color:#61756a}.dog-popup dd{margin:0;font-weight:600}.dog-popup small{display:block;margin-top:10px;max-width:240px}.dog-popup button{margin-top:10px;width:100%}.leaflet-popup-content{margin:16px}.leaflet-control-attribution{max-width:min(650px,calc(100vw - 20px));white-space:normal!important;background:#fffffff0!important;font-size:10px!important;line-height:1.35!important}dialog{border:0;border-radius:14px;padding:26px;max-width:calc(100vw - 28px);width:350px}dialog::backdrop{background:#152b26bb}dialog input,dialog button{width:100%;margin-top:6px}#login-error{color:#a34824}@media(max-width:420px){.topbar{gap:8px}.topbar strong{font-size:14px}.topbar #live-status{font-size:11px}.map-messages{bottom:65px}.map-menu{max-height:calc(100dvh - 100px)}}

.topbar #live-status{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topbar strong,.topbar button{flex-shrink:0}.dog-popup h2{overflow-wrap:anywhere}

.dog-name-label{background:#fffef5;border:1px solid #203f30;border-radius:6px;color:#183c31;font-weight:750;font-size:13px;line-height:20px;padding:3px 9px;box-shadow:0 1px 7px #0005;width:max-content;max-width:none;white-space:nowrap;overflow-wrap:normal;word-break:normal}#device-id{width:100%;margin-bottom:8px}.dog-popup dd{max-width:155px;text-align:right;overflow-wrap:anywhere}

.dog-popup .dog-id{margin:0 0 12px;color:#65796c;font-size:11px}

#command-panel{margin-top:22px;border-top:1px solid #c1cec2;padding-top:6px}#command-panel fieldset{margin:12px 0;padding:10px;border:1px solid #c1cec2;border-radius:8px;min-width:0}#command-panel legend{font-weight:750}#command-panel button[data-command]{width:100%;min-height:48px;margin-top:8px;font-weight:700;background:#19633d;color:white}#command-panel button:disabled{background:#dce3dc;color:#65786b;cursor:not-allowed}#command-panel input{width:100%}#command-status{font-weight:650}#command-history{padding-left:20px;font-size:12px}#command-history li{margin-bottom:9px;overflow-wrap:anywhere}

#command-device{display:block;overflow-wrap:anywhere}
/* Compact collar command dialog shared by map control and dog popups. */
#command-open svg{width:25px;height:25px;fill:#fffef6;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
#command-dialog{width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:0;background:#fffef8;color:#183c31;overflow:auto;overscroll-behavior:contain;box-shadow:0 10px 50px #0005}
#command-dialog::backdrop{background:#10251c66}
#command-panel{margin:0;border:0;padding:0 16px 16px}
.command-heading{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fffef8;padding:15px 0 10px;border-bottom:1px solid #dce3dc}
.command-eyebrow{font-size:10px;letter-spacing:.1em;font-weight:750;color:#65796c}
#command-title{font-size:22px;margin:2px 0;overflow-wrap:anywhere}
#command-close{width:44px;flex-shrink:0;margin:0;box-shadow:none}
#command-panel>label,#command-panel fieldset label{display:block;font-size:12px;font-weight:650;margin:10px 0 4px}
#command-target{width:100%;margin:0;min-height:44px}
#command-device{font-size:10px;font-weight:400;color:#65796c;margin-top:5px}
#command-connection{font-weight:700;font-size:12px;margin:8px 0 4px}
.command-note{font-size:11px;color:#65796c;margin:0 0 10px}
#command-panel fieldset{margin:10px 0;padding:8px;border-color:#dce3dc}
#command-panel legend{font-size:12px;padding:0 5px}
#command-panel .command-quick{display:grid;grid-template-columns:1fr 1fr;gap:0 8px}
#command-panel .command-quick button{font-size:13px;margin:0;min-height:50px;padding:8px}
.command-quick button:first-of-type{grid-area:1/1}.command-quick button:nth-of-type(2){grid-area:1/2}
.command-quick p:first-of-type{grid-area:2/1}.command-quick p:nth-of-type(2){grid-area:2/2}
#command-panel [data-command-status]{font-size:11px;color:#65796c;margin:5px 0 0;overflow-wrap:anywhere}
#command-panel [data-command-status]:empty{display:none}
#command-panel .command-shock{display:grid;grid-template-columns:70px 1fr;gap:0 8px;align-items:end}
.command-shock label{grid-column:1/-1}#command-panel .command-shock select{width:100%;margin:0}
#command-panel .command-shock button{margin:0;background:#85422c}.command-shock p{grid-column:1/-1}
#command-panel button[data-command]:disabled{background:#dce3dc;color:#65786b}
#command-panel details{border-top:1px solid #dce3dc;margin-top:12px}
#command-panel summary{cursor:pointer;min-height:44px;padding:12px 0;font-size:13px;font-weight:700}
#command-panel details fieldset{margin-top:0}#command-status{font-size:12px;margin:8px 0}
.dog-popup .dog-commands{background:#19633d;color:white;font-weight:700}
@media(max-width:420px){#command-dialog{max-height:calc(100dvh - 20px)}#command-panel{padding:0 12px 12px}}
.trail-modes{position:absolute;z-index:800;left:12px;bottom:max(18px,env(safe-area-inset-bottom));display:flex;align-items:center;gap:3px;max-width:calc(100vw - 24px);padding:4px;border-radius:10px;background:#fffef8f5;box-shadow:0 2px 12px #0004}.trail-modes>span{font-size:11px;padding:0 5px}.trail-modes button{min-height:44px;padding:6px 9px;font-size:12px;border-color:transparent;background:transparent}.trail-modes button[aria-pressed=true]{background:#19633d;color:white}.map-messages{bottom:max(85px,calc(env(safe-area-inset-bottom) + 65px))}.dog-pin.uncertain{border-color:#ffb54d;box-shadow:0 0 0 3px #8b4d13,0 3px 10px #0007}.dog-popup details{margin-top:12px}.dog-popup summary{cursor:pointer;font-weight:700;min-height:36px}.dog-popup details dl{font-size:11px}.map-messages #gps-notice,.map-messages #raw-trail-notice{background:#fff4d7;color:#895417}

.trail-modes{bottom:max(calc(var(--map-credit-height,36px) + 12px),calc(env(safe-area-inset-bottom) + 12px))}.map-messages{bottom:max(calc(var(--map-credit-height,36px) + 82px),calc(env(safe-area-inset-bottom) + 82px))}@media(max-width:360px){.trail-modes>span{display:none}}
