/* ==============================================================================
   Marine Fishery Monitoring Dashboard - Dark Modern Glassmorphic Theme (v2.0)
   - Absolute Geographic Map Pinning on Zoom (Zero-drift guaranteed)
   - Proportioned Viewport for 118~137°E, 28~45°N
   ============================================================================== */

:root {
  --bg-main: #070D18;
  --bg-sidebar: rgba(15, 23, 42, 0.90);
  --bg-card: rgba(30, 41, 59, 0.70);
  --bg-card-hover: rgba(51, 65, 85, 0.80);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 229, 255, 0.40);
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --accent-lps: #00E5FF; /* 대형선망 통일 시안 */
  --accent-sps: #FF9100; /* 소형선망 통일 오렌지 */
  --accent-green: #00E676;
  --accent-red: #FF1744;
  --accent-carrier: #00E5FF;
  --accent-light: #00E5FF;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  height: 60px;
  background: rgba(11, 19, 43, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #00E5FF 0%, #0077B6 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #070D18;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

.brand-badge {
  font-size: 0.72rem;
  background: rgba(0, 229, 255, 0.15);
  color: #00E5FF;
  padding: 2px 7px;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  margin-left: 8px;
}

.header-center {
  display: flex;
  align-items: center;
}

.feature2-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(0, 230, 118, 0.4);
  padding: 6px 14px;
  border-radius: 30px;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.15);
}

.pill-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #E2E8F0;
}

.dot-live {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  min-width: 90px;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
  width: 100%;
}

.stat-val {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  width: 100%;
}

.header-vessel-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-highlight {
  color: #FF5252;
}

.clock-display {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  background: #020617;
  padding: 6px 10px;
  border-radius: 6px;
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  letter-spacing: 0.01em;
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Main Layout */
.main-container {
  display: flex;
  flex: 1;
  height: calc(100vh - 60px);
  position: relative;
  overflow: hidden;
}

/* Sidebar (Left Panel Fixed Width 320px) */
.sidebar {
  flex: 0 0 320px !important;
  width: 320px !important;
  min-width: 320px !important;
  max-width: 320px !important;
  box-sizing: border-box !important;
  background: var(--bg-sidebar);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 900;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.sidebar-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  color: #E2E8F0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-lps);
}

/* Search Box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px 10px;
  transition: border-color 0.2s;
}

.search-box:focus-within {
  border-color: var(--accent-lps);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.search-icon {
  color: var(--text-dim);
  margin-right: 8px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.84rem;
  padding: 8px 0;
}

.clear-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
}

.search-results-dropdown {
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.search-item {
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.search-item:hover {
  background: rgba(0, 229, 255, 0.12);
}

.search-vname {
  font-weight: 700;
  color: var(--text-main);
}

.search-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Radio & Selects */
.mode-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.80rem;
  color: var(--text-muted);
  cursor: pointer;
}

.radio-label input[type="radio"] {
  accent-color: var(--accent-lps);
}

.date-picker-wrap {
  margin-top: 10px;
}

.input-sublabel {
  font-size: 0.74rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 6px;
}

.custom-select {
  width: 100%;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  padding: 8px 10px;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

.custom-select:focus {
  border-color: var(--accent-lps);
}

/* Presets */
.preset-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-btn-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 5px 0;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.btn-preset:hover {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-lps);
  border-color: var(--border-active);
}

.btn-danger:hover {
  background: rgba(255, 23, 68, 0.2);
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.quick-link {
  background: none;
  border: none;
  color: var(--accent-lps);
  font-size: 0.72rem;
  cursor: pointer;
}

.quick-link:hover {
  text-decoration: underline;
}

.sep {
  color: var(--text-dim);
  font-size: 0.70rem;
  margin: 0 4px;
}

/* Filter Tree */
.filter-tree {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tree-node {
  background: rgba(2, 6, 23, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
}

.node-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.root-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #F1F5F9;
}

.node-children {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 6px;
  border-left: 2px solid rgba(255, 255, 255, 0.06);
}

.tree-subnode {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 8px 10px;
}

.sub-header {
  margin-bottom: 6px;
}

.badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
}

.badge-lps {
  background: rgba(0, 229, 255, 0.18);
  color: var(--accent-lps);
  border: 1px solid rgba(0, 229, 255, 0.35);
}

.badge-sps {
  background: rgba(255, 145, 0, 0.18);
  color: var(--accent-sps);
  border: 1px solid rgba(255, 145, 0, 0.35);
}

.badge-disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge-count {
  font-size: 0.70rem;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 10px;
}

.disabled-subnode {
  opacity: 0.45;
  pointer-events: none;
}

.fleet-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
  max-height: 95px;
  overflow-y: auto;
  padding: 4px 2px;
}

.fleet-chips-container {
  margin: 4px 0 6px 0;
}

.inactive-fleets-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.68rem;
  color: var(--text-dim);
  transition: all 0.2s;
  user-select: none;
}

.inactive-fleets-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.2);
}

.inactive-fleets-toggle .chevron-icon {
  font-size: 0.60rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.inactive-fleets-toggle.open .chevron-icon {
  transform: rotate(180deg);
}

.inactive-fleets-wrap {
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 120px;
  opacity: 1;
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  padding: 4px;
}

.inactive-fleets-wrap.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 4px;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

.fleet-chip {
  font-size: 0.70rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.fleet-chip.inactive-chip {
  opacity: 0.65;
  border-style: dashed;
}

.fleet-chip.inactive-chip:hover {
  opacity: 1.0;
}

.fleet-chip.resting-chip {
  border: 1px dashed rgba(255, 255, 255, 0.28) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  opacity: 0.65;
  color: var(--text-dim);
}

.fleet-chip.resting-chip:hover {
  opacity: 0.95;
  border-color: rgba(0, 229, 255, 0.5) !important;
}

.fleet-chip.resting-chip.active {
  border: 1px dashed var(--accent-lps) !important;
  background: rgba(0, 229, 255, 0.12) !important;
  color: #E2E8F0;
  opacity: 0.90;
}

.fleet-chip.resting-chip.active.sps {
  border: 1px dashed var(--accent-sps) !important;
  background: rgba(255, 145, 0, 0.12) !important;
  color: #E2E8F0;
  opacity: 0.90;
}

.fleet-chip.active {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--accent-lps);
  color: #FFFFFF;
}

.fleet-chip.active.sps {
  background: rgba(255, 145, 0, 0.2);
  border-color: var(--accent-sps);
}

.role-selector-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.role-selector-row label {
  cursor: pointer;
  color: var(--text-muted);
}

/* Feature 2 Live Panel */
.f2-panel {
  background: rgba(0, 230, 118, 0.04);
  border: 1px solid rgba(0, 230, 118, 0.25);
  border-radius: 8px;
  margin: 10px;
}

.f2-badge {
  font-size: 0.65rem;
  background: var(--accent-green);
  color: #070D18;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}

.f2-control-item {
  margin-top: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.time-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-input {
  background: #020617;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.80rem;
  color-scheme: dark;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sublabel-text {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.speed-legend-bar {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.70rem;
  color: var(--text-dim);
}

.spd-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.color-dot.red { background-color: var(--accent-red); }
.color-dot.green { background-color: var(--accent-green); }

.opacity-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.range-slider {
  flex: 1;
  accent-color: var(--accent-green);
}

.slider-pct {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-main);
}

/* Map Wrapper with Centered Red Framed Canvas (Point 6: 28~45°N, 118~137°E 고정 프레임) */
.map-wrapper {
  flex: 1;
  position: relative;
  height: 100%;
  background: radial-gradient(circle at center, #0B132B 0%, #030712 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 14px 12px 14px;
  gap: 0;
  overflow: hidden;
  box-sizing: border-box;
}

#map-viewport-frame {
  position: relative;
  aspect-ratio: 19 / 17;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100% - 76px);
  max-width: calc(100% - 90px);
  margin: 0 auto 20px auto; /* Standard gutter: prevents longitude tick overlap with bottom summary bar */
  border: 2.5px solid #000000;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.95), inset 0 0 20px rgba(0, 0, 0, 0.6);
  background: #070D18;
  overflow: visible;
}

#map {
  width: 100%;
  height: 100%;
  background: #070D18;
  overflow: hidden;
}

/* Floating Overlays */
.map-floating-overlay {
  position: absolute;
  z-index: 850;
  pointer-events: auto;
}

.top-left {
  top: 16px;
  left: 16px;
}

.top-right {
  top: 16px;
  right: 16px;
}

.eez-legend-card, .vessel-legend-card {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: #E2E8F0;
  margin-bottom: 5px;
}

.legend-row:last-child {
  margin-bottom: 0;
}

.legend-line {
  width: 24px;
  height: 3px;
  display: inline-block;
  border-radius: 1px;
}

.eez-line {
  background-color: #000000;
  border-top: 1px solid #FFFFFF;
  border-bottom: 1px solid #FFFFFF;
}

.prohib-line {
  background: repeating-linear-gradient(90deg, #78909C 0, #78909C 4px, transparent 4px, transparent 8px);
  height: 2px;
}

.fg-lps-line {
  background: #00E5FF;
  border-top: 1px dashed #00E5FF;
}

.fg-chub-line {
  background: #FFD600;
  border-top: 1px dashed #FFD600;
}

.vessel-legend-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: #94A3B8;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

.vessel-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  font-size: 0.72rem;
  color: #E2E8F0;
}

.vessel-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.highlight-legend {
  background: rgba(224, 64, 251, 0.16);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(224, 64, 251, 0.45);
}

.circle-legend-marker,
.circle-legend-active {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.8px solid #FF1744;
  background: rgba(255, 23, 68, 0.35);
  display: inline-block;
  flex-shrink: 0;
}

.circle-legend-done {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.8px solid #000000;
  background: rgba(0, 0, 0, 0.35);
  display: inline-block;
  flex-shrink: 0;
}

/* HSI Colorbar */
.hsi-colorbar-wrap {
  right: 16px;
  top: 175px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  width: 120px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.hsi-colorbar-title {
  font-size: 0.70rem;
  font-weight: 700;
  color: #CBD5E1;
  text-align: center;
  margin-bottom: 8px;
}

.hsi-bar-outer {
  display: flex;
  height: 130px;
  gap: 8px;
}

.hsi-bar-gradient {
  width: 16px;
  height: 100%;
  border-radius: 3px;
  border: 1px solid #000;
  background: linear-gradient(to bottom,
    #7A0403 0%,
    #D02802 12%,
    #F66014 25%,
    #FEA22D 38%,
    #E1E339 50%,
    #77FA62 62%,
    #20DE8B 75%,
    #1FA6CE 88%,
    #30123B 100%
  );
}

.hsi-bar-ticks {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* Leaflet Zoom Control Position Adjustment (타임라인 바 겹침 방지) */
.leaflet-bottom.leaflet-right {
  bottom: 16px !important;
  right: 16px !important;
}

/* Timeline Bottom Bar (Placed outside and below map-viewport-frame, standardized 56px height) */
.timeline-bar {
  position: relative;
  width: min(940px, 100%);
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px 18px;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sharp distinct grid cell boundaries without blurring (User: 격자 테두리가 뚜렷하게, 뭉개지 않음) */
.crisp-hsi-layer {
  image-rendering: pixelated !important;
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: crisp-edges !important;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00E5FF, #0088CC);
  border: none;
  color: #070D18;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
  transition: transform 0.15s;
}

.play-btn:hover {
  transform: scale(1.06);
}

.speed-toggle-group {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 2px;
}

.spd-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.spd-btn.active {
  background: rgba(0, 229, 255, 0.25);
  color: var(--accent-lps);
}

.timeline-slider-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-slider {
  width: 100%;
  accent-color: var(--accent-lps);
  height: 6px;
  cursor: pointer;
}

.time-tick-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-dim);
}

.current-time-badge {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-lps);
  background: #020617;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-active);
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Switch UI */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
}

input:checked + .slider {
  background-color: var(--accent-green);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

.hidden {
  display: none !important;
}

/* ==============================================================================
   ★ [핵심 수정: Point 7] 줌 확대/축소 시 좌표 100% 절대 고정 마커 스타일
   - .boat-marker-div에 어떠한 CSS transition도 주지 않음 (Leaflet transform 간섭 차단)
   - 회전(transform: rotate)은 내부의 .boat-marker-inner에만 격리 적용
   ============================================================================== */
.boat-marker-div {
  position: absolute !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  overflow: visible !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  /* NO transition: transform allowed! Leaflet manages position via translate3d and negative margin */
  transition: none !important;
}

.boat-marker-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
}

.boat-rotator {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  pointer-events: auto;
}

.boat-marker-svg {
  display: block;
  pointer-events: auto;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.85));
}

