:root{
  color-scheme:light; --ink:#172c25; --muted:#52645d; --accent:#155c47; --accent-hover:#104a39;
  --line:#dde7e0; --surface:#fff; --page:#eef3ef; --map:#e2eae5; --error:#a13a2e;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  background:var(--page);color:var(--ink);line-height:1.5;font-size:16px
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0}
button,input{font:inherit}
button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;cursor:pointer;border:1px solid var(--accent);border-radius:10px;background:var(--accent);color:white;font-weight:650;padding:0 14px;white-space:nowrap;touch-action:manipulation}
button:not(:disabled):hover{background:var(--accent-hover)}
button.outline{border-color:var(--line);background:var(--surface);color:var(--accent)}
button.outline:not(:disabled):hover{background:#ecf4ee}
button:disabled{cursor:default;opacity:.48}
button:focus-visible,input:focus-visible,summary:focus-visible,a:focus-visible{outline:2px solid #25855f;outline-offset:3px}
input{border:1px solid var(--line);border-radius:9px;padding:9px 10px;min-height:44px;color:var(--ink);width:100%;background:white}
a{color:var(--accent)}
p{margin:0}
.shell{max-width:1340px;margin:auto;padding:0 clamp(14px,4vw,52px) max(16px,env(safe-area-inset-bottom))}
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:19px 0 17px}
.title{display:flex;align-items:center;gap:11px}
h1,h2{margin:0;letter-spacing:-.035em}
h1{font-size:clamp(1.16rem,2.35vw,1.65rem)}
h2{font-size:1.28rem;line-height:1.4;overflow-wrap:anywhere}
.mark{width:29px;height:33px;background:var(--accent);border-radius:50% 50% 50% 4px;transform:rotate(-45deg);display:grid;place-items:center}
.mark:before{content:"";width:9px;height:9px;border:2px solid white;border-radius:50%}
.workspace{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:14px}
.map-area{position:relative;min-height:570px;height:calc(100dvh - 115px);max-height:840px;overflow:hidden;border:1px solid var(--line);border-radius:15px;background:var(--map)}
#map{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0}
.search-area{position:absolute;z-index:2;top:13px;left:13px;right:13px;max-width:440px;filter:drop-shadow(0 3px 10px #172c2520)}
#search{background:white;display:flex;align-items:center;gap:6px;padding:5px;border-radius:12px;border:1px solid var(--line)}
#search input{border:0;min-width:0}
#results,.small,#map-error{background:var(--surface);border:1px solid var(--line);border-radius:10px;margin:6px 0 0}
.small,#map-error{padding:9px 12px;color:var(--muted);font-size:.88rem}
#map-error{position:absolute;z-index:1;pointer-events:none;left:13px;right:13px;bottom:24px;max-width:350px}
#results{padding:0;list-style:none;max-height:240px;max-height:min(40dvh,300px);overflow:auto}
#results button{display:block;width:100%;text-align:left;border:0;border-radius:0;white-space:normal;background:white;color:var(--ink);padding:9px 12px;min-height:52px}
#results button:hover{background:#eff6f1}
#results li+li{border-top:1px solid var(--line)}
#results small{display:block;color:var(--muted);font-weight:400}
.panel{align-self:start;background:var(--surface);border:1px solid var(--line);border-radius:15px;padding:17px;display:grid;gap:13px}
.connection-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px 15px;color:var(--muted);font-size:.87rem}
.connection-row>span{display:inline-flex;align-items:center;gap:6px}
.dot{width:7px;height:7px;border-radius:50%;background:#98a79d}
[data-ready=true] .dot{background:#1d8d62}
.selection{padding:7px 0 4px}
#selected-coordinates{color:var(--muted);margin-top:5px;font-size:.9rem;font-variant-numeric:tabular-nums}
details{border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
summary{cursor:pointer;padding:9px 0;min-height:44px;color:var(--accent);font-size:.92rem}
#coordinates{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding-bottom:10px}
#coordinates label{font-size:.85rem;color:var(--muted);min-width:0}
#coordinates button{grid-column:1/-1}
#feedback{color:var(--muted);font-size:.88rem;min-height:1.4em}
#feedback[data-error=true]{color:var(--error)}
#bluefy-link{font-size:.88rem;min-height:32px}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.sr-only{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
#map.leaflet-container{touch-action:none;background:var(--map)}
.leaflet-top.leaflet-right{top:65px}
.leaflet-control-zoom a{width:38px!important;height:38px!important;line-height:38px!important}
.leaflet-container .leaflet-control-attribution{font-size:.69rem}
.location-pin{width:20px!important;height:20px!important;border:3px solid #fff;border-radius:50%;background:var(--accent);box-shadow:0 1px 5px #172c2560;pointer-events:none}
@media(max-width:720px){
  .shell{padding-top:env(safe-area-inset-top)}
  .top{padding:11px 0}
  .workspace{grid-template-columns:minmax(0,1fr);gap:9px}
  .map-area{height:49vh;height:clamp(270px,49dvh,520px);min-height:270px}
  .panel{padding:12px 13px;gap:8px}
  .selection{padding:2px 0}
  .connection-row{font-size:.85rem}
}
