/* 전국 경찰 순찰 안전지도 — 공문서 스타일 (경찰청 남색 + 흰색) */
:root {
  --navy: #002a5c; --navy-2: #0a3d7a; --navy-tint: #eef3f9;
  --ink: #1c1f24; --muted: #5b6470;
  --line: #d9dee5; --line-strong: #b9c2cc; --paper: #ffffff; --danger: #c0392b;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: var(--ink); background: var(--paper); line-height: 1.6;
  display: flex; flex-direction: column;
}
.topline { height: 4px; background: var(--navy); flex: 0 0 auto; }
nav.gnb {
  flex: 0 0 auto; background: var(--navy); color: #fff;
  display: flex; align-items: center; gap: 14px; padding: 0 22px; height: 54px; overflow-x: auto;
}
nav.gnb .site {
  font-weight: 800; font-size: 15.5px; display: flex; align-items: center; gap: 9px;
  color: #fff; text-decoration: none; white-space: nowrap;
}
nav.gnb .site .mark {
  width: 26px; height: 26px; border: 1.5px solid rgba(255,255,255,.85); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 26px;
}
nav.gnb .links { margin-left: auto; display: flex; gap: 2px; }
nav.gnb .links a {
  color: rgba(255,255,255,.85); text-decoration: none; font-size: 13.5px; font-weight: 600;
  padding: 6px 11px; border-radius: 4px; white-space: nowrap;
}
nav.gnb .links a:hover { background: rgba(255,255,255,.12); color: #fff; }
nav.gnb .links a.on { background: #fff; color: var(--navy); }

.doc { width: min(980px, 100% - 48px); margin: 0 auto; padding: 38px 0 70px; flex: 1 0 auto; }
.doc-head { border-top: 3px solid var(--navy); border-bottom: 1px solid var(--navy); padding: 26px 4px 22px; margin-bottom: 8px; }
.doc-head .doc-no { color: var(--muted); font-size: 12.5px; letter-spacing: 1px; margin-bottom: 10px; }
.doc-head h1 { margin: 0; font-size: 30px; line-height: 1.3; color: var(--navy); letter-spacing: -0.3px; }
.doc-head .doc-sub { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; }
section.sec { margin-top: 34px; }
section.sec > h2 { font-size: 18.5px; color: var(--navy); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
p { margin: 8px 0; font-size: 15px; }
.small { font-size: 13px; color: var(--muted); }
table.gov { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 10px 0; border-top: 2px solid var(--navy); }
table.gov th { background: var(--navy-tint); color: var(--navy); font-weight: 700; border-bottom: 1px solid var(--line-strong); padding: 9px 10px; text-align: left; }
table.gov td { border-bottom: 1px solid var(--line); padding: 9px 10px; vertical-align: top; }
.formula { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13.5px; border: 1px solid var(--line); background: #fafbfc; padding: 11px 13px; margin: 10px 0; }
.note { border: 1px solid var(--line); border-left: 4px solid var(--navy); background: var(--navy-tint); padding: 12px 14px; font-size: 13.5px; margin: 12px 0; }

/* 권역 카드 */
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 16px 0; }
a.region-card {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line-strong); border-top: 4px solid var(--navy); background: #fff;
  padding: 16px 17px 14px; transition: box-shadow .12s, transform .12s;
}
a.region-card:hover { box-shadow: 0 6px 18px rgba(0,20,50,.14); transform: translateY(-2px); }
a.region-card h3 { margin: 0 0 2px; color: var(--navy); font-size: 18px; display: flex; justify-content: space-between; align-items: center; }
a.region-card h3 .go { font-size: 13px; color: var(--navy-2); font-weight: 700; }
a.region-card .rs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-top: 9px; font-size: 12.5px; color: var(--muted); }
a.region-card .rs b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.flow { display: grid; grid-template-columns: 1fr 30px 1fr 30px 1fr; gap: 8px; align-items: stretch; margin: 16px 0; }
.flow .step { border: 1px solid var(--line-strong); padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 9px; }
.flow .step .no { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: 13px; flex: 0 0 25px; }
.flow .step h3 { margin: 0; font-size: 14.5px; display: flex; gap: 8px; align-items: center; color: var(--navy); }
.flow .step p { margin: 0; font-size: 13px; }
.flow .step .viz { border: 1px solid var(--line); background: var(--navy-tint); padding: 8px; }
.flow .arr { display: flex; align-items: center; justify-content: center; color: var(--navy); font-weight: 800; font-size: 18px; }

footer.gfoot { flex: 0 0 auto; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; padding: 16px 22px; display: flex; gap: 14px; flex-wrap: wrap; background: #fff; }
footer.gfoot b { color: var(--navy); }

/* 지도 페이지 */
.map-wrap { position: relative; flex: 1 1 auto; min-height: 0; }
#map { width: 100%; height: 100%; }
.panel {
  position: absolute; z-index: 8; left: 14px; top: 14px; width: 252px;
  background: #fff; border: 1px solid var(--line-strong); border-top: 3px solid var(--navy);
  box-shadow: 0 4px 14px rgba(0, 20, 50, 0.13); padding: 13px 14px 12px; font-size: 13px;
}
.panel h2 { margin: 0 0 4px; font-size: 14.5px; color: var(--navy); }
.panel .small { display: block; margin-bottom: 8px; }
.lg-bar { height: 12px; display: flex; border: 1px solid var(--line); }
.lg-bar i { flex: 1 1 0; }
.lg-cap { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin: 2px 0 10px; }
.layers { border-top: 1px solid var(--line); padding-top: 9px; display: grid; gap: 6px; }
.layers label { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; margin: 0; font-weight: 500; }
.layers input { accent-color: var(--navy); width: 15px; height: 15px; }
#status {
  position: absolute; z-index: 8; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 7px 16px; border-radius: 999px; box-shadow: 0 4px 12px rgba(0,20,50,.25);
  max-width: calc(100% - 30px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.keybox { position: absolute; z-index: 9; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(255,255,255,.94); padding: 20px; }
.keybox.on { display: flex; }
.keybox .inner { max-width: 520px; border: 1px solid var(--line-strong); border-top: 3px solid var(--navy); background: #fff; padding: 22px 24px; font-size: 14px; }
.keybox h2 { margin: 0 0 8px; color: var(--navy); font-size: 17px; }
.keybox code { background: var(--navy-tint); padding: 2px 6px; font-size: 12.5px; }
.pt { font-size: 15px; line-height: 1; pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.gap-pin { font-size: 28px; line-height: 1; pointer-events: none; animation: gappulse 1.1s ease-in-out infinite; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
@keyframes gappulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.35); } }
table.gov a { color: var(--navy-2); font-weight: 700; text-decoration: none; }
table.gov a:hover { text-decoration: underline; }
.bs { font-size: 17px; line-height: 1; cursor: pointer; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }

@media (max-width: 760px) {
  nav.gnb { padding: 0 12px; gap: 8px; }
  .doc { width: calc(100% - 32px); padding-top: 24px; }
  .doc-head h1 { font-size: 23px; }
  .flow { grid-template-columns: 1fr; }
  .flow .arr { transform: rotate(90deg); }
  .panel { width: 210px; left: 10px; top: 10px; }
}
