/* ================================================
   배스맵 - 메인 스타일시트
   Dark Mode First / Mobile Optimized
   ================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;900&family=Inter:wght@400;600;700&display=swap');

/* ---- CSS 변수 (디자인 토큰) ---- */
:root {
  --bg-primary:     #0d1b2a;
  --bg-secondary:   #112236;
  --bg-card:        #162d44;
  --bg-glass:       rgba(255,255,255,0.06);

  --accent-primary: #00c6ff;
  --accent-secondary: #0072ff;
  --accent-green:   #00e5a0;
  --accent-amber:   #ffb547;
  --accent-red:     #ff6b6b;
  --accent-purple:  #a78bfa;

  --text-primary:   #e8f4fd;
  --text-secondary: #8baab8;
  --text-muted:     #4d6e82;

  --border-color:   rgba(0,198,255,0.12);
  --shadow-glow:    0 0 20px rgba(0,198,255,0.15);

  --header-h:       58px;
  --nav-h:          70px;
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      22px;
  --radius-xl:      32px;

  --font-main: 'Noto Sans KR', 'Inter', sans-serif;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- 기본 리셋 ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}
button { cursor: pointer; border: none; background: none; font-family: var(--font-main); }
input, textarea { font-family: var(--font-main); }
.hidden { display: none !important; }

/* ================================================
   스플래시 화면
   ================================================ */
#splash-screen {
  position: fixed; inset: 0;
  background: linear-gradient(160deg, #0a1628, #0d2040, #0a3350);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 60px;
}
.splash-logo { text-align: center; }
.splash-icon {
  font-size: 72px;
  filter: drop-shadow(0 0 24px rgba(0,198,255,0.6));
  animation: floatAnim 2s ease-in-out infinite;
}
@keyframes floatAnim {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.splash-title {
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(135deg, #00c6ff, #0072ff, #00e5a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  margin-top: 12px;
}
.splash-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
  letter-spacing: 0.5px;
}
.splash-loader { width: 200px; text-align: center; }
.loader-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}
.loader-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  animation: loadAnim 1.8s ease-out forwards;
  width: 0;
}
@keyframes loadAnim {
  0% { width: 0; }
  60% { width: 70%; }
  100% { width: 100%; }
}
.loader-text { font-size: 12px; color: var(--text-muted); margin-top: 10px; }

/* ================================================
   앱 구조
   ================================================ */
#main-app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* ---- 헤더 ---- */
.app-header {
  height: var(--header-h);
  background: rgba(13,27,42,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}
.header-logo {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #00c6ff, #00e5a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--accent-primary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.icon-btn:hover, .icon-btn:active { background: rgba(0,198,255,0.15); transform: scale(0.96); }
.weather-badge {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}

/* ---- 페이지 컨테이너 ---- */
.page-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: var(--bg-primary);
}
.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  /* visibility는 transition 없이 즉각 전환 */
  visibility: hidden;
  background: var(--bg-primary);
  z-index: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  -webkit-overflow-scrolling: touch;
}
.page.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
  visibility: visible;  /* 즉각 표시 */
  z-index: 2;
}
.page-inner {
  padding: 16px;
  padding-bottom: 24px;
}
.section-header { margin-bottom: 18px; }
.section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.section-sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin: 20px 0 10px;
}

/* ================================================
   지도 페이지
   ================================================ */
#page-map { overflow: hidden; }
#map-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}
#map-container {
  width: 100%;
  height: 100%;
  position: relative;
}
#kakao-map {
  width: 100%;
  height: 100%;
  background: #112236;
}

