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

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--kcg-border);
  flex-shrink: 0;
}

.app-header h1 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-family: 'Courier New', monospace;
}

/* Map mode toggle */
.map-mode-toggle {
  display: flex;
  gap: 4px;
  background: var(--kcg-subtle);
  border: 1px solid var(--kcg-border);
  border-radius: 6px;
  padding: 3px;
}

.map-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--kcg-dim);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Courier New', monospace;
}

.map-mode-btn:hover {
  color: var(--text-primary);
  background: var(--kcg-hover);
}

.map-mode-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
}

.map-mode-btn svg {
  flex-shrink: 0;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-counts {
  display: flex;
  gap: 10px;
}

.count-item {
  font-size: 11px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--kcg-hover);
  border: 1px solid var(--kcg-border);
}

.ac-count { color: #22d3ee; border-color: rgba(34, 211, 238, 0.3); }
.mil-count { color: #f97316; border-color: rgba(249, 115, 22, 0.3); }
.ship-count { color: #fb923c; border-color: rgba(251, 146, 60, 0.3); }
.sat-count { color: var(--kcg-danger); border-color: rgba(239, 68, 68, 0.3); }

.header-toggles {
  display: flex;
  gap: 4px;
}

.header-toggle-btn {
  background: var(--kcg-hover);
  border: 1px solid var(--kcg-border-light);
  color: var(--kcg-text-secondary);
  font-size: 10px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
}

.header-toggle-btn:hover {
  background: var(--kcg-hover-strong);
  border-color: var(--kcg-dim);
  color: var(--kcg-text);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kcg-border-heavy);
}

.status-dot.live {
  background: var(--danger);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.header-user {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--kcg-border);
}

.header-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.header-user-name {
  font-size: 11px;
  color: var(--kcg-text);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Cheonghae Unit pulsing beacon */
@keyframes cheonghae-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3); opacity: 0; }
}
@keyframes cheonghae-glow {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Planned strike targeting ring */
@keyframes planned-pulse {
  0%, 100% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.15); }
}

/* US Navy pulsing beacon (red) */
@keyframes usnavy-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}
@keyframes usnavy-glow {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Main layout */
.app-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.map-panel {
  flex: 1;
  position: relative;
  min-width: 0;
  min-height: 0;
}

.map-panel .maplibregl-map,
.map-panel .leaflet-container {
  background: var(--bg-primary);
}

/* Map overlay - Layer panel */
.map-overlay-left {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
}

/* Layer Panel */
.layer-panel {
  background: var(--kcg-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--kcg-border);
  border-radius: 8px;
  padding: 10px;
  min-width: 180px;
  box-shadow: var(--kcg-panel-shadow);
}

.layer-panel h3 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-family: 'Courier New', monospace;
}

.layer-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.layer-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border: none;
  font-size: 10px;
  border-radius: 4px;
  background: transparent;
  color: var(--kcg-dim);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.layer-toggle:hover {
  background: var(--kcg-hover);
}

.layer-toggle.active {
  color: var(--text-primary);
}

.layer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.layer-divider {
  height: 1px;
  background: var(--kcg-border);
  margin: 4px 0;
}

.layer-stats {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--kcg-border);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-family: 'Courier New', monospace;
}

.stat-cat {
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.stat-count {
  color: var(--text-primary);
  font-weight: 600;
}

.stat-header {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  padding: 2px 8px;
  font-family: 'Courier New', monospace;
}

/* Layer tree */
.layer-tree-header {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  transition: background 0.15s;
}
.layer-tree-header:hover { background: var(--kcg-hover); }
.layer-tree-arrow {
  font-size: 8px;
  width: 12px;
  text-align: center;
  color: var(--kcg-dim);
  transition: transform 0.15s;
}
.layer-tree-arrow.expanded { transform: rotate(90deg); }
.layer-tree-children {
  padding-left: 20px;
}
.category-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: 10px;
  cursor: pointer;
  border-radius: 3px;
  transition: opacity 0.15s;
}
.category-toggle.hidden { opacity: 0.35; }
.category-toggle:hover { background: var(--kcg-hover); }
.category-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.category-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-count { margin-left: auto; color: var(--kcg-muted); font-size: 9px; }

/* Nationality filter section */
.nationality-divider {
  height: 1px;
  background: var(--kcg-border);
  margin: 6px 0 4px;
}
.nationality-header {
  font-size: 9px;
  font-weight: 600;
  color: var(--kcg-dim);
  padding: 2px 8px;
  letter-spacing: 0.5px;
}

