/* 하진 DMZ 지도 — 디자인 토큰 · 레이아웃 · 컴포넌트
   테마: data-theme(dark·paper·contrast), 밀도: data-density(cozy·compact),
   배치: data-layout(overlay·docked·focus·command), 모바일은 760px 이하에서 하단 탭 + 시트로 바뀐다. */

:root {
  --bg: #0f100e;
  --map-bg: #0a0b09;
  --s1: #151613;
  --s2: #1b1d19;
  --s3: #23261f;
  --line: rgba(233, 231, 224, .075);
  --line-2: rgba(233, 231, 224, .14);
  --text: #e9e7e0;
  --text-2: #b4b3a9;
  --muted: #84857a;
  --accent: #e3a443;
  --accent-ink: #1b1205;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --ok: #7cc48a;
  --warn: #dc8443;
  --danger: #d4574e;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -12px rgba(0,0,0,.6);
  --r-sm: 6px;
  --r: 9px;
  --r-lg: 14px;
  --pad: 14px;
  --row: 40px;
  --rail-w: 60px;
  --drawer-w: 372px;
  --detail-w: 344px;
  --pin: 26px;
  --font: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
[data-theme="paper"] {
  --bg: #e7e3d8; --map-bg: #cfcabd; --s1: #f5f2ea; --s2: #ede9df; --s3: #e3ded2;
  --line: rgba(29, 30, 26, .09); --line-2: rgba(29, 30, 26, .17);
  --text: #1d1e1a; --text-2: #48493f; --muted: #76776b;
  --shadow: 0 12px 32px -14px rgba(40, 36, 24, .35);
  color-scheme: light;
}
[data-theme="contrast"] {
  --bg: #000; --map-bg: #000; --s1: #0b0b0b; --s2: #151515; --s3: #202020;
  --line: rgba(255,255,255,.2); --line-2: rgba(255,255,255,.34);
  --text: #fff; --text-2: #e0e0e0; --muted: #b5b5b5;
}
[data-density="compact"] { --pad: 11px; --row: 34px; --drawer-w: 340px; --detail-w: 320px; }
[data-pin="s"] { --pin: 21px; }
[data-pin="l"] { --pin: 31px; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .38; cursor: default; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
svg { display: block; flex: none; }
svg:not([width]) { width: 16px; height: 16px; } /* 아이콘 기본 크기. 아래 규칙이 덮어쓴다 */
.d-kicker svg { width: 14px; height: 14px; }
kbd { font: 500 11px var(--mono); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--text-2); }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-feature-settings: 'zero'; }
.muted { color: var(--muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────── 앱 셸 ───────── */
.app { display: grid; grid-template-columns: var(--rail-w) auto 1fr auto; height: 100vh; height: 100dvh; }
.stage { grid-column: 3; position: relative; min-width: 0; overflow: hidden; }
#map { position: absolute; inset: 0; z-index: 0; background: var(--map-bg); }

/* 레일 */
.rail { grid-column: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; background: var(--s1); border-right: 1px solid var(--line); z-index: 20; }
.rail-mark { width: 40px; height: 40px; margin-bottom: 10px; border-radius: 9px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); }
.rail-mark img { width: 100%; height: 100%; display: block; }
.rail-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); transition: background .15s, color .15s; }
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn:hover { color: var(--text); background: var(--s2); }
.rail-btn.on { color: var(--text); background: var(--s3); }
.rail-btn.on::before { content: ''; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail-btn .dot { position: absolute; top: 8px; right: 8px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; font: 700 9.5px/15px var(--mono); background: var(--accent); color: var(--accent-ink); }
.rail-btn .dot:empty { display: none; }
.rail-btn .tip { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); padding: 4px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap; background: var(--text); color: var(--bg); opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 50; }
.rail-btn:hover .tip { opacity: 1; transition-delay: .35s; }
.rail-label { display: none; }
.rail-spacer { flex: 1; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--s3); color: var(--text-2); font: 600 12px var(--font); }
.avatar svg { width: 16px; height: 16px; }
.sync-dot { position: absolute; right: 7px; bottom: 7px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--s1); background: var(--muted); }
.sync-dot.ok { background: var(--ok); } .sync-dot.busy { background: var(--accent); } .sync-dot.err { background: var(--danger); }

/* 서랍(왼쪽 패널) · 상세(오른쪽 패널) 공통 */
.sheet { display: flex; flex-direction: column; min-height: 0; background: var(--s1); }
.sheet-grip { display: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 var(--pad) 0 calc(var(--pad) + 2px); border-bottom: 1px solid var(--line); flex: none; }
.sheet-title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.sheet-head .grow { flex: 1; }
.sheet-body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: var(--pad) var(--pad) 28px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.drawer { grid-column: 2; width: var(--drawer-w); border-right: 1px solid var(--line); z-index: 15; }
.detail { grid-column: 4; width: var(--detail-w); border-left: 1px solid var(--line); z-index: 15; }

/* 배치: 겹침(기본) — 서랍·상세가 지도 위에 떠 있다 */
[data-layout="overlay"] .drawer,
[data-layout="overlay"] .detail,
[data-layout="focus"] .detail { position: absolute; top: 10px; bottom: 10px; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; transition: transform .26s var(--ease), opacity .2s; }
[data-layout="overlay"] .drawer { left: calc(var(--rail-w) + 10px); }
/* 상세 패널은 오른쪽 아래 지도 버튼과 겹치지 않을 만큼만 내려온다(버튼은 오른쪽 가장자리에 그대로 둔다) */
[data-layout="overlay"] .detail, [data-layout="focus"] .detail { right: 10px; bottom: auto; max-height: calc(100% - var(--tools-h, 300px) - 34px); }
[data-layout="overlay"] .app:not(.drawer-open) .drawer { transform: translateX(calc(-100% - 80px)); opacity: 0; pointer-events: none; }
.app:not(.detail-open) .detail { display: none; }
[data-layout="overlay"] .app.drawer-open .float-tl { left: calc(var(--drawer-w) + 22px); }
.float-br { transition: right .26s var(--ease); }

/* 배치: 분할 — 서랍·상세가 열로 붙고 지도가 줄어든다 */
[data-layout="docked"] .app:not(.drawer-open) .drawer { display: none; }

