/* ============================
   Reset
============================ */

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

html,
body {
  height: 100%;
}

/* ============================
   Theme Tokens
============================ */

:root {
  color-scheme: light;

  /* Light Theme Colors */
  --bg-body: #f3f4f6;
  --bg-main: #ffffff;
  --bg-elevated: #ffffff;
  --bg-panel: #f9fafb;
  --bg-panel-soft: #f9fafb;

  --bg-header: linear-gradient(to right, #ffffff, #f9fafb);
  --border-header: rgba(209, 213, 219, 1);
  --shadow-header: 0 10px 25px rgba(15, 23, 42, 0.08);

  --bg-map: #e5e7eb;

  --bg-timeline: linear-gradient(to bottom, #f9fafb, #e5e7eb);
  --border-timeline: rgba(209, 213, 219, 1);

  --bg-cursor: rgba(255, 255, 255, 0.9);
  --border-cursor: rgba(148, 163, 184, 0.5);
  --shadow-cursor: 0 8px 18px rgba(15, 23, 42, 0.15);

  --bg-sonar: radial-gradient(circle at top, #020617, #020617 60%, #000 100%);
  --border-sonar: rgba(15, 23, 42, 0.85);

  --border-subtle: rgba(148, 163, 184, 0.35);
  --border-strong: rgba(107, 114, 128, 0.6);

  --accent: #0284c7;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-strong: #0ea5e9;
  --accent-deep: #0369a1;

  --text-main: #0f172a;
  --text-muted: #6b7280;
  --danger: #dc2626;

  --shadow-strong: 0 22px 55px rgba(15, 23, 42, 0.18);
  --shadow-soft: 0 16px 30px rgba(15, 23, 42, 0.12);

  --status-pill-bg: rgba(255, 255, 255, 0.9);
  --status-pill-border: rgba(148, 163, 184, 0.5);
  --status-live-bg: rgba(248, 113, 113, 0.06);
  --status-live-border: rgba(248, 113, 113, 0.7);
  --status-live-text: #b91c1c;

  --timeline-track-bg: linear-gradient(
    to right,
    rgba(59, 130, 246, 0.7),
    rgba(148, 163, 184, 0.9)
  );
  --timeline-track-border: rgba(209, 213, 219, 1);

  --btn-ghost-bg: rgba(15, 23, 42, 0.04);
  --btn-ghost-bg-dark: rgba(15, 23, 42, 0.9);

  /* 기본 PC에서 우측 패널들이 딱 맞도록 조정해둔 값 */
  --ship-panel-height: 150px;
  --sonar-info-panel-height: 110px;
  --footer-panel-height: 64px; 
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg-body:
    radial-gradient(circle at top left, #1e293b 0, transparent 50%),
    radial-gradient(circle at top right, #0f172a 0, transparent 55%),
    radial-gradient(circle at bottom, #020617 0, #000 65%);

  --bg-main: #020617;
  --bg-elevated: rgba(2, 6, 23, 0.92);
  --bg-panel: rgba(15, 23, 42, 0.9);
  --bg-panel-soft: rgba(15, 23, 42, 0.85);

  --bg-header:
    linear-gradient(to right, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.96)),
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.05), transparent 60%);
  --border-header: rgba(15, 23, 42, 0.9);
  --shadow-header: 0 12px 30px rgba(15, 23, 42, 0.75);

  --bg-map: #020617;

  --bg-timeline:
    radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96)),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.98));
  --border-timeline: rgba(15, 23, 42, 0.9);

  --bg-cursor: radial-gradient(
    circle at top left,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.9)
  );
  --border-cursor: rgba(148, 163, 184, 0.4);
  --shadow-cursor: 0 10px 24px rgba(15, 23, 42, 0.9);

  --border-subtle: rgba(148, 163, 184, 0.25);
  --border-strong: rgba(148, 163, 184, 0.45);

  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-strong: #0ea5e9;
  --accent-deep: #0284c7;

  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #f97373;

  --shadow-strong: 0 24px 60px rgba(15, 23, 42, 0.9);
  --shadow-soft: 0 14px 35px rgba(15, 23, 42, 0.7);

  --status-pill-bg: rgba(15, 23, 42, 0.55);
  --status-pill-border: rgba(56, 189, 248, 0.3);
  --status-live-bg: rgba(248, 113, 113, 0.08);
  --status-live-border: rgba(248, 113, 113, 0.6);
  --status-live-text: #fecaca;

  --timeline-track-bg: linear-gradient(
    to right,
    rgba(30, 64, 175, 0.7),
    rgba(15, 23, 42, 0.9)
  );
  --timeline-track-border: rgba(15, 23, 42, 0.9);

  --btn-ghost-bg: rgba(15, 23, 42, 0.3);
  --btn-ghost-bg-dark: rgba(15, 23, 42, 0.9);
}

