/* 얼마에 샀어? 공통 스타일 */
:root {
  --bg: #f4f6f9; --surface: #fff; --surface-2: #f7f8fa;
  --ink: #191f28; --ink-2: #4e5968; --muted: #6b7280; --line: #e5e8eb; --line-2: #f0f2f5;
  --accent: #3182f6; --accent-ink: #1b64da; --accent-weak: #e8f3ff;
  --gain: #3182f6; --gain-bg: #e8f3ff; --gain-ink: #1b64da;  /* 이익은 파랑, 손실은 빨강(사용자 결정) */
  --loss: #d92d3a; --loss-bg: #fdeef0; --loss-ink: #b4232f;
  --trade: #3182f6; --presale: #ff9f43; --unknown: #c3c9d1;
  --bar-gain: var(--gain); --bar-loss: var(--loss);
  --radius: 16px; --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 2px 6px rgba(15, 23, 42, .06), 0 12px 32px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, .22);
  --top-h: 60px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.modal-open { overflow: hidden; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--accent-ink); color: #fff; }
.btn-primary:hover { background: #1550b0; }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--line); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.linklike { border: 0; background: none; color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }
.linklike:hover { text-decoration: underline; }

/* 머리 */
.top { position: sticky; top: 0; z-index: 1100; height: var(--top-h); display: flex; align-items: center; gap: 24px; padding: 0 20px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--ink); white-space: nowrap; letter-spacing: -0.03em; text-decoration: none !important; }
.brand-mark { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 8px; background: linear-gradient(135deg, #4c9bff, #1b64da); color: #fff; font-size: 15px; font-weight: 800; }
.top-nav { min-width: 0; display: flex; align-items: center; gap: 4px; font-size: 14px; overflow-x: auto; scrollbar-width: none; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a { color: var(--ink-2); padding: 8px 10px; border-radius: 8px; white-space: nowrap; font-weight: 500; text-decoration: none; }
.top-nav a:hover { background: var(--surface-2); color: var(--ink); }
.auth { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.auth .who { font-size: 13px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }

/* 바닥 */
.foot { border-top: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--muted); line-height: 1.7; }
.foot-in { max-width: 1080px; margin: 0 auto; padding: 28px 20px 40px; }
.foot p { margin: 6px 0; }
.foot-gu { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-bottom: 14px; }
.foot-gu a { color: var(--ink-2); }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px !important; }
.foot-links a { color: var(--ink-2); }

/* ---- 지도 화면 ---- */
body.map #app { display: grid; grid-template-columns: 380px 1fr; grid-template-areas: "side map"; height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); }
#side { grid-area: side; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.side-intro { padding: 22px 20px 14px; }
.side-intro h1 { font-size: 22px; line-height: 1.3; margin: 0 0 6px; letter-spacing: -0.03em; }
.side-intro p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.side-head { position: sticky; top: 0; z-index: 2; padding: 10px 20px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font-size: 14px; font-weight: 700; }
.side-head b { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.side-head span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.vis-list { padding: 6px 12px 8px; }
.vis-gu { margin: 8px 0 14px; }
.vis-gu h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; padding: 8px 8px 6px; font-size: 15px; letter-spacing: -0.02em; }
.vis-gu h3 small { font-size: 12px; font-weight: 500; color: var(--muted); }
.vis-gu ul { list-style: none; margin: 0; padding: 0; }
.vis-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; color: var(--ink); }
.vis-item:hover { background: var(--surface-2); }
.vi-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vi-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vi-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vi-side { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: none; font-variant-numeric: tabular-nums; }
.vi-side b { font-size: 14px; }
.vi-side small { font-size: 11px; color: var(--muted); }
.vi-pl { display: flex; flex-direction: column; align-items: flex-end; margin-top: 3px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.vi-pl em { font-style: normal; }
.vi-pl .g { color: var(--gain-ink); } .vi-pl .l { color: var(--loss); }
.vi-pl small { font-size: 11px; font-weight: 500; color: var(--muted); }
.vis-more { display: block; width: calc(100% - 16px); margin: 4px 8px 0; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.vis-more:hover { background: var(--surface-2); }
.vis-empty { padding: 24px 12px; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6; }
.side-foot { margin: auto 0 0; padding: 12px 20px 18px; font-size: 12px; color: var(--muted); line-height: 1.6; border-top: 1px solid var(--line-2); }

#mapwrap { grid-area: map; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; z-index: 0; background: #eef1f5; }
.search { position: absolute; z-index: 1000; top: 16px; left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 120px)); }
.search input { width: 100%; height: 48px; padding: 0 16px 0 46px; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid transparent; border-radius: 14px; box-shadow: var(--shadow); outline: none; -webkit-appearance: none; appearance: none; }
.search input:focus { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 4px rgba(49, 130, 246, .15); }
.search-ico { position: absolute; left: 15px; top: 14px; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.results { position: absolute; left: 0; right: 0; top: 54px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); max-height: min(420px, 60vh); overflow-y: auto; padding: 6px; }
.results div { padding: 10px 12px; font-size: 14px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.results div span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results div:hover, .results div.on { background: var(--accent-weak); }
.results small { color: var(--muted); white-space: nowrap; font-size: 12px; }
.data-info { position: absolute; z-index: 900; right: 12px; bottom: 28px; max-width: calc(100% - 24px); padding: 7px 12px; font-size: 12px; color: var(--ink-2); background: rgba(255, 255, 255, .94); border-radius: 10px; box-shadow: var(--shadow-sm), 0 4px 14px rgba(15, 23, 42, .1); backdrop-filter: blur(6px); }
.data-info:empty { display: none; }

/* 지도 라벨·묶음 */
.pin { display: inline-flex; align-items: center; gap: 5px; transform: translate(-50%, -50%); padding: 4px 9px 4px 8px; background: var(--surface); color: var(--ink); border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 3px 10px rgba(15, 23, 42, .14); cursor: pointer; transition: transform .12s, background .12s; }
.pin::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.pin small { font-size: 11px; font-weight: 500; color: var(--muted); }
.pin.tr::before { background: #64748b; }
.pin.pend::before { background: #c3c9d1; }
.pin.pend { color: var(--muted); }
.pin.hover { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 0 2px var(--accent), 0 4px 14px rgba(15, 23, 42, .2); }
.pin.sel { background: var(--accent); color: #fff; transform: translate(-50%, -50%) scale(1.08); }
.pin.sel small { color: rgba(255, 255, 255, .8); }
.pin.sel::before { background: #fff; }
.leaflet-container { font-family: var(--font); }
.mc { background: none; border: 0; }
.mc div { display: grid; place-items: center; border-radius: 50%; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; cursor: pointer; transition: transform .12s; }
.mc div:hover { transform: scale(1.08); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-control-zoom a { width: 36px !important; height: 36px !important; line-height: 36px !important; color: var(--ink-2) !important; border-color: var(--line-2) !important; }
.leaflet-top.leaflet-right { top: 6px; right: 4px; }
.leaflet-control-attribution { font-size: 10px; }

/* 공유 */
.share-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share-menu { position: fixed; z-index: 2200; min-width: 190px; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); animation: fade .12s ease-out; }
.share-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.share-menu button:hover, .share-menu button:focus-visible { background: var(--surface-2); outline: none; }
.share-menu svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toast { position: fixed; left: 50%; bottom: 32px; z-index: 2300; transform: translate(-50%, 16px); opacity: 0; padding: 11px 18px; border-radius: 12px; background: rgba(25, 31, 40, .92); color: #fff; font-size: 14px; font-weight: 500; pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.apt-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.apt-title h1 { margin: 8px 0 6px; }

/* ---- 단지 모달 ---- */
.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); animation: fade .18s ease-out; }
.modal-sheet { position: relative; width: min(1080px, 100%); height: 100%; background: var(--bg); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; outline: none; animation: rise .22s cubic-bezier(.2, .8, .2, 1); }
.modal-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.99); } }
.m-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 28px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.m-title { min-width: 0; }
.m-crumb { font-size: 12px; color: var(--muted); font-weight: 500; }
.m-head h2 { margin: 2px 0 0; font-size: 22px; letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.m-content { max-width: 880px; margin: 0 auto; padding: 20px 28px 48px; }
.m-sub { margin: 0 0 16px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }

/* 카드·지표 */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line-2); padding: 22px 24px; margin: 14px 0; }
.card > h2, .card > h3 { margin: 0 0 12px; font-size: 17px; letter-spacing: -0.02em; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0 0 4px; }
.kpi { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi b { font-size: 28px; line-height: 1.25; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.kpi.gain b { color: var(--gain-ink); }
.kpi-pl { display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 24px !important; }
.kpi-pl em { font-style: normal; white-space: nowrap; }
.kpi-pl small { font-size: 13px; font-weight: 600; margin-left: 2px; color: inherit; }
.kpi-pl .g { color: var(--gain-ink); } .kpi-pl .l { color: var(--loss); }
.kpi-counts { display: block; font-size: 13px !important; font-weight: 600; color: var(--ink-2) !important; margin-bottom: 2px; }
.kpi-counts em { font-style: normal; }
.kpi-be { display: block; margin-top: 4px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-2); }
.kpi-be b { color: var(--ink); font-variant-numeric: tabular-nums; }
.markets .mk-be { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.markets th.mk-be { font-weight: 400; }
.markets .mk-range { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.markets td.mk-n { color: var(--muted); font-size: 12px; }
.kpi-counts .g { color: var(--gain-ink); } .kpi-counts .l { color: var(--loss); }
.markets { border-collapse: collapse; width: 100%; font-size: 14px; }
.markets th, .markets td { text-align: left; padding: 11px 6px; border-bottom: 1px solid var(--line-2); font-weight: 400; }
.markets thead th { font-size: 12px; color: var(--muted); padding-top: 0; }
.markets tr:last-child td, .markets tr:last-child th { border-bottom: 0; }
.markets td:nth-child(2) { font-weight: 700; font-variant-numeric: tabular-nums; }
.markets small { color: var(--muted); font-size: 12px; }
.asof { font-size: 12px; color: var(--muted); margin: 14px 2px; }

/* ---- 상세(detail.js) ---- */
.sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin: 12px 0 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend small { color: var(--muted); }
.legend-counts { font-size: 12px; color: var(--muted); margin: -2px 0 6px; }
.row { display: grid; grid-template-columns: 84px 1fr 92px 96px; align-items: center; gap: 10px; font-size: 13px; padding: 5px 0; }
.row.head { font-size: 11px; color: var(--muted); margin-top: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.row > span:first-child { font-variant-numeric: tabular-nums; }
.share { display: inline-block; min-width: 44px; color: var(--ink-2); font-size: 12px; }
.sec-title { font-size: 17px; font-weight: 700; margin: 26px 0 4px; letter-spacing: -0.02em; }
.sec-desc { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin-bottom: 4px; }
.unknown-row { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }
.unknown-row .sub { margin: 0; font-size: 12px; }
.unknown-desc { margin: 2px 0 0 94px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.be { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; color: var(--ink-2); }
.be.gain { color: var(--gain-ink); } .be.loss { color: var(--loss); }
.bar { display: flex; height: 16px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.bar span { height: 100%; }
.n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.note { font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.65; }
.pending { margin: 12px 0 0; padding: 14px 16px; background: var(--surface-2); border-radius: 12px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.basis { margin-top: 4px; padding: 10px 14px; border-radius: 12px; background: #fff6ec; color: #8a4b0f; font-size: 13px; line-height: 1.6; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.tabs button { font-size: 13px; font-weight: 600; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.tabs button small { color: var(--muted); margin-left: 4px; font-weight: 500; }
.tabs button:hover { border-color: #cfd6de; }
.tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs button[aria-selected="true"] small { color: #c9cfd8; }
.pl { margin: 14px 0 6px; padding: 18px; background: var(--surface-2); border-radius: 14px; font-size: 13px; }
.pl small { color: var(--muted); }
.pl-head { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.pl-head small { font-weight: 500; font-size: 12px; margin-left: 4px; }
.seg { display: flex; padding: 4px; gap: 4px; background: #eaedf1; border-radius: 12px; margin-bottom: 14px; }
.seg button { flex: 1; font-size: 13px; font-weight: 600; padding: 8px 6px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.pl-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { border-radius: 12px; padding: 12px 14px; }
.stat.gain { background: var(--gain-bg); color: var(--gain-ink); }
.stat.loss { background: var(--loss-bg); color: var(--loss-ink); }
.stat .lbl { font-size: 13px; font-weight: 700; }
.stat .num { font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat .num small { font-size: 13px; font-weight: 500; color: inherit; margin-left: 2px; }
.stat .pct { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); margin: 12px 0 10px; }
.plbar span { height: 100%; }
.pl-foot { font-size: 12px; color: var(--muted); }
.pl-foot b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pl-tax { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.pl-tax b { font-weight: 700; color: var(--ink); }
.free-left { font-size: 12px; color: var(--muted); margin: 0 0 8px; }

/* 가입 안내 */
.gate { margin-top: 6px; padding: 22px; border-radius: 16px; background: linear-gradient(180deg, #f3f8ff, #fff); border: 1px solid #dbe8fb; }
.gate-title { font-weight: 800; font-size: 18px; margin-bottom: 6px; letter-spacing: -0.02em; }
.gate p { font-size: 13px; color: var(--ink-2); margin: 6px 0 14px; line-height: 1.6; }
.gate label { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0; cursor: pointer; }
.gate input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.kakao { width: 100%; margin-top: 12px; height: 50px; border: 0; border-radius: 12px; background: #FEE500; color: rgba(0, 0, 0, .85); font-weight: 700; font-size: 15px; cursor: pointer; }
.kakao:disabled { opacity: .4; cursor: not-allowed; }
.gate .free-left { margin: 12px 0 0; text-align: center; }

/* ---- 내용 페이지 ---- */
.content { max-width: 880px; margin: 0 auto; padding: 28px 20px 56px; }
.content h1 { font-size: 30px; margin: 8px 0 6px; letter-spacing: -0.03em; line-height: 1.3; }
.content h2 { font-size: 19px; margin: 32px 0 10px; letter-spacing: -0.02em; }
.content .card > h2 { margin: 0 0 12px; font-size: 17px; }
.crumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.crumb a { color: var(--muted); }
.apt-head { margin: 6px 0 16px; }
.apt-head .m-sub { margin: 0; }
.status-note { font-size: 13px; color: var(--ink-2); margin: 12px 2px; }
.more-link { margin: 14px 0 0; font-size: 14px; font-weight: 600; }
.nearby, .apt-list, .gu-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 20px; font-size: 14px; }
.nearby li, .gu-list li { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.apt-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.apt-list li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line-2); padding: 9px 0; }
.nearby small, .apt-list small, .gu-list small { color: var(--muted); font-size: 12px; margin-left: 4px; }
.prose { line-height: 1.8; font-size: 15px; color: var(--ink-2); }
.prose h1, .prose h2, .prose h3 { color: var(--ink); }
.prose h3 { font-size: 16px; margin: 22px 0 6px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0 16px; line-height: 1.6; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.legal-meta { font-size: 13px; color: var(--muted); }
.prose h2[id] { scroll-margin-top: calc(var(--top-h) + 16px); }
.legal-toc { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 20px; margin: 18px 0 8px; font-size: 14px; columns: 2; column-gap: 28px; }
.legal-toc a { display: block; padding: 3px 0; color: var(--ink-2); break-inside: avoid; }

/* ---- 휴대폰 ---- */
@media (max-width: 860px) {
  :root { --top-h: 56px; }
  .top { gap: 10px; padding: 0 14px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 26px; height: 26px; font-size: 14px; }
  .top-nav { font-size: 13px; }
  .top-nav a { padding: 6px 7px; }
  .auth .who { display: none; }
  body.map #app { display: flex; flex-direction: column; height: auto; }
  #mapwrap { height: 64vh; height: 64dvh; flex: none; }
  #side { border-right: 0; overflow: visible; }
  .side-head { top: var(--top-h); }
  .search { top: 12px; width: calc(100% - 24px); left: 12px; transform: none; }
  .search input { height: 46px; font-size: 16px; }
  .leaflet-top.leaflet-right { top: 64px; }
  .data-info { left: 12px; right: auto; bottom: 22px; font-size: 11px; }
  .modal { padding: 0; }
  .modal-sheet { border-radius: 0; }
  .m-head { padding: 12px 16px; }
  .m-head h2 { font-size: 19px; }
  .m-head .btn:not(.share-btn) { display: none; }
  .m-head .share-btn { width: 38px; padding: 0; }
  .m-head .share-btn span { display: none; }
  .m-content { padding: 16px 16px 40px; }
  .card { padding: 18px 16px; border-radius: 14px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }  /* 데스크톱처럼 한 줄에 나란히 */
  .kpi { padding: 12px 10px; border-radius: 14px; }
  .kpi span { font-size: 12px; }
  .kpi b { font-size: 20px; }
  .kpi-pl { font-size: 16px !important; flex-direction: column; }
  .kpi-pl small { font-size: 11px; }
  .kpi-rest { display: none; }  /* 좁은 화면: '판단 못 함' 줄은 숨김(카드 높이) */
  .kpi small { font-size: 11px; line-height: 1.4; }
  .row { grid-template-columns: 66px 1fr 78px 80px; gap: 6px; }
  .unknown-desc { margin-left: 72px; }
  .content { padding: 20px 16px 48px; }
  .content h1 { font-size: 25px; }
  .legal-toc { columns: 1; }
  .markets .mk-n { display: none; }  /* 좁은 화면: 근거 열은 숨기고 아래 설명으로 */
  .markets th, .markets td { padding: 10px 4px; font-size: 13px; }
  .prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .prose th, .prose td { min-width: 96px; word-break: keep-all; }
}
@media (max-width: 420px) {
  .top-nav a:first-child, .top-nav a:last-child { display: none; }  /* 지도(로고와 같음)·계산 방법(바닥글에 있음)만 숨김 */
}

/* 관리자 화면(/admin/) */
.admin [hidden] { display: none !important; }  /* .btn의 display가 hidden 속성을 덮지 않게 */
.adm-tag { font-size: 13px; font-weight: 700; color: var(--accent-ink); background: var(--accent-weak); padding: 4px 10px; border-radius: 999px; }
.adm h3 { font-size: 15px; margin: 20px 0 8px; }
.adm .muted, .adm-table td.muted { color: var(--muted); font-size: 13px; }
.adm-kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.adm-kv dt { color: var(--muted); }
.adm-kv dd { margin: 0; overflow-wrap: anywhere; }
.adm-scroll { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.adm-table th, .adm-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.adm-table th { color: var(--muted); font-weight: 600; }
.adm-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.adm-msg { font-size: 13px; color: var(--ink-2); margin: 8px 0; min-height: 1em; }
.adm-msg.bad { color: var(--loss-ink); }
.adm-input { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; background: var(--surface); color: var(--ink); }
.adm-num { width: 120px; }
.adm-login { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.adm-set { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.adm-set > span { grid-column: 1 / -1; font-size: 12px; }
.adm-check { display: block; margin-top: 12px; font-size: 14px; }
.adm-top { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.8; }
@media (max-width: 640px) {
  .adm-kv { grid-template-columns: 1fr; gap: 2px; }
  .adm-kv dd { margin-bottom: 8px; }
}

/* 베타 배지(로고 옆) */
.beta { display: inline-flex; align-items: center; gap: 6px; margin-left: -14px; white-space: nowrap; }
.beta b { font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent-weak); padding: 2px 7px; border-radius: 999px; letter-spacing: 0; }
.beta span { font-size: 12px; color: var(--muted); }

/* 첫 방문 안내 팝업 */
.notice { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.notice-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); animation: fade .18s ease-out; }
.notice-box { position: relative; width: min(520px, 100%); max-height: calc(100% - 16px); overflow-y: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 24px 24px 20px; animation: rise .22s cubic-bezier(.2, .8, .2, 1); outline: none; }
.notice-box h2 { margin: 0 0 12px; font-size: 19px; letter-spacing: -0.02em; }
.notice-box ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.notice-box li + li { margin-top: 6px; }
.notice-box b { color: var(--ink); }
.notice-more { margin: 12px 0 0; font-size: 13px; }
.notice-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* 내 정보(/account/) */
.account .card h2 { font-size: 17px; }
.acc-lose { margin: 0; padding-left: 18px; line-height: 1.7; color: var(--ink-2); font-size: 14px; }
.acc-reasons { display: grid; gap: 8px; font-size: 14px; }
.acc-reason { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.acc-foot { font-size: 13px; color: var(--muted); margin-top: 24px; }
.acc-foot a { color: var(--muted); }
.acc-del { color: var(--muted); font-weight: 500; }
.btn-danger { background: var(--loss); color: #fff; }
.btn-danger:hover { background: var(--loss-ink); }
.btn[disabled] { opacity: .5; cursor: default; }
@media (max-width: 860px) {
  .beta { margin-left: -6px; }
}
@media (max-width: 480px) {
  .top-nav { display: none; }  /* 아주 좁은 화면은 '지금은 서울만'을 보이려고 메뉴를 숨김(구별 보기·계산 방법은 바닥글에 있음) */
  .beta span { font-size: 11px; }
  .notice-actions { flex-direction: column-reverse; }
  .notice-actions .btn { width: 100%; }
}
.rebuilt-note { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); line-height: 1.6; }

/* 상단 "앱 설치" 버튼과 설치 안내 */
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top-right .auth { margin-left: 0; }
.install-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-btn[hidden] { display: none; }
.install-steps { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.install-steps li + li { margin-top: 6px; }
.install-note { margin: 0; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
@media (max-width: 640px) {
  .install-btn { padding: 0 9px; }
  .install-btn span { display: none; }  /* 좁은 화면은 아이콘만(aria-label로 이름) */
}
/* 인앱에서 넘어와 로그인을 이어서 하는 안내(화면 아래) */
.resume-bar { position: fixed; left: 50%; bottom: 16px; z-index: 2150; transform: translateX(-50%); width: min(480px, calc(100% - 24px)); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); animation: fade .2s ease-out; }
.resume-bar p { margin: 0; font-size: 14px; color: var(--ink); }
.resume-bar div { display: flex; gap: 6px; flex-shrink: 0; }
