/* ============================================
   COMMODITYCULT — Commodity Intelligence Platform
   Design System & Global Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0e17;
  --bg-card: #111827;
  --border-card: #334155;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.2);
  --accent-glow: rgba(34, 211, 238, 0.15);
  --gold: #FFD700;
  --copper: #B87333;
  --silver: #C0C0C0;
  --green: #22c55e;
  --red: #ef4444;
  --purple: #a78bfa;
  --orange: #f97316;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}

/* Subtle radial gradient overlay */
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 50%, rgba(34, 211, 238, 0.03) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 50%, rgba(34, 211, 238, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Commodity Ticker Band ---------- */
.ticker-band {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  height: 280px;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(34, 211, 238, 0.06);
  border-bottom: 1px solid rgba(34, 211, 238, 0.06);
  overflow: hidden;
  z-index: 1;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 32px;
  animation: ticker-scroll 40s linear infinite;
  will-change: transform;
  width: max-content;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-33.333%); }
}

.ticker-card {
  flex-shrink: 0;
  width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(30, 41, 59, 0.5);
  transition: border-color 0.3s;
}

.ticker-card:hover {
  border-color: var(--accent-dim);
}

.ticker-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ticker-icon svg {
  width: 100%;
  height: 100%;
}

.ticker-name {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.ticker-price {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ---------- Login Card ---------- */
.login-card {
  position: relative;
  z-index: 10;
  width: 380px;
  max-width: 90vw;
  padding: 48px 36px 36px;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--accent-dim);
  border-radius: 20px;
  box-shadow:
    0 0 60px rgba(34, 211, 238, 0.06),
    0 25px 50px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.login-logo {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--accent), #67e8f9, var(--accent));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logo-shimmer 4s ease-in-out infinite;
  margin-bottom: 2px;
}

@keyframes logo-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.login-subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 28px;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  position: relative;
}

.input-group label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.btn-signin {
  width: 100%;
  padding: 13px;
  margin-top: 8px;
  background: var(--accent);
  color: var(--bg-primary);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.btn-signin:hover {
  background: #67e8f9;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.3);
  transform: translateY(-1px);
}

.btn-signin:active {
  transform: translateY(0);
}

.login-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  width: 100%;
}

.create-account {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.create-account:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

.powered-by {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.5;
}

/* ============================================
   HUB PAGE
   ============================================ */

.hub-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

/* ---------- Header ---------- */
.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.hub-logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
}

.hub-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hub-header-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border-card);
  border-radius: 6px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dim), rgba(34, 211, 238, 0.05));
  border: 1px solid var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.user-avatar:hover {
  border-color: var(--accent);
}

.user-avatar svg {
  width: 18px;
  height: 18px;
  fill: var(--text-secondary);
}

/* ---------- Main Grid ---------- */
.hub-main {
  flex: 1;
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.hub-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.commodity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ---------- Commodity Card ---------- */
.commodity-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  cursor: default;
}

.commodity-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid transparent;
  transition: border-color 0.3s;
  pointer-events: none;
}

.commodity-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.commodity-card:hover::before {
  border-color: var(--accent-dim);
}

.commodity-card.clickable {
  cursor: pointer;
}

.commodity-card.clickable:hover {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(34, 211, 238, 0.08);
}

.card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.card-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-price {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-arrow {
  font-size: 16px;
}

.card-arrow.up { color: var(--green); }
.card-arrow.down { color: var(--red); }

.card-tagline {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  min-height: 36px;
}

.card-btn {
  margin-top: auto;
  padding: 8px 18px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.commodity-card.clickable .card-btn {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.card-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(34, 211, 238, 0.05);
}

.commodity-card.clickable .card-btn:hover {
  background: rgba(34, 211, 238, 0.1);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.1);
}

/* Coming Soon Overlay */
.coming-soon-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 5;
}

.coming-soon-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.coming-soon-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.coming-soon-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
}

/* ---------- News Ticker ---------- */
.news-ticker {
  border-top: 1px solid rgba(30, 41, 59, 0.5);
  background: rgba(10, 14, 23, 0.95);
  padding: 12px 0;
  overflow: hidden;
  position: sticky;
  bottom: 0;
  z-index: 100;
}

.news-ticker::before,
.news-ticker::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.news-ticker::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-primary), transparent);
}

.news-ticker::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-primary), transparent);
}

.news-track {
  display: flex;
  animation: news-scroll 60s linear infinite;
  width: max-content;
}

@keyframes news-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.news-item {
  flex-shrink: 0;
  padding: 0 32px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.news-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  flex-shrink: 0;
}