/* ============================
   Base
============================ */

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    system-ui,
    "Segoe UI",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Malgun Gothic",
    sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
}

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

/* ============================
   Header
============================ */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.75rem 1.5rem;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-header);
  box-shadow: var(--shadow-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-circle {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  background:
    radial-gradient(circle at 30% 0%, #38bdf8, #1d4ed8 55%, #020617 100%);
  box-shadow:
    0 0 0 2px rgba(148, 163, 184, 0.2),
    0 14px 35px rgba(15, 23, 42, 0.85);
  color: white;
}

.app-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.app-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-pill {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--status-pill-border);
  background: var(--status-pill-bg);
  backdrop-filter: blur(10px);
  color: var(--text-muted);
}

.status-live {
  background: var(--status-live-bg);
  border-color: var(--status-live-border);
  color: var(--status-live-text);
}

.header-time {
  display: flex;
  align-items: center;
}

.observation-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-main);
}

.obs-row {
  display: flex;
  gap: 6px;
}

.obs-label {
  opacity: 0.8;
}

.obs-date,
.obs-time {
  font-weight: 600;
}

/* Theme toggle */

.theme-toggle-btn {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  background: var(--btn-ghost-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

:root[data-theme="dark"] .theme-toggle-btn {
  background: var(--btn-ghost-bg-dark);
  color: var(--text-main);
}

.theme-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--text-main);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.theme-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.icon-sun {
  display: inline-block;
}
.icon-moon {
  display: none;
}
:root[data-theme="dark"] .icon-sun {
  display: none;
}
:root[data-theme="dark"] .icon-moon {
  display: inline-block;
}

/* ============================
   Main Layout
============================ */

.app-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.5rem 1.4rem;
  gap: 0.9rem;
  max-width: 100%;
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.main-layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(320px, 1.25fr);
  gap: 1.1rem;
  align-items: stretch;
  min-height: 0;
}

.main-left,
.main-right {
  min-height: 0;
}

.main-left {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.main-right {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

/* ============================
   Map / Sonar main view
============================ */

.map-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg-elevated);
  border-radius: 1rem;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

/* 지도/소나 2개 뷰 겹쳐놓고 스위칭 */
.primary-view {
  position: absolute;
  inset: 0;
  display: none;
}

.primary-view.is-active {
  display: block;
}

.primary-view--map .map {
  width: 100%;
  height: 100%;
}

/* 소나 확대 뷰 */
.primary-view--sonar {
  background: radial-gradient(circle at top, #022c58, #000814);
}

.sonar-main-inner {
  padding: 0.75rem 0.9rem 0.9rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sonar-main-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #e5e7eb;
  font-size: 0.8rem;
}

.sonar-main-title {
  font-weight: 600;
}

.sonar-main-subtitle {
  opacity: 0.7;
}

.sonar-main-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #020617;
  overflow: hidden;
}

#sonar-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================
   Sonar expand switching
============================ */

/* map-shell에 is-sonar-mode 붙으면 좌측은 소나, 기본은 지도 */
.map-shell.is-sonar-mode .primary-view--map {
  display: none;
}

.map-shell.is-sonar-mode .primary-view--sonar {
  display: block;
}

/* 기본: 지도 모드 */
.map-shell:not(.is-sonar-mode) .primary-view--map {
  display: block;
}

.map-shell:not(.is-sonar-mode) .primary-view--sonar {
  display: none;
}


/* 커서 패널 */

.cursor-info {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--bg-cursor);
  border: 1px solid var(--border-cursor);
  box-shadow: var(--shadow-cursor);
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  pointer-events: none;
  font-size: 0.7rem;
}

.cursor-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-size: 0.65rem;
}

.coordinates {
  display: flex;
  gap: 0.75rem;
}

/* MapLibre logo 숨기기 */

.maplibregl-ctrl-logo,
.maplibregl-ctrl-attrib {
  display: none !important;
}

/* ============================
   Timeline
============================ */

.timeline-panel {
  border-radius: 1rem;
  border: 1px solid var(--border-timeline);
  background: var(--bg-timeline);
  padding: 0.8rem 1rem 1.05rem;
  box-shadow: var(--shadow-soft);
  flex: 0 0 auto;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  position: relative;
  margin-bottom: 0.55rem;
  gap: 0.3rem;
}

.live-indicator-container {
  position: absolute;
  left: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.live-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--status-live-text);
}