.legend-toggle {
  font-size: 9px;
  color: var(--kcg-dim);
  cursor: pointer;
  padding: 2px 8px;
  margin-top: 2px;
  background: none;
  border: none;
  text-align: left;
}
.legend-toggle:hover { color: var(--kcg-muted); }
.legend-content {
  padding: 2px 8px 4px;
}

/* Side panel */
.side-panel {
  width: 300px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--kcg-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--kcg-panel-shadow);
}

/* ═══ Dashboard Tabs in Header ═══ */
.dash-tabs {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 2px;
}
.dash-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--kcg-dim);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
}
.dash-tab:hover {
  color: var(--kcg-muted);
  background: rgba(255,255,255,0.05);
}
.dash-tab.active {
  color: var(--kcg-text);
  background: rgba(239,68,68,0.2);
}
.dash-tab-flag {
  font-size: 14px;
}

/* Event Log */
.event-log {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-left: 1px solid var(--kcg-border);
}

.event-log h3 {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--kcg-border);
  font-family: 'Courier New', monospace;
}

.event-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.event-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.event-item {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  transition: background 0.15s;
}

.event-item:hover {
  background: var(--kcg-subtle);
}

.event-tag {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 5px;
  border-radius: 2px;
  color: var(--kcg-text);
  white-space: nowrap;
  height: fit-content;
  margin-top: 2px;
  font-family: 'Courier New', monospace;
}

.event-content {
  flex: 1;
  min-width: 0;
}

.event-label {
  font-size: 12px;
  font-weight: 500;
}

.event-time {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 1px;
  font-family: 'Courier New', monospace;
}

.event-desc {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

/* Breaking News Section */
.breaking-news-section {
  flex-shrink: 0;
  border-bottom: 1px solid var(--kcg-border);
  max-height: 280px;
  overflow-y: auto;
}

.breaking-news-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.08);
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
  position: sticky;
  top: 0;
  z-index: 1;
}

.breaking-flash {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--kcg-text);
  background: var(--kcg-danger);
  padding: 2px 6px;
  border-radius: 2px;
  font-family: 'Courier New', monospace;
  animation: flash-pulse 1.5s ease-in-out infinite;
}

@keyframes flash-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.breaking-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  font-family: 'Courier New', monospace;
}

.breaking-news-list {
  padding: 4px 8px;
}

.breaking-news-item {
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 3px;
  border-left: 2px solid transparent;
  transition: background 0.15s;
}

.breaking-news-item:hover {
  background: var(--kcg-subtle);
}

.breaking-news-item.breaking-new {
  border-left: 2px solid var(--kcg-danger);
  background: rgba(239, 68, 68, 0.05);
}

.breaking-news-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.breaking-cat-tag {
  font-size: 9px;
  font-weight: 700;
  color: var(--kcg-text);
  padding: 1px 6px;
  border-radius: 2px;
  white-space: nowrap;
}

.breaking-news-time {
  font-size: 9px;
  color: var(--kcg-dim);
  font-family: 'Courier New', monospace;
}

.breaking-news-headline {
  font-size: 11px;
  font-weight: 600;
  color: var(--kcg-text);
  line-height: 1.4;
}

.breaking-news-detail {
  font-size: 10px;
  color: var(--kcg-muted);
  line-height: 1.3;
  margin-top: 2px;
}

/* ═══ OSINT Live Feed ═══ */
.osint-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--kcg-border);
  background: rgba(239, 68, 68, 0.06);
  flex-shrink: 0;
}
.osint-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--kcg-danger);
  animation: osint-pulse 1.5s ease-in-out infinite;
}
@keyframes osint-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  50% { opacity: 0.6; box-shadow: 0 0 6px 3px rgba(239,68,68,0.3); }
}
.osint-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--kcg-danger);
  font-family: 'Courier New', monospace;
}
.osint-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--kcg-muted);
  font-family: 'Courier New', monospace;
}
.osint-loading {
  margin-left: auto;
  font-size: 10px;
  color: var(--kcg-dim);
  font-style: italic;
}
.osint-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
}
.osint-item {
  display: block;
  padding: 8px 8px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.osint-item:hover {
  background: rgba(255,255,255,0.05);
}
.osint-item.osint-recent {
  border-left-color: var(--kcg-danger);
  background: rgba(239,68,68,0.05);
}
.osint-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.osint-cat-tag {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--kcg-text);
  white-space: nowrap;
}
.osint-lang-tag {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--kcg-accent-hover);
  color: var(--kcg-text);
}
.osint-time {
  margin-left: auto;
  font-size: 9px;
  color: var(--kcg-dim);
  white-space: nowrap;
  font-family: 'Courier New', monospace;
}
.osint-item-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--kcg-text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.osint-item:hover .osint-item-title {
  color: var(--kcg-text);
}
.osint-item-source {
  font-size: 9px;
  color: var(--kcg-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Ship Summary (area total + Korean) */
.kr-ship-summary {
  padding: 10px 12px;
  background: rgba(59, 130, 246, 0.06);
  border-bottom: 1px solid var(--kcg-border);
  flex-shrink: 0;
}

.area-ship-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--kcg-hover);
}

