/* maps.diaocso.vn — MVP, mobile-first. Không dùng code/CSS của ViQy. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #1f2937; }
body { display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #0e7a3d; color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 6px; background: #fff; color: #0e7a3d; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; }
.brand-text small { font-size: 12px; opacity: .9; }
.free-badge { background: #facc15; color: #14532d; font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.projects-link { margin-left: auto; color: #fff; font-size: 13px; font-weight: 600; }

.toolbar { display: flex; gap: 8px; padding: 8px 12px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; align-items: center; }
.search-box { position: relative; flex: 1 1 280px; display: flex; }
.search-box input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 8px 0 0 8px; font-size: 14px; }
.search-box button { border: 1px solid #cbd5e1; border-left: 0; background: #fff; border-radius: 0 8px 8px 0; padding: 0 12px; cursor: pointer; font-size: 15px; }
.search-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 1000; margin: 4px 0 0; padding: 0; list-style: none; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.15); max-height: 260px; overflow: auto; }
.search-results li { padding: 9px 10px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.search-results li:last-child { border-bottom: 0; }
.search-results li:hover, .search-results li.active { background: #f0fdf4; }
.tool-btn { padding: 9px 12px; border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tool-btn:hover { background: #f0fdf4; }

.layers-panel { position: absolute; top: 118px; right: 12px; z-index: 900; width: min(300px, calc(100vw - 24px)); background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 12px; max-height: calc(100vh - 220px); overflow: auto; }
.layers-panel h2 { margin: 0 0 8px; font-size: 15px; }
.layers-panel fieldset { border: 1px solid #e2e8f0; border-radius: 8px; margin: 0 0 10px; padding: 8px 10px; }
.layers-panel legend { font-size: 13px; font-weight: 700; padding: 0 4px; }
.layers-panel label { display: block; font-size: 13px; padding: 3px 0; }
.panel-note { font-size: 12px; color: #64748b; margin: 4px 0 6px; line-height: 1.5; }
.goto-btn { display: block; width: 100%; margin-top: 6px; padding: 8px; border: 1px solid #0e7a3d; background: #f0fdf4; color: #0e7a3d; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.plan-status { margin-top: 8px; padding: 8px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; font-size: 12px; line-height: 1.5; color: #334155; }
.leaflet-popup-content .plan-box { background: #f0fdf4; border: 1px solid #0e7a3d; border-radius: 6px; padding: 7px 9px; margin: 8px 0; }

#map { flex: 1; min-height: 320px; z-index: 1; }
.leaflet-popup-content { font-size: 13px; line-height: 1.55; }
.leaflet-popup-content h3 { margin: 0 0 6px; font-size: 15px; }
.leaflet-popup-content .warn { background: #fef9c3; border: 1px solid #facc15; border-radius: 6px; padding: 7px 9px; margin: 8px 0; }
.leaflet-popup-content a { color: #0e7a3d; font-weight: 600; }
.leaflet-popup-content .coords { font-family: monospace; font-size: 12px; color: #475569; }

.measure-result { position: absolute; left: 50%; transform: translateX(-50%); bottom: 64px; z-index: 900; background: #111827; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.3); max-width: calc(100vw - 24px); text-align: center; }

.disclaimer { padding: 8px 12px; font-size: 12px; line-height: 1.55; color: #475569; background: #f8fafc; border-top: 1px solid #e2e8f0; }
.disclaimer a { color: #0e7a3d; }

@media (max-width: 640px) {
  .projects-link { display: none; }
  .layers-panel { top: 158px; }
  .tool-btn { font-size: 12px; padding: 8px 9px; }
}
