/* ==========================================================================
   PipsIQ — Design Tokens
   Signature: dark-ink-and-red (HFM brand red on near-black), HUD
   corner-bracket framing, live price ticker. Monospace carries all
   data/numeric content.
   ========================================================================== */

:root {
  /* Surfaces */
  --ink: #0A0C0F;
  --panel: #14181D;
  --panel-raised: #1B2028;
  --hairline: #262B31;
  --hairline-bright: #363E47;

  /* Signature accent — Pepperstone brand blue (variable names kept as
     --amber-* to avoid touching the ~25 files that reference them; only
     the values changed) */
  --amber: #0158DB;
  --amber-dim: #063170;
  --amber-glow: rgba(1, 88, 219, 0.18);

  /* Genuine warning/pending semantic color — kept separate from the brand
     accent above. Previously both badge-amber and the brand button shared
     one variable, which was fine when the brand was red (distinct from
     any warning color), but would silently make every pending/warning
     badge site-wide the same blue as every button once the brand became
     blue. Decoupled here instead of carrying that bug forward. */
  --warning: #D89B2E;
  --warning-glow: rgba(216, 155, 46, 0.18);

  /* Secondary data accent */
  --signal-blue: #6DA6FC;
  --signal-blue-dim: rgba(109, 166, 252, 0.18);

  /* Functional (ticker up/down — meaning, not decoration) */
  --up: #4CAF7D;
  --down: #D9645A;

  /* Text */
  --text: #E7E5DF;
  --text-muted: #8A8F94;
  --text-dim: #565C63;

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --max: 1180px;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  background-image: radial-gradient(circle, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--text-muted); }

.mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1em;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--amber);
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; border-bottom: 1px solid var(--hairline); }
section:last-of-type { border-bottom: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
  pointer-events: none;
}
.btn:hover::after { left: 130%; }
@media (prefers-reduced-motion: reduce) {
  .btn::after { display: none; }
}

.btn-primary {
  background: var(--amber);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(1,88,219,0.28);
}
.btn-primary:hover { background: #6DA6FC; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(1,88,219,0.36); }

.btn-ghost {
  background: transparent;
  border-color: var(--hairline-bright);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); background: var(--amber-glow); }

.btn-block { width: 100%; justify-content: center; }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  background: rgba(10, 12, 15, 0.97);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  flex-shrink: 0;
}
.brand .iq { color: var(--amber); }
.brand-logo {
  height: 30px !important;
  max-height: 30px !important;
  width: auto !important;
  max-width: none;
  display: block;
  object-fit: contain;
  transition: opacity 0.2s ease;
}
.brand:hover .brand-logo { opacity: 0.85; }

