/* LandRadar WebUIUXMaster Premium Design System (Light & Dark Dual Mode) */

:root {
  /* Dark Theme (Executive Navy Slate) - Default */
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #e0f2fe;
  --accent: #2563eb;
  --bg-main: #0b1120;
  --bg-header: rgba(11, 17, 32, 0.92);
  --bg-card: #111c34;
  --bg-card-hover: #172544;
  --bg-subtle: #0d1628;
  --border-color: #1e293b;
  --border-active: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;
  --badge-green-bg: rgba(16, 185, 129, 0.15);
  --badge-green-text: #34d399;
  --badge-yellow-bg: rgba(245, 158, 11, 0.15);
  --badge-yellow-text: #fbbf24;
  --badge-red-bg: rgba(239, 68, 68, 0.15);
  --badge-red-text: #f87171;
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --spring-curve: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme (Clean Light Modern) */
[data-theme="light"] {
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #e0f2fe;
  --accent: #1d4ed8;
  --bg-main: #f8fafc;
  --bg-header: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-active: #0284c7;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #334155;
  --badge-green-bg: #ecfdf5;
  --badge-green-text: #059669;
  --badge-yellow-bg: #fffbeb;
  --badge-yellow-text: #d97706;
  --badge-red-bg: #fef2f2;
  --badge-red-text: #dc2626;
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.25s var(--spring-curve), color 0.25s var(--spring-curve);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  letter-spacing: -0.2px;
}

/* Global Header */
.global-header {
  height: 64px;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  transition: background 0.25s var(--spring-curve), border-color 0.25s var(--spring-curve);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  transition: transform 0.2s var(--spring-curve);
}

.brand-link:active {
  transform: scale(0.97);
}

.brand-logo {
  height: 36px;
  width: auto;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-search-bar {
  flex: 1;
  max-width: 480px;
  margin: 0 16px;
  position: relative;
}

.search-input-group {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 14px;
  transition: border-color 0.2s var(--spring-curve), box-shadow 0.2s var(--spring-curve);
}

.search-input-group:focus-within {
  border-color: var(--border-active);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.btn-search {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s var(--spring-curve), transform 0.15s var(--spring-curve);
}

.btn-search:hover {
  background: var(--primary-dark);
}

.btn-search:active {
  transform: scale(0.96);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-subtle);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1001;
  display: none;
}

.search-dropdown.active {
  display: block;
}

.dropdown-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s var(--spring-curve);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
}

.dropdown-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--spring-curve);
}

.btn-theme-toggle:hover {
  border-color: var(--border-active);
}

.btn-theme-toggle:active {
  transform: scale(0.95);
}

.btn-header-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--spring-curve);
}

.btn-header-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  color: var(--text-main);
}

.btn-header-action:active {
  transform: scale(0.96);
}

.btn-report {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--spring-curve), opacity 0.15s;
}

.btn-report:hover {
  opacity: 0.95;
  transform: translateY(-2px);
}

.btn-report:active {
  transform: scale(0.97);
}

/* Layout */
.main-container {
  display: grid;
  grid-template-columns: 1fr 500px;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Map Section */
.map-section {
  position: relative;
  width: 100%;
  height: 100%;
}

#map-view {
  width: 100%;
  height: 100%;
  background: var(--bg-main);
}

.map-control-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-header);
  backdrop-filter: blur(8px);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
}

.radius-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.radius-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.radius-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--spring-curve);
}

.radius-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.radius-btn:active {
  transform: scale(0.95);
}

.map-legend {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-top: 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Side Intelligence Panel */
.side-panel {
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-subtle);
}

.location-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.target-address {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.location-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-bookmark-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #f59e0b;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--spring-curve);
  white-space: nowrap;
}

.btn-bookmark-toggle:hover {
  border-color: #f59e0b;
}

.btn-bookmark-toggle:active {
  transform: scale(0.95);
}

.target-district-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.score-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.score-card-mini {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  box-shadow: var(--inset-highlight);
}

.score-mini-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.score-mini-value {
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 2px;
}

