/* PropScan — PropGen 계승 디자인 */
:root {
  --navy:       #131c2e;
  --navy2:      #1a2640;
  --navy3:      #223050;
  --cyan:       #00c4cc;
  --cyan2:      #00a8b0;
  --blue:       #1e6fe8;
  --blue2:      #1558c0;
  --white:      #ffffff;
  --gray1:      #f0f4fa;
  --gray2:      #d8e2f0;
  --gray3:      #8fa3bf;
  --text:       #1a2640;
  --text-light: #5a7090;
  --success:    #22c55e;
  --error:      #ef4444;
  --warn:       #f59e0b;
  --radius:     10px;
  --shadow:     0 4px 24px rgba(0,0,0,0.13);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Pretendard', 'Noto Sans KR', system-ui, sans-serif;
  background: var(--navy);
  color: var(--white);
  height: 100vh;
  display: flex;
  overflow: hidden;
  user-select: none;
}

/* ── 사이드바 ── */
#sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--navy);
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 0 4px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.logo-text h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 10px;
  color: var(--gray3);
  margin-top: 2px;
  letter-spacing: 0.2px;
}

.nav-label {
  font-size: 10px;
  color: var(--gray3);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 6px;
}

nav { display: flex; flex-direction: column; gap: 2px; }

nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--gray3);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
}

nav a:hover { background: rgba(255,255,255,0.06); color: var(--white); }
nav a.active {
  background: linear-gradient(135deg, rgba(0,196,204,0.18), rgba(30,111,232,0.18));
  color: var(--white);
  border-left: 3px solid var(--cyan);
}

nav a svg { width: 17px; height: 17px; flex-shrink: 0; }

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.btn-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--gray3);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.btn-settings:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.btn-settings svg { width: 16px; height: 16px; }

.version-badge {
  font-size: 11px;
  color: var(--gray3);
  padding: 4px 12px;
}

/* ── 메인 콘텐츠 ── */
#main {
  flex: 1;
  background: var(--gray1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* 상태 배너 */
#status-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
}
#status-bar.error   { background: #fef2f2; color: var(--error); display: flex; }
#status-bar.success { background: #f0fdf4; color: #16a34a; display: flex; }
#status-bar.warn    { background: #fffbeb; color: #b45309; display: flex; }

/* 메인 패딩 */
.main-inner { padding: 28px 32px; flex: 1; }

/* 섹션 헤더 */
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.section-sub {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
}

/* ── 입력 카드 ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-title svg { color: var(--blue); width: 16px; height: 16px; }

/* PNU 입력 */
#pnu-input {
  width: 100%;
  min-height: 90px;
  border: 1.5px solid var(--gray2);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: 'Consolas', monospace;
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.8;
}
#pnu-input:focus { border-color: var(--blue); }
#pnu-input::placeholder { color: var(--gray3); font-family: inherit; }

.input-hint {
  font-size: 11.5px;
  color: var(--text-light);
  margin-top: 6px;
}

/* 샘플 버튼 */
.sample-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.btn-sample {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--gray2);
  background: var(--gray1);
  color: var(--text-light);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-sample:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(30,111,232,0.05);
}

/* 조회 버튼 */
#btn-search {
  width: 100%;
  padding: 13px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
#btn-search:hover { opacity: 0.9; }
#btn-search:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── 결과 카드 ── */
#result-section[hidden] { display: none; }

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.result-address {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.result-pnu {
  font-size: 11px;
  color: var(--text-light);
  font-family: monospace;
  margin-top: 2px;
}

.btn-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--blue);
  background: rgba(30,111,232,0.07);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-copy:hover { background: var(--blue); color: var(--white); }
.btn-copy svg { width: 15px; height: 15px; }

/* 규모 가검토 결과 그리드 */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.summary-item {
  background: var(--gray1);
  border-radius: 8px;
  padding: 14px 16px;
  border-left: 3px solid var(--blue);
}
.summary-item.highlight { border-left-color: var(--cyan); }

.summary-label {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.summary-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.summary-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  margin-left: 2px;
}
.summary-note {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 3px;
}

/* 복사 텍스트 미리보기 */
.copy-preview {
  background: var(--navy);
  border-radius: 8px;
  padding: 16px 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--gray2);
  font-family: monospace;
  line-height: 1.9;
  white-space: pre;
  overflow-x: auto;
}

/* ── 모달 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  display: none;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: 14px;
  width: 440px;
  max-width: 95vw;
  max-height: 92vh;                 /* 내용이 많아도 화면 밖으로 넘치지 않음 */
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}

.modal-header {
  background: var(--navy2);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--white); }
.modal-sub { font-size: 12px; color: var(--gray3); margin-top: 2px; }

.btn-close {
  background: none;
  border: none;
  color: var(--gray3);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
}
.btn-close:hover { color: var(--white); }

.modal-body { padding: 24px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.modal-header, .modal-footer { flex-shrink: 0; }

.field-group { margin-bottom: 18px; }
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.field-status { font-size: 14px; }
.field-link { font-size: 11px; color: var(--blue); text-decoration: none; }
.field-link:hover { text-decoration: underline; }

.field-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray2);
  border-radius: 8px;
  font-size: 13px;
  font-family: monospace;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.field-input:focus { border-color: var(--blue); }

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 10px;
}

.btn-cancel {
  flex: 1;
  padding: 11px;
  border-radius: 8px;
  border: 1.5px solid var(--gray2);
  background: none;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-cancel:hover { background: var(--gray1); }

.btn-save {
  flex: 2;
  padding: 11px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-save:hover { opacity: 0.9; }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

#save-msg {
  margin: 0 24px 16px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: none;
}
#save-msg.ok  { background: #f0fdf4; color: #16a34a; display: block; }
#save-msg.err { background: #fef2f2; color: var(--error); display: block; }

/* 로딩 스피너 */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 모드 배지 */
.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.mode-badge.mock { background: rgba(245,158,11,0.15); color: var(--warn); }
.mode-badge.live { background: rgba(34,197,94,0.15); color: var(--success); }

/* ════════ v1.1 — 입력 방식 · 지도 · 용도 설정 · 업데이트 ════════ */
.muted { color: var(--text-light); font-size: 12px; }
[hidden] { display: none !important; }
#main input, #main textarea, #main select { user-select: text; }

/* 세그먼트 버튼 */
.seg { display: inline-flex; background: var(--gray1); border: 1px solid var(--gray2); border-radius: 9px; padding: 3px; gap: 2px; margin-bottom: 14px; flex-wrap: wrap; }
.seg-btn { border: none; background: transparent; padding: 8px 16px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-light); cursor: pointer; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--white); color: var(--blue); box-shadow: 0 1px 4px rgba(19,28,46,.12); }
.seg-sm { margin-bottom: 0; }
.seg-sm .seg-btn { padding: 6px 11px; font-size: 12px; }