.news-item .news-label {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- Uranium Electron Animation ---------- */
@keyframes electron-orbit-1 {
  0% { transform: rotate(0deg) translateX(14px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(14px) rotate(-360deg); }
}

@keyframes electron-orbit-2 {
  0% { transform: rotate(120deg) translateX(14px) rotate(-120deg); }
  100% { transform: rotate(480deg) translateX(14px) rotate(-480deg); }
}

@keyframes electron-orbit-3 {
  0% { transform: rotate(240deg) translateX(14px) rotate(-240deg); }
  100% { transform: rotate(600deg) translateX(14px) rotate(-600deg); }
}

/* Large uranium electrons for hub card */
@keyframes electron-orbit-lg-1 {
  0% { transform: rotate(0deg) translateX(20px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(20px) rotate(-360deg); }
}

@keyframes electron-orbit-lg-2 {
  0% { transform: rotate(120deg) translateX(20px) rotate(-120deg); }
  100% { transform: rotate(480deg) translateX(20px) rotate(-480deg); }
}

@keyframes electron-orbit-lg-3 {
  0% { transform: rotate(240deg) translateX(20px) rotate(-240deg); }
  100% { transform: rotate(600deg) translateX(20px) rotate(-600deg); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .commodity-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .commodity-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hub-main {
    padding: 24px 16px;
  }
  .hub-header {
    padding: 14px 16px;
  }
}

@media (max-width: 600px) {
  .commodity-grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 32px 20px 24px;
    width: 92vw;
    max-width: 92vw;
  }
  .login-logo {
    font-size: 22px;
    letter-spacing: 2px;
  }
  .login-subtitle {
    font-size: 11px;
    margin-bottom: 20px;
  }
  .ticker-band {
    height: 120px;
    opacity: 0.3;
  }
  .ticker-card {
    width: 80px;
    padding: 8px 4px;
    gap: 4px;
  }
  .ticker-icon {
    width: 28px;
    height: 28px;
  }
  .ticker-name {
    font-size: 8px;
  }
  .ticker-price {
    font-size: 9px;
  }
  /* Hub mobile */
  .hub-logo {
    font-size: 16px;
    letter-spacing: 2px;
  }
  .hub-title {
    font-size: 18px;
  }
  .card-icon {
    width: 40px;
    height: 40px;
  }
  .card-name {
    font-size: 14px;
  }
  .card-btn {
    font-size: 11px;
    padding: 8px 16px;
  }
  /* Commodity detail mobile */
  .panels-row {
    flex-direction: column;
  }
  .panel-card {
    width: 100%;
  }
}

/* ---------- Utility Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Subtle grid pattern overlay for login */
.grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Particle dots */
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: particle-float 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes particle-float {
  0%, 100% { opacity: 0; transform: translateY(0); }
  50% { opacity: 0.3; transform: translateY(-40px); }
}

/* Natural gas card — flickering fire (both login ticker and hub cards) */
.commodity-card[data-commodity="natgas"] .card-icon svg,
.ticker-card[data-commodity="natgas"] .ticker-icon svg {
  filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.3));
  animation: fireFlicker 0.15s ease-in-out infinite alternate;
}

@keyframes fireFlicker {
  0% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.4)); }
  20% { transform: scale(1.03) rotate(-1deg); filter: drop-shadow(0 0 10px rgba(249, 115, 22, 0.6)); }
  40% { transform: scale(0.98) rotate(1deg); filter: drop-shadow(0 0 5px rgba(255, 160, 0, 0.5)); }
  60% { transform: scale(1.02) rotate(-0.5deg); filter: drop-shadow(0 0 12px rgba(249, 115, 22, 0.7)); }
  80% { transform: scale(0.99) rotate(0.5deg); filter: drop-shadow(0 0 7px rgba(255, 100, 0, 0.5)); }
  100% { transform: scale(1.01) rotate(0deg); filter: drop-shadow(0 0 9px rgba(249, 115, 22, 0.5)); }
}

/* Gold card subtle glow */
.commodity-card[data-commodity="gold"] .card-icon svg {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.2));
}

/* Uranium card glow */
.commodity-card[data-commodity="uranium"] .card-icon svg {
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.3));
}

.commodity-card[data-commodity="uranium"]::after {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, 0.15);
  pointer-events: none;
}

/* ============================================
   COMMODITY DASHBOARD — Three-Panel Layout
   ============================================ */

.commodity-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.commodity-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.commodity-back-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.commodity-back-link:hover {
  opacity: 0.8;
}

.commodity-back-arrow {
  font-size: 18px;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}

.commodity-back-link:hover .commodity-back-arrow {
  color: var(--accent);
  transform: translateX(-3px);
}

