@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

/* ============================================================
   도시강풍 v2 디자인 시스템 — 처음부터 새로 작성 (bootstrap 미사용)
   참고한 문법: 현대 인시던트/자산 관리 도구들(스플릿 뷰, 칩, KPI 행,
   드로어형 상세)의 공통 패턴.
   ============================================================ */

:root {
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-soft: #eef2f7;
    --bg: #f4f6fa;
    --surface: #ffffff;
    --accent: #4f46e5;
    --accent-hov: #4338ca;
    --accent-soft: #eef2ff;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --warn: #b45309;
    --warn-soft: #fef3c7;
    --ok: #047857;
    --ok-soft: #d1fae5;
    --r: 12px;
    --r-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
    --sidebar-w: 360px;   /* 사용자 확정값 */
    --list-w: 640px;
    --map-h: 340px;
    --font: 'Pretendard Variable', Pretendard, -apple-system, 'Segoe UI', 'Malgun Gothic', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.01em;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
ul { list-style: none; }

/* ---------- 셸 ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
    width: var(--sidebar-w);
    background: #10162b;
    color: #9aa5c4;
    position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column;
    padding: 18px 12px;
    z-index: 50;
}
.side .brand {
    color: #fff; font-size: 20px; font-weight: 700; letter-spacing: -0.01em;
    padding: 2px 10px 16px; display: flex; align-items: center; gap: 8px;
}
.side .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.side .group { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: #55618a; padding: 12px 10px 6px; }
.side a.nav {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin: 1px 0; border-radius: 9px;
    color: #9aa5c4; font-weight: 400; font-size: 15.5px;
}
.side a.nav .ico { width: 18px; text-align: center; opacity: .75; }
.side a.nav:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side a.nav.on { background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(79, 70, 229, .35); }
.side a.nav.on .ico { opacity: 1; }
.side .todo {
    margin-left: auto; font-size: 10px; font-weight: 700;
    background: rgba(240, 165, 0, .16); color: #eab308;
    padding: 2px 7px; border-radius: 999px;
}
.side .foot { margin-top: auto; font-size: 11px; color: #414d75; padding: 10px; }

.main { flex: 1; margin-left: var(--sidebar-w); padding: 22px 26px 16px; min-width: 0; }

/* 페이지 헤더 */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.phead .crumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.phead h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.phead .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.phead .actions { display: flex; gap: 8px; }

/* ---------- 공용 컴포넌트 ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.card .hd { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); font-weight: 600; font-size: 14.5px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card .bd { padding: 14px 16px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 15px; border-radius: 9px; border: 1px solid transparent;
    font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
    background: #fff; color: var(--ink-2); border-color: var(--line);
    transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: #f8fafc; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.pri:hover { background: var(--accent-hov); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: default; }

.chip {
    display: inline-flex; align-items: center; gap: 5px;
    height: 22px; padding: 0 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; background: #f1f5f9; color: var(--ink-2);
    border: 1px solid #cbd5e1;   /* 테두리 추가 — 흐릿하게 보이던 칩 구분용 (2026-10-01) */
}
.chip.acc { background: var(--accent-soft); color: var(--accent); border-color: #c7d2fe; }
.chip.red { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.chip.amber { background: var(--warn-soft); color: var(--warn); border-color: #fcd34d; }
.chip.green { background: var(--ok-soft); color: var(--ok); border-color: #6ee7b7; }
.chip.line { background: #fff; border: 1px solid var(--line); }
.chip.clip { max-width: 280px; display: inline-block; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.input, select.input {
    height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px;
    background: #fff; outline: none; min-width: 0;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .13); }
.input[readonly] { background: #f8fafc; color: var(--muted); }

.search { position: relative; }
.search .input { padding-left: 32px; width: 100%; }
/* 돋보기 아이콘 — '⌕'(U+2315)은 폰트 미지원으로 네모로 깨져 SVG 로 교체 (2026-09-30) */
.search::before { content: ''; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; opacity: .5;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23808080' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cline x1='21' y1='21' x2='15.5' y2='15.5'/%3E%3C/svg%3E"); }

.kv { font-size: 12px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.muted { color: var(--muted); }
.hr { border: 0; border-top: 1px solid var(--line-soft); margin: 12px 0; }

/* ---------- 스플릿 뷰 (목록 + 상세) ---------- */
.split { display: grid; grid-template-columns: var(--list-w) minmax(0, 1fr); gap: 16px; align-items: start; }
/* 상세가 과도하게 눌리기 전에(≈520px 미만) 일찍 세로 스택으로 전환.
   스택 시 sticky를 반드시 해제 — 고정된 목록 밑으로 상세가 파고들어 겹치는 버그의 원인 */
@media (max-width: 1240px) {
    .split { grid-template-columns: 1fr; }
    /* base의 .list-pane{position:sticky}가 이 블록보다 뒤에 선언돼 있어 !important 필요 */
    .list-pane { position: static !important; max-height: 440px; }
}

.list-pane { position: sticky; top: 18px; display: flex; flex-direction: column; max-height: calc(100vh - 60px); }
.list-pane .tools { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; }
.list-pane .tools .row { display: flex; gap: 6px; flex-wrap: wrap; }
.list-pane .tools select.input { height: 30px; font-size: 12.5px; padding: 0 8px; border-radius: 7px; flex: 1; }
.pill-check {
    display: inline-flex; align-items: center; gap: 5px;
    height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px;
    background: #fff; font-size: 12.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; user-select: none;
}
.pill-check input { accent-color: var(--accent); margin: 0; cursor: pointer; }
.pill-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* 목록 칩 고정폭: 내용 길이(빈값~6글자)와 무관하게 열 시작 위치를 맞춘다 */
.item .t2 .chip.cfix { flex: none; justify-content: center; padding: 0 4px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; display: inline-block; line-height: 22px;
  text-align: center; }
.item .t2 .cfix.cg { width: 68px; }   /* 피해도: 최장 '부분손상' */
.item .t2 .cfix.cm { width: 94px; }   /* 중분류·피해대상: 최장 '공사장가림막' */
.item .t2 .cfix.cp { width: 34px; }   /* 사진 표식 — 없어도 자리 유지 */
.item .t2 .cfix.cmed { width: 165px; }  /* 미디어사(모니터링) — 넘치면 … */ /* 미디어사(모니터링) — 긴 이름('부산경남대표방송 KNN')이 두 줄로 접히지 않게 */
.item .t2 .cfix.ct { width: 62px; }   /* 분석유형(드론): 2D/3D/정사영상 */
.item .t2 .cfix.cr { width: 78px; }   /* 아카이브 등록상태(드론) */
.item .t2 .cfix.cno { width: 44px; }  /* 일련번호(현황보고) */
.item .t2 .cfix.cwt { width: 118px; } /* 강풍유형: 최장 '폭풍(이동성 고기압)' */
.item .t2 .cfix.cdr { width: 62px; }  /* 로컬 수정 표식 — 없어도 자리 유지 */
.item .t2 .cfix.cst { width: 60px; }  /* 사고원인 분석 진행단계 */
.item .t2 .cfix.csrc { width: 46px; } /* 모니터링 수집 출처: '수동'/'자동' */
/* 자동수집분 표식 — 눈에 띄되 피해 등급 색(red/amber)과 겹치지 않게 청록 계열 */
.chip.auto { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
/* 드론 프로젝트 행(오버레이 목록)도 상태 칩 폭 고정 */
.prow > .chip { flex: none; width: 68px; justify-content: center; }
/* 정보연계 모달 선택 목록(.pm)·대시보드 최근 기사 등 목록형 전반의 칩·값 폭 고정 */
.pm .chip.cfix, .item .t2 .chip.cfix { flex: none; justify-content: center; padding: 0 4px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; display: inline-block; line-height: 22px;
  text-align: center; }
.pm .cfix.cmed, .item .t2 .cfix.cmed { width: 165px; }
.pm .cfix.cfid { width: 118px; }   /* 시설물 ID */
.pm .cfix.cg { width: 68px; }
.cfix2 { display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.cfix2.cdate { width: 84px; }      /* 보도일 */
.cfix2.cobj { width: 104px; }      /* 피해대상·시설물 유형 */
.list-scroll { overflow-y: auto; flex: 1; }
.list-foot { padding: 9px 14px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }

.item {
    padding: 11px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer;
    display: flex; flex-direction: column; gap: 5px;
    border-left: 3px solid transparent;
}
.item:hover { background: #f8faff; }
.item.on { background: var(--accent-soft); border-left-color: var(--accent); }
.item .t1 { display: flex; align-items: center; gap: 8px; }
.item .t1 .title { font-weight: 600; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t1 .date { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item .t2 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item .t2 .addr { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 120px; }
.item .metric { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 500; display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
/* 인근 최대값이 주(主), 대표 ASOS는 참고값이라 한 단계 낮춰 표기한다 */
.item .metric .u { font-size: 11px; color: var(--muted); font-weight: 400; }
.item .metric .aw { font-size: 11.5px; color: var(--muted); font-weight: 400; padding: 1px 5px; border: 1px solid var(--line-soft); border-radius: 4px; }
.list-foot .wleg { font-size: 11px; color: var(--muted); margin-left: 10px; cursor: help; }
.list-foot .wleg b { font-weight: 600; color: var(--ink-2); }
/* 물리 상한 초과 — 값은 그대로 두고 표시만 한다 */
.item .metric .wbad { color: var(--danger); font-weight: 700; cursor: help; }
/* 사건 줄에서 아카이브로 넘기는 버튼 — 줄 높이를 늘리지 않게 작게, 마우스 올릴 때만 보이게 */
.item .t1 .date .rep { font-weight: 400; font-size: 10.5px; }
.item .arcbtn { height: 22px; padding: 0 8px; font-size: 11.5px; flex: 0 0 auto;
                opacity: 0; transition: opacity .12s; }
.item:hover .arcbtn, .item.on .arcbtn { opacity: 1; }
.stn td.bad, .stn-asos td.bad { color: var(--danger); font-weight: 700; }

/* ---------- 상세 패널 ---------- */
.detail-hero { padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft); }
.detail-hero .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-hero h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.35; }
.detail-hero .chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.detail-hero .stats { display: flex; gap: 26px; margin-top: 14px; flex-wrap: wrap; }
.detail-hero .stat .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.detail-hero .stat .k { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.sec { border-bottom: 1px solid var(--line-soft); }
.sec > summary {
    list-style: none; cursor: pointer; padding: 12px 20px;
    font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; color: var(--ink-2);
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.sec[open] > summary::before { transform: rotate(90deg); }
.sec > summary .hint { margin-left: auto; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.sec .sec-bd { padding: 4px 20px 16px; }

/* 필드 그리드 (읽기) */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px 20px; }
.f { min-width: 0; }
.f .k { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0.01em; }
.f .v { font-size: 15px; font-weight: 500; margin-top: 2px; word-break: break-all; line-height: 1.45; }
.f .v.na { color: #cbd5e1; font-weight: 400; }
.f.wide { grid-column: span 2; }
.f.wide:has(.v.pre) { grid-column: 1 / -1; }
.f .v.pre { white-space: pre-wrap; font-weight: 400; line-height: 1.65; font-size: 14px; }

/* 필드 그리드 (편집) */
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.e { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.e label { font-size: 12px; font-weight: 500; color: var(--muted); }
.e.wide { grid-column: 1 / -1; }

/* STN 관측 카드 */
.stn-wrap { display: grid; grid-template-columns: 1fr; gap: 10px; }
.stn table { table-layout: fixed; }
.stn {
    border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #fff;
}
.stn .h { padding: 8px 12px; background: #f8fafc; border-bottom: 1px solid var(--line-soft); font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.stn .h .m { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.stn table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stn th, .stn td { padding: 7px 9px; border-top: 1px solid var(--line-soft); }
.stn thead th { border-top: none; font-size: 11.5px; color: var(--muted); font-weight: 500; text-align: right; background: #fbfcfe; }
.stn td { text-align: right; font-variant-numeric: tabular-nums; }
.stn td.lab, .stn th.lab { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; background: #fbfcfe; white-space: nowrap; }
.stn td.max { background: var(--accent-soft); font-weight: 700; }
.stn-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.stn-legend b { color: var(--ink-2); }

/* 대표 ASOS 카드 — 최인근 3곳(.stn)보다 위에 두고 테두리로 구분한다.
   AWS 가 더 가까워도 관측 항목·품질관리가 달라 이쪽이 기준이 된다. */
.stn-asos {
    border: 1.5px solid var(--accent); border-radius: var(--r-sm); overflow: hidden;
    background: #fff; margin-bottom: 10px;
}
.stn-asos .h { padding: 8px 12px; background: var(--accent-soft); border-bottom: 1px solid var(--line-soft);
    font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.stn-asos .h .m { font-weight: 400; color: var(--ink-2); font-size: 11.5px; }
.stn-asos table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.stn-asos th, .stn-asos td { padding: 7px 9px; border-top: 1px solid var(--line-soft); }
.stn-asos thead th { border-top: none; font-size: 11.5px; color: var(--muted); font-weight: 500;
    text-align: right; background: #fbfcfe; }
.stn-asos td { text-align: right; font-variant-numeric: tabular-nums; }
.stn-asos td.lab, .stn-asos th.lab { text-align: left; color: var(--muted); font-weight: 600;
    font-size: 12px; background: #fbfcfe; white-space: nowrap; }
.stn-asos td.max { background: var(--accent-soft); font-weight: 700; }
.stn-asos .kv { padding: 6px 12px; }
/* 해외 사례 — 국내 관측으로 산출할 수 없어 분석을 막는다 */
.stn-asos.oversea { border-color: var(--danger); background: var(--danger-soft); padding: 10px 12px; }
.stn-asos.oversea b { color: var(--danger); }
.stn-asos.oversea .kv { padding: 0; }

/* 사진 그리드 */
.pgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.pcell {
    width: 118px; border: 1px dashed var(--line); border-radius: var(--r-sm);
    background: #f8fafc; color: var(--muted); font-size: 11px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px;
    text-align: center;
}
.pcell img { width: 100%; height: 70px; object-fit: cover; border-radius: 5px; }
.pcell .big { font-size: 20px; }
.pcell span { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 읽기 화면(.pgrid)의 사진 타일은 2배 크기 — 클릭 확대 없이도 내용 식별 가능하게.
   편집/첨부 존(.mzone)의 70px 타일은 그대로 둔다 */
.pgrid .pcell { width: 236px; max-width: 100%; }
.pgrid .pcell img { height: 140px; }
.pgrid .pcell span { max-width: 210px; }

/* 지도 */
.mapbox { height: var(--map-h); border-radius: var(--r-sm); border: 1px solid var(--line); overflow: hidden; }

/* ---------- 모달 (자체 구현) ---------- */
.mm-back {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
    display: none; align-items: flex-start; justify-content: center; z-index: 100;
    padding: 5vh 16px;
}
.mm-back.show { display: flex; }
.mm {
    background: #fff; border-radius: 14px; width: 100%; max-width: 980px;
    max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    overflow: hidden;
}
.mm .mm-hd { padding: 14px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.mm .mm-hd h3 { font-size: 16px; font-weight: 600; flex: 1; }
.mm .mm-x { border: none; background: none; font-size: 20px; color: var(--muted); cursor: pointer; padding: 2px 8px; border-radius: 7px; }
.mm .mm-x:hover { background: #f1f5f9; }
.mm .mm-bd { overflow-y: auto; flex: 1; }
.mm .mm-ft { padding: 11px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; background: #fbfcfe; }
.mm .mm-ft .left { margin-right: auto; }

/* 가져오기 목록 */
.pick { padding: 8px 14px; border-bottom: 1px solid var(--line-soft); display: flex; gap: 10px; cursor: pointer; align-items: flex-start; }
.pick:hover { background: #f8faff; }
.pick input { margin-top: 3px; accent-color: var(--accent); }
.pick .pt { font-weight: 500; font-size: 14px; }
.pick .pm { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- KPI / 대시보드 ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 15px 17px; }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi .bar { height: 3px; border-radius: 2px; background: var(--accent); margin-top: 11px; opacity: .85; }
.kpi.g2 .bar { background: #0ea5e9; }
.kpi.g3 .bar { background: #f59e0b; }
.kpi.g4 .bar { background: #10b981; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }

/* 프로젝트 카드 (드론) */
/* 프로젝트 브라우저: 수년치 대비 — 검색·필터로 좁히고, 기본은 최신 1줄만(접힘) */
.proj-tools {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
}
.proj-tools select.input { height: 32px; font-size: 13px; }
/* 연도별 그룹 행 리스트 — 카드보다 8배 조밀, 내부 스크롤·연도 헤더 고정 */
.plist { max-height: 300px; overflow-y: auto; }
.pyear {
    position: sticky; top: 0; z-index: 2;
    background: #f8fafc; color: var(--ink-2);
    font-weight: 700; font-size: 13px;
    padding: 7px 14px; border-bottom: 1px solid var(--line-soft);
    display: flex; gap: 8px; align-items: baseline;
}
.prow {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; border-bottom: 1px solid #f1f5f9;
    cursor: pointer; border-left: 3px solid transparent;
}
.prow:hover { background: #f8faff; }
.prow.on { background: var(--accent-soft); border-left-color: var(--accent); }
.prow .pn { font-weight: 600; font-size: 14px; flex: 1; min-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pd { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 78px; }
.prow .pr { font-size: 12.5px; color: var(--muted); flex: 0 0 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pc { font-size: 12.5px; color: var(--ink-2); flex: 0 0 118px; font-variant-numeric: tabular-nums; }
.prow .pid { font-size: 11.5px; color: #a3adc2; font-variant-numeric: tabular-nums; flex: 0 0 86px; text-align: right; }
@media (max-width: 900px) { .prow .pr, .prow .pid { display: none; } }
.proj { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; border: 2px solid transparent; }
.proj:hover { border-color: #c7cdfa; }
.proj.on { border-color: var(--accent); background: linear-gradient(0deg, var(--accent-soft), #fff 70%); }
.proj .id { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.proj .nm { font-weight: 600; font-size: 14.5px; margin: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj .mt { font-size: 12.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj .ft { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-2); }

/* 빈 상태 */
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .5; }

/* 알림 배너 */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); font-size: 13px; }

/* 페이지네이션(간단) */
.pgr { display: flex; gap: 4px; align-items: center; }
.pgr button { border: 1px solid var(--line); background: #fff; border-radius: 7px; min-width: 28px; height: 28px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.pgr button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pgr button:disabled { opacity: .4; cursor: default; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; border: 2px solid #f4f6fa; }
::-webkit-scrollbar-track { background: transparent; }




/* ---------- 정보연계 모달: 탭 + 스테이징 ---------- */
.mtabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line-soft); }
.mtab {
    border: none; background: none; cursor: pointer;
    padding: 11px 14px; font-size: 13.5px; font-weight: 500; color: var(--muted);
    border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 6px;
}
.mtab:hover { color: var(--ink); }
.mtab.on { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.tp-tools { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.stage-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
}
.stage-row .st { flex: 1; min-width: 0; }
.stage-row .pt { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-row .pm { font-size: 12px; color: var(--muted); }
select.cand { height: 30px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }


/* 발생 시점·위치: 좌(정보 스택)/우(좁은 지도) 2단 — 지도 가로 비율 축소 */
/* 위치 배치(사용자 확정): 좌 = 정보(넓게, 주소 길이 대비) + 그 아래 '지도 범례',
   우 = 지도가 오른쪽 끝(옛 범례 자리)까지 확장 */
.sec-bd { container-type: inline-size; }
.locgrid {
    display: grid; gap: 14px 18px; align-items: stretch;
    grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "info map" "legend map";
}
.locgrid .fstack { grid-area: info; }
.locgrid #mapSlot { grid-area: map; }
.locgrid .loc-legend { grid-area: legend; align-self: start; }
@container (max-width: 700px) {
    .locgrid { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "info" "legend" "map"; }
}
.fstack { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; align-content: start; }
.fstack .f.wide { grid-column: 1 / -1; }
.fstack .f .v { font-size: 15px; }
.locgrid .mapbox, .locgrid #mapSlot { height: var(--map-h); min-height: 300px; }
.locgrid #mapSlot .mapbox { height: 100%; }
.loc-legend {
    background: #1c3550; color: #d7e3f0; border-radius: var(--r-sm);
    padding: 14px 14px; display: flex; flex-direction: column; gap: 12px;
    font-size: 12.5px;
}
.loc-legend .lg-t { font-weight: 700; font-size: 14px; color: #fff; letter-spacing: 1px; margin-bottom: 2px; }
.loc-legend .lg-i { display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.loc-legend small { color: #93a9c2; }
.lg-pin { width: 12px; height: 12px; border-radius: 50% 50% 50% 0; background: #3388ff; transform: rotate(-45deg); margin-top: 2px; flex: 0 0 12px; }
.lg-stn { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #8ea2ff; background: #eef2ff; margin-top: 2px; flex: 0 0 12px; box-sizing: border-box; }
.lg-line { width: 16px; border-top: 2px dashed #8ea2ff; margin-top: 8px; flex: 0 0 16px; }

/* 지오코딩 도구 (편집 모드) */
.geo-tools { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }


/* 읽기 필드 구분 (사용자 확정): 행은 흐린 밑선, 열은 '중간만 흐릿한 짧은 선' —
   표 틀처럼 꽉 잇지 않고 정리된 느낌만 주는 방식 */
.f.full { grid-column: 1 / -1 !important; }
.fgrid, .fstack { gap: 0 !important; }
.fgrid .f, .fstack .f {
    margin: 0;
    padding: 10px 14px 9px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}
.fgrid .f:not(.full)::after, .fstack .f:not(.full)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 24%;
    height: 52%;
    width: 1px;
    background: linear-gradient(180deg, transparent, #dbe3ee 30%, #dbe3ee 70%, transparent);
}


/* 대시보드 사용자 지정 통계 카드 */
.stat-hd { flex-wrap: wrap; }
.stat-ctl { display: flex; gap: 6px; }
.stat-ctl select.input { height: 30px; font-size: 12.5px; padding: 0 8px; border-radius: 7px; font-weight: 400; }
.stat-card .bd { padding: 8px 12px 6px; }


.stat-bd { display: flex; flex-direction: column; justify-content: flex-end; }


/* 드론 프로젝트 브라우저(사용자 최종 정의): 얇은 선이 아니라
   '테두리와 내용 사이의 띠' 전체가 두꺼운 색 프레임.
   카드 전체를 네이비로 칠하고(패딩 12px = 프레임 두께),
   안쪽 도구줄+목록을 하나의 밝은 패널로 띄운다 */
.proj-card {
    background: #2e3a72 !important;
    border: none !important;
    padding: 12px !important;
    box-shadow: 0 4px 14px rgba(30, 38, 90, 0.25) !important;
}
.proj-card .proj-tools {
    background: #fff;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid var(--line-soft);
    margin: 0;
}
.proj-card .plist {
    background: #fbfcff;
    margin: 0;
    border: none;
    border-radius: 0 0 8px 8px;
    box-shadow: inset 0 2px 6px rgba(40, 50, 100, 0.08);
}
.proj-card .pyear { background: #f0f3fb; color: #4a5578; }
.proj-card .prow.on { background: var(--accent-soft); border-left-color: var(--accent); }



/* 미디어 첨부 공통: 섹션 소제목, 셀 삭제 버튼, 출처 라벨 */
.mediahd { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 14px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.pcell { position: relative; }
.pcell .px {
    position: absolute; top: 3px; right: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    border: none; background: rgba(15, 23, 42, 0.55); color: #fff;
    font-size: 12px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.pcell .px:hover { background: var(--danger); }
.pcell .pfrom { font-size: 10.5px; color: #97a2bd; }


/* ===== 프로젝트 선택 바 + 펼침 패널 (구역 색칠 방식 전면 폐기) ===== */
.pjbar { position: relative; margin-bottom: 16px; padding: 0 !important; background: #fff !important; border: none !important; box-shadow: var(--shadow) !important; }
.pjcur {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 13px 16px; border: none; background: none; cursor: pointer;
    border-radius: var(--r); text-align: left; font-size: 14px;
}
.pjcur:hover { background: #f8faff; }
.pjcur .pjname { font-weight: 700; font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pjcur .pjmeta { color: var(--muted); font-size: 12.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pjcur .pjcaret { color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.pjpanel {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
    background: #fff; border-radius: 12px; border: 1px solid var(--line);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}
.pjpanel .plist { max-height: 340px; margin: 0; border: none; border-radius: 0; box-shadow: none; background: #fff; }


/* 미디어 첨부 2열 존: 좌=사진 / 우=동영상 (사용자 요청 반반 분할) */
.media2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .media2col { grid-template-columns: 1fr; } }
.mzone { border: 1px dashed #ccd5e4; border-radius: 8px; padding: 12px 14px; background: #fbfcff; }
.mzone .mz-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.mzone .mz-h b { font-size: 13.5px; }
.mzone input[type=file] { width: 100%; padding-top: 6px; }
.pcell img, .pcell video { width: 100%; height: 70px; object-fit: cover; border-radius: 4px; background: #0f172a; }


/* 지도 상시 라벨: 지점번호(관측소 위), 거리·방위(연결선 중간) */
.maplbl {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid #c7cdfa !important;
    border-radius: 5px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18) !important;
    color: #35407c !important;
    font-family: var(--font) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 1px 6px !important;
    white-space: nowrap !important;
}
.maplbl::before { display: none !important; }   /* 툴팁 꼬리 제거 */
.linelbl { width: auto !important; height: auto !important; transform: translate(-50%, -50%); }

/* 모니터링 읽기 필드: 한 줄 말줄임(oneline) — 전체 내용은 title 툴팁 */
.fgrid.oneline .f .v {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
}
.fgrid.oneline .f .v a { white-space: nowrap; }


/* ============================================================
   반응형(모바일) — 사용자 요청: 모바일에서도 깨지지 않게
   ============================================================ */

/* 모바일 탑바·백드롭 (기본 숨김) */
.mtopbar {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; height: 50px; z-index: 130;
    background: #10162b; color: #fff;
    align-items: center; gap: 10px; padding: 0 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.3);
}
.mtopbar .mnav {
    border: none; background: rgba(255, 255, 255, 0.1); color: #fff;
    width: 36px; height: 36px; border-radius: 8px; font-size: 17px; cursor: pointer;
}
.mtopbar .mbrand { font-weight: 700; font-size: 16px; }
.mback {
    display: none; position: fixed; inset: 0; z-index: 115;
    background: rgba(15, 23, 42, 0.45);
}
.mback.show { display: block; }

/* 상세 히어로: 좁으면 버튼 줄바꿈 */
.detail-hero .top { flex-wrap: wrap; }
.pjcur .pjname, .pjcur .pjmeta { min-width: 0; }

@media (max-width: 980px) {
    .mtopbar { display: flex; }
    .side {
        transform: translateX(-105%);
        transition: transform 0.22s ease-out;
        width: 280px;
        z-index: 120;
        box-shadow: 8px 0 30px rgba(15, 23, 42, 0.35);
    }
    .side.open { transform: none; }
    .main { margin-left: 0 !important; padding: 64px 14px 20px !important; }
    .phead h1 { font-size: 19px !important; }
    /* 스플릿: 목록 위(고정폭 해제·높이 제한), 상세 아래 */
    .split { grid-template-columns: 1fr !important; }
    .list-pane { position: static; max-height: 420px; }
    .pjcur .pjmeta { display: none; }   /* 좁을 땐 이름만 */
}

@media (max-width: 640px) {
    .kpis { grid-template-columns: 1fr 1fr; }
    .kpi .v { font-size: 22px; }
    .detail-hero { padding: 14px 14px 12px; }
    .detail-hero .stats { gap: 16px; }
    .sec > summary, .sec .sec-bd { padding-left: 14px; padding-right: 14px; }
    .stn table { font-size: 12px; }
    .stn th, .stn td { padding: 6px 6px; }
    .stn-grid, .stn .lab { font-size: 12px; }
    .mm-back { padding: 2vh 8px; }
    .mm .mm-bd { max-height: 70vh; }
    .item .t2 .addr { min-width: 80px; }
    .prow .pc { display: none; }
    .mediahd { margin-top: 10px; }
    .phead .actions { width: 100%; }
    .phead .actions .btn { flex: 1; }
}


/* 말줄임 자체 툴팁 — 즉시 표시 */
.tipbox {
    display: none;
    position: fixed;
    z-index: 500;
    max-width: 520px;
    background: #0f172a;
    color: #f1f5f9;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.55;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
    pointer-events: none;
    white-space: pre-wrap;
    word-break: break-all;
}


/* 이미지 확대 보기 — 클릭 시 새 창/다운로드 대신 화면 안에서 크게 보고, 저장은 버튼으로 */
.lbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(15, 23, 42, 0.82);
    flex-direction: column;
}
.lbox.show { display: flex; }
.lbox .lb-hd {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    color: #f1f5f9;
    font-size: 13.5px;
    font-weight: 600;
}
.lbox .lb-act { display: flex; gap: 6px; }
.lbox .lb-act .btn { height: 28px; padding: 0 12px; font-size: 12.5px; text-decoration: none; }
.lbox .lb-bd {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px 18px;
}
.lbox .lb-bd img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}


/* ── 휴대폰(≤560px) 보정 ─────────────────────────────────────────────
   현장에서 아카이브 내용을 확인하고 체크리스트를 입력하는 상황.
   표가 가로로 넘치거나 칩이 줄바꿈으로 어긋나던 것을 잡고, 터치 대상을 키운다. */
@media (max-width: 560px) {
    body { font-size: 14.5px; }
    .main { padding: 60px 10px 18px !important; }
    .phead h1 { font-size: 18px !important; }
    .phead .sub { font-size: 12px; }

    /* 목록 칩: 고정폭을 풀어 좁은 화면에서 줄이 깨지지 않게 */
    .item .t2 { flex-wrap: wrap; gap: 5px 6px; }
    .item .t2 .chip.cfix, .item .t2 .chip.cfix2 { width: auto !important; min-width: 0 !important; }
    .item .t2 .addr { min-width: 0; width: 100%; white-space: normal; word-break: keep-all; }
    .item .t1 .title { white-space: normal; word-break: keep-all; }
    .list-pane { max-height: none; }

    /* 상세: 라벨-값 2열을 1열로 */
    .fgrid { grid-template-columns: 1fr; gap: 10px; }
    .detail-hero .stats { flex-wrap: wrap; gap: 12px; }

    /* 관측 표: 가로 스크롤로 넘기고 잘리지 않게 */
    .stn { overflow-x: auto; }
    .stn table { min-width: 340px; }
    .stn table, .stn .lab { font-size: 11.5px; }
    .stn th, .stn td { padding: 6px 5px; }
    .mtbl { font-size: 11.5px; }
    .rpt .wxgrid { grid-template-columns: 1fr; }

    /* 터치 대상 최소 크기 */
    .btn { min-height: 38px; padding: 0 12px; }
    .btn.sm { min-height: 32px; }
    .input, select.input { height: 40px; font-size: 14px; }
    .pill-check { min-height: 34px; }

    /* 지도는 화면 폭에 맞춰 낮게 */
    #mapSlot, .leaflet-container { min-height: 220px !important; }
}
