:root {
  --ink: #111827; --sub: #4b5563; --mute: #9ca3af; --line: #e5e7eb; --bg: #f8fafc;
  --brand: #e03131; --panel-w: 380px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif; color: var(--ink); }
a { color: inherit; text-decoration: none; }

/* 상단 바 */
.topbar { height: 56px; display: flex; align-items: center; gap: 28px; padding: 0 20px; border-bottom: 1px solid var(--line); background: #fff; }
.logo { font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.logo-pin { color: var(--brand); font-size: 22px; }
.logo-tag { font-size: 10px; color: var(--brand); border: 1px solid var(--brand); border-radius: 4px; padding: 1px 5px; letter-spacing: .08em; }
.topnav { display: flex; gap: 22px; font-size: 14px; color: var(--sub); overflow-x: auto; }
.topnav a { padding: 18px 0; cursor: pointer; white-space: nowrap; }
.topnav a.active { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px var(--brand); }
.lang-select { margin-left: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; background: #fff; color: var(--sub); cursor: pointer; }

/* 레이아웃 */
.layout { display: flex; height: calc(100% - 56px); }
.panel { width: var(--panel-w); flex: none; overflow-y: auto; border-right: 1px solid var(--line); padding: 28px 22px; background: #fff; }
.mapwrap { flex: 1; position: relative; }
#map { position: absolute; inset: 0; }

.eyebrow { color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .14em; margin: 0 0 10px; }
h1 { font-size: 28px; line-height: 1.3; margin: 0 0 14px; letter-spacing: -.02em; }
.lead { font-size: 13.5px; line-height: 1.65; color: var(--sub); margin: 0 0 10px; }
.count { font-size: 13.5px; color: var(--sub); margin: 0 0 18px; }
.count b { color: var(--brand); }
.search, .select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font-size: 14px; background: var(--bg); margin-bottom: 10px; font-family: inherit; }
.list-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin: 18px 0 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.pill { font-size: 12px; background: #f1f5f9; color: var(--sub); padding: 2px 9px; border-radius: 999px; font-weight: 600; }

/* 목록 카드 */
.list { list-style: none; margin: 0; padding: 0; }
.card { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.card:hover { background: var(--bg); }
.thumb { width: 84px; height: 64px; border-radius: 8px; flex: none; background: #e5e7eb center/cover; position: relative; display: grid; place-items: center; font-size: 26px; }
.thumb .play { position: absolute; right: 4px; bottom: 4px; font-size: 10px; background: rgba(0,0,0,.7); color: #fff; padding: 1px 5px; border-radius: 4px; }
.card-body { min-width: 0; }
.cat { font-size: 11.5px; font-weight: 700; }
.card-name { display: block; font-weight: 700; font-size: 15px; margin: 2px 0; }
.card-sub { font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; margin-top: 4px; }
.badge.pending { background: #fff4e6; color: #d9480f; }
.badge.ok { background: #ebfbee; color: #2b8a3e; }
.empty { color: var(--mute); font-size: 13px; padding: 24px 0; text-align: center; }

/* 카테고리 칩 */
.chips { position: absolute; z-index: 2; top: 16px; left: 16px; right: 16px; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 16px; font-size: 14px; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.06); font-family: inherit; display: flex; align-items: center; gap: 6px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.legend { position: absolute; z-index: 2; left: 12px; bottom: 12px; background: rgba(255,255,255,.95); border-radius: 8px; padding: 6px 10px; font-size: 11.5px; color: var(--sub); display: flex; gap: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: -1px; }

/* 상세 */
.back { border: none; background: none; font-size: 14px; color: var(--sub); cursor: pointer; padding: 0; margin-bottom: 16px; font-family: inherit; }
.d-name { font-size: 24px; margin: 6px 0 2px; letter-spacing: -.02em; }
.d-alt { color: var(--mute); font-size: 13px; margin-bottom: 12px; }
.status { border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; margin: 12px 0; }
.status.pending { background: #fff4e6; color: #a63c06; }
.status.ok { background: #ebfbee; color: #2b8a3e; }
.d-summary { font-size: 14px; line-height: 1.7; color: #1f2937; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.tag { font-size: 12px; background: #f1f5f9; color: var(--sub); padding: 3px 8px; border-radius: 6px; }
.d-sec { font-size: 13px; font-weight: 700; margin: 22px 0 8px; }
.hl { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.7; }
.info { width: 100%; font-size: 13px; border-collapse: collapse; }
.info th { text-align: left; color: var(--mute); font-weight: 500; width: 76px; padding: 6px 0; vertical-align: top; }
.info td { padding: 6px 0; line-height: 1.5; }
.btns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn { flex: 1; text-align: center; padding: 11px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line); white-space: nowrap; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.video { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.v-meta { font-size: 12px; color: var(--sub); margin: 6px 0 14px; }
.v-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.v-tab { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.v-tab.on { background: var(--ink); color: #fff; }
.novideo { font-size: 13px; color: var(--mute); background: var(--bg); border-radius: 10px; padding: 18px; text-align: center; }
.sources { list-style: none; padding: 0; margin: 0; font-size: 12.5px; }
.sources li { padding: 5px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 6px; }
.sources a { color: #1c7ed6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang { flex: none; font-size: 10px; font-weight: 700; background: #e7f5ff; color: #1864ab; padding: 1px 5px; border-radius: 4px; height: fit-content; margin-top: 1px; }
.note { font-size: 11.5px; color: var(--mute); margin-top: 18px; line-height: 1.6; }

/* 지도 팝업 */
.maplibregl-popup-content { border-radius: 10px; padding: 8px 12px; font-family: inherit; font-size: 13px; font-weight: 700; }

/* 모바일: 지도 위, 목록 아래 */
@media (max-width: 820px) {
  .topnav { display: none; }
  .layout { flex-direction: column-reverse; }
  .mapwrap { flex: none; height: 52vh; }
  .panel { width: 100%; flex: 1; border-right: none; border-top: 1px solid var(--line); padding: 18px 16px; }
  h1 { font-size: 22px; } .lead { display: none; }
  .legend { display: none; }
}