/* ==============================================================================
   ★ [조업(양망) 중 본선 고품질 소나 레이더 루핑 펄스 효과]
   - 점선 원 완전 제거 (조업 어장 원과의 혼동 차단)
   - 부드럽게 퍼져나가는 3중 컨센트릭 소나 레이더 파동 (Solid High-Tech Ripple)
   - 이동(재생) 및 정지 모든 상황에서 100% 영구 연속 루핑 보장
   ============================================================================== */
.sonar-emitter {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 0;
}

.sonar-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.8px solid #E040FB;
  background: radial-gradient(circle, rgba(224, 64, 251, 0.38) 0%, rgba(217, 70, 239, 0.10) 55%, transparent 100%);
  box-shadow: 0 0 12px rgba(224, 64, 251, 0.70), 0 0 4px rgba(244, 114, 182, 0.50);
  pointer-events: none;
  opacity: 0;
  animation: sonar-ripple 2.1s cubic-bezier(0.12, 0.55, 0.35, 1) infinite;
}

.sonar-ring.ring-1 {
  animation-delay: 0s;
}

.sonar-ring.ring-2 {
  animation-delay: 0.7s;
}

.sonar-ring.ring-3 {
  animation-delay: 1.4s;
}

@keyframes sonar-ripple {
  0% {
    width: 10px;
    height: 10px;
    opacity: 0.95;
    border-width: 2.2px;
  }
  50% {
    opacity: 0.60;
    border-width: 1.6px;
  }
  100% {
    width: 50px;
    height: 50px;
    opacity: 0;
    border-width: 0.6px;
  }
}

/* Leaflet Custom Popups */
.leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.96) !important;
  backdrop-filter: blur(14px) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-active) !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75) !important;
  padding: 4px !important;
}

.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.96) !important;
}

.custom-popup {
  padding: 8px 10px;
  font-size: 0.80rem;
  line-height: 1.45;
  min-width: 260px;
}

.popup-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.popup-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.popup-grid {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 4px 8px;
}

.popup-k {
  color: var(--text-dim);
}

.popup-v {
  color: var(--text-main);
  font-weight: 500;
}

.popup-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}

.popup-status-chip {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.70rem;
}

.status-fishing {
  background: rgba(255, 23, 68, 0.25);
  color: #FF5252;
  border: 1px solid #FF5252;
}

.status-nav {
  background: rgba(0, 230, 118, 0.2);
  color: #00E676;
  border: 1px solid #00E676;
}

.status-moored {
  background: rgba(100, 116, 139, 0.25);
  color: #94A3B8;
  border: 1px solid #64748B;
}

.status-lost {
  background: rgba(148, 163, 184, 0.20);
  color: #CBD5E1;
  border: 1px solid #94A3B8;
}

.status-light {
  background: rgba(255, 214, 0, 0.18);
  color: #FFD600;
  border: 1px solid #FFD600;
}

.status-support {
  background: rgba(0, 229, 255, 0.18);
  color: #00E5FF;
  border: 1px solid #00E5FF;
}

.boat-marker-div.signal-lost {
  opacity: 0.82;
}

.boat-marker-div.signal-lost .boat-marker-svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
}

.popup-sog-cog {
  color: #00E5FF;
}

.popup-hauls-cnt {
  color: #FF5252;
}

.popup-catch-act {
  color: #00E676;
}

.popup-market {
  color: #94A3B8;
}

/* ==============================================================================
   Right Sidebar (지도 밖 오른쪽 정렬 패널: 베이스맵, HSI 제어, 어업협정 레이어, 범례)
   ============================================================================== */
.sidebar-right {
  flex: 0 0 320px !important;
  width: 320px !important;
  min-width: 320px !important;
  max-width: 320px !important;
  box-sizing: border-box !important;
  background: var(--bg-sidebar);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 900;
}

.sidebar-right::-webkit-scrollbar {
  width: 6px;
}
.sidebar-right::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* Basemap Toggle Grid */
.basemap-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.basemap-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 4px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.basemap-pill input {
  display: none;
}

.basemap-pill:hover {
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent-lps);
  border-color: var(--border-active);
}

.basemap-pill.active {
  background: rgba(0, 229, 255, 0.22);
  color: #00E5FF;
  border-color: #00E5FF;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

/* HSI Side Panel */
.hsi-side-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.hsi-bar-horizontal-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.hsi-bar-horizontal-wrap .hsi-bar-gradient {
  width: 100%;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(to right, 
    #30123B 0%, 
    #4662D8 20%, 
    #28BBEC 40%, 
    #A2FC3C 60%, 
    #FB8022 80%, 
    #7A0403 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hsi-bar-ticks-horiz {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* Layer Checkbox List */
.layer-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.layer-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.layer-check-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.layer-check-item input[type="checkbox"] {
  accent-color: var(--accent-lps);
  cursor: pointer;
}

.layer-chip {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2.2px dotted #000000 !important;
  background: transparent !important;
  flex-shrink: 0;
}

.section-toggle-header {
  transition: background 0.15s;
  padding: 2px 4px;
  border-radius: 4px;
}

.section-toggle-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.section-toggle-header.collapsed #treatyChevron,
.section-toggle-header.collapsed #vesselLegendChevron {
  transform: rotate(-90deg);
}

.layer-checkbox-list,
.vessel-legend-grid-side {
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease, margin-top 0.28s ease;
  overflow: hidden;
}

.layer-checkbox-list.collapsed,
.vessel-legend-grid-side.collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none !important;
}

.layer-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}

.eez-line-side {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2.2px dotted #000000 !important; /* 조업한계선 검정 점선 */
  flex-shrink: 0;
}

.aqua-line-side {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2.0px solid #000000 !important; /* 양식어장 검정 실선 */
  flex-shrink: 0;
}

.layer-item-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Vessel Legend Grid in Right Sidebar */
.vessel-legend-grid-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

/* Speed Gradient Bar */
.speed-gradient-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.speed-gradient-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #D50000 0%, #FF6D00 25%, #FFD600 50%, #76FF03 75%, #00C853 100%);
}

.speed-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* ==============================================================================
   Light Theme (화이트 해도 모드 지원)
   ============================================================================== */
body.light-theme {
  --bg-main: #EEF2F6;
  --bg-sidebar: rgba(255, 255, 255, 0.98);
  --bg-card: rgba(241, 245, 249, 0.95);
  --bg-card-hover: rgba(226, 232, 240, 0.95);
  --border-color: rgba(0, 0, 0, 0.10);
  --border-active: rgba(0, 119, 182, 0.50);
  --text-main: #0F172A;
  --text-muted: #334155;
  --text-dim: #64748B;
}

body.light-theme .app-header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

body.light-theme .brand-title {
  color: #0F172A;
}

body.light-theme .stat-pill {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.10);
}

body.light-theme .stat-val {
  color: #0284C7;
}

body.light-theme .stat-highlight {
  color: #DC2626;
}

body.light-theme .clock-display {
  background: #E2E8F0;
  color: #0369A1;
  border-color: rgba(2, 132, 199, 0.3);
  width: 200px;
  min-width: 200px;
  max-width: 200px;
}

body.light-theme .map-wrapper {
  background: radial-gradient(circle at center, #F1F5F9 0%, #CBD5E1 100%);
}

body.light-theme #map-viewport-frame {
  background: #F8FAFC;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.12);
}

body.light-theme #map {
  background: #F8FAFC;
}

body.light-theme .timeline-bar {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}

body.light-theme .time-tick-labels span {
  color: #475569;
  font-weight: 600;
}

body.light-theme .current-time-badge {
  background: #E0F2FE;
  color: #0369A1;
  border-color: #38BDF8;
  width: 200px;
  min-width: 200px;
  max-width: 200px;
}

body.light-theme .basemap-pill {
  background: #F1F5F9;
  color: #475569;
  border-color: #CBD5E1;
}

body.light-theme .basemap-pill.active {
  background: #E0F2FE;
  color: #0284C7;
  border-color: #0284C7;
}

body.light-theme .tree-node {
  background: #F8FAFC;
  border-color: #E2E8F0;
}

body.light-theme .root-label {
  color: #0F172A;
}

body.light-theme .search-box {
  background: #FFFFFF;
  border-color: #CBD5E1;
}

body.light-theme .custom-select, body.light-theme .time-input {
  background: #FFFFFF;
  color: #0F172A;
  border-color: #CBD5E1;
}

/* ==============================================================================
   ★ [화이트 해도 전용 규격] 선박 정보 팝업창 & 선박 검색창 하얀색 테마
   ============================================================================== */

