:root{--ink:#14213d;--bg:#eef2f7;--sea:#cfe3f3;--land:#fbf8ef;--ctx:#dcdcdc;--border:#3b3b3b;--panel:#fff;--accent:#14213d}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--ink);background:var(--bg);
  touch-action:manipulation;-webkit-text-size-adjust:100%;overflow-x:hidden;display:flex;flex-direction:column;min-height:100vh}
.top{background:var(--ink);color:#fff;padding:.6rem 1.2rem;display:flex;flex-wrap:wrap;align-items:baseline;gap:.3rem 1.5rem}
.top h1{margin:0;font-size:clamp(1.3rem,2.2vw,2.2rem);line-height:1.15;font-weight:800;letter-spacing:-.01em}
.top .yrs{font-weight:500;opacity:.85;white-space:nowrap}
.status{margin:0;font-size:clamp(1rem,1.3vw,1.35rem);color:#ffd166;font-weight:600;min-height:1.4em}
.layout{flex:1;display:flex;gap:.8rem;padding:.8rem;min-height:0}
.mapwrap{position:relative;flex:1;min-width:0;background:var(--sea);border-radius:14px;overflow:hidden;box-shadow:0 2px 10px rgba(20,33,61,.15);
  display:flex;align-items:center;justify-content:center}
#map{width:100%;height:100%;display:block;touch-action:pan-y;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#map .grat{fill:none;stroke:#fff;stroke-opacity:.45;stroke-width:1}
#map .ctx{fill:var(--ctx);stroke:#bdbdbd;stroke-width:.8}
#map .c{fill:var(--land);stroke:var(--border);stroke-width:1.2;stroke-linejoin:round;cursor:pointer;transition:fill .15s}
#map .c:hover,#map .c.hover{stroke:#000;stroke-width:3}
#map .c:focus{outline:none;stroke:#000;stroke-width:3.5}
#map .wb{stroke:#000;stroke-width:2;cursor:pointer}
#map .lbl{font-weight:700;fill:#111;paint-order:stroke;stroke:#fff;stroke-width:4px;stroke-linejoin:round;pointer-events:none;text-anchor:middle;dominant-baseline:middle}
#map.nonames .lbl{display:none}
.credit{position:absolute;right:.6rem;bottom:.3rem;margin:0;font-size:.75rem;color:#35506b;opacity:.85;pointer-events:none}
.tip{position:absolute;pointer-events:none;background:var(--ink);color:#fff;padding:.35rem .7rem;border-radius:8px;font-size:1.15rem;font-weight:700;white-space:nowrap;transform:translate(-50%,-130%);z-index:5;box-shadow:0 2px 6px rgba(0,0,0,.3)}
.tip small{display:block;font-weight:500;font-size:.9rem;opacity:.9}
.panel{width:clamp(300px,24vw,400px);flex:none;background:var(--panel);border-radius:14px;padding:.8rem 1rem;box-shadow:0 2px 10px rgba(20,33,61,.15);overflow-y:auto}
.panel h2{font-size:1.1rem;margin:.1rem 0 .5rem;text-transform:uppercase;letter-spacing:.04em;color:#3d4f6e}
.panel h2:not(:first-child){margin-top:.9rem}
.legend{list-style:none;margin:0;padding:0;display:grid;gap:.35rem}
.legend li{display:flex;align-items:center;gap:.5rem;border:3px solid transparent;border-radius:12px;padding:.15rem .35rem;background:#f4f6fa}
.legend li.active{border-color:var(--ink);background:#e6ecf7}
.sw{width:50px;height:40px;border-radius:10px;border:2px solid rgba(0,0,0,.35);cursor:pointer;flex:none;position:relative}
.legend li.active .sw::after{content:"✓";position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:1.6rem;font-weight:900;text-shadow:0 0 3px #000}
.legend input{flex:1;min-width:0;width:0;font:inherit;font-size:1.15rem;font-weight:700;color:var(--ink);border:1px solid transparent;background:transparent;border-radius:8px;padding:.35rem .4rem}
.legend input:hover{border-color:#c5cede}
.legend input:focus{border-color:var(--ink);background:#fff;outline:none}
.legend .cnt{font-size:.95rem;color:#55627a;white-space:nowrap;min-width:3.6em;text-align:right}
.tools{display:grid;grid-template-columns:1fr 1fr;gap:.45rem;margin-top:.7rem}
.out{margin-left:auto;display:flex;gap:.45rem;align-self:center}
.out .tool{min-height:42px;background:transparent;color:#fff;border-color:rgba(255,255,255,.45)}
.out .tool:hover{border-color:#fff}
.tool{font:inherit;font-size:1.05rem;font-weight:700;min-height:48px;border-radius:10px;border:2px solid #c5cede;background:#fff;color:var(--ink);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:.4rem;padding:.3rem .6rem}
.tool:hover:not(:disabled){border-color:var(--ink)}
.tool:disabled{opacity:.45;cursor:default}
.tool[aria-pressed=true]{background:var(--ink);color:#fff;border-color:var(--ink)}
.tool.danger{color:#b3261e}
.tool.toggle input{width:22px;height:22px;margin:0}
.presets{display:grid;grid-template-columns:1fr 1fr;gap:.45rem}
.presets button{font:inherit;font-size:1.05rem;font-weight:700;min-height:52px;border-radius:10px;border:2px solid var(--ink);background:#fff;color:var(--ink);cursor:pointer;line-height:1.15;padding:.3rem}
.presets button.on{background:var(--ink);color:#fff}
.info{margin-top:.6rem;background:#fff8e1;border-left:6px solid #f2b705;border-radius:8px;padding:.6rem .8rem;font-size:1rem;line-height:1.35}
.info h3{margin:0 0 .3rem;font-size:1.15rem}
.info p{margin:.2rem 0}
.printlegend{display:none}
@media (min-width:901px){body{height:100vh;overflow:hidden}}
@media (max-width:900px){
  .out{margin-left:0;width:100%}
  .out .tool{flex:1}
  .layout{flex-direction:column;padding:.5rem}
  .mapwrap{flex:none;aspect-ratio:1.6/1;width:100%}
  .panel{width:100%}
  .credit{font-size:.6rem}
  .legend{grid-template-columns:1fr 1fr}
  .legend li{flex-wrap:nowrap}
  .legend .cnt{display:none}
  .sw{width:40px;height:40px}
  .legend input{font-size:1rem;padding:.3rem .2rem}
}
@media (max-width:480px){.legend{grid-template-columns:1fr}.legend .cnt{display:inline}.legend input{font-size:1.1rem}
.tool,.presets button{font-size:.98rem}.top{padding:.5rem .8rem}}
@media print{
  @page{size:A4 landscape;margin:10mm}
  body{background:#fff;height:auto;overflow:visible;display:block}
  .top{background:#fff;color:#000;padding:0 0 4mm}
  .status,.panel .tools,.out,.presets,.panel h2,.tip{display:none!important}
  .layout{display:block;padding:0}
  .mapwrap{box-shadow:none;border:1px solid #999;height:150mm}
  .panel{width:auto;box-shadow:none;padding:2mm 0;overflow:visible}
  .legend{grid-template-columns:repeat(4,auto);justify-content:start}
  .legend li{background:none;border:none}
  .legend li.unused{display:none}
  .sw{width:10mm;height:7mm;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .legend li.active .sw::after{content:none}
  #map *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .mapwrap{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .info{border:1px solid #999;font-size:10pt;padding:2mm 3mm;margin-top:2mm}
  .info h3{font-size:11pt}
  .legend input{width:auto;flex:none;field-sizing:content;min-width:8em;border:none;font-size:11pt}
  .legend .cnt{display:inline!important;font-size:9pt}
  .mapwrap{height:125mm}
}
#map .lbl.start{text-anchor:start}
