:root {
  --brand: #7c3aed;
  --brand2: #6d28d9;
}

* { box-sizing: border-box; }

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.toggle-btn {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  transition: all 120ms ease;
  text-align: center;
}
.toggle-btn:hover { background: rgba(255,255,255,0.07); }
.toggle-btn.active {
  background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(109,40,217,0.95));
  border-color: rgba(124,58,237,0.6);
}

.kpi {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(2,6,23,0.4);
  padding: 14px;
  border-radius: 16px;
}
.kpi-label {
  font-size: 11px;
  color: rgba(148,163,184,1);
}
.kpi-value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
}

/* Mobile gate overlay */
#mobileGateOverlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
}
#mobileGateOverlay.show { display: flex; }

/* Subtle scrollbars for tables */
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }

/* ECharts containers need an explicit height */
.chart-box {
  width: 100%;
  height: 420px;
}

@media (max-width: 1024px) {
  .chart-box {
    height: 360px;
  }
}

/* Chart actions */
.chart-action-btn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(2,6,23,0.45);
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: rgba(226,232,240,0.9);
  transition: all 120ms ease;
}
.chart-action-btn:hover {
  background: rgba(255,255,255,0.07);
}

/* Fullscreen chart sizing */
.chart-card:fullscreen {
  background: rgba(2, 6, 23, 0.98);
  padding: 16px;
}
.chart-card:fullscreen .chart-box {
  height: calc(100vh - 120px);
}

/* Safari/WebKit fullscreen */
.chart-card:-webkit-full-screen {
  background: rgba(2, 6, 23, 0.98);
  padding: 16px;
}
.chart-card:-webkit-full-screen .chart-box {
  height: calc(100vh - 120px);
}

/* Fleet visualization */
.fleet-viz {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(2,6,23,0.45);
  border-radius: 16px;
  padding: 12px;
  height: 180px;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-end; /* stack from bottom */
}

.miner-box {
  width: 54px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(255,255,255,0.04));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transform: translateY(0);
  opacity: 1;
}
.miner-box.variant-b {
  background: linear-gradient(135deg, rgba(56,189,248,0.18), rgba(255,255,255,0.04));
}

.miner-box .fans {
  display: flex;
  gap: 4px;
}

.miner-box .fan {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(2,6,23,0.25);
  position: relative;
  overflow: hidden;
}
.miner-box .fan:before {
  content: '';
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, rgba(255,255,255,0.0), rgba(255,255,255,0.25), rgba(255,255,255,0.0));
  animation: spin 1.4s linear infinite;
  opacity: 0.75;
}

.miner-box .label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(226,232,240,0.9);
}

.miner-box.enter {
  animation: dropIn 220ms ease-out;
}
.miner-box.leave {
  animation: dropOut 200ms ease-in forwards;
}

@keyframes dropIn {
  from { transform: translateY(-28px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes dropOut {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(28px); opacity: 0; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Email access gate overlay */
#accessGateOverlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
}
#accessGateOverlay.show { display: flex; }

/* Walkthrough overlay */
#walkthroughOverlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
}
#walkthroughOverlay.show { display: block; }
.wt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
}
.wt-highlight {
  position: absolute;
  border: 2px solid rgba(124,58,237,0.95);
  box-shadow: 0 0 0 6px rgba(124,58,237,0.18);
  border-radius: 14px;
  pointer-events: none;
}
.wt-card {
  position: absolute;
  width: min(420px, calc(100vw - 2rem));
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(2,6,23,0.96);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}
.wt-title { font-size: 14px; font-weight: 700; color: rgba(241,245,249,0.95); }
.wt-text { margin-top: 8px; font-size: 13px; color: rgba(226,232,240,0.85); line-height: 1.4; }
.wt-actions { margin-top: 12px; display: flex; justify-content: space-between; gap: 10px; }
.wt-btn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(241,245,249,0.92);
  transition: all 120ms ease;
}
.wt-btn:hover { background: rgba(255,255,255,0.10); }
.wt-btn.primary {
  background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(109,40,217,0.95));
  border-color: rgba(124,58,237,0.6);
}
.wt-btn.primary:hover {
  filter: brightness(1.05);
}
