/* ============================================================================
   Aetherion AI · Trading Assistant
   Dark trading-floor theme + marketing pages
============================================================================ */

:root {
  --bg: #02040a;
  --bg-elev: rgba(8, 12, 18, 0.85);
  --bg-elev2: rgba(14, 20, 28, 0.85);
  --bg-elev3: rgba(22, 30, 44, 0.85);
  --border: rgba(0, 240, 255, 0.15);
  --border-bright: rgba(0, 240, 255, 0.4);
  --border-accent: rgba(255, 0, 60, 0.5);
  --text: #e0f8ff;
  --text-dim: #7395a1;
  --text-muted: #4b6672;
  --accent: #00f0ff;
  --accent-bright: #66f8ff;
  --accent-grad: linear-gradient(135deg, #00f0ff 0%, #ff003c 100%);
  --green: #00ff66;
  --red: #ff003c;
  --amber: #ffcc00;
  --gold: #ffcc00;
  --purple: #bb00ff;
  --shadow-sm: 0 4px 12px rgba(0,240,255,0.1);
  --shadow: 0 8px 32px rgba(0,240,255,0.15);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.8);
  --shadow-glow: 0 0 30px rgba(0,240,255,0.4), inset 0 0 15px rgba(0,240,255,0.1);
  --mono: 'Share Tech Mono', monospace;
  --sans: 'Rajdhani', sans-serif;
  --display: 'Chakra Petch', sans-serif;
  --radius: 0px; /* brutalist hard edges */
  --radius-lg: 0px; 
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg);
  background-image: radial-gradient(circle at center, #02040a 0%, #000 100%);
  position: relative;
 color: var(--text); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; letter-spacing: -0.01em; }
h1, h2, h3, h4, h5, h6, .brand-name { font-family: var(--display); letter-spacing: -0.02em; }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-bright); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ============================================================================
   Topbar / Nav
============================================================================ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 7, 10, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-logo {
  width: 32px; height: 32px;
  background: var(--accent-grad);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px; color: #0a0e14;
  box-shadow: 0 0 20px rgba(94, 179, 255, .4);
}
.brand-name { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-version { font-family: var(--mono); font-size: 10px; color: var(--text-muted); margin-left: 4px; }
.mode-badge { font-family: var(--mono); font-size: 9px; font-weight: 700; margin-left: 6px; padding: 1px 5px; border-radius: 3px; letter-spacing: .5px; }
.mode-live { color: #3fd87b; border: 1px solid #3fd87b; background: rgba(63,216,123,.1); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: 6px; color: var(--text-dim); font-size: 14px; font-weight: 500;
  transition: all .15s;
}
.nav-links a:hover { background: var(--bg-elev2); color: var(--text); }
.nav-links a.active { color: var(--accent); background: rgba(94, 179, 255, .1); }
.nav-cta {
  background: var(--accent-grad); color: #0a0e14 !important; font-weight: 600;
  padding: 8px 16px !important; border-radius: 6px;
  box-shadow: 0 0 20px rgba(94, 179, 255, .25);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(94, 179, 255, .4); color: #0a0e14 !important; background: var(--accent-grad) !important; }

.nav-status { font-size: 11px; font-family: var(--mono); display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-up { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-down { background: var(--red); }
.dot-unknown { background: var(--text-muted); }

.hamburger { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 8px; }
@media (max-width: 880px) {
  .nav-links { position: fixed; top: 60px; right: 0; flex-direction: column; align-items: stretch; background: var(--bg-elev); border: 1px solid var(--border); padding: 12px; border-radius: 0 0 0 12px; gap: 4px; transform: translateX(100%); transition: transform .25s; min-width: 220px; }
  .nav-links.open { transform: translateX(0); }
  .hamburger { display: block; }
  .nav-status { display: none; }
}

/* ============================================================================
   Layout
============================================================================ */
main { flex: 1; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 24px; }
section { padding: 64px 0; }
section.tight { padding: 32px 0; }

footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 48px 28px 24px;
  margin-top: 64px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
  max-width: 1180px; margin: 0 auto;
}
.footer-brand p { color: var(--text-dim); font-size: 13px; margin-top: 8px; max-width: 340px; }
.footer-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-dim); font-size: 13px; padding: 4px 0; }
.footer-col a:hover { color: var(--accent); }
.footer-legal { max-width: 1180px; margin: 32px auto 0; padding-top: 24px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); text-align: center; }
.footer-legal p { margin-bottom: 6px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ============================================================================
   Disclaimer banner
============================================================================ */
.disclaimer-banner {
  background: linear-gradient(90deg, rgba(255, 200, 87, .12), rgba(255, 200, 87, .06));
  border-bottom: 1px solid rgba(255, 200, 87, .25);
  padding: 10px 28px; font-size: 12px; color: var(--text); text-align: center;
}
.disclaimer-banner strong { color: var(--amber); }

/* ============================================================================
   Hero (home)
============================================================================ */
.hero {
  position: relative;
  padding: 80px 0 100px; overflow: hidden;
  background: radial-gradient(ellipse at 30% 20%, rgba(94, 179, 255, .08), transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(167, 139, 250, .06), transparent 60%);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(94, 179, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 179, 255, .04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 100px;
  background: rgba(94, 179, 255, .1); border: 1px solid rgba(94, 179, 255, .25);
  font-size: 12px; color: var(--accent); font-weight: 600; letter-spacing: 0.3px;
  margin-bottom: 24px;
}
.hero-eyebrow .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.hero h1 { font-size: 56px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 20px; }
.hero h1 .gradient { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p.lead { font-size: 18px; color: var(--text-dim); margin-bottom: 32px; max-width: 540px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.hero-stat-num { font-size: 28px; font-weight: 700; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.hero-visual { position: relative; }
.hero-card-stack { position: relative; height: 480px; }
.hero-card {
  position: absolute;
  background: var(--bg-elev);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  width: 320px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
}
.hero-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-glow);
  z-index: 10;
  border-color: var(--border-accent);
}
.hero-card-1 { top: 0; right: 0; }
.hero-card-2 { top: 100px; right: 60px; transform: rotate(-3deg); }
.hero-card-2:hover { transform: rotate(0deg) translateY(-8px) scale(1.02); }
.hero-card-3 { top: 200px; right: 0; }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 38px; }
  .hero p.lead { font-size: 16px; }
  .hero-card-stack { height: 360px; margin-top: 24px; }
  .hero-stats { gap: 20px; }
}

/* ============================================================================
   Buttons
============================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
  background: var(--bg-elev2); color: var(--text); border: 1px solid var(--border-bright);
  cursor: pointer; transition: all .18s; text-decoration: none;
}
.btn:hover { background: var(--bg-elev3); border-color: var(--text-dim); transform: translateY(-1px); }
.btn-primary {
  background: var(--accent-grad); color: #0a0e14; border-color: transparent;
  box-shadow: 0 0 24px rgba(94, 179, 255, .3);
}
.btn-primary:hover { color: #0a0e14; transform: translateY(-2px); box-shadow: 0 0 36px rgba(94, 179, 255, .5); }
.btn-ghost { background: transparent; }
.btn-large { padding: 16px 32px; font-size: 16px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================================
   Section headers
============================================================================ */
.section-eyebrow { font-family: var(--mono); font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 12px; }
.section-title { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 16px; line-height: 1.15; }
.section-subtitle { font-size: 17px; color: var(--text-dim); max-width: 640px; margin-bottom: 48px; }
.section-center { text-align: center; }
.section-center .section-subtitle { margin-left: auto; margin-right: auto; }
@media (max-width: 720px) { .section-title { font-size: 28px; } }

/* ============================================================================
   Feature grid
============================================================================ */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--bg-elev);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all .35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.feature::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.08), transparent 70%);
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.feature:hover::before { opacity: 1; }
.feature:hover { border-color: var(--border-accent); transform: translateY(-6px); box-shadow: var(--shadow); }
.feature-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(94, 179, 255, .1);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; font-size: 22px;
}
.feature h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.feature p { color: var(--text-dim); font-size: 14px; }
@media (max-width: 880px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }

