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

:root {
  --teal-50: #EAFaf4;
  --teal-100: #CCEFE3;
  --teal-400: #10B981;
  --teal-600: #059669;
  --navy: #0A2540;
  --navy-light: #1E293B;
  --bg-main: #F8FAFC;
  --surface: #FFFFFF;
  --text-main: #0F172A;
  --text-sub: #475569;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', sans-serif;
  background-color: #DEE2E6; color: var(--text-main);
  min-height: 100vh; display: flex; justify-content: center; align-items: center;
}

/* ---- 전체 프레임 ---- */
.web-window {
  width: 1024px; height: 768px; background: var(--surface);
  border-radius: var(--radius-lg); border: 2px solid #CBD5E1;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}

/* 풀스크린 대화면 프레임 구조 정상화 */
.full-screen-frame {
  width: 100vw; height: 100vh; background: var(--surface);
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}

.page { display: none; width: 100%; height: 100%; flex-direction: column; background: #fff; }
.page.active { display: flex; }

.web-header {
  padding: 24px 30px; border-bottom: 2px solid #E2E8F0;
  display: flex; justify-content: space-between; align-items: center; background: #fff;
  flex-shrink: 0;
}
.web-header h2 { font-size: 22px; font-weight: 700; color: var(--navy); }
.small-logout-btn {
  background: #F1F5F9; border: none; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text-sub); transition: all 0.2s;
}
.small-logout-btn:hover { background: #E2E8F0; }

.app-header {
  background: #112240; color: #fff; padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.app-header h2 { font-size: 16px; font-weight: 700; text-align: center; flex: 1; letter-spacing: -0.3px; }
.app-header .back-btn, .app-header .home-btn {
  background: rgba(255, 255, 255, 0.1); border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer;
}

.split-body { flex: 1; display: flex; padding: 30px; gap: 30px; overflow: hidden; background: #F8FAFC; }

/* ---- 좌측 패널 1:1:1 세로 배치 ---- */
.side-panel { 
  width: 360px; display: flex; flex-direction: column; gap: 20px; flex-shrink: 0; 
}
.side-ratio-box {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
}

.box-card {
  height: 100%; background: #fff; border: 2px solid var(--border); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: center;
}

.box-safezone-count {
  height: 100%; background: #EFF6FF; border: 2px solid #BFDBFE; border-radius: 16px;
  padding: 20px; display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow-sm);
}

.badge-group { display: flex; gap: 10px; height: 100%; }
.badge-item {
  flex: 1; border: 2px solid var(--border); border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; 
  background: #fff; box-shadow: var(--shadow-sm); padding: 16px 0; transition: all 0.2s ease;
}
.badge-item.active { background: #EAFaf4; border-color: var(--teal-400); }

.badge-icon-zone { flex: 2; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.badge-icon-zone i { font-size: 38px !important; display: inline-block; line-height: 1; }
.badge-text-zone { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--text-sub); letter-spacing: -0.3px; }
.badge-item.active .badge-text-zone { color: var(--teal-600); }

/* 오른쪽 메인 공간 */
.main-map-panel { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.map-box { flex: 1; background: #EDF2F7; border: 2px solid var(--border); border-radius: var(--radius-lg); position: relative; overflow: hidden; }
.arrow-navigate-btn {
  height: 56px; background: var(--navy); color: #fff; border: none;
  border-radius: var(--radius-md); font-size: 16px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; transition: opacity 0.2s;
}
.arrow-navigate-btn:hover { opacity: 0.9; }

/* ---- [수정 핵심] 실시간 안내 대화면 맵 레이아웃 분할 ---- */
.simulation-body { 
  flex: 1; /* 남은 화면 전체를 채우도록 설정 */
  display: flex; 
  position: relative; 
  overflow: hidden; 
}

/* 지도 박스 높이가 0이 되지 않도록 100% 꽉 채우기 */
.kmap { 
  flex: 1; 
  height: 100% !important; 
  background: #E2E8F0; 
  position: relative; 
}

.result-panel {
  background: #fff; padding: 22px 40px; 
  border-top: 2px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.04);
  flex-shrink: 0; /* 하단 바 영역 고정 */
}

/* ---- 대형 로그인 상자 ---- */
.center-login-box {
  width: 650px; padding: 50px 40px; border: 2px solid var(--border);
  border-radius: var(--radius-lg); background: #fff; text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.02); margin: auto;
}
.big-input {
  width: 100%; height: 90px; font-size: 24px; font-weight: 600;
  padding: 20px; border-radius: var(--radius-md); border: 2px solid #CBD5E1;
  outline: none; margin-top: 12px; background: #F8FAFC; text-align: center;
}
.big-input:focus { border-color: var(--teal-400); background: #fff; }
.big-btn {
  width: 100%; height: 68px; font-size: 20px; font-weight: 700; color: #fff;
  background: var(--teal-400); border: none; border-radius: var(--radius-md);
  margin-top: 24px; cursor: pointer; transition: background 0.2s;
}

/* ---- 프리미엄 입력란 ---- */
.premium-input-box {
  background: #ffffff; border: 2px solid var(--border); border-radius: 16px;
  padding: 24px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 16px;
}
.premium-route-item { display: flex; align-items: center; gap: 16px; position: relative; }
.route-icon-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--teal-400); flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--teal-50);
}
.route-icon-dot.dest { background: #EF4444; box-shadow: 0 0 0 4px #FEE2E2; }
.route-input-wrapper { flex: 1; position: relative; }
.route-label-text { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }

.premium-field {
  width: 100%; height: 48px; background: #F8FAFC; border: 1px solid #E2E8F0;
  border-radius: 10px; padding: 0 16px; font-size: 14px; font-weight: 600;
  color: var(--text-main); outline: none; transition: all 0.25s ease;
}
.premium-field:focus { border-color: var(--teal-400); background: #ffffff; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1); }
.premium-field[readonly] { background: #F1F5F9; color: #64748B; cursor: not-allowed; }

.option-box-title { font-size: 12px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.triple-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.triple-row label { background: #F8FAFC; border: 1px solid #E2E8F0; padding: 9px; text-align: center; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.triple-row input[type="radio"] { display: none; }
.triple-row input[type="radio"]:checked + label { background: #EAFaf4; border-color: var(--teal-400); color: var(--teal-600); }

.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  border: 1px solid #E2E8F0; z-index: 99; max-height: 180px; overflow-y: auto; display: none;
}
.search-results.show { display: block; }
.search-result-item { padding: 12px 14px; cursor: pointer; border-bottom: 1px solid #F1F5F9; }
.search-result-item:hover { background: #F8FAFC; }
.search-result-item .sr-name { font-size: 13px; font-weight: 700; }

.toast {
  position: absolute; left: 50%; top: 90px; transform: translateX(-50%);
  background: #0F172A; color: #fff; padding: 12px 24px; border-radius: 30px; font-size: 13px; font-weight: 600; opacity: 0; z-index: 999; transition: opacity 0.2s;
}
.toast.show { opacity: 1; }
/* ---- 시뮬레이션 시작(경로 이동) 버튼 ---- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 56px; padding: 0 24px;
  font-size: 16px; font-weight: 800; letter-spacing: -0.3px; color: #fff;
  background: linear-gradient(135deg, #34D399 0%, #10B981 55%, #059669 100%);
  border: none; border-radius: 14px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(16,185,129,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-primary i { font-size: 20px; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(16,185,129,0.45); filter: brightness(1.03); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 6px 14px rgba(16,185,129,0.3); }
.btn-primary:disabled { background: #CBD5E1; box-shadow: none; cursor: default; transform: none; filter: none; }

/* ---- 신고하기 버튼 ---- */
.small-report-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #FEF2F2; border: 1.5px solid #FECACA; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 800; cursor: pointer; color: #DC2626; transition: all 0.18s;
}
.small-report-btn i { font-size: 16px; }
.small-report-btn:hover { background: #DC2626; border-color: #DC2626; color: #fff; box-shadow: 0 6px 16px rgba(220,38,38,0.28); }

/* ---- 신고 모달 ---- */
.report-overlay {
  position: fixed; inset: 0; background: rgba(10,37,64,0.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.report-overlay.show { opacity: 1; pointer-events: auto; }
.report-box {
  position: relative; width: 440px; max-width: 92vw; background: #fff; border-radius: 20px;
  padding: 28px 28px 24px; box-shadow: 0 24px 60px rgba(0,0,0,0.28); border: 2px solid #E2E8F0;
}
.report-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border: none;
  background: #F1F5F9; border-radius: 50%; cursor: pointer; color: var(--text-sub);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.report-close:hover { background: #E2E8F0; }
.report-head { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.report-badge {
  width: 48px; height: 48px; border-radius: 14px; background: #FEF2F2; color: #DC2626;
  display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0;
}
.report-head h3 { font-size: 19px; font-weight: 800; color: var(--navy); }
.report-head p { font-size: 12.5px; color: var(--text-sub); margin-top: 2px; }
.report-label { font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 10px; }
.report-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.report-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 10px;
  border: 1.5px solid #E2E8F0; background: #F8FAFC; color: var(--text-sub);
  font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.15s;
}
.report-chip i { font-size: 16px; }
.report-chip:hover { border-color: #FCA5A5; background: #FEF2F2; color: #DC2626; }
.report-chip.active { border-color: #DC2626; background: #DC2626; color: #fff; }
.report-submit {
  width: 100%; height: 52px; border: none; border-radius: 12px; cursor: pointer;
  font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #F87171 0%, #DC2626 100%);
  box-shadow: 0 8px 20px rgba(220,38,38,0.3); transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.report-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(220,38,38,0.4); }
.report-submit:disabled { background: #CBD5E1; box-shadow: none; cursor: default; transform: none; }
.report-emergency { margin-top: 14px; text-align: center; font-size: 12px; color: var(--text-sub); }
.report-emergency b { color: #DC2626; }
.report-done-icon { font-size: 60px; color: var(--teal-400); line-height: 1; margin-bottom: 10px; }