/* Filter Toolbar */
.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.filter-controls-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.filter-select {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all 0.2s var(--spring-curve);
  font-family: inherit;
  height: 36px;
}

.filter-select:hover {
  border-color: var(--border-active);
}

.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.filter-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-filter-reset {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0 12px;
  height: 36px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--spring-curve);
  font-family: inherit;
}

.btn-filter-reset:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.btn-filter-apply {
  background: var(--primary);
  border: none;
  color: #ffffff;
  padding: 0 14px;
  height: 36px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--spring-curve);
  font-family: inherit;
}

.btn-filter-apply:hover {
  background: var(--primary-dark);
}

/* Premium Segmented Control Tabs */
.intelligence-tabs {
  display: flex;
  background: var(--bg-subtle);
  padding: 5px;
  border-radius: 12px;
  gap: 4px;
  margin: 0 16px 14px 16px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s var(--spring-curve);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Tab Content */
.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-pane.active {
  display: flex;
}

/* Cards & Lists */
/* Cards & Lists (Enterprise Compact Feed & Expandable Detail) */
.radar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s var(--spring-curve);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radar-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.radar-card.active-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

/* 1행: 헤더 메타 (지자체, 분류 태그, 거리, 경보 뱃지) */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card-tags-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.card-district-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: -0.2px;
}

[data-theme="dark"] .card-district-tag {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
}

.card-type-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--bg-subtle);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.card-distance-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 2행: 선명한 B2B 헤드라인 타이틀 */
.card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.45;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.card-title:hover {
  color: var(--primary);
}

/* 3행: AI 1줄 핵심 요약 */
.card-summary {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 4행: 컴팩트 하단 요약 바 */
.card-compact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2px;
}

.card-prob-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 200px;
}

.prob-mini-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.prob-mini-track {
  flex: 1;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.prob-mini-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #38bdf8, #0284c7);
}

.prob-mini-val {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
}

.card-footer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage-badge-mini {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-sub);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.btn-card-toggle {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--spring-curve);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-card-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* ==================== 아코디언 상세 분석 섹션 ==================== */
.card-detail-section {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
  margin-top: 4px;
  animation: fadeInDetail 0.25s ease-out;
}

.card-detail-section.expanded {
  display: flex;
}

@keyframes fadeInDetail {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* AI 핵심 발언록 말풍선 그룹 */
.transcript-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.transcript-heading {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-sub);
  letter-spacing: -0.2px;
}

.speech-bubble-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-main);
  line-height: 1.45;
}

.speech-speaker {
  font-weight: 700;
  color: var(--primary);
  margin-right: 6px;
  font-size: 0.78rem;
}

/* 카드 내 위치 이동 버튼 바 */
.card-action-bar-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.btn-focus-map {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--spring-curve);
  font-family: inherit;
}

.btn-focus-map:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-active);
}

/* 5단계 안건 타임라인 트래커 */
.timeline-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 12px 0 8px 0;
  padding: 0 4px;
}

.timeline-stepper::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--border-color);
  z-index: 1;
}

.timeline-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s var(--spring-curve);
}

.timeline-step.completed .timeline-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.timeline-step.current .timeline-dot {
  background: var(--accent);
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  color: #ffffff;
}

.timeline-step-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-step.completed .timeline-step-label {
  color: var(--text-sub);
}

.timeline-step.current .timeline-step-label {
  color: var(--primary);
  font-weight: 700;
}

.card-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.btn-card-detail {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--spring-curve);
}

.btn-card-detail:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-card-detail:active {
  transform: scale(0.96);
}

/* 4축 레이더 차트 컨테이너 */
.radar-chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--inset-highlight);
}

.chart-canvas-container {
  width: 100%;
  max-width: 360px;
  height: 240px;
  position: relative;
}

/* Soil Carfax Styles */
.carfax-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: var(--inset-highlight);
}

.carfax-grade-badge {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.carfax-score-desc {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-top: 6px;
}

.carfax-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.carfax-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  box-shadow: var(--inset-highlight);
}