/* 1. 선박 정보 팝업창 (White Background, Clean Shadow, High Contrast Text) */
body.light-theme .leaflet-popup-content-wrapper {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: 10px !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14) !important;
  padding: 4px !important;
}

body.light-theme .leaflet-popup-tip {
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08) !important;
}

.leaflet-container a.leaflet-popup-close-button {
  top: 10px !important;
  right: 10px !important;
  width: 26px !important;
  height: 26px !important;
  font-size: 18px !important;
  line-height: 24px !important;
  text-align: center !important;
  color: #64748B !important;
  border-radius: 6px !important;
  background: rgba(241, 245, 249, 0.9) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100 !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
  border-color: #CBD5E1 !important;
}

body.light-theme .custom-popup {
  color: #0F172A !important;
}

body.light-theme .popup-title {
  color: #0F172A !important;
  border-bottom: 1px solid #E2E8F0 !important;
  padding-right: 28px !important;
}

body.light-theme .popup-k {
  color: #64748B !important;
  font-weight: 500;
}

body.light-theme .popup-v {
  color: #1E293B !important;
  font-weight: 600;
}

body.light-theme .popup-divider {
  background: #E2E8F0 !important;
}

body.light-theme .popup-sog-cog {
  color: #0284C7 !important;
  font-weight: 700;
}

body.light-theme .popup-hauls-cnt {
  color: #DC2626 !important;
  font-weight: 700;
}

body.light-theme .popup-catch-act {
  color: #059669 !important;
  font-weight: 700;
}

body.light-theme .popup-market {
  color: #64748B !important;
}

body.light-theme .badge-lps {
  background: #E0F2FE !important;
  color: #0284C7 !important;
  border: 1px solid #BAE6FD !important;
}

body.light-theme .badge-sps {
  background: #FFEDD5 !important;
  color: #EA580C !important;
  border: 1px solid #FED7AA !important;
}

body.light-theme .status-nav {
  background: #DCFCE7 !important;
  color: #16A34A !important;
  border: 1px solid #86EFAC !important;
}

body.light-theme .status-fishing {
  background: #FEE2E2 !important;
  color: #DC2626 !important;
  border: 1px solid #FCA5A5 !important;
}

/* 2. 선박 검색창 & 자동완성 드롭다운 (Pure White, Deep Text, Soft Blue Hover) */
body.light-theme .search-box {
  background: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

body.light-theme .search-box input {
  color: #0F172A !important;
}

body.light-theme .search-box input::placeholder {
  color: #94A3B8 !important;
}

body.light-theme .search-icon {
  color: #64748B !important;
}

body.light-theme .clear-btn {
  color: #94A3B8 !important;
}

body.light-theme .clear-btn:hover {
  color: #0F172A !important;
}

body.light-theme .search-box:focus-within {
  border-color: #0284C7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

body.light-theme .search-results-dropdown {
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .search-item {
  border-bottom: 1px solid #F1F5F9 !important;
  color: #0F172A !important;
}

body.light-theme .search-item:hover {
  background: #F0F9FF !important;
}

body.light-theme .search-vname {
  color: #0F172A !important;
}

body.light-theme .search-meta {
  color: #64748B !important;
}

body.light-theme .search-empty-msg {
  color: #64748B !important;
}

/* 3. 지도 플로팅 범례 카드 (Light Theme) */
body.light-theme .eez-legend-card,
body.light-theme .vessel-legend-card {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .legend-row {
  color: #1E293B !important;
}

body.light-theme .vessel-legend-title {
  color: #0F172A !important;
}

body.light-theme .inactive-fleets-toggle {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: #64748B !important;
}

body.light-theme .inactive-fleets-toggle:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #1E293B !important;
}

body.light-theme .inactive-fleets-wrap {
  background: rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .wave-contour-panel .wave-legend-row {
  background: rgba(15, 23, 42, 0.85) !important;
  color: #F8FAFC !important;
}

/* ==========================================================================
   스마트 날짜 네비게이터 (Smart Date Navigator & Picker)
   ========================================================================== */
#dateSelect,
label[for="dateSelect"] {
  display: none !important;
}

.smart-date-nav-wrap {
  margin-top: 6px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.smart-date-nav-wrap:hover {
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 4px 18px rgba(0, 229, 255, 0.15);
}

.smart-date-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.duration-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stepper-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

#decDayBtn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #475569;
  color: #E2E8F0;
}

#decDayBtn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #94A3B8;
  color: #FFFFFF;
}

#incDayBtn {
  background: rgba(0, 229, 255, 0.18);
  border: 1px solid #00E5FF;
  color: #00E5FF;
}

#incDayBtn:hover {
  background: rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  color: #FFFFFF;
}

.date-nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-arrow-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.5);
  color: #00E5FF;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  transition: all 0.15s ease;
  user-select: none;
}

.date-arrow-btn:hover {
  background: rgba(0, 229, 255, 0.28);
  border-color: #00E5FF;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
  transform: translateY(-1px);
}

.date-arrow-btn:active {
  transform: translateY(1px);
}

.date-input-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.date-input-with-icon {
  width: 100%;
  height: 32px;
  padding: 0 32px 0 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.4);
  border-radius: 6px;
  color: #F8FAFC;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.date-input-with-icon:hover,
.date-input-with-icon:focus {
  border-color: #00E5FF;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.35);
  outline: none;
}

/* 브라우저 네이티브 달력 인디케이터 투명 전체 커버 */
.date-input-with-icon::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
  color: transparent;
  background: transparent;
  cursor: pointer;
}

.calendar-icon-indicator {
  position: absolute;
  right: 10px;
  pointer-events: none;
  font-size: 1.05rem;
  line-height: 1;
  filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.5));
  transition: transform 0.2s ease;
}

.date-input-container:hover .calendar-icon-indicator {
  transform: scale(1.15);
}

#applyDateBtn {
  margin-top: 8px;
  width: 100%;
  height: 34px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(0, 180, 216, 0.4));
  border: 1px solid #00E5FF;
  border-radius: 6px;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 229, 255, 0.2);
  transition: all 0.15s ease;
}

#applyDateBtn:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.45), rgba(0, 180, 216, 0.65));
  box-shadow: 0 4px 14px rgba(0, 229, 255, 0.45);
  transform: translateY(-1px);
}

body.light-theme .smart-date-nav-wrap {
  background: #FFFFFF !important;
  border: 1.5px solid #0284C7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.12) !important;
}

body.light-theme .smart-date-header-row span {
  color: #0F172A !important;
  font-weight: 800 !important;
}

body.light-theme .date-arrow-btn {
  background: #F0F9FF !important;
  border-color: #0284C7 !important;
  color: #0284C7 !important;
}

body.light-theme .date-arrow-btn:hover {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.35) !important;
}

body.light-theme .date-input-with-icon {
  background: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
  font-weight: 800 !important;
}

body.light-theme .date-input-with-icon:focus {
  border-color: #0284C7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

body.light-theme #durationDaysLabel {
  color: #0284C7 !important;
  font-weight: 800 !important;
}

body.light-theme .duration-stepper {
  background: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
}

body.light-theme #decDayBtn {
  background: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  color: #475569 !important;
}

body.light-theme #decDayBtn:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
}

body.light-theme #incDayBtn {
  background: #E0F2FE !important;
  border-color: #0284C7 !important;
  color: #0284C7 !important;
}

body.light-theme #incDayBtn:hover {
  background: #0284C7 !important;
  color: #FFFFFF !important;
}

body.light-theme #voyageRangeDisplay {
  color: #475569 !important;
  font-weight: 700 !important;
}

body.light-theme #applyDateBtn {
  background: linear-gradient(135deg, #0284C7, #0369A1) !important;
  border-color: #0284C7 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25) !important;
}

body.light-theme #applyDateBtn:hover {
  background: linear-gradient(135deg, #0369A1, #075985) !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4) !important;
}

/* 근해어업 대형선망 & 소형선망 박스 라이트 테마 (밝고 선명하게) */
body.light-theme .tree-subnode {
  background: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.tree-subnode.node-lps,
body.light-theme .tree-subnode.node-lps,
body.light-theme .tree-subnode:first-child:not(.node-sps) {
  border-color: #BAE6FD !important;
  background: #F0F9FF !important;
}

.tree-subnode.node-sps,
body.light-theme .tree-subnode.node-sps,
body.light-theme .tree-subnode:nth-child(2):not(.node-lps) {
  border-color: #FED7AA !important;
  background: #FFF7ED !important;
}

body.light-theme .badge-lps {
  background: #E0F2FE !important;
  color: #0369A1 !important;
  border-color: #7DD3FC !important;
}

body.light-theme .badge-sps {
  background: #FFEDD5 !important;
  color: #C2410C !important;
  border-color: #FDBA74 !important;
}

body.light-theme .badge-count {
  background: #E2E8F0 !important;
  color: #1E293B !important;
  font-weight: 700 !important;
}

body.light-theme .role-selector-row {
  color: #334155 !important;
  border-top-color: rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .role-selector-row label {
  color: #334155 !important;
  font-weight: 600 !important;
}

body.light-theme .role-label {
  color: #0F172A !important;
  font-weight: 700 !important;
}

body.light-theme .fleet-chip {
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  color: #334155 !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

body.light-theme .fleet-chip:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
  border-color: #94A3B8 !important;
}

body.light-theme .fleet-chip.active {
  background: #0284C7 !important;
  border-color: #0284C7 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3) !important;
}

body.light-theme .fleet-chip.active.sps {
  background: #EA580C !important;
  border-color: #EA580C !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.3) !important;
}

body.light-theme .fleet-chip.inactive-chip {
  opacity: 0.75 !important;
  border-style: dashed !important;
  background: #F8FAFC !important;
  color: #64748B !important;
}

body.light-theme .fleet-chip.resting-chip {
  background: #F8FAFC !important;
  border: 1.5px dashed #94A3B8 !important;
  color: #64748B !important;
  opacity: 0.75 !important;
  box-shadow: none !important;
}

body.light-theme .fleet-chip.resting-chip.active {
  background: #E0F2FE !important;
  border: 1.5px dashed #0284C7 !important;
  color: #0369A1 !important;
  box-shadow: none !important;
  opacity: 0.95 !important;
}

body.light-theme .fleet-chip.resting-chip.active.sps {
  background: #FFEDD5 !important;
  border: 1.5px dashed #EA580C !important;
  color: #C2410C !important;
  box-shadow: none !important;
  opacity: 0.95 !important;
}

body.light-theme .inactive-fleets-toggle {
  background: #F8FAFC !important;
  border: 1px dashed #CBD5E1 !important;
  color: #64748B !important;
  font-weight: 600 !important;
}

body.light-theme .inactive-fleets-toggle:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
  border-color: #94A3B8 !important;
}

body.light-theme .inactive-fleets-wrap {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
}

body.light-theme .node-children {
  border-left-color: #CBD5E1 !important;
}

body.light-theme .section-title {
  color: #0F172A !important;
  font-weight: 800 !important;
}

body.light-theme .radio-label span {
  color: #1E293B !important;
  font-weight: 700 !important;
}

body.light-theme .input-sublabel {
  color: #475569 !important;
  font-weight: 600 !important;
}

body.light-theme .preset-label {
  color: #0F172A !important;
  font-weight: 700 !important;
}

body.light-theme .tree-node > .node-header span {
  color: #0F172A !important;
  font-weight: 800 !important;
}

/* ==============================================================================
   4-Tab Navigation & Multi-Mode System
   ============================================================================== */
.top-nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active {
  background: #00E5FF;
  color: #070D18;
  border-color: #00E5FF;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

body.light-theme .top-nav-tabs {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
}

body.light-theme .nav-tab {
  color: #475569 !important;
}

body.light-theme .nav-tab:hover {
  color: #0F172A !important;
  background: rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .nav-tab.active {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  border-color: #0284C7 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35) !important;
}

/* Floating Live Mode Pill (inside map top-left) */
.floating-live-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(0, 230, 118, 0.5);
  padding: 6px 14px;
  border-radius: 30px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 230, 118, 0.2);
}

.floating-live-pill .pill-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #E2E8F0;
}