.nav-links {
  display: flex;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.nav-links a {
  color: var(--text-muted);
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.nav-links a:hover {
  color: #FFFFFF;
  background-color: var(--amber);
  box-shadow: 0 6px 16px rgba(1,88,219,0.32);
  transform: translateY(-1px);
}
.nav-links a.active {
  color: #FFFFFF;
  background-color: var(--amber);
  box-shadow: 0 6px 16px rgba(1,88,219,0.32);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }

.nav-toggle-checkbox { display: none; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 10px;
  margin: -10px;
}

@media (max-width: 860px) {
  .nav-links { position: fixed !important; top: 72px !important; left: 0 !important;
    width: 100vw !important; height: calc(100vh - 72px) !important; bottom: auto !important; right: auto !important;
    background: var(--ink); flex-direction: column; padding: 32px 24px;
    gap: 24px; font-size: 1rem; transform: translateX(100%);
    transition: transform 0.25s ease; z-index: 999 !important; box-sizing: border-box; overflow-y: auto; }
  .nav-toggle-checkbox:checked ~ .nav-links { transform: translateX(0); }
  .nav-links a { border-radius: 8px; padding: 12px 16px; }
  .nav-toggle { display: block; }
  .nav-actions .btn-ghost, .nav-actions .nav-icon-btn { display: none; }
}

/* ==========================================================================
   Ticker — signature live-market strip
   ========================================================================== */
.ticker {
  border-bottom: 1px solid var(--hairline);
  background: var(--panel);
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  border-top: 2px solid var(--amber);
}
.ticker::before, .ticker::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: 60px; z-index: 2;
}
.ticker::before { left: 0; background: linear-gradient(90deg, var(--panel), transparent); }
.ticker::after { right: 0; background: linear-gradient(270deg, var(--panel), transparent); }

.ticker-track {
  display: inline-flex;
  gap: 40px;
  padding: 10px 0;
  animation: ticker-scroll 38s linear infinite;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.ticker:hover .ticker-track { animation-play-state: paused; }

.ticker-item { display: inline-flex; gap: 8px; color: var(--text-muted); }
.ticker-item .pair { color: var(--text); font-weight: 600; }
.ticker-item .up { color: var(--up); }
.ticker-item .down { color: var(--down); }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ==========================================================================
   HUD corner-bracket card — signature framing device
   ========================================================================== */
.hud {
  position: relative;
  border: 1px solid var(--hairline);
  background: var(--panel);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 10px 24px rgba(0,0,0,0.25);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
a.hud:hover, .hud.hud-hoverable:hover {
  transform: translateY(-4px);
  border-color: var(--hairline-bright);
  box-shadow: 0 24px 48px rgba(0,0,0,0.45), 0 0 0 1px rgba(1,88,219,0.2);
}
.hud::before, .hud::after,
.hud .hud-br, .hud .hud-bl { content: ''; position: absolute; width: 14px; height: 14px; transition: border-color 0.22s ease; }
.hud::before { top: -1px; left: -1px; border-top: 2px solid var(--amber); border-left: 2px solid var(--amber); }
.hud::after { top: -1px; right: -1px; border-top: 2px solid var(--amber); border-right: 2px solid var(--amber); }
.hud .hud-bl { bottom: -1px; left: -1px; border-bottom: 2px solid var(--amber); border-left: 2px solid var(--amber); }
.hud .hud-br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--amber); border-right: 2px solid var(--amber); }

.hud-dim::before, .hud-dim::after, .hud-dim .hud-bl, .hud-dim .hud-br {
  border-color: var(--hairline-bright) !important;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 88px 0 96px; position: relative; overflow: hidden; }
.hero::before {
  content: '';
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-42%);
  width: 900px;
  height: 560px;
  background: radial-gradient(ellipse at center, rgba(1,88,219,0.16) 0%, rgba(1,88,219,0.05) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; }
.hero-copy p.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 46ch; }

@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-copy .eyebrow { animation: hero-fade-up 0.6s ease both; }
.hero-copy h1 { animation: hero-fade-up 0.6s ease 0.08s both; }
.hero-copy p.lead { animation: hero-fade-up 0.6s ease 0.16s both; }
.hero-copy .hero-cta { animation: hero-fade-up 0.6s ease 0.24s both; }
.hero-grid > .hud { animation: hero-fade-up 0.7s ease 0.2s both; }
@media (prefers-reduced-motion: reduce) {
  .hero-copy .eyebrow, .hero-copy h1, .hero-copy p.lead, .hero-copy .hero-cta, .hero-grid > .hud {
    animation: none;
  }
}
.hero-cta { display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap; }

.hero-stats { display: flex; gap: 40px; margin-top: 56px; }
.stat .num { font-family: var(--font-mono); font-size: 1.7rem; color: var(--amber); font-weight: 700; }
.stat .label { font-size: 0.78rem; color: var(--text-dim); letter-spacing: 0.03em; }

/* Mock terminal panel in hero */
.terminal {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  position: relative;
}
.terminal-head {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--hairline); padding-bottom: 14px; margin-bottom: 18px;
}
.terminal-head .dots { display: flex; gap: 6px; }
.terminal-head .dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline-bright); }
.terminal-head .dots span:first-child { background: var(--down); }
.terminal-head .dots span:nth-child(2) { background: #E8B93F; }
.terminal-head .dots span:last-child { background: var(--up); }
.terminal-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--hairline); }
.terminal-row:last-child { border-bottom: none; }
.terminal-row .sig { color: var(--up); font-weight: 600; }
.terminal-row .sig.down { color: var(--down); font-weight: 600; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 28px; }
}

/* ==========================================================================
   Grids / cards
   ========================================================================== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card-num { font-family: var(--font-mono); color: var(--amber-dim); font-size: 0.85rem; margin-bottom: 12px; }

.section-head { max-width: 640px; margin-bottom: 56px; }

/* ==========================================================================
   Pricing
   ========================================================================== */
