/* ═══════════════════════════════════════════════
   WHERENUC — STYLE.CSS
   Live News + TradingView Markets + 3D Globe
   ═══════════════════════════════════════════════ */

:root {
  --bg: #070c18;
  --surface: #ffffff;
  --surface-dim: #f4f6fb;
  --glass: rgba(255,255,255,0.93);
  --glass-dark: rgba(10,14,26,0.82);

  --border: rgba(0,0,0,0.08);
  --border-light: rgba(255,255,255,0.12);

  --blue: #1a6dff;
  --teal: #00c8a0;
  --amber: #7c2d12;
  --red: #ef4444;
  --green: #059669;
  --sky: #4c1d95;
  --brown: #8a5a00;
  --gray: #e5e7eb;

  --text: #0f1729;
  --text2: #4b5563;
  --muted: #9ca3af;

  --panel-w: 380px;
  --radius: 14px;
  --rsm: 8px;

  --shadow: 0 8px 40px rgba(0,0,0,0.22);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.12);

  --ease: cubic-bezier(0.4,0,0.2,1);
  --dur: 300ms;
}

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

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
  color: var(--text);
}

/* ═══════════════════════════════════════════════
   GLOBE
   ═══════════════════════════════════════════════ */

#globe-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, rgba(26,109,255,0.12), transparent 35%),
    radial-gradient(circle at bottom, rgba(0,200,160,0.08), transparent 35%),
    var(--bg);
}

#globe-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
}

#globe-canvas:active {
  cursor: grabbing;
}

/* ═══════════════════════════════════════════════
   PANELS
   ═══════════════════════════════════════════════ */

.panel {
  position: fixed;
  z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition:
    transform var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
  will-change: transform;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.panel-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--green);
  background: #dcfce7;
  border-radius: 999px;
  padding: 3px 8px;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.35;
    transform: scale(0.75);
  }
}

.panel-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms;
}

.panel-close:hover {
  background: var(--surface-dim);
  color: var(--text);
}

/* ═══════════════════════════════════════════════
   NEWS PANEL
   ═══════════════════════════════════════════════ */

#news-panel {
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--panel-w);
  border-radius: 0 var(--radius) var(--radius) 0;
  transform: translateX(calc(-1 * var(--panel-w) - 4px));
  opacity: 0;
  display: flex;
  flex-direction: column;
}

#news-panel.open {
  transform: translateX(0);
  opacity: 1;
}

body.news-open .sidebar-toggle {
  opacity: 0;
  pointer-events: none;
}

.news-list {
  flex: 1;
  overflow-y: auto;
  padding: 7px 10px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.news-card {
  display: flex;
  gap: 11px;
  padding: 12px 9px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition:
    background 150ms,
    transform 150ms;
  cursor: pointer;
}

.news-card:last-child {
  border-bottom: none;
}

.news-card:hover {
  background: var(--surface-dim);
  border-radius: var(--rsm);
  transform: translateX(2px);
}

.news-thumb {
  width: 74px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-dim);
}

.news-thumb-ph {
  width: 74px;
  height: 56px;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.news-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 5px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-desc {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text2);
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  font-size: 11px;
  color: var(--muted);
}

.news-source {
  font-weight: 800;
  color: var(--blue);
}

/* ═══════════════════════════════════════════════
   FINANCE PANEL / TRADINGVIEW
   ═══════════════════════════════════════════════ */

#finance-panel {
  top: 0;
  left: 0;
  right: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  transform: translateY(-110%);
  opacity: 0;
}

#finance-panel.open {
  transform: translateY(0);
  opacity: 1;
}

body.finance-open .top-toggle {
  opacity: 0;
  pointer-events: none;
}

.finance-grid {
  display: flex;
  gap: 10px;
  padding: 12px 18px 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tradingview-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(260px, 0.8fr);
  gap: 12px;
}

.tv-card {
  background: #0b1220;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  min-height: 420px;
}

.tv-card.small {
  min-height: 420px;
}

.tv-card-title {
  color: white;
  font-size: 12px;
  font-weight: 800;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.tv-widget {
  width: 100%;
  height: 380px;
}

.tv-widget iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}