/* ============================================================================
   Steps / how it works
============================================================================ */
.steps { display: flex; flex-direction: column; gap: 24px; max-width: 760px; margin: 0 auto; }
.step {
  display: grid; grid-template-columns: 60px 1fr; gap: 24px;
  background: var(--bg-elev); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all .25s;
}
.step:hover { border-color: var(--accent); transform: translateX(4px); }
.step-num {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #0a0e14;
}
.step h3 { font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--text-dim); font-size: 14px; }

/* ============================================================================
   Story section
============================================================================ */
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.story-text h2 { font-size: 32px; margin-bottom: 16px; line-height: 1.2; }
.story-text p { color: var(--text-dim); margin-bottom: 16px; }
.story-image { background: var(--bg-elev); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow); }
.story-image img { width: 100%; height: auto; }
@media (max-width: 880px) { .story-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ============================================================================
   Methodology / pillars
============================================================================ */
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillar-card {
  background: var(--bg-elev); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative; overflow: hidden;
  transition: all .25s;
}
.pillar-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-grad);
}
.pillar-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pillar-card .pillar-num { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 8px; }
.pillar-card h3 { font-size: 22px; margin-bottom: 12px; }
.pillar-card p { color: var(--text-dim); font-size: 14px; margin-bottom: 12px; }
.pillar-card .pillar-emoji { font-size: 36px; margin-bottom: 16px; display: block; }
@media (max-width: 880px) { .pillar-grid { grid-template-columns: 1fr; } }

/* ============================================================================
   FAQ
============================================================================ */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-item summary {
  padding: 20px 24px; cursor: pointer;
  font-weight: 600; font-size: 16px;
  display: flex; align-items: center; justify-content: space-between;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 24px; color: var(--accent); transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { background: var(--bg-elev2); }
.faq-content { padding: 0 24px 20px; color: var(--text-dim); font-size: 14px; }
.faq-content code { background: var(--bg-elev2); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); font-size: 12px; }

/* ============================================================================
   Code / pre
============================================================================ */
pre.code-block {
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--mono); font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}
pre.code-block .keyword { color: var(--accent); }
pre.code-block .string { color: var(--green); }

/* ============================================================================
   CTA banner
============================================================================ */
.cta-banner {
  background: linear-gradient(135deg, rgba(94, 179, 255, .12), rgba(167, 139, 250, .12));
  border: 1px solid rgba(94, 179, 255, .25);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  position: relative; overflow: hidden;
}
.cta-banner::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(94, 179, 255, .15), transparent 60%);
  pointer-events: none;
}
.cta-banner > * { position: relative; z-index: 1; }
.cta-banner h2 { font-size: 32px; margin-bottom: 12px; }
.cta-banner p { color: var(--text-dim); margin-bottom: 24px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ============================================================================
   Page hero (about, how it works, etc.)
============================================================================ */
.page-hero {
  padding: 64px 0 32px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse at center top, rgba(94, 179, 255, .08), transparent 70%);
  text-align: center;
}
.page-hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.page-hero p { font-size: 17px; color: var(--text-dim); max-width: 600px; margin: 0 auto; }
@media (max-width: 720px) { .page-hero h1 { font-size: 32px; } }

/* ============================================================================
   Prose (long-form pages)
============================================================================ */
.prose { max-width: 760px; margin: 0 auto; padding: 32px 24px; }
.prose h2 { font-size: 28px; margin: 40px 0 12px; letter-spacing: -0.01em; }
.prose h3 { font-size: 20px; margin: 28px 0 10px; color: var(--accent); }
.prose p { color: var(--text-dim); margin-bottom: 14px; }
.prose ul, .prose ol { color: var(--text-dim); padding-left: 22px; margin-bottom: 14px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px; margin: 20px 0;
  background: var(--bg-elev);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
  font-style: italic;
}
.prose .callout {
  background: rgba(255, 200, 87, .08);
  border: 1px solid rgba(255, 200, 87, .25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  color: var(--text);
}
.prose .callout strong { color: var(--amber); }
.prose .callout-info {
  background: rgba(94, 179, 255, .08);
  border-color: rgba(94, 179, 255, .25);
}
.prose .callout-info strong { color: var(--accent); }

/* ============================================================================
   Live tool styles (existing — preserved + extended)
============================================================================ */
.tool-shell { padding: 32px 0; }
.card {
  background: var(--bg-elev); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.card h1 { font-size: 26px; margin-bottom: 24px; }
.card h2 { font-size: 18px; margin: 16px 0 8px; }
.card h3 { font-size: 15px; margin: 0 0 8px; }

.form-row { margin: 16px 0; }
.form-row label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; font-weight: 500; }
.hint { color: var(--text-dim); font-size: 12px; margin-left: 8px; }

input, select, textarea {
  background: var(--bg-elev2); color: var(--text); border: 1px solid var(--border);
  padding: 12px 14px; border-radius: 8px; font-size: 14px; min-width: 220px;
  font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94, 179, 255, .2); }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.action {
  background: var(--bg-elev); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px;
}
.action p { color: var(--text-dim); font-size: 13px; margin: 0 0 14px; }
.action select { width: 100%; margin-bottom: 12px; }
.action button { margin-right: 8px; }
@media (max-width: 720px) { .action-grid { grid-template-columns: 1fr; } }

.progress-bar {
  background: var(--bg-elev2); height: 8px; border-radius: 4px; overflow: hidden;
  margin-top: 16px; border: 1px solid var(--border);
}
.progress-fill { height: 100%; background: var(--accent-grad); width: 0%; transition: width .5s; }
#scan-progress p { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin: 8px 0 0; text-align: center; }
.hidden { display: none !important; }

#btn-back { margin-bottom: 16px; }
.section-result {
  background: var(--bg-elev); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 16px;
}
.section-result h2 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
  font-size: 17px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.section-result h2 .num {
  background: var(--accent-grad); color: #0a0e14;
  padding: 2px 10px; border-radius: 4px; font-size: 12px; font-weight: 800; font-family: var(--mono);
  margin-right: 4px;  /* belt-and-suspenders space alongside the flex gap */
  flex-shrink: 0;
}
.section-result h2 .h2-text {
  flex: 1;
  line-height: 1.3;
}

