.globe-live-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--success);
  background: var(--success-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(22, 163, 74, 0.15);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.globe-page {
  padding-top: 60px;
  height: 100vh;
  overflow: hidden;
}

.globe-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
}

.globe-viewport {
  position: relative;
  overflow: hidden;
  background: #0d1117;
  flex: 1 1 0;
  min-height: 0;
}

#cesiumContainer {
  width: 100%;
  height: 100%;
}

#cesiumContainer .cesium-viewer-bottom,
#cesiumContainer .cesium-viewer-animationContainer,
#cesiumContainer .cesium-viewer-timelineContainer,
#cesiumContainer .cesium-viewer-fullscreenContainer {
  display: none !important;
}

.globe-overlay-top {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 10;
  pointer-events: none;
}

.globe-overlay-top h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  margin-bottom: 2px;
  letter-spacing: -0.02em;
}

.globe-overlay-top p {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.globe-overlay-controls {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

.traffic-toggle-btn {
  align-self: flex-start;
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(10, 14, 22, 0.72);
  color: rgba(255,255,255,0.92);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.traffic-toggle-btn:hover {
  border-color: rgba(255,255,255,0.28);
  background: rgba(17, 24, 39, 0.84);
}

.traffic-toggle-btn.active {
  color: #d1fae5;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(6, 78, 59, 0.62);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12), 0 0 18px rgba(34, 197, 94, 0.16);
}

.traffic-toggle-btn:active {
  transform: translateY(1px);
}

.traffic-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.traffic-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(10, 14, 22, 0.56);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.72);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.traffic-legend-swatch {
  display: inline-block;
  flex-shrink: 0;
}

.traffic-legend-swatch.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16), 0 0 10px rgba(34, 197, 94, 0.28);
}

.traffic-legend-swatch.direct,
.traffic-legend-swatch.relay {
  width: 16px;
  height: 2px;
  border-radius: 999px;
}

.traffic-legend-swatch.direct {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.28);
}

.traffic-legend-swatch.relay {
  background: #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.28);
}

.traffic-legend-swatch.observed {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.32);
}