/* ---- 지도 컨트롤 ---- */
.map-controls {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000; /* 지도가 Resize될 때 가려지지 않도록 최상단으로 격상 */
}
.map-ctrl-btn {
  width: 58px;
  background: rgba(13,31,50,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-primary);
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.map-ctrl-btn:active { transform: scale(0.94); }
.map-ctrl-btn.active { border-color: var(--accent-primary); background: rgba(0,198,255,0.15); box-shadow: var(--shadow-glow); }
.ctrl-icon { font-size: 20px; }
.ctrl-label { font-size: 10px; color: var(--text-secondary); text-align: center; line-height: 1.2; font-weight: 600; }
.drought-btn.active .ctrl-label { color: var(--accent-amber); }
.pin-btn.active .ctrl-label { color: var(--accent-green); }
.heat-btn.active .ctrl-label { color: var(--accent-red); }

/* ---- 저수지 정보 카드 ---- */
.reservoir-card {
  position: absolute;
  bottom: 14px;
  left: 12px;
  right: 80px;
  background: rgba(13,31,50,0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  z-index: 1000; /* 지도 Resize 시 가려짐 방지 */
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.reservoir-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.reservoir-stats { display: flex; gap: 16px; }
.stat-item { display: flex; flex-direction: column; }
.stat-label { font-size: 10px; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }
.stat-value { font-size: 14px; font-weight: 700; color: var(--accent-primary); }

/* ---- 갈수기 오버레이 ---- */
.drought-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(20,60,40,0.55), rgba(30,80,50,0.65));
  z-index: 5;
  pointer-events: none;
}
.drought-label {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  background: rgba(255,181,71,0.9);
  color: #1a1200;
  padding: 4px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.drought-info-panel {
  position: absolute;
  bottom: 90px; left: 12px;
  right: 80px;
  background: rgba(13,27,42,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,181,71,0.3);
  border-radius: var(--radius-md);
  padding: 12px;
  pointer-events: all;
}
.drought-tip { display: flex; gap: 8px; align-items: flex-start; }
.tip-icon { font-size: 16px; }
.drought-tip p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.structure-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ================================================
   추천 페이지
   ================================================ */
.weather-summary-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(0,198,255,0.08));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 4px;
}
.ws-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.ws-header > span { font-size: 40px; }
.ws-condition { font-size: 15px; font-weight: 700; }
.ws-temp { font-size: 28px; font-weight: 900; color: var(--accent-primary); letter-spacing: -1px; }
.ws-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ws-detail-item {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.wsd-label { font-size: 11px; color: var(--text-muted); }
.wsd-val { font-size: 14px; font-weight: 700; color: var(--text-primary); }

/* ---- 전략 카드 ---- */
.strategy-card {
  background: linear-gradient(135deg, rgba(0,200,100,0.12), rgba(0,114,255,0.1));
  border: 1px solid rgba(0,229,160,0.25);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 80px;
}
.strategy-loading { color: var(--text-muted); font-size: 14px; padding: 16px 0; text-align: center; }
.strategy-main-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-green);
  margin-bottom: 8px;
}
.strategy-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* ---- 루어 카드 ---- */
.lure-list { display: flex; flex-direction: column; gap: 10px; }
.lure-loading { color: var(--text-muted); font-size: 14px; padding: 16px 0; text-align: center; }
.lure-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all var(--transition);
}
.lure-card:active { transform: scale(0.98); }
.lure-emoji { font-size: 32px; line-height: 1; }
.lure-info { flex: 1; }
.lure-name { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.lure-type-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  margin-bottom: 6px;
  font-weight: 700;
}
.badge-top    { background: rgba(255,107,107,0.15); color: #ff6b6b; }
.badge-bottom { background: rgba(167,139,250,0.15); color: #a78bfa; }
.badge-mid    { background: rgba(0,198,255,0.15);   color: #00c6ff; }
.badge-finesse { background: rgba(0,229,160,0.15);  color: #00e5a0; }
.lure-colors { display: flex; gap: 6px; flex-wrap: wrap; }
.lure-color-chip {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lure-priority {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.priority-stars { font-size: 14px; letter-spacing: -2px; }
.priority-label { font-size: 9px; color: var(--text-muted); }

/* ---- 방향 카드 ---- */
.direction-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.direction-advice { font-size: 13px; color: var(--text-secondary); line-height: 1.7; flex: 1; }
#wind-rose-canvas { flex-shrink: 0; border-radius: 50%; background: var(--bg-glass); }

/* ---- 피딩 타임 ---- */
.feeding-time-list { display: flex; flex-direction: column; gap: 8px; }
.feeding-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.feeding-item.peak { border-color: rgba(255,181,71,0.4); background: rgba(255,181,71,0.05); }
.feeding-icon { font-size: 20px; }
.feeding-time { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.feeding-desc { font-size: 12px; color: var(--text-secondary); }
.feeding-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 99px;
  font-weight: 700;
}
.badge-peak { background: rgba(255,181,71,0.2); color: var(--accent-amber); }
.badge-minor { background: rgba(0,198,255,0.15); color: var(--accent-primary); }

/* ================================================
   물색 분석 페이지
   ================================================ */
.upload-zone {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  min-height: 200px;
  overflow: hidden;
  transition: border-color var(--transition);
  margin-bottom: 16px;
}
.upload-zone:active { border-color: var(--accent-primary); }
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pad: 32px;
  padding: 40px 20px;
  gap: 10px;
  text-align: center;
}
.upload-icon { font-size: 52px; }
.upload-text { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.upload-hint { font-size: 13px; color: var(--text-secondary); }
.upload-btn {
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 28px;
  border-radius: 99px;
  box-shadow: 0 4px 16px rgba(0,114,255,0.35);
  transition: all var(--transition);
}
.upload-btn:active { transform: scale(0.96); }
.upload-preview { position: relative; }
.upload-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}
.reupload-btn {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(13,27,42,0.85);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
}

/* ---- 분석 결과 ---- */
.vision-result {
  animation: fadeInUp 0.35s var(--transition) both;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vision-result-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}
.clarity-badge {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  flex-shrink: 0;
}
.clarity-badge.clear   { background: rgba(0,229,160,0.15); border: 2px solid #00e5a0; color: #00e5a0; }
.clarity-badge.stained { background: rgba(255,181,71,0.15); border: 2px solid #ffb547; color: #ffb547; }
.clarity-badge.muddy   { background: rgba(255,107,107,0.15); border: 2px solid #ff6b6b; color: #ff6b6b; }
.clarity-label { font-size: 16px; font-weight: 800; }
.clarity-desc  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }

.color-analysis-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.color-swatch {
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
}

.lure-color-list { display: flex; gap: 10px; flex-wrap: wrap; }
.lure-color-card {
  flex: 1 1 140px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lc-swatch {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}
.lc-info .lc-name { font-size: 13px; font-weight: 700; }
.lc-info .lc-reason { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.vision-tips-card {
  background: linear-gradient(135deg, rgba(0,198,255,0.08), rgba(0,229,160,0.05));
  border: 1px solid rgba(0,198,255,0.2);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ================================================
   로그 페이지
   ================================================ */
.log-stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.log-stat {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.log-stat span { font-size: 26px; font-weight: 900; color: var(--accent-primary); }
.log-stat small { font-size: 11px; color: var(--text-muted); font-weight: 600; }

.pin-log-list { display: flex; flex-direction: column; gap: 10px; }
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 40px 20px; text-align: center;
  color: var(--text-secondary); font-size: 14px; line-height: 1.7;
}
.empty-icon { font-size: 48px; opacity: 0.5; }
.go-map-btn {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  color: white; font-weight: 700; font-size: 14px;
  padding: 10px 24px; border-radius: 99px;
  margin-top: 4px;
}

.pin-log-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; gap: 12px; align-items: flex-start;
}
.pin-log-icon { font-size: 28px; line-height: 1; }
.pin-log-info { flex: 1; }
.pin-log-type { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.pin-log-coords { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.pin-log-memo { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.pin-log-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.pin-log-delete {
  padding: 6px; color: var(--text-muted); font-size: 16px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.pin-log-delete:active { color: var(--accent-red); background: rgba(255,107,107,0.1); }
.pin-shared-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 99px;
  background: rgba(0,229,160,0.1); color: var(--accent-green);
  font-weight: 700; margin-top: 4px; display: inline-block;
}

/* ================================================
   하단 네비게이션
   ================================================ */
.bottom-nav {
  height: var(--nav-h);
  background: rgba(13,27,42,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative;
}
.nav-item::after {
  content: '';
  position: absolute;
  bottom: -1px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
  border-radius: 99px;
  transition: width 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-item.active { color: var(--accent-primary); }
.nav-item.active::after { width: 32px; }
.nav-icon { font-size: 22px; transition: transform var(--transition); }
.nav-item.active .nav-icon { transform: scale(1.15); }
.nav-label { font-size: 10px; font-weight: 600; }

/* ================================================
   핀 마킹 모달
   ================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  width: 100%;
  background: linear-gradient(180deg, #162d44, #0f2233);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 16px 20px 32px;
  animation: slideUp 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--border-color);
  border-radius: 99px;
  margin: 0 auto 16px;
}
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.modal-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.pin-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.pin-type-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: all var(--transition);
}
.pin-type-btn.selected {
  border-color: var(--accent-primary);
  background: rgba(0,198,255,0.15);
  box-shadow: var(--shadow-glow);
}
.pin-type-btn:active { transform: scale(0.94); }
.pt-icon { font-size: 22px; }
.pt-label { font-size: 10px; color: var(--text-secondary); font-weight: 600; text-align: center; line-height: 1.2; }
.pin-memo {
  width: 100%; min-height: 70px;
  background: var(--bg-glass); border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary); font-size: 13px;
  padding: 10px 12px; resize: none;
  margin-bottom: 14px; outline: none;
  transition: border-color var(--transition);
}
.pin-memo:focus { border-color: var(--accent-primary); }
.pin-share-row {
  margin-bottom: 16px;
  display: flex; align-items: center;
}
.share-toggle {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}
.share-toggle input { display: none; }
.toggle-slider {
  width: 44px; height: 24px;
  background: var(--bg-glass); border: 1px solid var(--border-color);
  border-radius: 99px; position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-slider::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition);
}
.share-toggle input:checked + .toggle-slider { background: rgba(0,229,160,0.3); border-color: var(--accent-green); }
.share-toggle input:checked + .toggle-slider::after { left: 23px; background: var(--accent-green); }
.share-label { font-size: 13px; color: var(--text-secondary); }
.modal-actions { display: flex; gap: 10px; }
.modal-cancel {
  flex: 1; padding: 14px;
  background: var(--bg-glass); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); color: var(--text-secondary);
  font-size: 15px; font-weight: 600;
  transition: all var(--transition);
}
.modal-confirm {
  flex: 2; padding: 14px;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  border-radius: var(--radius-md); color: white;
  font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,114,255,0.35);
  transition: all var(--transition);
}
.modal-cancel:active { transform: scale(0.97); }
.modal-confirm:active { transform: scale(0.97); }

/* ================================================
   API 설정 모달
   ================================================ */
.settings-group {
  margin-bottom: 14px;
}
.settings-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.settings-source {
  font-size: 10px;
  font-weight: 400;
  color: var(--accent-primary);
  opacity: 0.8;
}
.settings-input {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 12px;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--transition);
  letter-spacing: 0.2px;
}
.settings-input::placeholder { color: var(--text-muted); }
.settings-input:focus { border-color: var(--accent-primary); }
.settings-hint {
  font-size: 11px;
  margin-top: 4px;
  min-height: 14px;
  color: var(--accent-green);
}
.settings-hint.error { color: var(--accent-red); }

/* ================================================
   기압 급강하 알리미 (Task 2)
   ================================================ */
.pressure-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255,107,107,0.12), rgba(255,107,107,0.04));
  border: 1px solid rgba(255,107,107,0.45);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  animation: pulseRed 2.5s ease-in-out infinite;
}
@keyframes pulseRed {
  0%,100% { box-shadow: 0 0 0   0   rgba(255,107,107,0); }
  50%      { box-shadow: 0 0 14px 4px rgba(255,107,107,0.22); }
}
.pressure-alert-icon { font-size: 26px; flex-shrink: 0; }
.pressure-alert-body { flex: 1; min-width: 0; }
.pressure-alert-title {
  font-size: 14px;
  font-weight: 800;
  color: #ff6b6b;
  letter-spacing: -0.3px;
}
.pressure-alert-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.58);
  margin-top: 2px;
}
.pressure-alert-badge {
  flex-shrink: 0;
  background: rgba(255,107,107,0.18);
  border: 1px solid rgba(255,107,107,0.5);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #ffaaaa;
  text-align: center;
  line-height: 1.3;
}

/* 기압 트렌드 카드 */
.pressure-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 12px 8px;
  margin-bottom: 12px;
}
.pressure-stats-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.pressure-stat {
  flex: 1;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  text-align: center;
}
.pressure-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.pressure-stat-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
#pressure-chart-canvas {
  width: 100%;
  display: block;
  border-radius: 6px;
}
.pressure-legend {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.legend-item {
  font-size: 10px;
  color: var(--text-muted);
}
.legend-golden { color: rgba(255,107,107,0.85); }
.legend-now    { color: rgba(255,181,71,0.85); }
.legend-line   { color: rgba(0,198,255,0.75); }

/* ================================================
   TOAST
   ================================================ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%; transform: translateX(-50%);
  background: rgba(13,31,50,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  padding: 10px 20px;
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  z-index: 600;
  animation: fadeIn 0.2s ease both;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

@media (min-width: 480px) {
  #app {
    max-width: 430px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 80px rgba(0,0,0,0.6);
    min-height: 100dvh;
  }
  body { background: #060f18; }
}

/* ================================================
   Leaflet 지도 커스텀 스타일
   ================================================ */

/* Leaflet 기본 UI 다크 테마 맞춤 */
.leaflet-container {
  background: #0d1b2a;
  font-family: var(--font-main);
}
.leaflet-control-zoom {
  display: none; /* 줌 컨트롤 숨김 (제스처로 충분) */
}
.leaflet-control-attribution {
  background: rgba(13,27,42,0.7) !important;
  color: rgba(255,255,255,0.3) !important;
  font-size: 9px !important;
  backdrop-filter: blur(4px);
}
.leaflet-control-attribution a {
  color: rgba(0,198,255,0.5) !important;
}

/* ---- 저수지 마커 ---- */
.res-marker {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(13,31,50,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,198,255,0.3);
  border-radius: 99px;
  padding: 4px 10px 4px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}
.res-marker:hover {
  border-color: var(--accent-primary);
  background: rgba(0,198,255,0.12);
  transform: scale(1.05);
}
.res-marker > span {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ---- 핀 마커 ---- */
.pin-marker {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(13,31,50,0.9);
  border: 2px solid var(--accent-primary);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 3px 12px rgba(0,0,0,0.5), 0 0 8px rgba(0,198,255,0.3);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pin-marker > * {
  transform: rotate(45deg); /* 이모지 다시 똑바로 */
}
.pin-marker:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.6), 0 0 16px rgba(0,198,255,0.5);
}

/* ---- 클러스터 마커 ---- */
.cluster-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: white;
  box-shadow: 0 3px 12px rgba(0,114,255,0.4);
}

/* ---- Leaflet 팝업 다크 테마 ---- */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
  color: var(--text-primary) !important;
}
.leaflet-popup-tip {
  background: var(--bg-card) !important;
}
.leaflet-popup-close-button {
  color: var(--text-secondary) !important;
  font-size: 18px !important;
}

/* ---- MarkerCluster 다크 오버라이드 ---- */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(0,114,255,0.15) !important;
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: rgba(0,198,255,0.3) !important;
  color: white !important;
  font-weight: 700 !important;
  font-family: var(--font-main) !important;
}