.grade-badge { display: inline-block; padding: 4px 12px; border-radius: 4px; font-family: var(--mono); font-weight: 700; font-size: 12px; }
.grade-A { background: var(--green); color: #000; }
.grade-B { background: var(--green); color: #000; }
.grade-C { background: var(--amber); color: #000; }
.grade-D { background: #6e7681; color: #fff; }
.grade-F { background: var(--red); color: #fff; }
.b-plus-star { color: var(--gold); margin-left: 6px; }

.scan-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.scan-table th, .scan-table td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--border); }
.scan-table th { background: var(--bg-elev2); font-size: 11px; text-transform: uppercase; color: var(--text-dim); font-weight: 600; letter-spacing: 0.5px; }
.scan-table td.num { font-family: var(--mono); text-align: center; padding-left: 4px; padding-right: 4px; }
.scan-table tr.b-plus { background: rgba(63, 216, 123, .05); }
.scan-table tr:hover { background: rgba(255,255,255,.03); }
.scan-table .pair-cell { font-weight: 600; cursor: pointer; }
.scan-table .pair-cell:hover { color: var(--accent); }

/* ============================================================================
   v4.9 — Live tool data visualizations (sparklines, heatmaps, gauges, donuts)
============================================================================ */

/* Sparkline — mini chart in scan summary table */
.sparkline { display: inline-block; line-height: 0; vertical-align: middle; }
.sparkline svg { display: block; }

/* TF heatmap — 7 colored mini-cells, one per timeframe */
.tf-heatmap { display: inline-flex; gap: 2px; }
.hm-cell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 22px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  border-radius: 3px;
  cursor: help;
}
.hm-bull       { background: rgba(63, 216, 123, .85); color: #000; }
.hm-bull-weak  { background: rgba(63, 216, 123, .45); color: #fff; }
.hm-bear       { background: rgba(255, 107, 107, .85); color: #000; }
.hm-bear-weak  { background: rgba(255, 107, 107, .45); color: #fff; }
.hm-range      { background: var(--bg-elev3); color: var(--text-dim); }

/* Forecast pill in scan table */
.fc-pill {
  display: inline-block; padding: 3px 9px; border-radius: 12px;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.fc-pill.fc-bull  { background: rgba(0, 230, 118, .15); color: var(--green); border: 1px solid rgba(0, 230, 118, .35); }
.fc-pill.fc-bear  { background: rgba(255, 82, 82, .15); color: var(--red); border: 1px solid rgba(255, 82, 82, .35); }
.fc-pill.fc-none  { background: var(--bg-elev3); color: var(--text-muted); border: 1px solid var(--border); }

/* v4.9 scan table — wider cells, no per-TF columns (heatmap replaces them) */
.scan-table-v49 td, .scan-table-v49 th { padding: 10px 12px; }
.scan-table-v49 tr.b-plus-row { background: rgba(63, 216, 123, .06); border-left: 3px solid var(--green); }
.scan-table-v49 .notes-cell { font-size: 14px; }

/* ============================================================================
   v5.3 — Trade Journal (modal, log-trade box, open-trade flag, mini buttons)
============================================================================ */
.journal-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 16px 0; padding: 12px; background: var(--bg-elev); border-radius: var(--radius);
}
.journal-toolbar select { min-width: 140px; }

.btn-mini {
  background: var(--bg-elev3); color: var(--text); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 4px; font-size: 11px; cursor: pointer;
  font-family: inherit;
}
.btn-mini:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.btn-mini-danger { color: var(--red); }
.btn-mini-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* Modal — for logging/closing trades */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.modal-card {
  background: var(--bg-elev); border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg); padding: 24px;
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close {
  background: none; border: 0; color: var(--text-dim);
  font-size: 24px; cursor: pointer; padding: 0 8px; line-height: 1;
}
.modal-close:hover { color: var(--text); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* "Took this trade?" log-trade-box on analysis output */
.log-trade-box {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  margin: 12px 0;
  background: linear-gradient(135deg, rgba(94,179,255,.08), rgba(167,139,250,.08));
  border: 1px solid rgba(94,179,255,.25);
  border-radius: var(--radius);
}
.log-trade-icon { font-size: 32px; }
.log-trade-text { flex: 1; }
.log-trade-text strong { display: block; font-size: 14px; }
.log-trade-text p { color: var(--text-dim); font-size: 12px; margin: 4px 0 0; }

/* Active-trade flag in scan summary */
.open-trade-flag {
  display: inline-block;
  background: rgba(255, 200, 87, .2);
  color: var(--amber);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 11px;
  border: 1px solid rgba(255, 200, 87, .4);
}
.open-trade-row { background: rgba(255, 200, 87, .04) !important; border-left: 3px solid var(--amber) !important; }

/* ============================================================================
   v5.2 — Edgeful-style stats panels (range histo / break prob / momentum)
============================================================================ */
.stats-panel {
  background: var(--bg-elev); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 12px;
}
.stats-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; flex-wrap: wrap; gap: 8px;
}
.stats-panel-header strong { font-size: 14px; color: var(--text); }
.stats-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stats-mini {
  background: var(--bg-elev3);
  border-radius: 6px;
  padding: 10px;
  display: flex; flex-direction: column; align-items: center;
}
.stats-mini-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); margin-bottom: 6px;
}
.stats-mini-foot {
  font-size: 10px; color: var(--text-dim); margin-top: 4px;
  font-family: var(--mono);
}

.vol-badge {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 100px;
  border: 1px solid;
}
.vol-badge.vol-normal   { background: rgba(63,216,123,.10); color: var(--green); border-color: rgba(63,216,123,.3); }
.vol-badge.vol-elevated { background: rgba(255,200,87,.10); color: var(--amber); border-color: rgba(255,200,87,.3); }
.vol-badge.vol-extreme  { background: rgba(255,107,107,.12); color: var(--red);  border-color: rgba(255,107,107,.4); }

@media (max-width: 720px) {
  .stats-panel-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   v5.2 — Risk Calculator page
============================================================================ */
.calc-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 20px;
}
@media (max-width: 880px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-inputs h2 { font-size: 18px; }
.calc-inputs input, .calc-inputs select { width: 100%; }
.calc-inputs .form-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

.calc-headline { padding: 18px; }
.calc-headline-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.calc-headline-item {
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  background: var(--bg-elev2);
}
.calc-headline-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); margin-bottom: 6px;
}
.calc-headline-value {
  font-size: 22px; font-weight: 800;
  font-family: var(--mono);
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.calc-headline-value.red {
  background: linear-gradient(135deg, var(--red), #ff8a80);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.calc-headline-sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; font-family: var(--mono); }

@media (max-width: 600px) { .calc-headline-row { grid-template-columns: 1fr; } }

.scenario-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 12px; align-items: center;
  padding: 12px 14px;
  background: var(--bg-elev2);
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 3px solid;
}
.scenario-loss   { border-left-color: var(--red); }
.scenario-win-1  { border-left-color: var(--accent); }
.scenario-win-2  { border-left-color: var(--green); }

.scenario-label strong { font-size: 13px; }
.scenario-sub { font-size: 11px; color: var(--text-dim); font-family: var(--mono); margin-top: 2px; }

.scenario-bar-wrap {
  height: 16px; background: var(--bg-elev3); border-radius: 8px; overflow: hidden;
  position: relative;
}
.scenario-bar { height: 100%; border-radius: 8px; transition: width .3s; }
.scenario-bar-loss { background: linear-gradient(90deg, var(--red), #ff8a80); }
.scenario-bar-win  { background: linear-gradient(90deg, var(--accent), var(--green)); }

.scenario-payout { font-family: var(--mono); font-size: 18px; font-weight: 800; min-width: 90px; text-align: right; }
.payout-loss { color: var(--red); }
.payout-win  { color: var(--green); }

.calc-explainer ol { padding-left: 22px; }

/* ============================================================================
   v5.1 — Dual-chart layout (H1 + M15 side-by-side)
============================================================================ */
.tf-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}
@media (max-width: 880px) { .tf-dual-grid { grid-template-columns: 1fr; } }

.tf-panel {
  background: var(--bg-elev); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column;
}
.tf-panel-h1 { border-left: 3px solid var(--accent); }
.tf-panel-m15 { border-left: 3px solid var(--purple); }
.tf-panel-failed { border-left: 3px solid var(--red); }

.tf-panel-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.tf-panel-heading {
  font-size: 14px; margin: 0; color: var(--text);
  font-family: var(--mono);
}
.verdict-pill {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  padding: 4px 10px; border-radius: 100px; border: 1px solid;
  white-space: nowrap;
}

/* Compact forecast banner inside a TF panel */
.forecast-banner.forecast-compact {
  margin-bottom: 10px; padding: 8px 12px;
}
.forecast-banner.forecast-compact .forecast-arrow {
  width: 32px; height: 32px; font-size: 22px;
}
.forecast-banner.forecast-compact .forecast-text strong { font-size: 12px; }
.forecast-banner.forecast-compact .forecast-conf { font-size: 11px; }

/* Trade levels mini-table inside each TF panel */
.tf-trade-levels {
  background: var(--bg-elev3);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
  font-family: var(--mono); font-size: 11.5px;
}
.tl-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.tl-label { color: var(--text-dim); }
.tl-value { font-weight: 700; text-align: right; }
.tl-value.entry { color: var(--gold); }
.tl-value.sl    { color: var(--red); }
.tl-value.tp    { color: var(--green); }

/* Synthesis card explaining how to use both TFs together */
.tf-synthesis {
  background: var(--bg-elev); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(94,179,255,.2);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 16px;
}
.tf-synthesis strong { color: var(--accent); display: block; margin-bottom: 6px; font-size: 13px; }
.tf-synthesis p { color: var(--text-dim); font-size: 12.5px; line-height: 1.55; margin: 0; }

/* ============================================================================
   Trading Session timeline (top of every analysis)
============================================================================ */
.session-section {
  background: linear-gradient(135deg, var(--bg-elev), var(--bg-elev2));
  border: 1px solid var(--border-bright);
}
.session-header-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; margin-bottom: 12px;
}
.session-active-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.session-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  border: 1px solid;
}
.session-active { /* color set inline per session */ }
.session-closed {
  background: rgba(255, 107, 107, .12);
  border-color: rgba(255, 107, 107, .4);
  color: var(--red);
}
.session-quiet {
  background: var(--bg-elev3);
  border-color: var(--border);
  color: var(--text-dim);
}
.session-overlap {
  background: linear-gradient(90deg, rgba(94,179,255,.15), rgba(167,139,250,.15));
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 100px;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  animation: overlapPulse 2.5s infinite;
}
@keyframes overlapPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94, 179, 255, .4); }
  50%      { box-shadow: 0 0 0 8px rgba(94, 179, 255, 0); }
}

.session-clock {
  display: flex; flex-direction: column; align-items: flex-end;
  font-family: var(--mono); line-height: 1.2;
}
.session-now {
  font-size: 18px; font-weight: 800; color: var(--green);
}
.session-now small { font-size: 10px; color: var(--text-muted); margin-left: 3px; font-weight: 500; }
.session-local {
  font-size: 11px; color: var(--text-dim); margin-top: 2px;
}
.session-local small { font-size: 9px; color: var(--text-muted); margin-left: 3px; }

.session-svg-wrap {
  background: var(--bg-elev3);
  border-radius: var(--radius);
  padding: 8px;
  margin: 12px 0;
  overflow-x: auto;
}
.session-svg {
  width: 100%; min-width: 600px; height: auto; display: block;
}

.session-footer-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; margin-top: 8px;
}
.session-next {
  font-family: var(--mono); font-size: 13px; color: var(--text);
  background: var(--bg-elev2);
  padding: 8px 14px;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  font-weight: 600;
}
.session-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px; color: var(--text-dim);
}
.session-leg-item {
  display: inline-flex; align-items: center; gap: 5px;
}
.leg-swatch {
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--c);
  display: inline-block;
}

