/* ============================================================
   피그플랜 포털 A안 – pigplan-portal.css
   ============================================================ */

:root {
  --primary: #1D9ADD;
  --primary-dark: #1a8bc7;
  --primary-light: #f0f9ff;
  --dark: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --white: #ffffff;
  --bg: #E8EDF1;
  --card-border: #dce0e4;
  --radius: 6px;
  --up: #DC2626;
  --down: #2563EB;
}

/* ========== 리셋 & 기본 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow-y: auto; overflow-x: hidden; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-700);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== GNB 헤더 (50px) ========== */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  height: 50px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 900;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 48px;
}
.logo img { height: 26px; }
.nav-menu { display: flex; gap: 28px; align-items: center; }
.nav-menu a {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  transition: color 0.2s;
}
.nav-menu a:hover { color: var(--primary); }
.nav-menu a.active { color: var(--primary); font-weight: 600; }

/* 드롭다운 메뉴 */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.nav-dropdown-toggle:hover { color: var(--primary); }
.nav-dropdown-toggle .arrow {
  font-size: 10px;
  transition: transform 0.2s;
}
.nav-dropdown.open .nav-dropdown-toggle .arrow {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 160px;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 100;
}
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
}
.nav-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  white-space: nowrap;
}
.nav-dropdown-menu a:hover {
  background: var(--gray-50);
  color: var(--primary);
}