.metric-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.metric-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.factor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.factor-item {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.factor-item.positive {
  background: var(--badge-green-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--badge-green-text);
}

.factor-item.risk {
  background: var(--badge-red-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--badge-red-text);
}

/* Waste Matcher Styles */
.waste-simulator-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--inset-highlight);
}

.sim-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.sim-select, .sim-input {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
}

.sim-select {
  flex: 1.4;
}

.sim-input {
  flex: 1;
}

.btn-match {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--spring-curve);
}

.btn-match:hover {
  background: var(--primary-dark);
}

.btn-match:active {
  transform: scale(0.96);
}

.esg-banner {
  background: var(--badge-green-bg);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  color: var(--badge-green-text);
  font-size: 0.78rem;
  padding: 10px;
  border-radius: 8px;
  margin-top: 10px;
  line-height: 1.4;
}

/* Modals & Bottom Sheet for Mobile */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalScaleUp 0.25s var(--spring-curve);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.bottom-sheet-handle {
  display: none;
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  margin: 8px auto 0 auto;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-subtle);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  color: var(--text-main);
  font-size: 0.9rem;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-subtle);
}

.btn-print {
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-toast {
  background: var(--bg-card);
  border: 1px solid var(--primary);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-subtle);
  animation: slideUpToast 0.25s var(--spring-curve);
}

@keyframes slideUpToast {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 모바일 전용 5대 Ergonomics: 하단 고정 네비게이션 바 (Bottom Nav) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  z-index: 1500;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s var(--spring-curve);
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

/* Responsive & Mobile Protection */
@media (max-width: 960px) {
  .main-container {
    grid-template-columns: 1fr;
    grid-template-rows: 360px 1fr;
    height: auto;
    overflow: visible;
  }
  .side-panel {
    border-left: none;
    border-top: 1px solid var(--border-color);
    height: auto;
    min-height: 500px;
    padding-bottom: 70px;
  }
  .header-search-bar {
    max-width: 240px;
    margin: 0 8px;
  }
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: block;
  }
  .global-header {
    padding: 0 12px;
    height: 56px;
  }
  .brand-title {
    display: none;
  }
  .btn-header-action span {
    display: none;
  }
  .btn-report span {
    display: none;
  }
  .map-control-overlay {
    top: 8px;
    left: 8px;
    right: 8px;
  }
  .main-container {
    grid-template-rows: 280px 1fr;
  }

  /* 모바일 원핸드 바텀 시트 전환 */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-container {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    animation: slideUpBottomSheet 0.3s var(--spring-curve);
  }
  .bottom-sheet-handle {
    display: block;
  }
  @keyframes slideUpBottomSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}

/* Print Styling */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .global-header, .map-section, .panel-tabs, .modal-footer, .btn-close-modal, .toast-container, .filter-toolbar, .mobile-bottom-nav {
    display: none !important;
  }
  .modal-backdrop {
    position: static !important;
    background: none !important;
    display: block !important;
    padding: 0 !important;
  }
  .modal-container {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    background: #ffffff !important;
    color: #000000 !important;
  }
  .radar-card, .carfax-hero, .carfax-metric-card, .esg-banner {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #000000 !important;
  }
}

/* ==================== 상단 종합 인텔리전스 대시보드 위젯 ==================== */

.location-subtitle {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.main-dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  margin: 12px 16px 16px 16px;
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--spring-curve);
}

.main-dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #6366f1, #10b981);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.dashboard-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-dashboard-fold-toggle {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--spring-curve);
  font-family: inherit;
}

.btn-dashboard-fold-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
  border-color: var(--border-active);
}

.dashboard-slim-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.slim-item b {
  font-weight: 800;
}

.slim-sep {
  color: var(--border-color);
  font-weight: bold;
}

.dashboard-foldable-body {
  transition: all 0.3s var(--spring-curve);
}

.dashboard-foldable-body.folded {
  display: none;
}

.dashboard-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-bottom: 4px;
}

[data-theme="dark"] .dashboard-tag {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
}