@media (max-width: 720px) {
  .session-header-row { flex-direction: column; align-items: stretch; }
  .session-clock { flex-direction: row; gap: 12px; align-items: baseline; align-self: flex-end; }
  .session-now { font-size: 16px; }
  .session-svg { min-width: 480px; }
  .session-footer-row { flex-direction: column; align-items: stretch; }
}

/* ============================================================================
   Report Problem page
============================================================================ */
.report-card { background: var(--bg-elev); }
.report-meta {
  font-family: var(--mono); font-size: 11px; color: var(--text-muted);
  margin-top: 6px; text-align: right;
}
.report-output {
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  max-height: 600px;
  overflow-y: auto;
}
.report-bottom-meta {
  margin-top: 10px;
  font-family: var(--mono); font-size: 11px; color: var(--text-muted);
  text-align: right;
}
.report-howto {
  background: rgba(94, 179, 255, .04);
  border: 1px solid rgba(94, 179, 255, .15);
  margin-top: 16px;
}
.report-howto h3 { color: var(--accent); }
.report-howto ol li { margin-bottom: 6px; }

/* v5.0 H1+M15 match badge */
.match-row { margin-bottom: 16px; text-align: center; }
.match-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px;
  border-radius: 100px;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  letter-spacing: 0.3px;
}
.match-badge.match-pass {
  background: rgba(63, 216, 123, .12);
  color: var(--green);
  border: 1.5px solid rgba(63, 216, 123, .4);
  box-shadow: 0 0 16px rgba(63, 216, 123, .15);
}
.match-badge.match-fail {
  background: rgba(255, 107, 107, .08);
  color: var(--text-dim);
  border: 1.5px solid rgba(255, 107, 107, .25);
}

/* Stats row — 4 cards above the three pillars */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 130px;
}
.stat-card-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 8px;
}
.stat-card-sub {
  font-size: 10px; color: var(--text-muted); margin-top: 4px;
  font-family: var(--mono);
}
.stat-card-grade { font-size: 18px; padding: 4px 0; }
.stat-card-heatmap { padding: 4px 0; }
.stat-empty { color: var(--text-muted); font-size: 12px; padding: 16px 0; }

@media (max-width: 880px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .stat-card { min-height: 110px; padding: 10px; }
}

/* Alignment gauge / forecast donut — centered, sized */
.alignment-gauge svg, .forecast-donut svg { display: block; }

/* v4.7 phase grouping in scan table */
.scan-table-legend { color: var(--text-dim); font-size: 12px; margin-bottom: 12px; }
.scan-table tr.phase-row th { font-size: 10px; padding: 4px 6px; text-align: center; border-bottom: 2px solid var(--border-bright); }
.scan-table tr.phase-row .phase-trend { background: rgba(94, 179, 255, .1); color: var(--accent); }
.scan-table tr.phase-row .phase-aoi { background: rgba(255, 200, 87, .12); color: var(--amber); }
.scan-table tr.phase-row .phase-entry { background: rgba(167, 139, 250, .1); color: var(--purple); }
.scan-table th.tf-trend, .scan-table td.tf-trend { background: rgba(94, 179, 255, .04); }
.scan-table th.tf-aoi, .scan-table td.tf-aoi { background: rgba(255, 200, 87, .06); border-left: 2px solid rgba(255, 200, 87, .25); border-right: 2px solid rgba(255, 200, 87, .25); }
.scan-table th.tf-entry, .scan-table td.tf-entry { background: rgba(167, 139, 250, .04); }

