:root {
  --ink: #1f2f45;
  --ink-2: #44566d;
  --muted: #6b7c90;
  --line: #e2e8f0;
  --bg: #eef2f7;
  --card: #ffffff;
  --pink: #e83e72;
  --pink-soft: #fff0f4;
  --green: #0b8a5b;
  --green-soft: #e4f5ee;
  --blue: #2a6fc9;
  --radius: 14px;
  --shadow: 0 1px 2px #1b2b4410, 0 6px 20px #1b2b440d;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', Inter, system-ui, sans-serif;
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }

/* ---- 상단 바 ---- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 24px; background: #ffffffee; backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--green); color: #fff;
  display: grid; place-items: center; font-weight: 900; font-size: 22px; }
.brandname { font-weight: 800; font-size: 19px; line-height: 1.25; }
.brandname small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.08em; margin-top: 2px; }
.runpick { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.runpick select { min-width: 300px; }

select, input[type=number] {
  width: 100%; border: 1px solid #cfd9e5; background: #f8fafc; border-radius: 10px; padding: 10px 12px;
  font-size: 16px; color: var(--ink); outline: none;
}
select:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #2a6fc922; }

.page { max-width: 1680px; margin: 0 auto; padding: 20px 24px 40px; }

/* ---- 지도 60 : 핵심 결과 40 ---- */
.overview { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.mapcol { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mapstage { position: relative; height: clamp(460px, calc(100vh - 230px), 760px); border-radius: var(--radius);
  overflow: hidden; background: #dce8e8; box-shadow: var(--shadow); }
#map { position: absolute; inset: 0; }
.maplabel { position: absolute; z-index: 3; left: 14px; top: 14px; background: #ffffffee; border-radius: 12px;
  padding: 10px 14px; max-width: 300px; box-shadow: var(--shadow); }
.maplabel b { font-size: 16px; }
.maplabel p { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.maptools { position: absolute; z-index: 3; right: 14px; top: 14px; display: flex; gap: 6px; }
.maptools button { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px 14px;
  font-size: 14px; font-weight: 700; color: var(--ink-2); box-shadow: var(--shadow); }
.maptools button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.maplibregl-ctrl-top-right { top: 56px; }
.error { display: none; position: absolute; z-index: 10; left: 14px; bottom: 14px; background: #fff6e5;
  border: 1px solid #efc77c; color: #725020; padding: 10px 12px; border-radius: 10px; font-size: 14px; max-width: 420px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 14px; color: var(--ink-2);
  background: var(--card); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); }
.legend { flex-direction: column; align-items: stretch; gap: 6px; }
.lg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.lg-title { font-weight: 700; color: var(--ink); min-width: 118px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #d5dde7; }
.dot.agent { width: 9px; height: 9px; border: 1.5px solid #1f2f45; box-shadow: none; }
.cand-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; margin-right: 6px; vertical-align: middle;
  font-style: normal; font-size: 11px; font-weight: 800; background: #fff; color: #c2214f; border: 2.5px solid var(--pink); }
.cand-badge.sel { background: var(--pink); color: #fff; border-color: #fff; box-shadow: 0 0 0 4px #e83e722e; }
.maplibregl-popup { max-width: 320px !important; }
.pop-kind { display: table; font-size: 12px; font-weight: 800; border-radius: 6px; padding: 1px 7px; margin-bottom: 4px; background: #eef2f7; color: var(--ink-2); }
.pop-kind.cand { background: var(--pink-soft); color: #c2214f; }
.pop-kind.agent { background: #e0f4f8; color: #0e7490; }

.playbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; background: var(--card);
  border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); }
.seg { display: flex; gap: 4px; background: #f1f5f9; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 7px 12px; font-size: 14px; font-weight: 700; color: var(--muted); }
.seg button.active { background: var(--ink); color: #fff; }
.play { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--pink); color: #fff; font-size: 16px; }
.range { flex: 1 1 140px; min-width: 120px; accent-color: var(--pink); }
.playlabel { font-size: 14px; color: var(--muted); }
.toggles { display: flex; gap: 6px; margin-left: auto; }
.chip { border: 1px solid #d5dfea; background: #f6f9fc; color: var(--muted); border-radius: 9px; padding: 6px 11px; font-size: 14px; font-weight: 600; }
.chip.active { background: #e8f2ff; border-color: #b9d6fb; color: #1765b0; }

/* ---- 사이드: 핵심 결과 ---- */
.side { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px 20px; font-size: 16px; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; color: var(--green); }
.side h1 { font-size: 26px; margin-top: 4px; }
.intro { margin: 6px 0 16px; font-size: 15px; color: var(--muted); }
.fieldlabel { display: block; font-size: 15px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.side select { font-size: 17px; padding: 12px 14px; }

.hero { margin: 14px 0 16px; padding: 16px 18px; border-radius: 12px; background: linear-gradient(115deg, var(--pink-soft), #f3f8ff); border: 1px solid #f6dce5; }
.hero-id { font-size: 28px; font-weight: 900; color: #d22f63; margin-top: 6px; line-height: 1.25; word-break: keep-all; }
.hero-sub { font-size: 15px; color: var(--ink-2); margin-top: 6px; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpis.sub { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
.kpi { background: #f6f9fc; border: 1px solid #e8eef5; border-radius: 12px; padding: 12px 14px; min-width: 0; }
.kpi span { display: block; font-size: 15px; font-weight: 600; color: var(--ink-2); line-height: 1.35; }
.kpi b { display: block; font-size: 22px; font-weight: 800; margin-top: 4px; line-height: 1.2; white-space: nowrap; }
.kpi small { display: block; font-size: 14px; color: var(--muted); margin-top: 3px; }
.kpis.sub .kpi small { font-size: 13.5px; line-height: 1.35; }
.kpi.main b { font-size: 26px; }
.kpi.main:first-child { grid-column: 1 / -1; background: var(--pink-soft); border-color: #f6d5e0; }
.kpi.main:first-child b { color: #c42a5b; font-size: 30px; }
.kpi.good b { color: var(--green); }
.note { font-size: 15px; color: var(--muted); margin: 12px 0 0; }

.tag { display: inline-block; font-style: normal; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; white-space: nowrap; }
.tag.real { background: var(--green-soft); color: var(--green); }
.tag.est { background: #e7f0fd; color: var(--blue); }
.tag.asm { background: #fff2dc; color: #9a620c; }
.tag.gen { background: #f1eaff; color: #6b3fc0; }

/* ---- 상세 분석 ---- */
.details { margin-top: 28px; }
.details h2 { font-size: 22px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; font-size: 16px; }
.card.wide { grid-column: 1 / -1; }
.card h3 { font-size: 18px; margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.card h3 small { font-size: 14px; font-weight: 500; color: var(--muted); }
.card p { margin: 0 0 12px; color: var(--ink-2); }
.prose { color: var(--ink-2); }
.prose ul { margin: 8px 0; padding-left: 20px; }
.prose li { margin: 3px 0; }
.prose .muted { color: var(--muted); font-size: 15px; }

/* 후보 비교 (HTML 막대) */
.cmp { display: grid; gap: 10px; }
.cmp-head, .cmp-row { display: grid; grid-template-columns: minmax(130px, 1.1fr) minmax(0, 2.6fr) repeat(4, minmax(84px, 0.7fr)); gap: 12px; align-items: center; }
.cmp-row .num small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.rank { display: inline-block; font-style: normal; font-size: 12px; font-weight: 800; color: #fff; background: var(--ink); border-radius: 6px; padding: 0 6px; margin-right: 6px; vertical-align: 1px; }
.cmp-head { font-size: 13px; font-weight: 700; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.cmp-head span:nth-child(n+3), .cmp-row .num { text-align: right; }
.cmp-row { padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.cmp-row:hover { background: #f6f9fc; }
.cmp-row.sel { background: var(--pink-soft); }
.cmp-name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.cmp-name small { display: block; font-weight: 500; color: var(--muted); font-size: 14px; }
.cmp-bar { position: relative; height: 26px; background: #f1f5f9; border-radius: 6px; }
.cmp-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: #9db9d9; border-radius: 6px; }
.cmp-row.sel .cmp-bar .fill { background: var(--pink); }
.cmp-bar .whisker { position: absolute; top: 50%; height: 2px; background: var(--ink); }
.cmp-bar .whisker::before, .cmp-bar .whisker::after { content: ''; position: absolute; top: -6px; width: 2px; height: 14px; background: var(--ink); }
.cmp-bar .whisker::before { left: 0; } .cmp-bar .whisker::after { right: 0; }
.num { font-variant-numeric: tabular-nums; font-size: 15px; }
.num b { font-size: 16px; }
.cmp-foot { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* 기준선 검증 */
.vbars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: end; height: 130px; margin: 6px 0 4px; }
.vbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.vbar .pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.vbar .r, .vbar .s { width: 38%; border-radius: 4px 4px 0 0; }
.vbar .r { background: #2fbba2; } .vbar .s { background: #9db9d9; }
.vbar label { font-size: 13px; color: var(--muted); }
.vlegend { font-size: 14px; color: var(--muted); display: flex; gap: 14px; }
table.vtable { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 12px; }
.vtable th, .vtable td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.vtable th { font-size: 14px; color: var(--muted); font-weight: 700; }
.vtable th:first-child, .vtable td:first-child { text-align: left; }

/* 판단 */
.inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.inputs label { font-size: 14px; font-weight: 700; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.verdict { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: #f6f9fc; color: var(--ink-2); font-size: 16px; }
.verdict.go { background: var(--green-soft); color: #0a6e48; }
.verdict.nogo { background: #ffedf1; color: #b3214a; }
.verdict small { display: block; font-size: 14px; margin-top: 6px; opacity: 0.85; }

/* Agent 팝업(간략) */
.ap-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.ap-name { margin-left: 4px; }
.name-src { display: inline-block; font-style: normal; font-size: 11px; font-weight: 700; border-radius: 5px; padding: 0 6px; margin-left: 6px; vertical-align: 2px; cursor: help; }
.name-src.original_text { background: #eef2f7; color: #475569; }
.name-src.virtual { background: #fff2dc; color: #9a620c; }
.ad-namenote { font-size: 13px; color: var(--muted); margin: -2px 0 10px; }
.ap-who { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
dl.ap { display: grid; grid-template-columns: 62px 1fr; gap: 3px 8px; margin: 6px 0 0; font-size: 13px; line-height: 1.45; }
dl.ap dt { color: var(--muted); font-weight: 700; }
dl.ap dd { margin: 0; color: var(--ink-2); }
dl.ap.act { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }
.ap-uuid { margin-top: 6px; font-size: 11px; color: #94a3b8; font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.na { color: #94a3b8; }
/* Agent 상세 카드(원문 전체) */
.ad-head { font-size: 16px; color: var(--ink-2); margin-bottom: 8px; }
.ad-head b { font-size: 17px; color: var(--ink); margin-right: 6px; }
dl.ad { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; margin: 0; font-size: 15px; }
dl.ad dt { color: var(--muted); font-weight: 700; }
dl.ad dd { margin: 0; color: var(--ink-2); }
.ad-src { margin-top: 10px; font-size: 13px; color: #94a3b8; word-break: break-all; }
@media (max-width: 640px) { dl.ad { grid-template-columns: 1fr; gap: 2px; } dl.ad dd { margin-bottom: 8px; } }
/* Agent 팝업·상세의 LLM 추론(생성) 표시 */
.maplibregl-popup-content:has(.ap-strip) { max-height: min(380px, 52vh); overflow-y: auto; }
.ap-strip-h { margin-top: 8px; font-size: 12px; color: var(--muted); font-weight: 700; }
.ap-strip > div { display: grid; grid-template-columns: 30px repeat(6, 1fr); gap: 2px; margin-top: 2px; font-size: 11px; align-items: center; }
.ap-strip span { color: var(--muted); }
.ap-strip b { text-align: center; font-weight: 600; border-radius: 3px; padding: 1px 0; background: rgb(8 145 178 / calc(var(--v) * 0.85 + 0.06)); color: #0f2a35; }
.ap-strip b.on { outline: 2px solid var(--ink); }
.ad-llm-h { margin-top: 14px; font-weight: 800; font-size: 15px; }
.ad-llm { overflow-x: auto; }
.ad-llm table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.ad-llm th, .ad-llm td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ad-llm th { color: var(--muted); font-weight: 700; }
.ad-llm .r { text-align: right; white-space: nowrap; }
.ad-llm td:first-child { white-space: nowrap; }
.ad-llm .why { color: var(--ink-2); }
.ad-llm tr.on td { background: #e6f6fa; }
.agentbox { margin-top: 14px; padding: 12px 14px; background: #f6f9fc; border-radius: 10px; font-size: 15px; color: var(--ink-2); }
.actions { margin-top: 16px; }
.reportbtn { border: 0; border-radius: 10px; background: var(--pink); color: #fff; padding: 12px 18px; font-weight: 800; font-size: 16px; }
.warning { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.maplibregl-popup-content { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; box-shadow: 0 12px 30px #1e3a5540; }

/* ---- 반응형 ---- */
@media (max-width: 1100px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .mapstage { height: clamp(380px, 60vh, 620px); }
  .runpick select { min-width: 220px; }
}
@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: stretch; padding: 10px 14px; gap: 8px; }
  .brandname { font-size: 17px; }
  .runpick { flex-direction: column; align-items: stretch; gap: 4px; }
  .runpick select { min-width: 0; }
  .page { padding: 14px 12px 28px; }
  .mapstage { height: clamp(340px, 62vh, 520px); }
  .maplabel { max-width: 210px; padding: 8px 10px; }
  .maplabel p { display: none; }
  .side, .card { padding: 18px 16px; }
  .hero-id { font-size: 24px; }
  .kpi b { font-size: 20px; } .kpi.main b { font-size: 22px; } .kpi.main:first-child b { font-size: 26px; }
  .kpis.sub { grid-template-columns: minmax(0, 1fr); }
  .kpis.sub .kpi { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: baseline; }
  .kpis.sub .kpi small { grid-column: 1 / -1; }
  .toggles { margin-left: 0; }
  .cmp-head { display: none; }
  .cmp-row { grid-template-columns: 1fr 1fr; grid-template-areas: "name name" "bar bar"; gap: 6px 10px; }
  .cmp-name { grid-area: name; } .cmp-bar { grid-area: bar; }
  .cmp-row .num { text-align: left; font-size: 14px; }
  .cmp-row .num::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); }
  .vbars { height: 110px; }
}

/* ==== 에이전트 시뮬레이션 (시작 → 재생 → 완료) ==== */
.muted { color: var(--muted); }
.tag.vis { background: #eef2f7; color: #475569; border: 1px dashed #94a3b8; }
.h2sub { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.overview { grid-template-columns: minmax(0, 1.7fr) minmax(340px, 1fr); }
.mapstage { height: clamp(500px, calc(100vh - 220px), 800px); }
@media (min-width: 1101px) { .mapcol { position: sticky; top: 84px; } .mapstage { height: clamp(460px, calc(100vh - 300px), 760px); } }
.hud { position: absolute; z-index: 4; left: 50%; top: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  background: #1f2f45e8; color: #fff; border-radius: 999px; padding: 7px 16px; font-size: 15px; box-shadow: var(--shadow); white-space: nowrap; }
.hud b { font-size: 16px; }
.hud #hudStep { color: #cbd5e1; font-size: 13px; }
.hud-state { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 1px 8px; background: #64748b; }
.hud-state.running { background: #0891b2; } .hud-state.paused { background: #b45309; } .hud-state.done { background: var(--green); }
.maplibregl-popup { z-index: 6; }
.vnote { pointer-events: none; position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 34px; margin: 0 auto; max-width: 560px; text-align: center;
  background: #ffffffe6; border: 1px dashed #94a3b8; border-radius: 10px; padding: 6px 10px; font-size: 13px; color: var(--ink-2); }
.startcard { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 440px);
  background: #fffffff5; border-radius: 16px; padding: 22px 24px; box-shadow: 0 18px 50px #1e3a5545; text-align: left; }
.startcard[hidden], .donecard[hidden], .hud[hidden] { display: none; }
.sc-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; color: var(--pink); }
.startcard h2 { font-size: 22px; margin: 4px 0 10px; line-height: 1.3; }
.sc-facts { margin: 0 0 14px; padding-left: 18px; font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.startbtn { width: 100%; border: 0; border-radius: 12px; background: var(--pink); color: #fff; font-size: 18px; font-weight: 800; padding: 14px; box-shadow: 0 6px 18px #e83e7255; }
.startbtn:hover { filter: brightness(1.05); } .startbtn:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }
.sc-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.donecard { position: absolute; z-index: 5; left: 50%; top: 58px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px;
  background: #fffffff5; border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 14px; width: max-content; max-width: 92%; }
.donecard b { color: var(--green); }
.play:disabled, .chip:disabled { opacity: 0.45; cursor: not-allowed; }
.ctxbar { flex: 1 1 100%; display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; order: 9; }
.ctxbar button { position: relative; height: 22px; border: 0; border-radius: 4px; background: #e2e8f0; overflow: hidden; padding: 0; }
.ctxbar button::before { content: ''; position: absolute; inset: 0; width: calc(var(--f, 0) * 100%); background: #0891b2; }
.ctxbar button.done::before { background: #64748b; width: 100%; }
.ctxbar button.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.ctxbar button span { position: relative; font-size: 11px; font-weight: 700; color: var(--ink); }
.ctxbar button:nth-child(7) { margin-left: 6px; }
.playlabel { order: 10; }
.lg-inline { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }
.side-h { font-size: 18px; margin: 18px 0 10px; display: flex; align-items: baseline; gap: 8px; }
.side-h small { font-size: 13px; font-weight: 600; color: var(--muted); }
.mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.m { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.m span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.m b { display: block; font-size: 21px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.m small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.mblock { margin-top: 12px; }
.mh { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.mh small { font-weight: 500; color: var(--muted); font-size: 12px; }
.mtext { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.hbars small.muted { display: block; font-size: 12px; margin-top: 2px; }
.hb { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; margin: 3px 0; }
.hb-l { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 10px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.hb-t i { display: block; height: 100%; background: #2a78d6; border-radius: 0 4px 4px 0; transition: width 0.15s linear; }
.hb.sel .hb-l { font-weight: 800; color: var(--ink); } .hb.sel .hb-t i { background: var(--pink); }
.hb-v { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.hb-v small { color: var(--muted); }
.result[hidden] { display: none; }
.tw { overflow-x: auto; }
table.rtab, table.stab { width: 100%; border-collapse: collapse; font-size: 14px; }
.rtab th, .rtab td, .stab th, .stab td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rtab th:nth-child(-n+2), .rtab td:nth-child(-n+2), .stab th:first-child, .stab td:first-child { text-align: left; }
.rtab th, .stab th { color: var(--muted); font-weight: 700; font-size: 12px; line-height: 1.3; }
.rtab tr[data-cid] { cursor: pointer; } .rtab tr.sel td { background: var(--pink-soft); }
.cmp-run { font-size: 14px; color: var(--muted); margin: -4px 0 8px !important; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.sbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.sbox.wide { grid-column: 1 / -1; }
.sbox h4 { margin: 0 0 8px; font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sbox h4 small { font-weight: 500; color: var(--muted); font-size: 12px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { border-radius: 10px; background: #f6f9fc; padding: 8px 10px; } .tile b { display: block; font-size: 22px; } .tile span { font-size: 12px; color: var(--muted); }
.leg { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); margin-right: 12px; }
.leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.vb2 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; height: 130px; align-items: end; margin: 8px 0 4px; }
.vb2c { display: flex; flex-direction: column; height: 100%; }
.vb2p { flex: 1; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.vb2p i { display: block; width: 30%; max-width: 18px; border-radius: 4px 4px 0 0; }
.vb2c label { font-size: 11px; color: var(--muted); text-align: center; margin-top: 3px; }
.warnbox { background: #fff6e5; border-radius: 8px; padding: 8px 10px; font-size: 14px; color: #6b4a12 !important; margin-top: 8px !important; }
@media (max-width: 1100px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .mapstage { height: clamp(400px, 64vh, 640px); }
}
@media (max-width: 640px) {
  .mapstage { height: clamp(380px, 66vh, 560px); }
  .hud { top: 60px; font-size: 13px; padding: 5px 12px; } .hud b { font-size: 14px; }
  .vnote { bottom: 46px; font-size: 12px; }
  .startcard { padding: 16px 16px; } .startcard h2 { font-size: 18px; } .sc-facts { font-size: 13px; }
  .startbtn { font-size: 16px; padding: 12px; }
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .m b { font-size: 18px; }
  .hb { grid-template-columns: 70px minmax(0, 1fr) auto; }
  .ctxbar button span { display: none; }
}

/* ==== 배포본 하단 출처·라이선스 ==== */
.credits { max-width: 1680px; margin: 0 auto; padding: 4px 24px 36px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.credits p { margin: 6px 0; }
.credits ul { margin: 4px 0 8px; padding-left: 18px; }
.credits a { color: var(--blue); }
@media (max-width: 640px) { .credits { padding: 4px 14px 28px; font-size: 12px; } }
