:root {
  --bg:#f4f6f9; --card:#fff; --line:#e3e7ee; --text:#1c2430; --muted:#6b7585;
  --navy:#132a4f; --navy2:#1c3a6b; --accent:#ff6a13; --blue:#1f5eff;
  --ok:#0f8a4a; --warn:#b45309; --bad:#c62828; --okbg:#e3f6ea; --warnbg:#fff3df; --badbg:#fde8e8;
}
* { box-sizing: border-box; }
body { margin:0; font-family:"Pretendard","Malgun Gothic","Apple SD Gothic Neo",system-ui,sans-serif; background:var(--bg); color:var(--text); font-size:14px; }
a { color:var(--blue); }

/* ---------- 헤더 ---------- */
.topbar { background:var(--navy); color:#fff; }
.topbar .in { max-width:1360px; margin:0 auto; padding:0 20px; display:flex; align-items:stretch; gap:6px; min-height:56px; flex-wrap:wrap; }
.logo { align-self:center; }
.logo { display:flex; align-items:center; gap:8px; color:#fff; text-decoration:none; font-weight:800; font-size:17px; margin-right:18px; white-space:nowrap; }
.logo i { width:28px; height:28px; border-radius:7px; background:var(--accent); display:inline-flex; align-items:center; justify-content:center; font-style:normal; font-size:15px; }
.nav { display:flex; align-items:stretch; flex-wrap:wrap; }
.nav > a, .nav .dd { min-height:56px; }
.nav > a, .nav .dd > span { color:#d6deeb; text-decoration:none; padding:0 13px; display:flex; align-items:center; font-weight:600; font-size:14.5px; white-space:nowrap; cursor:pointer; border-bottom:3px solid transparent; }
.nav > a:hover, .nav .dd:hover > span { color:#fff; }
.nav > a.active, .nav .dd.active > span { color:#fff; border-bottom-color:var(--accent); }
.dd { position:relative; display:flex; }
.dd .menu { display:none; position:absolute; top:100%; left:0; background:#fff; border:1px solid var(--line); border-radius:0 0 8px 8px; box-shadow:0 8px 24px rgba(0,0,0,.12); min-width:170px; z-index:20; padding:6px 0; }
.dd:hover .menu { display:block; }
.dd .menu a { display:block; padding:8px 16px; color:var(--text); text-decoration:none; font-size:13.5px; }
.dd .menu a:hover { background:#f2f5fa; color:var(--navy); }
.topstat { align-self:center; margin-left:auto; font-size:12px; color:#9fb0c9; display:flex; gap:10px; align-items:center; white-space:nowrap; }
.topstat a { color:#9fb0c9; text-decoration:none; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:3px; }
.dot.ok { background:#34d17a; } .dot.bad { background:#ff5a5a; }

main { padding:20px; max-width:1360px; margin:0 auto; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:16px; }
.grid { display:grid; gap:16px; }
.grid.c2 { grid-template-columns:1fr 1fr; } .grid.c3 { grid-template-columns:repeat(3,1fr); } .grid.c4 { grid-template-columns:repeat(4,1fr); }
.grid.side { grid-template-columns: minmax(0,1fr) 380px; align-items:start; }
@media (max-width:1000px){ .grid.c2,.grid.c3,.grid.c4,.grid.side { grid-template-columns:1fr; } }
h1 { font-size:21px; margin:0 0 14px; } h2 { font-size:16px; margin:0 0 12px; color:#22304a; }
h2 small, h1 small { font-weight:400; color:var(--muted); font-size:12.5px; margin-left:6px; }
.sec-head { display:flex; align-items:baseline; justify-content:space-between; margin:22px 0 10px; }
.sec-head h2 { margin:0; font-size:18px; }
.sec-head a { font-size:13px; text-decoration:none; }

table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { border-bottom:1px solid var(--line); padding:7px 8px; text-align:left; white-space:nowrap; vertical-align:middle; }
th { background:#f3f5f9; font-weight:600; color:#3b4659; } td.num, th.num { text-align:right; font-variant-numeric:tabular-nums; }
td.wrap { white-space:normal; }
.tbl-wrap { overflow:auto; }
label { display:block; font-size:12px; color:var(--muted); margin-bottom:3px; }
input[type=text], input[type=number], input[type=password], input[type=date], select, textarea { width:100%; padding:7px 9px; border:1px solid #cdd5e0; border-radius:6px; font-size:14px; font-family:inherit; background:#fff; }
textarea { font-family:inherit; }
.field { margin-bottom:10px; }
.check { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text); margin:6px 0; }
.check input { width:auto; }
button, .btn { background:var(--blue); color:#fff; border:0; border-radius:6px; padding:8px 14px; font-size:14px; cursor:pointer; text-decoration:none; display:inline-block; font-family:inherit; }
.btn.accent, button.accent { background:var(--accent); }
button.secondary, .btn.secondary { background:#e8ecf2; color:#1c2430; } button.danger { background:var(--bad); }
button:disabled { opacity:.5; cursor:not-allowed; }
.btn.sm, button.sm { padding:4px 10px; font-size:12.5px; }

.badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11.5px; font-weight:700; white-space:nowrap; }
.badge.high { background:var(--okbg); color:var(--ok);} .badge.mid { background:#e0eaff; color:#1d4ed8;} .badge.low { background:var(--warnbg); color:var(--warn);} .badge.fail { background:var(--badbg); color:var(--bad);} .badge.unknown { background:#eceff3; color:#5b6575; }
.badge.제안 { background:var(--ok); color:#fff; } .badge.감시 { background:#f59e0b; color:#fff; } .badge.제외 { background:#9aa3b2; color:#fff; }
.badge.share { background:#7c3aed; color:#fff; } .badge.src { background:#eef2f8; color:#33415c; } .badge.dday { background:#fff1e8; color:var(--accent); }
.badge.type { background:#e7f0ff; color:#1e4fc2; } .badge.risk-high { background:var(--badbg); color:var(--bad); } .badge.risk-mid { background:var(--warnbg); color:var(--warn); } .badge.risk-info { background:#eef2f8; color:#4b5568; }
.ok { color:var(--ok);} .bad { color:var(--bad);} .warn { color:var(--warn); } .muted { color:var(--muted); }
pre { background:#0f172a; color:#e2e8f0; padding:12px; border-radius:6px; overflow:auto; font-size:12.5px; line-height:1.5; }
.msg { background:#ecfdf5; border:1px solid #a7f3d0; color:#065f46; padding:8px 12px; border-radius:6px; margin-bottom:12px; }
.err { background:#fef2f2; border:1px solid #fecaca; color:#991b1b; padding:8px 12px; border-radius:6px; margin-bottom:12px; }
.verdict { font-size:18px; font-weight:800; padding:10px 14px; border-radius:8px; margin-bottom:10px; }
.verdict.제안 { background:var(--okbg); color:var(--ok);} .verdict.감시 { background:var(--warnbg); color:var(--warn);} .verdict.제외, .verdict.포기, .verdict.포기\/보류 { background:var(--badbg); color:var(--bad);}
.kv td:first-child { color:var(--muted); width:38%; white-space:nowrap; } .kv td { white-space:normal; }
.inline { display:flex; gap:10px; align-items:end; flex-wrap:wrap; } .inline .field { margin:0; min-width:120px; }
.hint { font-size:12px; color:var(--muted); margin-top:4px; }
.log { background:#0f172a; color:#e2e8f0; font-family:Consolas,monospace; font-size:12px; padding:10px; border-radius:6px; height:320px; overflow:auto; white-space:pre-wrap; }
details summary { cursor:pointer; color:var(--blue); }
.stat { font-size:24px; font-weight:800; } .stat small { font-size:12px; color:var(--muted); font-weight:400; display:block; }

/* ---------- 추천 홈 ---------- */
.hero { background:linear-gradient(120deg,var(--navy) 0%, var(--navy2) 100%); color:#fff; border-radius:12px; padding:20px 22px; margin-bottom:16px; display:flex; gap:24px; align-items:center; flex-wrap:wrap; }
.hero h1 { color:#fff; margin:0 0 4px; font-size:22px; }
.hero p { margin:0; color:#b9c7de; font-size:13px; }
.kpis { display:flex; gap:10px; margin-left:auto; flex-wrap:wrap; }
.kpi { background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14); border-radius:10px; padding:10px 16px; min-width:96px; text-decoration:none; color:#fff; }
.kpi b { display:block; font-size:24px; font-weight:800; }
.kpi span { font-size:12px; color:#b9c7de; }
.kpi.hot b { color:#ffb37a; }
.chips { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:6px; }
.chip { background:#fff; border:1px solid var(--line); border-radius:20px; padding:7px 14px; color:#22304a; text-decoration:none; font-size:13px; font-weight:600; }
.chip:hover, .chip.on { border-color:var(--accent); color:var(--accent); background:#fff6f0; }

.cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:14px; }
.icard { background:#fff; border:1px solid var(--line); border-radius:12px; overflow:hidden; display:flex; flex-direction:column; text-decoration:none; color:inherit; transition:box-shadow .15s, transform .15s; }
.icard:hover { box-shadow:0 10px 24px rgba(19,42,79,.12); transform:translateY(-2px); }
.thumb { height:132px; background:#dfe6f1 center/cover no-repeat; position:relative; display:flex; align-items:center; justify-content:center; color:#7d8aa3; font-weight:700; font-size:15px; }
.thumb .tl { position:absolute; top:8px; left:8px; display:flex; gap:4px; flex-wrap:wrap; }
.thumb .tr { position:absolute; top:8px; right:8px; }
.score { width:44px; height:44px; border-radius:50%; background:#fff; color:var(--navy); font-weight:800; font-size:15px; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 8px rgba(0,0,0,.18); }
.score.hi { background:var(--accent); color:#fff; }
.ibody { padding:12px 14px 14px; display:flex; flex-direction:column; gap:6px; flex:1; }
.iaddr { font-weight:700; font-size:14.5px; line-height:1.35; }
.ititle { color:var(--muted); font-size:12.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.prices { display:flex; justify-content:space-between; align-items:baseline; font-size:12.5px; color:var(--muted); }
.prices b { color:var(--bad); font-size:17px; }
.bar { height:6px; background:#edf1f6; border-radius:4px; overflow:hidden; }
.bar i { display:block; height:100%; background:linear-gradient(90deg,var(--accent),#ffb37a); }
.capline { font-size:12.5px; display:flex; justify-content:space-between; }
.headline { font-size:12.5px; color:#2b3a55; background:#f5f8fc; border-radius:6px; padding:7px 9px; line-height:1.45; }

/* ---------- 목록 ---------- */
.filters { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; align-items:end; }
.filters .field { margin:0; }
.list td .addr { font-weight:700; } .list td .sub { color:var(--muted); font-size:12px; max-width:380px; overflow:hidden; text-overflow:ellipsis; }
.list .tn { width:72px; height:54px; border-radius:6px; background:#dfe6f1 center/cover no-repeat; display:flex; align-items:center; justify-content:center; font-size:11px; color:#7d8aa3; }
.list tr:hover td { background:#fafcff; }
.pager { display:flex; gap:6px; justify-content:center; margin-top:12px; }
.pager a, .pager span { padding:5px 10px; border:1px solid var(--line); border-radius:6px; text-decoration:none; background:#fff; }
.pager span { background:var(--navy); color:#fff; border-color:var(--navy); }

/* ---------- 상세 ---------- */
.ihead { display:flex; gap:18px; align-items:flex-start; flex-wrap:wrap; }
.ihead .thumb { width:260px; height:180px; border-radius:10px; }
.sticky { position:sticky; top:12px; }
.pricebars .row { display:grid; grid-template-columns:86px 1fr 92px; gap:8px; align-items:center; margin:7px 0; font-size:12.5px; }
.pricebars .track { height:12px; background:#eef2f7; border-radius:6px; position:relative; overflow:hidden; }
.pricebars .track i { position:absolute; left:0; top:0; bottom:0; border-radius:6px; }
.suggest { background:#fff6f0; border:1px solid #ffd4b8; border-radius:10px; padding:12px 14px; margin:10px 0; }
.suggest b { color:var(--accent); font-size:20px; }
.risk { display:flex; gap:8px; padding:7px 0; border-bottom:1px dashed var(--line); font-size:13px; }
.risk:last-child { border-bottom:0; }
.photos { display:flex; gap:6px; flex-wrap:wrap; } .photos img { width:120px; height:84px; object-fit:cover; border-radius:6px; }
.empty { text-align:center; padding:36px 16px; color:var(--muted); }
.empty h2 { color:var(--text); }
.steps { text-align:left; display:inline-block; line-height:1.9; }

@media (max-width:1180px){ .topstat { display:none; } .nav > a, .nav .dd > span { padding:0 9px; font-size:14px; } .nav > a, .nav .dd { min-height:48px; } }
.list td.wrap { min-width:260px; }

/* ---------- 대출·수익 한눈에 ---------- */
.ltiles { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
@media (max-width:900px){ .ltiles { grid-template-columns:1fr 1fr; } }
.lt { background:#f5f7fb; border-radius:10px; padding:12px 14px; }
.lt span { display:block; font-size:12px; color:var(--muted); }
.lt b { display:block; font-size:24px; font-weight:800; margin:2px 0; }
.lt em { font-style:normal; font-size:11.5px; color:var(--muted); }
.lt.blue { background:#e8efff; } .lt.blue b { color:#1d4ed8; }
.lt.accent { background:#fff1e8; } .lt.accent b { color:var(--accent); }
.stack { display:flex; height:30px; border-radius:8px; overflow:hidden; background:#eef2f7; font-size:12px; font-weight:700; color:#fff; }
.stack i { display:flex; align-items:center; justify-content:center; font-style:normal; white-space:nowrap; overflow:hidden; padding:0 6px; }
.s-loan { background:#3b6cf6; } .s-dep { background:#14a38b; } .s-mine { background:var(--accent); }
.lh { font-weight:700; font-size:13.5px; margin-bottom:6px; color:#22304a; }
.lrow { display:grid; grid-template-columns:100px 90px 1fr; gap:6px; align-items:baseline; padding:5px 0; border-bottom:1px dashed var(--line); font-size:13px; }
.lrow b { text-align:right; } .lrow em { font-style:normal; color:var(--muted); font-size:11.5px; }
.lrow u { grid-column:1 / -1; text-decoration:none; color:var(--accent); font-size:11.5px; font-weight:700; }
.lrow.bind { background:#fff6f0; border-radius:6px; padding:5px 6px; }
.wf { display:grid; grid-template-columns:104px 1fr 84px; gap:8px; align-items:center; margin:5px 0; font-size:13px; }
.wf b { text-align:right; } .wbar { height:14px; background:#f0f3f8; border-radius:4px; overflow:hidden; }
.wf i { display:block; height:100%; }
.wf.pos i { background:#16a34a; } .wf.neg i { background:#ef8a8a; } .wf.sub i { background:#3b6cf6; } .wf.final i { background:var(--accent); }
.wf.sub span, .wf.final span { font-weight:700; } .wf.final b { font-size:16px; color:var(--accent); }

.badge.risk-good { background:var(--okbg); color:var(--ok); }
.themes { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:10px; }
.theme { background:#fff; border:1px solid var(--line); border-radius:10px; padding:12px 14px; text-decoration:none; color:inherit; display:flex; flex-direction:column; gap:2px; }
.theme:hover { border-color:var(--accent); background:#fff6f0; }
.theme b { font-size:15px; } .theme span { font-size:12px; color:var(--muted); } .theme em { font-style:normal; font-weight:800; color:var(--accent); font-size:18px; margin-top:4px; }

/* ---------- 입찰 달력 ---------- */
.cal { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.cal .ch { text-align:center; font-weight:700; font-size:12.5px; color:var(--muted); padding:4px 0; }
.cal .cd { min-height:92px; background:#fafbfd; border:1px solid var(--line); border-radius:6px; padding:4px; display:flex; flex-direction:column; gap:3px; }
.cal .cd.out { background:transparent; border:0; }
.cal .cd.today { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.cal .dn { font-size:12px; font-weight:700; color:#3b4659; }
.ev { display:block; font-size:11px; line-height:1.3; padding:2px 4px; border-radius:4px; text-decoration:none; color:#1c2430; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.ev span { display:block; color:var(--muted); font-size:10.5px; }
.ev.watch { background:#fff1e8; border-left:3px solid var(--accent); }
.ev.reco { background:#e8efff; border-left:3px solid #3b6cf6; }
@media (max-width:760px){ .cal .cd { min-height:60px; } .ev span { display:none; } }
/* ---------- 지역별 현황 ---------- */
.hbar { display:grid; grid-template-columns:110px 1fr 70px 60px; gap:8px; align-items:center; padding:4px 0; font-size:13px; }
.hbar .tr { height:16px; background:#eef2f7; border-radius:4px; overflow:hidden; }
.hbar .tr i { display:block; height:100%; background:linear-gradient(90deg,#3b6cf6,#7aa0ff); }
.hbar .tr i.p { background:linear-gradient(90deg,var(--accent),#ffb37a); }

/* ---------- 휴대폰 ---------- */
.burger { display:none; margin-left:auto; align-self:center; background:transparent; border:1px solid rgba(255,255,255,.3); color:#fff; font-size:20px; padding:4px 12px; border-radius:6px; }
@media (max-width:760px){
  body { font-size:15px; }
  .topbar .in { padding:0 12px; min-height:52px; }
  .burger { display:block; }
  .nav { display:none; width:100%; flex-direction:column; padding-bottom:8px; }
  body.navopen .nav { display:flex; }
  .nav > a, .nav .dd { min-height:44px; }
  .nav > a, .nav .dd > span { padding:0 6px; border-bottom:0; border-left:3px solid transparent; }
  .nav > a.active, .nav .dd.active > span { border-left-color:var(--accent); border-bottom:0; }
  .dd { flex-direction:column; }
  .dd > span { min-height:44px; }
  .dd:hover .menu { display:none; }
  .dd.open .menu { display:block; position:static; box-shadow:none; border:0; background:rgba(255,255,255,.06); border-radius:6px; }
  .dd .menu a { color:#d6deeb; padding:10px 16px; }
  .topstat { display:none; }
  main { padding:12px; }
  h1 { font-size:19px; } h1 small { display:block; margin:4px 0 0; }
  .hero { padding:16px; gap:12px; }
  .hero h1 { font-size:19px; }
  .kpis { margin-left:0; width:100%; display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
  .kpi { min-width:0; padding:8px; } .kpi b { font-size:19px; }
  .hero form, .hero form button { width:100%; }
  .cards { grid-template-columns:1fr; }
  .themes { grid-template-columns:1fr 1fr; }
  .chips { flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; -webkit-overflow-scrolling:touch; }
  .chip { white-space:nowrap; flex:0 0 auto; }
  .filters { grid-template-columns:1fr 1fr; }
  .card { padding:12px; border-radius:8px; }
  .list td.wrap { min-width:180px; }
  .ihead .thumb { width:100%; height:170px; }
  .stat { font-size:20px; }
  input[type=text], input[type=number], input[type=password], input[type=date], select, textarea { font-size:16px; }
  .ltiles { grid-template-columns:1fr 1fr; } .lt b { font-size:19px; }
  .lrow { grid-template-columns:86px 80px 1fr; }
  .wf { grid-template-columns:92px 1fr 72px; }
  .hbar { grid-template-columns:80px 1fr 56px 44px; }
  .sticky { position:static; }
}

.stars { color:#f59e0b; letter-spacing:1px; font-size:15px; line-height:1; }
.stars.big { font-size:24px; margin:2px 0 6px; }

/* ---------- 권리분석 요약 ---------- */
.rgrade { font-weight:800; padding:4px 12px; border-radius:6px; color:#fff; font-size:14px; }
.g-안전 { background:var(--ok); } .g-주의 { background:#d97706; } .g-위험 { background:var(--bad); } .g-확인필요 { background:#6b7585; }
.rsum { margin:8px 0 10px; padding-left:18px; line-height:1.7; }
.todo { margin:4px 0; padding-left:20px; line-height:1.7; font-size:13px; }
tr.bindrow td { background:#fff6f0; }

/* ---------- 문제 사유 빨간 요약 ---------- */
.alerts { display:flex; flex-direction:column; gap:2px; }
.al { color:#d32f2f; font-size:12.5px; line-height:1.4; }
.al.high { color:#c62828; font-weight:800; }
.al.more { color:#9a5a5a; font-size:11.5px; }
.alerts.small .al { font-size:11.5px; }
.alertbox { border:2px solid #e53935; background:#fff5f5; border-radius:10px; padding:12px 16px; margin-bottom:16px; }
.alertbox .ah { color:#c62828; font-weight:800; font-size:16px; margin-bottom:6px; }
.alertbox .ah span { font-weight:600; font-size:12.5px; margin-left:8px; color:#9a3a3a; }
.alertbox .al { font-size:14px; padding:2px 0; }
.alertbox .af { margin-top:6px; font-size:12.5px; }
.okbox { border:1px solid #a7e3bf; background:#effaf3; color:var(--ok); border-radius:10px; padding:10px 16px; margin-bottom:16px; font-weight:700; font-size:13.5px; }

/* ---------- 휴대폰: 넓은 표를 카드로 (table.mstack) ---------- */
@media (max-width:760px){
  table.mstack, table.mstack tbody { display:block; }
  table.mstack thead, table.mstack tr.mhead { display:none; }
  table.mstack tr { display:block; border:1px solid var(--line); border-radius:10px; padding:8px 10px; margin-bottom:10px; background:#fff; }
  table.mstack td { display:flex; justify-content:space-between; gap:10px; border:0; padding:4px 0; white-space:normal; text-align:right; }
  table.mstack td::before { content:attr(data-label); color:var(--muted); font-size:12px; text-align:left; flex:0 0 38%; }
  table.mstack td:first-child { display:block; text-align:left; font-size:15px; border-bottom:1px dashed var(--line); padding-bottom:6px; margin-bottom:4px; }
  table.mstack td:first-child::before { content:none; }
  table.mstack td.wrap { min-width:0; }
  table.mstack tr.bindrow { border-color:var(--accent); }
  .tbl-wrap:has(table.mstack) { overflow:visible; }
  .card.tbl-wrap { padding:10px; }
  .hero .kpis { margin-left:0; }
  .filters { grid-template-columns:1fr 1fr; }
}