.market-strip {
  width: 100%;
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.market-chip {
  flex-shrink: 0;
  min-width: 128px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.market-symbol {
  font-size: 12px;
  font-weight: 900;
  color: var(--text);
}

.market-name {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════
   TOGGLE BUTTONS
   ═══════════════════════════════════════════════ */

.sidebar-toggle,
.top-toggle {
  position: fixed;
  z-index: 110;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 150ms var(--ease);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.sidebar-toggle:hover,
.top-toggle:hover {
  box-shadow: var(--shadow);
  transform: scale(1.04);
}

.sidebar-toggle {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  writing-mode: vertical-rl;
  padding: 16px 11px;
  border-radius: 0 var(--rsm) var(--rsm) 0;
  gap: 8px;
}

.sidebar-toggle:hover {
  transform: translateY(-50%) scale(1.04);
}

.sidebar-toggle .toggle-icon {
  font-size: 18px;
  writing-mode: horizontal-tb;
}

.sidebar-toggle .toggle-label {
  writing-mode: vertical-rl;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.top-toggle {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  border-radius: 999px;
}

.top-toggle:hover {
  transform: translateX(-50%) scale(1.04);
}

.top-toggle .toggle-icon {
  font-size: 16px;
}

/* ═══════════════════════════════════════════════
   HOVER TOOLTIP
   ═══════════════════════════════════════════════ */

.hover-tooltip {
  position: fixed;
  z-index: 200;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  min-width: 220px;
  max-width: 290px;
  pointer-events: none;
  transition:
    opacity 180ms var(--ease),
    transform 180ms var(--ease);
}

.hover-tooltip.hidden {
  opacity: 0;
  transform: scale(0.96) translateY(4px);
  pointer-events: none;
}

.tt-status {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 7px;
}

.tt-status.operational {
  background: #cff7ea;
  color: #047857;
}

.tt-status.construction {
  background: #edd2c8;
  color: #7c2d12;
}

.tt-status.planned {
  background: #e5dcfb;
  color: #4c1d95;
}

.tt-status.closed {
  background: #f3f4f6;
  color: #98a2b3;
}

.tt-status.mine {
  background: #e7dccf;
  color: #4a2c0f;
}

.tt-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.tt-country {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 10px;
}

.tt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.tt-stat {
  background: var(--surface-dim);
  border-radius: 6px;
  padding: 7px 9px;
}

.tt-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 2px;
  font-weight: 700;
}

.tt-stat-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.tt-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.4;
  grid-column: span 2;
}

/* ═══════════════════════════════════════════════
   LAYERS
   ═══════════════════════════════════════════════ */

.layer-toggles {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 6px;
}

.layer-btn {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text2);
  transition: all 150ms;
  box-shadow: var(--shadow-sm);
}

.layer-btn.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.layer-btn:hover:not(.active) {
  background: var(--surface-dim);
}

/* ═══════════════════════════════════════════════
   LEGEND
   ═══════════════════════════════════════════════ */

.legend {
  position: fixed;
  right: 18px;
  bottom: 70px;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--rsm);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
}

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

.dot-operational {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.dot-construction {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

.dot-planned {
  background: var(--sky);
  box-shadow: 0 0 6px var(--sky);
}

.dot-closed {
  background: var(--gray);
  box-shadow: 0 0 4px var(--gray);
}

.dot-mine {
  background: var(--brown);
  box-shadow: 0 0 6px var(--brown);
}

/* ═══════════════════════════════════════════════
   ZOOM CONTROLS
   ═══════════════════════════════════════════════ */

.zoom-controls {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zoom-controls button {
  width: 38px;
  height: 38px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--rsm);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 150ms;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-controls button:hover {
  box-shadow: var(--shadow);
  background: white;
}

/* ═══════════════════════════════════════════════
   STATS BAR
   ═══════════════════════════════════════════════ */

#stats-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  gap: 0;
}

.stat-group {
  display: flex;
  align-items: center;
}

.uranium-group {
  background: linear-gradient(
    90deg,
    rgba(26,109,255,0.04),
    rgba(0,200,160,0.04)
  );
  border-radius: var(--rsm);
  padding: 0 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
}

.stat-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stat-value {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
}

.stat-value.accent {
  color: var(--blue);
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.stat-divider.tall {
  width: 1px;
  height: 40px;
  background: var(--border);
  margin: 0 4px;
}

/* ═══════════════════════════════════════════════
   SKELETON LOADING
   ═══════════════════════════════════════════════ */

@keyframes shimmer {
  0% {
    background-position: -600px 0;
  }

  100% {
    background-position: 600px 0;
  }
}

.skeleton-card {
  height: 80px;
  border-radius: var(--rsm);
  margin-bottom: 10px;
  background:
    linear-gradient(
      90deg,
      #f0f0f0 25%,
      #e8e8e8 50%,
      #f0f0f0 75%
    );
  background-size: 1200px 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-ticker {
  flex-shrink: 0;
  width: 148px;
  height: 108px;
  border-radius: var(--rsm);
  background:
    linear-gradient(
      90deg,
      #f0f0f0 25%,
      #e8e8e8 50%,
      #f0f0f0 75%
    );
  background-size: 1200px 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-wrap {
  padding: 8px 10px;
}

.skeleton-wrap.horizontal {
  display: flex;
  gap: 10px;
  padding: 12px 18px;
}

/* ═══════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

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

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

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 900px) {
  :root {
    --panel-w: 330px;
  }

  .tradingview-grid {
    grid-template-columns: 1fr;
  }

  #finance-panel {
    max-height: 80vh;
    overflow-y: auto;
  }

  .finance-grid {
    display: block;
  }

  .legend {
    display: none;
  }

  .layer-toggles {
    left: 8px;
    right: 8px;
    transform: none;
    overflow-x: auto;
    justify-content: flex-start;
  }

  #stats-bar {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .stat-item {
    padding: 0 14px;
    min-width: max-content;
  }
}

@media (max-width: 520px) {
  :root {
    --panel-w: 100vw;
  }

  #news-panel {
    border-radius: 0;
  }

  .top-toggle {
    top: 10px;
  }

  .zoom-controls {
    right: 10px;
  }

  .news-thumb,
  .news-thumb-ph {
    width: 66px;
    height: 52px;
  }
}
/* ═══════════════════════════════════════════════
   RIGHT SEARCH PANEL
   ═══════════════════════════════════════════════ */

.search-toggle {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 90;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(18px);
  color: var(--text);
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms var(--ease), opacity 160ms var(--ease), box-shadow 160ms var(--ease);
}

.search-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

body.search-open .search-toggle {
  opacity: 0;
  pointer-events: none;
}

.panel-right {
  right: 0;
  top: 0;
  bottom: 0;
  width: min(430px, 92vw);
  border-radius: var(--radius) 0 0 var(--radius);
  transform: translateX(calc(100% + 6px));
  opacity: 0;
  display: flex;
  flex-direction: column;
}

.panel-right.open {
  transform: translateX(0);
  opacity: 1;
}

.search-count {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--text2);
  background: var(--surface-dim);
  border-radius: 999px;
  padding: 4px 9px;
}

.search-box-wrap {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.site-search-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  background: white;
  color: var(--text);
}

.site-search-input:focus {
  border-color: rgba(26,109,255,0.45);
  box-shadow: 0 0 0 4px rgba(26,109,255,0.09);
}

.site-search-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.search-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 12px 9px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  color: inherit;
  transition: background 150ms, transform 150ms;
}

.search-item:hover {
  background: var(--surface-dim);
  border-radius: var(--rsm);
  transform: translateX(-2px);
}

.search-item-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  margin-top: 2px;
}

.search-item-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.25;
}

.search-item-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text2);
  line-height: 1.35;
}