.commodity-header-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 14px;
  border: 1px solid var(--border-card);
  border-radius: 6px;
}

/* ---------- Dashboard Grid ---------- */
.commodity-dashboard {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(400px, 1.2fr) minmax(280px, 1fr);
  gap: 1px;
  padding: 1px;
  background: rgba(30, 41, 59, 0.2);
}

/* ---------- Panel Base ---------- */
.dash-panel {
  background: var(--bg-primary);
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.panel-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}

.panel-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--commodity-accent, var(--accent));
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

/* ---------- Panel 1: Globe ---------- */
.panel-globe {
  grid-column: 1;
  grid-row: 1;
  padding: 16px;
}

.globe-container {
  flex: 1;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #060a12;
}

.globe-iframe {
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  position: absolute;
  inset: 0;
}

.globe-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(6, 10, 18, 0.95);
  z-index: 1;
}

.globe-fallback-icon {
  font-size: 48px;
  opacity: 0.4;
  animation: pulse 3s ease-in-out infinite;
}

.globe-fallback-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.globe-fallback-text {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  max-width: 280px;
  line-height: 1.5;
}

/* ---------- Panel 2: Thesis ---------- */
.panel-thesis {
  grid-column: 1;
  grid-row: 2;
  overflow-y: auto;
}

.thesis-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.thesis-summary {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.thesis-divider {
  height: 1px;
  background: linear-gradient(to right, var(--commodity-accent, var(--accent)), transparent);
  opacity: 0.2;
}

.thesis-subhead {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.thesis-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

.thesis-bullets li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.thesis-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--commodity-accent, var(--accent));
  opacity: 0.6;
}

.thesis-footer {
  margin-top: auto;
  padding: 14px 16px;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(30, 41, 59, 0.4);
  border-radius: 10px;
}

.thesis-footer-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--commodity-accent, var(--accent));
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 4px;
  margin-bottom: 8px;
  opacity: 0.7;
}

.thesis-footer-text {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
}

/* ---------- Panel 3: Analysis ---------- */
.panel-analysis {
  grid-column: 2;
  grid-row: 1 / 3;
  overflow-y: auto;
  border-left: 1px solid rgba(30, 41, 59, 0.3);
}

.analysis-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Key Metrics Grid */
.analysis-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-card {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(30, 41, 59, 0.5);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Producers Table */
.analysis-table-wrap {
  background: rgba(17, 24, 39, 0.4);
  border: 1px solid rgba(30, 41, 59, 0.4);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
}

.analysis-subhead {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 13px;
}

.analysis-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}

.analysis-table tbody tr {
  transition: background 0.15s;
}

.analysis-table tbody tr:hover {
  background: rgba(34, 211, 238, 0.03);
}

.analysis-table tbody td {
  padding: 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(30, 41, 59, 0.2);
  white-space: nowrap;
}

.analysis-table .producer-name {
  font-weight: 500;
  color: var(--text-primary);
}

.margin-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: rgba(34, 197, 94, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Preview Cards */
.analysis-previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preview-card {
  background: rgba(17, 24, 39, 0.4);
  border: 1px dashed rgba(30, 41, 59, 0.5);
  border-radius: 10px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: border-color 0.2s;
}

.preview-card:hover {
  border-color: var(--commodity-accent, var(--accent));
}

.preview-icon {
  font-size: 24px;
  opacity: 0.6;
}

.preview-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.preview-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---------- Commodity Dashboard Scrollbar ---------- */
.panel-thesis::-webkit-scrollbar,
.panel-analysis::-webkit-scrollbar {
  width: 4px;
}

.panel-thesis::-webkit-scrollbar-track,
.panel-analysis::-webkit-scrollbar-track {
  background: transparent;
}

.panel-thesis::-webkit-scrollbar-thumb,
.panel-analysis::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 4px;
}

.panel-thesis::-webkit-scrollbar-thumb:hover,
.panel-analysis::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.5);
}

/* ---------- Commodity Dashboard Responsive ---------- */
@media (max-width: 1024px) {
  .commodity-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: 50vh auto auto;
  }

  .panel-globe {
    grid-column: 1;
    grid-row: 1;
  }

  .panel-analysis {
    grid-column: 1;
    grid-row: 2;
    border-left: none;
    border-top: 1px solid rgba(30, 41, 59, 0.3);
  }

  .panel-thesis {
    grid-column: 1;
    grid-row: 3;
  }
}

