/* Unlock Overlay & 3-Network Latency CSS for Theme-Glassmorphism */

/* 1. Hide default empty multi-ping container */
.multi-ping {
  display: none !important;
}

/* 1.1 Graceful fallback for any missing or broken flag/OS icons */
img[src$="/.svg"],
img[src*="undefined.svg"],
img[src=""] {
  display: none !important;
}

.instance-detail img[src*="/images/flags/"] {
  width: 24px !important;
  height: 24px !important;
  border-radius: 4px !important;
  object-fit: cover !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* 2. Three-Network Latency Row (三网实测: 电信 / 联通 / 移动) */
.trinet-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  margin-top: 4px !important;
  margin-bottom: 2px !important;
  box-sizing: border-box !important;
}

.trinet-card {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  border-radius: 8px !important;
  padding: 5px 7px !important;
  text-align: left !important;
  transition: all 0.2s ease !important;
  min-width: 0 !important;
  overflow: hidden !important;
  cursor: default !important;
  box-sizing: border-box !important;
  user-select: none;
  background: rgba(15, 23, 42, 0.04) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.dark .trinet-card {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.trinet-card:hover {
  background: rgba(15, 23, 42, 0.08) !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
}

.dark .trinet-card:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

.trinet-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  color: #334155 !important;
  width: 100% !important;
}

.dark .trinet-top {
  color: #94a3b8 !important;
}

.trinet-isp {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-weight: 600 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.dark .trinet-isp {
  font-weight: 500 !important;
}

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

.trinet-dot-telecom { background-color: #06b6d4 !important; }
.trinet-dot-unicom  { background-color: #3b82f6 !important; }
.trinet-dot-mobile  { background-color: #10b981 !important; }

.trinet-loss {
  font-size: 10px !important;
  font-variant-numeric: tabular-nums !important;
  flex-shrink: 0 !important;
  margin-left: 3px !important;
  color: #64748b !important;
}

.dark .trinet-loss {
  color: rgba(148, 163, 184, 0.7) !important;
}

.trinet-loss.has-loss {
  color: #be123c !important;
  font-weight: 700 !important;
  background: rgba(244, 63, 94, 0.12) !important;
  padding: 0 3px !important;
  border-radius: 3px !important;
}

.dark .trinet-loss.has-loss {
  color: #fb7185 !important;
  background: rgba(244, 63, 94, 0.2) !important;
}

.trinet-bottom {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  margin-top: 3px !important;
}

.trinet-ms {
  font-size: 12px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.025em !important;
}

.trinet-rating {
  font-size: 9px !important;
  color: #64748b !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

.dark .trinet-rating {
  color: rgba(148, 163, 184, 0.6) !important;
  font-weight: 400 !important;
}

/* Option 1: Two clean stacked rows for PING & TCP (ratings removed for clean look) */
.trinet-rows {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  width: 100% !important;
  margin-top: 3px !important;
}

.trinet-row {
  display: flex !important;
  align-items: baseline !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
  line-height: 1.25 !important;
}

.trinet-row-tag {
  font-size: 8.5px !important;
  font-weight: 800 !important;
  color: #64748b !important;
  letter-spacing: 0.04em !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  width: 26px !important;
  flex-shrink: 0 !important;
}

.dark .trinet-row-tag {
  color: #94a3b8 !important;
}

.trinet-row-val {
  font-size: 12px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.01em !important;
}

/* Latency color grading: Deep high-contrast colors in Light Mode, vibrant neon in Dark Mode */
.lat-excellent { color: #047857 !important; } /* emerald-700 in light */
.lat-good      { color: #0284c7 !important; } /* sky-600 in light */
.lat-fair      { color: #b45309 !important; } /* amber-700 in light */
.lat-slow      { color: #be123c !important; } /* rose-700 in light */
.lat-none      { color: #64748b !important; }

.dark .lat-excellent { color: #34d399 !important; }
.dark .lat-good      { color: #22d3ee !important; }
.dark .lat-fair      { color: #fbbf24 !important; }
.dark .lat-slow      { color: #fb7185 !important; }
.dark .lat-none      { color: #94a3b8 !important; }

/* 3. Unlock Overlay Row (Option B: Mini Array + Glass Tooltip) */
.ub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5px;
  border-radius: 8px;
  padding: 3px 5px;
  margin-top: 4px;
  margin-bottom: 2px;
  font-size: 10px;
  line-height: 1;
  position: relative;
  z-index: 20;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.dark .ub-row {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.ub-left {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.ub-group {
  display: flex;
  align-items: center;
  gap: 1.5px;
  flex-shrink: 0;
}

.ub-sep {
  color: rgba(100, 116, 139, 0.5);
  font-size: 9px;
  user-select: none;
  padding: 0 1px;
}

.dark .ub-sep {
  color: rgba(148, 163, 184, 0.35);
}

.ub-item {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 1px 2px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.1;
  border-width: 1px;
  border-style: solid;
  cursor: default;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dark .ub-item {
  font-weight: 600;
}

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

/* Status colors - High contrast in Light Mode, bright neon in Dark Mode */
.ub-status-unlocked {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.3);
}
.ub-status-unlocked .ub-dot {
  background: #059669;
}

.dark .ub-status-unlocked {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.28);
}
.dark .ub-status-unlocked .ub-dot {
  background: #34d399;
}

.ub-status-original {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.3);
}
.ub-status-original .ub-dot {
  background: #d97706;
}

.dark .ub-status-original {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.28);
}
.dark .ub-status-original .ub-dot {
  background: #fbbf24;
}

.ub-status-blocked {
  background: rgba(225, 29, 72, 0.12);
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.3);
}
.ub-status-blocked .ub-dot {
  background: #e11d48;
}

.dark .ub-status-blocked {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.28);
}
.dark .ub-status-blocked .ub-dot {
  background: #fb7185;
}

/* Summary Badge */
.ub-summary-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  font-variant-numeric: tabular-nums;
  border-width: 1px;
  border-style: solid;
  flex-shrink: 0;
}

.ub-summary-badge:hover {
  transform: scale(1.05);
}

.ub-summary-full {
  background: rgba(5, 150, 105, 0.14);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.35);
}

.dark .ub-summary-full {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.ub-summary-partial {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.35);
}

.dark .ub-summary-partial {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

/* Tooltip Portal & Popup */
#ub-tooltip-portal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
  z-index: 999999;
}

.ub-popup {
  position: absolute;
  pointer-events: auto;
  border-radius: 12px;
  padding: 12px 14px;
  width: 290px;
  font-family: inherit;
  animation: ubFadeIn 0.15s ease-out;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
  color: #0f172a;
}

.dark .ub-popup {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  color: #f1f5f9;
}

@keyframes ubFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ub-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.dark .ub-popup-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ub-popup-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.dark .ub-popup-title {
  color: #f8fafc;
}

.ub-popup-badge {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1.5px 6px;
  border-radius: 9999px;
}

.ub-popup-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 6px;
  margin-top: 6px;
}

.ub-popup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.ub-popup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 11px;
}

.dark .ub-popup-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.ub-popup-item-name {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #1e293b;
}

.dark .ub-popup-item-name {
  color: #cbd5e1;
}

.ub-popup-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ub-popup-status {
  font-size: 9.5px;
  font-weight: 500;
}

.ub-popup-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 6px;
  font-size: 9.5px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
}

.dark .ub-popup-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

/* ==========================================================================
   3. Baseline Latency Panel (Detail Page: 三网接入实测)
   ========================================================================== */

.baseline-latency-panel {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 6px !important;
  margin-bottom: 24px !important;
}

.bl-header {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
}

.bl-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.bl-mini-ranges {
  display: inline-flex !important;
  align-items: center !important;
  background: rgba(15, 23, 42, 0.04) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 6px !important;
  padding: 2px !important;
  gap: 2px !important;
}

.dark .bl-mini-ranges {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.bl-mini-btn {
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  font-size: 10.5px !important;
  font-weight: 500 !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.bl-mini-btn:hover {
  color: #0f172a !important;
  background: rgba(15, 23, 42, 0.06) !important;
}

.bl-mini-btn.active {
  background: rgba(99, 102, 241, 0.15) !important;
  color: #4338ca !important;
  font-weight: 600 !important;
}

.dark .bl-mini-btn {
  color: #94a3b8 !important;
}

.dark .bl-mini-btn:hover {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.dark .bl-mini-btn.active {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #818cf8 !important;
}

.bl-refresh-btn-mini {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  background: rgba(15, 23, 42, 0.04) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  color: #64748b !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.bl-refresh-btn-mini:hover {
  color: #0f172a !important;
  background: rgba(15, 23, 42, 0.08) !important;
}

.dark .bl-refresh-btn-mini {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
}

.dark .bl-refresh-btn-mini:hover {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.bl-mini-cards-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 10px 0 !important;
}

.bl-mini-carrier-card {
  border-radius: 8px !important;
  padding: 8px 10px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(15, 23, 42, 0.02) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  transition: all 0.2s ease !important;
}

.dark .bl-mini-carrier-card {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

.bl-mini-carrier-card.card-telecom {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.06) 0%, rgba(249, 115, 22, 0.02) 100%) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}
.dark .bl-mini-carrier-card.card-telecom {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(249, 115, 22, 0.02) 100%) !important;
  border-color: rgba(239, 68, 68, 0.18) !important;
}

.bl-mini-carrier-card.card-mobile {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(20, 184, 166, 0.02) 100%) !important;
  border-color: rgba(16, 185, 129, 0.2) !important;
}
.dark .bl-mini-carrier-card.card-mobile {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(20, 184, 166, 0.02) 100%) !important;
  border-color: rgba(16, 185, 129, 0.18) !important;
}

.bl-mini-carrier-card.card-unicom {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.06) 0%, rgba(6, 182, 212, 0.02) 100%) !important;
  border-color: rgba(14, 165, 233, 0.2) !important;
}
.dark .bl-mini-carrier-card.card-unicom {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(6, 182, 212, 0.02) 100%) !important;
  border-color: rgba(14, 165, 233, 0.18) !important;
}

.bl-mini-carrier-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
}

.dark .bl-mini-carrier-header {
  color: #cbd5e1 !important;
}

.bl-mini-carrier-title {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.bl-mini-carrier-val {
  font-size: 19px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
  line-height: 1.1 !important;
  margin: 4px 0 3px 0 !important;
}

.bl-mini-carrier-val-dual {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  font-variant-numeric: tabular-nums !important;
  line-height: 1.1 !important;
  margin: 5px 0 3px 0 !important;
}

.bl-mini-carrier-val-dual .bl-dual-item {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 4px !important;
}

.bl-mini-carrier-val-dual .bl-dual-tag {
  font-size: 9.5px !important;
  font-weight: 800 !important;
  color: #64748b !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  letter-spacing: 0.04em !important;
}

.dark .bl-mini-carrier-val-dual .bl-dual-tag {
  color: #94a3b8 !important;
}

.bl-mini-carrier-val-dual .bl-dual-num {
  font-size: 16px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
}

.bl-mini-carrier-footer-v2 {
  display: flex !important;
  flex-direction: column !important;
  gap: 2.5px !important;
  font-size: 10px !important;
  color: #64748b !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
  padding-top: 4px !important;
  margin-top: 4px !important;
}

.dark .bl-mini-carrier-footer-v2 {
  color: #94a3b8 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.bl-footer-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  line-height: 1.3 !important;
  width: 100% !important;
}

.bl-footer-lbl {
  font-size: 9.5px !important;
  opacity: 0.8 !important;
}

.bl-footer-nums {
  font-variant-numeric: tabular-nums !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}

.bl-mini-carrier-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 9.5px !important;
  color: #64748b !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
  padding-top: 3px !important;
  margin-top: 2px !important;
}

.dark .bl-mini-carrier-footer {
  color: #94a3b8 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.bl-mini-chart-card {
  border-radius: 8px !important;
  padding: 8px 10px 4px 10px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(15, 23, 42, 0.02) !important;
  margin-bottom: 8px !important;
}

.dark .bl-mini-chart-card {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(15, 23, 42, 0.45) !important;
}

.bl-mini-chart-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 10.5px !important;
  color: #64748b !important;
  margin-bottom: 2px !important;
}

.dark .bl-mini-chart-header {
  color: #94a3b8 !important;
}

.bl-proto-tabs {
  display: inline-flex !important;
  background: rgba(15, 23, 42, 0.06) !important;
  padding: 1.5px !important;
  border-radius: 5px !important;
  gap: 2px !important;
  margin-left: 6px !important;
}

.dark .bl-proto-tabs {
  background: rgba(255, 255, 255, 0.08) !important;
}

.bl-proto-btn {
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 9.5px !important;
  font-weight: 600 !important;
  padding: 1.5px 7px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  line-height: 1.2 !important;
}

.dark .bl-proto-btn {
  color: #94a3b8 !important;
}

.bl-proto-btn.active {
  background: #3b82f6 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
}

.bl-mini-chart-title {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
}

.dark .bl-mini-chart-title {
  color: #cbd5e1 !important;
}

.bl-mini-legend {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.bl-mini-echarts-box {
  width: 100% !important;
  height: 135px !important;
  min-height: 135px !important;
}

#baseline-latency-section,
.baseline-latency-panel {
  display: none !important;
}

.bl-title-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.bl-title {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--glass-light-text, #0f172a) !important;
}

.dark .bl-title {
  color: var(--glass-dark-text, #f8fafc) !important;
}

.bl-badge {
  font-size: 10px !important;
  font-weight: 500 !important;
  padding: 1px 7px !important;
  border-radius: 9999px !important;
  background: rgba(99, 102, 241, 0.12) !important;
  color: #818cf8 !important;
  border: 1px solid rgba(99, 102, 241, 0.25) !important;
}

.bl-subtitle {
  font-size: 11px !important;
  color: rgba(148, 163, 184, 0.85) !important;
  margin-top: 2px !important;
}

.bl-target-name {
  color: #60a5fa !important;
  font-weight: 500 !important;
}

.bl-refresh-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  color: rgba(148, 163, 184, 0.8) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.bl-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

.bl-refresh-icon {
  width: 13px !important;
  height: 13px !important;
}

.bl-spin {
  animation: bl-spin-anim 1s linear infinite !important;
}

@keyframes bl-spin-anim {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.bl-range-selector {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-bottom: 10px !important;
}

.bl-range-btn {
  padding: 3px 10px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #94a3b8 !important;
  transition: all 0.2s ease !important;
}

.bl-range-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f1f5f9 !important;
}

.bl-range-btn.active {
  background: rgba(99, 102, 241, 0.18) !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
  color: #818cf8 !important;
  font-weight: 600 !important;
}

.bl-cards-grid {
  display: grid !important;
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
}

@media (min-width: 768px) {
  .bl-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

.bl-card {
  position: relative !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  transition: border-color 0.2s ease !important;
}

.bl-card:hover {
  border-color: rgba(15, 23, 42, 0.16) !important;
}

.dark .bl-card {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: #111827 !important;
}

.dark .bl-card:hover {
  border-color: rgba(255, 255, 255, 0.16) !important;
}

.bl-card-telecom {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.06) 0%, rgba(249, 115, 22, 0.02) 100%) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}
.bl-card-telecom:hover {
  border-color: rgba(239, 68, 68, 0.35) !important;
}
.dark .bl-card-telecom {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(249, 115, 22, 0.03) 100%) !important;
  border-color: rgba(239, 68, 68, 0.18) !important;
}

.bl-card-mobile {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(20, 184, 166, 0.02) 100%) !important;
  border-color: rgba(16, 185, 129, 0.2) !important;
}
.bl-card-mobile:hover {
  border-color: rgba(16, 185, 129, 0.35) !important;
}
.dark .bl-card-mobile {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(20, 184, 166, 0.03) 100%) !important;
  border-color: rgba(16, 185, 129, 0.18) !important;
}

