/* ── 기본 리셋 & 변수 ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-h: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --gh: 80px;
  --gh-row1: 52px;
  --footer-h: 34px;
  --docs-toolbar-h: 44px;
  --tabs-h: 52px;
  --panel-w: 320px;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body { height: 100%; overflow: hidden; background: var(--bg); }

/* ── 통합 레이아웃 ───────────────────────────────── */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── 통합 헤더 ───────────────────────────────────── */
.global-header {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: var(--gh-row1);
  background: #1e40af;
  flex-shrink: 0;
  position: relative;
  z-index: 2000;
  overflow: visible;
  color: #fff;
}

/* 헤더 1행: 왼쪽 고정, 검색 절대 센터 */
.gh-row1 {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: var(--gh-row1);
  flex-shrink: 0;
}
.gh-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.gh-left .grade-legend {
  margin-left: auto;
}
/* 검색창: 헤더 전체 기준 절대 중앙 */
.gh-search {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  width: 42%;
  max-width: 580px;
  min-width: 260px;
}

/* 등급 레이블 */
.grade-label {
  font-size: 11px;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  font-weight: 500;
  margin-right: 2px;
}

/* 헤더 2행: 등급범례 + 통계 바 */
.gh-row2 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  height: 28px;
  flex-shrink: 0;
  background: rgba(0,0,0,.18);
  font-size: 11px;
  overflow: hidden;
}
/* 보고서 탭에서는 row2 숨김 */
#globalHeader[data-tab="docs"] .gh-row2 { display: none; }
.gh-row2-div {
  width: 1px; height: 14px;
  background: rgba(255,255,255,.3);
  flex-shrink: 0;
}

.gh-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.gh-logo { font-size: 18px; }
.gh-title { letter-spacing: -0.3px; cursor: pointer; }
.gh-title:hover { color: var(--accent); }


/* ── 패널 영역 ───────────────────────────────────── */
.panels {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  flex: 1 1 50%;
  min-width: 0;
}

.pane-map { border-right: 1px solid var(--border); }

/* ── 패널 비율 ───────────────────────────────────── */
.panels.ratio-1-2 .pane-map  { flex: 1 1 33.3%; }
.panels.ratio-1-2 .pane-docs { flex: 2 1 66.7%; }
.panels.ratio-2-3 .pane-map  { flex: 2 1 40%; }
.panels.ratio-2-3 .pane-docs { flex: 3 1 60%; }

/* ── 새로고침 버튼 ───────────────────────────────── */
.btn-refresh-all {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  background: rgba(255,255,255,.25); border: 1px solid rgba(255,255,255,.4);
  border-radius: 8px; color: #fff; cursor: pointer; transition: background .15s;
}
.btn-refresh-all:hover { background: rgba(255,255,255,.42); }
.btn-refresh-all.spinning svg { animation: spin .5s linear; }

/* ── 비율 버튼 ───────────────────────────────────── */
.gh-ratio {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.ratio-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 5px;
  background: transparent;
  color: rgba(255,255,255,.65);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.ratio-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.ratio-btn.active { background: rgba(255,255,255,.22); color: #fff; border-color: rgba(255,255,255,.7); }

/* 미니 패널 아이콘 */
.ri {
  display: inline-flex;
  gap: 2px;
  height: 10px;
  align-items: stretch;
}
.ri::before, .ri::after {
  content: '';
  display: block;
  background: currentColor;
  border-radius: 1px;
  opacity: .85;
}
.ri-11::before { width: 7px; }
.ri-11::after  { width: 7px; }
.ri-12::before { width: 5px; }
.ri-12::after  { width: 9px; }
.ri-23::before { width: 6px; }
.ri-23::after  { width: 8px; }

/* ── 헤더 검색 공통 ─────────────────────────────── */
.header-search {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  gap: 6px;
  min-width: 0;
}

.header-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  height: 32px;
  outline: none;
  min-width: 0;
}

.icon-search { font-size: 13px; }

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  z-index: 3000;
  display: none;
  max-height: 260px;
  overflow-y: auto;
}
.search-dropdown.open { display: block; }
.search-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.search-dropdown-item:hover { background: var(--bg); }
.search-dropdown-item strong { color: var(--text); }
.search-dropdown-item span { color: var(--muted); font-size: 12px; }
.search-dropdown-empty { padding: 12px 14px; color: var(--muted); font-size: 13px; }

.header-stats { font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; gap: 8px; }
.header-stats strong { color: var(--text); }

.btn-list-toggle {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text);
}
.btn-list-toggle.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.map-header-row2 { display: flex; align-items: center; }

/* 등급 범례 */
.grade-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.grade-legend-label { font-size: 11px; color: var(--muted); }
.grade-legend-item {
  display: flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 2px 6px; border-radius: 4px; border: 1px solid transparent;
  transition: all .15s;
}
.grade-legend-item i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.grade-legend.filtered .grade-legend-item { opacity: 0.4; }
.grade-legend.filtered .grade-legend-item.active { opacity: 1; border-color: currentColor; }

/* ── 지도 본체 ───────────────────────────────────── */
.map-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map { width: 100%; height: 100%; }