.header-right { display: flex; align-items: center; gap: 16px; }
.insight-cta {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #0e8fa8, #0ea5c2);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(14,143,168,0.2);
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.insight-cta:hover {
  background: linear-gradient(135deg, #0c7d94, #0e8fa8);
  box-shadow: 0 4px 16px rgba(14,143,168,0.35);
  transform: translateY(-1px);
  color: #fff;
}
.insight-cta .new-badge {
  background: #fff;
  color: #0e8fa8;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
}

/* ========== page-wrap: page-body + ad-wing ========== */
.page-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 24px;
  width: 100%;
  flex: 1;
}
.page-body {
  flex: 1;
  min-width: 0;
  max-width: 1600px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ========== 카드 공통 ========== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
}
.card-header {
  padding: 8px 14px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.card-body {
  padding: 10px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-more { font-size: 11px; color: var(--gray-400); }
.card-more:hover { color: var(--primary); }

/* ========== 상단 묶음 (top-row) ========== */
.top-row {
  display: flex;
  gap: 6px;
  margin-bottom: 0;
  height: 485px;
}

/* 좌측 컬럼 (로그인 + 공지) */
.left-col {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 우측 영역 (슬라이더 + 돈가시세) */
.right-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  gap: 6px;
  overflow: hidden;
}

/* ========== 로그인 카드 ========== */
.login-card { border-top: 3px solid var(--primary); }
.login-card .card-header { background: var(--primary-light); padding: 8px 14px; }
.login-card .card-body { padding: 10px 14px; }
.lang-select {
  padding: 3px 6px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 11px;
  color: var(--gray-600);
  background: var(--white);
  cursor: pointer;
}
.login-form { display: flex; flex-direction: column; gap: 5px; }
.login-input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 12px;
}
.login-input:focus { outline: none; border-color: var(--primary); }
.login-options { display: flex; gap: 14px; }
.login-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--gray-500);
  cursor: pointer;
}
.login-checkbox input {
  width: 13px;
  height: 13px;
  accent-color: var(--primary);
  cursor: pointer;
}
.login-btn {
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 2px;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(29, 154, 221, 0.3);
}
.login-btn:hover { background: linear-gradient(135deg, var(--primary-dark), #1478a8); box-shadow: 0 3px 10px rgba(29, 154, 221, 0.4); }
.login-btn:disabled { background: var(--gray-400); cursor: not-allowed; }
.signup-btn {
  display: block;
  width: 100%;
  height: 30px;
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  line-height: 28px;
}
.signup-btn:hover { background: var(--gray-50); border-color: var(--gray-400); }
.login-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  margin-top: 4px;
  color: var(--gray-400);
}
.login-links a { color: var(--gray-500); }
.login-links a:hover { color: var(--primary); }

/* ========== 사용자 카드 ========== */
.user-card { border-top: 3px solid var(--primary); }
.user-card .card-header { background: var(--primary-light); padding: 8px 14px; }
.user-card .card-body { padding: 12px 14px; }
.user-profile { display: flex; flex-direction: column; gap: 10px; }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-grade-mark {
  width: 40px;
  height: 48px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.user-grade-mark svg { width: 100%; height: 100%; }
.user-details { flex: 1; }
.user-farm-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-name { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.user-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}
.user-stat { text-align: center; position: relative; cursor: default; }
.user-stat-value { font-size: 17px; font-weight: 700; color: var(--primary); }
.user-stat-label { font-size: 10px; color: var(--gray-500); margin-top: 2px; }
.stat-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #f3f4f6;
  font-size: 11px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.stat-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
}
.user-stat.has-tooltip:hover .stat-tooltip { display: block; }
.user-actions { display: flex; gap: 6px; }
.user-action-btn {
  flex: 1;
  padding: 10px 7px;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
}
.user-action-btn:hover { background: var(--gray-200); }
.user-action-btn.primary { background: var(--primary); color: white; }
.user-action-btn.primary:hover { background: var(--primary-dark); }

/* ========== 공지사항 카드 ========== */
.notice-card { flex: 1; overflow: hidden; }
.notice-card .card-body { padding: 8px 14px; overflow: hidden; }
.notice-list { display: flex; flex-direction: column; flex: 1; justify-content: center; }
.notice-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 12px;
}
.notice-item:last-child { border-bottom: none; }
.notice-item:hover { color: var(--primary); }
.notice-badge {
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  flex-shrink: 0;
}
.badge-system { background: #fef2f2; color: #dc2626; }
.badge-general { background: var(--primary-light); color: var(--primary); }
.badge-tech-notice { background: #f0fdf4; color: #16a34a; }
.notice-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-empty { padding: 16px; text-align: center; color: var(--gray-400); font-size: 12px; }

/* ========== 슬라이더 ========== */
.slider-wrap {
  flex: 1 1 140px;
  min-width: 0;
  overflow: hidden;
  min-height: 0;
}
.slider {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  height: 100%;
}
.slider-track {
  display: flex;
  transition: transform .5s ease;
  height: 100%;
}
.slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 16px 20px;
  position: relative;
  cursor: pointer;
}
.slide-content {
  position: relative;
  z-index: 1;
}
.slide-title {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.slide-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 6px;
}
.slide-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  margin-top: 4px;
}
/* 이미지 배너 */
.slide--img { padding: 0; }
.slide:has(.slide-img) { padding: 0; }
.slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  background: linear-gradient(135deg, #e8edf2 0%, #dce3ea 100%);
}
.slide-link {
  display: flex;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  align-items: center;
  cursor: pointer;
}

/* 슬라이더 화살표 */
.s-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: all .2s;
  font-size: 16px;
}
.s-arrow:hover {
  background: rgba(0,0,0,.55);
  box-shadow: 0 3px 12px rgba(0,0,0,.3);
  transform: translateY(-50%) scale(1.1);
}
.s-prev { left: 12px; }
.s-next { right: 12px; }

/* 슬라이더 도트 */
.s-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
  background: rgba(0,0,0,.2);
  padding: 4px 8px;
  border-radius: 12px;
}
.s-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  transition: all .3s;
  border: none;
}
.s-dot.on {
  background: #fff;
  width: 22px;
  border-radius: 4px;
}

/* ========== 돈가 시세 ========== */
.price-wrap {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.price-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}
.price-card .card-body {
  flex: 1; min-height: 0; overflow: hidden;
  padding: 0;
  display: flex; flex-direction: column;
}

/* ══════════════════════════════════════
   돈가 시세 — 상/하 레이아웃
   ══════════════════════════════════════ */