body.light-theme .floating-live-pill {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1.5px solid #10B981 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .floating-live-pill .pill-title {
  color: #0F172A !important;
}

/* Floating Live Cursor Coordinates Badge */
.cursor-coords-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 5px 12px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #00E5FF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

body.light-theme .cursor-coords-badge {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid #CBD5E1 !important;
  color: #0369A1 !important;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Short-term Forecast Timeline & Hist Summary Bars */
.forecast-timeline-bar,
.hist-summary-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
}

.forecast-stepper-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fc-step-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.fc-step-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #FFFFFF;
}

.fc-step-btn.active {
  background: #00E5FF;
  color: #070D18;
  border-color: #00E5FF;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.forecast-date-display {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #00E5FF;
  margin-left: 12px;
}

body.light-theme .fc-step-btn {
  background: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  color: #475569 !important;
}

body.light-theme .fc-step-btn.active {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  border-color: #0284C7 !important;
}

body.light-theme .forecast-date-display {
  color: #0284C7 !important;
}

.hist-summary-content {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hist-stat-item strong {
  color: var(--text-main);
  font-weight: 700;
}

.hist-stat-item.highlight strong {
  color: #FF9100;
  font-size: 1.05rem;
}

body.light-theme .hist-summary-content {
  color: #475569 !important;
}

body.light-theme .hist-stat-item strong {
  color: #0F172A !important;
}

body.light-theme .hist-stat-item.highlight strong {
  color: #EA580C !important;
}

/* Month Grid Buttons */
.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.month-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.month-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  color: var(--text-main);
}

.month-btn.active {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #0284C7;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.35);
}

body.light-theme .month-btn {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #64748B !important;
}

body.light-theme .month-btn:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
}

body.light-theme .month-btn.active {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  border-color: #0284C7 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3) !important;
}

/* Selection Cards (Species & Gear) */
.selection-card-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selection-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.selection-card:hover:not(.disabled) {
  border-color: rgba(0, 229, 255, 0.5);
  background: rgba(51, 65, 85, 0.6);
}

.selection-card input[type="radio"] {
  display: none;
}

.selection-card.active {
  background: rgba(0, 229, 255, 0.12);
  border-color: #00E5FF;
}

.selection-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.3);
  border-style: dashed;
}

.card-main-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.70rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-check-icon {
  font-size: 1.0rem;
  font-weight: 900;
  color: #00E5FF;
}

.badge-soon {
  font-size: 0.65rem;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  border-radius: 4px;
  margin-left: 5px;
  font-weight: normal;
}

body.light-theme .selection-card {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
}

body.light-theme .selection-card:hover:not(.disabled) {
  border-color: #0284C7 !important;
  background: #F0F9FF !important;
}

body.light-theme .selection-card.active {
  background: #F0F9FF !important;
  border-color: #0284C7 !important;
}

body.light-theme .selection-card.disabled {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

body.light-theme .card-main-title {
  color: #0F172A !important;
}

body.light-theme .card-desc {
  color: #64748B !important;
}

body.light-theme .card-check-icon {
  color: #0284C7 !important;
}

/* Graticule / Coordinate controls */
.coord-fmt-group {
  display: flex;
  gap: 6px;
}

.radio-label-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.radio-label-pill input {
  display: none;
}

.radio-label-pill.active {
  background: rgba(0, 229, 255, 0.2);
  border-color: #00E5FF;
  color: #00E5FF;
}

body.light-theme .radio-label-pill {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #475569 !important;
}

body.light-theme .radio-label-pill.active {
  background: #E0F2FE !important;
  border-color: #0284C7 !important;
  color: #0369A1 !important;
}

/* Graticule Canvas / Leaflet styling */
/* Graticule Canvas / Outer Label styling */
.graticule-outer-labels-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 860;
  overflow: visible;
}

.graticule-outer-label {
  position: absolute;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #94A3B8;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1;
}

body.light-theme .graticule-outer-label {
  color: #1E293B !important;
}

.graticule-outer-label.lat-label {
  transform: translateX(-100%) translateY(-50%);
  text-align: right;
  padding-right: 6px;
}

.graticule-outer-label.lon-label {
  transform: translateX(-50%) translateY(100%);
  text-align: center;
  padding-top: 6px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Date Card Box (Clean Modern Reference UI matching attached image)
   ========================================================================== */
.date-card-box {
  background: rgba(15, 23, 42, 0.55);
  border: 1.5px solid #00B0FF;
  border-radius: 8px;
  padding: 12px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 176, 255, 0.12);
}

body.light-theme .date-card-box {
  background: #F8FAFC;
  border-color: #0284C7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}

.date-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.date-card-title {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

body.light-theme .date-card-title {
  color: #0F172A;
}

.time-mode-btn-group {
  display: flex;
  gap: 6px;
}

.btn-time-mode {
  padding: 3px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-sans);
  background: rgba(255, 255, 255, 0.05);
  border: 1.2px solid rgba(148, 163, 184, 0.4);
  color: var(--text-muted);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-time-mode:hover {
  border-color: #00E5FF;
  color: var(--text-main);
}

.btn-time-mode.active {
  background: rgba(0, 229, 255, 0.18);
  border-color: #00B0FF;
  color: #00E5FF;
  font-weight: 700;
}

body.light-theme .btn-time-mode {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #475569;
}

body.light-theme .btn-time-mode:hover {
  border-color: #0284C7;
  color: #0F172A;
}

body.light-theme .btn-time-mode.active {
  background: #E0F2FE;
  border-color: #0284C7;
  color: #0369A1;
  font-weight: 700;
}

.date-card-nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-card-arrow-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid #00B0FF;
  border-radius: 6px;
  color: #00E5FF;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.date-card-arrow-btn:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.25);
  transform: scale(1.04);
}

.date-card-arrow-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #64748B;
  color: #64748B;
}

body.light-theme .date-card-arrow-btn {
  background: #FFFFFF;
  border-color: #0284C7;
  color: #0284C7;
}

body.light-theme .date-card-arrow-btn:hover:not(:disabled) {
  background: #E0F2FE;
}

body.light-theme .date-card-arrow-btn:disabled {
  opacity: 0.35;
  border-color: #CBD5E1;
  color: #94A3B8;
}

.date-card-center {
  flex: 1;
  height: 34px;
  background: rgba(2, 6, 23, 0.65);
  border: 1.2px solid rgba(0, 176, 255, 0.35);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.date-card-center:hover {
  border-color: #00E5FF;
}

body.light-theme .date-card-center {
  background: #FFFFFF;
  border-color: #CBD5E1;
}

body.light-theme .date-card-center:hover {
  border-color: #0284C7;
}

.date-display-val {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

body.light-theme .date-display-val {
  color: #0F172A;
}

.cal-icon-emoji {
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.native-hidden-date {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.date-card-range-text {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94A3B8;
  text-align: center;
  letter-spacing: -0.2px;
}

body.light-theme .date-card-range-text {
  color: #475569;
}

/* ==============================================================================
   4. 최적어장 찾기 & 위판장 추천 (Optimal Fishing Grounds & Market Finder)
   ============================================================================== */
.opt-species-btn-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.opt-species-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-color);
  text-align: center;
}

.opt-species-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: #38BDF8;
}

.opt-species-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(14, 165, 233, 0.15));
  border-color: #0284C7;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.3);
}