.plan {
  border: 1px solid var(--hairline);
  background: var(--panel);
  padding: 36px 28px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 10px 24px rgba(0,0,0,0.25);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.plan:hover { transform: translateY(-4px); box-shadow: 0 20px 42px rgba(0,0,0,0.4); }
.plan.featured { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 20px 60px var(--amber-glow); position: relative; }
.plan.featured:hover { box-shadow: 0 0 0 1px var(--amber), 0 26px 70px rgba(1,88,219,0.18); }
.plan.featured .plan-tag {
  position: absolute; top: -13px; left: 28px; background: var(--amber); color: #FFFFFF;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; padding: 4px 10px; border-radius: 2px;
  text-transform: uppercase; font-weight: 700;
}
.plan-name { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; color: var(--text-muted); }
.plan-price { font-family: var(--font-mono); font-size: 2.4rem; color: var(--text); margin: 14px 0 4px; }
.plan-price .cur { font-size: 1.1rem; color: var(--text-muted); vertical-align: top; margin-right: 4px; }
.plan-price .per { font-size: 0.9rem; color: var(--text-dim); }
.plan-desc { font-size: 0.88rem; margin-bottom: 24px; }
.plan-features { list-style: none; padding: 0; margin: 0 0 28px; flex-grow: 1; }
.plan-features li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--hairline); font-size: 0.9rem; color: var(--text-muted); }
.plan-features li:first-child { border-top: none; }
.plan-features li::before { content: '▸'; color: var(--amber); flex-shrink: 0; }

/* ==========================================================================
   Forms (enrollment / M-Pesa checkout)
   ========================================================================== */
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.field input, .field select {
  width: 100%; background: var(--ink); border: 1px solid var(--hairline-bright); color: var(--text);
  padding: 13px 14px; border-radius: var(--radius); font-family: var(--font-body); font-size: 0.95rem;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--amber); }
.field-hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 6px; }

.form-status { font-family: var(--font-mono); font-size: 0.85rem; padding: 12px 14px; border-radius: var(--radius); margin-top: 16px; display: none; }
.form-status.show { display: block; }
.form-status.pending { background: var(--warning-glow); color: var(--warning); border: 1px solid var(--warning); }
.form-status.success { background: rgba(76, 175, 125, 0.12); color: var(--up); border: 1px solid var(--up); }
.form-status.error { background: rgba(217, 100, 90, 0.12); color: var(--down); border: 1px solid var(--down); }

/* ==========================================================================
   Footer
   ========================================================================== */
footer { background: var(--panel); border-top: none; padding: 0 0 28px; }

.footer-banner { background: var(--panel-raised); border-bottom: 1px solid var(--hairline); border-top: 2px solid var(--amber); }
.footer-banner-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
  font-size: 0.86rem;
  color: var(--text);
}
.footer-banner-inner strong { color: var(--amber); }

.footer-social-solid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--amber);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.76rem;
  border-radius: 999px;
  padding: 8px 16px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.footer-social-solid:hover { background: #6DA6FC; color: #FFFFFF; }

.footer-row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; padding: 28px 0 20px; border-bottom: 1px solid var(--hairline); margin-bottom: 20px; }
.footer-row .brand { height: auto; }
.footer-links-flow { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-top: 4px; }
.footer-links-flow a { color: var(--text-muted); font-size: 0.86rem; transition: color 0.2s ease; }
.footer-links-flow a:hover { color: var(--amber); }

.footer-bottom { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--text-dim); font-family: var(--font-mono); flex-wrap: wrap; gap: 10px; }
@media (max-width: 700px) { .footer-banner-inner, .footer-row, .footer-bottom { flex-direction: column; align-items: flex-start; } }

/* Risk disclosure — required honesty for a trading brand */
.risk-note {
  font-size: 0.75rem; color: var(--text-dim); border-top: 1px solid var(--hairline);
  padding-top: 16px; margin: 0 0 16px; line-height: 1.6;
}

/* Page header (inner pages) */
.page-head { padding: 64px 0 48px; }
.page-head .eyebrow { margin-bottom: 18px; }

/* Utility */
.text-center { text-align: center; margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; }
.badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 10px; border: 1px solid var(--hairline-bright); border-radius: 2px; color: var(--text-muted);
  background: var(--panel-raised);
}
.badge-up { color: var(--up); border-color: var(--up); background: rgba(76,175,125,0.14); }
.badge-down { color: var(--down); border-color: var(--down); background: rgba(217,100,90,0.14); }
.badge-amber { color: var(--warning); border-color: var(--warning); background: var(--warning-glow); }