.marker { display: inline-block; font-size: 14px; line-height: 1; }
.marker-bull { color: var(--green); }
.marker-bear { color: var(--red); }
.marker-range { color: var(--text-dim); }
.marker-pending { color: var(--amber); }
.marker-weak { opacity: 0.6; }
.marker-engulf { font-size: 10px; margin-left: 2px; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pillar { padding: 14px; border-radius: 8px; background: var(--bg-elev2); border: 1px solid var(--border); }
.pillar h4 { margin: 0 0 6px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.pillar.pass { border-color: var(--green); }
.pillar.partial { border-color: var(--amber); }
.pillar.fail { border-color: var(--red); }
@media (max-width: 720px) { .pillars { grid-template-columns: 1fr; } }

.trade-box {
  background: var(--bg-elev2); border: 2px solid var(--green);
  border-radius: var(--radius); padding: 22px; margin: 12px 0;
}
.trade-box.stand-down { border-color: var(--red); }
.trade-box.alt { border-color: var(--accent); }
.trade-box .verdict { font-size: 18px; font-weight: 700; margin: 8px 0; }
.trade-box.stand-down .verdict { color: var(--red); }
.trade-box.b-plus .verdict { color: var(--green); }

.trade-detail { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-family: var(--mono); font-size: 13px; margin-top: 12px; }
.trade-detail dt { color: var(--text-dim); }

.sizing-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.sizing-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.sizing-table td:first-child { color: var(--text-dim); width: 40%; }
.sizing-table td:nth-child(2) { font-family: var(--mono); }
.sizing-table tr.warn td { background: rgba(255, 107, 107, .08); }
.sub-viable-warn {
  background: rgba(255, 107, 107, .12); border-left: 3px solid var(--red);
  padding: 14px; margin-top: 12px; border-radius: 0 4px 4px 0; font-size: 13px;
}

.trigger-list { display: flex; flex-direction: column; gap: 8px; }
.trigger {
  background: var(--bg-elev2); padding: 14px; border-radius: 6px;
  border-left: 3px solid var(--accent); font-family: var(--mono); font-size: 13px;
}
.trigger .pair { font-weight: 700; color: var(--accent); }
.trigger .dir-long { color: var(--green); }
.trigger .dir-short { color: var(--red); }

.chart-image { max-width: 100%; border-radius: 6px; border: 1px solid var(--border); margin-top: 8px; }
.chart-image.annotated { border-width: 2px; box-shadow: 0 4px 16px rgba(0,0,0,0.4); }

/* Verdict banner above the annotated chart */
.verdict-banner {
  background: var(--bg-elev2);
  border: 2px solid var(--border-bright);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: var(--mono);
}

/* Caption below the chart explaining the conditional logic */
.chart-caption {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-elev2);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

/* Legend showing all the drawn levels with their colors */
.chart-legend {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 11px; font-family: var(--mono);
  align-items: center;
}
.chart-legend > strong {
  width: 100%; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.5px;
  font-size: 10px; margin-bottom: 4px;
}
.legend-item {
  background: var(--bg-elev2);
  padding: 4px 10px;
  border-left: 3px solid var(--text-dim);
  border-radius: 0 4px 4px 0;
  color: var(--text);
}

/* Honest disclaimer beneath the legend */
.chart-disclaimer-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255, 200, 87, .08);
  border: 1px solid rgba(255, 200, 87, .25);
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
  font-style: italic;
}

/* v4.9 small disclaimer (per user directive — at the very end, smaller) */
.chart-disclaimer-note.small-disclaimer {
  font-size: 10px;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-top: 1px dashed var(--border);
  border-radius: 0;
  color: var(--text-muted);
  text-align: center;
  font-style: normal;
  margin-top: 16px;
}

/* v4.9 forecast / scenario banner */
.forecast-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 16px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--border-bright);
}
.forecast-banner.forecast-bull { background: rgba(0, 230, 118, .08); border-color: rgba(0, 230, 118, .35); }
.forecast-banner.forecast-bear { background: rgba(255, 82, 82, .08); border-color: rgba(255, 82, 82, .35); }
.forecast-arrow {
  font-size: 30px; line-height: 1;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 800;
}
.forecast-banner.forecast-bull .forecast-arrow { background: rgba(0, 230, 118, .2); color: var(--green); }
.forecast-banner.forecast-bear .forecast-arrow { background: rgba(255, 82, 82, .2); color: var(--red); }
.forecast-text { font-size: 14px; }
.forecast-text strong { font-size: 14px; }
.forecast-banner.forecast-bull .forecast-text strong { color: var(--green); }
.forecast-banner.forecast-bear .forecast-text strong { color: var(--red); }
.forecast-conf { color: var(--text-dim); font-family: var(--mono); font-size: 12px; margin-left: 4px; }
.forecast-bar {
  grid-column: 1 / -1;
  height: 4px;
  background: var(--bg-elev2);
  border-radius: 2px;
  overflow: hidden;
}
.forecast-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .6s;
}
.forecast-banner.forecast-bull .forecast-fill { background: linear-gradient(90deg, var(--green), #00ff88); }
.forecast-banner.forecast-bear .forecast-fill { background: linear-gradient(90deg, var(--red), #ff5252); }

.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.recommend-box {
  background: rgba(94, 179, 255, .08); border-left: 3px solid var(--accent);
  padding: 16px; border-radius: 0 4px 4px 0; margin: 12px 0;
}
.recommend-box .alt-pair { font-family: var(--mono); font-weight: 700; color: var(--accent); cursor: pointer; }
.recommend-box .alt-pair:hover { text-decoration: underline; }

.error {
  background: rgba(255, 107, 107, .12); border-left: 3px solid var(--red);
  padding: 16px; border-radius: 0 4px 4px 0; color: var(--text);
}

/* ============================================================================
   Status badges (live tool dashboard)
============================================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.kpi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.kpi-value { font-size: 24px; font-weight: 700; font-family: var(--mono); }
.kpi-value.green { color: var(--green); }
.kpi-value.red { color: var(--red); }
.kpi-value.gradient { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
@media (max-width: 720px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }

/* KPI subtitle (live indicator under the count) */
.kpi-subtitle {
  font-size: 11px; color: var(--text-muted); font-family: var(--mono);
  margin-top: 4px; display: flex; align-items: center; gap: 4px;
}
.kpi-subtitle.live { color: var(--green); }
.kpi-subtitle.fallback { color: var(--amber); }
.kpi-subtitle .live-pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 6px var(--green); display: inline-block;
  animation: livePulse 1.8s infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.3); }
}

/* KPI label refresh-button */
.kpi-label { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kpi-action-btn {
  background: var(--bg-elev2); color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 11px;
  transition: all .15s;
}
.kpi-action-btn:hover { background: var(--bg-elev3); color: var(--accent); border-color: var(--accent); }
.kpi-action-btn:disabled { opacity: 0.5; cursor: wait; }

/* ============================================================================
   Visual chart (SVG)
============================================================================ */
.viz-chart { background: var(--bg-elev2); border-radius: var(--radius); padding: 16px; }
.viz-chart svg { display: block; width: 100%; height: auto; }

/* ============================================================================
   Demo screenshots gallery
============================================================================ */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.gallery-item {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: all .25s;
}
.gallery-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.gallery-item img { width: 100%; height: 200px; object-fit: cover; }
.gallery-item-meta { padding: 12px 16px; font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; }
@media (max-width: 720px) { .gallery { grid-template-columns: 1fr; } }

/* ============================================================================
   PWA / mobile-optimized styles
============================================================================ */
/* When running as installed PWA, hide the disclaimer banner (already accepted) */
body.is-pwa .disclaimer-banner { display: none; }
/* And give the topbar safe-area padding for iOS notch */
body.is-pwa .topbar { padding-top: max(14px, env(safe-area-inset-top)); }
body.is-pwa { padding-bottom: env(safe-area-inset-bottom); }

@media (max-width: 720px) {
  /* Bigger tap targets on mobile */
  .btn { padding: 14px 22px; font-size: 15px; min-height: 48px; }
  .btn-large { padding: 16px 28px; font-size: 16px; min-height: 52px; }
  input, select { padding: 14px 14px; font-size: 16px; min-height: 48px; }
  /* Stack hero CTA buttons on mobile */
  .hero-cta .btn { width: 100%; justify-content: center; }
  /* Bigger nav links */
  .nav-links a { padding: 12px 16px; font-size: 15px; }
  /* Live tool — full-width sections */
  .tool-shell .container { padding: 0 16px; }
  .card { padding: 20px; border-radius: 12px; }
  .action { padding: 18px; }
  .action button { width: 100%; margin-bottom: 8px; margin-right: 0; }
  /* Scan summary table — make it horizontal scrollable on phones */
  .scan-table { font-size: 12px; }
  .scan-table th, .scan-table td { padding: 8px 6px; }
  /* Hide topbar version tag on phones (saves space) */
  .brand-version { display: none; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 32px; }
  .section-title { font-size: 24px; }
  .container { padding: 0 16px; }
  /* Section result heading wraps better */
  .section-result h2 { font-size: 15px; flex-wrap: wrap; }
  /* Trade detail grid: single column */
  .trade-detail { grid-template-columns: 1fr; gap: 4px; }
  .trade-detail dt { color: var(--accent); margin-top: 8px; }
  /* KPI strip becomes 2x2 */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px; }
  .kpi-value { font-size: 18px; }
  /* Hero stats wrap to 2x2 */
  .hero-stats { flex-wrap: wrap; gap: 16px; }
  .hero-stats > div { flex: 1 1 calc(50% - 8px); min-width: 0; }
  /* Make the "Add to home screen" install button always visible if not installed */
}

/* Install hint shows when PWA isn't yet installed */
.pwa-install-hint {
  position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 100;
  background: var(--bg-elev);
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: none;
  align-items: center; gap: 12px;
  font-size: 13px;
}
body:not(.is-pwa) .pwa-install-hint.show { display: flex; }
.pwa-install-hint .pwa-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #0a0e14; flex-shrink: 0;
}
.pwa-install-hint .pwa-msg { flex: 1; color: var(--text-dim); }
.pwa-install-hint .pwa-msg strong { color: var(--text); display: block; }
.pwa-install-hint .pwa-close {
  background: none; border: 0; color: var(--text-dim); font-size: 20px;
  cursor: pointer; padding: 0 4px;
}

