@font-face { font-family: "Noto Sans Khmer"; font-weight: 400; font-display: swap; src: url(../vendor/fonts/NotoSansKhmer-400.woff2) format("woff2"); }
@font-face { font-family: "Noto Sans Khmer"; font-weight: 700; font-display: swap; src: url(../vendor/fonts/NotoSansKhmer-700.woff2) format("woff2"); }

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5b6676;
  --line: #d9dee6;
  --primary: #1d4ed8;
  --primary-text: #ffffff;
  --mv: #d62828;
  --lv: #1f6feb;
  --switch: #7c3aed;
  --memo: #0f8a7e;
  --area: #e8730c;
  --danger: #b42318;
  --warn-bg: #fff4d6;
  --net: #6d28d9;
  --tab-h: 60px;
  --top-h: 56px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Khmer", "Noto Sans KR", sans-serif; }
body.km { font-family: "Noto Sans Khmer", system-ui, sans-serif; line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.ic { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--danger); min-height: 1.2em; margin: 4px 0; }
.warn { background: var(--warn-bg); border: 1px solid #f1c96b; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }

.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn.danger { color: var(--danger); }
.btn.big { width: 100%; min-height: 48px; font-weight: 600; }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; color: var(--primary); padding: 8px; min-height: 44px; cursor: pointer; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
label { display: block; margin: 10px 0; font-size: 15px; color: var(--muted); }
input, select, textarea { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); margin-top: 4px; }
label input { color: var(--text); }