/* ==========================================================================
   Dashboard tiles (student + admin overview stats)
   ========================================================================== */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.tile { border: 1px solid var(--hairline); background: var(--panel); border-radius: var(--radius); padding: 22px; box-shadow: 0 2px 4px rgba(0,0,0,0.28), 0 8px 18px rgba(0,0,0,0.2); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.35); }
.tile .tile-label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.tile .tile-num { font-family: var(--font-mono); font-size: 1.9rem; color: var(--amber); margin-top: 8px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

/* ==========================================================================
   Tabs (student dashboard sections)
   ========================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); margin-bottom: 32px; flex-wrap: wrap; }
.tab-btn {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.03em; background: none; border: none;
  color: var(--text-muted); padding: 12px 18px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--amber); border-bottom-color: var(--amber); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ==========================================================================
   Data list rows (materials, assignments, sessions, certificates)
   ========================================================================== */
.data-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border: 1px solid var(--hairline); background: var(--panel); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 12px; flex-wrap: wrap;
}
.data-row .data-main h4 { margin: 0 0 4px; font-size: 1rem; font-family: var(--font-body); font-weight: 600; }
.data-row .data-main p { margin: 0; font-size: 0.85rem; }
.data-row .data-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); }
.data-row .data-actions { display: flex; gap: 10px; flex-shrink: 0; }
.data-row .data-actions .btn { padding: 9px 16px; font-size: 0.78rem; }
.empty-note { color: var(--text-dim); font-size: 0.9rem; font-style: italic; }

/* ==========================================================================
   Admin shell — sidebar layout
   ========================================================================== */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--hairline);
  padding: 28px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .brand { display: block; margin-bottom: 36px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a {
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted);
  padding: 10px 12px; border-radius: var(--radius); display: block;
}
.admin-nav a:hover { background: var(--panel-raised); color: var(--text); }
.admin-nav a.active { background: var(--amber-glow); color: var(--amber); }
.admin-main { flex-grow: 1; padding: 40px; max-width: 1100px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }

@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-main { padding: 24px; }
}

/* ==========================================================================
   Tables (admin lists)
   ========================================================================== */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th {
  text-align: left; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-dim); border-bottom: 1px solid var(--hairline-bright); padding: 10px 12px;
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--hairline); color: var(--text-muted); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.table-wrap { border: 1px solid var(--hairline); background: var(--panel); border-radius: var(--radius); overflow-x: auto; margin-bottom: 32px; }
.table-wrap .data-table { margin: 0; }
.table-actions { display: flex; gap: 8px; }
.table-actions form { display: inline; }
.btn-sm { padding: 7px 12px; font-size: 0.72rem; }
.btn-danger { background: transparent; border: 1px solid var(--down); color: var(--down); }
.btn-danger:hover { background: rgba(217, 100, 90, 0.12); }

.panel-block {
  border: 1px solid var(--hairline); background: var(--panel); border-radius: var(--radius);
  padding: 28px; margin-bottom: 32px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 10px 24px rgba(0,0,0,0.25);
}

/* Certificate print view */
.certificate {
  border: 3px solid var(--amber); background: var(--panel); padding: 64px 48px; text-align: center;
  max-width: 800px; margin: 40px auto;
}
.certificate .cert-brand { font-family: var(--font-mono); letter-spacing: 0.2em; color: var(--amber); font-size: 0.85rem; }
.certificate h1 { margin: 24px 0 8px; }
.certificate .cert-name { font-family: var(--font-display); font-size: 2rem; color: var(--amber); margin: 24px 0; }
.certificate .cert-code { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); margin-top: 32px; }
@media print {
  .nav, .ticker, footer, .no-print { display: none !important; }
  body { background: #fff; color: #111; }
  .certificate { border-color: #b8860b; }
}

/* ==========================================================================
   Floating Telegram button
   ========================================================================== */
.telegram-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #229ED9; /* Telegram's own brand blue — deliberately not the site accent, so it reads as a distinct chat affordance */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(34, 158, 217, 0.4), 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.telegram-float:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(34, 158, 217, 0.5), 0 4px 10px rgba(0,0,0,0.35);
}
.telegram-float svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}
@media print {
  .telegram-float { display: none !important; }
}
@media (max-width: 560px) {
  .telegram-float { right: 16px; bottom: 16px; width: 50px; height: 50px; }
  .telegram-float svg { width: 24px; height: 24px; }
}

