/* HUSS GGE Geo-Analysis — "Cadastral Light" Design System
   밝은 토지 인텔리전스 계측기: 농업 알마낙 + 지적측량 도면의 정밀함.
   ※ 모든 id/클래스 계약은 JS와 공유되므로 셀렉터명은 유지하고 스킨만 재정의한다. */

:root {
  /* ── Cadastral Light 팔레트 ── */
  --bg-primary: #F6F4EC;      /* 웜 페이퍼 */
  --bg-secondary: #FCFBF7;    /* 카드/서피스 */
  --panel-glass: #FFFFFF;     /* (구 글래스) → 솔리드 밝은 카드 */
  --panel-border: rgba(22, 33, 26, 0.10);
  --panel-hover-border: rgba(46, 90, 52, 0.45);

  --text-primary: #16211A;    /* 딥 포레스트 잉크 */
  --text-secondary: #5B6660;
  --text-muted: #97A09A;

  --accent: #2E5A34;          /* 필드 그린 */
  --accent-strong: #234527;
  --accent-glow: rgba(46, 90, 52, 0.10);
  --accent-2: #C1683F;        /* 테라코타 — 지적선·유휴 하이라이트 */
  --gold: #B8A24A;            /* 하비스트 골드 — 적합도 점수 */
  --blue-accent: #3E6E8E;     /* 슬레이트 블루 */
  --orange-accent: #C1683F;   /* 경고=테라코타 계열 */
  --red-accent: #B23A2E;      /* 유휴 강조(벽돌 적) */

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;

  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 8px 24px -12px rgba(22, 33, 26, 0.18);
  --shadow-soft: 0 2px 8px -3px rgba(22, 33, 26, 0.12);

  /* ── 타이포 스택 ── */
  --font-display: 'Fraunces', 'Pretendard', Georgia, serif;
  --font-body: 'Pretendard', 'Pretendard Variable', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, 'SFMono-Regular', monospace;
}

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

body {
  background-color: var(--bg-primary);
  /* 종이 위 지적 측량 그리드 — 아주 옅게 깔아 계측기의 도면 분위기를 만든다 */
  background-image:
    linear-gradient(rgba(22, 33, 26, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 33, 26, 0.028) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px;
  gap: 16px;
}

/* Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  color: var(--accent);
  width: 26px;
  height: 26px;
}

.logo-area h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.logo-area .accent {
  color: var(--accent);
  font-weight: 400;
  font-style: italic;
}

.project-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(46, 90, 52, 0.20);
  padding: 5px 11px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Main Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  flex: 1;
  gap: 16px;
  height: calc(100% - 75px);
  min-height: 0;
}

/* Sidebar & Content */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}

.content-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 16px;
  min-height: 0;
}

.sidebar-panel::-webkit-scrollbar {
  width: 5px;
}
.sidebar-panel::-webkit-scrollbar-thumb {
  background: rgba(22, 33, 26, 0.15);
  border-radius: 10px;
}

/* Card — 밝은 종이 카드 (글래스 제거) */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

/* 사이드바 카드 로드 시 staggered 등장 */
.sidebar-panel .card {
  animation: rise 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.sidebar-panel .card:nth-of-type(1) { animation-delay: 0.05s; }
.sidebar-panel .card:nth-of-type(2) { animation-delay: 0.10s; }
.sidebar-panel .card:nth-of-type(3) { animation-delay: 0.15s; }
.sidebar-panel .card:nth-of-type(4) { animation-delay: 0.20s; }
.sidebar-panel .card:nth-of-type(5) { animation-delay: 0.25s; }

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

.card:hover {
  border-color: var(--panel-hover-border);
  box-shadow: var(--shadow-premium);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--panel-border);
}