/* 배치: 집중 — 레일·서랍을 숨기고 지도만 */
[data-layout="focus"] .rail, [data-layout="focus"] .drawer { display: none; }
[data-layout="focus"] .app { grid-template-columns: 0 0 1fr auto; }
.focus-exit { display: none; }
[data-layout="focus"] .focus-exit { display: grid; }

/* 배치: 관제 — 넓은 화면용 3열, 오른쪽 패널을 항상 켠다 */
[data-layout="command"] { --drawer-w: 400px; --detail-w: 380px; }
[data-layout="command"] .app .drawer { display: flex; }
[data-layout="command"] .app .detail { display: flex; }

/* ───────── 지도 위 떠 있는 것들 ───────── */
.float { position: absolute; z-index: 10; }
.float-tl { top: 12px; left: 12px; right: 12px; pointer-events: none; transition: left .26s var(--ease), right .26s var(--ease); }
.float-tl > * { pointer-events: auto; }
[data-layout="overlay"] .app.detail-open .float-tl { right: calc(var(--detail-w) + 22px); }
.float-br { right: 12px; bottom: 12px; }
.float-bl { left: 12px; bottom: 12px; }
.float-tc { top: 12px; left: 50%; transform: translateX(-50%); }
.hud-wrap { top: auto; bottom: 14px; }

.omni { position: relative; width: min(420px, 100%); }
.omni-box { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 8px 0 12px; border-radius: var(--r); background: var(--s1); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.omni-box svg { width: 16px; height: 16px; color: var(--muted); }
.omni-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 14px; }
.omni-box input::placeholder { color: var(--muted); }
.omni-box:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--line-2)); }
.omni-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: min(60vh, 520px); overflow: auto; padding: 4px; border-radius: var(--r); background: var(--s1); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.omni-group { padding: 8px 10px 4px; font: 600 10.5px var(--mono); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.omni-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 6px 10px; border-radius: 7px; text-align: left; }
.omni-item.active, .omni-item:hover { background: var(--s3); }
.omni-item .t { flex: 1; min-width: 0; }
.omni-item .s { font-size: 12px; color: var(--muted); white-space: nowrap; }
.omni-empty { padding: 16px; color: var(--muted); font-size: 13px; }

/* 맵 · 층 고르기 (검색창 아래) */
.mapbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; width: fit-content; }
.mapseg { display: flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--s1); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.mapseg button { height: 30px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.mapseg button:hover { color: var(--text); }
.mapseg button.on { background: var(--accent); color: #151613; }
.mapseg.floors button.on { background: var(--s3); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset; }
.map-under.leaflet-container { background: #0c0d0c; }
.d-goto { width: 100%; justify-content: center; margin: 4px 0 10px; }

/* 빠른 필터 칩 */
.quick { display: flex; gap: 6px; margin-top: 8px; max-width: 100%; width: max-content; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.quick::-webkit-scrollbar { display: none; }
.qchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 15px; font-size: 12.5px; font-weight: 550; background: var(--s1); border: 1px solid var(--line-2); color: var(--text-2); box-shadow: var(--shadow); white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.qchip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.qchip:hover { color: var(--text); }
.qchip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.qchip.on i { box-shadow: 0 0 0 2px var(--bg); }

/* 지도 도구 */
.tools { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.toolgroup { display: flex; flex-direction: column; border-radius: var(--r); background: var(--s1); border: 1px solid var(--line-2); box-shadow: var(--shadow); overflow: hidden; }
.tbtn { width: 38px; height: 38px; display: grid; place-items: center; color: var(--text-2); }
.tbtn + .tbtn { border-top: 1px solid var(--line); }
.tbtn svg { width: 17px; height: 17px; }
.tbtn:hover { color: var(--text); background: var(--s2); }
.tbtn.on { color: var(--accent); }
.focus-exit { width: 40px; height: 40px; place-items: center; border-radius: var(--r); background: var(--s1); border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--text-2); }
.coord { font: 500 11.5px var(--mono); color: var(--text-2); padding: 4px 8px; border-radius: 6px; background: color-mix(in srgb, var(--s1) 88%, transparent); border: 1px solid var(--line); }
.coord:empty { display: none; }

/* 상태 띠 (강조·고르기 안내) */
.banner { display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 40px)); padding: 6px 6px 6px 14px; border-radius: 20px; background: var(--text); color: var(--bg); font-size: 13px; box-shadow: var(--shadow); }
.banner b { font-weight: 650; }
.banner button { height: 26px; padding: 0 11px; border-radius: 13px; background: var(--bg); color: var(--text); font-size: 12px; font-weight: 600; flex: none; }
.banner .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 레이드 HUD */
.hud { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 6px 0 14px; border-radius: 20px; background: var(--s1); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 13px; }
.hud-time { font: 600 15px var(--mono); letter-spacing: .02em; }
.hud-time.alert { color: var(--danger); }
.hud-sep { width: 1px; height: 18px; background: var(--line-2); }
.hud-next { max-width: 240px; color: var(--text-2); }
.hud-next b { color: var(--text); font-weight: 600; }
.hud button { height: 28px; padding: 0 12px; border-radius: 14px; background: var(--s3); font-size: 12px; font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 3000; padding: 9px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 500; box-shadow: var(--shadow); transition: .22s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ───────── 공통 컴포넌트 ───────── */
.label { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; font: 600 10.5px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.label:first-child { margin-top: 2px; }
.label .end { margin-left: auto; display: flex; gap: 12px; text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 12px; }
.label .n { color: var(--text-2); }
.lead { margin: 0 0 12px; color: var(--text-2); font-size: 13px; }
.note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.link { color: var(--accent); font-weight: 600; font-size: 12.5px; }
.link.danger { color: var(--danger); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; background: var(--s3); color: var(--text); border: 1px solid var(--line); white-space: nowrap; transition: background .15s, border-color .15s; }
.btn svg { width: 15px; height: 15px; }
.btn:hover:not(:disabled) { border-color: var(--line-2); background: color-mix(in srgb, var(--s3) 70%, var(--text) 6%); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn-ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--s2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); }
.btns { display: flex; gap: 6px; flex-wrap: wrap; }
.btns > .btn { flex: 1; }
.ibtn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--muted); flex: none; }
.ibtn svg { width: 16px; height: 16px; }
.ibtn:hover { color: var(--text); background: var(--s3); }
.ibtn.on { color: var(--accent); }
.ibtn.danger:hover { color: var(--danger); }

.seg { display: flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--s2); border: 1px solid var(--line); }
.seg button { flex: 1; height: 30px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--s3); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset; }
.seg.scroll { overflow-x: auto; scrollbar-width: none; }
.seg.scroll button { flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; font-size: 12.5px; font-weight: 500; color: var(--text-2); border: 1px solid var(--line-2); text-decoration: none; white-space: nowrap; }
.chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.chip.on { color: var(--text); background: var(--s3); border-color: var(--text-2); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.chip .n { font: 500 11px var(--mono); color: var(--muted); }

.field { width: 100%; height: 38px; padding: 0 11px; border-radius: var(--r-sm); background: var(--s2); border: 1px solid var(--line); outline: none; }
textarea.field { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.field:focus { border-color: color-mix(in srgb, var(--accent) 60%, var(--line-2)); }
.field.sm { height: 30px; width: auto; padding: 0 8px; font-size: 12.5px; }
select.field { cursor: pointer; }
.form { display: grid; gap: 8px; }

.toggle { position: relative; width: 36px; height: 22px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; border-radius: 11px; background: var(--s3); border: 1px solid var(--line-2); transition: .15s; pointer-events: none; }
.toggle span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: .18s var(--ease); }
.toggle input:checked + span { background: var(--accent); border-color: transparent; }
.toggle input:checked + span::after { transform: translateX(14px); background: var(--accent-ink); }

.check { position: relative; width: 20px; height: 20px; flex: none; }
.check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.check span { position: absolute; inset: 0; border-radius: 5px; border: 1.5px solid var(--line-2); pointer-events: none; display: grid; place-items: center; }
.check input:checked + span { background: var(--accent); border-color: transparent; }
.check input:checked + span::after { content: ''; width: 9px; height: 5px; margin-top: -2px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg); }