.korean-highlight-toggle {
  margin-left: auto;
  padding: 1px 8px;
  font-size: 9px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  border-radius: 3px;
  border: 1px solid var(--kcg-border);
  background: transparent;
  color: var(--kcg-muted);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.6;
}

.korean-highlight-toggle.active {
  border-color: #00e5ff;
  background: rgba(0, 229, 255, 0.15);
  color: #00e5ff;
}

.area-ship-icon {
  font-size: 14px;
}

.area-ship-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.area-ship-total {
  margin-left: auto;
  font-size: 16px;
  font-weight: 700;
  color: #fb923c;
  font-family: 'Courier New', monospace;
}

.kr-ship-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.kr-flag {
  font-size: 16px;
}

.kr-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

.kr-total {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--kcg-accent);
  font-family: 'Courier New', monospace;
}

.kr-ship-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.kr-ship-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.kr-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.kr-cat {
  flex: 1;
  font-size: 10px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.kr-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  font-family: 'Courier New', monospace;
}

.kr-ship-list {
  max-height: 120px;
  overflow-y: auto;
}

.kr-ship-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 9px;
  font-family: 'Courier New', monospace;
}

.kr-ship-name {
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kr-ship-type {
  color: var(--text-secondary);
  font-size: 8px;
  flex-shrink: 0;
}

.kr-ship-speed {
  color: #22d3ee;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 32px;
  text-align: right;
}

.kr-ship-speed:not(:empty) {
  padding: 1px 4px;
  background: rgba(34, 211, 238, 0.1);
  border-radius: 2px;
}

/* ═══ Iran Tab — Military Ship List ═══ */
.iran-ship-summary {
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.04);
  border-bottom: 1px solid var(--kcg-border);
  flex-shrink: 0;
}
.iran-mil-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.iran-mil-icon { font-size: 12px; }
.iran-mil-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--kcg-danger);
  letter-spacing: 0.5px;
}
.iran-mil-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--kcg-danger);
}
.iran-mil-list {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}
.iran-mil-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 2px;
  font-size: 10px;
}
.iran-mil-item:hover {
  background: rgba(255,255,255,0.03);
}

.iran-mil-item-interactive {
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 3px;
}