.card-icon {
  color: var(--accent);
  width: 18px;
  height: 18px;
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.card-body {
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
}

/* Controls */
.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.label-with-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label-with-value span {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 700;
}

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

.input-sub {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  transition: var(--transition-smooth);
}

.input-sub:focus-within {
  border-color: var(--accent);
  background: #fff;
}

.input-sub span {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-sub input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 100%;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  outline: none;
  font-weight: 500;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  background: rgba(22, 33, 26, 0.10);
  height: 5px;
  border-radius: 3px;
  outline: none;
}

/* Primary button */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 4px 12px -4px rgba(46, 90, 52, 0.45);
  transition: var(--transition-smooth);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 7px 16px -5px rgba(46, 90, 52, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: rgba(22, 33, 26, 0.14);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* Info alert */
.info-alert {
  display: flex;
  gap: 12px;
  background: rgba(184, 162, 74, 0.12);
  border: 1px solid rgba(184, 162, 74, 0.35);
  color: #7a6a24;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  margin-bottom: 16px;
}

.info-alert i {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.info-alert strong { color: #6a5c1f; }

.info-alert p {
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Diagnosis / placeholder */
.diagnosis-card {
  flex: 1;
}

.placeholder-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  flex: 1;
}

.placeholder-body p {
  font-size: 0.82rem;
  line-height: 1.55;
  margin-top: 16px;
}

.placeholder-body strong { color: var(--text-secondary); }

.placeholder-body code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent);
}

.large-icon {
  width: 46px;
  height: 46px;
  color: var(--text-muted);
  stroke-width: 1.4;
}

.large-icon.pulse {
  animation: marker-pulse 2.2s infinite ease-in-out;
}

@keyframes marker-pulse {
  0%, 100% { transform: scale(1); opacity: 0.45; }
  50% { transform: scale(1.12); opacity: 0.85; color: var(--accent); }
}

.result-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.4s ease-out;
}

/* Score */
.score-container {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  padding: 14px;
  border-radius: var(--radius-md);
}

.score-circle {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 4px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: rgba(184, 162, 74, 0.10);
}

#suitability-score {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent-strong);
  line-height: 1;
}

.score-label {
  font-size: 0.52rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.score-meta h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.score-meta p {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 3px;
}

/* Metrics grid */
.metrics-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-item {
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.metric-item .m-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.metric-item .m-value {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Report boxes */
.report-box {
  background: var(--bg-primary);
  border-left: 3px solid var(--accent);
  padding: 11px 14px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.report-box h3 {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.report-box p {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Map */
.map-card {
  position: relative;
  padding: 0;
}

.map-header {
  position: absolute;
  top: 12px;
  left: 50px;
  right: 12px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
  flex-wrap: wrap;
}

.tab-selectors {
  display: flex;
  background: rgba(252, 251, 247, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--panel-border);
  padding: 3px;
  border-radius: var(--radius-md);
  pointer-events: auto;
  box-shadow: var(--shadow-premium);
}

.map-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.map-tab:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(22, 33, 26, 0.05);
}

.map-tab.active {
  background: var(--accent);
  color: #fff;
}

.map-tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.opacity-control {
  background: rgba(252, 251, 247, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--panel-border);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-premium);
}

.opacity-control input {
  width: 80px;
}

#map-container {
  width: 100%;
  height: 100%;
  background-color: #E8E6DD;
  border-radius: var(--radius-lg);
}

/* Map legend */
.map-legend {
  position: absolute;
  bottom: 20px;
  right: 14px;
  z-index: 1000;
  background: rgba(252, 251, 247, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 11px;
  width: 184px;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-title {
  font-size: 0.64rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.legend-scale {
  height: 10px;
  border-radius: 5px;
  width: 100%;
  border: 1px solid var(--panel-border);
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text-secondary);
}

/* Charts */
.charts-container-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.chart-box {
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chart-box h3 {
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 8px;
}

.chart-element {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.chart-placeholder {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(246, 244, 236, 0.90);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  padding: 24px;
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.loading-overlay p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(46, 90, 52, 0.15);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* Helpers */
.hide {
  display: none !important;
}

/* Leaflet — light theme overrides */
.leaflet-container {
  background: #E8E6DD !important;
  font-family: var(--font-body) !important;
}
.leaflet-bar a {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--panel-border) !important;
}
.leaflet-bar a:hover {
  background-color: var(--bg-primary) !important;
  color: var(--accent) !important;
}
.leaflet-control-attribution {
  background: rgba(252, 251, 247, 0.75) !important;
  color: var(--text-muted) !important;
}
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--panel-border);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(22, 33, 26, 0.35);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.modal-card {
  width: 460px;
  max-width: 90%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background: var(--bg-secondary);
  box-shadow: 0 24px 60px -20px rgba(22, 33, 26, 0.35);
}

.settings-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
}

.dark-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  outline: none;
  transition: var(--transition-smooth);
}

.dark-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-secondary {
  flex: 1;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: #fff;
  color: var(--text-primary);
  border-color: var(--panel-hover-border);
}

/* Leaflet layer control — light */
.leaflet-control-layers {
  background: rgba(252, 251, 247, 0.94) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--panel-border) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-body) !important;
  box-shadow: var(--shadow-premium) !important;
  padding: 10px !important;
}

.leaflet-control-layers-list {
  font-size: 0.8rem;
}

.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.leaflet-control-layers-separator {
  border-top: 1px solid var(--panel-border) !important;
  margin: 8px 0 !important;
}

.leaflet-control-layers input[type="radio"],
.leaflet-control-layers input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── 유휴농지 배너 ──────────────────────────────── */
.idle-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.idle-banner.idle-positive {
  background: rgba(178, 58, 46, 0.10);
  border-color: rgba(178, 58, 46, 0.35);
}

.idle-banner.idle-negative {
  background: var(--accent-glow);
  border-color: rgba(46, 90, 52, 0.35);
}

.idle-banner.idle-neutral {
  background: rgba(184, 162, 74, 0.12);
  border-color: rgba(184, 162, 74, 0.40);
}

.idle-banner > span:first-child {
  font-size: 1.6rem;
  line-height: 1;
}

.idle-banner > div {
  flex: 1;
}

.idle-banner strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.idle-confidence-badge {
  background: rgba(22, 33, 26, 0.06);
  border: 1px solid var(--panel-border);
  border-radius: 50px;
  padding: 2px 9px;
  font-size: 0.7rem;
  white-space: nowrap;
  color: var(--text-secondary);
}

/* ── 필지 정보 그리드 ───────────────────────────── */
.parcel-info-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}

.parcel-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 11px;
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
}