@media (max-width: 600px) {
  .commodity-dashboard {
    grid-template-rows: 40vh auto auto;
    gap: 0;
    padding: 0;
  }

  .dash-panel {
    padding: 16px;
  }

  .analysis-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .analysis-previews {
    grid-template-columns: 1fr;
  }

  .commodity-back-link .hub-logo {
    font-size: 16px;
    letter-spacing: 2px;
  }

  .metric-value {
    font-size: 14px;
  }
}

/* ============================================================
   MOBILE UX PASS  (added 2026-06-18)
   Additive + media-scoped. Everything below is gated behind
   @supports / @media (hover|pointer|max-width) so the desktop
   experience (>700px, fine pointer) is byte-for-byte unchanged.
   ============================================================ */

/* ---- 1. Dynamic viewport height ----
   100vh on a phone includes the area behind the collapsing URL bar,
   which can clip vertically-centered cards. Upgrade full-height
   containers to 100dvh where the engine supports it. */
@supports (height: 100dvh) {
  .login-page { height: 100dvh; }
  .hub-page, .commodity-page { min-height: 100dvh; }
}

/* ---- 2. Reduced motion ----
   The infinite ticker/news marquees, logo shimmer, particle drift and
   natural-gas flame run forever; honor a user's reduced-motion choice
   (also meaningfully cuts battery/CPU on phones). */
@media (prefers-reduced-motion: reduce) {
  .ticker-track,
  .news-track,
  .login-logo,
  .particle,
  .panel-label-dot,
  .globe-fallback-icon,
  .commodity-card[data-commodity="natgas"] .card-icon svg,
  .ticker-card[data-commodity="natgas"] .ticker-icon svg,
  .commodity-card[data-commodity="uranium"] .card-icon svg {
    animation: none !important;
  }
}

/* ---- 3. Fluid display type ----
   No clamp()/vw existed anywhere, so several headings stayed desktop-sized
   at 375px. These clamps are identical to the originals at desktop widths
   (the max value) and only scale down on narrow screens. */
.login-logo    { font-size: clamp(22px, 7vw, 32px); }
.card-name     { font-size: clamp(15px, 4.5vw, 20px); }
.card-price    { font-size: clamp(16px, 5vw, 22px); }
.coming-soon-name { font-size: clamp(15px, 4.5vw, 20px); }

/* ---- 4. Touch ergonomics (coarse pointer only) ----
   Bring primary controls up to the ~44px minimum tap target and stop
   iOS from auto-zooming on input focus (triggered by font-size < 16px).
   Scoped to coarse pointers so mouse/desktop sizing is untouched. */
@media (pointer: coarse) {
  .input-group input { font-size: 16px; }
  .user-avatar { width: 44px; height: 44px; }
  .user-avatar svg { width: 20px; height: 20px; }
  .card-btn { min-height: 44px; padding: 12px 18px; }
  .create-account { display: inline-block; padding: 10px 6px; }
  .commodity-back-link { padding: 6px 4px; }
}

/* ---- 5. No sticky-hover on touch ----
   Devices that can't hover were getting permanent "lifted/glowing" card
   states after a tap. Neutralize hover-only transforms there. */
@media (hover: none) {
  .commodity-card:hover { transform: none; box-shadow: none; }
  .commodity-card.clickable:hover { box-shadow: 0 0 0 transparent; }
  .ticker-card:hover { border-color: rgba(30, 41, 59, 0.5); }
  .preview-card:hover { border-color: rgba(30, 41, 59, 0.5); }
}

/* ---- 6. Reusable wide-table helper ----
   Wrap any wide table in <div class="mc-table-scroll"> to get momentum
   scrolling, a thin visible scrollbar, and a right-edge fade hinting
   there's more to scroll. Pair with a min-width on the inner table. */
.mc-table-scroll {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.mc-table-scroll::-webkit-scrollbar { height: 6px; }
.mc-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.4);
  border-radius: 4px;
}
.mc-table-scroll::after {
  content: '';
  position: sticky;
  top: 0;
  right: 0;
  float: right;
  width: 28px;
  height: 100%;
  margin-left: -28px;
  pointer-events: none;
  background: linear-gradient(to left, var(--bg-primary), transparent);
}

/* ---- 7. Small-phone tier (<= 430px) ----
   The sheet's smallest breakpoint was 600px; add a tighter tier so
   chrome stops crowding on real phones (iPhone SE/12/13/14 = 375-430). */
@media (max-width: 430px) {
  .hub-header { padding: 12px 14px; }
  .hub-header-tag { display: none; }   /* purely decorative — reclaim the width */
  .hub-header-right { gap: 12px; }
  .hub-main { padding: 20px 12px; }
  .hub-title { font-size: 12px; letter-spacing: 1.5px; }
  .commodity-card { padding: 22px 18px 18px; }
  .news-item { padding: 0 20px; }
}