.iran-mil-item-interactive:hover {
  background: rgba(0, 229, 255, 0.1);
}
.iran-mil-flag { font-size: 11px; flex-shrink: 0; }
.iran-mil-name {
  flex: 1;
  color: var(--kcg-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.iran-mil-cat {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 2px;
  flex-shrink: 0;
}
.iran-mil-cat.cat-carrier { color: #ff4444; background: rgba(255,68,68,0.15); }
.iran-mil-cat.cat-destroyer { color: #ff8800; background: rgba(255,136,0,0.15); }
.iran-mil-cat.cat-warship { color: #ff6600; background: rgba(255,102,0,0.15); }
.iran-mil-cat.cat-patrol { color: #ffcc00; background: rgba(255,204,0,0.15); }

/* ═══ Korea Tab ═══ */
.korea-safety {
  padding: 12px;
  background: rgba(59, 130, 246, 0.06);
  border-bottom: 1px solid var(--kcg-border);
  flex-shrink: 0;
}
.korea-safety-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.korea-safety-icon { font-size: 14px; }
.korea-safety-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--kcg-accent);
  letter-spacing: 0.5px;
}
.korea-safety-stats {
  display: flex;
  gap: 8px;
}
.korea-stat-card {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.korea-stat-card.total { border-color: rgba(59,130,246,0.3); }
.korea-stat-card.anchored { border-color: rgba(239,68,68,0.3); }
.korea-stat-card.moving { border-color: rgba(34,197,94,0.3); }
.korea-stat-num {
  font-size: 20px;
  font-weight: 800;
  font-family: 'Courier New', monospace;
}
.korea-stat-card.total .korea-stat-num { color: var(--kcg-accent); }
.korea-stat-card.anchored .korea-stat-num { color: var(--kcg-danger); }
.korea-stat-card.moving .korea-stat-num { color: var(--kcg-success); }
.korea-stat-label {
  font-size: 9px;
  color: var(--kcg-muted);
  margin-top: 2px;
  font-weight: 600;
}
.korea-breakdown {
  padding: 8px 12px;
  border-bottom: 1px solid var(--kcg-border);
  flex-shrink: 0;
}
.korea-breakdown-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--kcg-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-family: 'Courier New', monospace;
}
.korea-ship-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.korea-ship-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  color: var(--kcg-muted);
  border-bottom: 1px solid var(--kcg-border);
  flex-shrink: 0;
  font-family: 'Courier New', monospace;
}
.korea-ship-section-count {
  color: var(--kcg-accent);
  font-size: 11px;
}
.korea-ship-detail-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}
.korea-ship-card {
  padding: 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  background: rgba(255,255,255,0.02);
  transition: background 0.15s;
}
.korea-ship-card:hover { background: rgba(255,255,255,0.05); }
.korea-ship-card.anchored { border-left-color: var(--kcg-danger); }
.korea-ship-card.moving { border-left-color: var(--kcg-success); }
.korea-ship-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}
.korea-ship-card-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--kcg-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.korea-ship-status {
  font-size: 8px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-left: 6px;
}
.korea-ship-status.stat-anchored {
  color: var(--kcg-danger);
  background: rgba(239,68,68,0.15);
}
.korea-ship-status.stat-moving {
  color: var(--kcg-success);
  background: rgba(34,197,94,0.15);
}
.korea-ship-card-info {
  display: flex;
  gap: 8px;
  font-size: 9px;
  align-items: center;
}
.korea-ship-card-type { font-weight: 600; }
.korea-ship-card-code { color: var(--kcg-dim); }
.korea-ship-card-speed {
  margin-left: auto;
  color: var(--kcg-muted);
  font-family: 'Courier New', monospace;
}
.korea-ship-card-dest {
  font-size: 9px;
  color: var(--kcg-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Charts Panel */
.charts-panel {
  background: var(--bg-secondary);
  border-top: 1px solid var(--kcg-border);
  flex-shrink: 0;
  height: 110px;
  overflow: visible;
  box-shadow: var(--kcg-panel-shadow);
  position: relative;
  z-index: 5;
}

.sensor-chart h3 {
  padding: 3px 16px 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 2px 12px 4px;
}

.chart-item h4 {
  font-size: 8px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0;
  padding-left: 4px;
  font-family: 'Courier New', monospace;
}

.chart-demo-label {
  font-size: 9px;
  color: #ef4444;
  opacity: 0.7;
}

/* ═══ Ship popup modal ═══ */
.vessel-photo-frame {
  height: 160px;
}

.ship-popup-body {
  width: 300px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.4;
}

.ship-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px 4px 0 0;
  margin: -10px -10px 8px -10px;
  color: #fff;
}

.ship-popup-name {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ship-popup-navy-badge {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  color: #000;
  line-height: 1;
}

/* Type tags row */
.ship-popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--kcg-border-light, rgba(100, 116, 139, 0.15));
}

.ship-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.ship-tag-primary {
  color: #fff;
}

.ship-tag-secondary {
  background: rgba(100, 116, 139, 0.3);
  color: #94a3b8;
}

.ship-tag-dim {
  background: var(--kcg-hover, rgba(100, 116, 139, 0.1));
  color: var(--kcg-dim, #64748b);
}

/* Data grid */
.ship-popup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
}

.ship-popup-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid var(--kcg-border-light, rgba(100, 116, 139, 0.08));
  overflow: hidden;
  min-height: 18px;
}

.ship-popup-row:nth-last-child(1),
.ship-popup-row:nth-last-child(2) {
  border-bottom: none;
}

/* Full-width rows for long values (status, destination, ETA) */
.ship-popup-full-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-top: 1px solid var(--kcg-border-light, rgba(100, 116, 139, 0.08));
}