/* Mode selector */
.mode-selector {
  display: flex;
  gap: 2px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.mode-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

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

.mode-btn.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.mode-btn[data-mode="live"].active { color: var(--success); }
.mode-btn[data-mode="v2"].active  { color: var(--warning); }

/* Advisory banner */
.advisory-banner {
  margin-top: 6px;
  padding: 5px 10px;
  background: rgba(217, 119, 6, 0.14);
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-radius: var(--radius-sm);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

/* Blocked arc */
.arc-blocked { stroke: #ef4444; }

/* Sim link list (v2 advisory panel) */
.sim-link-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 180px;
  overflow-y: auto;
}

.sim-summary-line {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-weight: 600;
}

.sim-link-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 10px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.sim-link-item.blocked {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.04);
}

.sim-link-route {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
  white-space: nowrap;
  min-width: 140px;
}

.sim-link-state {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

.sim-link-state.reachable {
  color: var(--success);
  background: var(--success-light);
}

.sim-link-state.blocked {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.sim-link-detail {
  flex: 1;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.5;
  min-width: 0;
}

.sim-link-bearer {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
}

.sim-link-blocked-reason {
  display: inline-block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Bottom panel */
.globe-bottom-panel {
  flex-shrink: 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  overflow-y: auto;
  max-height: 34vh;
}

.bottom-panel-top {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px 12px;
}

.bottom-panel-nodes {
  padding: 0 12px 10px;
}

.globe-panel-nodes .node-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 6px;
}

.globe-panel-nodes .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.globe-panel-nodes .panel-header .panel-footer-info {
  gap: 12px;
}

.globe-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.globe-panel h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

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

.panel-header h3 {
  margin-bottom: 0;
}

.refresh-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0;
  transition: opacity 0.3s;
}

.refresh-indicator.active {
  opacity: 1;
}

/* Overview stats */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.overview-stat {
  text-align: center;
  padding: 8px 4px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
}

.overview-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
  letter-spacing: -0.02em;
}

.overview-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Tailscale status */
.ts-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.ts-status-row:first-child {
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.ts-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.ts-status-dot.running { background: var(--success); box-shadow: 0 0 6px rgba(22,163,74,0.4); }
.ts-status-dot.stopped { background: var(--danger); }

.ts-status-key {
  color: var(--text-muted);
  font-size: 12px;
}

.ts-status-val {
  font-weight: 600;
  font-size: 13px;
}

.mono { font-family: var(--mono); }

/* Bearer list */
.bearer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bearer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

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

.bearer-dot.healthy { background: var(--success); box-shadow: 0 0 4px rgba(22,163,74,0.3); }
.bearer-dot.degraded { background: var(--warning); }
.bearer-dot.failed { background: var(--danger); }

.bearer-info {
  flex: 1;
  min-width: 0;
}

.bearer-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: block;
}

.bearer-iface {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.bearer-rtt {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.bearer-placeholder,
.node-placeholder {
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 0;
}

/* Node list */
.node-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.node-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.node-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

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

.node-dot.online { background: var(--success); box-shadow: 0 0 4px rgba(22,163,74,0.3); }
.node-dot.offline { background: var(--text-dim); }

.node-info { flex: 1; min-width: 0; }

.node-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-meta {
  font-size: 10px;
  color: var(--text-dim);
}

.node-meta .mono {
  font-size: 10px;
}

.node-conn {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.node-conn.direct {
  color: var(--success);
  background: var(--success-light);
}

.node-conn.relay {
  color: var(--primary);
  background: var(--primary-light);
}

.node-traffic {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.node-traffic-live {
  display: inline-block;
  margin-top: 3px;
  color: var(--text-muted);
}

.node-traffic-live.active {
  color: var(--success);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.18);
}

.node-traffic-total {
  display: block;
  margin-top: 2px;
}

.node-obs-badge {
  display: inline-block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

/* Traffic test panel */
.bottom-panel-tests {
  padding: 0 12px 10px;
}

.globe-panel-tests .traffic-test-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.traffic-test-item {
  padding: 8px 10px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

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

.tt-route {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
}

.tt-age {
  font-size: 10px;
  color: var(--text-dim);
}

.tt-metrics {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.tt-bearer {
  font-weight: 700;
  font-family: var(--mono);
}

.tt-throughput {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text-muted);
}

.tt-sla {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
}

.tt-sla.sla-pass {
  color: var(--success);
  background: var(--success-light);
}

.tt-sla.sla-fail {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.tt-bearer-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.obs-bearer-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: var(--bg);
}

/* Panel footer */
.globe-panel-muted {
  background: transparent;
  border: none;
  padding: 4px 4px 0;
}

.panel-footer-info {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
}

/* Quality band legend swatches */
.traffic-legend-swatch.qb-excellent,
.traffic-legend-swatch.qb-good,
.traffic-legend-swatch.qb-degraded,
.traffic-legend-swatch.qb-marginal {
  width: 16px;
  height: 2px;
  border-radius: 999px;
}
.traffic-legend-swatch.qb-excellent { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.28); }
.traffic-legend-swatch.qb-good      { background: #3b82f6; box-shadow: 0 0 8px rgba(59,130,246,0.28); }
.traffic-legend-swatch.qb-degraded  { background: #eab308; box-shadow: 0 0 8px rgba(234,179,8,0.28); }
.traffic-legend-swatch.qb-marginal  { background: #f97316; box-shadow: 0 0 8px rgba(249,115,22,0.28); }

/* Bearer capabilities legend */
.bearer-caps-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.bearer-cap-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(10, 14, 22, 0.56);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.72);
  backdrop-filter: blur(8px);
  cursor: help;
}

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

.bearer-cap-name {
  font-family: var(--mono);
  font-weight: 700;
}

.bearer-cap-meta {
  color: rgba(255,255,255,0.45);
  font-size: 9px;
}

/* Health badge */
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.health-badge.pass {
  color: var(--success);
  background: var(--success-light);
  border: 1px solid rgba(22, 163, 74, 0.15);
}

.health-badge.fail {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.health-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.health-dot.pass { background: var(--success); box-shadow: 0 0 4px rgba(22,163,74,0.4); }
.health-dot.fail { background: var(--danger); box-shadow: 0 0 4px rgba(239,68,68,0.4); }

.health-label {
  white-space: nowrap;
}

/* Detail overlay panels (link detail + node detail) */
.detail-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 20;
  width: 340px;
  max-height: 50vh;
  overflow-y: auto;
  pointer-events: auto;
}

.detail-overlay-right {
  left: auto;
  right: 12px;
}

.detail-overlay .globe-panel {
  background: rgba(13, 17, 23, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
}

.link-detail-close {
  appearance: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.link-detail-close:hover { background: rgba(255,255,255,0.08); }

.link-detail-route {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

/* Link detail bearer rows */
.ld-distance {
  font-size: 11px;
  font-family: var(--mono);
  color: rgba(255,255,255,0.5);
  margin-bottom: 10px;
}

.ld-bearer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ld-bearer-row {
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
}

.ld-bearer-row.out-of-range {
  opacity: 0.5;
  border-color: rgba(239, 68, 68, 0.15);
}

.ld-bearer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.ld-bearer-name {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.ld-quality-band {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  color: #fff;
}

.ld-score-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}

.ld-score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

.ld-bearer-metrics {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  font-family: var(--mono);
}

.ld-bearer-reason {
  font-size: 9px;
  color: var(--danger);
  font-family: var(--mono);
  margin-top: 3px;
}

/* Node detail panel */
.nd-node-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.nd-section {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nd-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.nd-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 6px;
}

.nd-kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  padding: 3px 0;
}

.nd-kv .mono {
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

.nd-link {
  color: var(--primary) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nd-link:hover {
  color: #60a5fa !important;
}

.nd-link-hint {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 6px;
}

/* Telemetry badge on node list */
.node-telem-badge {
  display: inline-block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  margin-left: 6px;
}

.node-telem-badge.fresh {
  color: var(--success);
}

.node-telem-badge.recent {
  color: var(--warning);
}

.node-telem-badge.stale {
  color: var(--danger);
}

/* Responsive */
@media (max-width: 900px) {
  .globe-page {
    height: auto;
    overflow: auto;
  }
  .globe-layout {
    height: auto;
  }
  .globe-viewport {
    min-height: 50vh;
  }
  .bottom-panel-top {
    grid-template-columns: 1fr;
  }
  .globe-bottom-panel {
    max-height: none;
  }
  .globe-panel-nodes .node-list {
    grid-template-columns: 1fr;
  }
  .traffic-legend {
    /* already vertical */
  }
}