/* ==========================================================================
   Calculator result panel (Resources / Trading Tools)
   ========================================================================== */
.calc-result {
  border: 1px solid var(--hairline);
  background: var(--ink);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 140px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.calc-big {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 6px;
}
.calc-big.up { color: var(--up); }
.calc-big.down { color: var(--down); }
.calc-sub { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }

/* ==========================================================================
   Notification bell
   ========================================================================== */
.notif-wrap { position: relative; display: inline-flex; }

.notif-bell {
  position: relative;
  background: none;
  border: 1px solid var(--hairline-bright);
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.notif-bell:hover { color: var(--text); border-color: var(--amber); }
.notif-bell svg { width: 19px; height: 19px; }

.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--amber);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.notif-panel {
  position: absolute;
  top: 50px;
  right: 0;
  width: 340px;
  max-width: 90vw;
  background: var(--panel);
  border: 1px solid var(--hairline-bright);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  z-index: 300;
  overflow: hidden;
}
.notif-panel[hidden] { display: none; }

.notif-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.notif-panel-head button {
  background: none;
  border: none;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
}
.notif-panel-head button:hover { text-decoration: underline; }

.notif-list { max-height: 360px; overflow-y: auto; }

.notif-item {
  padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 0.12s ease;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--panel-raised); }
.notif-item.unread { background: rgba(1, 88, 219, 0.06); border-left: 2px solid var(--amber); }

.notif-item-title { font-size: 0.88rem; color: var(--text); font-weight: 600; margin-bottom: 3px; }
.notif-item-msg { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 5px; line-height: 1.4; }
.notif-item-time { font-size: 0.7rem; color: var(--text-dim); }

.notif-empty { padding: 28px 16px; text-align: center; color: var(--text-dim); font-size: 0.85rem; }

@media (max-width: 560px) {
  .notif-panel { position: fixed; top: 72px; right: 12px; left: 12px; width: auto; }
}

/* ==========================================================================
   Avatars (profile picture / initials fallback)
   ========================================================================== */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm { width: 30px; height: 30px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 84px; height: 84px; }
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-raised);
  border: 1px solid var(--hairline-bright);
  color: var(--amber);
  font-family: var(--font-display);
  font-weight: 700;
}
.avatar-sm.avatar-fallback { font-size: 0.85rem; }
.avatar-lg.avatar-fallback { font-size: 2rem; }

/* ==========================================================================
   Progress bar (dashboard cohort progress)
   ========================================================================== */
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--panel-raised);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ==========================================================================
   Activity heatmap (Trading Journal)
   ========================================================================== */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  max-width: 100%;
}
.heatmap-cell {
  width: 100%;
  aspect-ratio: 1;
  min-width: 10px;
  border-radius: 2px;
  background: var(--panel-raised);
  border: 1px solid var(--hairline);
}
.heatmap-cell[data-level="1"] { background: rgba(1, 88, 219, 0.3); border-color: rgba(1,88,219,0.4); }
.heatmap-cell[data-level="2"] { background: rgba(1, 88, 219, 0.6); border-color: rgba(1,88,219,0.7); }
.heatmap-cell[data-level="3"] { background: var(--amber); border-color: var(--amber); }
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.heatmap-legend .heatmap-cell { width: 12px; height: 12px; min-width: 12px; }

/* ==========================================================================
   Leaderboard podium
   ========================================================================== */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
  padding: 24px 0 0;
}
.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 110px;
}
.podium-bar {
  width: 100%;
  margin-top: 12px;
  background: linear-gradient(180deg, var(--amber-glow), var(--panel-raised));
  border: 1px solid var(--hairline-bright);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

/* ==========================================================================
   Scroll-reveal animation
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  animation: reveal-fallback 0.7s ease 1.8s forwards;
}
@keyframes reveal-fallback {
  to { opacity: 1; transform: translateY(0); }
}
.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; animation: none; }
}

/* ==========================================================================
   CTA pulse — used sparingly on the single most important button per page
   ========================================================================== */
@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(1,88,219,0.28), 0 0 0 0 rgba(1,88,219,0.35); }
  50% { box-shadow: 0 4px 14px rgba(1,88,219,0.28), 0 0 0 8px rgba(1,88,219,0); }
}
.btn-pulse { animation: btn-pulse 2.4s ease-in-out infinite; }
.btn-pulse:hover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .btn-pulse { animation: none; }
}