/* ============================================================================
   Chat widget — bubble + slide-up panel
============================================================================ */
.chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-grad);
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(94, 179, 255, .35), 0 0 0 0 rgba(94, 179, 255, .4);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
  animation: chatBubblePulseIn 2.4s ease-out 1.5s 1;
}
.chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 36px rgba(94, 179, 255, .55);
}
.chat-bubble.hidden { display: none; }
.chat-bubble-icon { font-size: 26px; line-height: 1; }
.chat-bubble-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: chatPulseRing 2.5s infinite;
}
@keyframes chatPulseRing {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes chatBubblePulseIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  height: 600px;
  max-height: calc(100vh - 48px);
  background: var(--bg-elev);
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: chatPanelOpen .25s ease-out;
}
.chat-panel.open { display: flex; }
@keyframes chatPanelOpen {
  from { transform: scale(.85) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* Header */
.chat-header {
  background: linear-gradient(135deg, rgba(94, 179, 255, .15), rgba(167, 139, 250, .15));
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #0a0e14;
}
.chat-header strong { display: block; font-size: 14px; }
.chat-subtitle { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.chat-close {
  background: none; border: 0; color: var(--text-dim);
  font-size: 28px; cursor: pointer; line-height: 1;
  padding: 0 8px; border-radius: 6px; transition: all .15s;
}
.chat-close:hover { color: var(--text); background: var(--bg-elev2); }

/* Messages */
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.chat-msg {
  display: flex; flex-direction: column;
  max-width: 88%;
  font-size: 13.5px;
  line-height: 1.5;
}
.chat-msg .chat-bubble-text {
  padding: 10px 14px;
  border-radius: 14px;
}
.chat-msg-user {
  align-self: flex-end;
}
.chat-msg-user .chat-bubble-text {
  background: var(--accent-grad);
  color: #0a0e14;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.chat-msg-assistant {
  align-self: flex-start;
}
.chat-msg-assistant .chat-bubble-text {
  background: var(--bg-elev2);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg-error .chat-bubble-text {
  background: rgba(255, 107, 107, .12);
  border: 1px solid rgba(255, 107, 107, .35);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg-assistant strong { color: var(--accent); }
.chat-msg-assistant code {
  background: var(--bg-elev3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--accent-bright);
}
.chat-msg-assistant a { color: var(--accent); }
.chat-msg-assistant ul {
  margin: 8px 0;
  padding-left: 18px;
}
.chat-msg-assistant li { margin: 3px 0; }
.chat-msg-assistant h3, .chat-msg-assistant h4 {
  margin: 10px 0 4px;
  font-size: 13px;
  color: var(--text);
}

.chat-citations {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(94, 179, 255, .06);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-size: 11px;
  color: var(--text-dim);
  display: flex; flex-direction: column; gap: 4px;
}
.chat-citations strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 10px;
}
.chat-citations a {
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
  word-break: break-all;
}
.chat-citations a:hover { text-decoration: underline; }

/* Typing indicator */
.chat-typing {
  padding: 8px 18px;
  display: flex; gap: 4px;
}
.chat-typing.hidden { display: none; }
.chat-typing span {
  width: 7px; height: 7px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: chatTypingBounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Form */
.chat-form {
  border-top: 1px solid var(--border);
  padding: 12px 14px 8px;
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--bg-elev);
}
.chat-form textarea {
  flex: 1;
  resize: none;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  min-height: 40px;
  max-height: 200px;
  min-width: 0;
}
.chat-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(94, 179, 255, .2);
}
.chat-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--accent-grad);
  color: #0a0e14;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.chat-send:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 4px 12px rgba(94, 179, 255, .4); }
.chat-send:disabled { opacity: .35; cursor: not-allowed; }

.chat-disclaimer {
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 0 14px 10px;
  background: var(--bg-elev);
  line-height: 1.4;
}
.chat-disclaimer a { color: var(--text-dim); }

/* Mobile responsive — fullscreen chat on small screens */
@media (max-width: 720px) {
  .chat-bubble { width: 56px; height: 56px; bottom: 20px; right: 20px; }
  .chat-bubble-icon { font-size: 24px; }
  .chat-panel {
    bottom: 0; right: 0; left: 0; top: 0;
    width: 100vw; height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
  }
  .chat-msg { max-width: 92%; font-size: 14px; }
  /* Larger tap target for input on phones */
  .chat-form textarea { font-size: 16px; min-height: 44px; }
  .chat-send { width: 44px; height: 44px; }
}

/* When in PWA standalone mode, respect safe-area insets */
body.is-pwa .chat-panel { padding-bottom: env(safe-area-inset-bottom); }
body.is-pwa .chat-bubble { bottom: max(24px, calc(env(safe-area-inset-bottom) + 8px)); }

/* ============================================================================
   Utility
============================================================================ */
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.flex-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }


/* Scanline and grain effects */
body::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 1000;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
  position: fixed;
}
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: transparent;
  box-shadow: inset 0 0 120px rgba(0,0,0,0.9);
  pointer-events: none;
  z-index: 999;
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.reveal-active {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.hero-card { clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.hero-card:hover { transform: translateY(-10px) translateX(-5px) !important; border-color: var(--accent); }

/* Moving Graph Animation */
.animated-graph path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawGraph 3s ease forwards infinite alternate;
}
@keyframes drawGraph {
  to { stroke-dashoffset: 0; }
}

.brand-logo { border-radius: 0; transform: skew(-10deg); box-shadow: 0 0 10px var(--accent); }
h1, h2, h3 { text-transform: uppercase; text-shadow: 2px 2px 0px rgba(0,240,255,0.3); }
.btn { border-radius: 0; text-transform: uppercase; letter-spacing: 2px; position: relative; overflow: hidden; }
.btn-primary { background: transparent; border: 1px solid var(--accent); color: var(--accent); box-shadow: 0 0 10px rgba(0,240,255,0.2); }
.btn-primary:hover { background: var(--accent); color: #000; box-shadow: 0 0 30px var(--accent); }

.feature, .step { border-radius: 0; border-left: 4px solid var(--border-bright); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%); }
.feature:hover, .step:hover { border-left-color: var(--accent); box-shadow: var(--shadow-glow); }

.hero { background: radial-gradient(ellipse at top, rgba(0, 240, 255, 0.1), transparent 70%); }

/* ====== BUG FIXES FOR TEXT OVERFLOW ====== */

/* 1. Fix Chat Bubble Text Overflow */
.chat-msg {
  max-width: 95%; /* Give it more room */
}
.chat-msg .chat-bubble-text {
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  padding: 12px 16px;
  line-height: 1.4;
}

/* 2. Fix Risk Calc Input and Text Overflow */
.calc-grid {
  grid-template-columns: 1fr; /* Stack them so inputs have full width */
}
.calc-inputs input, .calc-inputs select {
  width: 100%;
  box-sizing: border-box;
  min-width: 0; /* Prevents input from breaking flex containers */
}
.calc-headline-value {
  font-size: clamp(16px, 4vw, 22px); /* Responsive font size */
  word-break: break-word;
}
.scenario-payout {
  font-size: clamp(14px, 3vw, 18px);
}

/* 3. Global fixes for wide uppercase fonts */
h1, h2, h3, h4, h5, h6 {
  word-break: break-word;
  hyphens: auto;
}
.btn {
  white-space: normal;
  text-align: center;
  word-break: break-word;
}


/* ====== ADDITIONAL OVERFLOW FIXES ====== */
.hero-card {
  word-break: break-word;
  overflow: hidden;
}
.hero-card strong {
  word-break: break-word;
}
.section-result {
  overflow-x: auto;
}
.stats-panel-grid {
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

/* ====== ADDITIONAL MARKETING ANIMATIONS ====== */
.grow-bar {
  transform-origin: bottom;
  animation: growBarAnim 2s cubic-bezier(0.16, 1, 0.3, 1) forwards infinite alternate;
}
@keyframes growBarAnim {
  0% { transform: scaleY(0); }
  100% { transform: scaleY(1); }
}

.spin-slow {
  animation: spinAnim 20s linear infinite;
  transform-origin: center;
}
.spin-fast {
  animation: spinAnim 5s linear infinite;
  transform-origin: center;
}
.spin-fast-reverse {
  animation: spinAnim 7s linear infinite reverse;
  transform-origin: center;
}
@keyframes spinAnim {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.pulse-opacity {
  animation: pulseOpAnim 2s ease-in-out infinite alternate;
}
@keyframes pulseOpAnim {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

.scan-line {
  animation: scanLineAnim 3s linear infinite;
}
@keyframes scanLineAnim {
  0% { transform: translateX(0); }
  100% { transform: translateX(200px); }
}

.glitch-hover:hover {
  animation: glitchAnim 0.2s linear infinite;
  color: var(--red);
  text-shadow: 2px 0 var(--accent), -2px 0 var(--green);
}
@keyframes glitchAnim {
  0% { transform: translate(0) }
  20% { transform: translate(-2px, 1px) }
  40% { transform: translate(-1px, -1px) }
  60% { transform: translate(2px, 1px) }
  80% { transform: translate(1px, -1px) }
  100% { transform: translate(0) }
}

.pulse-border {
  animation: borderPulseAnim 4s infinite alternate;
}
@keyframes borderPulseAnim {
  0% { border-color: var(--border); box-shadow: none; }
  100% { border-color: var(--accent); box-shadow: 0 0 15px rgba(0,240,255,0.2); }
}

/* Make standard feature grids stagger float */
.feature {
  animation: floatAnim 6s ease-in-out infinite alternate;
}
@keyframes floatAnim {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

/* ====== INTERACTIVE PILLARS ====== */
.interactive-pillars-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 800px;
  margin: 0 auto;
}
@media(min-width: 768px) {
  .interactive-pillars-wrapper { flex-direction: row; align-items: stretch; }
}
.interactive-pillars {
  position: relative;
  width: 320px;
  height: 320px;
  flex-shrink: 0;
}
.pillar-connections {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  animation: spinAnim 30s linear infinite;
  transform-origin: center;
}
.pillar-node {
  position: absolute;
  width: 80px; height: 80px;
  background: var(--bg-elev);
  border: 2px solid var(--border-bright);
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
  z-index: 10;
}
.pillar-node:hover {
  transform: scale(1.15);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent);
}
.pillar-node.active {
  border-color: var(--red);
  box-shadow: 0 0 30px var(--red);
  transform: scale(1.2);
}
.node-1 { top: 0; left: 50%; margin-left: -40px; }
.node-2 { bottom: 20px; left: 20px; }
.node-3 { bottom: 20px; right: 20px; }
.node-icon { font-size: 24px; }
.node-label { font-family: var(--mono); font-size: 10px; font-weight: bold; color: var(--text); margin-top: 4px; text-transform: uppercase; }

.pillar-details {
  background: var(--bg-elev2);
  padding: 32px;
  flex-grow: 1;
  position: relative;
  min-height: 250px;
  overflow: hidden;
}
.detail-card {
  position: absolute;
  top: 32px; left: 32px; right: 32px;
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
  transition: all 0.4s ease;
}
.detail-card.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.detail-card .pillar-num { font-family: var(--mono); color: var(--accent); margin-bottom: 8px; }
.detail-card h3 { color: var(--text); font-size: 24px; margin-bottom: 16px; }
.detail-card p { font-size: 14px; color: var(--text-dim); margin-bottom: 12px; }

/* ====== FLOATING TRADING SESSION ====== */
.session-section.side-widget {
  position: fixed;
  right: 20px;
  top: 100px;
  width: 320px;
  background: var(--bg-elev2);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-glow);
  z-index: 1000;
  padding: 16px;
  border-radius: 0;
  animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.side-widget .session-clock {
  flex-direction: row; align-items: baseline; gap: 8px; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px; margin-bottom: 10px;
}
.side-widget .session-active-row {
  flex-direction: column; align-items: stretch; gap: 4px;
}
.side-widget .session-badge {
  justify-content: space-between;
}
.side-widget .next-session-info {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 12px;
  text-align: center; border-top: 1px dashed var(--border); padding-top: 8px;
}
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@media(max-width: 1200px) {
  .session-section.side-widget {
    position: relative; right: auto; top: auto; width: 100%; margin-bottom: 24px;
    animation: none;
  }
}

/* ============================================================================
   PHASE 3 — additive enhancements (do not edit the rules above this line).
   Three Pillars motion · marketing graphs · scroll-driven number count-ups ·
   trading-session widget polish · live-tool result reveal.
   ============================================================================ */

/* ---- Three Pillars: living, breathing nodes ---- */
.interactive-pillars { position: relative; }
.pillar-node {
  /* additive — augments the existing pillar-node rule without overriding it */
  animation: pillarFloat 4.6s ease-in-out infinite;
  will-change: transform;
}
.pillar-node.node-2 { animation-delay: -1.5s; }
.pillar-node.node-3 { animation-delay: -3s; }
.pillar-node:hover {
  transform: translate(-50%, -50%) scale(1.08) !important;
  z-index: 4;
  filter: drop-shadow(0 0 18px var(--accent));
}
.pillar-node.active::after {
  content: ""; position: absolute; inset: -10px;
  border: 1px solid var(--accent); border-radius: 50%;
  animation: pillarRing 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes pillarFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-6px); }
}
@keyframes pillarRing {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Animated dashed flow along the SVG triangle connecting the three pillars. */
.pillar-connections .animated-graph {
  stroke-dasharray: 8 6;
  animation: pillarFlow 14s linear infinite;
}
@keyframes pillarFlow { to { stroke-dashoffset: -200; } }

/* Detail card transition — additive, smoother fade between cards. */
.pillar-details .detail-card {
  transition: opacity .45s cubic-bezier(0.16, 1, 0.3, 1), transform .45s cubic-bezier(0.16, 1, 0.3, 1);
}
.pillar-details .detail-card:not(.active) {
  position: absolute; inset: 0; opacity: 0; transform: translateX(8px); pointer-events: none;
}
.pillar-details .detail-card.active {
  opacity: 1; transform: translateX(0); position: relative;
}
.pillar-details { position: relative; min-height: 180px; }

/* ---- Phase 3 marketing graphs ---- */
.mkt-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin-top: 24px;
}
.mkt-card {
  position: relative; padding: 22px;
  background: var(--bg-elev2); border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.mkt-card:hover { transform: translateY(-3px); border-color: var(--border-bright); box-shadow: 0 12px 40px rgba(0,240,255,.06); }
.mkt-card::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 2px;
  background: var(--accent-grad);
}
.mkt-card-label { font-family: var(--mono); font-size: 11px; color: var(--text-dim); letter-spacing: 1.2px; text-transform: uppercase; }
.mkt-card-value { font-size: 28px; font-weight: 800; margin: 6px 0 4px; }
.mkt-card-value .gradient { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.mkt-card-foot { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.mkt-card svg { display: block; margin-top: 14px; width: 100%; height: 64px; overflow: visible; }

/* Live-looking sparkline — animates the dash from left to right on intersect. */
.mkt-sparkline {
  fill: none; stroke: var(--accent); stroke-width: 1.6;
  stroke-dasharray: 600; stroke-dashoffset: 600;
  filter: drop-shadow(0 0 4px var(--accent));
  animation: sparkDraw 2.4s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.mkt-card.delay-1 .mkt-sparkline { animation-delay: 0.4s; }
.mkt-card.delay-2 .mkt-sparkline { animation-delay: 0.6s; }
.mkt-card.delay-3 .mkt-sparkline { animation-delay: 0.8s; }
@keyframes sparkDraw { to { stroke-dashoffset: 0; } }

/* Radial pulse — used as accent on heatmap-style mkt cards. */
.mkt-radial { animation: mktRadialPulse 3s ease-in-out infinite; transform-origin: center; }
@keyframes mktRadialPulse { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.06); opacity: 1; } }

/* Bouncing dots row — used in regime / momentum cards. */
.mkt-dots circle { animation: mktDotPulse 1.8s ease-in-out infinite; }
.mkt-dots circle:nth-child(2) { animation-delay: 0.2s; }
.mkt-dots circle:nth-child(3) { animation-delay: 0.4s; }
.mkt-dots circle:nth-child(4) { animation-delay: 0.6s; }
.mkt-dots circle:nth-child(5) { animation-delay: 0.8s; }
@keyframes mktDotPulse {
  0%, 100% { r: 4; opacity: .35; }
  50% { r: 6; opacity: 1; }
}

/* Volatility ribbon — vertical bars whose height oscillates */
.mkt-ribbon rect {
  transform-box: fill-box; transform-origin: bottom;
  animation: mktRibbon 2.6s ease-in-out infinite;
}
.mkt-ribbon rect:nth-child(1) { animation-delay: 0s; }
.mkt-ribbon rect:nth-child(2) { animation-delay: 0.18s; }
.mkt-ribbon rect:nth-child(3) { animation-delay: 0.36s; }
.mkt-ribbon rect:nth-child(4) { animation-delay: 0.54s; }
.mkt-ribbon rect:nth-child(5) { animation-delay: 0.72s; }
.mkt-ribbon rect:nth-child(6) { animation-delay: 0.9s; }
.mkt-ribbon rect:nth-child(7) { animation-delay: 1.08s; }
.mkt-ribbon rect:nth-child(8) { animation-delay: 1.26s; }
@keyframes mktRibbon {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* ---- Trading-session widget polish (cyber HUD vibe) ---- */
.session-section.side-widget {
  /* additive — adds an animated border-glow on top of the existing static glow */
  position: fixed; /* re-stated for specificity */
}
.session-section.side-widget::after {
  content: ""; position: absolute; inset: -1px;
  background: linear-gradient(135deg, rgba(0,240,255,0.6), transparent 40%, rgba(255,0,60,0.4));
  filter: blur(8px); opacity: 0; z-index: -1;
  animation: sessionGlow 4.6s ease-in-out infinite;
}
@keyframes sessionGlow {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.5; }
}

/* ---- Live tool — staggered reveal of result blocks (every direct child of #results-content) ---- */
#results-content > * {
  opacity: 0; transform: translateY(16px);
  animation: liveBlockRise 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
#results-content > *:nth-child(1) { animation-delay: 0.05s; }
#results-content > *:nth-child(2) { animation-delay: 0.18s; }
#results-content > *:nth-child(3) { animation-delay: 0.30s; }
#results-content > *:nth-child(4) { animation-delay: 0.42s; }
#results-content > *:nth-child(5) { animation-delay: 0.54s; }
#results-content > *:nth-child(6) { animation-delay: 0.66s; }
#results-content > *:nth-child(7) { animation-delay: 0.78s; }
#results-content > *:nth-child(8) { animation-delay: 0.90s; }
#results-content > *:nth-child(n+9) { animation-delay: 1.05s; }
@keyframes liveBlockRise { to { opacity: 1; transform: translateY(0); } }

/* ---- Number count-ups ---- */
[data-countup] { font-variant-numeric: tabular-nums; }

/* ---- Scroll progress bar at the very top of the page ---- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 1100;
  background: var(--accent-grad);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.06s linear;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

/* ---- Subtle particle drift backdrop (absolute-positioned, decorative) ---- */
.particle-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.particle-bg span {
  position: absolute; display: block;
  width: 2px; height: 2px; background: var(--accent);
  border-radius: 50%; opacity: 0.35;
  animation: particleDrift linear infinite;
  filter: blur(0.4px);
}
@keyframes particleDrift {
  from { transform: translate3d(0, 100vh, 0); }
  to   { transform: translate3d(0, -110vh, 0); }
}