.opt-sp-name {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.opt-sp-gear {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.opt-species-btn.active .opt-sp-gear {
  color: #38BDF8;
  font-weight: 600;
}

body.light-theme .opt-species-btn {
  background: #F8FAFC;
  border-color: #E2E8F0;
  color: #1E293B;
}

body.light-theme .opt-species-btn:hover {
  background: #F1F5F9;
  border-color: #0284C7;
}

body.light-theme .opt-species-btn.active {
  background: #EFF6FF;
  border-color: #0284C7;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.2);
}

body.light-theme .opt-species-btn.active .opt-sp-gear {
  color: #0284C7;
}

/* KMI Market Pill */
.opt-market-info-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 6px;
  font-size: 0.72rem;
  color: #10B981;
}

.opt-market-info-pill .market-dot {
  font-size: 0.65rem;
  animation: pulse 2s infinite;
}

body.light-theme .opt-market-info-pill {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #059669;
}

/* Port selects and pickers */
.opt-custom-select {
  width: 100%;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.80rem;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.opt-custom-select:focus {
  border-color: #0284C7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

.opt-select-sm {
  padding: 6px 8px;
  font-size: 0.75rem;
}

body.light-theme .opt-custom-select {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #1E293B;
}

.btn-pick-map {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-pick-map:hover,
.btn-pick-map.picking {
  background: rgba(2, 132, 199, 0.2);
  border-color: #0284C7;
  color: #38BDF8;
}

.btn-pick-map.picking {
  animation: pulse-border 1.5s infinite;
}

.btn-reset-map {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reset-map:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

body.light-theme .btn-pick-map {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #334155;
}

body.light-theme .btn-pick-map:hover,
body.light-theme .btn-pick-map.picking {
  background: #EFF6FF;
  border-color: #0284C7;
  color: #0284C7;
}

body.light-theme .btn-reset-map {
  border-color: #CBD5E1;
  color: #64748B;
}

.opt-pick-coords-notice {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed #F59E0B;
  border-radius: 6px;
  font-size: 0.72rem;
  color: #F59E0B;
  text-align: center;
  animation: fadeIn 0.25s;
}

/* Arrival modes cards */
.opt-arrival-modes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.opt-arr-mode-card {
  display: flex;
  align-items: flex-start;
  padding: 8px 10px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.opt-arr-mode-card input[type="radio"] {
  margin-top: 3px;
  margin-right: 8px;
  accent-color: #0284C7;
}

.opt-arr-mode-card:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: #64748B;
}

.opt-arr-mode-card.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: #0284C7;
}

.opt-arr-mode-content {
  flex: 1;
}

.opt-arr-mode-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-color);
}

.opt-rec-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
  border-radius: 4px;
}

.opt-arr-mode-desc {
  font-size: 0.70rem;
  color: var(--text-dim);
  margin-top: 3px;
  line-height: 1.35;
}

body.light-theme .opt-arr-mode-card {
  background: #F8FAFC;
  border-color: #E2E8F0;
}

body.light-theme .opt-arr-mode-card:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

body.light-theme .opt-arr-mode-card.active {
  background: #EFF6FF;
  border-color: #0284C7;
}

/* Param grid */
.opt-param-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.opt-param-item label {
  display: block;
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit input {
  width: 100%;
  padding: 6px 36px 6px 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.80rem;
  font-weight: 700;
  outline: none;
}

.input-with-unit input:focus {
  border-color: #0284C7;
}

.input-with-unit .unit {
  position: absolute;
  right: 8px;
  font-size: 0.70rem;
  color: var(--text-dim);
  pointer-events: none;
}

body.light-theme .input-with-unit input {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #1E293B;
}

/* Execute Button */
.btn-execute-opt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  border: 1px solid #38BDF8;
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-execute-opt:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
  background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
}

.btn-execute-opt:active {
  transform: translateY(0);
}

/* Optimal Recommendation Cards */
.opt-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opt-result-card {
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.opt-result-card:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: #38BDF8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.opt-result-card.active-card {
  border-color: #00E5FF;
  background: rgba(2, 132, 199, 0.15);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
}

.opt-card-rank-strip {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.opt-rank-1 .opt-card-rank-strip { background: linear-gradient(180deg, #F59E0B, #D97706); }
.opt-rank-2 .opt-card-rank-strip { background: linear-gradient(180deg, #94A3B8, #64748B); }
.opt-rank-3 .opt-card-rank-strip { background: linear-gradient(180deg, #B45309, #78350F); }

.opt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.opt-rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #FFFFFF;
}

.opt-rank-1 .opt-rank-number {
  background: #0284C7;
  color: #FFFFFF;
}

.opt-rank-2 .opt-rank-number {
  background: #64748B;
  color: #FFFFFF;
}

.opt-rank-3 .opt-rank-number {
  background: #475569;
  color: #FFFFFF;
}

.opt-cost-breakdown-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  font-size: 0.68rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 6px 8px;
  margin-top: 5px;
}

body.light-theme .opt-cost-breakdown-box {
  background: #F8FAFC;
  border-color: #E2E8F0;
}

.opt-cost-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.opt-cost-item span {
  color: var(--text-dim);
}

.opt-cost-item strong {
  color: var(--text-color);
  font-weight: 700;
}

.opt-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

.opt-rank-1 .opt-rank-badge {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.opt-rank-2 .opt-rank-badge {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

.opt-rank-3 .opt-rank-badge {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FEF3C7;
}

.opt-hsi-badge {
  font-size: 0.70rem;
  font-weight: 700;
  padding: 2px 6px;
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 4px;
}

.opt-card-ground-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 6px;
}

.opt-card-route-flow {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.opt-flow-arrow {
  color: #94A3B8;
  font-size: 0.70rem;
}

.opt-card-route-flow strong {
  color: var(--text-color);
}

.opt-card-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.opt-metric-box {
  display: flex;
  flex-direction: column;
}

.opt-metric-box .lbl {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.opt-metric-box .val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-color);
  margin-top: 1px;
}

.opt-metric-box .val-profit {
  color: #10B981;
  font-size: 0.82rem;
}

.opt-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.opt-price-pill {
  font-size: 0.70rem;
  color: #38BDF8;
}

.btn-view-route {
  padding: 3px 8px;
  background: rgba(2, 132, 199, 0.2);
  border: 1px solid #0284C7;
  border-radius: 4px;
  color: #38BDF8;
  font-size: 0.70rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-view-route:hover {
  background: #0284C7;
  color: #FFFFFF;
}

body.light-theme .opt-result-card {
  background: #FFFFFF;
  border-color: #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .opt-result-card:hover {
  background: #F8FAFC;
  border-color: #0284C7;
}

body.light-theme .opt-result-card.active-card {
  border-color: #0284C7;
  background: #EFF6FF;
}

body.light-theme .opt-card-metrics-grid {
  background: #F8FAFC;
  border-color: #E2E8F0;
}

body.light-theme .opt-card-departure-row {
  background: rgba(2, 132, 199, 0.08) !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
}

body.light-theme .opt-card-departure-row strong {
  color: #0369A1 !important;
}

body.light-theme .opt-cost-breakdown-box {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

/* Market Mini Table */
.market-table-wrap {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.market-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  text-align: left;
}

.market-mini-table th,
.market-mini-table td {
  white-space: nowrap !important;
}

.market-mini-table th {
  position: sticky;
  top: 0;
  background: rgba(30, 41, 59, 0.95);
  color: var(--text-muted);
  font-weight: 700;
  padding: 6px 6px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.70rem;
}

.market-mini-table td {
  padding: 6px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  font-size: 0.72rem;
}

.market-mini-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.btn-basis-pill {
  transition: all 0.15s ease;
}

.btn-basis-pill.active {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  font-weight: 700;
}

/* Sea Block Grid Labels (검정색 글자, 박스/테두리 없음, 외곽 흰색 헤일로) */
.sea-block-icon-wrap {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.sea-block-label {
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  color: #000000 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  text-align: center;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  text-shadow: -1px -1px 0 #FFFFFF, 1px -1px 0 #FFFFFF, -1px 1px 0 #FFFFFF, 1px 1px 0 #FFFFFF, 0 0 2px #FFFFFF;
}

.sea-block-label.sea-block-major {
  letter-spacing: -0.3px;
}

.sea-block-label.sea-block-minor {
  letter-spacing: -0.4px;
}

body.light-theme .sea-block-label {
  color: #000000 !important;
  background: transparent !important;
  border: none !important;
}

body.light-theme .market-mini-table th {
  background: #F1F5F9;
  border-color: #E2E8F0;
  color: #475569;
}

body.light-theme .market-mini-table td {
  border-color: #F1F5F9;
  color: #1E293B;
}

/* Optimal Summary Bar on Map (Standardized 56px height) */
.optimal-summary-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  box-sizing: border-box !important;
}

.optimal-summary-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  max-width: 100%;
}

.opt-sum-badge-pill {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  color: #B45309;
  border: 1px solid #F59E0B;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.opt-sum-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-color);
}

.opt-sum-flow .opt-sum-arrow {
  color: #94A3B8;
  font-size: 0.74rem;
}

.opt-sum-node.node-dep { color: #38BDF8; }
.opt-sum-node.node-ground { color: #F59E0B; }
.opt-sum-node.node-arr { color: #10B981; }

.opt-sum-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}

.opt-sum-metrics {
  display: flex;
  align-items: center;
  gap: 14px;
}

.opt-sum-metric {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.opt-sum-metric .lbl {
  font-size: 0.70rem;
  color: var(--text-dim);
}

.opt-sum-metric .val {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-color);
}

.opt-sum-metric .sub {
  font-size: 0.70rem;
  color: var(--text-dim);
}

.opt-sum-metric.highlight .val-profit {
  font-size: 0.95rem;
  color: #10B981;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

body.light-theme .opt-sum-metric.highlight .val-profit {
  color: #059669;
  text-shadow: none;
}

/* -------------------------------------------------------------
   최적어장 찾기 핀포인트 & 흰색 카드 디자인 (사용자 맞춤 표준)
   ------------------------------------------------------------- */
.custom-opt-teardrop-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.custom-opt-teardrop-pin:hover {
  transform: scale(1.18);
  z-index: 9999;
}

/* 어장 중심점 타깃 (어장 중심 및 항로 굴절점 시인성 확보) */
.opt-ground-focal-point {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2.5px solid #000000;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
  position: relative;
}
.opt-ground-focal-point::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #000000;
}

/* 흰색 최적어장 카드 (조업 어장과 항로를 가리지 않도록 상단 오프셋 배치) */
.opt-pin-ground-white {
  position: relative;
  background: #FFFFFF;
  color: #0F172A;
  border: 2px solid #000000;
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 175px;
  max-width: 210px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.12);
  font-family: var(--font-display, 'Pretendard', sans-serif);
  cursor: pointer;
  transition: transform 0.18s ease;
  user-select: none;
}
.opt-pin-ground-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.opt-pin-ground-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}
.opt-pin-ground-badge {
  background: #0F172A;
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1.5px 5px;
  border-radius: 4px;
  letter-spacing: -0.3px;
}
.opt-pin-ground-hsi {
  background: #DCFCE7;
  color: #15803D;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 4px;
  border: 1px solid #86EFAC;
}

.opt-pin-ground-title {
  font-size: 0.80rem;
  font-weight: 800;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  margin-bottom: 3px;
}

.opt-pin-ground-footer {
  font-size: 0.68rem;
  color: #475569;
  display: flex;
  align-items: center;
  white-space: nowrap;
  line-height: 1.2;
}
.opt-pin-ground-footer strong {
  color: #059669;
  font-weight: 800;
}

/* 카드 하단 포인팅 화살표 (어장 중심점을 향함) */
.opt-pin-ground-arrow {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #000000;
}
.opt-pin-ground-arrow::after {
  content: '';
  position: absolute;
  bottom: 1.5px;
  left: -5px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #FFFFFF;
}

/* -------------------------------------------------------------
   Optimal Fishing Grounds Sidebar (혜영수산 선단 & 10대 어종 & 2대 버튼)
   ------------------------------------------------------------- */
.opt-company-title {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 800;
  color: #F8FAFC;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.opt-fleet-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.opt-fleet-label {
  width: 44px;
  min-width: 44px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94A3B8;
}

.opt-fleet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fleet-vessel-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #E2E8F0;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  user-select: none;
}

.fleet-vessel-chip.locked {
  cursor: default;
  border-color: #64748B;
  background: rgba(51, 65, 85, 0.6);
  color: #F1F5F9;
}

.fleet-vessel-chip.carrier-chip {
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94A3B8;
}

.fleet-vessel-chip.carrier-chip:hover {
  border-color: #38BDF8;
  color: #FFFFFF;
  background: rgba(14, 165, 233, 0.15);
}

.fleet-vessel-chip.carrier-chip.selected {
  border-color: #0284C7;
  background: rgba(2, 132, 199, 0.3);
  color: #38BDF8;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

/* 10대 대상어종 2열 박스 */
.opt-species-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  margin-top: 6px;
}

.opt-species-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.opt-sp-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  color: #E2E8F0;
  padding: 2px 0;
  user-select: none;
}

.opt-sp-radio-label input[type="radio"] {
  accent-color: #0284C7;
  cursor: pointer;
}

.opt-sp-radio-text {
  font-weight: 500;
}

/* 출항지/입항지 선택 */
.opt-port-select-wrap {
  width: 100%;
}

.btn-pick-map {
  flex: 1;
  padding: 6px 8px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 6px;
  color: #38BDF8;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-pick-map:hover, .btn-pick-map.picking {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38BDF8;
  color: #FFFFFF;
}

.btn-reset-map {
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #94A3B8;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset-map:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #FFFFFF;
}

/* 2대 액션 버튼 */
.opt-actions-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
}

.btn-opt-search {
  width: 100%;
  padding: 10px;
  background: #0284C7;
  border: 1px solid #38BDF8;
  border-radius: 6px;
  color: #FFFFFF;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
}

.btn-opt-search:hover {
  background: #0369A1;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.5);
}

.btn-opt-ai {
  width: 100%;
  padding: 10px;
  background: #007799;
  border: 1px solid #00E5FF;
  border-radius: 6px;
  color: #FFFFFF;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(0, 229, 255, 0.25);
}

.btn-opt-ai:hover {
  background: #0088AA;
  box-shadow: 0 4px 14px rgba(0, 229, 255, 0.45);
}

/* Light Theme overrides for new elements */
body.light-theme .opt-company-title {
  color: #0F172A;
}
body.light-theme .fleet-vessel-chip {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #334155;
}
body.light-theme .fleet-vessel-chip.locked {
  background: #E2E8F0;
  border-color: #94A3B8;
  color: #1E293B;
}
body.light-theme .fleet-vessel-chip.carrier-chip.selected {
  background: #E0F2FE;
  border-color: #0284C7;
  color: #0369A1;
}
body.light-theme .opt-species-box {
  background: #F8FAFC;
  border-color: #BAE6FD;
}
body.light-theme .opt-sp-radio-label {
  color: #1E293B;
}
body.light-theme .btn-pick-map {
  background: #F0F9FF;
  border-color: #7DD3FC;
  color: #0284C7;
}
body.light-theme .btn-reset-map {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #64748B;
}

/* -------------------------------------------------------------
   Optimal Route Click Card (Image 1 규격 & 사용자 스타일 커스텀)
   - 해구 단독 표기 (234-4해구)
   - 위경도 좌표 표기 (ddmm.mm, ddmm.mm)
   - 88% 적합 (선명하고 큰 녹색 글씨)
   - 거리 및 비용: 회색의 얇은 글씨 (color: #64748B, font-weight: 400~500)
   - 4대 상세 타임라인: 출항➔어장, 최적출항, 어장➔입항, 예상입항
   ------------------------------------------------------------- */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  border: 2px solid #0F172A;
}

.leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.4;
}

.opt-route-click-card {
  background: #FFFFFF;
  color: #0F172A;
  padding: 14px 28px 14px 16px;
  width: 275px;
  font-family: var(--font-display, 'Pretendard', sans-serif);
  box-sizing: border-box;
}

.leaflet-container a.leaflet-popup-close-button {
  top: 8px;
  right: 8px;
  color: #94A3B8;
  font-size: 16px;
  padding: 4px;
}
.leaflet-container a.leaflet-popup-close-button:hover {
  color: #0F172A;
}

/* 상단 헤더: 테마 뱃지 + 해구 단독 명칭 */
.opt-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.opt-theme-badge {
  font-size: 0.70rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: -0.3px;
}
.opt-theme-profit {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}
.opt-theme-cost {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #7DD3FC;
}
.opt-theme-hsi {
  background: #F3E8FF;
  color: #7E22CE;
  border: 1px solid #D8B4FE;
}

.opt-block-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.opt-block-coords {
  font-size: 0.75rem;
  color: #64748B;
  font-weight: 500;
  margin-bottom: 6px;
}

/* 중앙 적합도 강조: 선명하고 큰 녹색 글씨 */
.opt-hsi-highlight-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: #16A34A;
  letter-spacing: -0.8px;
  line-height: 1.1;
  margin: 6px 0 10px 0;
}

/* [사용자 핵심 지시] 거리와 비용: 회색의 얇은 글씨 (color: #64748B, font-weight: 400~500) */
.opt-gray-metrics-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #CBD5E1;
  margin-bottom: 10px;
}

.opt-gray-metric-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
  color: #64748B;
  font-weight: 400; /* 얇은 글씨 */
}