/* 로그인 */
.screen { min-height: 100%; }
#login, #mustChange { display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 4px; }
.login-card h1 { margin: 4px 0 8px; font-size: 22px; text-align: center; }
.login-card .logo { width: 64px; height: 64px; margin: 0 auto; }
.login-card .btn { margin-top: 6px; }
.lang-row { text-align: center; color: var(--muted); }
.install-box { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.install-box .btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.install-help ol { margin: 10px 0 0; padding-left: 22px; line-height: 1.6; font-size: 15px; }
.install-help .ic { width: 18px; height: 18px; vertical-align: -3px; color: var(--primary); }

/* 앱 */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#netBar { background: var(--net); color: #fff; padding: 6px 12px; font-size: 14px; text-align: center; }
#top { height: var(--top-h); padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: relative; z-index: 1100; padding-top: max(6px, env(safe-area-inset-top)); height: auto; }
.search { display: flex; gap: 6px; }
.search select { width: auto; flex: none; margin: 0; }
.search input { margin: 0; min-width: 0; }
.dropdown { position: absolute; left: 8px; right: 8px; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; max-height: 50vh; overflow: auto;
  box-shadow: 0 6px 24px rgba(0,0,0,.15); }
.dropdown li button { width: 100%; text-align: left; background: none; border: 0; padding: 10px; min-height: 44px; cursor: pointer;
  border-radius: 8px; display: flex; flex-direction: column; }
.dropdown li button:hover { background: var(--bg); }
.dropdown .sub { font-size: 13px; color: var(--muted); }

main { flex: 1; position: relative; overflow: hidden; }
.view { position: absolute; inset: 0; overflow: auto; display: none; }
.view.active { display: block; }
#view-map.active { overflow: hidden; }
#map { position: absolute; inset: 0; background: #e5e9ef; }
.pad { padding: 16px; max-width: 760px; margin: 0 auto; }
.pad h2 { margin: 4px 0 12px; font-size: 20px; }
.row { display: flex; gap: 8px; }
.row > * { margin: 0; }
.row select { width: auto; }

#tabs { height: var(--tab-h); display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); height: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
#tabs button { flex: 1; background: none; border: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); cursor: pointer; min-height: 44px; }
#tabs button.active { color: var(--primary); font-weight: 600; }

/* 지도 버튼 */
.fab { position: absolute; z-index: 1000; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); color: var(--text); }
.fab-tr { top: 10px; right: 10px; }
.fab-br { bottom: 24px; right: 10px; }
.fab.on { color: var(--primary); }
.panel { position: absolute; z-index: 1001; top: 60px; right: 10px; width: min(300px, calc(100% - 20px)); max-height: calc(100% - 80px);
  overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.panel h3 { font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
.radio-list label, .check-list label { display: flex; align-items: center; gap: 10px; margin: 0; min-height: 44px; color: var(--text); }
.radio-list input, .check-list input { width: 20px; min-height: 20px; height: 20px; margin: 0; }
.legend div { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 14px; }
.legend .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #888; }
.legend .dot.mv { background: var(--mv); }
.legend .dot.lv { background: var(--lv); }
.legend .dot.other { background: transparent; border-color: #888; }
.legend .line { width: 22px; height: 3px; }
.legend .line.mv { background: var(--mv); }
.legend .line.lv { background: var(--lv); }
.legend .tr, .tr-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center;
  background: #fff; border: 2px solid #333; font: 700 10px/1 system-ui, sans-serif; color: #333; }
.tr-label, .pole-label { background: none; border: 0; box-shadow: none; font: 600 11px/1.1 system-ui, sans-serif; color: #111;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; white-space: nowrap; }
.tr-label { color: #333; font-weight: 700; }

/* 전주 카드 (아래에서 올라오는 창) */
.sheet { position: absolute; z-index: 1002; left: 8px; right: 8px; bottom: 8px; max-height: 60%; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 -4px 24px rgba(0,0,0,.18); }
@media (min-width: 720px) { .sheet { left: auto; width: 380px; top: 64px; bottom: auto; max-height: calc(100% - 80px); } }
.plate { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.plate .no { font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.plate .badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; color: #fff; }
.badge.MV { background: var(--mv); }
.badge.LV { background: var(--lv); }
.plate .close { margin-left: auto; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; }
.sheet .body { padding: 8px 14px 14px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.sheet h4 { margin: 14px 0 6px; font-size: 14px; color: var(--muted); }
.span-row { display: flex; gap: 8px; align-items: center; min-height: 36px; font-size: 15px; }
.span-row .v { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.span-row .v.MV { background: var(--mv); }
.span-row .v.LV { background: var(--lv); }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 6px 0; font-size: 15px; text-align: left; }

/* 목록 카드 */
.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cards li button { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; min-height: 52px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.cards .t { font-weight: 600; }
.cards .s { font-size: 13px; color: var(--muted); }

/* 더보기 */
.me-card { margin-bottom: 10px; }
.me-name { font-size: 18px; font-weight: 700; }
.menu { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.menu li + li { border-top: 1px solid var(--line); }
.menu button { width: 100%; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0 16px;
  min-height: 52px; cursor: pointer; text-align: left; }
.back { background: none; border: 0; display: inline-flex; align-items: center; gap: 4px; color: var(--primary);
  min-height: 44px; padding: 0; cursor: pointer; margin-bottom: 6px; }
table.tbl { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 15px; }
.tbl th, .tbl td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.user-row { display: flex; flex-direction: column; gap: 2px; }
.user-row .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.user-row .acts .btn { min-height: 40px; padding: 0 10px; font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.tag { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.tag.off { color: var(--danger); }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px); transform: translateX(-50%); z-index: 3000;
  background: #1b2430; color: #fff; padding: 10px 16px; border-radius: 10px; max-width: calc(100% - 32px); font-size: 15px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #12161c; --surface: #1b2129; --text: #e7ecf2; --muted: #9aa5b4; --line: #2c3440;
    --warn-bg: #3a2f12; }
}

/* 수정 (2단계) */
.fab-bl { bottom: 96px; left: 10px; }
.panel-bl { top: auto; right: auto; bottom: 146px; left: 10px; width: min(260px, calc(100% - 20px)); padding: 6px; }
.menu-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0;
  background: none; color: var(--text); font: inherit; font-size: 16px; text-align: left; cursor: pointer; border-radius: 8px; }
.menu-btn:hover { background: var(--bg); }
.menu-btn.danger { color: var(--danger); }
.pole-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.pole-acts .btn { min-height: 40px; padding: 0 12px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.pole-acts .ic { width: 16px; height: 16px; }
.span-row.click { cursor: pointer; }
.span-row .edit-ic { margin-left: auto; color: var(--muted); }
.edit-form label { display: block; margin: 8px 0; }
.edit-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.edit-form .btns { display: flex; gap: 8px; margin-top: 12px; }
.edit-form .btns .btn { flex: 1; }
.edit-bar { position: absolute; z-index: 1003; top: 10px; left: 10px; right: 64px; background: #111827; color: #fff;
  border-radius: 12px; padding: 8px 10px 8px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); font-size: 15px; }
.edit-bar .acts { margin-left: auto; display: flex; gap: 6px; }
.edit-bar .btn { min-height: 38px; padding: 0 12px; font-size: 14px; }
.picking #map { cursor: crosshair; }

/* 계량기함·개폐기·사진 (assets.js) */
.span-row.sub { padding-left: 16px; font-size: 14px; min-height: 30px; }
.sw-ic { width: 22px; height: 22px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; background: #16a34a; flex: none; }
.sw-ic.open { background: #fff; color: #dc2626; border: 2px solid #dc2626; }
.edit-form label.inline, label.inline { display: flex; gap: 8px; align-items: center; color: var(--text); }
label.inline input { width: auto; min-height: 0; }
.photo-strip { display: flex; gap: 8px; overflow-x: auto; margin: 8px 0; padding-bottom: 4px; }
.thumb { flex: none; width: 96px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  overflow: hidden; cursor: pointer; font: inherit; }
.thumb img { display: block; width: 96px; height: 72px; object-fit: cover; }
.thumb span { display: block; font-size: 12px; padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.edit-form .photo-slot, .photo-slot { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 0 12px; margin: 6px 0;
  border: 1px solid var(--line); border-radius: 10px; color: var(--text); cursor: pointer; background: var(--surface); }
.photo-slot span:nth-of-type(2) { margin-left: auto; }
.photo-view { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.9); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 16px; gap: 10px; }
.photo-view img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 6px; }
.photo-view .cap { color: #fff; font-size: 14px; text-align: center; }
.photo-view .acts { display: flex; gap: 8px; }

/* 위치 메모 (memos.js) */
.fab-br2 { bottom: 76px; right: 10px; color: #0f8a7e; }
.memo-pin { width: 24px; height: 24px; border-radius: 5px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4);
  color: #fff; font: 700 15px/20px system-ui, sans-serif; text-align: center; position: relative; }
.memo-pin.peek { opacity: .5; }
.memo-pin i { position: absolute; top: -8px; right: -9px; background: #111827; color: #fff; font: 600 10px/14px system-ui, sans-serif;
  min-width: 14px; padding: 0 3px; border-radius: 7px; font-style: normal; }
#tabs button { position: relative; }
.tab-badge { position: absolute; top: 4px; left: calc(50% + 6px); background: #0f8a7e; color: #fff; font-size: 11px;
  line-height: 16px; min-width: 16px; padding: 0 4px; border-radius: 8px; }
.mbadge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; margin-right: 6px; vertical-align: middle; }
.mbadge.open { background: #0f8a7e; color: #fff; }
.mbadge.done { background: #e5e7eb; color: #4b5563; }
.mbadge.hid { background: #fff7ed; color: #9a3412; }
.memo-sheet { position: fixed; inset: 0; z-index: 2500; background: var(--bg); overflow: auto; }
.memo-sheet h2 { font-size: 20px; margin: 4px 0 6px; }
.memo-body { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0;
  white-space: normal; word-break: break-word; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.btn-row .ic { width: 18px; height: 18px; margin-right: 4px; }
.reply { border-top: 1px solid var(--line); padding: 8px 0; }
.reply .link { min-height: 0; padding: 0 6px; }
.link.danger { color: var(--danger); }
.reply-form { margin-top: 12px; border-top: 1px solid var(--line); }
.mp-pick { display: flex; gap: 8px; margin: 8px 0; }
.mp-pick .btn { display: inline-flex; align-items: center; gap: 6px; color: var(--text); margin: 0; }
.mp-prev { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-th { position: relative; }
.mp-th img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
.mp-th button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: #111827; color: #fff; padding: 0; display: flex; align-items: center; justify-content: center; }
.mp-th button .ic { width: 14px; height: 14px; }
.memo-card { display: flex !important; gap: 10px; align-items: flex-start; }
.memo-card img, .mc-noimg { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: #e6f4f2;
  display: flex; align-items: center; justify-content: center; color: #0f8a7e; }
.mc-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mc-body { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#view-memo .row select { flex: 1; width: auto; }
#mFQuery { margin: 8px 0; }

/* 목록·선로 (lists.js) */
.list-kind { margin-bottom: 8px; font-weight: 600; }
.cards li button { display: flex; gap: 10px; align-items: center; }
.vb { flex: none; font-size: 12px; padding: 2px 8px; border-radius: 99px; color: #fff; }
.vb.MV { background: var(--mv); }
.vb.LV { background: var(--lv); }
.lc { display: flex; flex-direction: column; min-width: 0; }
.lc .s { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.chip { margin-left: auto; flex: none; font-size: 12px; border: 1px solid var(--line); background: #fefce8; color: #854d0e;
  border-radius: 99px; padding: 2px 8px; cursor: pointer; max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.span-row .chip + .edit-ic { margin-left: 4px; }
.big { width: 100%; justify-content: flex-start; gap: 8px; display: flex; align-items: center; }
.plate .vb { margin-right: 4px; }
.span-row .link-btn { white-space: nowrap; }

/* 가져오기 (imports.js) */
details.imp { margin: 10px 0; }
details.imp > summary { font-weight: 600; min-height: 32px; cursor: pointer; }
.radio-row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 14px; color: var(--muted); margin: 6px 0; }
.radio-row label.inline { margin: 0; }
.imp-out ul { padding-left: 18px; margin: 4px 0; }

/* 범위 도구 (range.js) */
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 8px 0; }
.seg button { flex: 1; min-height: 40px; border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--primary); color: #fff; }
.rng label { display: block; margin: 8px 0; }
.rng label.inline { display: flex; gap: 8px; align-items: center; }
.rng label.inline input { width: auto; }
.rng-sum { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 14px; line-height: 1.5; }
.rng-tbl { max-height: 260px; overflow: auto; margin: 6px 0; }
.rng-tbl .tbl { font-size: 13px; }
.rng-tbl .tbl th, .rng-tbl .tbl td { padding: 5px 6px; }
.rng-tbl tr.bad td { color: var(--danger); }
.rng-tbl tr[data-al] { cursor: pointer; }
.warn-t { color: #b45309; }
.rn-label { background: #fff; border: 1px solid #7b1fa2; color: #4a148c; border-radius: 6px; padding: 1px 5px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.rn-label.bad { border-color: var(--danger); color: var(--danger); }
.gm-handle { width: 44px; height: 44px; border-radius: 50%; background: #1565c0; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.35); border: 3px solid #fff; cursor: grab; }
.gm-handle .ic { width: 24px; height: 24px; }
.edit-bar.gm .acts { flex-wrap: wrap; }
.edit-bar .btn:not(.primary) { color: #111827; }
.edit-bar .btn:disabled { opacity: .45; }

/* ── 현장 확인·승인 (7단계) ── */
.field-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: var(--bg); }
.vs-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vs-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.warn-chip { background: var(--warn-bg); border: 1px solid #f1c96b; border-radius: 999px; padding: 2px 8px; font-size: 13px; }
.field-row .warn { margin: 6px 0; padding: 6px 10px; }
.pend .link-btn { color: #9a3412; text-align: left; }
.fw-steps { display: flex; list-style: none; padding: 0; margin: 0 0 10px; gap: 4px; }
.fw-steps li { flex: 1; text-align: center; font-size: 13px; padding: 4px 0; border-bottom: 3px solid var(--line); color: var(--muted); }
.fw-steps li.on { border-color: var(--primary); color: var(--text); font-weight: 600; }
.gps-box { background: var(--bg); border-radius: 12px; padding: 14px; text-align: center; font-size: 18px; }
.fw-acts { margin-top: 12px; justify-content: flex-end; }
.fw-acts .btn { flex: 1 1 auto; }
ul.plain { list-style: none; padding: 0; margin: 6px 0; }
ul.plain li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.cand { list-style: none; padding: 0; margin: 0 0 8px; }
.cand-btn { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px; margin-bottom: 6px; font: inherit; color: var(--text); cursor: pointer; min-height: 64px; }
.cand-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cand-txt > span:first-child { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sketch { flex: none; background: var(--bg); border-radius: 8px; }
.line-q { border-bottom: 1px solid var(--line); padding: 6px 0; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); min-height: 44px; margin: 4px 0; }
label.check input { width: 20px; height: 20px; min-height: 20px; margin: 0; flex: none; }
.cs-pin { background: #f59e0b; color: #fff; border: 2px solid #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; font-size: 13px; }
.legend-pin { width: 16px; height: 16px; font-size: 11px; display: inline-flex; }
.legend .dot.ring { background: #fff; border-width: 3px; box-shadow: none; }
.fw-plate { border-left: 3px solid var(--primary); padding-left: 10px; margin: 0 0 6px; }
.fw-extras { margin: 6px 0; }
.fw-extra { display: flex; gap: 8px; align-items: center; min-height: 32px; }
.cs-fig { margin: 6px 0; }
.cs-fig figcaption { margin-top: -2px; }
.cs-photo { display: block; max-width: 100%; max-height: 220px; border-radius: 10px; margin: 6px 0; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.bar span { display: block; height: 100%; background: #16a34a; }
.legend-row { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.legend-row > span { display: inline-flex; align-items: center; gap: 4px; }
.tbl-wrap { overflow-x: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tab-badge.inline { position: static; margin-left: auto; }
.tag-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.tag-sheet .tag { border: 1px dashed var(--muted); border-radius: 8px; padding: 8px; text-align: center; background: #fff; color: #000; break-inside: avoid; }
.tag-sheet .tag .qr svg { width: 110px; height: 110px; }
.tag-sheet .tag .tno { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
@media print {
  body.print-tags #app > *:not(main), body.print-tags #tabs, body.print-tags #top, body.print-tags .back,
  body.print-tags #subBody > *:not(#tgBox), body.print-tags #tgBox > *:not(.tag-sheet) { display: none !important; }
  body.print-tags main, body.print-tags #view-sub { display: block !important; overflow: visible !important; position: static !important; }
  body.print-tags .tag-sheet { grid-template-columns: repeat(4, 1fr); }
}

/* 관리 화면 (sysadmin.js) */
.opt-group { margin: 18px 0 6px; font-size: 15px; color: var(--muted); }
details.opt { margin-bottom: 8px; padding: 12px 14px; }
details.opt summary { font-weight: 600; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.opt-body { margin-top: 10px; }
.opt-row { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.opt-row input { flex: 1; margin: 0; min-width: 0; }
.opt-n { flex: none; min-width: 44px; text-align: right; }
.icon-btn { flex: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:disabled { opacity: .35; }
.icon-btn .ic { width: 18px; height: 18px; }
.cat { border-left: 3px solid var(--line); padding-left: 8px; margin: 10px 0; }
.cat .opt-list.sub { margin-left: 14px; }
.cat-label { font-weight: 600; }
.row.wrap { flex-wrap: wrap; }
.row.wrap select { flex: 1 1 120px; }
.tr-row { padding: 10px 12px; }
.tr-ko { font-weight: 600; margin-bottom: 6px; word-break: break-word; }
.tr-row textarea { width: 100%; margin: 0; }
.tr-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.tr-foot .btn { margin-left: auto; min-height: 38px; }
.au-row { padding: 10px 12px; }
.au-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.au-detail { margin-top: 4px; word-break: break-word; }
.trash-row { padding: 12px; }

/* 3단계 고객 연결 */
.tag.crit { background: #ffe4e6; border-color: #fda4af; color: #be123c; }
.tag.alert { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
button.card { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 10px 12px; }
.cust-row > div + div, .tr-row > div + div { margin-top: 3px; }
.chk-row { display: flex !important; justify-content: space-between; align-items: center; }
.chain { display: flex; flex-direction: column; gap: 0; margin: 6px 0; }
.chain-step { position: relative; padding: 6px 0 8px 18px; border-left: 3px solid #99d5cf; margin-left: 6px; }
.chain-step::before { content: ''; position: absolute; left: -8px; top: 9px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--surface); border: 3px solid #0f8a7e; }
.chain-step:last-child { border-left-color: transparent; }
.lbar { display: block; height: 8px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; flex: 1; margin: 4px 0; }
.lbar > div { height: 100%; background: #0f8a7e; }
.lbar > div.over { background: #dc2626; }
.lbar > div.ph-R { background: #dc2626; } .lbar > div.ph-S { background: #ca8a04; } .lbar > div.ph-T { background: #2563eb; }
.ph-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.ph-bar b { width: 14px; }
.ph-bar .small { min-width: 110px; text-align: right; }
.ph-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ph-row .ph-seg { width: 100%; margin: 2px 0 0; }
.ph-seg button { min-height: 44px; }
.h4-act { float: right; font-size: 13px; }

/* 전주 창 선로 한 줄 (같은 선로·회선의 이전·다음 구간) */
.line-row { gap: 6px; }
.cline { display: flex; align-items: center; gap: 3px; min-width: 0; flex: 1; flex-wrap: nowrap; overflow: hidden; }
.pbtn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 6px 2px; cursor: pointer; color: var(--primary); font: inherit; }
.pdot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--lv); background: var(--surface); flex: none; }
.pdot.MV { border-color: var(--mv); }
.pno { display: none; }
.me { width: 12px; height: 12px; border-radius: 50%; background: var(--lv); flex: none; box-shadow: 0 0 0 3px #fde68a; }
.me.MV { background: var(--mv); }
.cbar { width: 8px; height: 2px; background: var(--muted); flex: none; }
.cseg { font-size: 12px; padding: 4px 5px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.line-row .chip { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cseg.click { cursor: pointer; text-decoration: underline dotted; }
@media (min-width: 600px) { .pno { display: inline; } }
.cseg.wire { width: 26px; height: 28px; padding: 0; border: 0; background: linear-gradient(var(--lv), var(--lv)) center / 100% 3px no-repeat; flex: none; }
.cseg.wire.MV { background-image: linear-gradient(var(--mv), var(--mv)); }
.cseg.wire.click { text-decoration: none; }
.cspec { font-size: 13px; margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.list-more { padding: 10px 0 24px; text-align: center; }
.list-more .btn { width: 100%; }

/* 4단계 계통·정전 영향 (network.js) */
.badge.out { background: #ea580c; }
.imp-label { font-size: 16px; }
.imp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 4px; }
.imp-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; text-align: center; }
.imp-grid b { display: block; font-size: 20px; }
.imp-grid span { font-size: 12px; color: var(--muted); }
.fd-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.fd-form .row2, #ssForm .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fd-form input[type=color] { min-height: 44px; padding: 2px; }
.fd-row > div + div, .sw-row > div + div { margin-top: 3px; }
.fd-row .btn-row, .sw-row .btn-row { margin: 8px 0 0; }
.chk-item { padding: 0; }
.chk-item .chk-row { width: 100%; border: 0; background: none; font: inherit; color: inherit; padding: 12px; min-height: 44px; cursor: pointer; }
.chk-item .chk-list { padding: 0 12px 12px; }
.chk-list .chip { margin-left: 0; }
.sw-ic.diff { box-shadow: 0 0 0 3px #facc15; }

/* 5단계 현장 업무 (work.js) */
.wb { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; margin-right: 4px;
  vertical-align: middle; background: #e5e7eb; color: #374151; }
.wb.pri-urgent, .wb.gr-urgent, .wb.out { background: #dc2626; color: #fff; }
.wb.pri-high, .wb.gr-major { background: #ea580c; color: #fff; }
.wb.pri-normal { background: #e0e7ff; color: #3730a3; }
.wb.gr-minor { background: #fef3c7; color: #92400e; }
.wb.gr-ok, .wb.st-done { background: #dcfce7; color: #166534; }
.wb.st-open { background: #f1f5f9; color: #334155; }
.wb.st-doing { background: #0f8a7e; color: #fff; }
.wb.st-canceled { background: #e5e7eb; color: #6b7280; text-decoration: line-through; }
.work-row { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 10px 12px; }
.work-row + .work-row { margin-top: 0; }
.pw-box .stack { margin: 6px 0; }
.pw-insp { display: block; text-align: left; margin: 4px 0; }
.ins-row { border-bottom: 1px solid var(--line); padding: 8px 0; }
.ins-row.bad .ins-name { font-weight: 700; }
.ins-seg { margin: 4px 0; }
.ins-seg button { min-height: 36px; font-size: 13px; }
.ins-row .seg button.on[data-g="minor"] { background: #f59e0b; }
.ins-row .seg button.on[data-g="major"] { background: #ea580c; }
.ins-row .seg button.on[data-g="urgent"] { background: #dc2626; }
.ins-row .seg button.on[data-g="ok"] { background: #16a34a; }
.ins-note { margin-top: 4px; }
.wo-pin { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px;
  background: #4f46e5; color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.wo-pin .ic { width: 14px; height: 14px; }
.wo-pin.pri-high { background: #ea580c; }
.wo-pin.pri-urgent { background: #dc2626; }
.wo-pin.doing { outline: 2px solid #0f8a7e; }
.wo-pin.mine { width: 28px; height: 28px; }
.legend-wo { display: inline-flex; width: 16px; height: 16px; vertical-align: middle; margin-right: 6px; }
label.btn { margin: 0; color: var(--text); font-size: inherit; }
.w-red { color: var(--danger); }

/* 6단계: PC 속성 표 (table.js) */
.fab-tr2 { top: 62px; right: 10px; }
.attr-pane { position: absolute; z-index: 1003; left: 0; right: 0; bottom: 0; height: 40%; display: flex; flex-direction: column;
  background: var(--surface); border-top: 2px solid var(--primary); box-shadow: 0 -4px 16px rgba(0,0,0,.12); }
#view-map.with-table #map { bottom: 40%; }
#view-map.with-table .fab-br, #view-map.with-table .fab-left, #view-map.with-table .fab-right { display: none; }
.t-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.t-bar select, .t-bar input:not([type=checkbox]) { min-height: 32px; margin: 0; padding: 2px 6px; font-size: 13px; width: auto; }
.t-bar label.inline { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.t-bar label.inline input { width: 16px; height: 16px; min-height: 16px; margin: 0; }
.t-sp { flex: 1; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; }
.btn.sm .ic { width: 15px; height: 15px; }
.t-wrap { flex: 1; overflow: auto; }
table.attr { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
table.attr th, table.attr td { padding: 3px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
table.attr th { position: sticky; top: 0; z-index: 1; background: var(--bg, #f4f6f9); cursor: pointer; user-select: none; font-weight: 600; }
table.attr td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.attr .chk { width: 26px; text-align: center; }
table.attr .chk input { width: 15px; height: 15px; min-height: 15px; margin: 0; }
table.attr tbody tr { cursor: default; }
table.attr tbody tr:hover { background: rgba(31,111,235,.06); }
table.attr tr.sel { background: rgba(250,204,21,.22); }
table.attr tr.cur { outline: 2px solid var(--primary); outline-offset: -2px; }
@media (max-width: 899px) { .attr-pane, #btnTable { display: none !important; } #view-map.with-table #map { bottom: 0; } }

/* 가운데 작은 창 */
.modal { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.25); }

/* 보고 · 대시보드 (reports.js) */
.rep-head { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; }
.rep-head h2, .rep-head h3 { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tile .tv { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .tl { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tile .ts { margin-top: 4px; }
.bar.thin { height: 4px; margin: 2px 0 0; }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.mchart { display: flex; align-items: stretch; gap: 4px; height: 160px; margin: 8px 0 12px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; }
.mcol { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mbars { flex: 1; display: flex; align-items: flex-end; gap: 1px; border-bottom: 1px solid var(--line); }
.mbars span { flex: 1; min-height: 1px; border-radius: 2px 2px 0 0; }
.ml { font-size: 10px; color: var(--muted); text-align: center; margin-top: 2px; white-space: nowrap; overflow: hidden; }
.rep-tbl { font-size: 13px; }
.rep-tbl th, .rep-tbl td { padding: 5px 7px; white-space: nowrap; }
.rep-tbl tfoot th { border-top: 2px solid var(--line); }
@media print {
  body.print-rep #tabs, body.print-rep #top, body.print-rep .back, body.print-rep .back-more, body.print-rep #repTabs,
  body.print-rep .rep button { display: none !important; }
  body.print-rep main, body.print-rep #view-sub { display: block !important; overflow: visible !important; position: static !important; }
  body.print-rep .tbl-wrap { overflow: visible; }
  body.print-rep .mchart, body.print-rep .tile { break-inside: avoid; }
}