.pi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pi-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 700;
  text-align: right;
  word-break: break-all;
}

/* ── 라우트 네비게이션 ──────────────────────────── */
.route-nav {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 5px;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: var(--shadow-soft);
}

.route-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 2px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.route-tab i {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.route-tab:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.route-tab.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--panel-hover-border);
}

/* 라우트 뷰: 로딩 오버레이 기준 컨테이너 */
.view {
  position: relative;
}

/* 차트 패널: 분석 라우트에서만 노출 */
.charts-card {
  height: 280px;
}

/* ── 드론 상세 분석 뷰 (js/drone.js + index.html #view-drone) ──────────
   실제 사용 클래스에 대응하는 스타일. 통계 표는 공용 .metric-item 재사용. */

/* 제품 가용성 배지 (DSM/DTM/정사/멀티스펙트럴) */
.drone-site {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.drone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  border: 1px solid var(--panel-border);
  letter-spacing: 0.2px;
}

.chip-on {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: rgba(46, 90, 52, 0.30);
}

.chip-off {
  background: transparent;
  color: var(--text-muted);
  border-style: dashed;
}

.drone-hint {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.5;
}

/* 레이어 토글 (RGB/DSM/DTM/CHM/경사/거칠기/식생/배수) */
.drone-layer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drone-layer-tab {
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  padding: 6px 11px;
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.drone-layer-tab:hover {
  color: var(--text-primary);
  border-color: var(--panel-hover-border);
}

.drone-layer-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 3px 8px -3px rgba(46, 90, 52, 0.5);
}

/* 경고 박스 — 골드 톤 */
.drone-warnings {
  margin-top: 12px;
  padding: 10px 13px;
  background: rgba(184, 162, 74, 0.12);
  border: 1px solid rgba(184, 162, 74, 0.35);
  border-radius: var(--radius-md);
  font-size: 0.74rem;
  line-height: 1.55;
  color: #7a6a24;
}

/* ── 농지 추천 뷰 (js/recommend.js + #view-recommend) ────────────── */
.recommend-summary {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.recommend-summary strong { color: var(--text-primary); }

/* 추천 후보 물방울 핀 (Leaflet divIcon) — 기본 흰 박스 제거 + 드롭섀도 */
.gge-pin { background: transparent !important; border: 0 !important; }
.gge-pin svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35)); }

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

.recommend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-body);
  transition: var(--transition-smooth);
  animation: fadeIn 0.3s ease-out;
}

.recommend-item:hover {
  border-color: var(--panel-hover-border);
  box-shadow: var(--shadow-soft);
  transform: translateX(2px);
}

.ri-rank {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  width: 22px;
  flex-shrink: 0;
  text-align: center;
}

