:root{
  color-scheme:light;
  --bg:#f5f7fb;
  --surface:rgba(255,255,255,.78);
  --surface-strong:rgba(255,255,255,.92);
  --surface-soft:#f6f7fb;
  --line:rgba(60,60,67,.12);
  --text:#111827;
  --sub:#667085;
  --blue:#0a84ff;
  --blue-soft:#eaf4ff;
  --green:#e8f7ee;
  --orange:#fff2e2;
  --red:#ffebeb;
  --shadow:0 18px 48px rgba(15,23,42,.12);
}
*{box-sizing:border-box}
html,body{
  width:100%;height:100%;margin:0;padding:0;
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Apple SD Gothic Neo","Pretendard","Noto Sans KR",sans-serif;
  letter-spacing:-.02em;
}
button,input,select{font:inherit}
button{border:none;background:none;color:inherit}
input,select{appearance:none}
[hidden]{display:none !important}
.app-shell{position:relative;width:100vw;height:100vh;overflow:hidden}
#map{position:absolute;inset:0;background:#e7edf5}
.overlay-card{
  backdrop-filter:blur(28px) saturate(150%);
  -webkit-backdrop-filter:blur(28px) saturate(150%);
  background:var(--surface);
  border:1px solid rgba(255,255,255,.68);
  box-shadow:var(--shadow);
}
.top-overlay{
  position:fixed;
  z-index:1200;
  top:12px;
  left:50%;
  transform:translateX(-50%);
  width:min(920px, calc(100vw - 24px));
  border-radius:22px;
  padding:8px 10px;
  overflow:visible;
}
.top-bar{display:flex;align-items:center;gap:8px}
.brand-title{
  margin:0;
  flex:0 0 auto;
  font-size:18px;
  line-height:1;
  font-weight:800;
  letter-spacing:-.03em;
}
.search-box{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  flex:1 1 auto;
  min-height:40px;
  padding:0 13px;
  border-radius:17px;
  background:var(--surface-strong);
  border:1px solid var(--line);
  overflow:hidden;
}
.search-icon{position:relative;z-index:2;width:18px;height:18px;fill:#8a8a90;flex:0 0 auto}
.search-box input{
  position:relative;
  z-index:2;
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  color:var(--text);
  font-size:15px;
  font-weight:600;
}
.search-box input::placeholder{color:#8a8a90;font-weight:500}
.search-marquee{
  display:none;
  position:absolute;
  left:42px;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  overflow:hidden;
  color:#8a8a90;
  font-size:14px;
  font-weight:500;
  pointer-events:none;
  white-space:nowrap;
}
.search-marquee span{
  display:inline-block;
  min-width:max-content;
  padding-left:100%;
}
.search-box.has-value .search-marquee,
.search-box.is-focus .search-marquee{display:none}
.floating-actions{
  position:fixed;
  z-index:1199;
  top:calc(var(--actions-top, 66px));
  left:50%;
  transform:translateX(-50%);
  width:min(920px, calc(100vw - 24px));
  display:flex;
  justify-content:flex-end;
  gap:8px;
  pointer-events:none;
}
.floating-actions .action-btn{pointer-events:auto}
.action-btn{
  min-width:54px;
  height:36px;
  padding:0 12px;
  border-radius:999px;
  background:var(--surface);
  border:1px solid rgba(255,255,255,.74);
  box-shadow:0 10px 24px rgba(15,23,42,.12);
  cursor:pointer;
  font-size:13px;
  font-weight:800;
}
.action-btn.primary{background:rgba(10,132,255,.92);color:#fff}
.info-panel{
  position:fixed;
  z-index:1200;
  right:max(12px, calc(50vw - 448px));
  top:calc(var(--info-top, 110px));
  width:min(320px, calc(100vw - 32px));
  border-radius:24px;
  padding:14px;
}
.info-panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.info-panel-head strong{font-size:15px;font-weight:800}
.icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  border-radius:999px;
  background:var(--surface-strong);
  border:1px solid var(--line);
  font-size:20px;
  line-height:1;
  cursor:pointer;
}
.info-panel-body{display:grid;gap:10px;margin-top:12px}
.info-block{
  padding:12px 13px;
  border-radius:18px;
  background:var(--surface-strong);
  border:1px solid var(--line);
}
.info-block-title{margin:0 0 8px;font-size:12px;font-weight:800;color:var(--sub)}
.info-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.info-stat{
  padding:10px 11px;
  border-radius:14px;
  background:var(--surface-soft);
}
.info-stat strong{display:block;font-size:17px;font-weight:800;line-height:1.1}
.info-stat span{display:block;margin-top:4px;color:var(--sub);font-size:11px;font-weight:700}
.info-row{display:flex;justify-content:space-between;gap:12px;padding:2px 0;font-size:13px;font-weight:700}
.info-row span:last-child{color:var(--sub)}
.bottom-sheet{
  position:fixed;
  z-index:1200;
  left:50%;
  bottom:16px;
  transform:translateX(-50%);
  width:min(920px, calc(100vw - 24px));
  height:var(--sheet-height);
  min-height:120px;
  border-radius:30px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.sheet-handle{
  display:flex;
  justify-content:center;
  align-items:center;
  padding:10px 16px 6px;
  cursor:grab;
  touch-action:none;
  flex:0 0 auto;
}
.sheet-handle:active{cursor:grabbing}
.sheet-handle-bar{
  display:block;
  width:52px;
  height:5px;
  border-radius:999px;
  background:rgba(60,60,67,.26);
}
.sheet-scroll{flex:1 1 auto;min-height:0;overflow:auto;padding-bottom:10px}
.sheet-scroll::-webkit-scrollbar{width:8px}
.sheet-scroll::-webkit-scrollbar-thumb{background:rgba(60,60,67,.18);border-radius:999px}
.sheet-header{padding:0 14px 10px;display:grid;gap:10px}
.sheet-toolbar{display:flex;gap:10px;align-items:center}
.segment{
  flex:1 1 auto;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  padding:4px;
  border-radius:999px;
  background:rgba(120,120,128,.12);
}
.segment-btn{
  height:40px;
  border-radius:999px;
  color:var(--sub);
  font-weight:800;
  cursor:pointer;
}
.segment-btn.active{
  background:var(--surface-strong);
  color:var(--text);
  box-shadow:0 4px 14px rgba(17,17,17,.08);
}
.sheet-tool-btn{
  flex:0 0 auto;
  min-width:68px;
  height:40px;
  padding:0 14px;
  border-radius:999px;
  background:var(--surface-strong);
  border:1px solid var(--line);
  color:var(--sub);
  font-size:13px;
  font-weight:800;
  cursor:pointer;
}
.sheet-tool-btn.active{background:var(--blue-soft);color:var(--blue);border-color:rgba(10,132,255,.18)}
.filter-panel{display:grid;gap:10px}
.filter-row{display:flex;gap:10px;min-width:0}
.select-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  width:100%;
  min-height:44px;
  padding:0 14px;
  border-radius:16px;
  background:var(--surface-strong);
  border:1px solid var(--line);
}
.select-wrap span{flex:0 0 auto;font-size:12px;font-weight:700;color:var(--sub)}
.select-wrap select{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  color:var(--text);
  font-size:15px;
  font-weight:700;
}
.chips{display:flex;gap:8px;overflow:auto;padding-bottom:2px}
.chips::-webkit-scrollbar{display:none}
.chip{
  flex:0 0 auto;
  min-height:34px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface-strong);
  color:var(--sub);
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.chip.active{background:var(--blue-soft);color:var(--blue);border-color:rgba(10,132,255,.18)}
.sheet-body{padding:0 14px 0;display:flex;flex-direction:column;gap:10px}
.selection-card{
  padding:14px;
  border-radius:22px;
  background:var(--surface-strong);
  border:1px solid var(--line);
}
.selection-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.selection-kicker{margin:0 0 5px;color:var(--sub);font-size:11px;font-weight:800}
.selection-title{margin:0;font-size:20px;line-height:1.1;font-weight:800}
.selection-sub{margin:6px 0 0;color:var(--sub);font-size:13px;font-weight:700;line-height:1.35}
.selection-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.badge{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 11px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}
.badge-single{background:var(--green);color:#1c6b31}
.badge-joint{background:var(--blue-soft);color:var(--blue)}
.badge-split{background:var(--orange);color:#a15a00}
.badge-review{background:var(--red);color:#b33131}
.badge-map-ok{background:#eff7ff;color:#0a69cc}
.badge-map-candidate{background:#f5f8ff;color:#345fa8}
.badge-map-wait{background:#f2f2f6;color:#5f5f65}
.note-box{
  margin-top:10px;
  padding:11px 13px;
  border-radius:16px;
  background:var(--surface-soft);
  color:var(--sub);
  font-size:12px;
  font-weight:600;
  line-height:1.45;
}
.link-list,.candidate-list{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.inline-btn{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  width:100%;
  padding:11px 13px;
  border-radius:16px;
  background:var(--surface-soft);
  border:1px solid transparent;
  cursor:pointer;
  text-align:left;
}
.inline-btn strong{display:block;font-size:14px;font-weight:800;line-height:1.2}
.inline-btn span{display:block;margin-top:4px;color:var(--sub);font-size:12px;font-weight:600;line-height:1.3}
.inline-btn .inline-end{flex:0 0 auto;margin-top:0;color:var(--text);font-size:12px;font-weight:800}
.inline-btn.active{border-color:rgba(10,132,255,.18);background:var(--blue-soft)}
.results-head{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:0 2px}
.results-head strong{font-size:15px;font-weight:800}
.results-head span{color:var(--sub);font-size:12px;font-weight:700}
.results-list{display:flex;flex-direction:column;gap:8px;padding-bottom:14px}
.result-card{
  padding:13px 14px;
  border-radius:20px;
  background:var(--surface-strong);
  border:1px solid var(--line);
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.result-card:hover{transform:translateY(-1px);box-shadow:0 14px 30px rgba(15,23,42,.08)}
.result-card.active{border-color:rgba(10,132,255,.22);box-shadow:0 0 0 4px rgba(10,132,255,.08)}
.result-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.result-title{font-size:17px;font-weight:800;line-height:1.15}
.result-sub{margin-top:5px;color:var(--sub);font-size:12px;font-weight:600}
.result-main{margin-top:8px;font-size:13px;font-weight:800;line-height:1.35}
.result-badges{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px}
.empty-state{
  padding:22px 16px;
  border-radius:22px;
  text-align:center;
  color:var(--sub);
  background:var(--surface-strong);
  border:1px dashed var(--line);
  font-size:14px;
  font-weight:600;
}
.bottom-sheet[data-snap="min"] .filter-panel,
.bottom-sheet[data-snap="min"] .selection-card,
.bottom-sheet[data-snap="min"] .results-head{display:none}
.bottom-sheet[data-snap="min"] .sheet-body{padding-top:0}
.bottom-sheet[data-snap="min"] .results-list{gap:6px}
.bottom-sheet[data-snap="min"] .result-card{padding:11px 12px}
.map-popup{font-size:13px;font-weight:700}
.leaflet-popup-content-wrapper,.leaflet-popup-tip{
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(24px);
  -webkit-backdrop-filter:blur(24px);
}
@keyframes mobileSearchMarquee{
  0%{transform:translateX(0)}
  100%{transform:translateX(-100%)}
}
@media (max-width: 900px){
  .top-overlay,.bottom-sheet{width:min(100vw - 16px, 920px)}
  .top-overlay{top:8px;padding:8px 10px}
  .floating-actions{width:min(100vw - 16px, 920px)}
  .bottom-sheet{bottom:8px}
  .info-panel{right:10px;width:min(320px, calc(100vw - 20px))}
}
@media (max-width: 720px){
  .top-bar{gap:8px}
  .brand-title{font-size:16px;white-space:nowrap}
  .search-box{min-height:39px;padding:0 12px}
  .search-box input{font-size:15px}
  .search-marquee{display:block}
  .search-marquee span{animation:mobileSearchMarquee 8s linear infinite}
  .floating-actions{gap:7px}
  .action-btn{min-width:50px;height:34px;padding:0 11px;font-size:12px}
  .selection-title{font-size:18px}
}
@media (max-width: 560px){
  .top-bar{display:grid;grid-template-columns:auto 1fr;align-items:center}
  .floating-actions{width:min(100vw - 16px, 920px);justify-content:flex-end}
  .info-panel{left:8px;right:8px;top:auto;bottom:144px;width:auto}
}
@media (max-width: 420px){
  .segment-btn{font-size:14px}
  .sheet-tool-btn{min-width:62px;padding:0 12px}
  .result-title{font-size:16px}
  .brand-title{font-size:15px}
  .search-marquee{font-size:13px}
}
