* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow-x: hidden; } /* 가로 넘침 잠금(모바일 버튼 밀림 방지) */
body { touch-action: manipulation; } /* 더블탭 확대 방지 */
body {
  font-family: "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  font-size: 14px;
  color: #222;
  background: #f4f5f7;
}

#app { display: flex; height: 100vh; max-width: 100vw; }
#map-wrap { min-width: 0; }

#sidebar {
  width: 340px;
  flex: 0 0 auto;
  overflow-y: auto;
  padding: 14px;
  background: #fff;
}

#resizer {
  flex: 0 0 5px;
  cursor: col-resize;
  background: #ddd;
  transition: background .15s;
}
#resizer:hover { background: #2b6cb0; }

#editor-panel {
  width: 300px;
  flex: 0 0 auto;
  background: #fff;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  padding: 14px;
}
#editor-panel[hidden] { display: none !important; }
#editor-panel h2 { font-size: 14px; margin: 0; color: #333; }
#sidebar h1 { font-size: 17px; margin: 0 0 12px; }
.user-chip { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #555; margin: -6px 0 10px; }
.user-chip a.small { padding: 3px 8px; font-size: 12px; border: 1px solid #cfe1f7; border-radius: 6px; color: #1c7ed6; text-decoration: none; background: #f4f8ff; }
.user-chip > span:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .row { flex: none; }
.user-chip .row a, .user-chip .row button { white-space: nowrap; }
.user-chip[hidden] { display: none !important; }
.sys-chip { margin: -2px 0 12px; padding: 8px 10px; border: 1px solid #e3e4e8; border-radius: 8px; background: #fafbfc; font-variant-numeric: tabular-nums; }
.usage-row + .usage-row { margin-top: 8px; }
.usage-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; color: #555; margin-bottom: 4px; white-space: nowrap; }
.usage-label b { font-size: 12px; color: #1b2a4a; }
.usage-sub { font-size: 10.5px; color: #888; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-fill.usage { background: #1c7ed6; }
.goal-fill.usage.warn { background: #f08c00; }
.goal-fill.usage.over { background: #e03131; }
.sys-chip[hidden] { display: none !important; }
.route-list li.group .zone-dl { margin-left: auto; padding: 0 6px; border: 0; background: transparent; color: #adb5bd; font-size: 13px; cursor: pointer; }
.route-list li.group:hover .zone-dl { color: #1c7ed6; }
/* 취득 시작 — 앱의 주 액션. 사이드바 상단 큰 버튼 + 지도 위 플로팅 버튼 + 목록/편집 패널 진입점 */
.ic-drive { width: 20px; height: 20px; flex: none; }
.btn-drive {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  width: 100%; padding: 12px 14px; margin: 0 0 14px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, #1b2a4a 0%, #1c7ed6 100%); color: #fff;
  box-shadow: 0 6px 18px rgba(28, 126, 214, .35);
}
.btn-drive .ic-drive { grid-row: 1 / span 2; width: 28px; height: 28px; }
.btn-drive span { font-size: 16px; font-weight: 900; letter-spacing: -.2px; line-height: 1.1; }
.btn-drive small { font-size: 11px; font-weight: 600; opacity: .85; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-drive:hover { filter: brightness(1.07); background: linear-gradient(135deg, #1b2a4a 0%, #1c7ed6 100%); }
.btn-drive-inline { display: flex; align-items: center; justify-content: center; gap: 6px; background: #1b2a4a; color: #fff; border-color: #1b2a4a; font-weight: 800; }
.btn-drive-inline:hover { background: #243a66; }
.drive-h2 { display: flex; align-items: center; gap: 6px; }
#drive-fab {
  position: absolute; right: 16px; bottom: 24px; z-index: 320;
  display: flex; align-items: center; gap: 8px; padding: 13px 18px 13px 14px;
  border: 0; border-radius: 28px; background: linear-gradient(135deg, #1b2a4a 0%, #1c7ed6 100%); color: #fff;
  font-size: 15px; font-weight: 900; letter-spacing: -.2px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
#drive-fab .ic-drive { width: 22px; height: 22px; }
#drive-fab:hover { filter: brightness(1.07); background: linear-gradient(135deg, #1b2a4a 0%, #1c7ed6 100%); }
body.mode-edit #drive-fab, body.mode-drive #drive-fab { display: none; }
#sidebar h2 { font-size: 13px; margin: 0 0 8px; color: #555; text-transform: uppercase; letter-spacing: .04em; }

.box { margin-bottom: 16px; padding: 12px; border: 1px solid #e3e4e8; border-radius: 8px; background: #fafbfc; position: relative; }
.box[hidden] { display: none !important; }

.box-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.box-head h2 { margin: 0; }
button.small { padding: 3px 8px; font-size: 12px; }
button.small.primary { flex: none; }

.row { display: flex; gap: 6px; margin-bottom: 8px; }
.row:last-child { margin-bottom: 0; }

input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font: inherit;
  background: #fff;
  margin-bottom: 8px;
}
.row input, .row select { margin-bottom: 0; }
input[readonly] { background: #f0f1f3; color: #666; cursor: default; }
#f-number { width: 64px; flex: 0 0 64px; }
#f-zone { width: 80px; flex: 0 0 80px; }

button {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  cursor: pointer;
  white-space: nowrap; /* 버튼 안에서 글자 줄바꿈 금지 */
}
button.grow { flex: 1; }
button:hover { background: #f0f1f3; }
button:active { transform: scale(.95); }
button:disabled { opacity: .6; cursor: default; }
button.primary { background: #2b6cb0; border-color: #2b6cb0; color: #fff; flex: 1; }
button.primary:hover { background: #2c5f9e; }

.hint { font-size: 12px; color: #777; margin: 6px 0; }

.point-list { list-style: none; margin: 0 0 10px; padding: 0; border: 1px solid #e6e8ec; border-radius: 8px; overflow: hidden; }
.point-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  background: #fff;
  border-bottom: 1px solid #f0f1f3;
  min-height: 38px;
}
.point-list li:last-child { border-bottom: none; }
.point-list li:hover { background: #fafbfc; }

.pt-icon {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #adb5bd;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #868e96;
}
.point-list li.start .pt-icon { border-color: #2f9e44; border-width: 4px; }
.point-list li.end .pt-icon { border-color: #e03131; border-width: 4px; }

.pt-text {
  flex: 1;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pt-ctl {
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transition: opacity .12s;
}
.point-list li:hover .pt-ctl { opacity: 1; }
.pt-ctl .rm {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #fff;
  color: #666;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pt-ctl .rm:hover { color: #e03131; border-color: #e03131; background: #fff; }
.drag-handle {
  cursor: grab;
  touch-action: none;
  color: #99a;
  font-size: 15px;
  padding: 0 3px;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }
.point-list li.pending {
  border: 1.5px dashed #74a0d8;
  border-radius: 8px;
  margin: 5px;
  background: #f5f9ff;
}
.point-list li.pending .pt-icon {
  border-style: dashed;
  border-color: #74a0d8;
}
.point-list li.pending .pt-text {
  color: #2b6cb0;
  cursor: default;
}
.point-list li.pending.full {
  border-color: #ccc;
  background: #f6f6f7;
}
.point-list li.pending.full .pt-text { color: #999; }
.point-list li.pending.full .pt-icon { border-color: #ccc; }

.point-list li.dragging {
  opacity: .55;
  background: #e7effa;
  border: 1px dashed #2b6cb0;
  border-radius: 6px;
}

.stats {
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 10px;
  margin-bottom: 8px;
}
.stats-time { font-size: 24px; font-weight: 800; color: #2b6cb0; line-height: 1.2; }
.stats-sub { font-size: 12px; color: #868e96; margin-top: 3px; }
.warn { padding: 8px 10px; background: #fdeaea; border: 1px solid #f5c2c2; border-radius: 6px; margin-bottom: 8px; font-size: 12px; color: #a12020; }
.banner { padding: 8px 10px; background: #fff3cd; border: 1px solid #ffd43b; border-radius: 6px; margin-bottom: 8px; font-size: 12px; color: #7a5c00; line-height: 1.5; }

.route-list { list-style: none; margin: 0; padding: 0; max-height: 45vh; overflow-y: auto; }
.route-list li.group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 2px 3px;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  border: none;
  background: none;
}
.route-list li.item {
  position: relative; /* 액션 아이콘을 글자 위에 겹쳐 띄우기 위한 기준 */
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  margin-bottom: 4px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
}
.route-list li.item:hover { background: #eef3fa; border-color: #b9cdea; }
.route-list li.item.hovered {
  background: #dbe7f7;
  border-color: #2b6cb0;
  box-shadow: inset 0 0 0 1px #2b6cb0;
}
.route-list li.item.editing { outline: 2px solid #2b6cb0; }
.route-list .drag-handle { flex: none; cursor: grab; color: #868e96; font-size: 18px; line-height: 1; padding: 0 6px 0 2px; user-select: none; }
.route-list li.item:hover .drag-handle { color: #2b6cb0; }
.route-list li.item.dragging { opacity: .45; border-style: dashed; }
body.role-viewer .route-list .drag-handle, body.role-viewer .point-list .drag-handle { display: none !important; }
#ro-banner { margin-bottom: 8px; }
#ro-banner[hidden] { display: none !important; }
.route-list .dot {
  flex: 0 0 10px;
  width: 10px; height: 10px;
  border-radius: 50%;
}
.route-list .title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.route-list .title small { color: #888; display: block; font-size: 11px; }
/* 평소엔 자리를 차지하지 않고, 호버 시 글자 위에 반투명 블러 배경과 함께 겹쳐 나타남 */
.route-list .ctl {
  position: absolute;
  right: 4px;
  top: 4px;    /* 테두리(파란 강조 포함)에 닿지 않게 안쪽으로 띄움 */
  bottom: 4px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 3px 0 44px; /* 왼쪽 44px이 페이드 구간 */
  border-radius: 5px;
  --fade: 238, 243, 250; /* 행 hover 배경색과 동일 */
  background: linear-gradient(
    to right,
    rgba(var(--fade), 0) 0,
    rgba(var(--fade), .25) 12px,
    rgba(var(--fade), .6) 24px,
    rgba(var(--fade), .88) 36px,
    rgba(var(--fade), .92) 44px,
    rgba(var(--fade), .92) 100%
  );
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40px); /* 블러 자체도 같이 페이드 */
  mask-image: linear-gradient(to right, transparent 0, #000 40px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}
.route-list li.item:hover .ctl,
.route-list li.item.editing .ctl { opacity: 1; pointer-events: auto; }
.route-list li.item.editing .ctl,
.route-list li.item.hovered .ctl { --fade: 219, 231, 247; } /* 파란 강조 행 배경색 */
.route-list .ctl button {
  padding: 3px 6px;
  font-size: 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: #777;
}
.route-list .ctl button:hover { background: #d7e3f5; }

.search-results {
  position: absolute;
  left: 12px; right: 12px;
  max-height: 320px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
}
.search-results .sr { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.search-results .sr.active, .search-results .sr:hover { background: #eef3fa; }
.sr-name { font-size: 13px; font-weight: 700; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-addr { font-size: 11px; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
/* 검색 핀 카드 */
.search-pin { position: relative; }
.sp-card { background: #fff; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.28); padding: 10px 12px; min-width: 210px; max-width: 270px; }
.sp-card b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-card small { display: block; font-size: 11px; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sp-acts { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.sp-acts button { padding: 8px 10px; font-size: 12px; font-weight: 800; border-radius: 8px; background: #1b2a4a; color: #fff; border: 0; white-space: nowrap; }
.sp-acts button:hover { background: #243a66; }
.sp-acts button.ghost { background: #fff; color: #555; border: 1px solid #dee2e6; }
.sp-tip { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 10px solid #fff; margin: 0 auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }

#map-wrap { flex: 1; position: relative; }

/* 경유지 추가 모드: 지도 커서를 핀 모양으로 */
#map-wrap.picking, #map-wrap.picking * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='32'%3E%3Cpath d='M12 1C6 1 1.5 5.6 1.5 11.4c0 8 10.5 19.1 10.5 19.1s10.5-11.1 10.5-19.1C22.5 5.6 18 1 12 1z' fill='%23e8590c' stroke='%23fff' stroke-width='2'/%3E%3Ccircle cx='12' cy='11.5' r='4' fill='%23fff'/%3E%3C/svg%3E") 12 30, crosshair !important;
}

#btn-add-point.on {
  background: #e7effa;
  border-color: #2b6cb0;
  color: #2b6cb0;
  font-weight: 600;
}
#map { width: 100%; height: 100%; }
#map-msg[hidden] { display: none !important; }
#map-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: #f4f5f7;
  font-size: 15px;
  line-height: 1.7;
  color: #555;
  z-index: 100;
  white-space: pre-line;
}

/* ---------- 취득(주행) 모드 패널 ---------- */
#drive-panel {
  position: fixed;
  right: 12px;
  bottom: 24px;
  width: 340px;
  z-index: 450;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  padding: 14px;
}
#drive-panel[hidden] { display: none !important; }
#drive-backdrop { display: none; }
#drive-backdrop[hidden] { display: none !important; }
#drive-panel h2 { font-size: 15px; margin: 0; }
.drive-label { display: block; font-size: 12px; color: #555; margin-bottom: 6px; }
.drive-label select { margin-top: 3px; }
.drive-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #555; margin: 4px 0 10px; }
/* 취득 모드 전용 회전 지도 (MapLibre GL) — 카카오 지도 위를 덮는다 */
#drive-map { position: absolute; inset: 0; z-index: 40; background: #e9ecef; }
#drive-map[hidden] { display: none !important; }
.gl-car { width: 52px; height: 52px; filter: drop-shadow(0 2px 5px rgba(0,0,0,.35)); z-index: 10; } /* 내 위치는 항상 최상단 */
.gl-car svg { display: block; width: 100%; height: 100%; }
.gl-pin.hover-pin { pointer-events: none; }
.gl-pin {
  z-index: 1;
  padding: 3px 8px; border-radius: 10px; color: #fff; font-size: 12px; font-weight: 800;
  border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.35); white-space: nowrap;
}

/* ---------- 취득 주행 UI: 네이버 내비 스타일 오버레이 ---------- */
#drive-run { position: fixed; inset: 0; z-index: 460; pointer-events: none; }
#drive-run[hidden] { display: none !important; }
.nv-top {
  pointer-events: auto;
  position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px;
  max-width: 520px; margin: 0 auto;
  background: #1b2a4a; color: #fff;
  border-radius: 16px; padding: 14px 16px 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.nv-top.turn-now { background: #d9480f; }
.nv-top.straight { background: #1b2a4a; }
.nv-top.to-start { background: #1864ab; }
.nv-top.arrived { background: #e67700; }
.nv-top.done { background: #2b8a3e; }
.nv-top.warn { background: #b45309; }
.nv-top.off { background: #c92a2a; animation: drive-blink 1s step-start infinite; }
.nv-turn { display: flex; align-items: center; gap: 14px; }
.nv-icon { width: 64px; height: 64px; flex: none; display: flex; align-items: center; justify-content: center; }
.nv-icon svg { width: 100%; height: 100%; display: block; }
.nv-main { flex: 1; min-width: 0; }
.nv-dist { font-size: 34px; font-weight: 900; line-height: 1.05; letter-spacing: -.5px; }
.nv-text { font-size: 20px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-bottom {
  pointer-events: auto;
  position: absolute; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
  background: #fff; border-radius: 16px; padding: 10px 12px 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.28);
}
.nv-bar { height: 6px; background: #e9ecef; border-radius: 3px; overflow: hidden; }
#nv-fill { height: 100%; width: 0; background: #2db400; transition: width .4s; }
.nv-row { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 8px; }
.nv-chip { flex: none; background: #1b2a4a; color: #fff; padding: 5px 10px; border-radius: 9px; font-size: 15px; font-weight: 900; white-space: nowrap; letter-spacing: .2px; }
.nv-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-idx { flex: none; font-size: 13px; font-weight: 700; color: #868e96; white-space: nowrap; }
/* 현황 행: 상태 알약(색 점) + 남은 거리, 그 아래 커버율 바 (사용자: 눈에 띄게·직관적으로, 이탈 m는 제외) */
.nv-state { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.nv-state-pill { display: inline-flex; align-items: center; gap: 9px; min-width: 0; padding: 8px 14px 8px 11px; border-radius: 12px; background: #f1f3f5; color: #343a40; }
.nv-state-pill i { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #adb5bd; }
.nv-state-pill b { font-size: 17px; font-weight: 900; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-state-pill.wait { background: #e7f0fb; color: #1864ab; }
.nv-state-pill.wait i { background: #1c7ed6; }
.nv-state-pill.run { background: #e6fcf0; color: #2b8a3e; }
.nv-state-pill.run i { background: #2db400; box-shadow: 0 0 0 4px rgba(45, 180, 0, .18); animation: nv-dot 1.6s ease-in-out infinite; }
.nv-state-pill.off { background: #fff0f0; color: #c92a2a; }
.nv-state-pill.off i { background: #e03131; animation: drive-blink 1s step-start infinite; }
.nv-state-pill.warn { background: #fff4e0; color: #b45309; }
.nv-state-pill.warn i { background: #f08c00; }
.nv-state-pill.done { background: #e6fcf0; color: #2b8a3e; }
.nv-state-pill.done i { background: #2b8a3e; }
.nv-state-pill.nogps { background: #f1f3f5; color: #495057; }
.nv-state-pill.nogps i { background: #868e96; animation: drive-blink 1s step-start infinite; }
/* 차량 PC 녹화 연동 배지 (Data Machine) — 커버율 줄 아래 한 줄 */
.nv-rec { display: flex; margin-top: 8px; padding: 6px 12px 6px 10px; }
.nv-rec[hidden] { display: none; }
.nv-rec b { font-size: 15px; }
.nv-state-pill.rec { background: #fff0f0; color: #c92a2a; }
.nv-state-pill.rec i { background: #e03131; animation: drive-blink 1.2s step-start infinite; }
@keyframes nv-dot { 0%, 100% { box-shadow: 0 0 0 4px rgba(45, 180, 0, .18); } 50% { box-shadow: 0 0 0 7px rgba(45, 180, 0, .08); } }
.nv-remain { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.nv-remain small { font-size: 11px; font-weight: 700; color: #868e96; white-space: nowrap; }
.nv-remain b { font-size: 24px; font-weight: 900; color: #1b2a4a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nv-covrow { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.nv-covrow small { flex: none; font-size: 12px; font-weight: 800; color: #868e96; }
.nv-covrow .nv-bar { flex: 1; height: 12px; border-radius: 6px; }
.nv-covrow b { flex: none; min-width: 54px; text-align: right; font-size: 22px; font-weight: 900; color: #2b8a3e; font-variant-numeric: tabular-nums; }
.nv-btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; border: 1px solid #dee2e6; background: #f8f9fa; color: #333; flex: none; display: flex; align-items: center; justify-content: center; }
.nv-btn svg { width: 22px; height: 22px; }
.nv-speed { pointer-events: none; position: absolute; left: var(--nv-left, 12px); top: var(--nv-under, 140px); width: 74px; height: 74px; border-radius: 50%; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.3); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.nv-speed b { font-size: 30px; font-weight: 900; color: #1b2a4a; font-variant-numeric: tabular-nums; }
.nv-speed span { font-size: 11px; color: #868e96; font-weight: 700; margin-top: 3px; }
/* 속도계·단속카메라 표지는 상단 배너 바로 아래 왼쪽 한 줄 (--nv-under/--nv-left 는 drive.js nvLayout이 배너 크기로 계산) */
/* 추적 해제 중 하단 중앙 '내 위치로' 알약 (bottom은 drive.js nvLayout이 하단 카드 높이로 계산) */
.nv-recenter {
  pointer-events: auto; position: absolute; left: 50%; transform: translateX(-50%); bottom: var(--nv-above-bottom, 150px); z-index: 1;
  display: flex; align-items: center; gap: 8px; padding: 11px 20px 11px 16px; border: 0; border-radius: 28px;
  background: #fff; color: #111; font-size: 16px; font-weight: 800; letter-spacing: -.2px; box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.nv-recenter svg { width: 22px; height: 22px; }
.nv-recenter[hidden] { display: none !important; }
.nv-recenter:active { transform: translateX(-50%) scale(.96); }
.nv-3d { font-size: 13px; font-weight: 800; letter-spacing: .3px; color: #868e96; }
.nv-3d.on { background: #1c7ed6; border-color: #1c7ed6; color: #fff; }
/* 루트 시트 */
.nv-sheet {
  pointer-events: auto; position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  max-width: 560px; margin: 0 auto; max-height: 80vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.3);
  padding: 8px 14px calc(14px + env(safe-area-inset-bottom));
}
.nv-sheet[hidden] { display: none !important; }
.nv-sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: #dee2e6; margin: 0 auto 8px; flex: none; }
.nv-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex: none; }
.nv-sheet-head b { font-size: 18px; white-space: nowrap; color: #1b2a4a; }
.nv-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; flex: none; }
.nv-act { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px 9px; border-radius: 14px; border: 1px solid #dee2e6; background: #f8f9fa; font-size: 14px; font-weight: 800; color: #1b2a4a; white-space: nowrap; }
.nv-act .ic { width: 30px; height: 30px; display: block; }
.nv-act .ic svg { width: 100%; height: 100%; display: block; }
.nv-act:disabled { opacity: .4; }
.nv-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; border-top: 1px solid #f1f3f5; -webkit-overflow-scrolling: touch; }
.nv-list li { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid #f1f3f5; cursor: pointer; }
.nv-list li:active { background: #f1f3f5; }
.nv-list li .no { flex: none; min-width: 48px; text-align: center; font-size: 14px; font-weight: 900; padding: 5px 6px; border-radius: 8px; background: #e9ecef; color: #495057; white-space: nowrap; }
.nv-list li.cur .no { background: #1c7ed6; color: #fff; }
.nv-list li .nm { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-list li .st { flex: none; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 8px; white-space: nowrap; background: #f1f3f5; color: #868e96; }
.nv-list li .st.done { background: #d3f9d8; color: #2b8a3e; }
.nv-list li .st.low { background: #fff3bf; color: #b45309; }
.nv-list li .st.cur { background: #1c7ed6; color: #fff; }
.nv-list li .st.run { background: #d9480f; color: #fff; }
.nv-sheet-foot { display: flex; gap: 8px; margin-top: 10px; flex: none; }
.nv-sheet-foot button { flex: 1; padding: 12px 8px; font-size: 14px; font-weight: 800; white-space: nowrap; border-radius: 12px; }
.nv-sheet-foot button.danger { flex: 0 0 auto; color: #c92a2a; border-color: #f5c2c2; }
/* 확인 다이얼로그 */
.nv-dialog { pointer-events: auto; position: absolute; inset: 0; z-index: 3; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.nv-dialog[hidden] { display: none !important; }
.nv-dialog-box { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 18px 16px 14px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.nv-dialog-text { font-size: 18px; font-weight: 800; color: #1b2a4a; line-height: 1.4; margin-bottom: 14px; }
.nv-dialog-text small { display: block; font-size: 14px; font-weight: 600; color: #666; margin-top: 4px; }
.nv-dialog-btns { display: flex; flex-direction: column; gap: 8px; }
.nv-dialog-btns button { padding: 14px; font-size: 16px; font-weight: 800; border-radius: 12px; white-space: nowrap; }
.nv-dialog-btns button.primary { background: #1c7ed6; border-color: #1c7ed6; color: #fff; }
.nv-dialog-btns button.warn { background: #fff3bf; border-color: #ffe08a; color: #7a4b00; }
.nv-dialog-btns button.ghost { background: #fff; color: #495057; }
@media (max-width: 768px) {
  .nv-icon { width: 68px; height: 68px; }
  .nv-dist { font-size: 38px; }
  .nv-bottom { bottom: calc(10px + env(safe-area-inset-bottom)); left: 8px; right: 8px; }
  .nv-top { left: 8px; right: 8px; }
}

/* 회전 안내 카드 (내비의 다음 회전) */
.drive-turn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
}
.drive-turn[hidden] { display: none !important; }
#drive-turn-icon { font-size: 40px; line-height: 1; }
#drive-turn-text { font-size: 22px; font-weight: 800; }
.drive-turn.now { background: #e8590c; }

/* 차량 방향 화살표 마커 */
.drive-car { width: 52px; height: 52px; filter: drop-shadow(0 2px 5px rgba(0,0,0,.35)); }
.drive-car svg { display: block; width: 100%; height: 100%; }

/* 내비 스타일 큰 상태 배너 */
.drive-big {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  color: #fff;
  background: #2b6cb0;
}
.drive-big small { display: block; font-size: 13px; font-weight: 600; opacity: .9; margin-top: 2px; }
.drive-big.to-start { background: #2b6cb0; }
.drive-big.running { background: #2f9e44; }
.drive-big.arrived { background: #f08c00; animation: drive-blink 1s step-start infinite; }
.drive-big.done { background: #1f6b34; }
.drive-big.off { background: #e03131; animation: drive-blink 1s step-start infinite; }
.drive-big.nogps { background: #868e96; }
.drive-label.grow { flex: 1; }
.drive-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 22px; }
.drive-head span { font-size: 12px; color: #888; }
.drive-name { font-size: 12px; color: #666; margin: 2px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drive-bar { height: 12px; background: #e6e8ec; border-radius: 6px; overflow: hidden; }
#drive-fill { height: 100%; width: 0; background: #2f9e44; border-radius: 6px; transition: width .4s; }
.drive-stats { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; margin: 6px 0 2px; }
#drive-dev.bad { color: #e03131; }
.drive-state { font-size: 12px; color: #2b6cb0; margin-bottom: 8px; }
.drive-alert {
  background: #e03131; color: #fff; font-weight: 700; padding: 10px 12px; border-radius: 8px; margin-bottom: 8px;
  animation: drive-blink 1s step-start infinite;
}
@keyframes drive-blink { 50% { opacity: .55; } }
.drive-result { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; line-height: 1.5; }
.drive-result.good { background: #e6f7ea; border: 1px solid #b7e2c2; color: #1f6b34; }
.drive-result.bad { background: #fff3cd; border: 1px solid #ffd43b; color: #7a5c00; }
#drive-done.pulse { animation: drive-blink 1s step-start infinite; }
.drive-pin {
  padding: 3px 8px; border-radius: 10px; color: #fff; font-size: 12px; font-weight: 800;
  border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.35); white-space: nowrap;
}
@media (max-width: 768px) {
  /* 취득 설정 = 하단 시트 (서랍은 닫고, 배경막 탭으로 닫기) */
  #drive-backdrop { display: block; position: fixed; inset: 0; z-index: 440; background: rgba(0, 0, 0, .35); }
  #drive-panel {
    left: 0; right: 0; bottom: 0; width: auto;
    border-radius: 18px 18px 0 0; max-height: 82vh; overflow-y: auto;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .3);
  }
  #drive-panel::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: #dee2e6; margin: 0 auto 12px; }
  #drive-panel h2 { font-size: 19px; }
  #drive-panel .box-head { margin-bottom: 12px; }
  .drive-label { font-size: 14px; margin-bottom: 10px; }
  #drive-panel select { font-size: 16px; padding: 11px 12px; margin-top: 4px; } /* iOS 자동 줌 방지 */
  .drive-check { font-size: 15px; margin: 6px 0 14px; gap: 10px; }
  .drive-check input { width: 22px; height: 22px; }
  #drive-start { font-size: 18px; padding: 13px; }
  #drive-cancel { font-size: 15px; padding: 13px 18px; }
  #drive-panel .hint { font-size: 13px; line-height: 1.5; }
  .drive-head { font-size: 26px; }
  .drive-stats { font-size: 16px; }
}

#toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 9px 16px;
  border-radius: 8px;
  background: rgba(30, 30, 30, .88);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: none; }
.toast.success { background: rgba(43, 138, 62, .92); }
.toast.error { background: rgba(190, 40, 40, .92); }

#modal-backdrop, #zone-backdrop, #runs-backdrop, #dl-backdrop, #inq-backdrop, #pw-backdrop, #hist-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#modal-backdrop[hidden], #zone-backdrop[hidden], #runs-backdrop[hidden], #dl-backdrop[hidden], #inq-backdrop[hidden], #pw-backdrop[hidden], #hist-backdrop[hidden] { display: none !important; }
.dl-modal, .inq-modal { width: 440px; max-width: calc(100vw - 32px); }
.dl-modal .box-head, .inq-modal .box-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dl-modal .box-head h2, .inq-modal .box-head h2 { font-size: 17px; margin: 0; }
.dl-modal .box-head button, .inq-modal .box-head button { flex: 0 0 auto; }
.dl-target { font-size: 13px; font-weight: 700; color: #1b2a4a; margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-sec { margin-bottom: 10px; }
.dl-label { font-size: 11px; font-weight: 700; color: #7a8699; letter-spacing: .04em; margin-bottom: 5px; }
.dl-opts { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.dl-opts label { display: flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.dl-opts label small { color: #888; font-size: 11px; }
#dl-desc { min-height: 34px; }
.inq-modal textarea { width: 100%; box-sizing: border-box; font-size: 14px; padding: 10px; border: 1.5px solid #ced4da; border-radius: 8px; resize: vertical; margin-bottom: 8px; }
.side-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.modal {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  width: 300px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}
.modal p { margin: 0 0 14px; line-height: 1.5; }
.modal button { flex: 1; }

/* 구역 관리 모달 */
#btn-zones { flex: 0 0 auto; }
.zone-modal { width: 400px; max-width: calc(100vw - 32px); }
.zone-modal .hint { margin: 8px 0 0; }
.zone-modal #zm-color { flex: 0 0 40px; width: 40px; padding: 2px; height: 34px; }
.zone-modal #zm-id { flex: 0 0 64px; width: 64px; }
.zone-modal #zm-name { flex: 1; }
.zone-modal #zm-submit, .zone-modal #zm-cancel { flex: 1; }
.zm-list { max-height: 46vh; overflow-y: auto; margin-bottom: 10px; }
.zm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid #f0f1f3;
  font-size: 13px;
}
.zm-row:last-child { border-bottom: none; }
.zm-test-l { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #555; white-space: nowrap; flex: 0 0 auto; }
.zm-tag { font-size: 10px; font-weight: 800; color: #7a4b00; background: #fff3bf; padding: 1px 6px; border-radius: 6px; margin-left: 6px; white-space: nowrap; }
/* 취득 관리 카드 */
.acq { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e3e4e8; }
.acq[hidden] { display: none !important; }
.acq .goal-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700; color: #333; margin-bottom: 6px; }
.acq-row { display: grid; grid-template-columns: 10px 1fr auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.acq-row:hover { background: #eef3fa; }
.acq-row .dot { width: 10px; height: 10px; border-radius: 50%; grid-row: 1 / span 2; }
.acq-nm { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acq-n { font-size: 12px; font-weight: 800; color: #1b2a4a; white-space: nowrap; }
.acq-n em { font-style: normal; color: #b45309; font-weight: 700; font-size: 11px; }
.acq-last { font-size: 10.5px; color: #888; white-space: nowrap; }
.acq-bar { grid-column: 2 / -1; height: 5px; margin-top: 3px; }
.zm-row.editing { background: #eef4fc; border-radius: 6px; }
.zm-row .dot { flex: 0 0 12px; width: 12px; height: 12px; border-radius: 50%; }
.zm-row b { flex: 0 0 34px; }
.zm-row .zm-nm { flex: 1; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zm-row small { color: #999; }
.zm-row button { flex: none; padding: 2px 7px; font-size: 12px; line-height: 1.4; }

.goal { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e3e4e8; }
.goal .goal-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #444;
  margin-bottom: 5px;
}
.goal-bar { height: 8px; background: #e6e8ec; border-radius: 4px; overflow: hidden; }
.goal-fill { height: 100%; background: #2b6cb0; border-radius: 4px; transition: width .3s; }
.goal-fill.done { background: #2f9e44; }
.goal-fill.acq { background: #f08c00; }
.run-badge {
  display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 9px; vertical-align: 1px;
  font-size: 11px; font-weight: 800; background: #d3f9d8; color: #2b8a3e; cursor: pointer; white-space: nowrap;
}
.run-badge.low { background: #fff3bf; color: #b45309; }
.run-badge.none { display: none; background: #f1f3f5; color: #868e96; cursor: default; }
.run-badge:hover { filter: brightness(.94); }
/* 취득 기록 모달 */
.runs-modal { width: 460px; max-width: calc(100vw - 32px); }
.runs-modal .box-head h2 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 8px; }
.runs-list { max-height: 56vh; overflow-y: auto; }
.run-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid #eee; }
.run-row .when { grid-column: 1; font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-row .cov { grid-column: 2; grid-row: 1 / span 2; font-size: 22px; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
.run-row .cov.good { color: #2b8a3e; }
.run-row .cov.low { color: #e67700; }
.run-row .cov.ab { color: #868e96; font-size: 14px; }
.run-row .meta { grid-column: 1; font-size: 12px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-row .acts { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 4px; }
.run-row .acts button { flex: 0 0 auto; padding: 4px 10px; font-size: 12px; }
.run-row .acts button[data-act="del"] { color: #c92a2a; margin-left: auto; }
/* 지도 위 궤적 표시 칩 */
#track-chip {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 35;
  background: #5f3dc4; color: #fff; padding: 6px 6px 6px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 700; display: flex; gap: 6px; align-items: center; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,.3); max-width: calc(100% - 120px);
}
#track-chip[hidden] { display: none !important; }
#track-chip span { overflow: hidden; text-overflow: ellipsis; }
#track-chip button { background: transparent; border: 0; color: #fff; padding: 0 6px; font-size: 14px; }
.goal .goal-sub { font-size: 11px; color: #888; margin-top: 5px; line-height: 1.5; }

.zone-legend {
  background: rgba(255, 255, 255, .95);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}
.zone-legend[hidden] { display: none !important; }
.lg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  user-select: none;
}
.lg-item:hover { background: #e7effa; }
.lg-item.active { background: #dbe7f7; box-shadow: inset 0 0 0 1px #9db8dd; }
.lg-item .dot {
  flex: 0 0 12px;
  width: 12px; height: 12px;
  border-radius: 50%;
}
.lg-item small { margin-left: auto; color: #999; font-weight: 400; }
.lg-item .lg-id { font-weight: 800; margin-right: -3px; }

.zone-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  cursor: pointer;
  transition: transform .12s;
}
.zone-badge:hover { transform: scale(1.25); }

.route-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
  cursor: pointer;
  transition: transform .12s;
  box-sizing: border-box;
}
.route-badge:hover { transform: scale(1.3); }

.dir-arrow {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}

.naver-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #03c75a; /* 네이버 그린 */
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
  vertical-align: -3px;
}

#menu-fab { display: none; }

#map-side {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end; /* 버튼은 내용 크기만큼, 오른쪽 정렬 */
}
.map-btns { display: flex; gap: 8px; }

#maptype-btn {
  padding: 7px 11px;
  background: rgba(255, 255, 255, .95);
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  font-size: 12px;
  font-weight: 700;
  color: #333;
}
#maptype-btn:hover { background: #f0f1f3; }

/* ---------- 모바일 (768px 이하): 지도 풀스크린 + 서랍 사이드바 + 하단 시트 편집 ---------- */
@media (max-width: 768px) {
  #resizer { display: none; }

  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 340px);
    z-index: 500;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, .25);
  }
  #sidebar.open { transform: none; }
  .route-list { max-height: none; }

  #editor-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    max-height: 58vh;
    z-index: 400;
    border-right: none;
    border-top: 1px solid #ccc;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .2);
  }

  #drive-fab { right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  #menu-fab {
    display: flex;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 300;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: none;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  }

  .zone-legend { padding: 6px; min-width: 96px; }
  .lg-item { padding: 4px 8px; font-size: 12px; }

  button { padding: 10px 12px; } /* 터치 타깃 확대 */
  .point-list .ctl button, .route-list .ctl button { padding: 6px 8px; }
  .route-list .ctl, .point-list .pt-ctl { opacity: 1; } /* 호버가 없으니 항상 표시 */
  /* 모바일: 행이 좁아 이름·배지가 잘리므로 취득 상태 배지를 이름 아래 한 줄로(미취득도 표시), 네이버/다운로드 버튼은 편집 패널로 */
  .route-list .title .run-badge { display: block; width: fit-content; margin: 3px 0 1px; }
  .route-list .title .run-badge.none { display: block; }
  .route-list .ctl [data-act="navi"], .route-list .ctl [data-act="wp"] { display: none; }
  .route-list .drag-handle, .point-list .drag-handle { touch-action: none; padding: 6px 10px 6px 4px; font-size: 20px; } /* 터치 드래그 (enableTouchDrag) */
  /* 모바일은 항상 보이므로 겹치지 않게 다시 인라인 배치 */
  .route-list .ctl {
    position: static;
    padding: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: auto;
  }
}

/* 마커 요소의 박스 = 점 크기만. 라벨은 absolute라 앵커(0.5,0.5)가 점 중심에 정확히 걸린다
   (라벨을 레이아웃에 포함하면 점이 좌표보다 위로 떠서 축소 시 밀려나 보임) */
.gps-marker {
  position: relative;
  width: 16px;
  height: 16px;
  pointer-events: none;
  --c: #1c7ed6; /* 기기별 색 (JS에서 지정) */
}
.gps-dot {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--c);
  border: 3px solid #fff;
  box-sizing: border-box;
  animation: gps-pulse 1.6s ease-out infinite;
}
@keyframes gps-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 45%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; }
}
.gps-marker.following {
  width: 22px;
  height: 22px;
}
.gps-marker.following .gps-dot { border-width: 4px; }
.gps-name {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 9px;
  background: var(--c);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.gps-marker.stale .gps-dot { background: #adb5bd; animation: none; }
.gps-marker.stale .gps-name { background: rgba(134, 142, 150, .9); }

/* 실시간 위치 카드: 접속 중인 사람 목록, 탭하면 따라가기 */
.live-panel {
  background: rgba(255, 255, 255, .95);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
  padding: 8px;
  min-width: 150px;
}
.live-panel[hidden] { display: none !important; }
.live-panel .lp-help { float: right; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%; background: #1c7ed6; color: #fff; font-weight: 800; font-size: 12px; text-decoration: none; }
.live-panel .lp-head {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  padding: 0 6px 5px;
  letter-spacing: .03em;
}
.lp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  user-select: none;
}
.lp-item:hover { background: #eef3fa; }
.lp-item.active { background: #dbe7f7; box-shadow: inset 0 0 0 1.5px #2b6cb0; }
.lp-item .dot { flex: 0 0 11px; width: 11px; height: 11px; border-radius: 50%; }
.lp-item .nm { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lp-item small { color: #999; font-weight: 500; white-space: nowrap; }
.lp-item.active small { color: #2b6cb0; font-weight: 700; }
.lp-item.stale { color: #999; }
.lp-item .lp-del {
  padding: 1px 5px;
  font-size: 11px;
  border: none;
  background: transparent;
  color: #aaa;
  border-radius: 5px;
  opacity: 0;
  transition: opacity .12s;
}
.lp-item:hover .lp-del { opacity: 1; }
.lp-item .lp-del:hover { color: #e03131; background: #fdeaea; }
@media (max-width: 768px) {
  .lp-item .lp-del { opacity: 1; }
}

.pt-label {
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(30, 30, 30, .82);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- 기상 레이더(강수) 오버레이 (radar.js) ---------- */
/* (radar-canvas: 예전 캔버스 방식 잔재 — 타일셋 방식으로 교체돼 미사용) */
#radar-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 11px;
  background: rgba(255, 255, 255, .95); border: none; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2); font-size: 12px; font-weight: 700; color: #333;
}
#radar-btn svg { width: 16px; height: 16px; }
#radar-btn:hover { background: #f0f1f3; }
#radar-btn.on { background: #1c7ed6; color: #fff; }
#radar-btn.on:hover { background: #1971c2; }
#radar-panel { /* 지도 하단 중앙, 양옆 170px은 FAB 자리로 비움 */
  position: absolute; z-index: 36; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: min(440px, calc(100% - 340px));
  background: rgba(255, 255, 255, .96); border-radius: 12px; padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .22); font-size: 12px; color: #333;
}
#radar-panel[hidden], body.mode-drive #radar-panel, body.mode-edit #radar-panel { display: none !important; }
.rp-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rp-foot { margin-top: 6px; justify-content: space-between; }
.rp-play {
  flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  background: #1b2a4a; color: #fff; display: flex; align-items: center; justify-content: center;
}
.rp-play svg { width: 16px; height: 16px; }
.rp-play .rp-ic-pause, .rp-play.on .rp-ic-play { display: none; }
.rp-play.on .rp-ic-pause { display: block; }
#radar-slider {
  flex: 1; min-width: 0; height: 22px; margin: 0; -webkit-appearance: none; appearance: none; background: transparent;
  --rp-now: 100%;
}
#radar-slider::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #1c7ed6 0 var(--rp-now), #ced4da var(--rp-now) 100%);
}
#radar-slider::-moz-range-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #1c7ed6 0 var(--rp-now), #ced4da var(--rp-now) 100%);
}
#radar-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 2px solid #1c7ed6; box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
#radar-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #1c7ed6; }
#radar-time { flex: none; min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: #1b2a4a; }
#radar-time.nowcast { color: #e8590c; font-size: 11px; }
.rp-close { flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #868e96; font-size: 13px; }
.rp-close:hover { background: #f1f3f5; color: #333; }
.rp-legend { display: flex; align-items: center; gap: 5px; color: #868e96; font-size: 11px; font-weight: 700; }
.rp-legend i {
  display: block; width: 92px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #a8dcff, #4fa3f5, #1b64d1, #0b2f8a, #6a1fb0, #c9188c, #ff2e2e, #ffb300);
}
.rp-upd { color: #868e96; font-size: 11px; white-space: nowrap; }
/* 하단 행 현재 날씨 아이콘(자체 SVG, 채움형). 버튼처럼 보이지 않게 테두리·배경 제거, 레이더 켜짐은 작은 파란 점 */
.nv-radar { position: relative; border: 0; background: transparent; box-shadow: none; width: 44px; }
.nv-radar:hover { background: transparent; }
.nv-radar svg { width: 36px; height: 36px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.12)); }
.nv-radar.on { background: transparent; border: 0; }
.nv-radar.on::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 9px; height: 9px; border-radius: 50%; background: #1c7ed6; box-shadow: 0 0 0 2px #fff; }

/* ---------- 현재 날씨 줄 (취득 관리 카드 / 취득 시트) ---------- */
.acq-wx { font-size: 12px; color: #444; padding: 5px 6px 6px; margin: 0 0 4px; border-radius: 6px; background: #f1f5fb; line-height: 1.5; }
.acq-wx b { color: #1b2a4a; }
.acq-wx .wx-nm { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; background: #1b2a4a; color: #fff; font-size: 10.5px; font-weight: 800; line-height: 16px; vertical-align: 1px; }
.acq-wx small { display: block; margin-top: 1px; font-size: 10.5px; color: #888; }
.acq-wx.rain { background: #fff0f0; }
.acq-wx.rain b { color: #c92a2a; }
.acq-wx.off { color: #888; background: #f5f5f5; }
.run-row.rain .meta { color: #c92a2a; }

/* ---------- 모바일: 지도 우상단 범례는 칩(점+구역 ID)으로, 레이더 슬라이더는 취득 시작 버튼 위 ---------- */
@media (max-width: 768px) {
  .zone-legend { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 4px; padding: 6px; min-width: 0; max-width: min(64vw, 300px); }
  .lg-item { padding: 5px 8px; gap: 5px; font-size: 12px; border-radius: 14px; background: #f1f3f5; }
  .lg-item .lg-nm, .lg-item small { display: none; }
  .lg-item .lg-id { margin-right: 0; }
  .lg-item .dot { flex-basis: 10px; width: 10px; height: 10px; }
  #radar-btn, #maptype-btn { padding: 8px 11px; }
  #radar-panel {
    left: 12px; right: 12px; transform: none; width: auto;
    bottom: calc(86px + env(safe-area-inset-bottom));
  }
}
.rp-nowcast { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #555; white-space: nowrap; cursor: pointer; }
.rp-nowcast input { margin: 0; width: 13px; height: 13px; }

/* ---------- 취득 모드 단속카메라 안내: 상단 배너 아래 오른쪽, 도로 제한속도 표지판 모양(흰 바탕·굵은 빨간 테두리·검정 숫자) ---------- */
.nv-cam { pointer-events: none; position: absolute; right: var(--nv-right, 12px); top: var(--nv-under, 140px); display: flex; flex-direction: column; align-items: center; gap: 5px; z-index: 3; }
.nv-cam[hidden] { display: none !important; }
.nv-cam-sign {
  width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 9px solid #d7262b;
  box-shadow: 0 4px 16px rgba(0,0,0,.3), inset 0 0 0 2px #fff; display: flex; align-items: center; justify-content: center;
}
.nv-cam-sign b { font-size: 27px; font-weight: 900; color: #111; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.5px; }
.nv-cam-sign.nolimit b { font-size: 0; }
.nv-cam-sign.nolimit::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #d7262b; }
.nv-cam-txt { display: flex; flex-direction: column; align-items: center; background: rgba(255,255,255,.95); border-radius: 10px; padding: 3px 9px 4px; box-shadow: 0 2px 8px rgba(0,0,0,.25); line-height: 1.15; }
.nv-cam-txt b { font-size: 15px; font-weight: 900; color: #1b2a4a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nv-cam-txt small { display: flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: #868e96; white-space: nowrap; }
.nv-cam-ic { width: 12px; height: 12px; flex: none; }
/* 제한속도 초과: 표지판은 그대로(표준 모양 유지), 살짝 커졌다 작아지는 맥동 + 거리 글자 빨강. 화면 붉은 번짐·효과음은 별도 */
.nv-cam.over .nv-cam-sign { animation: nv-cam-pulse 1.1s ease-in-out infinite; }
.nv-cam.over .nv-cam-txt b { color: #d7262b; }
@keyframes nv-cam-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.gl-cam { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid #e03131; color: #1b2a4a; font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-variant-numeric: tabular-nums; }
.gl-cam.signal { border-color: #f08c00; }
.gl-cam.nolimit { font-size: 0; }
.gl-cam.nolimit::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e03131; }
/* 제한속도 초과: 화면 가장자리에서 안쪽으로 투명하게 번지는 붉은 그라데이션이 부드럽게 맥동 (선 테두리 아님) */
.nv-flash {
  pointer-events: none; position: absolute; inset: 0; z-index: -1; /* 카드·표지 아래, 지도 위 */
  background:
    linear-gradient(to right, rgba(224, 49, 49, .62), rgba(224, 49, 49, 0) 22%),
    linear-gradient(to left, rgba(224, 49, 49, .62), rgba(224, 49, 49, 0) 22%),
    linear-gradient(to bottom, rgba(224, 49, 49, .62), rgba(224, 49, 49, 0) 22%),
    linear-gradient(to top, rgba(224, 49, 49, .62), rgba(224, 49, 49, 0) 22%);
  animation: nv-flash 1.1s ease-in-out infinite;
}
.nv-flash[hidden] { display: none !important; }
@keyframes nv-flash { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

/* ---------- 다음-다음 안내 미니 카드: 상단 배너 왼쪽 아래에 매달림 (네이버지도식 "↱ 153 m") ---------- */
.nv-next {
  position: absolute; left: 0; top: 100%; display: flex; align-items: center; gap: 8px;
  padding: 7px 16px 8px 12px; background: inherit; color: #fff; border-radius: 0 0 16px 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
}
.nv-next[hidden] { display: none !important; }
.nv-next-icon { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; }
.nv-next-icon svg { width: 100%; height: 100%; display: block; }
.nv-next b { font-size: 22px; font-weight: 900; letter-spacing: -.3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nv-top.has-next { border-bottom-left-radius: 0; }

/* 모달 헤더의 닫기 버튼이 남는 폭을 다 먹지 않게 */
.modal .box-head button { flex: none; }

/* ---------- 내 위치 (메인 지도) ---------- */
#loc-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 11px;
  background: rgba(255, 255, 255, .95); border: none; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2); font-size: 12px; font-weight: 700; color: #333;
}
#loc-btn svg { width: 16px; height: 16px; }
#loc-btn:hover { background: #f0f1f3; }
#loc-btn.on { background: #1c7ed6; color: #fff; }        /* 따라가는 중 */
#loc-btn.on:hover { background: #1971c2; }
#loc-btn.no { color: #adb5bd; }                          /* 위치를 못 받는 중 */
.me-marker { position: relative; width: 18px; height: 18px; pointer-events: none; }
.me-marker::before {                                      /* 부드러운 맥동 후광 */
  content: ""; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%; background: rgba(28, 126, 214, .22); animation: me-pulse 2.4s ease-out infinite;
}
@keyframes me-pulse { 0% { transform: scale(.45); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.me-dot {
  position: absolute; inset: 0; border-radius: 50%; background: #1c7ed6; border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15), 0 2px 6px rgba(0, 0, 0, .35);
}
.me-head { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; display: none; transform: rotate(var(--hd, 0deg)); }
.me-marker.has-head .me-head { display: block; }
.me-head::before {
  content: ""; position: absolute; left: 50%; top: -7px; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid #1c7ed6;
  filter: drop-shadow(0 -1px 0 #fff) drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff);
}

/* ---------- 루트 변경 이력 모달 (관리자, 2026-09-23) ---------- */
#hist-filter { width: 100%; margin: 6px 0 4px; }
.hist-list { max-height: 56vh; overflow-y: auto; }
.hist-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid #eee; }
.hist-row .act {
  grid-column: 1; grid-row: 1 / span 2; align-self: center; font-size: 11px; font-weight: 800;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap; background: #e7f5ff; color: #1864ab;
}
.hist-row .act.dl { background: #ffe3e3; color: #c92a2a; }
.hist-row .act.rs { background: #fff3bf; color: #e67700; }
.hist-row .when { grid-column: 2; font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-row .meta { grid-column: 2; font-size: 12px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-row .acts { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 6px; }
.hist-row .acts button { flex: 0 0 auto; padding: 4px 10px; font-size: 12px; }
.hist-row .acts button.danger { color: #c92a2a; margin-left: auto; }

/* 차량 PC 녹화(DM bag) 배지 — 루트 목록 (Data Machine) */
.rec-badge { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px; font-size: 11px; font-weight: 700;
  background: #fff0f0; color: #c92a2a; white-space: nowrap; }
.rec-badge.none { background: #fff4e0; color: #b45309; }
.acq-n em.rec { color: #c92a2a; font-style: normal; }