.opt-gray-metric-item .metric-val {
  font-size: 0.95rem;
  color: #64748B !important;
  font-weight: 400 !important; /* 사용자 명시 지침: 회색의 얇은 글씨 */
}

/* 4대 상세 조업 타임라인 */
.opt-timeline-detail-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.73rem;
  color: #334155;
  background: #F8FAFC;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
}

.opt-timeline-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.35;
}

.opt-timeline-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  min-width: 48px;
  text-align: center;
}
.tag-sunset { background: #FEF3C7; color: #B45309; font-weight: 800; }
.tag-dep { background: #DCFCE7; color: #166534; }
.tag-fishing { background: #F3E8FF; color: #7E22CE; font-weight: 800; }
.tag-arr { background: #FEE2E2; color: #991B1B; }
.tag-landing { background: #FEF3C7; color: #92400E; font-weight: 800; }

.opt-sub-note {
  font-size: 0.68rem;
  color: #64748B;
  font-weight: 500;
}

.opt-auction-note {
  display: inline-block;
  color: #D97706;
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 2px;
}

.opt-timeline-text {
  flex: 1;
}
.opt-timeline-text strong {
  font-weight: 700;
  color: #0F172A;
}

/* 네비게이션 테마 배지 사이드바용 */
.opt-rank-theme-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: -0.3px;
}







/* ============================================================
   [v1.3.0] Floating Basemap Switcher & Progress Version Badges
   ============================================================ */

/* Map Floating Basemap Switcher */
.floating-basemap-switch {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1000;
  display: flex;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.floating-basemap-switch .basemap-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.floating-basemap-switch .basemap-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
}

.floating-basemap-switch .basemap-btn.active {
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.5);
}

/* Header Version & Progress Tag */
.header-version-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
}

.version-pill {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.date-pill {
  background: rgba(51, 65, 85, 0.8);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.progress-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.progress-status-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
  color: #a7f3d0;
  transform: translateY(-1px);
}

.progress-status-btn .pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Progress Tracker Modal Overlay */
.progress-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.progress-modal-overlay.hidden {
  display: none;
}

.progress-modal-content {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.progress-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: #1e293b;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.pm-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pm-badge {
  background: #0284c7;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

.pm-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.pm-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.pm-close-btn:hover {
  color: #f1f5f9;
}

.progress-modal-body {
  padding: 20px 24px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pm-version-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(71, 85, 105, 0.4);
  border-radius: 10px;
  padding: 14px 18px;
  transition: all 0.2s ease;
}

.pm-version-card.current {
  border-color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.15);
}

.pm-v-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pm-v-tag {
  font-size: 0.85rem;
  font-weight: 800;
  background: #2563eb;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
}

.pm-v-date {
  font-size: 0.8rem;
  color: #94a3b8;
}

.pm-status-done {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pm-v-desc ul {
  margin: 0;
  padding-left: 20px;
  color: #cbd5e1;
  font-size: 0.84rem;
  line-height: 1.6;
}

.pm-v-desc li {
  margin-bottom: 4px;
}

.pm-v-desc strong {
  color: #e2e8f0;
}

/* ============================================================
   [v1.3.0] Research Figures Gallery Modal Styles
   ============================================================ */
.research-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(71, 85, 105, 0.4);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.research-card:hover {
  transform: translateY(-3px);
  border-color: #38bdf8;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.25);
  background: rgba(30, 41, 59, 0.95);
}

.rc-img-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  background: #0b1120;
  overflow: hidden;
}

.rc-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.research-card:hover .rc-img-wrap img {
  transform: scale(1.05);
}

.rc-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #38bdf8;
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

.rc-content {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.rc-title {
  margin: 0 0 6px 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.35;
}

.rc-desc {
  margin: 0;
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==============================================================================
   [v1.5.0 / 2026-11-05] Smart Device Auto-Responsive & Orientation Adapter
   - 스마트폰 세로/가로(회전) 완벽 대응: 19:17 고정 비율 강제 해제 -> 100% 화면 자동 핏
   - 접속 기기 해상도(모바일/태블릿/노트북/대형PC)에 따른 유동형 UI 크기 자동 스케일링
   - 스마트폰 가로 모드(Landscape) 초슬림 헤더/타임라인 모드 지원
   - 터치 제스처 및 서랍식 오버레이 드로어 지원
   ============================================================================== */

/* Viewport Dynamic Height for iOS / Android */
body {
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.main-container {
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  position: relative;
  width: 100%;
}

/* Mobile Panel Drawer Toggle Buttons in Header */
.mobile-panel-toggles {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.mobile-toggle-btn {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mobile-toggle-btn:hover, .mobile-toggle-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.5);
}

/* Mobile Drawer Backdrop */
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  transition: opacity 0.25s ease;
}

.mobile-drawer-backdrop.active {
  display: block;
}

/* 1. Laptop / Mid Screen (<= 1400px) */
@media (max-width: 1400px) {
  .sidebar {
    flex: 0 0 280px !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
  }
  .sidebar-right {
    flex: 0 0 270px !important;
    width: 270px !important;
    min-width: 270px !important;
    max-width: 270px !important;
  }
  .clock-display {
    width: 165px;
    min-width: 165px;
    max-width: 165px;
    font-size: 0.78rem;
    padding: 4px 6px;
  }
}

/* 2. Tablet Screen (<= 1120px) */
@media (max-width: 1120px) {
  .header-vessel-stats {
    display: none !important;
  }
  .mobile-panel-toggles {
    display: flex;
  }
  .sidebar-right {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    z-index: 1100 !important;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.7) !important;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  .sidebar-right.drawer-open {
    transform: translateX(0) !important;
  }
}

/* 3. Smartphone & Small Devices (<= 860px) - 해상도 비율 100% 자동 맞춤 */
@media (max-width: 860px) {
  .app-header {
    height: auto !important;
    min-height: 52px !important;
    padding: 6px 10px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .main-container {
    height: calc(100vh - 94px) !important;
    height: calc(100dvh - 94px) !important;
  }

  .brand {
    gap: 6px !important;
  }
  .brand-logo {
    width: 28px !important;
    height: 28px !important;
  }
  .brand-title {
    font-size: 0.92rem !important;
  }
  .brand-badge {
    display: none !important;
  }
  .header-version-wrap {
    margin-left: 4px !important;
    gap: 4px !important;
  }
  .version-pill, .date-pill {
    font-size: 0.64rem !important;
    padding: 1px 5px !important;
  }
  .progress-status-btn {
    display: none !important;
  }
  .clock-display {
    display: none !important;
  }

  /* 상단 탭 모바일 터치 가로 스크롤 */
  .top-nav-tabs {
    order: 3 !important;
    width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    padding: 3px 0 5px 0 !important;
    display: flex !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .top-nav-tabs::-webkit-scrollbar {
    display: none;
  }
  .nav-tab {
    flex: 0 0 auto !important;
    font-size: 0.76rem !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
  }

  .mobile-panel-toggles {
    display: flex !important;
    margin-left: auto !important;
  }

  /* 좌/우 사이드바를 모바일 오버레이 서랍(Drawer)으로 전환 */
  .sidebar {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    z-index: 1100 !important;
    width: 86% !important;
    max-width: 330px !important;
    min-width: 270px !important;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.8) !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  .sidebar.drawer-open {
    transform: translateX(0) !important;
  }

  .sidebar-right {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    z-index: 1100 !important;
    width: 86% !important;
    max-width: 320px !important;
    min-width: 270px !important;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.8) !important;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  .sidebar-right.drawer-open {
    transform: translateX(0) !important;
  }

  /* [핵심] 19:17 고정 종횡비 강제 해제 -> 모바일 화면 100% 핏 */
  .map-wrapper {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    flex: 1 1 auto !important;
  }

  #map-viewport-frame {
    aspect-ratio: auto !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    flex: 1 1 100% !important;
  }

  #map {
    width: 100% !important;
    height: 100% !important;
  }

  /* 지도 위 플로팅 컨트롤 모바일 위치 및 크기 조절 */
  .floating-basemap-switch {
    top: 8px !important;
    right: 8px !important;
    padding: 2px !important;
    gap: 2px !important;
    z-index: 850 !important;
  }
  .floating-basemap-switch .basemap-btn {
    font-size: 0.68rem !important;
    padding: 3px 6px !important;
  }
  .floating-live-pill {
    top: 8px !important;
    left: 8px !important;
    padding: 3px 7px !important;
    font-size: 0.7rem !important;
    z-index: 850 !important;
  }
  .cursor-coords-badge {
    bottom: 60px !important;
    right: 8px !important;
    font-size: 0.65rem !important;
    padding: 2px 6px !important;
    z-index: 850 !important;
  }

  /* 하단 타임라인 바 스마트폰 최적화 (높이 묶임 해제 및 유동 크기) */
  .timeline-bar {
    position: absolute !important;
    bottom: 6px !important;
    left: 6px !important;
    right: 6px !important;
    width: auto !important;
    height: auto !important;
    min-height: 44px !important;
    max-height: 52px !important;
    padding: 6px 8px !important;
    background: rgba(15, 23, 42, 0.92) !important;
    backdrop-filter: blur(12px) !important;
    border-radius: 8px !important;
    z-index: 900 !important;
    display: flex !important;
    align-items: center !important;
  }
  .timeline-controls {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  .play-pause-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
  }
  .time-slider-wrap {
    flex: 1 1 auto !important;
    min-width: 70px !important;
  }
  .current-time-badge {
    font-size: 0.7rem !important;
    padding: 2px 5px !important;
    min-width: 55px !important;
    white-space: nowrap !important;
  }
  .spd-btn-group, .time-tick-labels {
    display: none !important;
  }

  /* 과거어장 통계 요약 바 모바일 최적화 */
  .hist-summary-bar {
    bottom: 6px !important;
    left: 6px !important;
    right: 6px !important;
    width: auto !important;
    height: auto !important;
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
  }
  .hist-summary-content {
    flex-wrap: wrap !important;
    gap: 4px 10px !important;
  }

  /* 단기 어장예측 스텝 버튼 바 모바일 최적화 */
  .forecast-timeline-bar {
    bottom: 6px !important;
    left: 6px !important;
    right: 6px !important;
    width: auto !important;
    height: auto !important;
    padding: 6px 10px !important;
  }
  .forecast-stepper-wrap {
    width: 100% !important;
    justify-content: space-around !important;
  }
  .fc-step-btn {
    font-size: 0.74rem !important;
    padding: 5px 10px !important;
  }
}

/* 4. [회전 대응] 스마트폰 가로 모드 (Landscape: max-height <= 500px) */
@media (max-height: 500px) and (orientation: landscape) {
  .app-header {
    min-height: 38px !important;
    padding: 2px 10px !important;
    flex-wrap: nowrap !important;
  }
  .brand-logo {
    width: 22px !important;
    height: 22px !important;
  }
  .brand-title {
    font-size: 0.8rem !important;
  }
  .top-nav-tabs {
    order: unset !important;
    width: auto !important;
    padding: 0 !important;
    border-top: none !important;
    gap: 2px !important;
  }
  .nav-tab {
    font-size: 0.68rem !important;
    padding: 2px 7px !important;
  }
  .main-container {
    height: calc(100vh - 40px) !important;
    height: calc(100dvh - 40px) !important;
  }
  .timeline-bar, .forecast-timeline-bar, .hist-summary-bar {
    bottom: 4px !important;
    padding: 3px 8px !important;
    min-height: 34px !important;
    max-height: 38px !important;
  }
  .floating-basemap-switch {
    top: 4px !important;
    right: 4px !important;
  }
  .floating-live-pill {
    top: 4px !important;
    left: 4px !important;
  }
  .cursor-coords-badge {
    bottom: 42px !important;
  }
}

/* ==============================================================================
   [v1.6.0] Authentication Gate & Mobile Element Anti-Overlap Fixes
   ============================================================================== */

/* Header User Auth Pill */
.user-auth-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.74rem;
  color: #f8fafc;
}

.user-auth-pill.hidden {
  display: none !important;
}

.user-icon {
  font-size: 0.82rem;
}

.user-name {
  font-weight: 700;
  color: #38bdf8;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* Auth Gate Modal Overlay */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.94) 0%, rgba(3, 7, 18, 0.98) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInAuth 0.3s ease;
}

.auth-gate-overlay.hidden {
  display: none !important;
}

@keyframes fadeInAuth {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-card {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 26px 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
  animation: popAuth 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popAuth {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-brand-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px auto;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4);
}

.auth-title {
  margin: 0 0 6px 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
}

.auth-tabs {
  display: flex;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(71, 85, 105, 0.4);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 20px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form.hidden {
  display: none !important;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.auth-input-group label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #cbd5e1;
}

.auth-input-group input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 8px;
  padding: 10px 12px;
  color: #f8fafc;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.auth-input-group input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.auth-error-msg {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: 6px;
  line-height: 1.4;
}

.auth-error-msg.hidden {
  display: none !important;
}

.auth-submit-btn {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  margin-top: 4px;
}

.auth-submit-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.auth-submit-btn.register {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.auth-demo-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(71, 85, 105, 0.5);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.auth-demo-label {
  font-size: 0.72rem;
  color: #94a3b8;
}

.auth-demo-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-demo-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #e0f2fe;
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.7rem;
  color: #64748b;
}

/* ==============================================================================
   [모바일 요소 겹침/간섭 완전 해결 (Anti-Overlap Engine)]
   ============================================================================== */
@media (max-width: 860px) {
  /* 1. 상단 플로팅 바 분리 & 축소: 좌상단 알약과 우상단 스위처 절대 겹침 방지 */
  .floating-live-pill {
    top: 6px !important;
    left: 6px !important;
    padding: 3px 7px !important;
    font-size: 0.68rem !important;
    max-width: 110px !important;
  }
  .floating-live-pill .pill-title {
    font-size: 0.68rem !important;
  }

  .floating-basemap-switch {
    top: 6px !important;
    right: 6px !important;
    padding: 2px !important;
    gap: 2px !important;
    max-width: 170px !important;
    overflow-x: auto !important;
  }
  .floating-basemap-switch .basemap-btn {
    font-size: 0.65rem !important;
    padding: 3px 5px !important;
  }

  /* 2. 하단 좌표 배지: 모바일 터치 환경에서는 타임라인과 간섭되므로 완전 숨김 */
  .cursor-coords-badge {
    display: none !important;
  }

  /* 3. Leaflet 줌 컨트롤: 하단 타임라인 바 위로 띄워 겹침 완전 방지 */
  .leaflet-bottom.leaflet-right {
    bottom: 58px !important;
    right: 8px !important;
    margin: 0 !important;
  }
  .leaflet-control-zoom {
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
  }
  .leaflet-control-zoom a {
    width: 28px !important;
    height: 28px !important;
    line-height: 28px !important;
    font-size: 14px !important;
    background: rgba(15, 23, 42, 0.9) !important;
    color: #38bdf8 !important;
  }

  /* 4. 하단 타임라인 바: 슬라이더와 재생버튼만 한 줄(42px)로 컴팩트 고정 */
  .timeline-bar {
    bottom: 6px !important;
    left: 6px !important;
    right: 6px !important;
    width: calc(100% - 12px) !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 4px 8px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  .timeline-controls {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .play-pause-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    flex: 0 0 30px !important;
  }
  .time-slider-wrap {
    flex: 1 1 auto !important;
    min-width: 60px !important;
  }
  .current-time-badge {
    font-size: 0.68rem !important;
    padding: 2px 4px !important;
    min-width: 50px !important;
    flex: 0 0 auto !important;
  }

  /* 5. 헤더 유저 정보 모바일 축소 */
  .user-auth-pill {
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
    gap: 4px !important;
  }
  .user-name {
    max-width: 70px !important;
  }
  .btn-logout {
    padding: 1px 4px !important;
    font-size: 0.62rem !important;
  }
}

/* ==============================================================================
   [v1.0] Admin Dashboard & Strict Mobile Anti-Overlap Engine
   ============================================================================== */

/* Admin Tabs */
.admin-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab-btn.active {
  background: #f59e0b;
  color: #000000;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.admin-subtab-pane.hidden {
  display: none !important;
}

.admin-table th, .admin-table td {
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  padding: 8px 10px;
}

.admin-table tr:hover {
  background: rgba(51, 65, 85, 0.3);
}

.admin-action-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
}

/* ==============================================================================
   [정밀 모바일 하단 겹침 박멸: 온팟 워터마크 분리 & 3단 수직 스택]
   ============================================================================== */
@media (max-width: 860px) {
  /* 1. 타임라인 바: 온팟 배지(28px) 위로 띄워 'bottom: 40px' 공중 부양 */
  .timeline-bar {
    position: absolute !important;
    bottom: 40px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    background: rgba(15, 23, 42, 0.94) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
    z-index: 920 !important;
    display: flex !important;
    align-items: center !important;
  }

  /* 2. 모바일 슬라이더 컨트롤: 속도버튼 숨기고 슬라이더 폭 100% 확장 */
  .timeline-controls {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .spd-btn-group, .time-tick-labels {
    display: none !important;
  }

  .play-pause-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    flex: 0 0 32px !important;
    padding: 0 !important;
  }

  .time-slider-wrap {
    flex: 1 1 auto !important;
    min-width: 80px !important;
  }

  .current-time-badge {
    font-size: 0.72rem !important;
    padding: 3px 6px !important;
    min-width: 58px !important;
    flex: 0 0 auto !important;
  }

  /* 3. Leaflet 줌 컨트롤 & 어트리뷰션: 타임라인 바 위(bottom: 90px)로 확실히 올려서 분리 */
  .leaflet-bottom.leaflet-right {
    bottom: 90px !important;
    right: 8px !important;
    margin: 0 !important;
    z-index: 850 !important;
  }

  .leaflet-control-zoom {
    margin-bottom: 4px !important;
  }

  .leaflet-control-attribution {
    font-size: 9px !important;
    background: rgba(15, 23, 42, 0.8) !important;
    color: #94a3b8 !important;
    padding: 0 4px !important;
  }

  /* 4. 마우스 좌표 배지: 모바일에서는 불필요하므로 완전 숨김 */
  .cursor-coords-badge {
    display: none !important;
  }

  /* 5. 과거어장 요약 바 & 단기예측 스텝 바도 온팟 배지 위로 띄움 */
  .hist-summary-bar, .forecast-timeline-bar, .optimal-summary-bar {
    position: absolute !important;
    bottom: 40px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    z-index: 920 !important;
  }
}


/* ==============================================================================
   [v1.0 정식 릴리즈] 모바일 드로어(Sidebar Drawer) 및 하단 간섭 완벽 박멸
   - 닫기 헤더 바, Onpod 워터마크 z-index 오버레이, 하단 패딩 100px 완벽 확보
   ============================================================================== */

/* 기본(데스크톱): 사이드바가 고정이므로 모바일 전용 닫기 헤더는 숨김 */
.mobile-drawer-header {
  display: none !important;
}

/* 태블릿 및 모바일 반응형 헤더 (<= 1120px) */
@media (max-width: 1120px) {
  .mobile-drawer-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 14px !important;
    background: #0f172a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
  }
  .mdh-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }
  .mdh-icon {
    font-size: 1.15rem !important;
  }
  .mdh-title {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: #f8fafc !important;
    letter-spacing: -0.3px !important;
  }
  .btn-drawer-close {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #e2e8f0 !important;
    font-size: 1.5rem !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
  }
  .btn-drawer-close:hover, .btn-drawer-close:active {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
  }

  /* 백드롭 및 드로어 z-index를 온팟 배지(약 10000) 위로 완전 상승 */
  .mobile-drawer-backdrop {
    z-index: 99990 !important;
  }
  .sidebar, .sidebar-right {
    z-index: 99999 !important;
  }
}

/* 스마트폰 전용 초정밀 해상도 및 배치 최적화 (<= 860px) */
@media (max-width: 860px) {
  /* 드로어 폭을 모바일 화면(375~430px)에 최적화하여 내용 찌그러짐 방지 */
  .sidebar {
    width: 90% !important;
    max-width: 375px !important;
    min-width: 290px !important;
    padding-bottom: 110px !important; /* 하단 온팟 배지 및 홈바 간섭 원천 차단 */
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }
  .sidebar-right {
    width: 90% !important;
    max-width: 375px !important;
    min-width: 290px !important;
    padding-bottom: 110px !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }

  /* 라디오 버튼 줄바꿈 깔끔하게 정리 (한 글자 짤림 방지) */
  .mode-radio-group .radio-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    font-size: 0.77rem !important;
    line-height: 1.38 !important;
    word-break: keep-all !important;
    padding: 4px 2px !important;
    cursor: pointer !important;
  }
  .mode-radio-group .radio-label input[type="radio"] {
    margin-top: 2px !important;
    flex: 0 0 15px !important;
    width: 15px !important;
    height: 15px !important;
  }

  /* 조업 기준일 카드 내부 패딩 및 버튼 모바일 최적화 */
  .date-card-box {
    padding: 8px 10px !important;
    margin-top: 6px !important;
  }
  .date-card-title {
    font-size: 0.78rem !important;
  }
  .btn-time-mode {
    font-size: 0.74rem !important;
    padding: 3px 8px !important;
  }
  .date-card-center {
    font-size: 0.85rem !important;
    padding: 5px 8px !important;
  }

  /* 필터링 프리셋 4개 버튼 균등 그리드 배치 */
  .preset-btn-bar {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
    margin-top: 6px !important;
  }
  .preset-btn-bar .btn-preset {
    font-size: 0.71rem !important;
    padding: 5px 2px !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* 선단 칩 터치 영역 및 랩핑 여유 공간 확보 */
  .fleet-chips-wrap {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    margin: 6px 0 !important;
  }
  .fleet-chip {
    font-size: 0.76rem !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
  }

  /* 선박 역할(본선, 운반선, 등선) 체크박스 터치 여유 */
  .role-chks-row, .vessel-role-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-top: 6px !important;
  }
  .role-chks-row .checkbox-label {
    font-size: 0.78rem !important;
    gap: 4px !important;
  }

  /* ========================================================================
     [메인 맵 뷰 하단 3단 완벽 분리]
     1층 (0 ~ 38px): Onpod 배지
     2층 (48 ~ 90px): 타임라인 바 (바닥에서 48px 떠서 가로/세로 간섭 0%)
     3층 (102 ~ 160px): Leaflet 줌 컨트롤 [+] [-]
     ======================================================================== */
  .timeline-bar {
    bottom: 48px !important;
    left: 8px !important;
    right: 8px !important;
    z-index: 920 !important;
  }
  .hist-summary-bar, .forecast-timeline-bar, .optimal-summary-bar {
    bottom: 48px !important;
    left: 8px !important;
    right: 8px !important;
    z-index: 920 !important;
  }
  .leaflet-bottom.leaflet-right {
    bottom: 102px !important;
    right: 8px !important;
    z-index: 850 !important;
  }
}


/* ==============================================================================
   [친절한 UI/UX 개선] 초보자 쉬운 가이드, AI 선장 브리핑, 모드 설명 배너
   ============================================================================== */

/* 1. 상단 헤더 '초보자 가이드' 버튼 */
.btn-guide-help {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-guide-help:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #f59e0b;
  color: #fef3c7;
  transform: translateY(-1px);
}
.guide-bulb {
  font-size: 0.88rem;
}

/* 2. 상단 모드별 쉬운 1줄 가이드 배너 */
.mode-guide-banner {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94));
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.77rem;
  color: #cbd5e1;
  position: relative;
  z-index: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.mgb-icon {
  font-size: 1.15rem;
  flex: 0 0 auto;
}
.mgb-content {
  flex: 1 1 auto;
  line-height: 1.4;
}
.mgb-title {
  font-weight: 800;
  color: #38bdf8;
  margin-right: 4px;
}
.mgb-desc {
  color: #e2e8f0;
}
.mgb-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.mgb-close-btn:hover {
  color: #f87171;
}

/* 3. [최적어장 찾기] AI 선장 맞춤형 추천 브리핑 카드 */
.opt-ai-captain-briefing {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(15, 23, 42, 0.85));
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}
.oacb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.oacb-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.oacb-robot-icon {
  font-size: 1.15rem;
}
.oacb-badge {
  font-weight: 800;
  font-size: 0.84rem;
  color: #38bdf8;
}
.oacb-tag {
  font-size: 0.70rem;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}