/* ==========================================================================
   Ad banner
   ========================================================================== */
.ad-banner { padding: 40px 0; }
.ad-banner-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 10px;
}
.ad-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border: 1px dashed var(--hairline-bright);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}
.ad-banner-inner:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}
.ad-banner-img { width: 100%; height: auto; display: block; max-height: 220px; object-fit: cover; }
.ad-banner-content { padding: 22px 0 22px 28px; }
.ad-banner-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--text); }
.ad-banner-desc { font-size: 0.88rem; color: var(--text-muted); margin-top: 4px; }
.ad-banner-inner > .btn { margin-right: 28px; flex-shrink: 0; }

/* ==========================================================================
   Hero v2 — centered headline, radiating beams, floating data cards
   (reference: dramatic dark hero with red light rays + scattered UI cards)
   ========================================================================== */
.hero-v2 {
  position: relative;
  overflow: hidden;
  padding: 90px 0 60px;
  text-align: center;
}
.hero-beams {
  position: absolute;
  bottom: -10%;
  left: 50%;
  width: 1px;
  height: 1px;
  z-index: 0;
  pointer-events: none;
}
.hero-beam {
  position: absolute;
  bottom: 0;
  left: -70px;
  width: 140px;
  height: 620px;
  background: linear-gradient(to top, rgba(1,88,219,0.5), rgba(1,88,219,0.08) 55%, transparent 85%);
  filter: blur(18px);
  transform-origin: bottom center;
  opacity: 0.8;
}
.hero-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% 100%, rgba(1,88,219,0.22), transparent 70%);
  z-index: 0;
  pointer-events: none;
}
.hero-v2-content { position: relative; z-index: 2; }
.hero-v2 h1 {
  font-weight: 400;
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.18;
  max-width: 15ch;
  margin: 0 auto 0;
}
.hero-v2 h1 strong { display: block; font-weight: 700; }
.hero-v2 .lead { max-width: 52ch; margin: 20px auto 32px; color: var(--text-muted); font-size: 1.08rem; }
.hero-v2-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; z-index: 3; }

/* Floating cards */
.hero-floaters {
  position: relative;
  z-index: 1;
  margin-top: 56px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}
.floater {
  background: var(--panel);
  border: 1px solid var(--hairline-bright);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55), 0 0 40px rgba(1,88,219,0.1);
  text-align: left;
  font-family: var(--font-mono);
  transition: transform 0.3s ease;
}
.floater:hover { transform: translateY(-6px) rotate(0deg) !important; }
.floater-1 { transform: rotate(-4deg) translateY(10px); width: 240px; }
.floater-2 { transform: rotate(2deg) translateY(-14px); width: 220px; }
.floater-3 { transform: rotate(-2deg) translateY(20px); width: 190px; }

.floater-label { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 10px; }
.floater-price { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--text); }
.floater-change { font-size: 0.85rem; margin-top: 4px; }
.floater-change.up { color: var(--up); }
.floater-change.down { color: var(--down); }
.floater-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.78rem; border-bottom: 1px dashed var(--hairline); }
.floater-row:last-child { border-bottom: none; }

.floater-gauge {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 10px;
  background: conic-gradient(var(--amber) 0% 72%, var(--hairline) 72% 100%);
  display: flex; align-items: center; justify-content: center;
}
.floater-gauge-inner {
  width: 72px; height: 72px; border-radius: 50%; background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.floater-gauge-num { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--amber); }
.floater-gauge-sub { font-size: 0.6rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }

@media (max-width: 860px) {
  .floater-1, .floater-2, .floater-3 { transform: none; width: 100%; max-width: 300px; }
  .hero-beam { width: 90px; height: 420px; left: -45px; }
}
@media (prefers-reduced-motion: reduce) {
  .floater { transition: none; }
}

/* Nav circular icon button */
.nav-icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--hairline-bright);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.nav-icon-btn:hover { border-color: var(--amber); color: var(--amber); }
.nav-icon-btn svg { width: 18px; height: 18px; }

/* ==========================================================================
   Hero v3 — spacious, left-aligned, big bold headline, single device
   mockup on the right. No dramatic glow — clean and roomy.
   ========================================================================== */