.ri-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.ri-jibun {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ri-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* 조건부 등급 칩 (골드) */
.chip.grade-mid {
  background: rgba(184, 162, 74, 0.15);
  color: #7a6a24;
  border-color: rgba(184, 162, 74, 0.40);
  white-space: nowrap;
}

/* 추천 옵션 (지목·우선순위 다중선택) */
.option-group {
  margin-bottom: 14px;
}
.option-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}
.option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.option-chip {
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.option-chip:hover { color: var(--text-primary); border-color: var(--panel-hover-border); }
.option-chip.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--panel-hover-border);
}

/* 예산 프리셋 버튼 */
.budget-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.budget-preset {
  flex: 1;
  min-width: 56px;
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  padding: 6px 8px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.budget-preset:hover { color: var(--text-primary); border-color: var(--panel-hover-border); }
.budget-preset.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--panel-hover-border);
}

/* 예산 초과 후보: 흐리게 + 태그 */
.recommend-item.over-budget { opacity: 0.55; }
.over-tag {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--accent-2);
  background: rgba(193, 104, 63, 0.12);
  border: 1px solid rgba(193, 104, 63, 0.35);
  border-radius: 50px;
  padding: 1px 7px;
  margin-left: 4px;
}

/* ── 작물 소득 뷰 (js/crop.js + #view-crop) ───────────────────── */
.crop-subtabs { display: flex; gap: 6px; margin-top: 4px; }
.crop-subtab {
  flex: 1;
  padding: 8px 6px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.crop-subtab:hover { color: var(--text-primary); border-color: var(--panel-hover-border); }
.crop-subtab.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--panel-hover-border);
}
.crop-income-title {
  font-family: var(--font-display, inherit);
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.crop-sub { color: var(--text-muted); font-size: 0.72rem; font-weight: 400; }
.metric-item.crop-income-hi {
  background: var(--accent-glow);
  border: 1px solid var(--panel-hover-border);
  border-radius: var(--radius-sm);
}
.metric-item.crop-income-hi .m-value { color: var(--accent); font-weight: 700; }

/* ══════════════════════════════════════════════════════════════
   내일귀농 홈 온보딩 — 밝은(Cadastral Light) 전체화면 + 구글식 검색 폼
   ══════════════════════════════════════════════════════════════ */
#home-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  background-image:
    radial-gradient(circle at 50% 22%, rgba(46, 90, 52, 0.10), transparent 55%),
    linear-gradient(rgba(22, 33, 26, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 33, 26, 0.028) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  overflow-y: auto;
  padding: 40px 20px;
}
#home-overlay.hide { display: none; }

.home-hero {
  width: 100%;
  max-width: 620px;
  text-align: center;
  color: var(--text-primary);
}

.home-brand {
  font-family: var(--font-display, 'Fraunces', serif);
  font-size: clamp(2.8rem, 8vw, 4.6rem);
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}
.home-brand i { width: 0.9em; height: 0.9em; color: var(--accent); }
.home-brand span { color: var(--accent); font-style: italic; }

.home-tagline {
  margin: 18px 0 30px;
  font-size: 1.02rem;
  color: var(--text-secondary);
  word-break: keep-all;   /* 한글 단어 중간 줄바꿈 방지 */
  text-wrap: balance;     /* 줄 길이 균형(어색한 한 단어 넘김 완화) */
}
.home-tagline strong { color: var(--text-primary); }

/* 구글식 알약형 검색바 (밝은 테마) */
.home-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  padding: 6px 22px;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}
.home-search:focus-within { border-color: var(--accent); box-shadow: 0 10px 30px -8px rgba(46, 90, 52, 0.3); }
.home-search .home-won { font-size: 1.5rem; color: var(--accent); font-weight: 700; }
#home-salary {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono, monospace);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 12px 4px;
  text-align: right;
  min-width: 0;
}
#home-salary::placeholder { color: var(--text-muted); font-weight: 400; font-size: 1.1rem; }
.home-search .home-unit { font-size: 1.1rem; color: var(--text-secondary); font-weight: 600; }

/* 필터 칩 행 */
.home-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 8px;
}
#home-region.dark-input {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--panel-border);
  border-radius: 50px;
  padding: 9px 16px;
  font-size: 0.85rem;
  cursor: pointer;
}
.home-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 50px;
  background: var(--bg-secondary);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.home-chk input { accent-color: var(--accent); cursor: pointer; }
.home-chk:has(input:checked) {
  background: var(--accent-glow);
  border-color: var(--panel-hover-border);
  color: var(--accent);
}