.bl-card-unicom {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.06) 0%, rgba(6, 182, 212, 0.02) 100%) !important;
  border-color: rgba(14, 165, 233, 0.2) !important;
}
.bl-card-unicom:hover {
  border-color: rgba(14, 165, 233, 0.35) !important;
}
.dark .bl-card-unicom {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.03) 100%) !important;
  border-color: rgba(14, 165, 233, 0.18) !important;
}

.bl-card-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
}

.bl-card-name {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
}

.dark .bl-card-name {
  color: #e2e8f0 !important;
}

.bl-isp-dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}

.bl-dot-telecom { background-color: #ef4444 !important; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5) !important; }
.bl-dot-mobile  { background-color: #10b981 !important; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5) !important; }
.bl-dot-unicom  { background-color: #0ea5e9 !important; box-shadow: 0 0 8px rgba(14, 165, 233, 0.5) !important; }

.bl-status-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 10px !important;
  color: #64748b !important;
}

.dark .bl-status-pill {
  color: #94a3b8 !important;
}

.bl-status-dot {
  width: 5px !important;
  height: 5px !important;
  border-radius: 50% !important;
}

.bl-status-dot.online {
  background-color: #10b981 !important;
  box-shadow: 0 0 6px #10b981 !important;
}

.bl-status-dot.offline {
  background-color: #64748b !important;
}

.bl-card-val {
  font-size: 26px !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
  font-variant-numeric: tabular-nums !important;
  margin: 10px 0 12px 0 !important;
}

.bl-tone-excellent { color: #047857 !important; }
.bl-tone-good      { color: #0284c7 !important; }
.bl-tone-fair      { color: #b45309 !important; }
.bl-tone-slow      { color: #dc2626 !important; }
.bl-tone-none      { color: #64748b !important; }

.dark .bl-tone-excellent { color: #34d399 !important; }
.dark .bl-tone-good      { color: #38bdf8 !important; }
.dark .bl-tone-fair      { color: #fbbf24 !important; }
.dark .bl-tone-slow      { color: #fb7185 !important; }
.dark .bl-tone-none      { color: #64748b !important; }

.bl-card-stats {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.dark .bl-card-stats {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

.bl-stat-col {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
}

.bl-stat-label {
  font-size: 10.5px !important;
  color: #64748b !important;
  line-height: 1.2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.dark .bl-stat-label {
  color: #94a3b8 !important;
}

.bl-stat-val {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  margin-top: 2px !important;
  font-variant-numeric: tabular-nums !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.dark .bl-stat-val {
  color: #f1f5f9 !important;
}

.bl-chart-card {
  position: relative !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.dark .bl-chart-card {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: #111827 !important;
}

.bl-chart-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.bl-chart-title {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
}

.dark .bl-chart-title {
  color: #cbd5e1 !important;
}

.bl-chart-legend {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.bl-legend-item {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 10.5px !important;
  color: #64748b !important;
}

.dark .bl-legend-item {
  color: #94a3b8 !important;
}

.bl-legend-line {
  width: 14px !important;
  height: 3px !important;
  border-radius: 2px !important;
}

.bl-echarts-box {
  width: 100% !important;
  height: 250px !important;
  min-height: 250px !important;
}

.bl-baseline-notice {
  border-radius: 12px !important;
  padding: 24px 20px !important;
  border: 1px solid rgba(99, 102, 241, 0.25) !important;
  background: rgba(99, 102, 241, 0.06) !important;
  text-align: center !important;
  color: #3730a3 !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}

.dark .bl-baseline-notice {
  background: rgba(99, 102, 241, 0.08) !important;
  color: #c7d2fe !important;
}

/* ==========================================================================
   4. Detail Page Bento Grid Redesign (Inner Page Optimization)
   ========================================================================== */

/* Hide stock sparse cards grid when Bento container is present */
.bento-hide-stock-grid {
  display: none !important;
}

/* Subtitle under node name */
.bento-hero-sub {
  font-size: 11.5px !important;
  color: #64748b !important;
  margin-top: 3px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  line-height: 1.3 !important;
}

.dark .bento-hero-sub {
  color: rgba(148, 163, 184, 0.85) !important;
}

.bento-hero-sub .mono-ip {
  font-family: monospace !important;
  color: #1e293b !important;
  font-weight: 500 !important;
}

.dark .bento-hero-sub .mono-ip {
  color: #cbd5e1 !important;
}

.bento-hero-sub .provider-tag {
  color: #4f46e5 !important;
  font-weight: 600 !important;
}

.dark .bento-hero-sub .provider-tag {
  color: #a5b4fc !important;
  font-weight: 500 !important;
}

/* Financial Pills in Header */
.bento-hero-financial {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin-left: auto !important;
  margin-right: 12px !important;
}

.bento-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 12px !important;
  border-radius: 9999px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}

.dark .bento-pill {
  background: #1e293b !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}

.bento-pill-label {
  color: #64748b !important;
  font-size: 10.5px !important;
}

.dark .bento-pill-label {
  color: #94a3b8 !important;
}

.bento-pill-val {
  font-weight: 600 !important;
  font-family: monospace !important;
  color: #0f172a !important;
  font-size: 11.5px !important;
}

.dark .bento-pill-val {
  color: #f8fafc !important;
}

.bento-pill-val.val-amber { color: #b45309 !important; }
.dark .bento-pill-val.val-amber { color: #fcd34d !important; }
.bento-pill-val.val-emerald { color: #047857 !important; }
.dark .bento-pill-val.val-emerald { color: #34d399 !important; }
.bento-pill-val.val-rose { color: #be123c !important; }
.dark .bento-pill-val.val-rose { color: #fb7185 !important; }

/* -------------------------------------------------------------
   Hide Stock Duplicate & Empty Panels on /instance/:id (Zero Flash)
   1. Red Box 1: Native 16 metric cards & 4 info cards (硬件信息, 系统信息, 存储信息, 网络信息)
   2. Native PingChart at the bottom ("暂无延迟数据")
   ------------------------------------------------------------- */
.instance-detail > .px-4.grid.grid-cols-2.gap-4,
.instance-detail > .grid.grid-cols-2.gap-4.md\:grid-cols-3,
.instance-detail > .px-4.gap-4.grid.grid-cols-1.lg\:grid-cols-2,
.instance-detail > .px-4:has(.h-80),
.instance-detail > .px-4:has([data-ping-task-id]),
.instance-detail > .px-4:has(.py-8):not(:has(.gap-4.grid.grid-cols-1.md\:grid-cols-2)),
.bento-hide-stock-grid,
.bento-hide-stock-info,
.bento-hide-ping-chart {
  display: none !important;
}

/* Prevent LoadChart from flashing at the top before Bento is mounted */
.instance-detail:not(:has(#bento-detail-container)) > .px-4 {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Ensure LoadChart and its 6 metric charts (CPU, 内存, 磁盘, 实时网络, 网络连接, 进程) are always fully visible */
.instance-detail .gap-4.grid.grid-cols-1.md\:grid-cols-2 {
  display: grid !important;
}

/* Bento Detail Container */
.bento-detail-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  width: 100% !important;
  padding: 0 1rem !important;
  box-sizing: border-box !important;
  margin-bottom: 24px !important;
}

/* Ensure LoadChart and its 6 metric charts (CPU, 内存, 磁盘, 实时网络, 网络连接, 进程) match Bento style */
.instance-detail .gap-4.grid.grid-cols-1.md\:grid-cols-2 > div {
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
  color: #0f172a !important;
  padding: 16px !important;
  transition: all 0.2s ease !important;
}

.instance-detail .gap-4.grid.grid-cols-1.md\:grid-cols-2 > div:hover {
  border-color: rgba(15, 23, 42, 0.16) !important;
}

.dark .instance-detail .gap-4.grid.grid-cols-1.md\:grid-cols-2 > div {
  background: #111827 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  color: #f8fafc !important;
}

.dark .instance-detail .gap-4.grid.grid-cols-1.md\:grid-cols-2 > div:hover {
  border-color: rgba(255, 255, 255, 0.18) !important;
}

/* 1. System & Hardware Specs Panorama Row (6 columns) */
.bento-specs-banner {
  border-radius: 16px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  padding: 14px !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
  box-sizing: border-box !important;
}

.dark .bento-specs-banner {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #0f172a !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.bento-specs-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

@media (min-width: 640px) {
  .bento-specs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  .bento-specs-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

.bento-spec-card {
  border-radius: 10px !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  background: rgba(15, 23, 42, 0.025) !important;
  padding: 10px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 72px !important;
  box-sizing: border-box !important;
}

.dark .bento-spec-card {
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  background: rgba(255, 255, 255, 0.025) !important;
}

.bento-spec-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 11px !important;
  color: #475569 !important;
  margin-bottom: 4px !important;
}

.dark .bento-spec-header {
  color: #94a3b8 !important;
}

.bento-spec-label {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-weight: 500 !important;
}

.bento-spec-label.cpu-label { color: #0284c7 !important; }
.dark .bento-spec-label.cpu-label { color: #22d3ee !important; }

.bento-spec-label.kernel-label { color: #4f46e5 !important; }
.dark .bento-spec-label.kernel-label { color: #818cf8 !important; }

.bento-spec-label.arch-label { color: #059669 !important; }
.dark .bento-spec-label.arch-label { color: #34d399 !important; }

.bento-spec-label.virt-label { color: #d97706 !important; }
.dark .bento-spec-label.virt-label { color: #fbbf24 !important; }

.bento-spec-label.uptime-label { color: #e11d48 !important; }
.dark .bento-spec-label.uptime-label { color: #fb7185 !important; }

.bento-tier-pill {
  font-weight: 700 !important;
  font-size: 10px !important;
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
}

.bento-tier-pill.tier-s { color: #b45309 !important; }
.dark .bento-tier-pill.tier-s { color: #fbbf24 !important; }
.bento-tier-pill.tier-a { color: #2563eb !important; }
.dark .bento-tier-pill.tier-a { color: #60a5fa !important; }
.bento-tier-pill.tier-b { color: #059669 !important; }
.dark .bento-tier-pill.tier-b { color: #34d399 !important; }
.bento-tier-pill.tier-c { color: #c2410c !important; }
.dark .bento-tier-pill.tier-c { color: #fb923c !important; }
.bento-tier-pill.tier-d { color: #dc2626 !important; }
.dark .bento-tier-pill.tier-d { color: #f87171 !important; }

.bento-spec-val {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.dark .bento-spec-val {
  font-weight: 500 !important;
  color: #f1f5f9 !important;
}

.bento-tier-track {
  width: 100% !important;
  height: 3px !important;
  background: rgba(15, 23, 42, 0.08) !important;
  border-radius: 9999px !important;
  overflow: hidden !important;
  margin-top: 6px !important;
}

.dark .bento-tier-track {
  background: #1e293b !important;
}

.bento-tier-bar {
  height: 100% !important;
  border-radius: 9999px !important;
}

.bar-tier-s { background-color: #f59e0b !important; }
.bar-tier-a { background-color: #3b82f6 !important; }
.bar-tier-b { background-color: #10b981 !important; }
.bar-tier-c { background-color: #f97316 !important; }
.bar-tier-d { background-color: #ef4444 !important; }
.bar-tier-cyan { background: linear-gradient(90deg, #0284c7, #2563eb) !important; }
.bar-tier-emerald { background: linear-gradient(90deg, #059669, #0d9488) !important; }
.bar-tier-amber { background: linear-gradient(90deg, #d97706, #ca8a04) !important; }
.bar-tier-indigo { background: linear-gradient(90deg, #4f46e5, #7c3aed) !important; }

.dark .bar-tier-cyan { background: linear-gradient(90deg, #06b6d4, #3b82f6) !important; }
.dark .bar-tier-emerald { background: linear-gradient(90deg, #10b981, #14b8a6) !important; }
.dark .bar-tier-amber { background: linear-gradient(90deg, #f59e0b, #eab308) !important; }
.dark .bar-tier-indigo { background: linear-gradient(90deg, #6366f1, #a855f7) !important; }

.bento-spec-sub {
  font-size: 10px !important;
  color: #64748b !important;
  margin-top: 4px !important;
}

/* 2. Instant 5-Metrics Gauges Row (Aligned identically with 6-col banner) */
.bento-metrics-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}

@media (min-width: 640px) {
  .bento-metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  .bento-metrics-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

.bento-gauge-card {
  border-radius: 14px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  padding: 12px 14px !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 88px !important;
  box-sizing: border-box !important;
}

.dark .bento-gauge-card {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #0f172a !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.bento-gauge-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 11px !important;
  color: #475569 !important;
  margin-bottom: 6px !important;
}

.dark .bento-gauge-top {
  color: #94a3b8 !important;
}

.bento-gauge-title {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-weight: 500 !important;
}

.bento-gauge-pct {
  font-family: monospace !important;
  font-weight: 600 !important;
  font-size: 11.5px !important;
}

.bento-gauge-pct.cyan { color: #0284c7 !important; }
.dark .bento-gauge-pct.cyan { color: #22d3ee !important; }

.bento-gauge-pct.emerald { color: #059669 !important; }
.dark .bento-gauge-pct.emerald { color: #34d399 !important; }

.bento-gauge-pct.amber { color: #d97706 !important; }
.dark .bento-gauge-pct.amber { color: #f59e0b !important; }

.bento-gauge-pct.indigo { color: #4f46e5 !important; }
.dark .bento-gauge-pct.indigo { color: #818cf8 !important; }

.bento-tcp-val {
  color: #64748b !important;
}
.dark .bento-tcp-val {
  color: #94a3b8 !important;
}

.bento-gauge-track {
  width: 100% !important;
  height: 4px !important;
  background: rgba(15, 23, 42, 0.08) !important;
  border-radius: 9999px !important;
  overflow: hidden !important;
  margin: 4px 0 !important;
}

.dark .bento-gauge-track {
  background: rgba(255, 255, 255, 0.08) !important;
}

.bento-gauge-fill {
  height: 100% !important;
  border-radius: 9999px !important;
  transition: width 0.3s ease !important;
}

.cyan-grad { background: linear-gradient(90deg, #0284c7, #2563eb) !important; }
.emerald-grad { background: linear-gradient(90deg, #059669, #0d9488) !important; }
.amber-grad { background: linear-gradient(90deg, #d97706, #ca8a04) !important; }
.indigo-grad { background: linear-gradient(90deg, #4f46e5, #7c3aed) !important; }

.dark .cyan-grad { background: linear-gradient(90deg, #06b6d4, #3b82f6) !important; }
.dark .emerald-grad { background: linear-gradient(90deg, #10b981, #14b8a6) !important; }
.dark .amber-grad { background: linear-gradient(90deg, #f59e0b, #eab308) !important; }
.dark .indigo-grad { background: linear-gradient(90deg, #6366f1, #a855f7) !important; }

.bento-gauge-footer {
  font-size: 10.5px !important;
  color: #64748b !important;
  margin-top: 4px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.dark .bento-gauge-footer {
  color: #94a3b8 !important;
}

.bento-speed-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 11px !important;
  font-family: monospace !important;
  font-weight: 600 !important;
  margin: 2px 0 !important;
}

.speed-up { color: #059669 !important; }
.dark .speed-up { color: #34d399 !important; }

.speed-down { color: #0284c7 !important; }
.dark .speed-down { color: #38bdf8 !important; }

/* 3. Dual Bento Wings (左右双翼等高) */
.bento-wings-grid {
  display: grid !important;
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  gap: 14px !important;
  box-sizing: border-box !important;
  align-items: stretch !important;
}

@media (min-width: 1024px) {
  .bento-wings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
  }
}

.bento-wing-card {
  border-radius: 14px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  padding: 16px 18px !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  height: 100% !important;
  box-sizing: border-box !important;
}

.dark .bento-wing-card {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #111827 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.bento-wing-card > div:first-child {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
}

.bento-wing-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.dark .bento-wing-header {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.bento-wing-title {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.dark .bento-wing-title {
  color: #f8fafc !important;
}

.bento-wing-sub {
  font-size: 10.5px !important;
  color: #64748b !important;
  margin-top: 2px !important;
}

.dark .bento-wing-sub {
  color: #94a3b8 !important;
}

.bento-range-label {
  color: #0284c7 !important;
  font-weight: 600 !important;
}

.dark .bento-range-label {
  color: #38bdf8 !important;
  font-weight: 500 !important;
}

.bento-status-badge {
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 10px !important;
  border-radius: 9999px !important;
}

.status-full {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #047857 !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.dark .status-full {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.status-partial {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #b45309 !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

.dark .status-partial {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.status-trinet {
  background: rgba(6, 182, 212, 0.12) !important;
  color: #0e7490 !important;
  border: 1px solid rgba(6, 182, 212, 0.25) !important;
}

.dark .status-trinet {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #22d3ee !important;
  border: 1px solid rgba(6, 182, 212, 0.3) !important;
}

.bento-unlock-cols {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-top: 14px !important;
  margin-bottom: 12px !important;
}

.bento-col-label {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  margin-bottom: 8px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.label-ai { color: #4f46e5 !important; }
.dark .label-ai { color: #818cf8 !important; }

.label-media { color: #e11d48 !important; }
.dark .label-media { color: #fb7185 !important; }

.bento-unlock-item {
  border-radius: 10px !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  background: rgba(15, 23, 42, 0.025) !important;
  padding: 7px 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 6px !important;
  transition: background 0.2s !important;
  box-sizing: border-box !important;
}

.bento-unlock-item:hover {
  background: rgba(15, 23, 42, 0.05) !important;
}

.dark .bento-unlock-item {
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  background: rgba(255, 255, 255, 0.025) !important;
}

.dark .bento-unlock-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

.bento-unlock-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.bento-unlock-icon {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  flex-shrink: 0 !important;
}

.icon-gpt { background: rgba(16, 185, 129, 0.12) !important; color: #047857 !important; border: 1px solid rgba(16, 185, 129, 0.25) !important; }
.dark .icon-gpt { background: rgba(16, 185, 129, 0.2) !important; color: #34d399 !important; border: 1px solid rgba(16, 185, 129, 0.3) !important; }

.icon-cl { background: rgba(245, 158, 11, 0.12) !important; color: #b45309 !important; border: 1px solid rgba(245, 158, 11, 0.25) !important; }
.dark .icon-cl { background: rgba(245, 158, 11, 0.2) !important; color: #fbbf24 !important; border: 1px solid rgba(245, 158, 11, 0.3) !important; }

.icon-gem { background: rgba(14, 165, 233, 0.12) !important; color: #0284c7 !important; border: 1px solid rgba(14, 165, 233, 0.25) !important; }
.dark .icon-gem { background: rgba(14, 165, 233, 0.2) !important; color: #38bdf8 !important; border: 1px solid rgba(14, 165, 233, 0.3) !important; }

.icon-rd { background: rgba(249, 115, 22, 0.12) !important; color: #c2410c !important; border: 1px solid rgba(249, 115, 22, 0.25) !important; }
.dark .icon-rd { background: rgba(249, 115, 22, 0.2) !important; color: #fb923c !important; border: 1px solid rgba(249, 115, 22, 0.3) !important; }

.icon-sp { background: rgba(30, 215, 96, 0.12) !important; color: #15803d !important; border: 1px solid rgba(30, 215, 96, 0.25) !important; }
.dark .icon-sp { background: rgba(30, 215, 96, 0.2) !important; color: #1ed760 !important; border: 1px solid rgba(30, 215, 96, 0.3) !important; }

.icon-stm { background: rgba(102, 192, 244, 0.12) !important; color: #1d4ed8 !important; border: 1px solid rgba(102, 192, 244, 0.25) !important; }
.dark .icon-stm { background: rgba(102, 192, 244, 0.2) !important; color: #60a5fa !important; border: 1px solid rgba(102, 192, 244, 0.3) !important; }

.icon-nf { background: rgba(225, 29, 72, 0.12) !important; color: #be123c !important; border: 1px solid rgba(225, 29, 72, 0.25) !important; }
.dark .icon-nf { background: rgba(225, 29, 72, 0.2) !important; color: #fb7185 !important; border: 1px solid rgba(225, 29, 72, 0.3) !important; }

.icon-d { background: rgba(99, 102, 241, 0.12) !important; color: #4338ca !important; border: 1px solid rgba(99, 102, 241, 0.25) !important; }
.dark .icon-d { background: rgba(99, 102, 241, 0.2) !important; color: #818cf8 !important; border: 1px solid rgba(99, 102, 241, 0.3) !important; }

.icon-yt { background: rgba(239, 68, 68, 0.12) !important; color: #b91c1c !important; border: 1px solid rgba(239, 68, 68, 0.25) !important; }
.dark .icon-yt { background: rgba(239, 68, 68, 0.2) !important; color: #f87171 !important; border: 1px solid rgba(239, 68, 68, 0.3) !important; }

.icon-tk { background: rgba(6, 182, 212, 0.12) !important; color: #0e7490 !important; border: 1px solid rgba(6, 182, 212, 0.25) !important; }
.dark .icon-tk { background: rgba(6, 182, 212, 0.2) !important; color: #22d3ee !important; border: 1px solid rgba(6, 182, 212, 0.3) !important; }

.icon-amz { background: rgba(0, 168, 225, 0.12) !important; color: #0369a1 !important; border: 1px solid rgba(0, 168, 225, 0.25) !important; }
.dark .icon-amz { background: rgba(0, 168, 225, 0.2) !important; color: #38bdf8 !important; border: 1px solid rgba(0, 168, 225, 0.3) !important; }

.icon-hbo { background: rgba(168, 85, 247, 0.12) !important; color: #7e22ce !important; border: 1px solid rgba(168, 85, 247, 0.25) !important; }
.dark .icon-hbo { background: rgba(168, 85, 247, 0.2) !important; color: #c084fc !important; border: 1px solid rgba(168, 85, 247, 0.3) !important; }

.icon-gen { background: rgba(148, 163, 184, 0.12) !important; color: #334155 !important; border: 1px solid rgba(148, 163, 184, 0.25) !important; }
.dark .icon-gen { background: rgba(148, 163, 184, 0.2) !important; color: #94a3b8 !important; border: 1px solid rgba(148, 163, 184, 0.3) !important; }

/* Streaming & AI Capability Diagnostics Strip */
.bento-unlock-diagnostics {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin-top: 6px !important;
  margin-bottom: 8px !important;
  padding: 6px 10px !important;
  background: rgba(15, 23, 42, 0.02) !important;
  border: 1px dashed rgba(15, 23, 42, 0.12) !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
}

.dark .bento-unlock-diagnostics {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

@media (max-width: 640px) {
  .bento-unlock-diagnostics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.bento-diag-item {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  min-width: 0 !important;
}

.bento-diag-icon {
  font-size: 11px !important;
  flex-shrink: 0 !important;
}

.bento-diag-meta {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
}

.bento-diag-title {
  font-size: 9px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.dark .bento-diag-title {
  color: #94a3b8 !important;
}

.bento-diag-val {
  font-size: 10px !important;
  font-weight: 600 !important;
  color: #047857 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-top: 1px !important;
}

.dark .bento-diag-val {
  font-weight: 500 !important;
  color: #34d399 !important;
}

/* Dual Stack Tag Indicator Dots & Range Switchers */
.uo-stk-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
}

.uo-stk-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 8.5px !important;
  font-weight: 700 !important;
  width: 14px !important;
  height: 14px !important;
  border-radius: 3px !important;
  line-height: 1 !important;
}

.uo-stk-pill.ok {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #047857 !important;
}
.dark .uo-stk-pill.ok {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #34d399 !important;
}

.uo-stk-pill.no {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #dc2626 !important;
}
.dark .uo-stk-pill.no {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #f87171 !important;
}

.uo-stk-pill.warn {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #b45309 !important;
}
.dark .uo-stk-pill.warn {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
}

.uo-stack-ranges {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
}

.bento-unlock-meta {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
}

.bento-unlock-name {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.dark .bento-unlock-name {
  color: #f1f5f9 !important;
}

.bento-unlock-desc {
  font-size: 9.5px !important;
  color: #64748b !important;
  line-height: 1.2 !important;
  margin-top: 1px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.bento-unlock-tag {
  font-size: 10px !important;
  font-weight: 500 !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
}

.tag-unlocked {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #047857 !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.dark .tag-unlocked {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.tag-original {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #b45309 !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

.dark .tag-original {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.tag-blocked {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

.dark .tag-blocked {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

@media (max-width: 640px) {
  .bento-unlock-cols {
    grid-template-columns: 1fr !important;
  }
}

.bento-wing-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
  padding-top: 10px !important;
  font-size: 10.5px !important;
  color: #475569 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.dark .bento-wing-footer {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
}

.bento-rating-val {
  color: #0f172a !important;
  font-weight: 600 !important;
}

.dark .bento-rating-val {
  color: #e2e8f0 !important;
}

.bento-avglat-val {
  color: #0284c7 !important;
  font-weight: 700 !important;
}

.dark .bento-avglat-val {
  color: #22d3ee !important;
}

.bento-loss-badge.bento-loss-ok {
  color: #047857 !important;
  font-weight: 600 !important;
}

.dark .bento-loss-badge.bento-loss-ok {
  color: #34d399 !important;
  font-weight: 500 !important;
}

.bento-loss-badge.bento-loss-warn {
  color: #b45309 !important;
  font-weight: 600 !important;
}

.dark .bento-loss-badge.bento-loss-warn {
  color: #fbbf24 !important;
  font-weight: 500 !important;
}

.bento-unlock-summary-txt {
  color: #047857 !important;
  font-weight: 600 !important;
}

.dark .bento-unlock-summary-txt {
  color: #34d399 !important;
  font-weight: 500 !important;
}

/* Tri-Network ISP Rows in Right Wing */
.bento-trinet-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin-top: 12px !important;
  margin-bottom: 12px !important;
}

.bento-isp-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.bento-isp-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 11.5px !important;
  color: #1e293b !important;
}

.dark .bento-isp-meta {
  color: #e2e8f0 !important;
}

.bento-isp-name {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-weight: 500 !important;
}

.route-tag {
  font-size: 9.5px !important;
  padding: 1px 5px !important;
  border-radius: 3px !important;
  font-weight: 600 !important;
}

.tag-cn2 { background: rgba(6, 182, 212, 0.12) !important; color: #0e7490 !important; }
.dark .tag-cn2 { background: rgba(34, 211, 238, 0.15) !important; color: #22d3ee !important; }

.tag-9929 { background: rgba(59, 130, 246, 0.12) !important; color: #1d4ed8 !important; }
.dark .tag-9929 { background: rgba(96, 165, 250, 0.15) !important; color: #60a5fa !important; }

.tag-cmin2 { background: rgba(139, 92, 246, 0.12) !important; color: #6d28d9 !important; }
.dark .tag-cmin2 { background: rgba(167, 139, 250, 0.15) !important; color: #a78bfa !important; }

.bento-isp-stats {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-family: monospace !important;
  font-size: 11px !important;
}

.loss-text { color: #64748b !important; font-size: 10px !important; }
.dark .loss-text { color: #94a3b8 !important; }

.loss-text.has-loss { color: #dc2626 !important; font-weight: 700 !important; }
.dark .loss-text.has-loss { color: #f87171 !important; }

.ms-text { font-weight: 700 !important; }

.lat-telecom { color: #0284c7 !important; }
.dark .lat-telecom { color: #22d3ee !important; }

.lat-unicom { color: #2563eb !important; }
.dark .lat-unicom { color: #60a5fa !important; }

.lat-mobile { color: #7c3aed !important; }
.dark .lat-mobile { color: #a78bfa !important; }

.bento-isp-track {
  width: 100% !important;
  height: 5px !important;
  background: rgba(15, 23, 42, 0.08) !important;
  border-radius: 9999px !important;
  overflow: hidden !important;
}

.dark .bento-isp-track {
  background: rgba(255, 255, 255, 0.08) !important;
}

.bento-isp-bar {
  height: 100% !important;
  border-radius: 9999px !important;
  transition: width 0.3s ease !important;
}

.bar-telecom { background: linear-gradient(90deg, #0284c7, #2563eb) !important; }
.bar-unicom { background: linear-gradient(90deg, #2563eb, #3b82f6) !important; }
.bar-mobile { background: linear-gradient(90deg, #7c3aed, #a855f7) !important; }

.dark .bar-telecom { background: linear-gradient(90deg, #06b6d4, #22d3ee) !important; }
.dark .bar-unicom { background: linear-gradient(90deg, #3b82f6, #60a5fa) !important; }
.dark .bar-mobile { background: linear-gradient(90deg, #8b5cf6, #a78bfa) !important; }

.bento-trinet-footer-row {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
}

.trinet-speed-card {
  border-radius: 8px !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  background: rgba(15, 23, 42, 0.025) !important;
  padding: 6px 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.dark .trinet-speed-card {
  border-color: rgba(255, 255, 255, 0.05) !important;
  background: rgba(255, 255, 255, 0.025) !important;
}

.speed-label { font-size: 10px !important; color: #64748b !important; }
.dark .speed-label { color: #94a3b8 !important; }

.speed-val { font-size: 11.5px !important; font-weight: 700 !important; color: #0f172a !important; font-family: monospace !important; }
.dark .speed-val { color: #f1f5f9 !important; }

/* 4. Telemetry Tabs & Controls */
.bento-telemetry-card {
  border-radius: 16px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  padding: 16px !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
  margin-bottom: 24px !important;
  box-sizing: border-box !important;
}

.dark .bento-telemetry-card {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: #0f172a !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.bento-tabs-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.dark .bento-tabs-header {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.bento-tabs-list {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(15, 23, 42, 0.03) !important;
  padding: 3px !important;
}

.dark .bento-tabs-list {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

.bento-tab-btn {
  padding: 5px 12px !important;
  border-radius: 7px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.bento-tab-btn:hover {
  color: #0f172a !important;
}

.bento-tab-btn.active {
  background: rgba(99, 102, 241, 0.12) !important;
  color: #4338ca !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  font-weight: 600 !important;
}

.dark .bento-tab-btn {
  color: #94a3b8 !important;
}

.dark .bento-tab-btn:hover {
  color: #f1f5f9 !important;
}

.dark .bento-tab-btn.active {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #a5b4fc !important;
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
}

.bento-tabs-note {
  font-size: 11px !important;
  color: #64748b !important;
  font-family: monospace !important;
}

.bento-tab-content {
  margin-top: 14px !important;
  min-height: 240px !important;
}

/* =========================================================================
   Detail Page: Custom Glassmorphism Server Quick Switcher & Select Fixes
   ========================================================================= */

/* 1. Global Safe Select & Option Styles (Adaptive to theme) */
select,
select:focus,
select:active,
.instance-detail select {
  color-scheme: light !important;
  background-color: transparent !important;
  color: #0f172a !important;
}

.dark select,
.dark select:focus,
.dark select:active,
.dark .instance-detail select {
  color-scheme: dark !important;
  color: #f1f5f9 !important;
}

select option,
.instance-detail select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
}

.dark select option,
.dark .instance-detail select option {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}

select option:checked,
select option:hover {
  background-color: #f1f5f9 !important;
  color: #0284c7 !important;
}

.dark select option:checked,
.dark select option:hover {
  background-color: #1e293b !important;
  color: #38bdf8 !important;
}

/* 2. Custom Glassmorphism Node Selector Component */
.uo-node-select-wrapper {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
}

.uo-node-select-trigger {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  cursor: pointer !important;
  padding: 4px 6px !important;
  border-radius: 8px !important;
  color: #0f172a !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  max-width: 135px !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  line-height: 1 !important;
}

@media (min-width: 640px) {
  .uo-node-select-trigger {
    max-width: 175px !important;
  }
}

.uo-node-select-trigger:hover {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #0284c7 !important;
}

.dark .uo-node-select-trigger {
  color: #f8fafc !important;
}

.dark .uo-node-select-trigger:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

.uo-node-select-text {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  line-height: 1.4 !important;
}

.uo-node-select-chevron {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  color: #64748b !important;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease !important;
}

.uo-node-select-wrapper.is-open .uo-node-select-chevron {
  transform: rotate(180deg) !important;
  color: #0284c7 !important;
}

.dark .uo-node-select-chevron {
  color: #94a3b8 !important;
}

.dark .uo-node-select-wrapper.is-open .uo-node-select-chevron {
  color: #38bdf8 !important;
}

.uo-node-select-menu {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(-6px) scale(0.96) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  min-width: 210px !important;
  max-width: 280px !important;
  max-height: 380px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 14px !important;
  padding: 6px !important;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.04) !important;
  z-index: 999999 !important;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s !important;
}

.dark .uo-node-select-menu {
  background: rgba(15, 23, 42, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
}

@media (max-width: 640px) {
  .uo-node-select-menu {
    left: auto !important;
    right: 0 !important;
    transform: translateY(-6px) scale(0.96) !important;
  }
}

.uo-node-select-wrapper.is-open .uo-node-select-menu {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateX(-50%) translateY(0) scale(1) !important;
}

@media (max-width: 640px) {
  .uo-node-select-wrapper.is-open .uo-node-select-menu {
    transform: translateY(0) scale(1) !important;
  }
}

.uo-node-select-menu::-webkit-scrollbar {
  width: 5px !important;
}
.uo-node-select-menu::-webkit-scrollbar-track {
  background: transparent !important;
}
.uo-node-select-menu::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18) !important;
  border-radius: 999px !important;
}
.dark .uo-node-select-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18) !important;
}
.uo-node-select-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.3) !important;
}
.dark .uo-node-select-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3) !important;
}

.uo-node-select-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 8px 10px !important;
  margin-bottom: 2px !important;
  border-radius: 8px !important;
  color: #1e293b !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.12s ease !important;
  user-select: none !important;
  line-height: 1.4 !important;
}

.dark .uo-node-select-item {
  color: #e2e8f0 !important;
}

.uo-node-select-item:last-child {
  margin-bottom: 0 !important;
}

.uo-node-select-item:hover {
  background: rgba(14, 165, 233, 0.08) !important;
  color: #0284c7 !important;
}

.dark .uo-node-select-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #38bdf8 !important;
}

.uo-node-select-item.is-selected {
  background: rgba(14, 165, 233, 0.12) !important;
  color: #0284c7 !important;
  font-weight: 600 !important;
}

.dark .uo-node-select-item.is-selected {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
}

.uo-node-select-item-name {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  flex: 1 !important;
  text-align: left !important;
}

.uo-node-select-check {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  color: #0284c7 !important;
  opacity: 0 !important;
}

.dark .uo-node-select-check {
  color: #38bdf8 !important;
}

.uo-node-select-item.is-selected .uo-node-select-check {
  opacity: 1 !important;
}



