* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: "Segoe UI", system-ui, sans-serif; font-size: 14px; color: #222; }
#app { display: flex; height: 100%; }
#panel { width: 360px; min-width: 300px; overflow-y: auto; padding: 14px 16px; background: #fafafa; border-right: 1px solid #ddd; }
#map { flex: 1; }
h1 { font-size: 18px; margin: 0 0 12px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #666; margin: 18px 0 6px; }
.drop { display: block; border: 2px dashed #9ab; border-radius: 8px; padding: 18px 12px; text-align: center; color: #456; cursor: pointer; background: #fff; }
.drop.over { background: #eef6ff; border-color: #48f; }
.drop input { display: none; }
#uploadForm button { margin-top: 8px; width: 100%; padding: 8px; border: 0; border-radius: 6px; background: #2563eb; color: #fff; font-weight: 600; cursor: pointer; }
#uploadForm button:disabled { background: #9bb; }
.status { margin-top: 8px; min-height: 18px; font-size: 13px; }
.status.ok { color: #1a7f37; }
.status.err { color: #c0392b; }
.status.warn { color: #b26a00; }
.row { margin-top: 8px; font-size: 13px; }
.row label { display: block; margin-bottom: 3px; color: #444; }
.row select { width: 100%; padding: 5px; border: 1px solid #bbb; border-radius: 5px; background: #fff; }
.warn { background: #fff4e0; border-left: 3px solid #e6a100; padding: 6px 8px; margin: 6px 0; font-size: 12.5px; }
h2 .tools { float: right; font-weight: normal; text-transform: none; letter-spacing: 0; }
h2 .tools a { color: #2563eb; text-decoration: none; }
.hidden { display: none; }
.muted { color: #888; font-size: 13px; }
table.kv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.kv th { text-align: left; color: #555; font-weight: 600; padding: 2px 6px 2px 0; vertical-align: top; white-space: nowrap; width: 38%; }
table.kv td { padding: 2px 0; word-break: break-word; }
.layer { display: flex; align-items: center; gap: 6px; padding: 3px 0; cursor: pointer; }
.layer .sw { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.layer .nm { flex: 1; }
.layer .ct { color: #888; font-size: 12px; }
.layer .off { font-size: 10.5px; color: #b26a00; background: #fff4e0; border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.layer .symbtn { width: 20px; height: 18px; padding: 0; margin: 0 4px 0 0; border: 1px solid #ccd; border-radius: 4px; background: #fff; color: #2563eb; font-size: 11px; line-height: 16px; cursor: pointer; }
.layer .symbtn:hover { background: #eef3ff; border-color: #2563eb; }
canvas.symsw { width: 14px; height: 14px; }
.symed { margin: 2px 0 6px 22px; padding: 6px 8px; background: #f3f6fb; border: 1px solid #d6deea; border-radius: 6px; font-size: 12px; }
.symed .symrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 3px 0; }
.symed label { color: #556; }
.symed select, .symed input[type=color] { padding: 2px 4px; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
.symed input[type=range] { width: 90px; }
.symed button { padding: 3px 8px; border: 1px solid #bbb; border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; }
.symed button.save { background: #2563eb; border-color: #2563eb; color: #fff; }
.symed button:disabled { opacity: .5; cursor: default; }
.symed canvas.prev { background: #fff; border: 1px solid #ddd; border-radius: 4px; }
a.ds { display: block; position: relative; padding: 5px 30px 5px 6px; margin: 2px 0; border-radius: 5px; text-decoration: none; color: #222; background: #fff; border: 1px solid #e3e3e3; }
a.ds .del { position: absolute; top: 50%; transform: translateY(-50%); right: 6px; width: 20px; height: 20px; margin: 0; padding: 0; border: 0; background: transparent; color: #b0b0b0; border-radius: 4px; cursor: pointer; font-size: 15px; line-height: 20px; text-align: center; }
a.ds:hover .del { color: #888; }
a.ds .del:hover { background: #fde3e3; color: #c0392b; }
a.ds:hover { border-color: #2563eb; background: #f3f7ff; }
a.ds .nm { display: block; font-weight: 600; font-size: 13px; }
a.ds .ct { display: block; color: #777; font-size: 11.5px; }
#legend .lg { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 1px 0; }
#legend .sw { width: 14px; height: 12px; border-radius: 2px; display: inline-block; border: 1px solid #999; }
.chip { display: inline-block; background: #e8eef7; border-radius: 12px; padding: 2px 9px; margin: 2px 2px 2px 0; font-size: 12px; }
.maplibregl-popup-content { font-family: inherit; font-size: 13px; }
.maplibregl-popup-content .ph { font-size: 13.5px; margin-bottom: 2px; }
.maplibregl-popup-content .ph .sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; border: 1px solid #999; margin-right: 5px; vertical-align: -1px; }
.maplibregl-popup-content .muted { color: #777; }
.maplibregl-popup-content .coords { margin-top: 5px; padding-top: 4px; border-top: 1px solid #e5e5e5; font-size: 12px; line-height: 1.5; }
.maplibregl-popup-content .coords b { font-family: Consolas, "Courier New", monospace; font-weight: 600; }
.maplibregl-popup-content .coords a.cp { color: #2563eb; text-decoration: none; font-size: 11px; margin-left: 4px; }