.dashboard-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.grade-badge-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grade-badge-hero {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.grade-aaa { background: linear-gradient(135deg, #10b981, #059669); color: #ffffff; }
.grade-aa  { background: linear-gradient(135deg, #0284c7, #2563eb); color: #ffffff; }
.grade-a   { background: linear-gradient(135deg, #38bdf8, #0284c7); color: #ffffff; }
.grade-bbb { background: linear-gradient(135deg, #f59e0b, #d97706); color: #ffffff; }
.grade-bb  { background: linear-gradient(135deg, #f97316, #ea580c); color: #ffffff; }
.grade-b   { background: linear-gradient(135deg, #ef4444, #dc2626); color: #ffffff; }

.grade-meta {
  display: flex;
  flex-direction: column;
}

.grade-score-hero {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.grade-status-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 520px) {
  .dashboard-grid {
    grid-template-columns: 180px 1fr;
    align-items: center;
  }
}

.radar-canvas-container {
  height: 180px;
  position: relative;
  width: 100%;
}

.dashboard-metrics-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-meter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meter-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.meter-name {
  color: var(--text-sub);
  font-weight: 600;
}

.meter-score {
  font-weight: 800;
}

.meter-bar-track {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.meter-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--spring-curve);
}

.dashboard-summary-banner {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.5;
  border-left: 3px solid var(--primary);
}

/* 펄스 애니메이션 */
@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; box-shadow: 0 0 24px #38bdf8; }
  100% { transform: scale(1); opacity: 1; }
}

.btn-filter-reset {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0 12px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-filter-reset:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.section-subheading {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.empty-hint {
  padding: 16px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: 8px;
  border: 1px dashed var(--border-color);
}

.sub-header-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.bookmark-item-card, .history-item-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.btn-delete-bookmark {
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-delete-bookmark:hover {
  background: rgba(239, 68, 68, 0.1);
}

.waste-match-card-primary {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.15);
}

.match-best-tag {
  background: #0284c7;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ==================== 사이트 글로벌 푸터 및 연소프트 회사 정보 / 배너 ==================== */

.site-footer {
  margin-top: 24px;
  padding: 20px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: calc(76px + env(safe-area-inset-bottom));
}

@media (min-width: 1025px) {
  .site-footer {
    margin-bottom: 20px;
  }
}

.footer-customer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.footer-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.footer-link-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.footer-link-btn.highlight {
  color: var(--primary);
  font-weight: 700;
}

.footer-sep {
  color: var(--border-color);
  font-size: 0.75rem;
}

.footer-company-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 769px) {
  .footer-company-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.company-info-block {
  flex: 1;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.company-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.company-details a {
  color: var(--primary);
  text-decoration: none;
}

.company-details a:hover {
  text-decoration: underline;
}

.company-copyright {
  margin-top: 6px;
  font-size: 0.72rem;
  opacity: 0.8;
}

.company-ad-widget {
  width: 100%;
  max-width: 320px;
  flex-shrink: 0;
}

.ad-widget-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.banner-frame-container {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #ffffff;
  line-height: 0;
}

.banner-frame-container iframe {
  display: block;
  border: none;
}

/* ==================== 고객 지원 문서 & 문의 모달 전용 스타일 ==================== */

.customer-doc-content {
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.6;
}

.doc-section {
  margin-bottom: 20px;
}

.doc-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  border-left: 3px solid var(--primary);
  padding-left: 8px;
}

.doc-p {
  margin-bottom: 8px;
}

.doc-ul {
  padding-left: 20px;
  margin: 6px 0 12px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-faq-item {
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border-subtle);
}

.doc-faq-q {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.doc-faq-a {
  color: var(--text-sub);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* 문의하기 폼 */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.required-star {
  color: #ef4444;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-main);
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 42px;
}

.form-textarea {
  min-height: 90px;
  resize: vertical;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-help-text {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.form-checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.checkbox-label {
  font-size: 0.8rem;
  color: var(--text-sub);
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.btn-primary-action {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s var(--spring-curve), transform 0.15s ease;
  min-height: 44px;
}

.btn-primary-action:hover {
  background: var(--primary-hover);
}

.btn-primary-action:active {
  transform: scale(0.97);
}