.search-item-badges {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.search-badge {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--surface-dim);
  color: var(--text2);
}

.search-badge.operational { background: rgba(5,150,105,0.13); color: #047857; }
.search-badge.construction { background: rgba(124,45,18,0.14); color: #7c2d12; }
.search-badge.planned { background: rgba(76,29,149,0.14); color: #4c1d95; }
.search-badge.closed { background: rgba(156,163,175,0.18); color: #4b5563; }
.search-badge.mine { background: rgba(74,44,15,0.14); color: #4a2c0f; }

.search-empty {
  padding: 24px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

/* Polished centered footer stats bar */
#stats-bar {
  left: 50%;
  right: auto;
  bottom: 14px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  height: 58px;
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,0.22);
  border-top: 1px solid rgba(255,255,255,0.26);
  border-radius: 18px;
  background: rgba(248,250,252,0.92);
  box-shadow: 0 12px 35px rgba(0,0,0,0.18);
  scrollbar-width: none;
}

#stats-bar::-webkit-scrollbar {
  display: none;
}

.stat-group {
  flex: 0 0 auto;
  white-space: nowrap;
}

.uranium-group {
  margin-left: 2px;
  background: linear-gradient(90deg, rgba(26,109,255,0.075), rgba(0,200,160,0.075));
  border: 1px solid rgba(15,23,42,0.04);
}

.stat-item {
  min-width: 124px;
  padding: 0 13px;
}

.stat-label {
  font-size: 9px;
  line-height: 1.05;
}

.stat-value {
  margin-top: 3px;
  font-size: 16px;
  line-height: 1.05;
}

@media (max-width: 900px) {
  .search-toggle {
    right: 12px;
    top: 12px;
    height: 38px;
  }

  .search-toggle .toggle-label {
    display: none;
  }

  #stats-bar {
    bottom: 10px;
    justify-content: flex-start;
    max-width: calc(100vw - 20px);
    height: 56px;
    padding: 0 8px;
  }

  .stat-item {
    min-width: 112px;
    padding: 0 9px;
  }
}

/* Search panel global-stat shortcuts */
.search-stat-shortcuts {
  display: grid;
  gap: 8px;
  margin: 4px 0 10px;
  padding: 6px 2px 10px;
  border-bottom: 1px solid var(--border);
}

.search-stat-card {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,246,251,0.96));
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease), border-color 150ms var(--ease);
}