.home-cta {
  margin-top: 20px;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 50px;
}
.home-skip {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
}
.home-skip:hover { color: var(--text-secondary); text-decoration: underline; }

/* 결과(필요면적 역산) */
.home-result {
  margin-top: 26px;
  background: var(--bg-secondary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  text-align: left;
}
.home-best { font-size: 1.05rem; color: var(--text-primary); line-height: 1.6; text-align: center; }
.home-best-crop { color: var(--accent); font-weight: 700; font-size: 1.2rem; }
.home-best-income { display: inline-block; margin-top: 8px; font-size: 0.95rem; color: var(--text-primary); }
.home-best-income strong { color: var(--accent); }
.home-best .home-sub { color: var(--text-muted); font-size: 0.85rem; }
.home-alts { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.home-alt {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 7px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
}
.home-note { margin-top: 12px; font-size: 0.72rem; color: var(--text-muted); text-align: center; }

/* ── 투자·지원금 뷰 ─────────────────────────────── */
.fin-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.metric-item.fin-total {
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.metric-item.fin-total .m-value { color: var(--text-primary); font-weight: 700; }
.fin-net { display: flex; flex-direction: column; gap: 4px; }
.fin-net-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-secondary); padding: 4px 2px; }
.fin-net-row.fin-net-hi {
  font-size: 1.05rem; font-weight: 700; color: var(--accent);
  background: var(--accent-glow); border: 1px solid var(--panel-hover-border);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 4px;
}
.fin-loans { margin-top: 8px; font-size: 0.74rem; color: var(--blue-accent); }
.fin-loan-note { color: var(--text-muted); }
.fin-subsidies { display: flex; flex-direction: column; gap: 7px; }
.fin-sub {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--bg-secondary); border: 1px solid var(--panel-border);
  cursor: pointer;
}
.fin-sub.on { border-color: var(--panel-hover-border); background: var(--accent-glow); }
.fin-sub input { margin-top: 3px; accent-color: var(--accent); }
.fin-sub-main { display: flex; flex-direction: column; gap: 2px; }
.fin-sub-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.fin-sub-tag {
  font-style: normal; font-size: 0.64rem; font-weight: 700; color: var(--accent);
  background: var(--accent-glow); border-radius: 50px; padding: 1px 7px; margin-left: 2px;
}
.fin-elig { font-size: 0.62rem; color: var(--gold); font-weight: 700; }
.fin-sub-note { font-size: 0.7rem; color: var(--text-muted); line-height: 1.4; }

/* 추천 가중치 슬라이더 */
.weight-sliders { display: flex; flex-direction: column; gap: 8px; }
.wslider { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--text-secondary); }
.wslider span { flex: 0 0 76px; }
.wslider input[type="range"] { flex: 1; accent-color: var(--accent); }
.wslider b { flex: 0 0 26px; text-align: right; color: var(--accent); font-family: var(--font-mono, monospace); }

/* ── 종합 진단: 위성+드론 통합 귀농 지수 (report 뷰) ───────────── */
.synth-block {
  background: var(--bg-primary);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}
.synth-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.synth-score-wrap {
  flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%;
  border: 5px solid var(--accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--accent-glow);
}
#synth-score {
  font-family: var(--font-display, serif);
  font-size: 1.9rem; font-weight: 700; line-height: 1;
  color: var(--accent-strong, var(--accent));
}
.synth-score-label { font-size: 0.56rem; color: var(--text-secondary); margin-top: 2px; }
.synth-hero-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.synth-hero-meta #synth-summary { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; }
.synth-radar { width: 100%; min-height: 300px; }

/* 사이드바 카드 압축 방지 — 워크플로가 카드 여러 개를 동시에 펼쳐도 각 카드는 자연 높이를 유지하고
   사이드바가 통째로 스크롤된다. (전역 .card 아님 — 중앙 지도/차트 카드는 flex 압축이 필요하므로 스코프) */