.ship-popup-full-row .ship-popup-value {
  text-align: right;
  min-width: 0;
}

.ship-popup-label {
  color: #888;
  font-size: 10px;
  flex-shrink: 0;
  margin-right: 4px;
}

.ship-popup-value {
  font-size: 10px;
  color: #e2e8f0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer */
.ship-popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--kcg-border-light, rgba(100, 116, 139, 0.15));
}

.ship-popup-timestamp {
  font-size: 9px;
  color: #64748b;
}

.ship-popup-link {
  font-size: 10px;
  color: var(--kcg-accent, #3b82f6);
  text-decoration: none;
}

/* ═══ 범용 팝업 스타일 ═══ */
.popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px 4px 0 0;
  margin: -10px -10px 8px -10px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.popup-body {
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.popup-body-sm {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  min-width: 220px;
}

.popup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 12px;
  font-size: 11px;
}

.popup-label {
  color: var(--kcg-muted, #888);
}

.popup-desc {
  margin-top: 6px;
  font-size: 11px;
  color: var(--kcg-text-secondary, #ccc);
  line-height: 1.4;
}

.ship-popup-link:hover {
  text-decoration: underline;
}

/* Footer / Controls */
.app-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--kcg-border);
  padding: 4px 20px 6px;
  flex-shrink: 0;
  box-shadow: var(--kcg-panel-shadow);
}

/* Replay Controls */
.replay-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 3px;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--kcg-border-light);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.ctrl-btn:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
}

.play-btn {
  width: 34px;
  height: 34px;
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.15);
}

.play-btn:hover {
  background: rgba(59, 130, 246, 0.3);
}

.speed-controls {
  display: flex;
  gap: 3px;
  margin-left: 8px;
}

.speed-btn {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  border: 1px solid var(--kcg-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Courier New', monospace;
}

.speed-btn:hover {
  border-color: var(--kcg-border-heavy);
  color: var(--text-primary);
}

.speed-btn.active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}

/* Range Controls */
.range-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  position: relative;
}

.range-presets {
  display: flex;
  gap: 3px;
  align-items: center;
}

.range-btn {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  border: 1px solid var(--kcg-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Courier New', monospace;
}

.range-btn:hover {
  border-color: var(--kcg-border-heavy);
  color: var(--text-primary);
}

.range-btn.active {
  border-color: var(--kcg-success);
  background: rgba(34, 197, 94, 0.15);
  color: var(--kcg-success);
}

.custom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 6px;
}

/* Range Picker Dropdown */
.range-picker {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 6px;
  background: var(--kcg-glass-dense);
  border: 1px solid var(--kcg-border);
  border-radius: 6px;
  padding: 10px 12px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
}

.range-picker-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.range-picker label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.range-picker label span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.range-picker input[type="datetime-local"] {
  background: var(--bg-secondary);
  border: 1px solid var(--kcg-border-light);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 4px 8px;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  outline: none;
  transition: border-color 0.15s;
}

.range-picker input[type="datetime-local"]:focus {
  border-color: var(--accent);
}

.range-picker input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

.range-apply-btn {
  padding: 5px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 4px;
  border: 1px solid var(--kcg-success);
  background: rgba(34, 197, 94, 0.15);
  color: var(--kcg-success);
  cursor: pointer;
  font-family: 'Courier New', monospace;
  transition: all 0.15s;
  white-space: nowrap;
}

.range-apply-btn:hover {
  background: rgba(34, 197, 94, 0.3);
}

/* Timeline Slider */
.timeline-slider {
  width: 100%;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-family: 'Courier New', monospace;
}

.timeline-current {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 12px;
}

.timeline-track {
  position: relative;
  height: 18px;
  background: var(--kcg-card);
  border-radius: 3px;
  cursor: pointer;
  overflow: visible;
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.1));
  border-radius: 3px 0 0 3px;
  pointer-events: none;
}