.search-stat-card:hover {
  transform: translateX(-2px);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
  border-color: rgba(26,109,255,0.24);
}

.search-stat-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.search-stat-icon.emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.search-stat-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-stat-title {
  font-size: 12px;
  font-weight: 950;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.search-stat-subtitle {
  font-size: 10px;
  font-weight: 700;
  color: var(--text2);
  line-height: 1.25;
}

.search-stat-value {
  font-size: 18px;
  font-weight: 950;
  color: #0f1729;
  font-variant-numeric: tabular-nums;
}

/* Search panel: compact official stats line, no bulky shortcut cards */
.search-official-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 4px 14px;
  margin: 0 0 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.search-official-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  white-space: nowrap;
}

.search-official-summary b {
  color: #0f172a;
  font-size: 12px;
}

.search-stat-shortcuts { display: none !important; }

/* Finance panel stability fixes: keeps the TradingView widgets fully visible without touching globe/search/news. */
#finance-panel {
  max-height: min(92vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#finance-panel .panel-header {
  flex-shrink: 0;
}

#finance-content.finance-grid {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 22px;
}

.tradingview-grid {
  min-height: 0;
}

.tv-card,
.tv-card.small {
  min-height: 460px;
}

.tv-widget {
  height: 420px;
}

.market-strip {
  padding-bottom: 6px;
}

@media (max-width: 900px) {
  .tradingview-grid {
    grid-template-columns: 1fr;
  }

  .tv-card,
  .tv-card.small {
    min-height: 420px;
  }

  .tv-widget {
    height: 380px;
  }
}

/* ═══════════════════════════════════════════════
   CONTACT BUTTON / POPOVER
   ═══════════════════════════════════════════════ */

.contact-toggle {
  position: fixed;
  left: 18px;
  bottom: 14px;
  z-index: 110;
  min-width: 52px;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition:
    transform 150ms var(--ease),
    box-shadow 150ms var(--ease),
    opacity 150ms var(--ease);
}

.contact-toggle:hover,
.contact-toggle.open {
  transform: scale(1.04);
  box-shadow: var(--shadow);
}

.contact-toggle-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.contact-toggle-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.contact-popover {
  position: fixed;
  left: 18px;
  bottom: 76px;
  z-index: 120;
  width: min(300px, calc(100vw - 36px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 180ms var(--ease),
    transform 180ms var(--ease);
}

.contact-popover.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.contact-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 13px;
}

.contact-close {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms;
}

.contact-close:hover {
  background: var(--surface-dim);
  color: var(--text);
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: background 150ms, transform 150ms;
}

.contact-link:hover {
  background: var(--surface-dim);
  transform: translateX(2px);
}

.contact-link-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #0f1729;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
  flex-shrink: 0;
}

.contact-link small {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 2px;
}

.contact-link b {
  display: block;
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}

@media (max-width: 900px) {
  .contact-toggle {
    left: 14px;
    bottom: 10px;
    height: 48px;
    min-width: 48px;
    padding: 0 13px;
  }

  .contact-popover {
    left: 14px;
    bottom: 68px;
  }
}

@media (max-width: 520px) {
  .contact-toggle-label {
    display: none;
  }

  .contact-toggle {
    width: 48px;
    padding: 0;
    justify-content: center;
  }
}