/* 목록 줄 */
.list { display: grid; gap: 2px; }
.row { display: flex; align-items: center; gap: 11px; min-height: var(--row); padding: 6px 8px; border-radius: var(--r-sm); text-align: left; width: 100%; }
button.row:hover, .row.click:hover { background: var(--s2); cursor: pointer; }
.row.on { background: var(--s3); }
.row.dim { opacity: .45; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub.wrap, .row-title.wrap { white-space: normal; }
.row-end { display: flex; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; }
.glyph { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; color: var(--c, var(--text-2)); background: color-mix(in srgb, var(--c, var(--text)) 13%, transparent); }
.glyph svg { width: 15px; height: 15px; }
.num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 700 11px var(--mono); background: var(--s3); color: var(--text-2); }
.num.go { background: var(--ok); color: #0d1a0f; } .num.end { background: var(--danger); color: #fff; } .num.tg { background: var(--accent); color: var(--accent-ink); }

.card { padding: 12px 13px; border-radius: var(--r); background: var(--s2); border: 1px solid var(--line); }
.card + .card { margin-top: 8px; }
.card-head { display: flex; align-items: center; gap: 8px; }
.card-title { font-weight: 650; font-size: 14px; }
.card p { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }

.threat { display: inline-flex; align-items: center; gap: 6px; font: 600 11px var(--mono); color: var(--c); white-space: nowrap; }
.threat::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 11.5px; color: var(--text-2); background: var(--s3); white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.src { display: inline-flex; align-items: center; gap: 5px; font: 600 10.5px var(--mono); letter-spacing: .03em; color: var(--muted); }
.src::before { content: ''; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.src.s-official { color: var(--text-2); } .src.s-official::before { background: currentColor; }
.src.s-verified { color: var(--ok); } .src.s-verified::before { background: currentColor; }
.src.s-community { color: #c9a95a; } .src.s-community::before { border-style: dashed; }
.src.s-research { color: #7fb2c2; } .src.s-research::before { box-shadow: 0 0 0 2px var(--s1), 0 0 0 3px currentColor; }
.src.s-mine { color: var(--accent); } .src.s-mine::before { border-style: dashed; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border-radius: var(--r); overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.stat { padding: 10px 12px; background: var(--s2); }
.stat span { display: block; font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; margin-top: 2px; font: 600 17px var(--mono); letter-spacing: -.01em; }
.bar { height: 3px; border-radius: 2px; background: var(--s3); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.callout { padding: 10px 12px; border-radius: var(--r-sm); background: var(--s2); border-left: 2px solid var(--warn); font-size: 12.5px; color: var(--text-2); }
.empty { padding: 26px 8px; text-align: center; color: var(--muted); font-size: 13px; }
.empty b { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* 체크리스트 */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.checks li { display: flex; gap: 10px; padding: 9px 12px; background: var(--s2); font-size: 12.5px; color: var(--text-2); }
.checks li::before { content: ''; flex: none; width: 6px; height: 6px; margin-top: 6px; border-radius: 1px; background: var(--muted); }
.checks li.need { color: var(--text); } .checks li.need::before { background: var(--accent); }
.checks li.warn::before { background: var(--warn); border-radius: 50%; }

/* 단계 목록 */
.steps { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 1px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; font-size: 12.5px; color: var(--text-2); border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps li .t { flex: 1; }
.steps li.done .t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }

/* 무기·아이템 */
.tier { display: inline-grid; place-items: center; min-width: 30px; height: 20px; padding: 0 5px; border-radius: 4px; font: 700 10px var(--mono); background: var(--s3); color: var(--text-2); }
.tier.t-META { background: var(--accent); color: var(--accent-ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cell { padding: 9px 10px; border-radius: var(--r-sm); background: var(--s2); border: 1px solid var(--line); }
.cell b { display: block; font-size: 13px; font-weight: 600; }
.cell span { font-size: 11.5px; color: var(--muted); }
.mats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.mat { height: 26px; padding: 0 9px; border-radius: 5px; font-size: 12px; border: 1px solid var(--line-2); color: var(--text-2); }
.mat b { font-family: var(--mono); color: var(--text); margin-left: 3px; }
.mat:hover { border-color: var(--accent); color: var(--text); }
.mat.basic { border-style: dashed; }

/* 레이어 목록 */
.layer-group + .layer-group { margin-top: 2px; }
.lg-head { display: flex; align-items: center; gap: 10px; min-height: var(--row); padding: 0 6px 0 8px; border-radius: var(--r-sm); }
.lg-head:hover { background: var(--s2); }
.lg-name { flex: 1; text-align: left; font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; height: var(--row); }
.lg-name .n { font: 500 11.5px var(--mono); color: var(--muted); }
.lg-name svg { width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.layer-group.open .lg-name svg { transform: rotate(90deg); }
.lg-sw { width: 16px; height: 16px; border-radius: 4px; background: var(--c); flex: none; margin: 0 4px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.layer-group.part .lg-sw { background: linear-gradient(135deg, var(--c) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--c); }
.layer-group.off .lg-sw { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.layer-group.off .lg-name { color: var(--muted); }
.lg-items { display: none; padding: 2px 0 6px 26px; }
.layer-group.open .lg-items { display: block; }
.lt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 0 8px; border-radius: var(--r-sm); font-size: 13px; color: var(--text-2); }
.lt:hover { background: var(--s2); color: var(--text); }
.lt .glyph { width: 22px; height: 22px; border-radius: 5px; }
.lt .glyph svg { width: 12px; height: 12px; }
.lt .n { margin-left: auto; font: 500 11.5px var(--mono); color: var(--muted); }
.lt.off { opacity: .4; }

/* 상세 패널 */
.d-kicker { display: flex; align-items: center; gap: 8px; font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c, var(--muted)); }
.d-title { margin: 6px 0 2px; font-size: 19px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; }
.d-en { font-size: 12px; color: var(--muted); }
.d-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.d-meta .mono { color: var(--text); }
.d-note { margin: 14px 0 0; font-size: 13.5px; line-height: 1.6; }
.d-orig { margin-top: 4px; font-size: 12px; color: var(--muted); }
.d-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 12px 0 0; font-size: 12.5px; line-height: 1.55; }
.d-facts dt { color: var(--muted); }
.d-facts dd { margin: 0; color: var(--text-2); }
.d-about { margin-top: 12px; font-size: 12.5px; color: var(--text-2); padding-left: 10px; border-left: 2px solid var(--line-2); }
.d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 16px; }
.d-actions .btn.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); }
.d-actions .btn.on svg { color: var(--accent); }
.d-more { display: flex; gap: 2px; margin-top: 6px; }
.d-near { margin-top: 4px; }

/* ───────── 지도 마커 ───────── */
.leaflet-container { font-family: var(--font); background: var(--map-bg); }
.leaflet-image-layer { transition: filter .3s; }
[data-mapstyle="calm"] .leaflet-image-layer { filter: saturate(.35) brightness(.78) contrast(1.05); }
[data-mapstyle="vivid"] .leaflet-image-layer { filter: saturate(1.25) brightness(1.08) contrast(1.08); }
[data-theme="paper"] .leaflet-image-layer { filter: saturate(.7) brightness(1.06) contrast(.95); }
.leaflet-control-container { display: none; }
.pin { --c: #fff; position: relative; width: var(--pin); height: var(--pin); margin: calc(var(--pin) / -2) 0 0 calc(var(--pin) / -2); border-radius: 50%; display: grid; place-items: center; background: #121310; color: var(--c); box-shadow: 0 0 0 1.5px var(--c), 0 2px 5px rgba(0,0,0,.55); transition: transform .14s var(--ease), opacity .18s; will-change: transform; }
.pin svg { width: 52%; height: 52%; }
.pin:hover { transform: scale(1.14); z-index: 1; }
.pin.s-community { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent), 0 2px 5px rgba(0,0,0,.55); opacity: .85; }
.pin.s-research { box-shadow: 0 0 0 1.5px var(--c), 0 0 0 3.5px #121310, 0 0 0 4.5px color-mix(in srgb, var(--c) 60%, transparent); }
.pin.s-mine { background: color-mix(in srgb, var(--accent) 22%, #121310); box-shadow: 0 0 0 1.5px var(--accent), 0 2px 5px rgba(0,0,0,.55); color: var(--accent); }
.pin.s-verified::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px #121310; }
.pin.owned::before { content: ''; position: absolute; left: -2px; top: -2px; width: 9px; height: 9px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 2px #121310; }
.pin.starred { box-shadow: 0 0 0 1.5px var(--c), 0 0 0 4px color-mix(in srgb, var(--accent) 70%, transparent), 0 2px 5px rgba(0,0,0,.55); }
.pin.visited { opacity: .32; }
.pin.dim { opacity: .14; }
#map.pin-fade .pin:not(.sel):not(.hit):not(.dim):not(:hover):not(:has(.ord)) { opacity: .3; }
#map.pin-fade .pin.visited:not(.sel):not(:hover) { opacity: .16; }
.pin.hit { transform: scale(1.18); box-shadow: 0 0 0 2px var(--c), 0 0 0 6px color-mix(in srgb, var(--c) 28%, transparent); }
.pin.sel { transform: scale(1.3); box-shadow: 0 0 0 2px var(--text), 0 0 0 6px color-mix(in srgb, var(--text) 22%, transparent); z-index: 2; }
.pin .ord { position: absolute; right: -8px; top: -8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; font: 700 10px/17px var(--mono); text-align: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px #121310; }
.z-far .pin { --pin: 17px; }
.z-far .pin svg { width: 58%; height: 58%; }
.z-far .pin .ord { right: -9px; top: -9px; }
.z-far .pin.s-verified::after, .z-far .pin.owned::before { display: none; }
.z-mid .pin { --pin: 22px; }

.wp { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; display: grid; place-items: center; font: 700 10.5px var(--mono); background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px #121310; }
.wp.start { background: var(--ok); color: #0d1a0f; } .wp.end { background: var(--danger); color: #fff; }
.wp.temp { background: var(--text); color: var(--bg); animation: ping 1.4s var(--ease) infinite; }
@keyframes ping { 50% { box-shadow: 0 0 0 2px #121310, 0 0 0 12px color-mix(in srgb, var(--text) 18%, transparent); } }
.ruler-pt { transform: translate(-50%, -160%); display: inline-block; white-space: nowrap; font: 600 11px var(--mono); padding: 2px 6px; border-radius: 4px; background: var(--text); color: var(--bg); }
.rlabel { pointer-events: auto; cursor: pointer; transform: translate(-50%, 17px); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 11.5px; font-weight: 650; letter-spacing: -.01em; color: #ecebe4; text-shadow: 0 1px 2px #000, 0 0 8px rgba(0,0,0,.9); }
.rlabel i { width: 7px; height: 7px; border-radius: 2px; background: var(--c); box-shadow: 0 0 0 1.5px rgba(0,0,0,.7); }
.rlabel:hover, .rlabel.hit { color: var(--accent); }
.plabel { transform: translate(-50%, -50%); display: inline-block; white-space: nowrap; font-size: 10.5px; color: rgba(236,235,228,.78); text-shadow: 0 1px 2px #000, 0 0 6px #000; }
.glabel { transform: translate(-50%, -50%); display: inline-block; font: 700 12px var(--mono); color: rgba(242,239,228,.82); text-shadow: 0 1px 2px #000, 0 0 6px #000; }
.gcell { display: inline-block; white-space: nowrap; font: 600 9.5px var(--mono); letter-spacing: .02em; color: rgba(242,239,228,.5); text-shadow: 0 1px 2px #000; pointer-events: none; }
#map[data-grid="soft"] .gcell { color: rgba(242,239,228,.32); }
#map[data-grid="bold"] .gcell { color: rgba(242,239,228,.8); font-weight: 700; }
#map[data-grid="bold"] .glabel { color: #f5f2e8; }
.z-far .gcell, .z-far .gsub, .z-mid .gsub { display: none; }
.no-labels .rlabel, .no-labels .plabel { display: none; }
.z-far .plabel { display: none; }
.z-far .rlabel { font-size: 10.5px; }
#map.picking, #map.measuring { cursor: crosshair; }
#map.picking .leaflet-marker-icon, #map.measuring .leaflet-marker-icon,
#map.picking .rlabel, #map.measuring .rlabel { pointer-events: none !important; }
.leaflet-tooltip.tip { padding: 4px 8px; border-radius: 6px; border: 0; background: var(--text); color: var(--bg); font: 600 12px var(--font); box-shadow: var(--shadow); }
.leaflet-tooltip.tip::before { display: none; }
.leaflet-tooltip.tip span { font-weight: 400; opacity: .65; margin-left: 6px; }
.leaflet-popup-content-wrapper { background: var(--s1); color: var(--text); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line-2); }
.leaflet-popup-tip { background: var(--s1); }
.leaflet-popup-content { margin: 14px; font: 13px/1.5 var(--font); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }

/* 가이드 */
.guide details { border-top: 1px solid var(--line); }
.guide details:last-of-type { border-bottom: 1px solid var(--line); }
.guide summary { padding: 13px 2px; font-weight: 600; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: '+'; font: 400 18px var(--mono); color: var(--muted); }
.guide details[open] summary::after { content: '−'; }
.guide details > :not(summary) { margin: 0 2px 14px; }
.guide li, .guide p { font-size: 13px; color: var(--text-2); }
.guide li { margin-bottom: 5px; }
.guide ul, .guide ol { padding-left: 18px; }
.guide .warn { padding: 10px 12px; border-radius: var(--r-sm); background: var(--s2); border-left: 2px solid var(--warn); font-size: 12.5px; color: var(--text-2); margin: 0 0 14px; }
.guide code { font: 12px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--s3); }
.guide a { color: var(--accent); }

/* 설정 */
.set { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 0; border-top: 1px solid var(--line); }
.set:first-of-type { border-top: 0; }
.set-main { flex: 1; min-width: 0; }
.set-title { font-size: 13.5px; font-weight: 550; }
.set-sub { font-size: 12px; color: var(--muted); }
.swatches { display: flex; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.swatch.on { box-shadow: 0 0 0 2px var(--s1), 0 0 0 4px var(--c); }
.layouts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.lay { padding: 8px; border-radius: var(--r); border: 1px solid var(--line-2); text-align: left; }
.lay.on { border-color: var(--accent); background: var(--accent-soft); }
.lay svg { width: 100%; height: auto; color: var(--muted); }
.lay.on svg { color: var(--accent); }
.lay b { display: block; margin-top: 6px; font-size: 13px; }
.lay span { font-size: 11.5px; color: var(--muted); }
.profile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--s2); border: 1px solid var(--line); }
.profile .avatar { width: 40px; height: 40px; }
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 40px; border-radius: var(--r-sm); background: #fff; color: #1f1f1f; font-weight: 600; font-size: 13.5px; border: 1px solid #dadce0; }
.gbtn:hover { background: #f6f7f8; }
.gbtn:disabled { opacity: .55; }
.steps-setup { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); }
.steps-setup li { margin-bottom: 4px; }
.steps-setup code { font: 11.5px var(--mono); padding: 1px 4px; border-radius: 4px; background: var(--s3); word-break: break-all; }

/* ───────── 모바일 ───────── */
@media (max-width: 760px) {
  :root { --rail-w: 0px; --tab-h: 60px; }
  .app { grid-template-columns: 1fr; }
  .stage { grid-column: 1; position: fixed; inset: 0; }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom); flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--line); z-index: 40; }
  .rail-mark, .rail-spacer, .rail-btn .tip, .rail-btn.desk { display: none; }
  .rail-btn { width: auto; flex: 1; height: 100%; border-radius: 0; flex-direction: column; gap: 3px; display: flex; align-items: center; justify-content: center; }
  .rail-btn:hover { background: none; }
  .rail-btn.on { background: none; color: var(--accent); }
  .rail-btn.on::before { display: none; }
  .rail-label { display: block; font-size: 10.5px; font-weight: 600; }
  .rail-btn .dot { top: 6px; right: calc(50% - 22px); }
  .rail-btn .avatar { width: 22px; height: 22px; }
  .sync-dot { right: calc(50% - 15px); bottom: auto; top: 22px; }

  /* 서랍과 상세는 아래에서 올라오는 시트가 된다. --y: 시트가 화면 위에서 떨어진 거리 */
  .sheet, [data-layout] .drawer, [data-layout] .detail { position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: auto !important; max-height: none !important; height: calc(100dvh - 56px); border: 0 !important; border-top: 1px solid var(--line-2) !important; border-radius: 16px 16px 0 0 !important; box-shadow: 0 -12px 40px -10px rgba(0,0,0,.55) !important; transform: translateY(var(--y, 100%)) !important; opacity: 1 !important; transition: transform .3s var(--ease) !important; z-index: 30; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); display: flex !important; overflow: hidden; }
  .detail { z-index: 32 !important; height: calc(100dvh - 40px); }
  .sheet.dragging { transition: none !important; }
  .sheet-grip { display: block; flex: none; height: 22px; position: relative; touch-action: none; cursor: grab; }
  .sheet-grip::before { content: ''; position: absolute; left: 50%; top: 8px; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line-2); }
  .sheet-head { min-height: 44px; touch-action: none; }
  .app:not(.drawer-open) .drawer { --y: 100% !important; }
  .app:not(.detail-open) .detail { display: flex !important; --y: 100% !important; pointer-events: none; }
  [data-layout="focus"] .rail { display: flex; }
  .focus-exit { display: none !important; }

  .float-tl { left: 10px !important; right: 10px !important; top: calc(10px + env(safe-area-inset-top)); }
  .omni { width: 100%; }
  .omni-box { height: 46px; }
  .omni-box input { font-size: 16px; } /* iOS 확대 방지 */
  .quick { overflow-x: auto; scrollbar-width: none; margin: 8px -10px 0; padding: 0 10px 4px; }
  .quick::-webkit-scrollbar { display: none; }
  .qchip { height: 34px; padding: 0 13px; font-size: 13px; }
  .float-br { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); right: 10px !important; }
  .float-bl { display: none; }
  .tbtn { width: 44px; height: 44px; }
  .tbtn[data-tool="in"], .tbtn[data-tool="out"] { display: none; } /* 휴대폰은 두 손가락으로 확대 */
  .float-tc.hud-wrap { top: auto; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); left: 10px; transform: none; }
  .hud-next { display: none; }
  .banner-wrap { top: auto !important; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 64px) !important; }
  .toast { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px); }
  .row { min-height: 46px; }
  .btn { height: 40px; }
  .ibtn { width: 38px; height: 38px; }
  .field { height: 42px; font-size: 16px; }
  .d-actions .btn { height: 44px; }
  .layouts { grid-template-columns: 1fr 1fr; }
  .lay.desk-only { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ───────── 제보 게시판 ───────── */
.rp-intro .btns { margin-top: 10px; }
.rp-form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.rp-cats { overflow-x: auto; scrollbar-width: none; }
.rp-cats button { flex: none; }
.rp-body { height: auto; min-height: 110px; padding: 9px 11px; resize: vertical; line-height: 1.5; font: inherit; font-size: 13.5px; }
.rp-ref { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: var(--r-sm); background: var(--s3); font-size: 12.5px; }
.rp-ref svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.rp-ref .ellipsis { flex: 1; min-width: 0; }
.rp-filter button { height: 24px; padding: 0 8px; font-size: 11.5px; }
.rp-item { margin-top: 8px; }
.rp-top { display: flex; align-items: center; gap: 6px; }
.rp-st { font: 600 11px var(--mono); padding: 2px 7px; border-radius: 5px; color: var(--text-2); background: var(--s3); }
.rp-st.run { color: #e3c06a; } .rp-st.ok { color: var(--ok); } .rp-st.bad { color: var(--muted); text-decoration: line-through; }
.rp-title { margin-top: 7px; font-weight: 650; font-size: 14px; word-break: break-word; }
.rp-text { white-space: pre-wrap; word-break: break-word; }
.rp-go { margin-top: 8px; }
.rp-go svg { width: 13px; height: 13px; }
.rp-reply { margin-top: 8px; padding: 8px 10px; border-left: 2px solid var(--accent); background: var(--s1); border-radius: 0 6px 6px 0; font-size: 13px; color: var(--text-2); white-space: pre-wrap; }
.rp-reply b { color: var(--accent); margin-right: 6px; font-size: 12px; }
.rp-admin { display: flex; gap: 6px; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.rp-admin .field { min-width: 0; }
.rp-admin select.field { flex: none; width: 88px; }
.rp-admin [data-reply] { flex: 1 1 0; }
.rp-admin .btn, .rp-admin .ibtn { flex: none; }
.rp-del.armed { display: inline-flex; align-items: center; width: auto; padding: 0 9px; gap: 4px; font-size: 12px; font-weight: 600; color: #fff; background: #c4453a; border-radius: 6px; }
.rp-del.armed svg { width: 14px; height: 14px; }
.small { font-size: 11.5px; }
.btns .grow, .rp-top .grow { flex: 1; }

/* ───────── 운영 통계 대시보드 ───────── */
.an-root {
  --series-1: #3987e5; --good: #4caf72; --bad: #e66767;
  position: fixed; inset: 0; z-index: 2000; background: var(--bg); color: var(--text);
  display: flex; flex-direction: column; animation: an-in .18s var(--ease);
}
[data-theme="paper"] .an-root { --series-1: #2a78d6; --good: #1f8a4c; --bad: #c7383a; }
@keyframes an-in { from { opacity: 0; transform: translateY(6px); } }
.an-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.an-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--s1); flex-wrap: wrap; }
.an-head .grow { flex: 1; }
.an-title { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.an-title svg { width: 18px; height: 18px; color: var(--series-1); }
.an-pill { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; padding: 3px 9px; border-radius: 99px; background: var(--s3); font: 600 11.5px var(--mono); color: var(--text-2); }
.an-pill svg { width: 13px; height: 13px; color: var(--good); }
.an-tabs { display: flex; gap: 2px; }
.an-tabs button { height: 32px; padding: 0 12px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); }
.an-tabs button.on { background: var(--s3); color: var(--text); }
.an-range button { padding: 0 12px; }
.an-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 40px; }
.an-body > * { max-width: 1320px; margin-left: auto; margin-right: auto; }
.an-loading { padding: 80px 0; text-align: center; color: var(--muted); }
.an-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.an-kpi { text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: var(--r); background: var(--s1); border: 1px solid var(--line); cursor: pointer; }
.an-kpi.static { cursor: default; }
.an-kpi:not(.static):hover { border-color: var(--line-2); }
.an-kpi.on { border-color: var(--series-1); box-shadow: 0 0 0 1px var(--series-1) inset; }
.an-kpi .t { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.an-kpi .v { font: 700 26px/1.2 var(--mono); letter-spacing: -.02em; }
.an-kpi .vs { font-size: 11.5px; color: var(--muted); }
.an-delta { font: 600 12px var(--mono); color: var(--muted); }
.an-delta.good { color: var(--good); } .an-delta.bad { color: var(--bad); }
.an-delta .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 4px; animation: an-pulse 1.6s infinite; }
@keyframes an-pulse { 50% { opacity: .3; } }
.an-card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.an-card > header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.an-card h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.an-card .grow { flex: 1; }
.an-unit { font-size: 11.5px; color: var(--muted); }
.an-wide { margin-top: 12px; }
.an-link { font-size: 12.5px; font-weight: 600; color: var(--series-1); display: inline-flex; align-items: center; gap: 4px; }
.an-link svg { width: 15px; height: 15px; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.an-chart { position: relative; }
.an-root svg.an-line { width: 100%; height: auto; display: block; overflow: visible; }
.an-line .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.an-line .ytick { fill: var(--muted); font: 500 11px var(--mono); text-anchor: end; }
.an-line .xtick { fill: var(--muted); font: 500 11px var(--mono); text-anchor: middle; }
.an-line .area { fill: color-mix(in srgb, var(--series-1) 16%, transparent); }
.an-line .stroke { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.an-line .dot { fill: var(--series-1); stroke: var(--s1); stroke-width: 2; vector-effect: non-scaling-stroke; }
.an-line .cross { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.an-line .hot { fill: var(--series-1); stroke: var(--s1); stroke-width: 2; vector-effect: non-scaling-stroke; }
.an-line .hit { fill: transparent; cursor: crosshair; }
.an-tip { display: none; position: absolute; top: 4px; pointer-events: none; padding: 7px 10px; border-radius: 7px; background: var(--s3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 12px; white-space: nowrap; }
.an-tip span { display: block; color: var(--text-2); margin-top: 2px; }
.an-tip b { color: var(--text); }
.an-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.an-list li { position: relative; display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border-radius: 5px; font-size: 13px; overflow: hidden; }
.an-list .an-bar { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--series-1) 18%, transparent); border-radius: 0 4px 4px 0; }
.an-list .k { position: relative; flex: 1; min-width: 0; }
.an-list .v { position: relative; font: 600 12.5px var(--mono); }
.an-list .p { position: relative; width: 44px; text-align: right; font: 500 11.5px var(--mono); color: var(--muted); }
.an-empty { padding: 18px 0; text-align: center; color: var(--muted); font-size: 12.5px; }
.an-heat { display: grid; grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.an-heat .hh { font: 500 10px var(--mono); color: var(--muted); text-align: left; }
.an-heat .hd { font-size: 11.5px; color: var(--text-2); }
.an-heat .c { height: 22px; border-radius: 3px; background: color-mix(in srgb, var(--series-1) calc(var(--a) * 100%), var(--s3)); }
.an-legend-scale { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.an-legend-scale i { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--s3), var(--series-1)); }
.an-scroll { overflow-x: auto; }
.an-table, .an-cohort { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.an-table th, .an-cohort th { text-align: left; font-weight: 600; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.an-table td, .an-cohort td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.an-table .an-n, .an-cohort .an-n { font-family: var(--mono); text-align: right; }
.an-cohort td.an-c { text-align: center; font: 600 11.5px var(--mono); background: color-mix(in srgb, var(--series-1) calc(var(--a) * 85%), transparent); }
.an-users tbody tr { cursor: pointer; }
.an-users tbody tr:hover { background: var(--s2); }
.an-who { display: flex; align-items: center; gap: 9px; }
.an-who img, .an-who .av, .an-profile img, .an-profile .av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--s3); font-weight: 700; flex: none; }
.an-who b { display: block; font-size: 13px; } .an-who span { font-size: 11.5px; color: var(--muted); }
.an-userbar { display: flex; align-items: center; gap: 12px; }
.an-userbar .field { max-width: 320px; }
.an-profile { display: flex; gap: 16px; align-items: center; }
.an-profile img, .an-profile .av { width: 56px; height: 56px; font-size: 22px; }
.an-profile h2 { margin: 0; font-size: 18px; }
.an-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.an-bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; }
.an-bars span { flex: 1; min-width: 2px; background: var(--series-1); border-radius: 3px 3px 0 0; }
.an-bars-rt { height: 140px; }
.an-axis { display: flex; justify-content: space-between; font: 500 11px var(--mono); color: var(--muted); margin-top: 6px; }
.an-feed { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.an-feed li { display: grid; grid-template-columns: 110px 1fr; gap: 2px 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.an-feed time { font: 500 11.5px var(--mono); color: var(--muted); grid-row: span 2; }
.an-feed em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.an-feed em b { color: var(--text-2); }
.an-rt { grid-template-columns: repeat(2, minmax(0, 220px)); }
.an-foot { font-size: 11.5px; color: var(--muted); margin-top: 16px; }
@media (max-width: 900px) {
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-head { padding: 10px 12px; gap: 8px; }
  .an-body { padding: 12px 12px 40px; }
  .an-kpi .v { font-size: 21px; }

  .an-feed li { grid-template-columns: 1fr; } .an-feed time { grid-row: auto; }
}

/* 설정 최하단 버전 정보 */
.app-version { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.app-version img { width: 20px; height: 20px; border-radius: 5px; }
.app-version b { color: var(--text-2); font-family: var(--mono); }
.app-version .mono { font-family: var(--mono); font-size: 11.5px; }
.app-version a { margin-left: auto; color: var(--muted); }

/* 나오는 곳 고르기: 띠의 장소 버튼과 지도 번호 표식 */
.banner.has-spots { flex-direction: column; align-items: stretch; gap: 6px; border-radius: 14px; padding: 6px 6px 8px 14px; }
.banner-top { display: flex; align-items: center; gap: 10px; }
.banner-top .t { flex: 1; }
.spot-chips { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; padding-right: 6px; }
.spot-chips::-webkit-scrollbar { display: none; }
.banner .spot-chips button { height: 28px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px 0 6px; white-space: nowrap; font-weight: 600; background: color-mix(in srgb, var(--bg) 12%, transparent); color: var(--bg); border: 1px solid color-mix(in srgb, var(--bg) 25%, transparent); }
.banner .spot-chips button b { min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; font: 700 10.5px var(--mono); background: var(--accent); color: var(--accent-ink); }
.banner .spot-chips button[data-spot="-1"] { padding-left: 10px; }
.banner .spot-chips button.on { background: var(--bg); color: var(--text); border-color: var(--bg); }
.spotm { position: absolute; transform: translate(-13px, -13px); display: flex; align-items: center; gap: 6px; pointer-events: auto; cursor: pointer; white-space: nowrap; }
.spotm b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 12.5px var(--mono); background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent), 0 2px 6px rgba(0,0,0,.6); }
.spotm span { padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 650; background: rgba(15,16,14,.86); color: #f1f0e9; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.spotm:hover b { transform: scale(1.1); }
@media (max-width: 760px) { .spotm span { font-size: 11px; padding: 2px 6px; } }

/* 부관 보상 */
.rewards { display: grid; gap: 6px; margin: 8px 0; }
.reward { --rc: var(--line-2); display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 8px; background: var(--s2); border: 1px solid var(--line); border-left: 3px solid var(--rc); }
.reward img, .reward .glyph { width: 64px; height: 40px; object-fit: contain; flex: none; border-radius: 5px; background: color-mix(in srgb, var(--rc) 14%, var(--s3)); display: grid; place-items: center; color: var(--rc); }
.reward .glyph svg { width: 20px; height: 20px; }
.reward b { display: block; font-size: 13px; }
.reward span { font-size: 11.5px; color: var(--muted); }
.reward.r-rare { --rc: #4a8fe0; } .reward.r-epic { --rc: #a463e0; } .reward.r-legendary { --rc: #e3a443; } .reward.r-ultra { --rc: #e0525a; } .reward.r-uncommon { --rc: #4caf72; }

/* 블랙리스트 */
.bl-search { position: relative; margin-bottom: 8px; }
.bl-search .glyph { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); background: none; }
.bl-search .glyph svg { width: 16px; height: 16px; }
.bl-search .field { width: 100%; padding-left: 34px; font-family: var(--mono); }
.bl-verdict { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 8px; border-radius: 8px; font-size: 13px; background: var(--s2); color: var(--text-2); }
.bl-verdict svg { width: 17px; height: 17px; flex: none; color: var(--ok); }
.bl-verdict.hit { background: color-mix(in srgb, #e0525a 16%, var(--s2)); color: var(--text); }
.bl-verdict.hit svg { color: #e0525a; }
.bl-cats { overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; }
.bl-cats button { flex: none; }
.bl-add summary { cursor: pointer; list-style: none; }
.bl-add summary svg { width: 16px; height: 16px; }
.bl-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.bl-form .field { width: 100%; }
.bl-memo { height: auto; min-height: 70px; padding: 9px 11px; resize: vertical; font: inherit; font-size: 13px; line-height: 1.5; }
.bl-del[data-armed] { width: auto; padding: 0 8px; display: inline-flex; gap: 4px; font-size: 11.5px; font-weight: 600; color: #fff; background: #c4453a; border-radius: 6px; }

/* 블랙리스트 카드: 해골 · 아이디 · 사유 한 줄 */
.bl-lang { margin-bottom: 10px; }
.bl-lang button { flex: 1; }
.bl-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; }
.bl-list li { --rc: #e0525a; display: flex; align-items: flex-start; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.bl-list li:last-child { border-bottom: 0; }
.bl-skull { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--rc); background: color-mix(in srgb, var(--rc) 15%, transparent); }
.bl-skull svg { width: 17px; height: 17px; }
.bl-main { flex: 1; min-width: 0; }
.bl-tag { display: flex; align-items: center; gap: 2px; min-height: 22px; }
.bl-tag b { font: 650 14px var(--mono); word-break: break-all; }
.bl-copy { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 6px; color: var(--muted); opacity: .55; }
.bl-copy:hover { opacity: 1; background: var(--s2); }
.bl-copy svg { width: 13px; height: 13px; }
.bl-sub { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bl-cat { color: var(--rc); font-weight: 600; }
.bl-sub time { font: 500 11px var(--mono); }
.bl-main p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.bl-c-solo { --rc: #4a8fe0 !important; } .bl-c-cheat { --rc: #a87fd0 !important; } .bl-c-abuse { --rc: #e3a443 !important; } .bl-c-etc { --rc: var(--muted) !important; }
.bl-admin { display: flex; gap: 2px; flex: none; }
.bl-admin .ibtn { width: 28px; height: 28px; flex: none; }
.bl-admin .ibtn svg { width: 15px; height: 15px; }
.lang-seg button { flex: 1; }

/* 레이어: 종류마다 한 줄씩 켜고 끄기 */
.layer-list { display: flex; flex-direction: column; }
.layer-row.off .glyph, .layer-row.off .row-title { opacity: .45; }
.qclear { padding: 0 9px; gap: 3px; font: 600 12px var(--mono); }
.qclear svg { width: 13px; height: 13px; }

/* 레이어 묶음 제목 */
.layer-head { display: flex; align-items: center; gap: 8px; margin: 14px 4px 4px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.layer-head i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.layer-head span { flex: 1; }
.layer-head .link { font-size: 11.5px; font-weight: 600; }

/* 특성 패널 */
.tr-trees .chip { cursor: pointer; }
.tr-trees .chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); display: inline-block; }
.tr-trees .chip.on { background: var(--s3); color: var(--text); border-color: color-mix(in srgb, var(--c, var(--accent)) 70%, var(--line-2)); }
.tr-glyph svg { width: 16px; height: 16px; }
.tr-glyph.big { width: 44px; height: 44px; border-radius: 11px; }
.tr-glyph.big svg { width: 24px; height: 24px; }
.tr-row .row-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tr-kind { margin-left: 6px; font: 600 10px var(--mono); padding: 1px 5px; border-radius: 4px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); vertical-align: 1px; }
.tr-grades { display: flex; gap: 4px; flex: none; }
.tg { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: 4px; font: 700 11px var(--mono); color: #151613; background: var(--g); }
.tg i { font-style: normal; font-weight: 600; font-size: 9px; opacity: .7; }
.tr-tiers { display: grid; gap: 6px; margin-top: 12px; }
.tr-tier { display: flex; gap: 8px; align-items: stretch; }
.tr-tier-g { flex: none; width: 34px; display: grid; place-items: center; border-radius: 7px; font: 800 16px var(--mono); color: #151613; background: var(--g); }
.tr-tier-list { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; padding: 6px; border-radius: 7px; background: var(--s2); border: 1px solid var(--line); min-height: 40px; align-items: center; }
.tr-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px 0 3px; border-radius: 7px; background: var(--s1); border: 1px solid var(--line-2); font-size: 12.5px; color: var(--text); }
.tr-chip:hover { border-color: var(--accent); }
.tr-chip .glyph { width: 24px; height: 24px; border-radius: 5px; }
.tr-chip .glyph svg { width: 14px; height: 14px; }
.tr-review > summary { gap: 8px; }
.tr-review .tr-h { margin-top: 10px; font: 600 10.5px var(--mono); letter-spacing: .08em; color: var(--muted); }
.tr-review .tr-eff { color: var(--text); }
.tr-dhead { display: flex; gap: 12px; align-items: center; }
.tr-dhead .d-title { margin: 0; }