.oacb-lead {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.45;
  margin: 0 0 8px 0;
}
.oacb-reasons-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.oacb-reason-item {
  font-size: 0.73rem;
  color: #cbd5e1;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}
.oacb-dot {
  font-size: 0.82rem;
  flex: 0 0 auto;
}
.oacb-profit-text {
  color: #34d399;
  font-weight: 800;
}

/* 4. 각 결과 카드별 친절한 추천 이유 박스 */
.opt-reason-box {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  margin: 6px 0;
  font-size: 0.72rem;
  line-height: 1.42;
  color: #fef3c7;
}

/* 5. [초보자 가이드 모달] 팝업 */
.guide-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.guide-modal-box {
  background: #0f172a;
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  max-width: 650px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
}
.guide-modal-header {
  padding: 14px 18px;
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gmh-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gmh-icon {
  font-size: 1.25rem;
}
.gmh-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #f8fafc;
}
.btn-guide-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}
.btn-guide-modal-close:hover {
  color: #f87171;
}
.guide-modal-body {
  padding: 18px;
  overflow-y: auto;
}
.guide-card-intro {
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.guide-card-intro h4 {
  margin: 0 0 6px 0;
  color: #38bdf8;
  font-size: 0.90rem;
}
.guide-card-intro p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #cbd5e1;
}
.guide-steps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.guide-step-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  position: relative;
}
.gsc-num {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  background: rgba(255, 255, 255, 0.05);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gsc-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}
.gsc-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.4;
}
.guide-terms-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gt-item {
  background: rgba(15, 23, 42, 0.6);
  border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gt-term {
  font-size: 0.76rem;
  font-weight: 800;
  color: #fbbf24;
}
.gt-meaning {
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.4;
}
.guide-modal-footer {
  padding: 12px 18px;
  background: rgba(30, 41, 59, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
}
.btn-guide-confirm {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-guide-confirm:hover {
  opacity: 0.9;
}

@media (max-width: 640px) {
  .guide-steps-grid {
    grid-template-columns: 1fr;
  }
}