.spacer {
  position: absolute;
  right: 0;
  width: 80px;
  height: 100%;
}

/* Playback 버튼 */

.control-btn,
.play-btn {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.8rem;
  background: var(--btn-ghost-bg);
  color: var(--text-main);
  font-size: 0.78rem;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.08s ease;
}

:root[data-theme="dark"] .control-btn,
:root[data-theme="dark"] .play-btn {
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.98),
    rgba(15, 23, 42, 0.9)
  );
}

.control-btn:hover,
.play-btn:hover {
  border-color: var(--accent);
  background: var(--bg-main);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
}

.control-btn:active,
.play-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.play-btn {
  padding-inline: 1.3rem;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  border-color: transparent;
  color: white;
  font-weight: 600;
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.4),
    0 14px 26px rgba(15, 23, 42, 0.3);
}

.play-btn.playing {
  background: radial-gradient(circle at top, #0f172a, #020617);
  border-color: rgba(129, 140, 248, 0.75);
}

/* Range */

.timeline-range {
  width: 100%;
  margin-top: 0.38rem;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--timeline-track-bg);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--timeline-track-border);
}

.timeline-range::-webkit-slider-thumb,
.timeline-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-strong);
  border: 2px solid #ffffff;
  box-shadow:
    0 0 0 4px var(--accent-soft),
    0 0 12px rgba(56, 189, 248, 0.6);
  cursor: pointer;
}

/* ============================
   Right side panels
============================ */

.panel {
  background: var(--bg-panel-soft);
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
  backdrop-filter: blur(18px);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.panel:hover {
  border-color: rgba(148, 163, 184, 0.55);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.panel-header {
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid var(--border-strong);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* 선박 / 소나 헤더 공통: 좌측 타이틀, 우측 메타(뱃지) */
.panel-header--ship,
.panel-header--sonar,
.panel-header--with-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* 헤더 오른쪽 영역 안에서 다시 오른쪽으로 붙이기 */
.panel-header-ship-meta,
.panel-header-sonar-meta {
  display: flex;
  align-items: center;
  margin-left: auto;   /* ← 우측으로 밀기 */
  gap: 0.35rem;
}

.panel-header-ship-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  text-align: right;
  white-space: nowrap;
}

.panel-body {
  padding: 0.8rem 0.95rem 0.95rem;
  font-size: 0.82rem;
  color: var(--text-main);
  overflow-y: auto;
}

/* 우측 패널 높이 분배 (PC 기준) */
.panel--ship {
  flex: 0 0 var(--ship-panel-height);
}

.panel--sonar-info {
  flex: 0 0 var(--sonar-info-panel-height);
}

.panel--footer {
  flex: 0 0 var(--footer-panel-height);
}

.panel--sonar-log {
  flex: 1 1 auto;
  min-height: 0;
}

/* 내용이 없어도 패널 자체 높이는 유지하되,
   패널별 변수 사용 */
.panel--ship .panel-body--fixed {
  min-height: calc(var(--ship-panel-height) - 56px);
}

.panel--sonar-info .panel-body--fixed {
  min-height: calc(var(--sonar-info-panel-height) - 56px);
}

/* 공통 placeholder 텍스트 */
.info-placeholder {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================
   Ship / Sonar info 공통 레이아웃
============================ */

/* 2열 그리드: 위 label, 아래 value 구조 */

#ship-info-panel .ship-info-body,
#sonar-info-panel .sonar-info-body {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 50 : 50 */
  column-gap: 0.75rem;
  row-gap: 0.35rem;
}

#ship-info-panel .ship-info-body .row,
#sonar-info-panel .sonar-info-body .row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0;
}

#ship-info-panel .ship-info-body .label,
#sonar-info-panel .sonar-info-body .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

#ship-info-panel .ship-info-body .value,
#sonar-info-panel .sonar-info-body .value {
  font-size: 0.82rem;
  font-weight: 500;
}

/* 선박 + 소나 어군 정보 → 내부 스크롤 제거 */
.panel--ship .panel-body,
.panel--sonar-info .panel-body {
  overflow-y: visible;
}

/* ============================
   Ship status pill
============================ */

.ship-status-pill {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid var(--border-subtle);
  background: var(--btn-ghost-bg);
  color: var(--text-muted);
  white-space: nowrap;
}

/* 운항중 (녹색 계열) */
.ship-status-pill--running {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.7);
  color: #15803d;
}

/* 정박중 (파란 계열) */
.ship-status-pill--anchored {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.7);
  color: #1d4ed8;
}

/* ============================
   Sonar header badges
============================ */

