:root {
  --demo-h: 36px;
  --gold: #c9a84c;
  --gold-hi: #e8c96a;
  --gold-bdr: rgba(201, 168, 76, 0.35);
  --gold-bg: rgba(201, 168, 76, 0.08);
}

body.demo-mode {
  margin: 0;
  padding-top: var(--demo-h);
}

.demo-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--demo-h);
  background: linear-gradient(90deg, #1a1508 0%, #0d0d12 50%, #1a1508 100%);
  border-bottom: 1px solid var(--gold-bdr);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 100000;
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.01em;
}

.demo-bar strong {
  color: var(--gold);
  font-weight: 600;
}

.demo-bar a {
  color: var(--gold-hi);
  text-decoration: none;
  font-weight: 600;
}

.demo-bar a:hover {
  text-decoration: underline;
}

.demo-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  flex-shrink: 0;
}

body.demo-mode #root > div {
  height: calc(100vh - var(--demo-h)) !important;
}

/* TradingView — tylko główny wykres (środek); miniatury w rankingu zostają 44px */
body.demo-mode .tradingview-widget-container[style*="width:100%"],
body.demo-mode .tradingview-widget-container[style*="width: 100%"] {
  height: 560px !important;
  min-height: 560px !important;
}

body.demo-mode .tradingview-widget-container[style*="width:100%"] .tradingview-widget-container__widget,
body.demo-mode .tradingview-widget-container[style*="width: 100%"] .tradingview-widget-container__widget,
body.demo-mode .tradingview-widget-container[style*="width:100%"] iframe,
body.demo-mode .tradingview-widget-container[style*="width: 100%"] iframe {
  height: 100% !important;
  min-height: 0 !important;
}

body.demo-mode .tradingview-widget-container[style*="height:44"],
body.demo-mode .tradingview-widget-container[style*="height: 44"] {
  height: 44px !important;
  min-height: 44px !important;
  width: 78px !important;
  overflow: hidden !important;
}

body.demo-mode .tradingview-widget-container[style*="height:44"] iframe,
body.demo-mode .tradingview-widget-container[style*="height: 44"] iframe {
  height: 44px !important;
  min-height: 0 !important;
}

.demo-btn-locked {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
}

.demo-login-msg {
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid var(--gold-bdr);
  border-radius: 8px;
  color: var(--gold-hi);
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 16px;
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ── Splash modal (jak w panelu ERP demo) ── */
#demoSplash {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 7, 10, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px;
}

.demo-splash-card {
  background: #fff;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: splashIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.demo-splash-top {
  background: #0f172a;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.demo-splash-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8a6018, #c9a84c);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.demo-splash-brand {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.demo-splash-brand span {
  color: #c9a84c;
}

.demo-splash-version {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

.demo-splash-badge {
  margin-left: auto;
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid rgba(201, 168, 76, 0.3);
  color: #c9a84c;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.06em;
}

.demo-splash-body {
  padding: 28px 28px 0;
}

.demo-splash-body h2 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  font-family: Inter, system-ui, sans-serif;
}

.demo-splash-body p {
  font-family: Inter, system-ui, sans-serif;
  margin: 0 0 14px;
}

.demo-splash-body p.lead {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.65;
}

.demo-splash-body p.sub {
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.6;
  margin-bottom: 22px;
}

.demo-splash-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 24px;
}

.demo-splash-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

.demo-splash-item.ok {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.demo-splash-item.ok .icon {
  color: #10b981;
}

.demo-splash-item.warn {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.demo-splash-item.warn .icon {
  color: #f59e0b;
}

.demo-splash-item .icon {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.demo-splash-footer {
  padding: 0 28px 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-splash-btn-primary {
  flex: 1;
  min-width: 160px;
  background: linear-gradient(135deg, #8a6018, #c9a84c);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 13px 20px;
  font: 700 14px Inter, system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(201, 168, 76, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

.demo-splash-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.45);
}

.demo-splash-btn-secondary {
  flex: 1;
  min-width: 140px;
  background: transparent;
  color: #0f172a;
  border: 1.5px solid #e5e7eb;
  border-radius: 9px;
  padding: 13px 20px;
  font: 600 14px Inter, system-ui, sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}

.demo-splash-btn-secondary:hover {
  border-color: #0f172a;
  background: #f9fafb;
}

@keyframes splashIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 640px) {
  #demoSplash {
    padding: 12px;
    align-items: flex-end;
  }

  .demo-splash-card {
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
  }

  .demo-splash-top {
    padding: 16px 18px;
  }

  .demo-splash-body {
    padding: 20px 18px 0;
  }

  .demo-splash-footer {
    padding: 0 18px 18px;
    flex-direction: column;
  }

  .demo-splash-btn-primary,
  .demo-splash-btn-secondary {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .demo-bar {
    height: 32px;
    font-size: 11px;
    gap: 8px;
    padding: 0 8px;
  }

  :root {
    --demo-h: 32px;
  }

  body.demo-mode .tradingview-widget-container[style*="width:100%"],
  body.demo-mode .tradingview-widget-container[style*="width: 100%"] {
    height: 380px !important;
    min-height: 380px !important;
  }
}