/* 공통 입력/버튼 */
.row { display: flex; gap: 8px; align-items: stretch; }
.text-input { flex: 1; padding: 11px 14px; border: 1.5px solid var(--gray2); border-radius: 8px; font: inherit; font-size: 14px; color: var(--text); outline: none; }
.text-input:focus { border-color: var(--blue); }
.btn-primary { width: 100%; margin-top: 14px; padding: 13px; border: none; border-radius: 8px; background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary:hover { opacity: .92; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-inline { width: auto; margin-top: 0; padding: 0 22px; font-size: 14px; }
.btn-ghost { border: 1.5px solid var(--gray2); background: #fff; color: var(--text); border-radius: 8px; padding: 0 16px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.sample-row .muted { align-self: center; }

/* 주소 후보 */
.cand-list { display: flex; flex-direction: column; gap: 4px; }
.cand { text-align: left; border: 1px solid var(--gray2); background: #fff; border-radius: 7px; padding: 8px 12px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.cand:hover, .cand.active { border-color: var(--blue); background: #eef4fe; }

/* 지도 */
.map-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.chk { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 5px; cursor: pointer; }
#map { height: 520px; border-radius: 10px; border: 1px solid var(--gray2); background: #dfe7f1; }
.map-help { font-size: 12px; color: var(--text-light); margin-top: 8px; }
.map-help.err { color: var(--error); }
.leaflet-container { font-family: inherit; }

/* Phase 1.5-A 커서 전환 — Leaflet 은 .leaflet-grab 을 #map 컨테이너 자체에 붙이므로 컨테이너를 직접 지정 */
#map.ps-cursor-pick, #map.ps-cursor-pick .leaflet-interactive { cursor: default; }
#map.ps-cursor-draw, #map.ps-cursor-draw .leaflet-interactive, #map.ps-cursor-draw .leaflet-mouse-marker { cursor: crosshair; }
/* 드래그로 지도를 옮기는 동안에만 쥔 손 (Leaflet 이 body 에 leaflet-dragging 을 붙였다 뗌) */
body.leaflet-dragging #map.leaflet-container, body.leaflet-dragging #map .leaflet-interactive,
#map.ps-dragging, #map.ps-dragging .leaflet-interactive { cursor: grabbing; }

/* 호버 툴팁 */
.ps-map-tooltip { position: absolute; z-index: 1000; background: rgba(30,36,48,.88); color: #fff; font-size: 11.5px; padding: 4px 10px; border-radius: 6px; pointer-events: none; white-space: nowrap; }

.sel-box { margin-top: 12px; border: 1.5px solid var(--cyan); border-radius: 10px; padding: 14px; background: rgba(0,196,204,.05); }
.sel-head { display: flex; justify-content: space-between; color: var(--text); font-size: 14px; margin-bottom: 8px; }
.sel-head span { color: var(--blue); font-weight: 700; }
.sel-list { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sel-item { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text); padding: 5px 2px; border-bottom: 1px dashed var(--gray2); }
.sel-item span:last-child { color: var(--text-light); white-space: nowrap; }

/* 경고/알림 상자 */
.warn-box { margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: #fffbeb; border-left: 3px solid var(--warn); color: #92400e; font-size: 13px; line-height: 1.6; }
.ok-box { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: #f0fdf4; color: #166534; font-size: 13px; line-height: 1.6; }
.ok-box ul { margin: 6px 0 6px 18px; max-height: 32vh; overflow-y: auto; padding-right: 6px; }
.ok-box li, .ok-box .muted, .err-box { overflow-wrap: anywhere; }
#update-overlay .modal { width: 560px; }
.err-box { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: #fef2f2; color: var(--error); font-size: 13px; }

/* 용도 · 조건 */
.limit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 12px; color: var(--text); font-size: 14px; font-weight: 600; }
.num { width: 78px; padding: 6px 8px; border: 1.5px solid var(--gray2); border-radius: 6px; font: inherit; font-size: 14px; color: var(--text); text-align: right; outline: none; }
.num:focus { border-color: var(--blue); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--gray2); background: var(--gray1); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.chip:hover { border-color: var(--cyan); color: var(--cyan2); }
.params { border-top: 1px solid var(--gray2); padding-top: 10px; color: var(--text); }
.params summary { cursor: pointer; font-size: 13px; font-weight: 700; padding: 4px 0; }
.param-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 22px; margin-top: 10px; }
.pf { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--text); }
.pf select { padding: 6px 8px; border: 1.5px solid var(--gray2); border-radius: 6px; font: inherit; }
.pf-wide { grid-column: 1 / -1; align-items: flex-start; justify-content: flex-start; gap: 24px; }
.pf-wide > span { padding-top: 6px; min-width: 70px; }
.mix-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 13px; }
.mix-row .num { width: 64px; }
.x { border: none; background: none; color: var(--gray3); cursor: pointer; font-size: 13px; }
.x:hover { color: var(--error); }
.basis-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text); line-height: 1.5; }
.summary-note { word-break: keep-all; }

/* 업데이트 */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; border: 2px dashed var(--gray2); border-radius: 10px; cursor: pointer; color: var(--text); font-size: 14px; text-align: center; }
.drop:hover, .drop.over { border-color: var(--cyan); background: rgba(0,196,204,.06); }
.drop-icon { font-size: 24px; color: var(--cyan); }
#update-overlay .modal-body .muted { color: var(--text-light); }

/* ════════ v1.2 — 규제 태그 · 경고 배지 · 면책 ════════ */
.reg-box { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--gray2); border-radius: 10px; background: #fafcff; }
.reg-title { font-size: 12px; font-weight: 700; color: var(--text-light); margin-bottom: 8px; letter-spacing: .02em; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: var(--gray1); color: var(--text); border: 1px solid var(--gray2); }
.tag i { font-style: normal; color: var(--text-light); font-size: 11px; }
.tag-warn { background: #fff4e5; border-color: #f5c27a; color: #9a4b00; font-weight: 600; }
.tag-info { background: #eaf6ff; border-color: #b6dcf7; color: #0b5a8a; }
.warn-badges { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.warn-badge { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 8px; background: #fff7ed; border: 1px solid #fdba74; color: #7c2d12; font-size: 13px; line-height: 1.5; }
.warn-badge b { flex: none; background: #ea580c; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; margin-top: 1px; }
#review-warnings .warn-badges { margin-bottom: 12px; }
.com-box { background: #fff7ed; border-radius: 8px; padding: 8px 10px; }
.disclaimer { margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: var(--gray1); color: var(--text); font-size: 12.5px; font-weight: 600; line-height: 1.5; border-left: 3px solid var(--navy, #131c2e); }

/* ════════ v1.3 — 상세 표 · 상가 카드 · 주차 방식 ════════ */
.row-label { font-size: 13px; font-weight: 700; color: var(--text); min-width: 120px; }
.mix-ratio-row { background: #f3f8ff; border: 1px solid #d6e6fb; border-radius: 8px; padding: 10px 12px; }
.limit-hint { font-size: 12px; color: #c2410c; min-height: 0; margin: -6px 0 8px; }
.num.invalid { border-color: #ea580c; background: #fff7ed; }
.parking-row { border-top: 1px solid var(--gray2); padding-top: 12px; margin: 4px 0 12px; }
.save-badge { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }
.save-badge b { background: #059669; }
.detail-block { margin-top: 18px; }
.detail-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--text); }
.dtable th { background: var(--navy, #131c2e); color: #fff; font-weight: 600; padding: 8px 10px; text-align: right; font-size: 12px; }
.dtable th:first-child, .dtable td:first-child { text-align: left; }
.dtable td { padding: 8px 10px; border-bottom: 1px solid var(--gray2); text-align: right; white-space: nowrap; }
.dtable tbody tr:nth-child(even) td { background: #f8fafc; }
.dtable tfoot td { font-weight: 700; background: #eef4fe; border-bottom: none; }
.dtable tfoot .tfoot-note { text-align: left; font-weight: 500; background: #f8fafc; }
.mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mini { background: #f8fafc; border: 1px solid var(--gray2); border-radius: 8px; padding: 10px 12px; }
.mini-label { font-size: 11.5px; color: var(--text-light); font-weight: 600; }
.mini-value { font-size: 19px; font-weight: 800; color: var(--text); margin-top: 2px; }
.mini-note { font-size: 11.5px; color: var(--text-light); }
@media (max-width: 1100px) { .mini-grid { grid-template-columns: repeat(2, 1fr); } }

/* ════════ v1.4 — 3D 규모 매스 ════════ */
.mass3d-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.mass3d-wrap { position: relative; }
#mass3d { height: 480px; border-radius: 10px; overflow: hidden; background: #1a2640; }
.mass3d-label { position: absolute; left: 12px; top: 12px; background: rgba(19,28,46,.85); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 6px; pointer-events: none; }
.mass3d-chips { position: absolute; left: 12px; top: 48px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.mass3d-chips span { background: rgba(255,247,237,.95); color: #7c2d12; font-size: 12px; padding: 4px 10px; border-radius: 6px; width: fit-content; }
.mass3d-legend { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 10px; background: rgba(19,28,46,.75); color: #fff; font-size: 11.5px; padding: 5px 10px; border-radius: 6px; pointer-events: none; }
.mass3d-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.btn-pro:disabled { opacity: .55; cursor: not-allowed; border-style: dashed; }
.linkbtn { border: none; background: none; color: var(--blue); text-decoration: underline; cursor: pointer; font: inherit; }


/* ════════ v1.5 — 3단계 UX ════════ */
.stepper { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 13px; color: var(--text-light); }
.stepper .step { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.stepper .step i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--gray2); color: var(--text-light); font-size: 12px; }
.stepper .step.on { color: var(--text); }
.stepper .step.on i { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; }
.stepper em { flex: 0 0 36px; height: 2px; background: var(--gray2); }
.step-no { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; font-size: 13px; margin-right: 4px; }

.type-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.type-card { text-align: left; border: 1.5px solid var(--gray2); background: #fff; border-radius: 10px; padding: 14px 14px 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; transition: .15s; }
.type-card b { font-size: 15px; color: var(--text); }
.type-card span { font-size: 12px; color: var(--text-light); line-height: 1.4; word-break: keep-all; }
.type-card:hover { border-color: var(--cyan); }
.type-card.active { border-color: var(--blue); background: #eef4fe; box-shadow: 0 0 0 3px rgba(30,111,232,.12); }
.type-card.active b { color: var(--blue); }
@media (max-width: 1200px) { .type-cards { grid-template-columns: repeat(3, 1fr); } }

.type-opts:empty { display: none; }
.type-opts { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #f3f8ff; border: 1px solid #d6e6fb; display: flex; flex-direction: column; gap: 10px; }
.opt-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.opt-label { font-size: 13px; font-weight: 700; color: var(--text); min-width: 130px; }
.opt-row .seg { margin-bottom: 0; }
.slider { width: 240px; accent-color: var(--blue); }
.mix-out { font-size: 13px; color: var(--blue); }
.opt-hint { font-size: 12px; color: var(--text-light); }
#type-opts-3 { margin: 0 0 12px; }

.site-head { margin: 14px 0 10px; padding-top: 14px; border-top: 1px solid var(--gray2); }
#site-card .summary-grid { margin-top: 0; }
.fit { margin-top: 12px; padding: 12px 14px; border-radius: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; border: 1px solid; }
.fit b { font-size: 14px; }
.fit-ok { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }
.fit-cond { background: #fff7ed; border-color: #fdba74; color: #7c2d12; }
.fit-no { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.fit .muted { font-size: 11.5px; }
.fit-btn { align-self: flex-start; margin-top: 6px; border: none; border-radius: 8px; padding: 8px 14px; background: var(--blue); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-run { width: 100%; margin-top: 14px; padding: 15px; border: none; border-radius: 10px; background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; letter-spacing: .02em; }
.btn-run:hover { opacity: .93; }

.result-top #quick-tabs { margin-bottom: 12px; }
.law-bar { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1fr 2fr; gap: 1px; background: var(--gray2); border: 1px solid var(--gray2); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.law-bar > div { background: #fafcff; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; }
.law-bar span { font-size: 11px; color: var(--text-light); font-weight: 600; }
.law-bar b { font-size: 14px; color: var(--text); }
.law-bar .hl { background: #eef4fe; }
.law-bar .hl b { color: var(--blue); font-size: 17px; }
.law-bar .basis b { font-size: 12px; font-weight: 600; }

.adv { border: 1px solid var(--gray2); border-radius: 10px; margin-top: 4px; }
.adv > summary { list-style: none; cursor: pointer; padding: 12px 14px; font-size: 13.5px; font-weight: 700; color: var(--text); }
.adv > summary::-webkit-details-marker { display: none; }
.adv-arrow { display: inline-block; transition: transform .15s; color: var(--blue); }
.adv[open] .adv-arrow { transform: rotate(90deg); }
.adv[open] > summary { border-bottom: 1px solid var(--gray2); }
.adv > .param-grid, .adv > .override { padding: 0 14px; }
.adv-safe { margin: 12px 14px 4px; padding: 9px 12px; border-radius: 8px; background: #ecfdf5; color: #065f46; font-size: 12.5px; }
.override { border-top: 1px dashed var(--gray2); margin-top: 14px; padding-top: 12px !important; padding-bottom: 14px !important; }
.override .param-grid.locked { opacity: .5; }
.q { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: var(--gray2); color: var(--text-light); font-size: 10px; font-weight: 800; cursor: help; position: relative; vertical-align: 1px; }
.q:hover::after, .q:focus::after { content: attr(data-tip); position: absolute; left: 50%; bottom: 140%; transform: translateX(-50%); width: 260px; background: #131c2e; color: #fff; font-size: 12px; font-weight: 500; line-height: 1.5; padding: 8px 10px; border-radius: 6px; z-index: 50; white-space: normal; word-break: keep-all; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.tscroll { overflow-x: auto; }
.copy-preview { white-space: pre-wrap !important; word-break: keep-all; overflow-wrap: anywhere; }

/* v1.6 — 3D 주변 건물 */
.mass3d-foot { margin-top: 6px; min-height: 16px; }
.mass3d-legend i { border: 1px solid rgba(255,255,255,.35); }

/* ════════ 사업수지 분석 (Phase 3-B) ════════ */
.fz-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.fz-cta .muted { font-size: 12.5px; }
#view-fz { color: var(--text); }
#view-fz .muted { color: var(--text-light); }
#view-fz .sm, #view-fz small { font-size: 11.5px; }
.fz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fz-head-r { display: flex; align-items: center; gap: 8px; }
.fz-head-r .btn-sm { height: 32px; }
.fz-badge { border: none; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.fz-badge.ok { background: #dcfce7; color: #15803d; }
.fz-badge.bad { background: #fee2e2; color: #b91c1c; }
.fz-alert { border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; line-height: 1.6; }
.fz-alert.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.fz-alert.bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.fz-alert .btn-sm { height: 26px; margin: 0 4px; }
.fz-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.fz-kpi { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 6px rgba(0,0,0,.07); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.fz-kpi span { font-size: 12px; color: var(--text-light); }
.fz-kpi b { font-size: 19px; font-weight: 800; color: var(--text); }
.fz-kpi small { color: var(--text-light); }
.fz-kpi.neg b { color: var(--error); }
.card .fz-kpis .fz-kpi { box-shadow: none; border: 1px solid var(--gray2); }
.fz-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--gray2); margin: 4px 0 16px; overflow-x: auto; }
.fz-tabs button { border: none; background: none; padding: 10px 16px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-light); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.fz-tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
.fz-tabs button:hover { color: var(--text); }
.fz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.fz-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-light); }
.fz-f > span { font-weight: 600; }
.fz-in { display: flex; align-items: center; border: 1.5px solid var(--gray2); border-radius: 7px; background: #fff; overflow: hidden; }
.fz-in:focus-within { border-color: var(--blue); }
.fz-in input, .fz-in select { flex: 1; min-width: 0; border: none; outline: none; padding: 7px 9px; font: inherit; font-size: 13px; color: var(--text); background: transparent; text-align: right; user-select: text; }
.fz-in select { text-align: left; cursor: pointer; }
.fz-in input[readonly] { color: var(--text-light); text-align: left; }
.fz-in em { font-style: normal; font-size: 11px; color: var(--gray3); padding-right: 8px; white-space: nowrap; }
.fz-eok { color: var(--blue); text-align: right; }
.fz-chk { flex-direction: row; align-items: center; gap: 8px; padding-top: 18px; cursor: pointer; }
.fz-chk input { width: 16px; height: 16px; accent-color: var(--blue); }
.fz-note { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-light); }
.fz-scroll { overflow-x: auto; border: 1px solid var(--gray2); border-radius: 8px; }
.fz-t { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--text); }
.fz-t th { background: var(--navy); color: #fff; font-weight: 600; padding: 7px 9px; text-align: right; font-size: 12px; white-space: nowrap; }
.fz-t th:first-child, .fz-t td:first-child { text-align: left; }
.fz-t td { padding: 6px 9px; border-bottom: 1px solid #edf1f7; vertical-align: middle; }
.fz-t td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fz-t td.b, .fz-t .b { font-weight: 700; }
.fz-t .neg, #view-fz .neg { color: var(--error); }
.fz-t tfoot td { background: var(--gray1); font-weight: 700; border-top: 2px solid var(--gray2); }
.fz-t td.ok, #view-fz .ok { color: #15803d; font-weight: 700; }
.fz-t td.bad, #view-fz .bad { color: #b91c1c; font-weight: 700; }
.fz-t td.ind { padding-left: 22px; }
.fz-grp tr.gh td { background: #f5f8fc; border-top: 1px solid var(--gray2); }
.fz-grp tr.gc td { background: #fbfcfe; padding: 12px 14px 14px 22px; }
.fz-edit td { padding: 4px 6px; }
.fz-cell { border: 1.5px solid var(--gray2); border-radius: 6px; padding: 5px 7px; font: inherit; font-size: 12.5px; color: var(--text); text-align: right; background: #fff; user-select: text; }
.fz-cell:focus { outline: none; border-color: var(--blue); }
.fz-cell.w-name { width: 150px; text-align: left; }
.fz-cell.w-s { width: 78px; }
.fz-cell.w-m { width: 100px; }
.fz-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--gray1); color: var(--text-light); white-space: nowrap; }
.fz-tag.warn { background: #fef3c7; color: #92400e; }
.fz-x { border: none; background: none; color: var(--gray3); font-size: 17px; cursor: pointer; padding: 0 6px; }
.fz-x:hover { color: var(--error); }
.fz-link { border: none; background: none; color: var(--blue); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; margin-left: 8px; padding: 0; }
.fz-addrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--text-light); }
.fz-addrow .btn-sm { height: 30px; }
.fz-month td, .fz-month th { white-space: nowrap; }
.fz-month th { text-align: center; line-height: 1.15; }
.fz-month th small { font-weight: 400; opacity: .75; font-size: 10.5px; }
.fz-month .stk { position: sticky; left: 0; z-index: 1; min-width: 150px; }
.fz-month td.stk { background: #fff; white-space: pre; }
.fz-month tr.hi td { background: #f5f8fc; font-weight: 700; }
.fz-month tr.hi td.stk { background: #eef3fa; }
.fz-month tr.sep td { background: var(--gray1); color: var(--text-light); font-size: 11.5px; font-weight: 700; position: sticky; left: 0; }
.fz-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.fz-stats div { border: 1px solid var(--gray2); border-radius: 8px; padding: 8px 11px; display: flex; flex-direction: column; gap: 2px; }
.fz-stats span { font-size: 11.5px; color: var(--text-light); }
.fz-stats b { font-size: 14px; }
.fz-stats .bad { border-color: #fecaca; background: #fef2f2; }
.fz-stats .bad b { color: #b91c1c; }
.fz-stats .warn { border-color: #fde68a; background: #fffbeb; }
.fz-chart { position: relative; width: 100%; }
.fz-chart svg { display: block; }
.fz-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text); margin-bottom: 4px; }
.fz-legend i, .fz-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.fz-tip { position: absolute; width: 190px; background: #fff; border: 1px solid var(--gray2); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 8px 10px; font-size: 12px; color: var(--text); pointer-events: none; line-height: 1.6; }
.fz-subt { font-size: 13px; font-weight: 700; color: var(--text); margin: 16px 0 8px; }
.fz-rates { display: flex; flex-wrap: wrap; gap: 6px; }
.fz-rate { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text-light); }
.fz-rate input { width: 62px; border: 1.5px solid var(--gray2); border-radius: 6px; padding: 5px 6px; font: inherit; font-size: 12.5px; text-align: right; color: var(--text); user-select: text; }
.fz-rate input:focus { outline: none; border-color: var(--blue); }
.fz-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--text); }
.fz-sum .btn-sm { height: 28px; }
.fz-timeline { display: flex; gap: 3px; margin: 16px 0 6px; font-size: 12px; font-weight: 600; }
.fz-timeline div { padding: 10px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 70px; }
.t-pre { background: #e0edff; color: #1e4fa8; } .t-con { background: #257de0; color: #fff; } .t-post { background: #d1fae5; color: #065f46; }
.fz-two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; align-items: start; }
.fz-two table { border: 1px solid var(--gray2); }
.fz-disc { margin: 8px 0 24px; padding: 12px 14px; font-size: 12px; color: var(--text-light); background: #fff; border-radius: 8px; border: 1px dashed var(--gray2); white-space: pre-wrap; word-break: keep-all; line-height: 1.6; }
.fz-empty .btn-sm { padding: 0 14px; }
@media (max-width: 1100px) { .fz-two { grid-template-columns: 1fr; } }
.fz-stats .good { border-color: #bbf7d0; background: #f0fdf4; }
.fz-stats .good b { color: #15803d; }
.fz-recon { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.fz-recon.ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.fz-recon.bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.fz-head-r .btn-xl { height: 34px; padding: 0 16px; font-size: 13.5px; }
.fz-alert.ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.fz-alert small { color: inherit; opacity: .8; word-break: break-all; }

/* 좁은 창에서 넘침 방지 */
.law-bar { overflow-x: auto; }
@media (max-width: 1200px) { .law-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mass3d-chips { flex-wrap: wrap; }
#status-bar span { overflow-wrap: anywhere; }
.fz-head { flex-wrap: wrap; }
.fz-head-r { flex-wrap: wrap; justify-content: flex-end; }
.fz-alert { overflow-wrap: anywhere; }

/* 타입 배분 도우미 */
.mix-box { flex: 1; min-width: 0; }
.mix-mode { margin-bottom: 8px; }
.mix-mode .seg-btn { padding: 6px 12px; font-size: 12px; }
.mix-alloc { margin-top: 10px; }
.alloc-sum { font-size: 12.5px; color: var(--text); background: #f5f8fc; border: 1px solid var(--gray2); border-radius: 8px; padding: 8px 10px; }
.alloc-sum.bad { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alloc-t { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; color: var(--text); }
.alloc-t th { text-align: right; color: var(--text-light); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--gray2); white-space: nowrap; }
.alloc-t td { text-align: right; padding: 4px 6px; border-bottom: 1px solid #edf1f7; white-space: nowrap; }
.alloc-t th:first-child, .alloc-t td:first-child { text-align: left; }
.alloc-t .ok { color: #15803d; }
.alloc-fill { font-size: 12.5px; margin-top: 8px; color: var(--text); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.alloc-fill .btn-sm { height: 28px; }

/* 결과 표 안 직접 수정 */
.rin { border: 1.5px solid var(--gray2); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 12.5px; color: var(--text); text-align: right; background: #fff; user-select: text; }
.rin:focus { outline: none; border-color: var(--blue); }
.rin.w-a { width: 78px; } .rin.w-c { width: 70px; } .rin.w-r { width: 54px; padding: 2px 4px; }
.rtable td { vertical-align: middle; }
.rtable .x, .res-tools .x { border: none; background: none; color: var(--gray3); cursor: pointer; font-size: 14px; }
.rtable .x:hover { color: var(--error); }
.res-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; }
.res-tools .btn-sm { height: 30px; }
.res-edit { margin-top: 10px; font-size: 13px; color: var(--text); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail-title .rin { font-size: 12px; }
.fz-cell.w-r { width: 62px; }
.fz-note-line { font-size: 12.5px; color: var(--text-light); margin-top: 10px; line-height: 1.6; }
.fz-savebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 14px; font-size: 12.5px; color: var(--text); }
.fz-savebar .btn-sm { height: 28px; }
.fz-dir { max-width: 560px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fz-dir-input { flex: 1; min-width: 280px; max-width: 560px; border: 1.5px solid var(--gray2); border-radius: 7px; padding: 6px 9px; font: inherit; font-size: 12.5px; color: var(--text); user-select: text; }
.fz-dir-input:focus { outline: none; border-color: var(--blue); }

/* 사업개요 요약 · ㎡/평 쌍 · 매출 구분 표 */
.fz-ovw { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; border: 1px solid var(--gray2); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.fz-ovw div { display: flex; gap: 10px; padding: 7px 12px; border-bottom: 1px solid #edf1f7; font-size: 12.5px; color: var(--text); }
.fz-ovw span { min-width: 110px; color: var(--text-light); font-weight: 600; }
.fz-ovw b { font-weight: 600; }
.fz-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fz-rev .fz-cat { background: #eef5fd; font-weight: 700; text-align: center !important; vertical-align: middle; white-space: nowrap; }
.fz-rev tr.fz-sub td { background: #f3f4f6; font-weight: 700; font-size: 12px; }
.fz-rev .fz-avg { background: #1f3a5f !important; color: #fff; }
.fz-cell.w-c { width: 70px; }
.rin.w-p { width: 66px; }

/* 3D 매스 용도 범례 (우측 상단) */
.mass3d-uselegend { position: absolute; right: 52px; top: 10px; min-width: 150px; background: rgba(255,255,255,.86); backdrop-filter: blur(4px);
  border: 1px solid rgba(26,38,64,.12); border-radius: 10px; padding: 9px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.18); pointer-events: none;
  font-family: "GmarketSans", "Gmarket Sans", "Gmarket Sans TTF", "Malgun Gothic", "맑은 고딕", sans-serif; color: #1a2640; font-size: 12px; }
.mass3d-uselegend .ul-title { font-weight: 700; font-size: 12px; margin-bottom: 6px; color: #334155; }
.mass3d-uselegend .ul-row { display: flex; align-items: center; gap: 7px; line-height: 1.75; white-space: nowrap; }
.mass3d-uselegend .ul-row i { width: 12px; height: 12px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.mass3d-uselegend .ul-row b { font-weight: 500; color: #475569; }

/* ── Phase 1.5-B 도시개발 1차 판독 (3색 신호등) ── */
.urban-slot { margin-top: 10px; }
.uc { border: 1.5px solid var(--gray2); border-radius: 10px; padding: 10px 14px; background: #fff; font-size: 13px; color: var(--text); }
.uc-loading, .uc-error { color: var(--text-light); display: flex; align-items: center; gap: 8px; }
.uc-error { color: var(--error); }
.uc-green  { border-color: #22c55e; background: #f0fdf4; }
.uc-yellow { border-color: #f59e0b; background: #fffbeb; }
.uc-red    { border-color: #fca5a5; background: #fef2f2; }
.uc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.uc-light { display: inline-flex; gap: 3px; padding: 3px 5px; background: #1f2937; border-radius: 999px; }
.uc-light i { width: 10px; height: 10px; border-radius: 50%; background: #4b5563; }
.uc-red .uc-light .r    { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.uc-yellow .uc-light .y { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.uc-green .uc-light .g  { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.uc-badge { font-weight: 800; font-size: 12px; padding: 2px 9px; border-radius: 999px; color: #fff; }
.uc-green .uc-badge { background: #16a34a; } .uc-yellow .uc-badge { background: #d97706; } .uc-red .uc-badge { background: #dc2626; }
.uc-headline { font-weight: 700; flex: 1 1 260px; }
.uc-cta { border: none; border-radius: 8px; padding: 7px 12px; background: #16a34a; color: #fff; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.uc-cta:hover { background: #15803d; }
.uc-toggle { border: none; background: none; color: var(--blue); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.uc-body { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.uc-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-light); font-size: 12.5px; }
.uc-facts b { color: var(--text); }
.uc-zones { font-size: 12px; color: var(--text-light); }
.uc-list { margin: 0; padding-left: 18px; line-height: 1.6; }
.uc-list.uc-red li::marker { content: "✕  "; color: #dc2626; }
.uc-list.uc-yellow li::marker { content: "!  "; color: #d97706; font-weight: 800; }
.uc-boundary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.uc-risk { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.uc-risk > div { background: rgba(255,255,255,.8); border: 1px solid var(--gray2); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.uc-risk i { font-style: normal; font-size: 11.5px; color: var(--text-light); font-weight: 700; }
.uc-risk b { font-size: 14px; }
.uc-risk small { font-size: 11px; color: var(--text-light); line-height: 1.4; }
.uc-bad { color: #dc2626; }
.uc-warn-chip { align-self: flex-start; font-size: 11px; font-weight: 700; color: #b91c1c; background: #fee2e2; border-radius: 6px; padding: 1px 6px; }
.uc-sub { font-weight: 800; font-size: 12.5px; margin-bottom: 4px; }
.uc-alts { display: flex; flex-direction: column; gap: 4px; }
.uc-alt { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--gray2); border-left: 3px solid var(--blue); border-radius: 6px; padding: 6px 10px; }
.uc-alt span { font-size: 12px; color: var(--text-light); }
.uc-foot { font-size: 11px; color: var(--text-light); }
.uc-modal-ov { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; align-items: center; justify-content: center; z-index: 3000; }
.uc-modal-ov.open { display: flex; }
.uc-modal { background: #fff; border-radius: 12px; width: min(760px, 94vw); max-height: 88vh; overflow: auto; padding: 18px 20px; color: var(--text); font-size: 13px; }
.uc-modal-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; margin-bottom: 12px; }
.uc-steps { padding-left: 20px; line-height: 1.7; margin-bottom: 10px; }
@media (max-width: 760px) { .uc-risk { grid-template-columns: 1fr; } }
.uc-risk span { font-size: 12.5px; }
.uc-risk b.uc-inline { font-size: 13px; }
/* 사업수지 → 가검토 돌아가기 · 남는 전용면적 줄 */
.fz-back { border: 1px solid var(--gray2); background: #fff; color: var(--blue); border-radius: 8px; padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; margin-bottom: 8px; }
.fz-back:hover { background: var(--gray1); }
.fz-left td { background: #f0fdf4; font-size: 12.5px; padding: 6px 10px !important; }
.fz-left td > * { margin-right: 6px; vertical-align: middle; }
.fz-left.over td { background: #fef2f2; color: #b91c1c; }

/* ── Phase 1.5-C 종상향 규모 가검토 · 체크리스트 ── */
.uc-cta.yellow { background: #d97706; } .uc-cta.yellow:hover { background: #b45309; }
.uc-modal-wide { width: min(1080px, 96vw); }
.ucs-ctl { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; padding: 12px 14px; background: var(--gray1); border-radius: 10px; margin-bottom: 12px; }
.ucs-ctl label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-light); font-weight: 600; }
.ucs-ctl b { color: var(--blue); } .ucs-ctl small { font-weight: 500; }
.ucs-ctl select, .ucs-ctl input[type=number] { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--gray2); border-radius: 7px; color: var(--text); background: #fff; }
.ucs-ctl input[type=number] { width: 72px; text-align: right; }
.ucs-num { flex-direction: row !important; align-items: center; } .ucs-num span { margin-right: 4px; } .ucs-num em { font-style: normal; }
.ucs-sl input[type=range] { width: 190px; accent-color: var(--blue); }
.ucs-compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.ucs-arrow { align-self: center; font-size: 22px; color: var(--gray3); }
.ucs-card { border: 1.5px solid var(--gray2); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.ucs-card.up { border-color: var(--blue); background: #f5f9ff; }
.ucs-ct { font-weight: 800; font-size: 13px; } .ucs-zone { font-size: 12.5px; color: var(--text-light); margin-bottom: 4px; }
.ucs-row { display: flex; justify-content: space-between; font-size: 12.5px; }
.ucs-big { font-size: 24px; font-weight: 800; margin-top: 4px; } .ucs-card.up .ucs-big { color: var(--blue); }
.ucs-delta { font-weight: 800; color: #16a34a; font-size: 13px; }
.ucs-note { font-size: 11px; color: var(--text-light); }
.ucs-gambo { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.ucs-gambo > div { border: 1px solid var(--gray2); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.ucs-gambo i { font-style: normal; font-size: 11.5px; color: var(--text-light); font-weight: 700; }
.ucs-gambo b { font-size: 16px; } .ucs-gambo small { font-size: 11px; color: var(--text-light); }
.ucs-gambo.warn > div:first-child { border-color: #fca5a5; background: #fef2f2; } .ucs-gambo.warn > div:first-child b { color: #dc2626; }
.ucs-basis { font-size: 11px; color: var(--text-light); margin-top: 6px; }
.ucs-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ucs-stage { border: 1px solid var(--gray2); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ucs-st { font-weight: 800; font-size: 12.5px; }
.ucs-item { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; }
.ucs-item > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ucs-item small { font-size: 11.5px; color: var(--text-light); line-height: 1.45; word-break: keep-all; }
.ucs-item.done b { color: #16a34a; }
.ucs-chip { flex: none; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 2px 7px; margin-top: 1px; white-space: nowrap; }
.ucs-chip.ok { background: #dcfce7; color: #15803d; } .ucs-chip.bad { background: #fee2e2; color: #b91c1c; }
.ucs-chip.warn { background: #fef3c7; color: #b45309; } .ucs-chip.info { background: #e0f2fe; color: #0369a1; }
.ucs-chip.man { background: var(--gray1); color: var(--text-light); }
.ucs-chk { font-size: 11.5px; color: var(--text); display: flex; gap: 5px; align-items: center; cursor: pointer; margin-top: 2px; }
.uc-copy { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; font-family: inherit; font-size: 12px; line-height: 1.6;
  background: var(--gray1); border: 1px solid var(--gray2); border-radius: 8px; padding: 10px 12px; max-height: 260px; overflow: auto; color: var(--text); }
.ucs-btns { display: flex; gap: 8px; margin-top: 8px; }
@media (max-width: 900px) { .ucs-compare, .ucs-gambo, .ucs-stages { grid-template-columns: 1fr; } .ucs-arrow { display: none; } }

/* ── Phase 2-A 3D 매스 디테일 ── */
.mass3d-label { display: flex; flex-direction: column; gap: 2px; }
.mass3d-label b { font-size: 15px; font-weight: 800; }
.mass3d-label small { font-size: 11.5px; font-weight: 500; color: #cbd5e1; }
.mass3d-chips { top: 62px; }
.mass3d-toolbar2 { margin-top: -2px; }
.mass3d-tlabel { font-size: 12.5px; font-weight: 700; color: var(--text); }
.mass3d-hwrap { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); }
.mass3d-hwrap input { width: 74px; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--gray2); border-radius: 7px; text-align: right; }
.mass3d-fit { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--gray1); color: var(--text-light); }
.mass3d-fit.ok { background: #dcfce7; color: #15803d; }
.mass3d-fit.bad { background: #fee2e2; color: #b91c1c; }
.mass3d-floorcard { position: absolute; right: 12px; bottom: 40px; width: 178px; background: rgba(255,255,255,.92); backdrop-filter: blur(4px);
  border-radius: 10px; padding: 8px 10px; box-shadow: 0 2px 10px rgba(0,0,0,.18); font-size: 11px; color: #334155; pointer-events: none; }
.mass3d-floorcard .fc-title { font-weight: 800; font-size: 12px; margin-bottom: 4px; color: #1a2640; }
.mass3d-floorcard svg { display: block; margin: 0 auto 4px; }
.mass3d-floorcard .fc-row { line-height: 1.5; word-break: keep-all; }
.mass3d-floorcard .fc-row b { color: #1a2640; }
.mass3d-floorcard .fc-note { margin-top: 3px; color: #2f86ff; font-weight: 700; }
.mass3d-hwrap select { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--gray2); border-radius: 7px; background: #fff; }
.mass3d-label { max-width: calc(100% - 260px); }
.mass3d-label b { font-size: 13.5px; line-height: 1.4; }

/* ── Phase 1.5-D 인센티브 · 조례 · 지구단위 배지 ── */
.law-breakdown { margin: -4px 0 10px; padding: 8px 12px; background: #f5f9ff; border: 1px solid #cfe0fb; border-radius: 8px; font-size: 12.5px; color: var(--text);
  white-space: pre-wrap; word-break: keep-all; display: flex; flex-direction: column; gap: 4px; }
.law-breakdown .lb-main b { color: var(--blue); font-size: 14px; }
.law-breakdown .lb-items { display: flex; flex-wrap: wrap; gap: 6px; }
.law-breakdown .lb-items span { background: #fff; border: 1px solid var(--gray2); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; }
.law-breakdown .lb-items i { font-style: normal; color: var(--text-light); margin-left: 4px; }
.law-breakdown .lb-cap, .inc-cap { color: #b91c1c; font-weight: 700; }
.law-breakdown .lb-verify { color: #92400e; font-size: 12px; }
.district-badge { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 12px;
  background: #fffbeb; border: 1px solid #fcd34d; border-left: 4px solid #f59e0b; border-radius: 8px; font-size: 12.5px; color: #78350f; word-break: keep-all; }
.inc-box { margin: 14px 0 6px; border: 1px dashed var(--gray2); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.inc-head { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.inc-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 10px; border-radius: 8px; background: var(--gray1); }
.inc-item.on { background: #eef4fe; }
.inc-item small { flex-basis: 100%; font-size: 11.5px; color: var(--text-light); }
.inc-ctl { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.inc-ctl input[type=range] { width: 160px; accent-color: var(--blue); }
.inc-ctl .inc-num { width: 64px; font: inherit; font-size: 12.5px; padding: 4px 6px; border: 1px solid var(--gray2); border-radius: 6px; text-align: right; }
.inc-ctl em { font-style: normal; color: var(--text-light); }
.inc-result { font-size: 12.5px; color: var(--text); word-break: keep-all; }
.inc-result b { color: var(--blue); }
.inc-box { color: var(--text); }
.adv > .inc-box { margin: 14px 14px 6px; }
.inc-head b { color: var(--text); font-size: 13.5px; }

/* ── 평면타입 카드 (개략 배치 예시) ── */
#unitcard-card { color: var(--text); }
.uc2-sugg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 10px; font-size: 12.5px; }
.uc2-ctl { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 12.5px; margin-bottom: 8px; }
.uc2-ctl select, .uc2-ctl input { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--gray2); border-radius: 7px; background: #fff; color: var(--text); }
.uc2-ctl input { width: 76px; text-align: right; }
.uc2-ctl .btn-primary { width: auto; margin-top: 0; padding: 8px 16px; font-size: 13px; }
.uc2-ctl .seg-btn:disabled { opacity: .4; cursor: not-allowed; }
#unitcard-msg { font-size: 12px; line-height: 1.6; word-break: keep-all; }
.uc2-img { display: block; width: 100%; max-width: 1100px; margin: 10px 0 4px; border-radius: 10px; border: 1px solid var(--gray2); }
.uc2-rt-title { font-weight: 800; font-size: 13px; margin: 14px 0 6px; }
.uc2-rt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.uc2-rt th, .uc2-rt td { border: 1px solid var(--gray2); padding: 6px 8px; text-align: right; }
.uc2-rt th:first-child, .uc2-rt td:first-child { text-align: left; }
.uc2-rt thead th { background: var(--gray1); font-weight: 700; }
.uc2-rt tfoot td { font-weight: 700; background: #fafcff; }
.uc2-rt-note { font-size: 11.5px; margin-top: 4px; }

/* ── 사업방식 자동 비교·판정 · 최고높이 자동 추정 ── */
.ucs-banner { padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; margin-bottom: 8px; word-break: keep-all; }
.ucs-banner.red { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.ucs-banner.orange { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.ucs-verdict-card { border: 1.5px solid var(--gray2); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.ucs-verdict-card.rec-A { border-color: #94a3b8; } .ucs-verdict-card.rec-B { border-color: var(--blue); background: #f5f9ff; } .ucs-verdict-card.rec-C { border-color: #16a34a; background: #f0fdf4; }
.ucs-vhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 14px; }
.ucs-vbadge { font-size: 11.5px; font-weight: 800; color: #fff; background: #475569; border-radius: 999px; padding: 3px 10px; }
.rec-B .ucs-vbadge { background: var(--blue); } .rec-C .ucs-vbadge { background: #16a34a; }
.ucs-verdict-card ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text-light); line-height: 1.6; }
.ucs-landowner { margin-top: 6px; font-size: 12px; font-weight: 700; color: #92400e; word-break: keep-all; }
.ucs-compare3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ucs-card.rec { border-color: var(--blue); background: #f5f9ff; box-shadow: 0 0 0 2px rgba(30,111,232,.12); }
.ucs-rec { font-size: 10.5px; font-weight: 800; color: #fff; background: var(--blue); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.ucs-delta.neg { color: #dc2626; } .ucs-delta.base { color: var(--text-light); font-weight: 600; }
.mass3d-hauto { font-size: 12px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mass3d-hauto b { color: var(--blue); }
.mass3d-hauto .hauto-flag { color: #b45309; font-weight: 700; cursor: help; }
@media (max-width: 900px) { .ucs-compare3 { grid-template-columns: 1fr; } }
.inc-eng { background: #f5f9ff; border: 1px solid #cfe0fb; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.inc-eng-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inc-tag { font-size: 11.5px; border: 1px solid var(--gray2); background: #fff; border-radius: 999px; padding: 2px 8px; }
.inc-tag.rec { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.inc-combo, .law-breakdown .lb-combo { font-weight: 700; color: #1e3a8a; word-break: keep-all; }
.inc-excl summary { cursor: pointer; color: var(--text-light); font-size: 12px; }
.inc-excl div { font-size: 11.5px; color: var(--text-light); padding-left: 6px; }

/* ── 웹 서비스: 결과 카드 버튼 묶음 · 버전 정보 ── */
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; flex-shrink: 0; }
.web-info { margin: 12px 0; }
@media (max-width: 1100px) {
  .result-header { flex-wrap: wrap; gap: 10px; }
  .result-actions { justify-content: flex-start; }
}