.pd-header-date { font-size: 12px; color: #aab0bc; font-weight: 500; }

/* 본문: 상하 분할 */
.pd-body { display: flex; flex-direction: column; height: 100%; }

/* ── 상단: 가격 요약 ── */
.pd-top {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #f0f1f5;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* 히어로 */
.pd-hero { flex-shrink: 0; }
.pd-live-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.pd-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #1D9ADD;
  box-shadow: 0 0 6px rgba(29,154,221,.4);
  animation: pdGlow 2s ease-in-out infinite;
}
@keyframes pdGlow {
  0%,100% { opacity:1; box-shadow: 0 0 6px rgba(29,154,221,.4); }
  50% { opacity:.5; box-shadow: 0 0 2px rgba(29,154,221,.2); }
}
.pd-live-text {
  font-size: 10px; font-weight: 600; color: #1D9ADD;
  letter-spacing: .5px; text-transform: uppercase;
}
.pd-basis {
  font-size: 9px; font-weight: 500; color: #aab0bc;
  margin-left: 2px;
}
.pd-price-row { display: flex; align-items: baseline; gap: 3px; }
.pd-price {
  font-size: 32px; font-weight: 900; color: #1a1a2e;
  letter-spacing: -.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pd-unit { font-size: 12px; font-weight: 600; color: #8b90a0; }
.pd-change-row { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.pd-change {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 13px; font-weight: 700; letter-spacing: -.01em;
}
.pd-change.up { background: rgba(220,38,38,.06); color: #DC2626; }
.pd-change.down { background: rgba(37,99,235,.06); color: #2563EB; }
.pd-change-arrow { font-size: 11px; }
.pd-pct { font-size: 12px; font-weight: 600; color: #aab0bc; }

/* 비교 수치 (가로 배치) */
.pd-stats-row {
  display: flex; gap: 0; flex: 1 1 auto;
  min-width: 0;
}
.pd-stat-box {
  flex: 1; text-align: center; min-width: 0;
  padding: 0 4px;
  border-left: 1px solid #f0f1f5;
  overflow: hidden;
}
/* 고정 위치 툴팁 (JS로 제어) */
.pd-tooltip {
  position: fixed;
  background: #1a1a2e; color: #fff;
  font-size: 11px; font-weight: 400; line-height: 1.4;
  padding: 6px 10px; border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0; transition: opacity .15s;
  z-index: 9999;
}
.pd-stat-box .pd-stat-label {
  font-size: clamp(9px, 1.8vw, 12px); font-weight: 500; color: #8b90a0;
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-stat-val-row {
  display: flex; align-items: baseline; justify-content: center; gap: 2px;
  white-space: nowrap;
}
.pd-stat-val {
  font-size: clamp(12px, 2.5vw, 15px); font-weight: 700; color: #1a1a2e;
  font-variant-numeric: tabular-nums;
}
.pd-stat-diff { font-size: clamp(9px, 1.6vw, 11px); font-weight: 700; margin-left: 2px; white-space: nowrap; }
.pd-stat-diff.up { color: #DC2626; }
.pd-stat-diff.down { color: #2563EB; }

/* ── 하단: 차트 + 인사이트 ── */
.pd-bottom {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
}

/* 차트 */
.pd-chart-area {
  flex: 1; display: flex; flex-direction: column; padding: 8px 16px 4px;
  min-height: 0;
}
.pd-chart-head {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 4px;
}
.pd-chart-title { font-size: 12px; font-weight: 700; color: #1a1a2e; }
.pd-chart-range { font-size: 11px; color: #ccd0da; font-weight: 500; }

/* 기간 탭 */
.pc-tabs { display: flex; gap: 0; background: #f5f6fa; border-radius: 6px; padding: 2px; }
.pc-tab {
  padding: 3px 10px; border-radius: 4px;
  font-size: 9px; font-weight: 600; color: #8b90a0;
  cursor: pointer; transition: all .15s; user-select: none;
}
.pc-tab.on { background: #fff; color: #1a1a2e; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.pc-tab:hover:not(.on) { color: #636b82; }
.pd-chart-wrap { flex: 1; position: relative; min-height: 0; overflow: hidden; }
.pd-chart-wrap > div { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }

/* 시그널 (인사이트) */
.pd-insight { padding: 0 16px 8px; flex-shrink: 0; }
.pd-insight-card {
  display: flex; gap: 6px; align-items: center;
  padding: 6px 10px; border-radius: 8px; transition: all .2s;
}
.pd-insight-card.up {
  background: linear-gradient(135deg, #fefce8, #f0fdf4);
  border: 1px solid #d9f99d;
}
.pd-insight-card.down {
  background: linear-gradient(135deg, #fff5f5, #fef2f2);
  border: 1px solid #fca5a5;
}
.pd-insight-card.flat {
  background: #f8f9fc; border: 1px solid #eef0f6;
}
.pd-insight-icon { font-size: 14px; flex-shrink: 0; line-height: 1; }
.pd-insight-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pd-insight-title { font-size: 11px; font-weight: 700; line-height: 1.3; }
.pd-insight-card.up .pd-insight-title { color: #3f6212; }
.pd-insight-card.down .pd-insight-title { color: #991b1b; }
.pd-insight-card.flat .pd-insight-title { color: #374151; }
.pd-insight-desc { display: none; }
.pd-insight-card.up .pd-insight-desc { color: #4d7c0f; }
.pd-insight-card.down .pd-insight-desc { color: #b91c1c; }
.pd-insight-card.flat .pd-insight-desc { color: #6b7280; }
.pd-insight-tags { display: flex; gap: 4px; flex-shrink: 0; }
.pd-tag {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 4px; letter-spacing: .02em;
}
.pd-tag.supply { background: rgba(37,99,235,.08); color: #2563EB; }
.pd-tag.price { background: rgba(220,38,38,.06); color: #DC2626; }
.pd-tag.type { background: rgba(16,185,129,.08); color: #059669; }

/* CTA (헤더 인라인) */
.pd-header-cta {
  font-size: 11px; font-weight: 600; color: #aab0bc;
  text-decoration: none; margin-left: 10px;
  transition: color .15s;
}
.pd-header-cta:hover { color: #1D9ADD; }

/* ========== 하단 5컬럼 (bot-row) ========== */
.bot-row {
  display: flex;
  gap: 6px;
  min-height: 0;
}
.bot-group { display: flex; min-width: 0; }
.bot-group-left { width: 300px; flex-shrink: 0; }
.bot-group-mid { flex: 1 1 140px; gap: 6px; }
.bot-group-right { flex: 1 1 0; gap: 6px; }
.bot-group > .card { flex: 1; min-width: 0; }
.bot-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ========== 농가 현황 카드 ========== */
.farm-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.farm-stat {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--radius);
  text-align: center;
}
.farm-stat-blue {
  background: var(--primary-light);
  border: 1px solid #bae6fd;
}
.farm-stat-dark {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.farm-stat-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
}
.farm-stat-num small {
  font-size: 12px;
  font-weight: 600;
}
.farm-stat-label {
  font-size: 10px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* 남한 지도 */
.farm-map {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#farmMapChart {
  flex: 1;
  width: 100%;
  min-height: 200px;
}
.farm-count-badge {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 10px;
}

/* ========== 유용한 콘텐츠 ========== */
/* 유용한 콘텐츠 - 2열 그리드 + 내부 스크롤 */
.useful-card { flex: 1 !important; padding: 0; display: flex; flex-direction: column; }
.guide-card { flex: 1 !important; }
.uc-scroll {
  overflow-y: auto;
  padding: 0 12px 6px;
  max-height: 300px;
  scrollbar-width: thin;
  scrollbar-color: #d0d5da transparent;
}
.uc-scroll::-webkit-scrollbar { width: 3px; }
.uc-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.uc-scroll::-webkit-scrollbar-track { background: transparent; }

.uc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.uc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  position: relative;
}
.uc-item:hover { background: #f0f5fa; }

.uc-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.uc-icon.cat-content { background: #EDF6FC; border: 1px solid rgba(29,154,221,.12); }
.uc-icon.cat-agency  { background: #ECFDF5; border: 1px solid rgba(16,185,129,.12); }

.uc-text { min-width: 0; }
.uc-title {
  font-size: 12px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uc-desc {
  font-size: 10px;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* hover 툴팁 */
.uc-item .uc-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: 9px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}
.uc-item .uc-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #333;
}
.uc-item:hover .uc-tip { display: block; }

/* ========== read-item 공통 (전문가 칼럼, 가이드, 뉴스) ========== */
.read-list { display: flex; flex-direction: column; height: 100%; justify-content: center; gap: 4px; }
.read-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #f4f5f7;
  cursor: pointer;
}
.read-item:last-child { border-bottom: none; }
.read-item-body { flex: 1; min-width: 0; }
.read-item-title {
  font-size: 12px;
  font-weight: 550;
  line-height: 1.5;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}
.read-item:hover .read-item-title { color: #0f172a; }
.read-item-date {
  font-size: 10px;
  color: #cbd5e1;
  margin-top: 2px;
  display: block;
}
.read-empty {
  padding: 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 12px;
}

/* 태그 뱃지 (전문가 칼럼) */
.read-tag-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.read-tag-badge.tag-blue   { color: #3b82f6; background: rgba(59,130,246,0.06);  border: 1px solid rgba(59,130,246,0.12); }
.read-tag-badge.tag-red    { color: #ef4444; background: rgba(239,68,68,0.06);   border: 1px solid rgba(239,68,68,0.12); }
.read-tag-badge.tag-purple { color: #8b5cf6; background: rgba(139,92,246,0.06); border: 1px solid rgba(139,92,246,0.12); }
.read-tag-badge.tag-green  { color: #16a34a; background: rgba(22,163,74,0.06);  border: 1px solid rgba(22,163,74,0.12); }
.read-icon-video { color: #ef4444; font-size: 10px; margin-right: 3px; }

/* 숫자 뱃지 (업계 뉴스) */
.read-num-badge {
  width: 20px;
  height: 20px;
  border-radius: var(--radius);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 20px;
  background: #f1f5f9;
  color: #94a3b8;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s ease;
}
.read-item:hover .read-num-badge { background: #0284c7; color: #fff; }

/* ========== 광고 윙 ========== */
.ad-wing {
  width: 160px;
  flex-shrink: 0;
  margin-left: 16px;
  position: sticky;
  top: 66px; /* 50px header + 16px padding */
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ad-banner-link {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ad-banner-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ad-banner-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

/* ========== 푸터 ========== */
.footer {
  background: #f8f9fb;
  border-top: 1px solid var(--gray-200);
  padding: 16px 24px;
  flex-shrink: 0;
}
.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  font-size: 11px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 8px;
  line-height: 1.8;
}
.footer-inner strong { color: var(--gray-700); }
.footer-inner a { color: var(--gray-500); }
.footer-inner a:hover { color: var(--primary); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-weight: 500; }
.footer-links a:hover { color: var(--primary); }
.footer-sep { color: var(--gray-300); }
.footer-copy { color: var(--gray-400); }

/* ========== 로딩 스피너 ========== */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 스켈레톤 로딩 */
.skeleton {
  background: linear-gradient(90deg, #f0f1f5 25%, #e8eaef 50%, #f0f1f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
.skeleton-line { height: 12px; margin-bottom: 8px; }
.skeleton-line:last-child { width: 60%; }
.skeleton-circle { width: 32px; height: 32px; border-radius: 50%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== 포털 모달 (아이디/비밀번호 찾기) ========== */
.portal-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portal-modal-blocker {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.portal-modal-wrapper { position: relative; z-index: 1; }
.portal-modal-container {
  background: var(--white);
  border-radius: 12px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  position: relative;
  padding: 28px;
}
.portal-modal-head {
  margin-bottom: 20px;
  padding-right: 36px;
}
.portal-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}
.portal-modal-subtitle {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
}
.portal-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--gray-400);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.portal-modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
.portal-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.portal-modal-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
}
.portal-modal-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.portal-modal-field input:focus { border-color: var(--primary); }
.portal-modal-btn {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.portal-modal-btn:hover { background: var(--primary-dark); }

/* ========== 햄버거 & 모바일 메뉴 ========== */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}
.hamburger {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gray-700);
  position: relative;
  transition: background 0.3s;
}
.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gray-700);
  transition: transform 0.3s, top 0.3s;
}
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }
.mobile-menu-toggle.active .hamburger { background: transparent; }
.mobile-menu-toggle.active .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}
.mobile-menu-toggle.active .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

.mobile-menu {
  display: none !important;
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  z-index: 1000;
  padding: 16px 24px;
  overflow-y: auto;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--gray-200);
}
.mobile-menu.open { display: flex !important; }
.mobile-menu a {
  display: block;
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  transition: color 0.2s, background 0.2s;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-radius: var(--radius);
}

/* ========== 반응형 ========== */

/* ≤1600px: ad-wing 숨김, 20~24인치 모니터 대응 */
@media (max-width: 1600px) {
  .ad-wing { display: none; }
  .page-body { max-width: 100%; }
  .top-row { height: auto; min-height: 420px; }
  .left-col { width: 260px; }
  .pd-price { font-size: 28px; }
  .pd-stat-box .pd-stat-label { font-size: 10px; }
  .pd-stat-val { font-size: 13px; }
}

/* ≤1366px: 20인치 이하 모니터 — 상단 2행 분리 */
@media (max-width: 1366px) {
  .top-row { flex-wrap: wrap; height: auto; min-height: 0; }
  .left-col { width: 100%; flex-direction: row; gap: 6px; }
  .left-col > .card { flex: 1; }
  .right-area { flex: 1 1 100%; overflow: visible; }
  .slider-wrap { flex: 1 1 55%; }
  .price-wrap { flex: 1 1 45%; }

  /* 하단: 3그룹 가로 배치 유지, 비율 조정 */
  .bot-row { flex-wrap: nowrap; }
  .bot-group-left { width: 240px; flex-shrink: 0; }
  .bot-group-mid { flex: 1 1 0; }
  .bot-group-right { flex: 1 1 0; }
  #farmMapChart { min-height: 180px; }
  .farm-stats { gap: 4px; }
  .farm-stat { padding: 6px 4px; }
  .farm-stat-num { font-size: 15px; }
  .farm-stat-label { font-size: 9px; }
}

/* ≤1024px: 햄버거 메뉴, 태블릿/소형 노트북 */
@media (max-width: 1024px) {
  .mobile-menu-toggle { display: flex; align-items: center; }
  .nav-menu { display: none; }
  .header-right { display: none; }

  .page-wrap { padding: 10px 12px; }

  /* 상단: 로그인|공지 → 슬라이더+돈가시세(가로) → 하단 2열 grid */
  .top-row { flex-direction: column; height: auto; gap: 6px; }
  .left-col { flex-direction: row; width: 100%; gap: 6px; }
  .right-area { overflow: visible; flex-direction: row; flex: none; gap: 6px; }
  .slider-wrap { flex: 1 1 60%; min-width: 0; }
  .price-wrap { flex: 1 1 40%; overflow: visible; }

  /* 하단 2열 grid:
     행1: 농가현황 | 유용한콘텐츠
     행2: 활용가이드 | 데이터양돈
     행3: 업계뉴스 (span 또는 단독) */
  .bot-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .bot-group {
    display: contents !important;
  }
  .bot-group-left {
    display: contents !important;
    width: auto;
  }
  .bot-group-mid {
    display: contents !important;
  }
  .bot-group-right {
    display: contents !important;
  }

  .farm-card { order: 1; }
  .useful-card { order: 2; }
  .guide-card { order: 3; }
  .expert-card { order: 4; }
  .news-card { order: 5; }

  #farmMapChart { min-height: 180px; }
  .farm-stats { gap: 4px; }
  .farm-stat { padding: 6px 4px; }
  .farm-stat-num { font-size: 14px; }
  .farm-stat-label { font-size: 9px; }

  .uc-grid { grid-template-columns: repeat(2, 1fr); }
  .uc-icon { width: 36px; height: 36px; font-size: 16px; }
  .uc-title { font-size: 11px; }
  .uc-desc { font-size: 10px; }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ≤768px: 좌측 컬럼 세로, 터치 타겟 확대 */
@media (max-width: 768px) {
  .left-col { flex-direction: column; }

  .slide { padding: 20px 16px; }
  .slide-title { font-size: 20px; }
  .slide-desc { font-size: 12px; }
  .slide-icon { font-size: 40px; right: 20px; }

  .login-input { height: 40px; font-size: 16px; }
  .login-btn { height: 42px; font-size: 14px; }
  .signup-btn { height: 40px; line-height: 38px; font-size: 13px; }
  .login-checkbox { font-size: 12px; padding: 4px 0; }
  .login-checkbox input { width: 16px; height: 16px; }
  .user-action-btn { padding: 10px 8px; font-size: 12px; }

  .card-body { padding: 10px 12px; }
  .card-header { padding: 10px 12px; }

  .uc-grid { grid-template-columns: repeat(2, 1fr); }
  .uc-icon { width: 40px; height: 40px; font-size: 18px; }
  .uc-title { font-size: 12px; }
  .uc-desc { font-size: 10px; }

  .s-arrow { width: 28px; height: 28px; }

  /* 돈가 시세: 세로 전환 */
  .pd-top { flex-direction: column; align-items: stretch; }
  .pd-stats-row { flex-direction: column; gap: 6px; }
  .pd-stat-box { flex: 1 1 auto; border-left: none; border-top: 1px solid #f0f1f5; padding: 6px 0 0; text-align: left; }
  .pd-stat-box:first-child { border-top: none; padding-top: 0; }
  .pd-stat-val-row { justify-content: flex-start; }
  .pd-price { font-size: 26px; }

  .header-inner { padding: 0 16px; }
  .footer { padding: 10px 16px; }

  /* 농가현황 지도 카드 */
  .farm-stats { gap: 6px; }
  .farm-stat { padding: 8px 6px; }
  .farm-stat-num { font-size: 16px; }

  /* 하단 카드 최소 높이 확보 + overflow 해제 */
  .bot-group > .card { min-height: 280px; overflow: visible !important; flex-shrink: 0; }

  /* 모든 컨테이너 overflow 해제 */
  .right-area,
  .price-wrap,
  .price-card,
  .price-card .card-body,
  .card-body,
  .bot-group { overflow: visible !important; }
  .pd-body { height: auto; }
  .pd-chart-wrap { min-height: 200px; height: 200px; }
  .bot-group { flex-shrink: 0; }
}

/* ≤480px: 최대 모바일 최적화 */
@media (max-width: 480px) {
  .header { height: 44px; }
  .mobile-menu { top: 44px; }

  .page-wrap { padding: 6px 6px; }
  .page-body { gap: 6px; }

  /* ★ bot-row: grid 해제 → 세로 스택 (1024px의 display:contents 덮어쓰기) */
  .bot-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  /* ★ 모든 레이아웃 컨테이너: 세로 스택 */
  .top-row,
  .left-col,
  .bot-group,
  .bot-group-left,
  .bot-group-mid,
  .bot-group-right {
    display: flex !important;
    flex-direction: column !important;
    flex: none !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    gap: 6px !important;
  }

  /* right-area: 세로 스택 + overflow 해제 */
  .right-area {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    gap: 6px !important;
    flex: none !important;
  }

  /* ★ 모든 카드: 콘텐츠 높이에 맞춤 — shrink 방지 */
  .card,
  .card-body,
  .bot-card,
  .bot-group > .card {
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
    flex-shrink: 0 !important;
  }

  /* 슬라이더 — 모바일에서는 이미지 비율 유지 */
  .slider-wrap {
    flex: none !important;
    width: 100% !important;
  }
  .slider, .slider-track, .slide {
    height: auto !important;
  }
  .slide {
    padding: 0;
    min-width: 100%;
  }
  .slide-img {
    height: auto !important;
    object-fit: contain !important;
  }
  .slide-title { font-size: 16px; }
  .slide-sub { font-size: 11px; }
  .s-arrow { width: 26px; height: 26px; }

  /* 돈가 시세 — 모든 height:100%, overflow:hidden 끊기 */
  .price-wrap {
    flex: none !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    min-width: 0 !important;
    overflow: visible !important;
    display: block !important;
  }
  .price-card {
    height: auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .price-card .card-body {
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
  }
  .pd-body { height: auto !important; }
  .pd-top { padding: 10px 12px; }
  .pd-price { font-size: 24px; }
  .pd-change { font-size: 12px; }
  .pd-unit { font-size: 11px; }
  .pd-chart-area { padding: 6px 10px 4px; }
  .pd-chart-wrap { min-height: 140px !important; height: 140px !important; position: relative; overflow: hidden !important; }
  .pd-chart-wrap > div { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }
  .pd-bottom { min-height: 0; height: auto !important; }

  /* 로그인 카드 */
  .login-card .card-body { padding: 10px 12px; }
  .login-input { height: 42px; }
  .login-btn { height: 44px; font-size: 15px; }
  .signup-btn { height: 38px; line-height: 36px; font-size: 13px; }
  .user-action-btn { padding: 10px 8px; font-size: 13px; }

  /* 공지사항 */
  .notice-card .card-body { padding: 6px 12px; }
  .notice-item { padding: 8px 0; font-size: 12px; }

  /* 농가현황 지도 — 컴팩트 */
  .farm-card .card-body { padding: 8px 10px; }
  .farm-stats { margin-bottom: 4px; gap: 4px; }
  .farm-stat { padding: 6px 4px; }
  .farm-stat-num { font-size: 14px; }
  .farm-stat-label { font-size: 9px; }
  #farmMapChart { min-height: 160px !important; height: 160px !important; flex: none !important; }
  .farm-map { flex: none !important; }

  /* 유용한 콘텐츠 — 콘텐츠 높이에 맞춤 */
  .useful-card { padding: 0 !important; }
  .useful-card > div:first-child { padding: 10px 10px 4px !important; margin-bottom: 2px !important; }
  .uc-scroll { max-height: none !important; overflow: visible !important; padding: 0 8px 6px; }
  .uc-grid { grid-template-columns: 1fr 1fr; gap: 0; }
  .uc-item { padding: 5px 4px; gap: 6px; }
  .uc-icon { width: 30px; height: 30px; font-size: 13px; border-radius: 6px; }
  .uc-title { font-size: 11px; }
  .uc-desc { font-size: 9px; }

  /* 데이터양돈 카드 */
  .expert-card .card-body { padding: 4px 10px; }
  .expert-card .read-item { padding: 6px 0; }

  /* 활용 가이드 — 빈 상태면 최소화 */
  .guide-card .card-body { padding: 6px 10px; }
  .guide-card .read-empty { padding: 10px; font-size: 11px; }

  /* 업계 뉴스 */
  .news-card .card-body { padding: 4px 10px; }
  .news-card .read-item { padding: 6px 0; }

  /* 공통 read 항목 */
  .read-item { padding: 6px 0; }
  .read-item-title { font-size: 12px; }
  .read-tag-badge { font-size: 9px; padding: 1px 5px; }
  .read-empty { padding: 10px; }

  /* 카드 헤더 */
  .card-header { padding: 7px 10px; font-size: 12px; }

  .logo img { height: 22px; }
  .header-inner { padding: 0 12px; }
  .footer { padding: 6px 10px; }
  .footer-inner { font-size: 10px; }
}