.timeline-playhead {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 22px;
  background: var(--accent);
  border-radius: 1px;
  transform: translateX(-1px);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Timeline event markers — clickable slots */
.tl-marker {
  position: absolute;
  top: 1px;
  width: 5px;
  height: 16px;
  border-radius: 1px;
  background: var(--marker-color);
  opacity: 0.5;
  transform: translateX(-2px);
  cursor: pointer;
  transition: all 0.12s ease;
  z-index: 2;
}

.tl-marker:hover {
  opacity: 1;
  width: 7px;
  transform: translateX(-3px);
  box-shadow: 0 0 8px var(--marker-color);
}

.tl-marker.selected {
  opacity: 1;
  width: 7px;
  transform: translateX(-3px);
  box-shadow: 0 0 10px var(--marker-color);
  border: 1px solid var(--kcg-text);
}

.tl-marker.in-cluster {
  opacity: 0.8;
}

/* Event detail strip below timeline */
.tl-detail-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
  max-height: 54px;
  overflow-y: auto;
  padding: 2px 0;
  animation: tl-strip-in 0.15s ease-out;
}

@keyframes tl-strip-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.tl-event-card {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--kcg-subtle);
  border: 1px solid var(--kcg-border);
  border-radius: 4px;
  padding: 3px 8px 3px 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: left;
}

.tl-event-card:hover {
  background: var(--kcg-hover-strong);
  border-color: var(--card-color);
}

.tl-event-card.active {
  background: var(--kcg-hover);
  border-color: var(--card-color);
}

.tl-event-card.future {
  opacity: 0.3;
}

.tl-card-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card-color);
  flex-shrink: 0;
  box-shadow: 0 0 5px var(--card-color);
}

.tl-event-card.future .tl-card-dot {
  box-shadow: none;
  opacity: 0.4;
}

.tl-card-time {
  font-size: 9px;
  font-weight: 700;
  color: var(--kcg-dim);
  font-family: 'Courier New', monospace;
  flex-shrink: 0;
}

.tl-card-source {
  font-size: 7px;
  font-weight: 700;
  color: var(--kcg-text);
  padding: 0 4px;
  border-radius: 2px;
  flex-shrink: 0;
  line-height: 1.5;
}

.tl-card-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--kcg-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.tl-card-type {
  font-size: 8px;
  color: var(--kcg-border-heavy);
  flex-shrink: 0;
}

.tl-card-goto {
  color: var(--kcg-border-heavy);
  flex-shrink: 0;
  transition: color 0.1s;
}

.tl-event-card:hover .tl-card-goto {
  color: var(--card-color);
}

.stat-header {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  padding-left: 8px;
  font-family: 'Courier New', monospace;
}

/* Aircraft, Satellite, Ship & Oil Tooltips - override Leaflet */
.aircraft-tooltip,
.satellite-tooltip,
.ship-tooltip,
.oil-tooltip,
.airport-tooltip {
  background: var(--kcg-glass) !important;
  border: 1px solid var(--kcg-border) !important;
  border-radius: 3px !important;
  padding: 2px 6px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
  font-family: 'Courier New', monospace !important;
}

.aircraft-tooltip::before,
.satellite-tooltip::before,
.ship-tooltip::before,
.oil-tooltip::before,
.airport-tooltip::before {
  border-right-color: var(--kcg-glass) !important;
}

/* Aircraft, Satellite, Ship, Impact & Facility icon containers */
.aircraft-icon,
.satellite-icon,
.ship-icon,
.impact-icon,
.airport-icon,
.refinery-icon,
.oilfield-icon,
.gasfield-icon,
.terminal-icon,
.petrochem-icon {
  background: none !important;
  border: none !important;
}

/* 새로 발생한 이벤트 플래시 효과 — lightweight (no filter) */
.event-flash {
  animation: event-glow 1s ease-in-out infinite alternate;
}

