/* 해외 시장 지표 페이지 — overseas_stock.css 와 동일 레이아웃 문법, 색상은 틸(teal). */
.overseas-market-page {
  --om-primary: #0d9488;
  --om-primary-soft: rgba(13, 148, 136, 0.1);
  --om-bg: #f4f8f7;
  --om-card: #ffffff;
  --om-border: #e0e8e6;
  --om-text: #1f2230;
  --om-muted: #7a8096;
  --om-up: #e23b4f;
  --om-down: #2f6fed;
  color: var(--om-text);
}

/* Hero */
.om-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 26px 28px;
  background: linear-gradient(135deg, #134e4a, #0d9488);
  border-radius: 18px;
  color: #fff;
  margin-bottom: 26px;
}
.om-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  opacity: 0.8;
  margin: 0 0 6px;
}
.om-hero h1 {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0 0 8px;
}
.om-hero-text {
  font-size: 0.92rem;
  opacity: 0.9;
  margin: 0;
  max-width: 560px;
}
.om-hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* KST/ET 시계 */
.om-clock {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 8px 14px;
  font-variant-numeric: tabular-nums;
}
.om-clock-row strong {
  margin-left: 6px;
  font-weight: 700;
}

/* Buttons */
.om-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
.om-btn:active { transform: translateY(1px); }
.om-btn i { margin-right: 5px; }
.om-btn-ghost-light {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.om-btn-ghost-light:hover { background: rgba(255, 255, 255, 0.25); }
/* 아이콘 단독 버튼 (a 태그 — 네이버 증권 새 창) */
.om-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 10px 14px;
}
.om-btn-icon i { margin-right: 0; }
.om-btn-icon:hover { color: #fff; }

/* 파일 폴더형 탭: 활성 탭은 본문과 같은 배경 + 아래 경계선 제거로 이어져 보이고,
   비활성 탭 사이에는 경계선이 남는다. */
.om-folder { margin-bottom: 26px; }
.om-tabs {
  display: flex;
  gap: 0;
  position: relative;
  z-index: 2;
  margin-bottom: -1px; /* 본문 상단 테두리와 1px 겹쳐 활성 탭이 연속되게 */
  overflow-x: auto;
  scrollbar-width: none;
}
.om-tabs::-webkit-scrollbar { display: none; }
.om-tab {
  flex: 0 0 auto;
  border: 1px solid var(--om-border);
  border-radius: 10px 10px 0 0;
  background: #ecf1f0;
  color: var(--om-muted);
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.om-tab + .om-tab { margin-left: -1px; } /* 탭 사이 경계선은 한 줄만 */
.om-tab.active {
  background: var(--om-card);
  color: var(--om-primary);
  border-bottom-color: var(--om-card); /* 본문과 경계선 없이 연속 */
  position: relative;
  z-index: 3;
}

/* 폴더 본문: 탭 아래 큰 카드. 안에 기간 바 + 지표 카드들이 담긴다. */
.om-folder-body {
  background: var(--om-card);
  border: 1px solid var(--om-border);
  border-radius: 0 12px 12px 12px;
  padding: 16px 18px 18px;
}

/* 섹션별 기준 기간 — 세그먼트(표) 형태, 아래 수평선 */
.om-section-period {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--om-border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.om-section-period[hidden] { display: none; }
.om-section-period-btns {
  display: inline-flex;
  border: 1px solid var(--om-border);
  border-radius: 10px;
  overflow: hidden;
}
.om-section-period-btns .om-period-btn {
  border: none;
  border-right: 1px solid var(--om-border);
  border-radius: 0;
  padding: 7px 14px;
}
.om-section-period-btns .om-period-btn:last-child { border-right: none; }

/* 카드 그리드 */
.om-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.om-card {
  background: var(--om-card);
  border: 1px solid var(--om-border);
  border-radius: 14px;
  padding: 16px 18px;
  min-height: 138px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.om-card.clickable { cursor: pointer; transition: box-shadow 0.15s ease, transform 0.1s ease; }
.om-card.clickable:hover {
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.16);
  transform: translateY(-2px);
}
.om-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.om-card-name { font-size: 0.92rem; font-weight: 700; }
.om-card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--om-muted);
  background: var(--om-primary-soft);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}
.om-card-price {
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.om-card-change {
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.om-card-change.up { color: var(--om-up); }
.om-card-change.down { color: var(--om-down); }
.om-card-change.flat { color: var(--om-muted); }
.om-card-ohl {
  font-size: 0.76rem;
  color: var(--om-muted);
  font-variant-numeric: tabular-nums;
}
.om-card-foot {
  margin-top: auto;
  font-size: 0.7rem;
  color: var(--om-muted);
}
.om-card.error { border-color: #f3c1c8; }
.om-card.error .om-card-price { font-size: 1rem; color: #dc2626; }
.om-card.active {
  border-color: var(--om-primary);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.18);
}

/* 스켈레톤 */
.om-card.skeleton .om-card-price,
.om-card.skeleton .om-card-change,
.om-card.skeleton .om-card-ohl {
  color: transparent;
  background: linear-gradient(90deg, #eef1f0 25%, #f7faf9 50%, #eef1f0 75%);
  background-size: 200% 100%;
  animation: om-shimmer 1.2s infinite;
  border-radius: 6px;
  min-height: 0.9em;
}
@keyframes om-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 차트 패널 — 클릭한 카드 바로 다음 위치로 JS가 이동시킨다.
   그리드 자식이 되므로 전체 컬럼을 차지하게 해 카드 줄 바로 아래 한 줄로 펼쳐진다. */
.om-chart-panel {
  background: var(--om-card);
  border: 1px solid var(--om-primary);
  border-radius: 14px;
  padding: 18px 20px;
}
.om-card-grid > .om-chart-panel {
  grid-column: 1 / -1;
}
.om-chart-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.om-chart-title strong { font-size: 1.05rem; font-weight: 800; }
.om-chart-meta {
  margin-left: 8px;
  font-size: 0.78rem;
  color: var(--om-muted);
}
.om-period-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.om-period-btn {
  border: 1px solid var(--om-border);
  background: #fff;
  color: var(--om-muted);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.om-period-btn.active {
  background: var(--om-primary);
  border-color: var(--om-primary);
  color: #fff;
}
.om-period-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.om-chart-wrap {
  position: relative;
  height: 340px;
}
.om-chart-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  color: var(--om-muted);
  pointer-events: none;
}
.om-chart-msg:empty { display: none; }
.om-chart-foot {
  margin: 10px 0 0;
  font-size: 0.74rem;
  color: var(--om-muted);
}

@media (max-width: 576px) {
  .om-hero { padding: 20px; }
  .om-chart-wrap { height: 260px; }
}
