/* CRD Climate Risk Explorer — 차분한 분석 화면: 흰 바탕 · 남색 글자 · 강조색 하나(청록). 재해 색은 데이터에만 쓴다 */
:root {
  --bg: #ffffff; --surface: #f6f7f9; --line: #e2e5ea; --line-2: #cfd4db;
  --ink: #0f1b2d; --ink-2: #3d4a5c; --muted: #6b7686;
  --accent: #0f766e; --accent-ink: #0b5d57; --accent-soft: #e7f3f1;
  --danger: #b42318;
  --r: 6px; --shadow: 0 1px 2px rgba(15,27,45,.06), 0 4px 14px rgba(15,27,45,.08);
  --font: 'Pretendard Variable', Pretendard, 'Noto Sans KR', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.app-map { overflow: hidden; }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* 머리 띠 */
.top { height: 56px; display: flex; align-items: center; gap: 24px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand b { font-size: 16px; letter-spacing: .02em; }
.brand span:last-child { color: var(--muted); font-size: 13px; }
.mark { width: 18px; height: 18px; border-radius: 4px; background: linear-gradient(135deg, var(--accent) 0 55%, #5eb5a8 55%); display: inline-block; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a.on { color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search { margin: 0; }
.search input { width: 300px; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg); }
.search input:focus, .filter:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* 두 칸 · 세 칸 단추 */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.seg:not(:has(> :not([hidden]))) { display: none; }     /* 단추가 다 숨은 칸 — 빈 테두리가 세로줄로 남지 않게 */
.seg button { border: 0; background: transparent; padding: 5px 12px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent); color: #fff; }
.seg.home { margin-left: 6px; border-color: transparent; background: var(--bg); box-shadow: var(--shadow); }     /* 켜고 끄는 단추가 아니라 '되돌리기' — 테두리 없이 글자색으로 구분 */
.seg.home button { color: var(--accent-ink); font-weight: 600; }
.seg button:not(.on):hover { background: var(--surface); }

/* 본문 */
.body { display: flex; height: calc(100% - 56px); }
.panel { width: 340px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: var(--bg); }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs button { flex: 1; border: 0; background: none; padding: 12px 4px 10px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.ctl { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); display: grid; gap: 10px; }
.ctl label, .ctl > div { display: grid; gap: 4px; }
.ctl .lbl, .ctl label > span { font-size: 12px; color: var(--muted); }
.ctl select { height: 32px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 8px; background: var(--bg); }
.ctl .seg { width: 100%; } .ctl .seg button { flex: 1; padding: 5px 4px; font-size: 13px; }
.filter { margin: 12px 16px 4px; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); }
.groups { overflow-y: auto; padding: 4px 8px 24px; flex: 1; }
.group { border-bottom: 1px solid var(--line); }
.gh { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 10px 8px; cursor: pointer; text-align: left; }
.gh:hover { background: var(--surface); }
.gh .car { color: var(--muted); font-size: 11px; transition: transform .15s; }
.group.open .gh .car { transform: rotate(90deg); }
.gh .gl { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.gh .gc { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; } .gh .gc b { color: var(--accent-ink); }
.group.open { padding-bottom: 6px; }
.item { display: grid; grid-template-columns: 16px 22px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: var(--r); cursor: pointer; }
.item .sw { width: 22px; height: 10px; border-radius: 2px; border: 1px solid rgba(15,27,45,.12); }
.item .sw.g-point { width: 10px; height: 10px; border-radius: 50%; justify-self: center; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(15,27,45,.25); }
.item .sw.g-point:not([style*="background"]) { background: var(--ink-2); }
.item .sw.g-line { height: 3px; border: 0; border-radius: 2px; }
.item .sw.g-polygon { width: 16px; height: 12px; justify-self: center; border: 1.5px solid; border-radius: 2px; }
.item.off { opacity: .45; }
.row { position: relative; }
.row .item { padding-right: 32px; }
.row .info { position: absolute; right: 8px; top: 7px; width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted); font: 600 10px/16px var(--font); text-align: center; cursor: pointer; }
.row .info[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.row .desc { margin: 0 8px 6px 54px; font-size: 12px; line-height: 1.5; color: var(--ink-2); white-space: pre-line; }
.link.reset { display: block; margin: 14px 8px 0; border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }
.legend .note.lead { color: var(--ink-2); }
.legend details.more summary { font-size: 11.5px; color: var(--accent-ink); cursor: pointer; margin-top: 4px; }
.legend details.more .note { margin-top: 4px; }
.row .info:hover, .row .info:focus-visible { border-color: var(--accent); color: var(--accent-ink); outline: none; }
.active { flex: none; border-top: 1px solid var(--line); background: var(--surface); padding: 0 16px; position: relative; }
.active .ah { display: flex; justify-content: space-between; align-items: center; height: 40px; font-size: 12.5px; }
.active .cnt { border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink-2); font-size: 12.5px; }
.active .cnt b { color: var(--accent-ink); } .active .cnt:disabled { cursor: default; color: var(--muted); } .active .cnt .car { color: var(--muted); font-size: 10px; }
.active .link { border: 0; background: none; color: var(--accent-ink); font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0; }
.active .chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 0 2px; max-height: 160px; overflow-y: auto; }
.active .chip { display: inline-flex; align-items: center; gap: 5px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 4px 1px 7px; font-size: 11.5px; max-width: 100%; }
.active .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.active .chip i { width: 12px; height: 8px; border-radius: 2px; flex: none; }
.active .chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 3px; font-size: 13px; line-height: 1; }
.item:hover { background: var(--surface); }
.item input { margin: 2px 0 0; accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.item .nm { color: var(--ink); }
.item .pd { font-size: 11px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; white-space: nowrap; }
.item.on { background: var(--accent-soft); }
.empty { color: var(--muted); padding: 16px 8px; font-size: 13px; }

/* 지도 */
.mapwrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; }
.mapbar { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 5; }      /* 5 — 지도 핀 · 이름표 · 말풍선(3 이하)이 단추를 덮어 '초기화'가 안 눌렸다 (2026-11-19) */   /* 영어는 단추가 길다 — 겹치지 않게 나란히 */
.view, .base, .tools { box-shadow: var(--shadow); }
.tools:has(button[hidden]) { display: none; }
.onlychip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 12px; border: 1px solid var(--accent); border-radius: var(--r); background: var(--bg); color: var(--accent); box-shadow: var(--shadow); font-size: 13px; }
.onlychip[hidden] { display: none; }
.onlychip .x { border: 0; background: transparent; color: inherit; font-size: 18px; line-height: 1; padding: 2px 6px; cursor: pointer; }
.hint { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); background: rgba(15,27,45,.82); color: #fff; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.legends { position: absolute; left: 12px; bottom: 28px; display: flex; flex-direction: column-reverse; gap: 8px; max-height: calc(100% - 90px); overflow-y: auto; }
.legend { width: 280px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 12px; }
.legend .lh { display: flex; gap: 8px; align-items: start; }
.legend .lh b { flex: 1; font-size: 13px; font-weight: 600; line-height: 1.35; }
.legend .x, .inspect .x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; }
.legend .x:hover, .inspect .x:hover { color: var(--ink); }
.ramp { height: 8px; border-radius: 2px; margin: 8px 0 3px; }
.ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.classes { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; margin-top: 8px; font-size: 11.5px; color: var(--ink-2); }
.classes i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.opacity { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.opacity input { flex: 1; accent-color: var(--accent); }
.note { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* 지점 정보 */
.inspect { position: absolute; top: 12px; right: 12px; width: 320px; max-height: calc(100% - 24px); overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.inspect .ih { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.inspect .loc { padding: 12px 14px 4px; }
.inspect .loc b { font-size: 15px; display: block; }
.inspect .loc span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.inspect h4 { font-size: 12px; color: var(--muted); font-weight: 600; margin: 14px 14px 4px; }
.kv { margin: 0 14px 12px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.kv .na { color: var(--muted); font-weight: 400; }

.maplibregl-ctrl-attrib { font: 10px var(--font); }
.maplibregl-ctrl-group { border-radius: var(--r) !important; box-shadow: var(--shadow) !important; }

/* 로그인 */
.login { position: fixed; inset: 0; z-index: 50; background: var(--surface); display: grid; place-items: center; }
.login .card { width: 360px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 28px; display: grid; gap: 12px; }
.login h1 { font-size: 18px; margin: 4px 0 0; } .login p { margin: 0; color: var(--muted); font-size: 13px; }
.login label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
.login input { height: 38px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 10px; }
.primary { height: 40px; border: 0; border-radius: var(--r); background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.primary:hover { background: var(--accent-ink); }
.err { color: var(--danger) !important; }


/* ---------------------------------------------------------------- 문서형 화면 (모니터링 · 자료) */
.ghost { height: 36px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg); cursor: pointer; color: var(--ink-2); }
.page { max-width: 1440px; margin: 0 auto; padding: 24px 32px 48px; display: grid; gap: 16px; }
.page > * { min-width: 0; }   /* 표가 넓어도 화면 밖으로 밀지 않게 — 칸 안(.tblwrap)에서 가로로 민다 */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 12.5px; }
.ph .sub { margin: 4px 0 0; }
p.note { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.warnbar { margin: 0; padding: 8px 12px; border-radius: var(--r); background: #fff7ed; color: #9a3412; font-size: 13px; border: 1px solid #fed7aa; }
.source { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; min-width: 0; }
.card h3 { margin: 0 0 6px; font-size: 14px; } .card > p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.65; }
.ch { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ch b { font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--line); border-left: 3px solid var(--lv, var(--line-2)); border-radius: 8px; padding: 12px 14px; display: grid; gap: 2px; background: var(--bg); }
.kpi .kl { font-size: 12.5px; color: var(--ink-2); }
.kpi b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi b.sm { font-size: 18px; } .kpi b small { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi .ks { font-size: 12px; color: var(--muted); min-height: 1em; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.mapcard { padding: 0; overflow: hidden; } .mapcard .ch { padding: 12px 16px 0; }
#mmap { height: 560px; border-top: 1px solid var(--line); margin-top: 10px; }
.mlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 16px; font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--line); }
.mlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.mlegend span:first-child:not(:has(i)) { color: var(--muted); }
.togs { display: flex; gap: 14px; }
.tog { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; cursor: pointer; } .tog input { accent-color: var(--accent); }
.stack { display: grid; gap: 12px; max-height: 640px; overflow-y: auto; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 13px; }
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows li p { flex-basis: 100%; margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.rows .num { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.stage { padding: 8px 0; border-top: 1px solid var(--line); } .stage b { margin-left: 6px; font-size: 13px; }
.stage p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.tblwrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td .sub { display: block; margin-top: 2px; }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.grp td { background: var(--surface); font-weight: 600; font-size: 12px; color: var(--ink-2); padding: 6px 10px; }
.tbl a { color: var(--accent-ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.muted { color: var(--muted); }
.btn { border: 1px solid var(--accent); color: var(--accent-ink); background: var(--bg); border-radius: var(--r); padding: 4px 10px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--accent-soft); } .btn.sm { font-size: 12px; padding: 2px 8px; }
.badge { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.badge.b-done { background: var(--accent-soft); color: var(--accent-ink); }
.badge.b-progress { background: #fef3c7; color: #92400e; } .badge.b-todo { background: #f1f5f9; color: #475569; }
.pbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--surface); margin: 0 0 10px; }
.pbar .b-done { background: var(--accent); } .pbar .b-progress { background: #f59e0b; } .pbar .b-todo { background: #cbd5e1; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 12px; }
iframe.embed { display: block; width: 100%; height: calc(100% - 56px); border: 0; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } .page { padding: 16px; } #mmap { height: 420px; } }
.card.slim { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 16px; } .card.slim b { font-size: 13.5px; }
p.note a, .card a { color: var(--accent-ink); }

/* 지역 분석 채팅 (chat.js) */
.chat { width: 400px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg); min-height: 0; }
.chat .chh { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat .log { position: relative; flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.chat .msg { flex-shrink: 0; max-width: 100%; font-size: 13.5px; }
.chat .chat-location { flex-shrink: 0; padding: 6px 14px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.chat[aria-busy="true"] .chip, .chat[aria-busy="true"] .redo, .chat[aria-busy="true"] .cbtn { opacity: .5; pointer-events: none; }
.chat .msg.me { align-self: flex-end; background: var(--accent); color: #fff; padding: 6px 10px; border-radius: 10px 10px 2px 10px; max-width: 85%; }
.chat .msg.bot { align-self: stretch; }
.chat .cc { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-top: 8px; }
.chat .cc > b { display: block; }
.chat .sub, .chat .muted { color: var(--muted); font-size: 12px; }
.chat .cc p { margin: 2px 0; }
.chat .big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.chat .big small { font-size: 13px; font-weight: 500; margin-left: 2px; }
.chat svg { width: 100%; height: auto; display: block; margin-top: 6px; }
.chat svg text { font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chat svg .g { stroke: var(--line); }
.chat .cchart.ec.line > div { width: 100%; height: 214px; } .chat .cchart.ec.bar > div { width: 100%; height: 118px; }      /* ECharts로 바꾼 뒤 */
.chat .ckey, .chat .stages { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; margin-top: 4px; }
.chat .ckey i, .chat .stage i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.chat .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 6px; }
.chat figure { margin: 0; }
.chat figure img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--surface); border-radius: 4px; }
.chat figcaption { font-size: 12px; margin-top: 2px; }
.chat .ramp { height: 8px; border-radius: 2px; }
.chat .ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.chat .note { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }
.chat .exs { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; border-top: 1px solid var(--line); }
.chat .chip { border: 1px solid var(--line-2); background: var(--bg); border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.chat .chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chat .chf { display: flex; gap: 6px; padding: 8px 14px 12px; }
.chat .chf input { flex: 1; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); }
.chatopen { position: absolute; top: 12px; right: 12px; z-index: 3; border: 0; background: var(--accent); color: #fff; border-radius: 999px; padding: 8px 14px; box-shadow: var(--shadow); cursor: pointer; font-weight: 600; }
@media (max-width: 900px) { .chat { position: absolute; inset: 56px 0 0 auto; width: min(400px, 100%); z-index: 4; } }

/* 출처 (sources.csv) */
.cite { display: block; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.cite a { color: var(--accent-ink); }
.cite.pending { font-style: italic; }
td .cite { margin-top: 0; }
.chat dl.srcs { margin: 6px 0 0; display: grid; grid-template-columns: 38% 1fr; gap: 4px 10px; font-size: 12px; }
.chat dl.srcs dt { color: var(--ink-2); } .chat dl.srcs dd { margin: 0; } .chat dl.srcs .cite { margin: 0; font-size: 12px; }
td .cite { margin-top: 0; min-width: 150px; }
.chat dl.srcs dd b { font-weight: 600; } .chat dl.srcs dd b.hit { color: var(--danger); }
.legend.slim { padding-bottom: 6px; } .legend.slim .cite { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend.slim .opacity { margin-top: 2px; }

/* 좁은 화면 — 지도가 가운데에서 너무 좁아지지 않게 (영어는 글자가 길다) */
@media (max-width: 1280px) { .panel { width: 300px; } .chat { width: 340px; } .search input { width: 220px; } }
@media (max-width: 1100px) { .chat { position: absolute; inset: 56px 0 0 auto; width: min(360px, 100%); z-index: 4; box-shadow: var(--shadow); }
  .nav a { padding: 6px 8px; } .brand span:last-child { display: none; } }
.inspect { max-width: calc(100% - 24px); }
.chat .chf input { min-width: 0; } .chat .chf .btn { flex: none; }
/* '지역 분석' 단추가 지도 오른쪽 위(KO·EN 아래)에 있을 때 — 지점 정보 창은 그 아래로 */
.mapwrap:has(.chatopen:not([hidden])) .inspect { top: 56px; max-height: calc(100% - 68px); }

/* 대화 기록 */
.chat .chh { gap: 8px; } .chat .cha { display: flex; gap: 6px; align-items: center; min-width: 0; }
.chat .cbtn { border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-2); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.chat .cbtn:hover, .chat .cbtn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.chat { position: relative; }
.chat .hist { flex: 1; min-height: 0; background: var(--bg); overflow-y: auto; padding: 12px 14px; border-top: 1px solid var(--line); }
.chat:has(.hist:not([hidden])) > :is(.log, .chat-location, .exs, .chf) { display: none; }
.chat .hist .hh { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; margin-bottom: 12px; }
.chat .hist .hh .sub { grid-column: 1 / -1; }
.chat .hist-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink-2); font-size: 22px; cursor: pointer; }
.chat .hist-close:hover, .chat .hist-close:focus-visible { color: var(--accent-ink); background: var(--accent-soft); }
.chat .hist ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.chat .hist li { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r); }
.chat .hist li.on { border-color: var(--accent); background: var(--accent-soft); }
.chat .hist .open { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 8px 10px; cursor: pointer; display: grid; gap: 2px; }
.chat .hist .open .t { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.chat .hist .open .d { font-size: 11.5px; color: var(--muted); }
.chat .hist .del { border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); min-width: 44px; padding: 0 10px; font-size: 12px; cursor: pointer; }
.chat .hist .del:hover, .chat .hist .del:focus-visible { color: var(--accent-ink); background: var(--accent-soft); }
.chat .msg.bot { position: relative; }
.chat .reply { overflow-wrap: anywhere; white-space: pre-line; }   /* 방법론 답(faq.py)은 여러 줄 */
.chat .acts { position: static; display: flex; justify-content: flex-end; clear: both; margin-top: 8px; }
.chat .redo { position: static; border: 0; background: none; color: var(--muted); font-size: 11.5px; cursor: pointer; padding: 6px 8px; border-radius: var(--r); }
.chat .redo:hover { background: var(--surface); }
.chat .votes, .chat .voted { display: inline-flex; align-items: center; gap: 2px; margin-right: auto; font-size: 11.5px; color: var(--muted); }
.chat .vote { border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: var(--r); font-size: 12px; color: var(--ink-2); }
.chat .vote:hover, .chat .vote:focus-visible { background: var(--surface); }
.chat .why { margin-right: 4px; }
.chat .redo:hover, .chat .redo:focus-visible { color: var(--accent-ink); }

/* 산불 월별 시뮬레이션 */
.ctl .fmrow { display: grid; grid-template-columns: 40px 56px 1fr; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.ctl .fmrow b { color: var(--ink); font-variant-numeric: tabular-nums; } .ctl .fmrow input { accent-color: var(--accent); width: 100%; }
.ctl .fmbar { display: flex; gap: 8px; align-items: center; } .ctl .fmbar .note { margin: 0; font-size: 11px; }
.tip { position: fixed; z-index: 50; background: var(--ink); color: #fff; font-size: 12px; line-height: 1.5; padding: 8px 10px; border-radius: var(--r);
  box-shadow: var(--shadow); white-space: pre-line; pointer-events: none; }
.chat dl.srcs .al { display: block; margin-bottom: 3px; } .chat dl.srcs .al b { color: var(--danger); }

/* 범례 — 여러 장일 때 보는 레이어만 펼침, 색 띠 양 끝의 뜻 */
.legend .lt { flex: 1; display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; text-align: left; cursor: default; min-width: 0; }
.legend .lt b { flex: 1; font-size: 13px; font-weight: 600; line-height: 1.35; }
.legend .lt .sw { width: 18px; height: 8px; border-radius: 2px; flex: none; }
.legend.mini { padding: 6px 10px; opacity: .92; cursor: pointer; } .legend.mini .lt { cursor: pointer; } .legend.mini .lt b { font-weight: 500; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend.mini:hover { border-color: var(--accent); }
.legend.focus { border-color: var(--accent); }
.legend .ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); margin-top: 1px; }
.legend .note.warn { color: var(--danger); }
.legends .lhint { font-size: 11px; color: var(--muted); background: rgba(255,255,255,.9); padding: 3px 8px; border-radius: var(--r); }

/* 머리 띠 계정 */
.account { display: flex; align-items: center; gap: 8px; }
.account .who { font-size: 12.5px; color: var(--ink-2); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .acct { height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg); color: var(--ink-2); cursor: pointer; white-space: nowrap; font-size: 13px; }
.account .acct:hover { border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 1100px) { .account .who { display: none; } }
.legends.playing .legend[data-id="fire_month"] :is(.note, details.more, .opacity) { display: none; }
.legends.playing .legend[data-id="fire_month"] { padding-bottom: 8px; }
/* 좁은 채팅 창 — 머리줄 단추가 잘리지 않게 */
.chat .chh { padding: 10px 12px; } .chat .chh > b { white-space: nowrap; } .chat .cha { flex-shrink: 0; gap: 4px; }
@media (max-width: 1280px) { .chat .cbtn { padding: 3px 8px; } }

/* 요약 브리핑 · 비교 */
.chat .brief .hl { margin: 6px 0 4px; padding-left: 18px; font-size: 12.5px; } .chat .brief .hl li { margin: 2px 0; }
.chat .cc h5 { font-size: 11.5px; color: var(--muted); margin: 10px 0 3px; font-weight: 600; }
.chat table.mini { width: 100%; border-collapse: collapse; font-size: 12px; }
.chat table.mini th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 3px 4px; }
.chat table.mini td { border-bottom: 1px solid var(--line); padding: 4px; vertical-align: top; } .chat table.mini td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.chat table.mini td.hot { color: var(--danger); font-weight: 600; } .chat table.mini .sub { display: block; font-weight: 400; }
.chat table.cmp td:first-child { color: var(--ink-2); width: 34%; }
/* 떼어 보기(모형) 겹창 */
.diorama { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 40%, #fbfcfd, #dfe5ec); }
.diorama .dh { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); background: var(--bg); }
.diorama .dh b { white-space: nowrap; }
.diorama .dh .note { margin-right: auto; font-size: 12px; }
.diorama .dx { display: inline-flex; gap: 6px; }
.diorama .dx[hidden] { display: none; }
.diorama .dh .x { margin-left: 8px; border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--ink-2); }
.diorama .dv { flex: 1; min-height: 0; position: relative; }
.diorama .dtip { position: absolute; z-index: 2; transform: translate(-50%, calc(-100% - 12px)); max-width: 280px; padding: 8px 11px; border-radius: 8px; background: var(--bg); box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.5; pointer-events: none; }
.diorama .dtip[hidden] { display: none; }
.diorama .dtip .muted { color: var(--muted); }
.diorama .df { padding: 8px 16px; text-align: center; }

/* ---------------------------------------------------------------- 재해 시뮬레이션 (sim.js) */
.sim .sb { padding: 10px 14px 12px; display: grid; gap: 8px; }
.sim .simrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sim .simrow .lbl { font-size: 12px; color: var(--muted); min-width: 64px; } .sim .simrow .lbl.sp { min-width: 0; margin-left: auto; }
.sim .simrow .seg button { padding: 3px 8px; font-size: 12px; }
.sim .simrow select { height: 28px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg); }
.sim .kv { margin: 0; } .sim .kv dd { font-weight: 500; font-size: 12px; } .sim .kv .bad { color: #b91c1c; }
.sim .simalert { background: #fef3c7; color: #92400e; border-radius: var(--r); padding: 6px 10px; font-size: 12.5px; font-weight: 600; }
.sim .simlg { display: grid; gap: 3px; font-size: 11.5px; color: var(--ink-2); }
.sim .simlg > div { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.sim .simlg b { font-weight: 600; color: var(--muted); min-width: 30px; font-size: 11px; }
.sim .simlg i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.sim .simlg i.sq { border-radius: 2px; width: 10px; height: 10px; }
.sim .simlg img { width: 16px; height: 16px; vertical-align: -4px; margin-right: 2px; }
.sim .link { border: 0; background: none; color: var(--accent-ink); cursor: pointer; padding: 0; font-size: 11px; text-decoration: underline; }
.simrain { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.mapwrap:has(.diorama) .simrain, .mapwrap:has(.diorama) .inspect.sim { z-index: 4; }      /* 모형 위에서도 시뮬레이션 창·빗줄기가 보이게 */
/* 사업장 일괄 평가 */
.scr textarea { width: 100%; box-sizing: border-box; margin: 6px 0 10px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13.5px; resize: vertical; }
.scr label { font-size: 13px; color: var(--ink-2); }
.scrbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .scrbar select { font: inherit; padding: 5px 8px; }
.tbl td.hot { color: var(--danger); font-weight: 600; }
#scrTbl th { font-size: 11.5px; line-height: 1.3; white-space: normal; vertical-align: bottom; min-width: 72px; }
#scrTbl th:first-child, #scrTbl th:nth-child(2) { min-width: 140px; }
#scrTbl thead tr.grp th { border-bottom: 0; padding-bottom: 2px; color: var(--ink-2); text-align: center; border-left: 1px solid var(--line); }
#scrTbl thead tr.grp th:first-child, #scrTbl thead tr.grp th:nth-child(2) { border-left: 0; text-align: left; }
#scrTbl tr.site td { border-bottom: 0; padding-bottom: 4px; }
#scrTbl tr.site td:first-child, #scrTbl tr.site td:nth-child(2) { min-width: 140px; max-width: 220px; }
#scrTbl td b { font-weight: 600; } #scrTbl td small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; white-space: nowrap; }
#scrTbl td.c { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
#scrTbl td.hot b { color: var(--danger); font-weight: 700; }
#scrTbl tr.hl td { padding: 0 10px 10px; font-size: 12px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
#scrTbl tr.hl td span::before { content: '요점 · '; color: var(--muted); } html[lang=en] #scrTbl tr.hl td span::before { content: 'Highlights · '; }
#scrTbl tr.hl td a { margin-left: 10px; }

/* 손전화 — 맨 끝에 둔다: 같은 선택자의 기본 규칙(.chatopen · .hint 등)이 뒤에 나오면 이긴다 */
@media (max-width: 900px) {
  /* 손전화 — 머리 띠는 메뉴를 가로로 밀어 보고(검색창은 뺀다), 레이어 목록은 아래 45% 서랍, 범례·지역 분석 단추는 그 위에 */
  .top { gap: 8px; padding: 0 12px; }
  .brand span:last-child { display: none; }
  .nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; gap: 0; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 8px; font-size: 13px; }
  .top-right { gap: 8px; margin-left: 0; } .search input { width: 120px; } .account .acct { padding: 0 8px; }
  .panel { position: absolute; z-index: 4; height: 45%; bottom: 0; width: 100%; border-top: 1px solid var(--line); }
  .legend { width: 220px; } .inspect { width: calc(100% - 24px); }
  .legends { bottom: calc(45% + 12px); max-height: calc(55% - 80px); }
  .hint { display: none; }
  .chatopen { top: auto; bottom: calc(45% + 12px); }
  .mapwrap:has(.chatopen:not([hidden])) .inspect { top: 12px; }
}
@media (max-width: 480px) { .brand b { display: none; } .search input { width: 96px; } }
/* 3D 건물 위험 현황 — 범례 맨 위 */
.bldcard { border-left: 3px solid #e5482f; }
.bldcard .big { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--ink); }
.bldcard .big b { color: #c2361f; }
.bldcard .rows { margin-top: 8px; display: grid; gap: 3px; font-size: 11.5px; color: var(--ink-2); }
.bldcard .rows div { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; }
.bldcard .rows b { font-weight: 600; color: var(--ink); text-align: right; }
.bldcard .rows small { grid-column: 1 / -1; color: var(--muted); padding-left: 8px; }
.bldcard .note { margin-top: 6px; }
.bldcard .ours { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.bldcard .ours button { flex: 1; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink-2); cursor: pointer; }
.bldcard .ours button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* 지도 화면 겉모습 (body.clean, demo.js clean) — 첫 화면은 지도만 (교수님 2026-11-10). 숨기기만 하면 못 찾으니(NN/g: 숨긴 메뉴는 발견율이 절반)
   구글 지도처럼 손잡이 셋은 늘 보인다: 왼쪽 위 검색창+☰(머리 띠) · 왼쪽 가장자리 '레이어' 탭 · 오른쪽 아래 '지역 분석'.
   열린 창은 지도 위에 겹친다(지도 크기 그대로). 가장자리에 마우스를 잠깐 대도 그쪽 창이 열린다 */
body.clean .body { height: 100%; }
body.clean .top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; transform: translateY(-100%); transition: transform .22s ease; }
body.clean .panel { position: fixed; top: 0; bottom: 0; left: 0; z-index: 19; box-shadow: var(--shadow); transform: translateX(-100%); transition: transform .22s ease; }
body.clean .chat { position: fixed; top: 0; bottom: 0; right: 0; z-index: 19; box-shadow: var(--shadow); transform: translateX(100%); transition: transform .22s ease; }
body.clean.ui-top :is(.panel, .chat) { top: 56px; }
body.clean.ui-top .top, body.clean.ui-left .panel, body.clean.chatonly .chat { transform: none; }
body.clean :is(.hint, .chatopen) { display: none; }
@media (prefers-reduced-motion: reduce) { body.clean :is(.top, .panel, .chat, .ptab, .fbar, .mapbar, .legends) { transition: none; } }
/* 검색창 + ☰ — 왼쪽 위, 목록 · 머리 띠가 열리면 비켜 선다 */
.fbar { position: absolute; top: 12px; left: 12px; z-index: 8; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg); box-shadow: var(--shadow); transition: left .22s ease, top .22s ease; }
.fbar .search input { width: 300px; height: 34px; border: 0; }
.fbar .search input:focus { outline: none; }
.fbar:focus-within { outline: 2px solid var(--accent); }
.demo-open { width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font-size: 17px; cursor: pointer; }
.demo-open:hover, .demo-open[aria-expanded="true"] { background: var(--surface); color: var(--ink); }
body.clean.ui-left .fbar { left: 352px; }
body.clean.ui-top .fbar { top: 68px; }
/* 지도 단추(2D · 3D · 영상 …) — 검색창 아래, 늘 보인다 (2026-11-12 사용자: 레이어 목록을 열어야만 보이면 거기까지 수평으로 이동해야 돼 불편) */
body.clean .mapbar { left: 12px; top: 60px; transition: left .22s ease, top .22s ease; }
body.clean.ui-left .mapbar { left: 352px; }
body.clean.ui-top .mapbar { top: 116px; }
/* 레이어 탭 — 왼쪽 가장자리 가운데, 목록이 열리면 목록 오른쪽 끝에 붙는다 (구글 지도 패널 접기 화살표) */
.ptab { position: fixed; left: 0; top: 50%; z-index: 18; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 5px;
  border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; background: var(--bg); color: var(--ink-2); font-size: 12px; cursor: pointer; box-shadow: var(--shadow); transition: left .22s ease; writing-mode: vertical-rl; letter-spacing: .1em; }
.ptab:hover { color: var(--accent-ink); background: var(--accent-soft); }
.ptab b { writing-mode: horizontal-tb; font-size: 11px; }
body.clean.ui-left .ptab { left: 340px; z-index: 20; }
body:not(.clean) .ptab, body:not(.clean) .cfab { display: none; }
/* 지역 분석(채팅) 단추 — 오른쪽 아래 */
/* 2026-11-19 상담 단추 관례(크게 · 둥글게 · 짙은 그림자)대로 키우고, 브이월드 출처 글줄(아래 10~30px)과 떨어지게 올렸다 */
.cfab { position: absolute; right: 56px; bottom: 60px; z-index: 8; display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 22px 0 18px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 20px rgba(15,27,45,.32); transition: transform .15s ease, background .15s ease; }
.cfab:hover { transform: translateY(-2px); }
.cfab:hover { background: var(--accent-ink); }
body.clean.chatonly .cfab { display: none; }
body.clean.ui-left .legends { left: 352px; }
.legends { transition: left .22s ease; }
.menu-close { display: none; }
body.clean.ui-top .menu-close { display: inline-flex; }     /* 머리 띠가 열렸을 때 — 오른쪽 끝 */
.clean-tip { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 7; padding: 8px 14px; border-radius: 18px; background: rgba(15,27,45,.72);
  color: #fff; font-size: 13px; pointer-events: none; transition: opacity .6s; white-space: nowrap; }
.clean-tip.gone { opacity: 0; }
@media (max-width: 720px) { .fbar .search input { width: 150px; } .cfab span { display: none; } .cfab { width: 50px; padding: 0; justify-content: center; font-size: 20px; } }
.story { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 120px); padding: 6px 8px; border-radius: 12px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.story b { font-size: 13px; margin: 0 8px 0 4px; white-space: nowrap; }
.story button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 5px 9px; border-radius: 999px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.story button span { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); font-size: 11px; font-variant-numeric: tabular-nums; }
.story button:hover { background: var(--surface); color: var(--ink); }
.story button.on { background: var(--accent); color: #fff; font-weight: 600; }
.story button.on span { background: rgba(255,255,255,.25); }
body.demo.ui-top .story { top: 68px; }     /* 머리 띠를 열어도 단계 띠는 그 아래에 — 숨기면 메뉴가 단추를 덮은 것처럼 보였다 (2026-11-13 사용자) */
.story-cap { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 7; margin: 0; max-width: min(720px, calc(100% - 660px)); padding: 10px 16px; border-radius: 10px;
  background: rgba(15,27,45,.78); color: #fff; font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.story-cap:empty { display: none; }
body.demo.ui-top .story-cap { display: none; }
body.clean .story { left: 366px; transform: none; max-width: calc(100% - 378px); justify-content: flex-start; }     /* 시연 단계 띠 — 왼쪽 위 검색창(354px) 오른쪽에 */
body.clean.ui-left .story { left: 706px; max-width: calc(100% - 718px); }
body.demo.chatonly .story { max-width: calc(100% - 378px - 412px); }     /* 요약 단계 — 채팅(400px) 왼쪽까지 */
body.demo.chatonly .story-cap { left: calc(300px + (100% - 700px) / 2); max-width: calc(100% - 740px); }     /* 왼쪽 범례(300)와 채팅(400) 사이 가운데 */
/* 채팅 지우기 — 되돌리기 알림 · 목록 '모두 지우기' · 답마다 '지우기' */
.chat .ctoast { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 14px 0; padding: 8px 12px; border-radius: var(--r); background: var(--ink); color: #fff; font-size: 12.5px; }
.chat .ctoast[hidden] { display: none; }
.chat .ctoast .link { color: #7ee0d4; font-weight: 600; border: 0; background: none; cursor: pointer; padding: 0; }
.chat .hist .hh .delall { grid-column: 1 / -1; justify-self: start; font-size: 12px; color: var(--danger); border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; }
.chat .qdel:hover, .chat .qdel:focus-visible { color: var(--danger); }
/* 떼어 보기 모형 (깨끗한 화면) — 범례를 모형 위로, 제목줄은 왼쪽 위 검색창 오른쪽부터, 상단 메뉴를 열면 그 아래로 */
.mapwrap:has(.diorama) .legends { z-index: 4; }
.mapwrap:has(.diorama) .mapbar { z-index: 2; }       /* 입체 모형(3)이 떠 있을 때는 전처럼 그 아래 */
body.clean .diorama .dh { padding-left: 366px; min-height: 58px; }
body.clean.ui-left .diorama .dh { padding-left: 706px; }
body.demo .diorama .dh { padding-top: 64px; padding-left: 16px; }     /* 시연 단계 띠(위 12px · 한 줄 약 40px)가 모형 제목줄을 덮었다 — 그 아래로 (2026-11-13 사용자) */
body.clean.ui-top .diorama { top: 56px; }
body.clean:not(.ui-left) .legends { left: 52px; }        /* 왼쪽 가장자리 레이어 탭(약 40px)에 안 가리게 */
body.clean.chatonly .diorama .dh { padding-right: 412px; }     /* 채팅(400px)이 열려 있어도 모형의 받기 · 닫기 단추가 가려지지 않게 */

/* 관측소 카드 (지하수 관측정 · 수질측정소) — 눈에 띄는 것은 그래프 하나: 평년과의 사이를 물빛·녹빛으로 칠한다. 나머지는 조용히 */
.st { padding: 14px 14px 12px; --up: #2a78d6; --down: #a8452c; }
.st h3 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.st .sthead { margin: 8px 0 0; display: flex; align-items: baseline; gap: 8px; }
.st .sthead b { font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.st .sthead.up b { color: var(--up); } .st .sthead.down b { color: var(--down); }
.st .sthead span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.st .stcells { display: flex; gap: 18px; margin: 10px 0 0; }
.st .stcells div { min-width: 0; }
.st .stcells span { display: block; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.st .stcells b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st .stvars { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 14px 0 0; border-bottom: 1px solid var(--line); }
.st .stvars button { border: 0; background: none; padding: 4px 0 5px; margin-bottom: -1px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.st .stvars button:hover { color: var(--ink); }
.st .stvars button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.st .stbar { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 2px; }
.st .stunit { font-size: 11.5px; color: var(--muted); }
.st .stbar .seg button { padding: 2px 9px; font-size: 12px; }
.st .stchart svg { display: block; width: 100%; height: auto; font-size: 9.5px; fill: var(--muted); font-variant-numeric: tabular-nums; cursor: crosshair; }
.st .stchart .g { stroke: var(--line); } .st .stchart .z { stroke: var(--line-2); }
.st .stchart .lv { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.st .stchart .nm { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 2; }
.st .stchart .hair { stroke: var(--ink); stroke-width: .6; }
.st .stchart .stec { width: 100%; height: 204px; }      /* ECharts — 구간 손잡이까지 */
.st .stread { margin: 2px 0 0; min-height: 18px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.st .stkey i { display: inline-block; width: 9px; height: 9px; margin: 0 4px 0 0; opacity: .55; } .st .stkey i + i, .st .stkey i:nth-of-type(2) { margin-left: 10px; }
.st .stnote { margin: 6px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.st .stinfo { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; }
.st .stinfo dt { color: var(--muted); white-space: nowrap; } .st .stinfo dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.st button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 지도 오른쪽 아래 단추 — 인쇄 그림이 확대·축소보다 크고 진해서 튀었다: 같은 무게로 */
.maplibregl-ctrl-group .maplibregl-export-control { background-size: 17px 17px !important; opacity: .72; }
.maplibregl-ctrl-group .maplibregl-export-control:hover { opacity: 1; }
.maplibregl-ctrl-scale { border-color: var(--ink-2); border-width: 0 1px 1px; color: var(--ink-2); background: rgba(255,255,255,.7); font: 10.5px var(--font); }
#datasets > p.note { margin-bottom: 10px; }
/* 시연 — 단계 띠(두 줄)가 지점 정보 머리를 가리지 않게 띠 아래로 */
body.demo .inspect { top: 96px; max-height: calc(100% - 108px); }
.inspect #inspectBody > p.note { margin: 6px 14px 12px; }      /* 지점 정보 맨 아래 공시지가 안내 — 왼쪽 끝에 붙어 잘려 보였다 */
/* 안내 띠 — 좁은 화면에서는 줄을 바꿔 화면 안에 (한 줄로 두면 휴대폰에서 화면이 가로로 51px 넘쳤다) */
.clean-tip { max-width: calc(100% - 24px); box-sizing: border-box; }
@media (max-width: 720px) { .clean-tip { white-space: normal; text-align: center; width: max-content; bottom: 122px; } }
.pinname{background:#fff;color:#0f2a44;border:1px solid #0f766e;border-radius:4px;padding:2px 7px;font-size:12px;font-weight:600;white-space:nowrap;box-shadow:0 1px 3px rgba(0,0,0,.2);pointer-events:none}
/* 시군구 평균 — 순위 막대 · 마우스 값 */
.legend.rank b { font-size: 12.5px; }
.legend.rank ol { list-style: none; margin: 6px 0 4px; padding: 0; }
.legend.rank li { display: grid; grid-template-columns: 22px 1fr 60px 44px; gap: 6px; align-items: center; font-size: 11.5px; padding: 2px 4px; border-radius: 4px; cursor: pointer; }
.legend.rank li .k { color: var(--ink-3, #6b7a90); text-align: right; font-variant-numeric: tabular-nums; }
.legend.rank li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend.rank li .nm em { font-style: normal; color: var(--accent-ink, #0f766e); font-size: 10.5px; }
.legend.rank li .bar { height: 6px; background: var(--line, #e6eaf0); border-radius: 3px; overflow: hidden; }
.legend.rank li .bar i { display: block; height: 100%; background: #0f766e; }
.legend.rank li .v { text-align: right; font-variant-numeric: tabular-nums; }
.legend.rank li.hl, .legend.rank li:hover { background: #e6f2f1; }
.legend.rank li.here { font-weight: 600; }
.choropop .maplibregl-popup-content { padding: 6px 9px; font-size: 12px; line-height: 1.45; }
/* 채팅(지역 분석)이 열려 있으면 지점 정보 · 시뮬레이션 창은 채팅 왼쪽에 — 같은 오른쪽 위에 떠서 서로 가렸다 (2026-11-17 사용자) */
body.clean.chatonly .inspect { right: 412px; }
@media (max-width: 1280px) { body.clean.chatonly .inspect { right: 352px; } }
@media (max-width: 1100px) { body.clean.chatonly .inspect { right: 372px; max-width: calc(100% - 384px); } }
@media (max-width: 900px) { body.clean.chatonly .inspect { right: 12px; max-width: calc(100% - 24px); } }     /* 손전화는 나란히 둘 자리가 없다 */
.chat .picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }     /* 되물은 곳 — 눌러서 고른다 */
.chat .picks .chip { font-size: 12.5px; padding: 4px 12px; }
/* 시군구 순위 — 값 · 변화 · 과거 건수 / 사는 곳 · 땅 전체 */
.legend .sggsw { margin: 7px 0 2px; } .legend .sggsw button { padding: 2px 10px; font-size: 12px; }
/* 토지 · 자산 — 다른 묶음과 같은 모양, 위쪽 재해 묶음과는 간격과 굵은 줄로 나눈다 (2026-11-19) */
.group.assets { margin-top: 18px; border-top: 2px solid var(--line-2); }
.legend.rank .rk { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.legend.rank .rk .seg button { padding: 2px 8px; font-size: 11.5px; }
/* 지점 정보 창은 지도 단추 줄(z 2)보다 위 — 좁은 화면에서 단추가 창 제목을 덮었다 (2026-11-17) */
.inspect { z-index: 3; }
/* 지도 조작 도움말 (「?」) */
.medot { width: 14px; height: 14px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(37,99,235,.35), 0 1px 4px rgba(0,0,0,.4); }
.toast { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); z-index: 9; background: rgba(15,27,45,.9); color: #fff; font-size: 13px; line-height: 1.45; padding: 8px 14px; border-radius: 8px; width: max-content; max-width: calc(100% - 32px); }
.maphelp { position: absolute; right: 56px; bottom: 84px; z-index: 9; width: min(340px, calc(100% - 72px)); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; font-size: 12.5px; }
.maphelp .mh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; } .maphelp .mh b { font-size: 13.5px; }
.maphelp .x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }
.maphelp dl { margin: 0; } .maphelp dl > div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); }
.maphelp dt { font-weight: 600; } .maphelp dd { margin: 0; color: var(--ink-2); } .maphelp p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

/* 불러오는 중 — 화면 가운데 도는 고리 + 글자 (침수심 3D의 .f3load와 같은 모양, 모니터링에서 씀) */
.pgload { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; display: inline-flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-radius: 10px; background: rgba(17, 24, 39, .86); color: #fff; font-size: 14px; pointer-events: none; }
.pgload[hidden] { display: none; }
#mmap .pgload { position: absolute; }      /* 지도 안으로 옮긴 뒤엔 지도 가운데 */
.pgload i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: pgspin .8s linear infinite; }
@keyframes pgspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pgload i { animation-duration: 2.4s; } }