@keyframes event-glow {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* 확장 펄스 링 — lightweight opacity only */
.event-pulse-ring {
  animation: pulse-expand 1.5s ease-out infinite;
}

@keyframes pulse-expand {
  0% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* 공격 충격파 — 큰 확장 링 */
.event-shockwave {
  animation: shockwave-expand 2s ease-out infinite;
}

@keyframes shockwave-expand {
  0% { opacity: 0.8; stroke-width: 3; }
  50% { opacity: 0.3; }
  100% { opacity: 0; }
}

/* 공격 내부 플래시 — 밝은 깜빡임 */
.event-strike-flash {
  animation: strike-flash 0.8s ease-in-out infinite alternate;
}

@keyframes strike-flash {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Impact site tooltip */
.impact-tooltip {
  background: rgba(40, 0, 0, 0.9) !important;
  border: 1px solid var(--kcg-event-impact) !important;
  border-radius: 3px !important;
  padding: 2px 6px !important;
  box-shadow: 0 2px 12px rgba(255, 0, 0, 0.4) !important;
  font-family: 'Courier New', monospace !important;
}

.impact-tooltip::before {
  border-right-color: rgba(40, 0, 0, 0.9) !important;
}

/* MapLibre GL popup override */
.gl-popup .maplibregl-popup-content,
.event-popup .maplibregl-popup-content {
  background: rgba(10, 10, 26, 0.96) !important;
  color: #e0e0e0 !important;
  border: 1px solid #444 !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8) !important;
  padding: 10px !important;
}

.gl-popup .maplibregl-popup-tip,
.event-popup .maplibregl-popup-tip {
  border-top-color: rgba(10, 10, 26, 0.96) !important;
}

.gl-popup .maplibregl-popup-close-button,
.event-popup .maplibregl-popup-close-button {
  color: #aaa !important;
  font-size: 18px;
  right: 4px;
  top: 2px;
}

/* Override default white popup background globally */
.maplibregl-popup-content {
  background: rgba(10, 10, 26, 0.96) !important;
  color: #e0e0e0 !important;
  border: 1px solid #444 !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8) !important;
}
.maplibregl-popup-tip {
  border-top-color: rgba(10, 10, 26, 0.96) !important;
}
.maplibregl-popup-close-button {
  color: #aaa !important;
}

/* GL marker labels (replaces Leaflet tooltips) */
.gl-marker-label {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 6px;
  white-space: nowrap;
  pointer-events: none;
  font-weight: 600;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  text-shadow: var(--kcg-map-label-shadow);
  background: var(--kcg-glass);
  border: 1px solid var(--kcg-border);
  border-radius: 3px;
  padding: 1px 5px;
}

.gl-impact-label {
  position: absolute;
  left: 100%;
  top: -8px;
  margin-left: 8px;
  white-space: nowrap;
  pointer-events: none;
  color: var(--kcg-event-impact);
  font-weight: 700;
  font-size: 10px;
  font-family: 'Courier New', monospace;
  text-shadow: var(--kcg-map-impact-shadow);
  background: rgba(40, 0, 0, 0.85);
  border: 1px solid var(--kcg-event-impact);
  border-radius: 3px;
  padding: 1px 5px;
}

.gl-new-badge {
  background: var(--kcg-event-impact);
  color: var(--kcg-text);
  padding: 0 3px;
  border-radius: 2px;
  font-size: 8px;
  margin-right: 4px;
  animation: event-glow 0.8s ease-in-out infinite alternate;
}

/* GL animation classes */
.gl-pulse-ring {
  animation: pulse-expand 1.5s ease-out infinite;
}

.gl-shockwave {
  animation: shockwave-expand 2s ease-out infinite;
}

.gl-strike-flash {
  animation: strike-flash 0.8s ease-in-out infinite alternate;
}

.gl-event-flash {
  animation: event-glow 1s ease-in-out infinite alternate;
}

/* Leaflet popup override (kept for globe mode fallback) */
.leaflet-popup-content-wrapper {
  background: var(--kcg-glass-dense) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--kcg-border) !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-popup-tip {
  background: var(--kcg-glass-dense) !important;
  border: 1px solid var(--kcg-border) !important;
}

.leaflet-popup-close-button {
  color: var(--kcg-muted) !important;
}

/* ======================== */
/* Mode Toggle (LIVE/REPLAY) */
/* ======================== */
.mode-toggle {
  display: flex;
  gap: 4px;
  background: var(--kcg-subtle);
  border: 1px solid var(--kcg-border);
  border-radius: 6px;
  padding: 3px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--kcg-dim);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Courier New', monospace;
}

.mode-btn:hover {
  color: var(--text-primary);
  background: var(--kcg-hover);
}

.mode-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
}

.mode-btn.active.live {
  color: var(--kcg-danger);
  border-color: var(--kcg-danger);
  background: rgba(239, 68, 68, 0.12);
}

.mode-dot-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.mode-btn.active.live .mode-dot-icon {
  animation: pulse 1s infinite;
}

/* ======================== */
/* Live Controls (footer)   */
/* ======================== */
.live-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--kcg-danger);
  animation: pulse 1s infinite;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.live-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--kcg-danger);
  font-family: 'Courier New', monospace;
}