/* 노선 칩 래퍼 */
.route-chips-row { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; align-items: center; gap: 4px; z-index: 900; }
.route-scroll-btn { flex-shrink: 0; width: 24px; height: 26px; border: 1px solid #d1d5db; border-radius: 14px; background: rgba(255,255,255,.92); font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.route-scroll-btn:hover { background: #fff; }

/* 노선 칩 */
.route-chips {
  flex: 1; overflow-x: auto;
  position: static;
  display: flex; gap: 6px; flex-wrap: nowrap;
  overflow-x: auto; z-index: 600;
  scrollbar-width: none;
}
.route-chips::-webkit-scrollbar { display: none; }

/* 줌 컨트롤을 노선 칩 아래로 내려서 겹침 방지 */
.leaflet-top.leaflet-right .leaflet-control-zoom { margin-top: 52px; }

/* 노선 칩 행 구분선 + 상부형식 토글 */
.route-chips-sep { width: 1px; height: 18px; background: rgba(0,0,0,.15); flex-shrink: 0; }
.btn-super-toggle {
  flex-shrink: 0;
  padding: 4px 10px; border-radius: 14px;
  border: 1px solid #d1d5db;
  background: rgba(255,255,255,.92); font-size: 12px; font-weight: 600;
  color: #374151; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.1); transition: all .15s;
}
.btn-super-toggle:hover { background: #fff; }
.btn-super-toggle.active { background: #1e40af; color: #fff; border-color: #1e40af; }
.route-chip {
  padding: 4px 10px; border-radius: 20px; border: 1px solid #d1d5db;
  background: rgba(255,255,255,.92); font-size: 12px; cursor: pointer;
  white-space: nowrap; backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  transition: all .15s;
}
.route-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 로딩 오버레이 */
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.7);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; z-index: 100;
  font-size: 13px; color: var(--muted);
}
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 목록 패널 (지도 좌측 오버레이) */
.list-panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: var(--panel-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 1100;
  box-shadow: 2px 0 8px rgba(0,0,0,.08);
}
.list-panel.open { transform: translateX(0); }

.list-panel-close {
  position: absolute;
  bottom: 40px; right: -36px;
  width: 32px; height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 6px 6px 0;
  box-shadow: 2px 0 6px rgba(0,0,0,.1);
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: color .15s, background .15s;
  z-index: 1;
}
.list-panel-close:hover { background: var(--bg); color: var(--text); }

/* 상부형식 필터 패널 (지도 우측 오버레이) */
.super-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 220px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 1100;
  box-shadow: -2px 0 8px rgba(0,0,0,.08);
  pointer-events: none;
}
.super-panel.open { transform: translateX(0); pointer-events: auto; }

