:root{
  --bg:#0f172a; --panel:#ffffff; --text:#1f2937; --muted:#6b7280; --border:#e5e7eb;
  --accent:#1565c0; --safe-bottom:env(safe-area-inset-bottom);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;height:100%}
body{font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR",sans-serif;color:var(--text)}

.app{display:flex;height:100vh;width:100%}
.map{flex:1 1 auto;height:100%}
.panel{
  flex:0 0 320px;height:100%;overflow-y:auto;background:var(--panel);
  border-left:1px solid var(--border);padding:16px 16px calc(20px + var(--safe-bottom));
}

.brand{font-size:1.25rem;margin:2px 0 16px;font-weight:800;letter-spacing:-.02em}
.brand .sub{font-size:.7rem;color:var(--muted);font-weight:600}

.field{display:block;margin-bottom:18px;border:0;padding:0}
.lbl{display:block;font-size:.82rem;font-weight:700;color:#374151;margin-bottom:7px}
.lbl b{color:var(--accent);font-size:1rem}
select{width:100%;padding:9px 10px;border:1px solid var(--border);border-radius:9px;font-size:.92rem;background:#fff}
input[type=range]{width:100%;accent-color:var(--accent)}
.hint{display:block;font-size:.72rem;color:var(--muted);margin-top:5px}

.seg{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.seg button{
  border:1px solid var(--border);background:#fff;color:var(--text);
  border-radius:8px;padding:9px 6px;font-size:.82rem;font-weight:600;cursor:pointer
}
.seg button.on{background:var(--accent);color:#fff;border-color:var(--accent)}

.readout{background:#f1f5f9;border-radius:10px;padding:11px 12px;font-size:.84rem;line-height:1.5;margin-bottom:16px;min-height:42px}
.readout b{color:var(--accent)}

.legend{border-top:1px solid var(--border);padding-top:14px}
.bar{display:flex;height:12px;border-radius:6px;overflow:hidden;margin:4px 0}
.bar i{flex:1}
.bar-lbl{display:flex;justify-content:space-between;font-size:.68rem;color:var(--muted)}
.leg-row{display:flex;align-items:center;gap:7px;font-size:.78rem;margin-top:7px}
.sw{width:14px;height:14px;border-radius:3px;display:inline-block;border:1px solid rgba(0,0,0,.1)}
.sw.reg{background:repeating-linear-gradient(45deg,#9e9e9e,#9e9e9e 3px,#fff 3px,#fff 6px)}
.chk{display:flex;align-items:center;gap:6px;font-size:.78rem;margin-top:10px;color:#374151}
.foot{font-size:.68rem;color:var(--muted);margin-top:14px;line-height:1.4}

.leaflet-container{background:#eef2f5}
.rinfo b{font-size:1.05rem}
.rbtn{margin-top:8px;display:inline-block;background:var(--accent);color:#fff;border:0;border-radius:7px;padding:6px 11px;font-size:.8rem;font-weight:700;cursor:pointer}

/* 모바일: 세로 스택 */
@media (max-width:760px){
  html,body{height:auto}
  .app{flex-direction:column-reverse;height:auto;min-height:100vh}
  .map{height:68vh;flex:0 0 auto}
  .panel{flex:0 0 auto;height:auto;border-left:0;border-top:1px solid var(--border)}
  .region-list{max-height:150px}
}

/* 규제 옵션 + 포함지역 목록/검색 */
.reg-opt{margin:-2px 0 14px}
.hint-inline{font-weight:400;color:var(--muted);font-size:.72rem}
.results{margin-bottom:16px}
#regionSearch{width:100%;padding:8px 10px;border:1px solid var(--border);border-radius:8px;font-size:.88rem;margin:6px 0}
.region-list{max-height:172px;overflow-y:auto;border:1px solid var(--border);border-radius:8px;padding:4px;background:#fafbfc}
.rl-head{font-size:.74rem;color:var(--muted);padding:5px 6px;font-weight:700}
.rl-empty{font-size:.8rem;color:var(--muted);padding:12px 6px;text-align:center}
.rl-grp{margin:1px 0}
.rl-grp>summary{cursor:pointer;font-size:.82rem;font-weight:700;padding:6px;border-radius:6px;list-style:none;display:flex;align-items:center}
.rl-grp>summary::-webkit-details-marker{display:none}
.rl-grp>summary:before{content:"▸";margin-right:6px;color:var(--muted);font-size:.7rem}
.rl-grp[open]>summary:before{content:"▾"}
.rl-cnt{font-weight:500;color:var(--muted);font-size:.72rem;margin-left:auto}
.ritem{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;text-align:left;background:none;border:0;border-radius:6px;padding:6px 8px;font-size:.82rem;cursor:pointer;color:var(--text)}
.ritem:hover{background:#eef2f7}
.ritem.sub{padding-left:20px;font-size:.8rem}
.rl-sub{color:var(--muted);font-size:.72rem}
.bd{font-size:.7rem;font-weight:700;border-radius:5px;padding:2px 6px;white-space:nowrap}
.bd.ok{background:#e6f4ea;color:#1a7a3a}
.bd.no{background:#eceff1;color:#90a4ae}
.bd.reg{background:#fdecea;color:#d62728}
.muted{color:var(--muted);font-weight:400;font-size:.76rem}