.live-clock {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  padding: 4px 12px;
  background: var(--kcg-hover);
  border: 1px solid var(--kcg-border);
  border-radius: 4px;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.history-presets {
  display: flex;
  gap: 3px;
}

.history-btn {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  border: 1px solid var(--kcg-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Courier New', monospace;
}

.history-btn:hover {
  border-color: var(--kcg-border-heavy);
  color: var(--text-primary);
}

.history-btn.active {
  border-color: var(--kcg-danger);
  background: rgba(239, 68, 68, 0.15);
  color: var(--kcg-danger);
}

.tz-radio-group {
  display: inline-flex;
  border: 1px solid var(--kcg-border);
  border-radius: 3px;
  overflow: hidden;
}

.tz-radio-btn {
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
}

.tz-radio-btn + .tz-radio-btn {
  border-left: 1px solid var(--kcg-border);
}

.tz-radio-btn.active {
  background: rgba(239, 68, 68, 0.15);
  color: var(--kcg-danger);
}

.tz-radio-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* Live mode accent on header border */
.app-live .app-header {
  border-bottom-color: rgba(239, 68, 68, 0.3);
}

.app-live .app-footer {
  border-top-color: rgba(239, 68, 68, 0.3);
}


/* Zoom animation — only during active zoom, not always */
.leaflet-zoom-anim .leaflet-zoom-animated {
  will-change: transform;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--kcg-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--kcg-border-heavy);
}

/* ═══ News Ticker (OSINT) ═══ */
.news-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  height: 24px;
  overflow: hidden;
}

.news-ticker-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--kcg-info);
  background: rgba(6, 182, 212, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  animation: ticker-pulse 2s ease-in-out infinite;
}

@keyframes ticker-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.news-ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
}

.news-ticker-scroll {
  display: flex;
  gap: 24px;
  animation: ticker-scroll 60s linear infinite;
  white-space: nowrap;
  width: max-content;
}

.news-ticker-scroll:hover {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.news-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--kcg-text-secondary);
  text-decoration: none;
  cursor: pointer;
  padding: 1px 0;
  transition: color 0.15s;
}

.news-ticker-item:hover {
  color: var(--kcg-text);
}

.news-ticker-cat {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.news-ticker-title {
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-ticker-time {
  font-size: 9px;
  color: var(--kcg-dim);
  flex-shrink: 0;
}

.news-ticker-item + .news-ticker-item::before {
  content: '·';
  color: var(--kcg-border-light);
  margin-right: 6px;
}

/* ===== CollectorMonitor ===== */
.collector-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background: var(--kcg-panel-bg, rgba(15, 23, 42, 0.95));
  border: 1px solid var(--kcg-border, rgba(100, 116, 139, 0.3));
  border-radius: 12px;
  padding: 20px;
  min-width: 600px;
  max-width: 800px;
  max-height: 80vh;
  overflow: auto;
  color: var(--kcg-text, #e2e8f0);
  font-family: monospace;
  font-size: 13px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.collector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.collector-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.collector-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.collector-server-time {
  font-size: 11px;
  opacity: 0.6;
}

.collector-refresh-btn {
  background: none;
  border: 1px solid var(--kcg-border, rgba(100, 116, 139, 0.3));
  color: var(--kcg-text, #e2e8f0);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 12px;
}

.collector-close-btn {
  background: none;
  border: none;
  color: var(--kcg-text, #e2e8f0);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}

.collector-error {
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  margin-bottom: 12px;
}

.collector-table {
  width: 100%;
  border-collapse: collapse;
}

.collector-table thead tr {
  border-bottom: 1px solid var(--kcg-border, rgba(100, 116, 139, 0.3));
}

.collector-th {
  text-align: left;
  padding: 6px 8px;
  font-size: 11px;
  opacity: 0.7;
}

.collector-th-right {
  text-align: right;
  padding: 6px 8px;
  font-size: 11px;
  opacity: 0.7;
}

.collector-table tbody tr {
  border-bottom: 1px solid var(--kcg-border, rgba(100, 116, 139, 0.15));
}

.collector-td {
  padding: 8px;
}

.collector-td-right {
  padding: 8px;
  text-align: right;
}

.collector-td-name {
  padding: 8px;
  font-weight: 500;
}

.collector-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.collector-success-count {
  color: #22c55e;
}

.collector-td-last-success {
  padding: 8px;
  opacity: 0.8;
}

.collector-td-error {
  padding: 8px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.collector-td-empty {
  padding: 20px;
  text-align: center;
  opacity: 0.5;
}