.super-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: #1e40af; color: #fff;
  flex-shrink: 0;
}
.super-panel-title { font-size: 13px; font-weight: 600; }
.super-panel-hdr-right { display: flex; align-items: center; gap: 6px; }
.super-clear-btn {
  font-size: 11px; padding: 2px 8px;
  border: 1px solid rgba(255,255,255,.5); border-radius: 4px;
  background: transparent; color: #fff; cursor: pointer;
  transition: background .15s;
}
.super-clear-btn:hover { background: rgba(255,255,255,.15); }
.super-close-btn {
  background: transparent; border: none; color: rgba(255,255,255,.8);
  font-size: 14px; cursor: pointer; padding: 0 2px; line-height: 1;
}
.super-close-btn:hover { color: #fff; }

.super-panel-body { overflow-y: auto; flex: 1; padding: 4px 0; }

.super-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer;
  font-size: 12px; border-bottom: 1px solid #f3f4f6;
  transition: background .1s; user-select: none;
}
.super-item:hover { background: #f9fafb; }
.super-item.active { background: #eff6ff; }

.super-item-check {
  width: 14px; height: 14px; flex-shrink: 0;
  border: 1.5px solid #d1d5db; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.super-item.active .super-item-check {
  background: #2563eb; border-color: #2563eb;
}
.super-item.active .super-item-check::after {
  content: '✓'; color: #fff; font-size: 9px; font-weight: 700;
}
.super-item-name { flex: 1; color: #374151; line-height: 1.3; }
.super-item.active .super-item-name { color: #1d4ed8; font-weight: 600; }
.super-item-count { font-size: 11px; color: #9ca3af; white-space: nowrap; }
.super-item.active .super-item-count { color: #60a5fa; }

.list-filter { padding: 10px; border-bottom: 1px solid var(--border); }
.list-filter input {
  width: 100%; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; margin-bottom: 6px; outline: none;
}
.list-filter input:focus { border-color: var(--accent); }
.list-filter-row { display: flex; gap: 6px; }
.list-filter-row select {
  flex: 1; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; outline: none; background: var(--surface);
}

.list-body { flex: 1; overflow-y: auto; }
.list-item {
  padding: 10px 12px; cursor: pointer; display: flex;
  align-items: flex-start; gap: 8px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.list-item:hover { background: var(--bg); }
.list-item.active { background: #eff6ff; }
.gps-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  margin-top: 3px;
}
.gps-dot.line  { background: var(--accent); }
.gps-dot.point { background: var(--success); }
.gps-dot.none  { background: var(--border); }
.list-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
.list-item-sub  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.list-footer { padding: 8px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.btn-load-more {
  display: block; width: 100%; padding: 10px;
  text-align: center; font-size: 13px; cursor: pointer;
  border: none; background: var(--bg); color: var(--accent);
  border-top: 1px solid var(--border);
}

/* 교량 상세 패널 (지도 우하단 오버레이) */
.bridge-panel {
  position: absolute;
  bottom: 0; right: 0;
  width: var(--panel-w);
  max-height: 70%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  box-shadow: -2px -2px 12px rgba(0,0,0,.1);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .25s ease;
  z-index: 500;
}
.bridge-panel.open { transform: translateY(0); }
.bridge-panel.minimized .bridge-panel-body { display: none; }

.bridge-panel-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.bridge-panel-header h2 {
  flex: 1; font-size: 14px; font-weight: 700;
  color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.btn-minimize, .btn-close-panel {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 14px; padding: 2px 4px;
  line-height: 1; border-radius: 4px;
}
.btn-minimize:hover, .btn-close-panel:hover { background: var(--bg); color: var(--text); }

.bridge-panel-body { flex: 1; overflow-y: auto; padding: 12px; }

/* 상세 패널 내용 */
.section-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin: 14px 0 6px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.section-title:first-child { margin-top: 0; }

.info-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.info-grid dt { font-size: 12px; color: var(--muted); white-space: nowrap; }
.info-grid dd { font-size: 12px; color: var(--text); word-break: break-word; }

.grade-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #fff;
}
.grade-a { background: #16a34a; }
.grade-b { background: #2563eb; }
.grade-c { background: #d97706; }
.grade-d { background: #dc2626; }
.grade-e { background: #7c3aed; }
.grade-unknown { background: #6b7280; }

/* 기상 조회 */
.weather-query { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.weather-query input[type="date"] {
  flex: 1; padding: 5px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; outline: none;
}
.btn-weather {
  padding: 5px 12px; border-radius: 6px;
  background: var(--accent); color: #fff; border: none;
  font-size: 12px; cursor: pointer;
}
.btn-weather:disabled { opacity: .5; cursor: not-allowed; }

.weather-card {
  background: var(--bg); border-radius: 8px;
  padding: 10px; font-size: 12px;
}
.weather-station { color: var(--muted); margin-bottom: 6px; font-size: 11px; }
.weather-temps { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.weather-avg { font-size: 18px; font-weight: 700; color: var(--text); }
.weather-range { font-size: 12px; color: var(--muted); }
.weather-extra { display: flex; gap: 12px; color: var(--muted); font-size: 11px; }
.weather-error { color: var(--danger); font-size: 12px; margin-top: 6px; }
.weather-loading { color: var(--muted); font-size: 12px; }
.weather-addr-note { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.weather-no-gps { font-size: 12px; color: var(--muted); }
.weather-src-note { font-size: 11px; color: var(--muted); margin-top: 4px; }

.mini-summary { display: none; }

/* 지도 새로고침 버튼 */
.btn-map-refresh {
  position: absolute;
  bottom: 68px; right: 10px;
  width: 36px; height: 36px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.12); z-index: 1001;
  color: var(--text); transition: all .15s;
}
.btn-map-refresh:hover { background: var(--bg); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-map-refresh.spinning svg { animation: spin .5s linear; }

/* 내 위치 버튼 */
.btn-my-location {
  position: absolute;
  bottom: 24px; right: 10px;
  width: 36px; height: 36px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.12); z-index: 1001;
  color: var(--text); transition: all .15s;
}
.btn-my-location:hover { background: var(--bg); }
.btn-my-location.loading { opacity: .6; animation: pulse 1s infinite; }
.btn-my-location.active { color: var(--accent); border-color: var(--accent); }
@keyframes pulse { 50% { opacity: .3; } }

/* Leaflet 커스텀 */
.bridge-tooltip { font-size: 12px; padding: 5px 8px; border-radius: 6px; border: none !important; }
.bridge-label { background: transparent !important; border: none !important; }
.bridge-label-inner {
  font-size: 11px; font-weight: 600; color: #1f2937;
  background: rgba(255,255,255,.85); padding: 1px 5px;
  border-radius: 4px; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  backdrop-filter: blur(2px);
}
.my-location-pin { background: transparent !important; border: none !important; }

/* ── 파란 헤더 위 컨트롤 오버라이드 ─────────────── */
.global-header .header-search {
  background: rgba(255,255,255,.38);
  border-color: rgba(255,255,255,.55);
}
.global-header .header-search:focus-within { border-color: rgba(255,255,255,.85); background: rgba(255,255,255,.5); }
.global-header .header-search input { color: #fff; }
.global-header .header-search input::placeholder { color: rgba(255,255,255,.75); }
.global-header .icon-search { color: rgba(255,255,255,.85); }

.gh-search #btnSearch {
  padding: 5px 14px; border-radius: 8px;
  background: rgba(255,255,255,.35); color: #fff;
  border: 1px solid rgba(255,255,255,.5);
  font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.gh-search #btnSearch:hover { background: rgba(255,255,255,.35); }

.global-header .btn-list-toggle {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.25);
  color: #fff;
}
.global-header .btn-list-toggle:hover { background: rgba(255,255,255,.25); }

.global-header .grade-legend-item { color: rgba(255,255,255,.9); border-color: rgba(255,255,255,.25); }
.global-header .grade-legend-item.active { border-color: #fff; color: #fff; }

.gh-row2 .docs-stats { color: rgba(255,255,255,.85); }
.gh-row2 .header-stats { color: rgba(255,255,255,.85); font-size: 11px; }
.gh-row2 .header-stats strong { color: #fff; }

/* ── 푸터 ────────────────────────────────────────── */
.app-footer {
  height: 44px;
  background: #1e3a8a;
  color: rgba(255,255,255,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 12px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}
.footer-dl-link {
  position: absolute;
  right: 16px;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}
.footer-dl-link:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.app-footer-logo {
  height: 30px;
  width: auto;
  opacity: .9;
  filter: invert(1) grayscale(1) brightness(3);
  mix-blend-mode: screen;
}
.credit-toast {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1e3a8a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 9999;
}
.credit-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 보고서 패널 ─────────────────────────────────── */
.docs-stats { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 툴바 */
.docs-toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 6px 14px;
  flex-shrink: 0;
  z-index: 9;
}
.toolbar-inner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.result-info { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.toolbar-controls {
  display: flex; align-items: center; gap: 6px;
  margin-left: auto; flex-wrap: wrap;
}
.ft-chips { display: flex; gap: 4px; }
.chip {
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; cursor: pointer; color: var(--text);
  transition: all .15s;
}
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.docs-toolbar select {
  padding: 4px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; outline: none;
  background: var(--surface); color: var(--text);
}
.btn-filter-toggle {
  padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface);
  font-size: 12px; cursor: pointer; color: var(--text);
}
.btn-filter-toggle:hover { background: var(--bg); }

/* 필터 패널 (1행 3열: 부재명 1 · 상부형식 1 · 제외키워드 2) */
.filter-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  flex-shrink: 0;
}
.filter-inner {
  display: flex;
  flex-direction: row;
  gap: 8px 16px;
  align-items: flex-end;
}
.filter-row { display: flex; flex-direction: column; gap: 4px; }
.filter-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-col-sm { flex: 1; }
.filter-col-lg { flex: 2; }
.filter-label { font-size: 12px; color: var(--muted); min-height: 30px;
                 display: flex; flex-direction: column; justify-content: flex-end; }
.filter-label-exclude { color: #dc2626; font-weight: 600; }
.filter-row select, .filter-col select {
  padding: 4px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; outline: none; width: 100%;
}
.exclude-area { flex: 1; }
.exclude-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.exclude-tag {
  display: flex; align-items: center; gap: 3px;
  padding: 2px 8px; background: #fef3c7;
  border: 1px solid #fbbf24; border-radius: 12px;
  font-size: 12px; color: #92400e;
}
.exclude-tag button {
  background: none; border: none; cursor: pointer;
  color: #92400e; font-size: 14px; line-height: 1; padding: 0;
}
.exclude-input-wrap { display: flex; gap: 6px; }
.exclude-input-wrap input {
  flex: 1; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; outline: none;
}
.exclude-input-wrap button {
  padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; cursor: pointer; white-space: nowrap;
}

/* 보고서 본체 */
.docs-body {
  flex: 1; overflow-y: auto;
  padding: 12px 14px;
}

/* 결과 카드 */
.results { display: flex; flex-direction: column; gap: 8px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); border-color: #d1d5db; }

.card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.card-type {
  padding: 2px 6px; border-radius: 4px;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.type-pdf { background: #fee2e2; color: #b91c1c; }
.type-hwp { background: #dbeafe; color: #1e40af; }
.card-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-bridge {
  font-size: 12px; color: var(--accent); margin-bottom: 4px;
  cursor: pointer; display: inline-block;
}
.card-bridge:hover { text-decoration: underline; }

.card-expand { display: none; }
.card.expanded .card-expand { display: block; }

.card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tag {
  padding: 2px 7px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 11px; color: var(--muted);
}
.card-summary { font-size: 12px; color: var(--muted); line-height: 1.5; }

.card-footer {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.btn-expand {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--muted); padding: 2px 0;
  display: flex; align-items: center; gap: 4px;
}
.btn-expand .arrow { transition: transform .15s; }
.card.expanded .btn-expand .arrow { transform: rotate(180deg); }

.btn { padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border); font-size: 12px; cursor: pointer; background: var(--surface); color: var(--text); }
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-h); }

/* 교량 기본정보 */
.bridge-info-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  margin-bottom: 12px;
}
.bridge-info-section.hidden { display: none; }
.bi-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bi-title { font-size: 13px; font-weight: 700; color: var(--text); }
.bi-count { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.bi-cards { display: flex; flex-direction: column; gap: 8px; }
.bi-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  background: var(--bg);
}
.bi-card-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.bi-grid { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 3px 14px; }
.bi-label { font-size: 11px; color: var(--muted); }
.bi-value { font-size: 11px; color: var(--text); }
.bi-full { display: none; }
.bi-card.bi-expanded .bi-full { display: grid; margin-top: 6px; }
.bi-card.bi-expanded .bi-summary { display: none; }

.bi-card-footer,
.bi-card-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.bi-map-btn {
  font-size: 12px; color: var(--accent); text-decoration: none;
  padding: 3px 8px; border: 1px solid var(--accent);
  border-radius: 4px; cursor: pointer; background: none;
}
.bi-map-btn:hover { background: #eff6ff; }
.bi-toggle-btn {
  font-size: 12px; color: var(--muted); background: none;
  border: 1px solid var(--border); border-radius: 4px;
  padding: 3px 8px; cursor: pointer;
}
.bi-toggle-btn:hover { background: var(--surface); }

/* 보수이력 */
.repair-section { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.repair-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.repair-title { font-size: 12px; font-weight: 600; color: var(--text); }
.repair-count { font-size: 11px; color: var(--muted); margin-left: 4px; font-weight: 400; }
.repair-list-btn {
  margin-left: auto; font-size: 11px; color: var(--accent);
  background: none; border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px; cursor: pointer;
}
.repair-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.repair-chip {
  padding: 3px 8px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 11px; cursor: pointer; color: var(--text);
}
.repair-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.repair-chip strong { font-weight: 700; }
.repair-list-wrap { margin-top: 8px; }
.repair-filter-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; display: block; }
.repair-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.repair-table th, .repair-table td {
  padding: 4px 6px; border-bottom: 1px solid var(--border);
  text-align: left; color: var(--text);
}
.repair-table th { color: var(--muted); font-weight: 600; }
.repair-more-btn {
  display: block; width: 100%; padding: 6px;
  text-align: center; font-size: 12px; cursor: pointer;
  border: none; background: var(--bg); color: var(--accent);
  margin-top: 4px; border-radius: 4px;
}
.repair-more-info { font-size: 11px; color: var(--muted); }

/* 페이지네이션 */
.pagination { display: flex; justify-content: center; gap: 4px; padding: 12px 0; flex-wrap: wrap; }
.page-btn {
  width: 32px; height: 32px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { background: var(--bg); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 빈 상태 */
.empty-state-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px 40px;
  position: relative;
}
.empty-state-logo {
  width: 1320px; height: 420px;
  max-width: 100%;
  background: url('/static/LOGO2.png') center/contain no-repeat;
  opacity: 0.15;
  margin-top: 24px;
}
.empty-state-text {
  font-size: 14px; color: var(--muted);
  text-align: center; margin: 0 0 10px;
}
.empty-state-hint {
  font-size: 13px; color: var(--muted);
  opacity: 0.7; text-align: center; margin: 0;
}

.empty-state, .no-result {
  text-align: center; color: var(--muted);
  font-size: 14px; padding: 40px 20px;
}

/* 스켈레톤 */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 4px;
  height: 16px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── 모달 ─────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--surface); border-radius: 12px;
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.modal-close {
  position: sticky; top: 0; float: right;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 8px;
  cursor: pointer; font-size: 14px; z-index: 1;
}
.detail-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.detail-bridge { font-size: 13px; color: var(--accent); margin-bottom: 10px; }
.detail-summary {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  background: var(--bg); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 12px;
}
.badge-pending {
  font-size: 13px; color: var(--muted);
  background: #fffbeb; border: 1px solid #fbbf24;
  border-radius: 6px; padding: 8px 12px; margin-bottom: 12px;
}
.detail-grid {
  display: grid; grid-template-columns: auto 1fr;
  gap: 6px 14px; margin-bottom: 16px;
}
.detail-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.detail-value { font-size: 13px; color: var(--text); }
.detail-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--border); }

/* ── 통계 오버레이 ───────────────────────────────── */
.stats-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(0,0,0,.5);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 20px;
}
.stats-overlay.hidden { display: none; }
.stats-container {
  background: var(--surface); border-radius: 12px;
  width: min(960px, 100%);
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.stats-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.stats-title { font-size: 18px; font-weight: 700; }
.stats-close-btn {
  padding: 6px 14px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; cursor: pointer; color: var(--text);
}
.stats-overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-ov-card {
  background: var(--bg); border-radius: 8px;
  padding: 14px; text-align: center;
}
.stat-ov-num { font-size: 20px; font-weight: 700; color: var(--text); }
.stat-ov-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stats-section { margin-bottom: 20px; }
.stats-section-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.stats-badge {
  font-size: 11px; background: #dbeafe; color: #1e40af;
  padding: 2px 6px; border-radius: 10px; font-weight: 400;
}
.stats-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.stat-bar-label {
  width: 120px; font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex-shrink: 0;
}
.stat-bar-wrap { flex: 1; display: flex; align-items: center; gap: 6px; }
.stat-bar {
  height: 14px; border-radius: 3px;
  background: var(--accent); min-width: 4px;
  transition: width .3s ease;
}
.stat-bar-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.zero-query-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.zero-tag {
  padding: 2px 8px; background: #fee2e2;
  border: 1px solid #fca5a5; border-radius: 10px;
  font-size: 12px; color: #991b1b;
}
.zero-tag em { font-style: normal; color: var(--danger); margin-left: 3px; }

/* ── 교량 카드 GPS·날씨 정보 ─────────────────────── */
.bi-mapinfo {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.gps-badge {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
}
.gps-ok  { background: #dcfce7; color: #166534; }
.gps-none { background: #f3f4f6; color: #6b7280; }
.wq-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; flex-wrap: wrap;
}
.wq-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.wq-date {
  padding: 3px 6px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; outline: none;
}
.wq-btn {
  padding: 3px 10px; border-radius: 6px;
  background: var(--accent); color: #fff;
  border: none; font-size: 12px; cursor: pointer;
}
.wq-btn:hover { background: var(--accent-h); }
.wq-result { margin-top: 4px; }
.weather-loading { font-size: 12px; color: var(--muted); }
.weather-error { font-size: 12px; color: var(--danger); }
.weather-card {
  font-size: 12px; color: var(--text);
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 6px; padding: 6px 10px;
  display: flex; flex-direction: column; gap: 3px;
}
.weather-station { font-size: 11px; color: var(--muted); }
.weather-temps { display: flex; align-items: baseline; gap: 6px; }
.weather-avg { font-weight: 700; color: #166534; font-size: 14px; }
.weather-range { font-size: 11px; color: var(--muted); }
.weather-extra { display: flex; gap: 10px; font-size: 11px; color: var(--muted); }

/* ── 모바일 하단 탭 ──────────────────────────────── */
.mobile-tabs {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--tabs-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 500;
}
.tab-btn {
  flex: 1; border: none; background: none;
  font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: color .15s;
  text-decoration: none;
}
.tab-btn.active { color: var(--accent); }
.tab-link { color: var(--muted); }
.tab-btn.active::after {
  content: ''; position: absolute;
  top: 0; width: 40%; height: 2px;
  background: var(--accent); border-radius: 0 0 2px 2px;
}

/* ── 카드 정보 모바일: 4열 → 2열 복귀 ──────────── */
@media (max-width: 600px) {
  .bi-grid { grid-template-columns: max-content 1fr; gap: 3px 10px; }
  .filter-inner { flex-direction: row; gap: 8px; align-items: flex-end; }
  .filter-col-sm { flex: 1; }
  .filter-col-lg { flex: none; }
}

/* ── 모바일 반응형 ───────────────────────────────── */
@media (max-width: 1023px) {
  .mobile-tabs { display: flex; }

  .app-layout { height: calc(100vh - var(--tabs-h)); }

  /* Leaflet 하단 컨트롤이 모바일 탭에 가리지 않도록 위로 올림 */
  .leaflet-bottom { bottom: var(--tabs-h); }

  /* 패널 탭 전환 */
  .panels { display: block; height: 100%; }
  .pane { display: none; height: 100%; }
  .pane.active { display: flex; }

  /* 헤더 모바일: 1행 flex, 푸터 숨김 */
  .app-footer { display: none; }
  .gh-ratio { display: none; }
  .btn-refresh-all { margin-left: auto; }
  .gh-row1 {
    display: flex; align-items: center; gap: 6px;
    padding: 0 8px; width: 100%; grid-template-columns: unset;
  }
  /* 검색창: 절대위치 해제 → flex로 남은 공간 모두 차지 */
  .gh-search {
    position: static;
    transform: none;
    width: auto; max-width: none; min-width: 0;
    flex: 1;
    padding: 0;
    justify-content: flex-start;
  }
  .gh-left { padding-right: 0; flex-shrink: 0; }
  /* 지도 탭: 타이틀 숨김 */
  .gh-title { display: none; }
  /* 보고서 탭: 타이틀 표시, 목록 버튼 숨김 */
  #globalHeader[data-tab="docs"] .gh-title { display: inline; font-size: 13px; white-space: nowrap; }
  #globalHeader[data-tab="docs"] .btn-list-toggle { display: none; }

  /* 지도 탭: row2에서 통계 텍스트 숨기고 등급범례만 표시 */
  #globalHeader[data-tab="map"] .gh-row2 .docs-stats,
  #globalHeader[data-tab="map"] .gh-row2 .header-stats,
  #globalHeader[data-tab="map"] .gh-row2 .gh-row2-div { display: none; }

  /* 보고서 패널 모바일 */
  .toolbar-controls { width: 100%; justify-content: flex-start; }
  .result-info { font-size: 12px; }

  /* 통계 오버레이 */
  .stats-overview { grid-template-columns: repeat(2, 1fr); }
  .stats-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .toolbar-controls { gap: 4px; }
  .ft-chips .chip { padding: 3px 8px; font-size: 11px; }
  .docs-toolbar select { font-size: 11px; }
}

/* ── 신축유간 계산기 ──────────────────────────────── */
#ejModal { align-items: flex-start; }
.ej-box { max-width: 680px; width: 96vw; max-height: calc(100vh - 110px); overflow-y: auto; margin: 90px auto 0; }
@media (max-width: 1023px) {
  .ej-box { padding-bottom: max(80px, calc(60px + env(safe-area-inset-bottom, 0px))); }
}
.ej-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.ej-bridge-name { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.ej-sec-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
                 letter-spacing: .4px; border-bottom: 1px solid var(--border);
                 padding-bottom: 4px; margin-bottom: 8px; }
.ej-hint { font-size: 10px; font-weight: 400; margin-left: 6px; }
.ej-form-grid { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; align-items: center; }
.ej-form-grid label { font-size: 12px; color: var(--muted); text-align: right; }
.ej-input { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px;
             font-size: 13px; width: 100%; outline: none; background: #fff; }
.ej-input:focus { border-color: var(--accent); }
.ej-unit-wrap { display: flex; align-items: center; gap: 6px; }
.ej-unit-wrap .ej-input { flex: 1; }
.ej-unit-wrap span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ej-bearing-wrap { display: flex; gap: 8px; align-items: center; }
.ej-bearing-wrap .ej-input { flex: 1; }
.ej-elastic-cb { display: flex; align-items: center; gap: 4px; white-space: nowrap;
                  font-size: 12px; cursor: pointer; }
.ej-elastic-cb input { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; }
.ej-elastic-note { font-size: 11px; color: #d97706; background: #fffbeb;
                    border: 1px solid #fde68a; border-radius: 6px; padding: 5px 10px; margin-bottom: 6px; }
.ej-node-row-label { font-size: 11px; font-weight: 700; margin-bottom: 3px; }
.ej-node-row { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; min-height: 34px; }
.ej-node-item { display: flex; flex-direction: column; align-items: center; gap: 2px;
                 border: 1.5px solid var(--border); border-radius: 7px;
                 padding: 3px 7px; min-width: 36px; background: var(--bg); transition: all .12s; }
.ej-node-item.ej-fixed-on  { border-color: var(--accent); background: #eff6ff; }
.ej-node-item.ej-joint-on  { border-color: #f97316; background: #fff7ed; }
.ej-node-item.ej-joint-forced { border-color: #cbd5e1; }
.ej-node-item .ej-nn { font-size: 11px; font-weight: 700; color: var(--text); }
.ej-node-item input[type=checkbox] { width: 12px; height: 12px; cursor: pointer; }
.ej-node-item input[type=checkbox]:disabled { cursor: default; opacity: .5; }
.ej-node-sep { color: #cbd5e1; font-size: 11px; display: flex; flex-direction: column;
                align-items: center; gap: 8px; margin-top: -2px; }
.ej-node-sep .ej-sl { font-size: 9px; color: #94a3b8; }
.ej-gap-grid { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.ej-gap-item { display: flex; align-items: center; gap: 5px; }
.ej-gap-item label { font-size: 13px; font-weight: 700; color: var(--text); min-width: 24px; }
.ej-gap-fi { width: 65px; padding: 5px 7px; border: 1px solid var(--border);
              border-radius: 6px; font-size: 13px; outline: none; }
.ej-gap-fi:focus { border-color: var(--accent); }
.ej-gap-unit { font-size: 12px; color: var(--muted); }
.ej-weather-src { font-size: 11px; color: var(--accent); background: #eff6ff;
                   border-radius: 5px; padding: 3px 8px; }

.ej-calc-btn { width: 100%; padding: 10px; background: var(--accent); color: #fff; border: none;
                border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer;
                margin: 12px 0 0; letter-spacing: 2px; }
.ej-calc-btn:hover { background: var(--accent-h); }
.ej-results { margin-top: 12px; }
.ej-results.hidden { display: none; }
.ej-params { background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
              padding: 10px 14px; margin-bottom: 10px; font-size: 12px; }
.ej-params-row { display: flex; flex-wrap: wrap; gap: 5px 16px; }
.ej-param { color: var(--muted); }
.ej-param strong { color: var(--text); }
.ej-diag-wrap { background: var(--bg); border: 1px solid var(--border);
                 border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.ej-result-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ej-result-table th { background: var(--bg); padding: 6px 8px; text-align: center;
                       border: 1px solid var(--border); font-size: 10px; color: var(--muted); font-weight: 700; }
.ej-result-table td { padding: 6px 8px; text-align: center; border: 1px solid var(--border); }
.ej-ok { color: #16a34a; font-weight: 700; }
.ej-ng { color: #dc2626; font-weight: 700; }
.ej-open-btn { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--accent);
                background: #fff; color: var(--accent); font-size: 11px; cursor: pointer; }
.ej-open-btn:hover { background: #eff6ff; }
.ej-save-hist-btn { padding: 7px 14px; border: 1px solid #16a34a; background: #f0fdf4;
                     border-radius: 6px; font-size: 12px; cursor: pointer; color: #15803d;
                     white-space: nowrap; }
.ej-save-hist-btn:hover { background: #dcfce7; }
.ej-print-btn { margin-top: 0; width: 100%; padding: 7px; border: 1px solid var(--border);
                  background: var(--bg); border-radius: 6px; font-size: 12px; cursor: pointer; }
.ej-print-btn:hover { background: #eff6ff; border-color: var(--accent); color: var(--accent); }

/* ── 신축유간 이력 관리 ──────────────────────────── */
#ejSaveModal, #ejHistoryModal, #ejActionModal { z-index: 9600; }
.ej-node-header { display: flex; align-items: center; justify-content: space-between;
                   margin-top: 12px; margin-bottom: 8px; }
.ej-node-header .ej-sec-title { margin: 0; border-bottom: none; padding-bottom: 0; }
.ej-node-btns { display: flex; gap: 6px; flex-shrink: 0; }
.ejh-header-btn { padding: 4px 10px; border: 1px solid #7c3aed; background: #fff;
                   color: #7c3aed; border-radius: 6px; font-size: 11px; cursor: pointer; }
.ejh-header-btn:hover:not(:disabled) { background: #f5f3ff; }
.ejh-header-btn:disabled, .ej-hist-disabled { opacity: .4; cursor: default; }
.ejh-header-btn.has-ng { border-color: #dc2626; color: #dc2626; }
.ejs-header-btn { padding: 4px 10px; border: 1px solid #16a34a; background: #fff;
                   color: #15803d; border-radius: 6px; font-size: 11px; cursor: pointer; }
.ejs-header-btn:hover:not(:disabled) { background: #f0fdf4; }
.ejs-header-btn:disabled { opacity: .4; cursor: default; }
.ej-save-box, .ejh-box, .eja-box { max-width: 520px; width: 96vw; }
.ejs-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.ejs-bridge { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.ejs-notice { background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px;
               padding: 12px 14px; font-size: 12.5px; line-height: 1.8; margin-bottom: 14px; }
.ejs-sub { font-size: 11px; color: var(--muted); }
.ejs-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ejs-row { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 8px; }
.ejs-row label { font-size: 12px; color: var(--muted); text-align: right; }
.ejs-input { padding: 5px 9px; border: 1px solid var(--border); border-radius: 6px;
              font-size: 13px; width: 100%; outline: none; }
.ejs-input:focus { border-color: var(--accent); }
.ejs-radio-group { display: flex; flex-direction: column; gap: 4px; }
.ejs-radio { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.ejs-hint-r { font-size: 11px; color: var(--muted); }
.ejs-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ejs-cancel-btn { padding: 7px 18px; border: 1px solid var(--border); border-radius: 7px;
                   background: var(--bg); font-size: 13px; cursor: pointer; }
.ejs-save-btn { padding: 7px 20px; background: var(--accent); color: #fff; border: none;
                 border-radius: 7px; font-size: 13px; font-weight: 700; cursor: pointer; }
.ejs-save-btn:hover { background: var(--accent-h); }
.ejs-msg { margin-top: 10px; font-size: 12px; padding: 8px 12px; border-radius: 6px; }
.ejs-msg.ok { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.ejs-msg.err { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.ejs-msg.hidden { display: none; }

/* 이력 목록 */
.ejh-list { max-height: 60vh; overflow-y: auto; }
.ejh-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
             margin-bottom: 8px; background: var(--bg); }
.ejh-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ejh-date { font-size: 12px; color: var(--muted); }
.ejh-user { font-size: 12px; font-weight: 600; }
.ejh-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.ejh-badge.ok  { background: #dcfce7; color: #15803d; }
.ejh-badge.ng  { background: #fee2e2; color: #dc2626; }
.ejh-badge.mix { background: #fff7ed; color: #c2410c; }
.ejh-badge.cfg { background: #eff6ff; color: #2563eb; }
.ejh-details { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.ejh-actions { display: flex; gap: 6px; }
.ejh-btn { padding: 3px 10px; border-radius: 5px; font-size: 11px; cursor: pointer; border: 1px solid var(--border); background: #fff; }
.ejh-btn.detail { color: var(--accent); border-color: var(--accent); }
.ejh-btn.modify { color: #7c3aed; border-color: #7c3aed; }
.ejh-btn.del    { color: #dc2626; border-color: #dc2626; }
.ejh-modified { font-size: 10px; color: var(--muted); font-style: italic; }
.ejh-empty { text-align: center; color: var(--muted); padding: 24px; font-size: 13px; }

/* bi-card 이력 버튼 */
.ej-hist-btn { padding: 4px 10px; border-radius: 6px; border: 1px solid #7c3aed;
                background: #fff; color: #7c3aed; font-size: 11px; cursor: pointer; }
.ej-hist-btn:hover { background: #f5f3ff; }
.ej-hist-btn.has-ng { border-color: #dc2626; color: #dc2626; }
.ej-hist-badge { padding: 4px 10px; border-radius: 6px; border: 1px solid #7c3aed;
                  background: #fff; color: #7c3aed; font-size: 11px; cursor: pointer;
                  white-space: nowrap; }
.ej-hist-badge:hover:not(:disabled) { background: #f5f3ff; }
.ej-hist-badge:disabled { opacity: .5; cursor: default; }
.ej-hist-badge.has-ng { border-color: #dc2626; color: #dc2626; }

/* eja 박스 */
.eja-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

/* ── 독스 검색 하이라이트 뱃지 ──────────────────── */
.docs-highlight-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(37, 99, 235, 0.88);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  z-index: 800;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  display: none;
}