.sidebar-panel .card { flex-shrink: 0; }
.sidebar-panel .card-body { overflow-y: visible; }
.synth-bars { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.synth-bar-row { display: flex; align-items: center; gap: 10px; }
.sb-label { flex: 0 0 92px; font-size: 0.75rem; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.sb-drone {
  font-size: 0.56rem; font-weight: 700; color: var(--accent-2);
  background: rgba(193,104,63,0.12); border: 1px solid rgba(193,104,63,0.30);
  border-radius: 50px; padding: 0 5px;
}
.sb-track { flex: 1; height: 8px; background: rgba(22,33,26,0.07); border-radius: 5px; overflow: hidden; }
.sb-fill { display: block; height: 100%; border-radius: 5px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }
.sb-val { flex: 0 0 28px; text-align: right; font-family: var(--font-mono, monospace); font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════════════
   워크플로 모달 (#wf-modal) — 지도 위 큰 팝업. .modal-overlay/.modal-card 재사용.
   ══════════════════════════════════════════════════════════════════ */
.wf-card {
  width: 680px; max-width: 94%; max-height: 88vh;
  display: flex; flex-direction: column;
  padding: 20px 22px;
}
.wf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.wf-steps { display: flex; align-items: center; gap: 8px; font-size: 0.74rem; color: var(--text-muted); }
.wf-step { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.wf-step b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--panel-border); color: var(--text-secondary); font-size: 0.7rem;
}
.wf-step.on { color: var(--accent); }
.wf-step.on b { background: var(--accent); color: #fff; }
.wf-step-arrow { color: var(--text-muted); }
.wf-close {
  background: transparent; border: none; cursor: pointer;
  font-size: 1.05rem; color: var(--text-muted); line-height: 1;
  padding: 4px 6px; border-radius: var(--radius-sm);
}
.wf-close:hover { color: var(--text-primary); background: var(--bg-primary); }
.wf-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin-bottom: 12px; color: var(--text-primary); }
.wf-body { overflow-y: auto; flex: 1; min-height: 0; }
.wf-actions { display: flex; gap: 10px; margin-top: 16px; }
.wf-actions .btn-primary, .wf-actions .btn-secondary { flex: 1; }

.wf-sub { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 10px; }
.wf-note { font-size: 0.76rem; color: var(--text-muted); margin-top: 12px; line-height: 1.5; }
.wf-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 0; color: var(--text-secondary); }
.wf-empty { padding: 30px 0; text-align: center; color: var(--text-secondary); }

/* Step 1a 내 조건(상세조건) */
.wf-prof {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; margin-bottom: 14px; font-size: 0.82rem; color: var(--text-secondary);
  background: var(--accent-glow); border: 1px solid var(--panel-border); border-radius: var(--radius-md);
}
.wf-prof b { color: var(--text-primary); }
.wf-prof-edit { background: transparent; border: none; color: var(--accent); font-weight: 600; font-size: 0.78rem; cursor: pointer; white-space: nowrap; }
.wf-prof-edit:hover { text-decoration: underline; }
.wf-cond-h { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }

/* 후보 리스트 */
.wf-cand-list { display: flex; flex-direction: column; gap: 7px; }
.wf-cand {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--bg-primary); border: 1px solid var(--panel-border);
  border-radius: var(--radius-md); padding: 10px 12px; cursor: pointer;
  transition: var(--transition-smooth); font-family: var(--font-body);
}
.wf-cand:hover { border-color: var(--panel-hover-border); }
.wf-cand.sel { border-color: var(--accent); background: var(--accent-glow); box-shadow: 0 0 0 1px var(--accent) inset; }
.wf-cand-rank {
  flex: 0 0 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border-radius: 50%; font-size: 0.74rem; font-weight: 700;
}
.wf-cand-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wf-cand-title { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); }
.wf-cand-sub { font-size: 0.74rem; color: var(--text-secondary); }
.wf-cand-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.wf-cand-score { font-family: var(--font-mono, monospace); font-weight: 700; color: var(--accent); font-size: 0.9rem; }
.wf-badge { font-size: 0.6rem; font-weight: 700; padding: 1px 6px; border-radius: 50px; }
.wf-badge.idle { background: rgba(178,58,46,0.12); color: var(--red-accent); }
.wf-badge.active { background: rgba(46,90,52,0.12); color: var(--accent); }

/* 선택 후보 위성 radar */
.wf-radar-wrap { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--panel-border); }
.wf-radar { width: 100%; }