.hero-v3 { padding: 120px 0 100px; }
.hero-v3-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: center;
}
.hero-v3 h1 {
  font-size: clamp(2.6rem, 5.2vw, 4.4rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 22px 0 28px;
}
.hero-v3 h1 .accent { color: var(--amber); display: block; }
.hero-v3 .lead { font-size: 1.15rem; max-width: 48ch; margin-bottom: 40px; color: var(--text-muted); }
.hero-v3-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 56px; }

/* Phone device mockup */
.phone-mock {
  position: relative;
  margin: 0 auto;
  width: 260px;
  background: #050607;
  border: 6px solid #1B2028;
  border-radius: 34px;
  padding: 14px 12px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(1,88,219,0.08);
  transform: rotate(3deg);
}
.phone-mock::before {
  content: '';
  position: absolute;
  top: 20px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 5px; border-radius: 3px;
  background: #1B2028;
}
.phone-screen {
  background: var(--panel);
  border-radius: 20px;
  padding: 34px 14px 16px;
  font-family: var(--font-mono);
}
.phone-screen-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.phone-screen-head .pair { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--text); }
.phone-screen-head .badge { font-size: 0.6rem; }

.phone-chart { height: 90px; display: flex; align-items: flex-end; gap: 4px; margin-bottom: 14px; padding: 0 2px; }
.phone-chart span { flex: 1; border-radius: 1px; }
.phone-chart .up { background: var(--up); }
.phone-chart .down { background: var(--down); }

.phone-price { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--text); margin-bottom: 2px; }
.phone-change { font-size: 0.75rem; color: var(--up); margin-bottom: 16px; }

.phone-actions { display: flex; gap: 8px; }
.phone-actions span { flex: 1; text-align: center; padding: 10px 0; border-radius: 8px; font-size: 0.75rem; font-weight: 700; }
.phone-actions .buy { background: var(--up); color: #0A0C0F; }
.phone-actions .sell { background: var(--down); color: #0A0C0F; }

.hero-v3-badge {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--hairline-bright);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  box-shadow: 0 16px 36px rgba(0,0,0,0.5);
}
.hero-v3-badge-1 { top: 10%; left: -10%; transform: rotate(-4deg); }
.hero-v3-badge-2 { bottom: 6%; right: -8%; transform: rotate(3deg); }
.hero-v3-visual { position: relative; }

@media (max-width: 900px) {
  .hero-v3-grid { grid-template-columns: 1fr; }
  .hero-v3-badge { display: none; }
  .hero-v3 { padding: 70px 0 60px; }
}

/* Show the username badge next to the nav avatar only when there's room */
@media (min-width: 1300px) {
  #navUsernameBadge { display: inline-block !important; }
}

/* ==========================================================================
   Profile page
   ========================================================================== */
.profile-banner { margin-bottom: 28px; }
.profile-banner-top { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.profile-banner-avatar .avatar-lg { box-shadow: 0 0 0 3px var(--ink), 0 0 0 4px var(--amber); }
.profile-banner-tiles { grid-template-columns: repeat(3, 1fr); }

.profile-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}
.profile-section-icon {
  font-size: 1.4rem;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--panel-raised);
  border: 1px solid var(--hairline-bright);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.avatar-upload-row { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.avatar-upload-wrap {
  position: relative;
  display: block;
  width: 84px; height: 84px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.avatar-upload-wrap .avatar-lg { width: 84px; height: 84px; }
.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(10,12,15,0.72);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.avatar-upload-wrap:hover .avatar-upload-overlay { opacity: 1; }

@media (max-width: 640px) {
  .profile-banner-tiles { grid-template-columns: 1fr 1fr; }
  .profile-banner-tiles .tile:last-child { grid-column: 1 / -1; }
}

/* ==========================================================================
   Members chat / chart room
   ========================================================================== */
.chat-feed {
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: 4px;
}
.chat-message { display: flex; gap: 12px; }
.chat-message-body { flex-grow: 1; min-width: 0; }
.chat-message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.chat-message-head span:first-child { color: var(--text); font-weight: 600; }
.chat-message-body p { margin: 0 0 8px; color: var(--text-muted); white-space: pre-line; }
.chat-attachment-img {
  max-width: 280px;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--hairline-bright);
  object-fit: cover;
}