.sonar-pill {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid var(--border-subtle);
  background: var(--btn-ghost-bg);
  color: var(--text-muted);
  white-space: nowrap;
}

/* 어군 탐지 여부 */
.sonar-pill--detect-on {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.7);
  color: #15803d;
}

.sonar-pill--detect-off {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.6);
  color: #4b5563;
}

/* 강도 배지 (색은 약간 강조) */
.sonar-pill--strength {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.7);
  color: #1d4ed8;
}

/* ============================
   Sonar mini panel
============================ */

.panel-body--sonar-mini {
  padding: 0.7rem 0.95rem 0.8rem;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.sonar-mini-wrap {
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #020617;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

/* mini 안에 들어오는 지도/캔버스를 꽉 채움 */
.sonar-mini-wrap .map,
.sonar-mini-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.sonar-expand-btn {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: transparent;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.sonar-expand-btn:hover {
  background-color: rgba(148, 163, 184, 0.08);
}

.sonar-expand-btn.is-active {
  background-color: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.8);
}

/* ============================
   Footer panel
============================ */

.panel-body--footer {
  padding: 0.6rem 0.95rem 0.7rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.panel-body--footer .copyright-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================
   Utilities
============================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================
   Responsive
============================ */

/* 데스크톱: 전체 화면 안에서만 스크롤 (우측 패널 내부 스크롤만 허용) */
@media (min-width: 1024px) {
  .app {
    height: 100vh;
  }

  .app-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .main-layout {
    height: 100%;
    min-height: 0;
  }

  .main-right {
    min-height: 0;
  }

  .panel-body {
    /* 패널 자체는 고정, 내용만 스크롤 */
    overflow-y: auto;
  }
}

/* 태블릿 이하: 좌/우를 세로로 쌓기 */
@media (max-width: 1023.98px) {
  .app-main {
    padding-inline: 1rem;
  }

  .main-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .main-right {
    margin-top: 0.75rem;
  }

  .panel--ship,
  .panel--sonar-info,
  .panel--footer,
  .panel--sonar-log {
    flex: 0 0 auto;
  }
}

/* 모바일 헤더 레이아웃 */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .header-status {
    align-self: stretch;
    justify-content: space-between;
    width: 100%;
  }

  .map-shell {
    min-height: 320px;
  }
}


/* === 날짜 네비게이션 === */
.date-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 1.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.03); /* 라이트 모드 기본 */
  font-size: 0.875rem;
  white-space: nowrap;
}

html.dark .date-nav {
  background: rgba(148, 163, 184, 0.15); /* 다크 모드일 때 살짝 밝게 */
}

.date-nav-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.15rem 0.25rem;
  color: #64748b;
}

.date-nav-btn:hover {
  color: #0f172a;
}

html.dark .date-nav-btn {
  color: #e5e7eb;
}

.date-nav-display {
  padding: 0 0.25rem;
}

.date-nav-label {
  font-weight: 500;
  color: #0f172a;
}

html.dark .date-nav-label {
  color: #f9fafb;
}

/* === 모바일 대응: 헤더 + 날짜 네비게이션 정리 === */
@media (max-width: 640px) {
  /* 헤더가 줄바꿈 가능하도록 */
  .app-header {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }

  /* 브랜드는 첫 줄 전체 차지 */
  .app-header .brand {
    flex: 1 1 100%;
    margin-bottom: 0.1rem;
  }

  /* 상태 영역은 두 번째 줄에 오른쪽 정렬 */
  .app-header .header-status {
    flex: 1 1 100%;
    justify-content: flex-end;
    align-items: center;
    gap: 0.25rem 0.5rem;
  }

  /* 날짜 네비: 마진/패딩 줄이고 너무 크지 않게 */
  .date-nav {
    margin: 0;
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
  }

  /* 날짜 텍스트가 길어도 줄 넘치지 않도록 */
  .date-nav-label {
    max-width: 7.5rem; /* 필요하면 숫자 조절 */
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 관측 일자/시각 블럭도 살짝 줄이기 */
  .header-time {
    font-size: 0.75rem;
  }

  .header-time .obs-row {
    gap: 0.25rem;
  }
}


/* === 타임라인 눈금 === */
.timeline-panel {
  /* 혹시 없으면 기본 여백 정도만 */
  padding: 0.5rem 0.75rem;
}

.timeline-controls {
  margin-top: 0.25rem;
}

.timeline-range {
  width: 100%;
}

.timeline-slider-row {
  margin-top: 0.25rem;
}

.timeline-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94a3b8;
}

html.dark .timeline-ticks {
  color: #cbd5f5;
}