/* 작물 섹션 */
.wf-crops { margin-top: 14px; padding: 12px; background: var(--bg-primary); border: 1px solid var(--panel-border); border-radius: var(--radius-md); }
.wf-crops-h { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.wf-crop { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 0; font-size: 0.82rem; color: var(--text-secondary); }
.wf-crop-best { color: var(--text-primary); }
.wf-crop-jump { margin-top: 8px; background: transparent; border: none; color: var(--accent); font-weight: 600; font-size: 0.78rem; cursor: pointer; padding: 2px 0; text-align: left; }
.wf-crop-jump:hover { text-decoration: underline; }

/* Step 2 스포트라이트 */
.wf-score-hero { display: flex; align-items: center; gap: 18px; padding: 6px 0 14px; }
.wf-score-num { font-family: var(--font-display); font-size: 3rem; font-weight: 700; color: var(--accent); line-height: 1; }
.wf-score-num span { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-left: 2px; }
.wf-score-meta { display: flex; flex-direction: column; gap: 4px; }
.wf-score-grade { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.wf-score-src { font-size: 0.78rem; color: var(--text-secondary); }
.wf-delta { font-size: 0.76rem; font-weight: 700; }
.wf-delta.up { color: var(--accent); }
.wf-delta.down { color: var(--red-accent); }
.wf-metrics { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.wf-metric { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 12px; background: var(--bg-primary); border: 1px solid var(--panel-border); border-radius: var(--radius-md); }
.wf-metric-l { font-size: 0.8rem; color: var(--text-secondary); }
.wf-metric-v { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════════════
   반응형 — 태블릿/폰. 데스크톱 셀렉터·계약은 유지하고 좁은 화면에서만 오버라이드.
   좁아지면 그리드(사이드바 360px + 지도)를 세로 스택으로 전환하고,
   고정 100vh 대신 페이지 자연 스크롤을 허용한다. 지도를 맨 위로 올린다.
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* 고정 뷰포트 높이 해제 → 콘텐츠 길이만큼 페이지가 스크롤 */
  .app-container { height: auto; min-height: 100vh; padding: 10px; }

  /* 사이드바+지도 2열 → 1열 스택 */
  .dashboard-grid { grid-template-columns: 1fr; height: auto; }

  /* 지도를 맨 위로 (추천 흐름: 지도 → 리스트) */
  .content-panel { order: -1; display: block; }
  .content-panel > .charts-card { margin-top: 16px; }

  /* 스택 시 1fr가 붕괴하므로 지도 높이를 명시 */
  .map-card { height: 52vh; min-height: 320px; }

  /* 사이드바 내부 스크롤 대신 페이지 스크롤에 맡김 */
  .sidebar-panel { overflow: visible; min-height: 0; }

  /* 차트 2개 좌우 → 세로 스택 */
  .charts-container-grid { grid-template-columns: 1fr; }
  .charts-card { height: auto; }

  /* 라우트 탭(8개): 6열 → 4열×2행, sticky 해제(지도와 겹침 방지) */
  .route-nav { grid-template-columns: repeat(4, 1fr); position: static; }

  /* 헤더 줄바꿈 허용 */
  .main-header { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
}

@media (max-width: 520px) {
  .logo-area h1 { font-size: 1.1rem; }
  .project-info { gap: 8px; }
  .project-info .badge { font-size: 0.66rem; padding: 4px 9px; }

  .map-card { height: 46vh; min-height: 280px; }
  .map-header { left: 44px; top: 8px; }

  /* 좁은 화면에선 투명도 슬라이더 숨김(공간 확보; 기능 필수 아님) */
  .opacity-control { display: none; }

  .map-legend { width: 150px; padding: 8px; }
  .map-legend .legend-title { font-size: 0.58rem; }

  .route-nav { gap: 3px; padding: 4px; }
  .route-tab { font-size: 0.6rem; padding: 7px 1px; }

  #home-overlay { padding: 28px 14px; }

  /* 모바일 홈: 브랜드·문구·연봉 입력줄 축소(줄바뀜/클리핑 완화) */
  .home-brand { font-size: clamp(2.2rem, 11vw, 2.8rem); }
  .home-tagline { font-size: 0.92rem; margin: 14px 0 22px; }
  .home-search { padding: 4px 14px; }
  .home-search .home-won { font-size: 1.2rem; }
  #home-salary { font-size: 1.2rem; padding: 10px 2px; }
  #home-salary::placeholder { font-size: 0.9rem; }
  .home-search .home-unit { font-size: 0.9rem; }

  /* 워크플로 모달: 폰에서 거의 전체화면 */
  .wf-card { width: 96%; max-height: 92vh; padding: 16px 14px; }
  .wf-title { font-size: 1.02rem; }
  .wf-steps { font-size: 0.68rem; gap: 5px; }
  .wf-score-num { font-size: 2.4rem; }
  .wf-actions { flex-direction: column; }
}
