/* ─── VARIABLES ─── */
:root {
  --black: #080808;
  --dark: #0f0f0f;
  --card: #141414;
  --border: #1e1e1e;
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-dim: rgba(201,168,76,0.12);
  --green: #22c55e;
  --red: #ef4444;
  --text: #e8e8e8;
  --muted: #666;
  --mono: 'DM Mono', monospace;
  --sans: 'DM Sans', sans-serif;
  --display: 'Bebas Neue', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
}

/* ─── MOBILE UX GLOBAL ─── */
@media (max-width: 768px) {
  /* Smooth momentum scrolling */
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  * { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }

  /* Prevent double-tap zoom */
  button, a, [onclick] { touch-action: manipulation; }

  /* Smooth transitions on interactive elements */
  button, a, .filter-btn, .page-btn, .nav-toggle,
  .week-card-header, .sum-card, .s-card, .dash-card { 
    transition: background 0.15s ease, color 0.15s ease,
                border-color 0.15s ease, opacity 0.15s ease !important;
  }

  /* Active press feedback */
  .filter-btn:active     { opacity: 0.65 !important; transform: scale(0.96) !important; }
  .page-btn:active       { opacity: 0.65 !important; transform: scale(0.96) !important; }
  .badge-ticker:active   { opacity: 0.65 !important; transform: scale(0.94) !important; }
  .pred-ticker:active    { opacity: 0.65 !important; }
  .week-card-header:active { background: rgba(201,168,76,0.04) !important; }
  tbody tr:active td     { background: rgba(201,168,76,0.06) !important; }

  /* Touch targets — comfortable tap areas */
  .filter-btn     { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
  .page-btn       { min-height: 36px; min-width: 36px; }
  .nav-toggle     { min-height: 44px; min-width: 44px; }
  .nav-links a    { padding: 10px 0 !important; min-height: 44px; display: flex; align-items: center; }

  /* Table: smooth horizontal scroll, no bounce */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
  }
  /* Subtle scrollbar on mobile */
  .table-wrap::-webkit-scrollbar { height: 2px; }
  .table-wrap::-webkit-scrollbar-track { background: transparent; }
  .table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 1px; }

  /* Modal slide-up animation */
  .ticker-modal, .stm-modal {
    will-change: transform;
    transform: translateZ(0);
  }

  /* Scrollable modal content — smooth & contained */
  .ticker-modal-scrollable, .stm-scrollable {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    scroll-behavior: smooth !important;
  }

  /* Modal overlay — tap outside to close */
  .ticker-modal-overlay, .stats-ticker-modal-overlay {
    cursor: pointer;
  }
  .ticker-modal, .stm-modal {
    cursor: default;
  }

  /* Week cards expand — smooth */
  .week-body { transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important; }

  /* Search & select — better mobile input */
  input, select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    border-radius: 0 !important;
  }
  input:focus, select:focus {
    outline: 1px solid var(--gold) !important;
    outline-offset: 0 !important;
  }

  /* Sticky table header — stays while scrolling */
  thead th { position: sticky; top: 0; z-index: 10; }

  /* Row hover area — bigger for touch */
  tbody tr { cursor: pointer; }

  /* Chart containers — no overflow bleed */
  .ticker-chart-inner, .stm-chart-inner {
    touch-action: pan-x pan-y !important;
    overflow: hidden !important;
  }
}

/* ─── NOISE OVERLAY ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ─── NAV ─── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  background: rgba(8,8,8,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--gold);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active { color: var(--gold); }

.nav-cta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--black);
  padding: 10px 20px;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
}

.nav-cta:hover { background: var(--gold-light); transform: translateY(-1px); }

/* ─── NAV SOCIAL ICONS ─── */
.nav-socials {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 16px;
}

.nav-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  text-decoration: none;
  transition: all 0.25s;
  font-size: 12px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  background: rgba(201,168,76,0.04);
  position: relative;
  overflow: hidden;
}

.nav-social-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.25s;
  z-index: 0;
}

.nav-social-btn:hover::before { transform: scaleY(1); }

.nav-social-btn:hover {
  color: var(--black);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(201,168,76,0.3);
}

.nav-social-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  position: relative;
  z-index: 1;
}

.nav-social-btn span {
  position: relative;
  z-index: 1;
}

/* ─── WHOP BUTTON SPECIFIC ─── */
.whop-btn {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 2px;
}

/* ─── FOOTER SOCIAL LINKS ─── */
.footer-social-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-social-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: all 0.2s;
  background: rgba(201,168,76,0.03);
}

.footer-social-link:hover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

.footer-social-link svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* ─── MOBILE NAV TOGGLE ─── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--muted);
  transition: all 0.3s;
}

/* ─── SECTIONS ─── */
section { padding: 44px 64px; }

.section-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(40px, 5vw, 72px);
  letter-spacing: 3px;
  line-height: 1;
  margin-bottom: 12px;
}

.section-sub {
  font-size: 16px;
  color: var(--muted);
  font-weight: 300;
  max-width: 560px;
  line-height: 1.7;
}

.section-header { margin-bottom: 32px; }

/* ─── BUTTONS ─── */
.btn-primary {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--black);
  padding: 16px 36px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  display: inline-block;
}

.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(201,168,76,0.25); }

.btn-secondary {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: transparent;
  color: var(--gold);
  padding: 16px 36px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.2s;
  display: inline-block;
}

.btn-secondary:hover { border-color: var(--gold); background: var(--gold-dim); }

/* ─── PILLS ─── */
.pill {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 16px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.pill.gold { border-color: var(--gold-dim); color: var(--gold); }

/* ─── BADGES ─── */
.badge-ticker {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
  padding: 5px 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-family: var(--display);
  border: 1px solid var(--gold-dim);
}

.badge-direction {
  padding: 5px 12px;
  font-size: 12px;
  letter-spacing: 1px;
  font-family: var(--mono);
  font-weight: 600;
}

.badge-bullish { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.badge-bearish { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

.badge-conf {
  font-size: 12px;
  padding: 4px 12px;
  border: 1px solid;
  font-family: var(--mono);
  font-weight: 700;
}

.conf-a { border-color: var(--gold-dim); color: var(--gold); background: rgba(201,168,76,0.08); }
.conf-b { border-color: rgba(255,255,255,0.15); color: #ccc; background: rgba(255,255,255,0.04); }
.conf-c { border-color: rgba(255,255,255,0.08); color: #888; background: rgba(255,255,255,0.02); }

.badge-result {
  font-size: 11px;
  padding: 3px 10px;
  letter-spacing: 1px;
  font-weight: 500;
  font-family: var(--mono);
}

.result-hit { background: rgba(34,197,94,0.1); color: var(--green); }
.result-miss { background: rgba(239,68,68,0.08); color: var(--red); }
.result-pending { background: rgba(255,255,255,0.04); color: var(--muted); }

.actual-pos { color: var(--green); }
.actual-neg { color: var(--red); }

/* ─── TICKER TAPE ─── */
.ticker-wrap {
  overflow: hidden;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  position: relative;
  margin: 0;
}

.ticker-inner {
  display: flex;
  gap: 8px;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
}

.ticker-item {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticker-item .t-ticker { color: var(--gold); font-weight: 500; }
.ticker-item .t-hit { color: var(--green); }
.ticker-item .t-miss { color: var(--red); }
.ticker-item .t-dot { color: var(--border); }

/* ─── LOADING ─── */
.stats-loading {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ─── DATA SOURCE NOTE ─── */
.data-source-note {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── LIVE DOT ─── */
.live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 8px;
  animation: pulse 2s ease-in-out infinite;
}

/* ─── ERROR STATE ─── */
.error-state {
  text-align: center;
  padding: 60px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy {
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 16px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.5px;
}

footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover { color: var(--gold); }

/* ─── PAGE HERO (for inner pages) ─── */
.page-hero {
  padding: 96px 64px 52px;
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201,168,76,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.page-hero .section-tag { margin-bottom: 16px; }
.page-hero .section-title { margin-bottom: 16px; }


/* ─── SKELETON LOADING ─── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #242424 50%, #1a1a1a 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 2px;
  display: inline-block;
}

.skeleton-text  { height: 14px; width: 80px;  }
.skeleton-num   { height: 36px; width: 100px; }
.skeleton-wide  { height: 14px; width: 140px; }

/* ─── STATS LOADING STATE ─── */
.stat-val-loading {
  display: inline-block;
  width: 90px;
  height: 32px;
  background: linear-gradient(90deg, #1a1a1a 25%, #242424 50%, #1a1a1a 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 2px;
  vertical-align: middle;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}




/* ══════════════════════════════════════════
   RESPONSIVE — نظيف وواضح
   ══════════════════════════════════════════ */

html, body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }

/* ── Hide subtitles under numbers ── */
.dash-sub, .sum-sub, .conf-stats,
.s-sub, .be-sts, .stat-sub,
.period-detail { display: none !important; }

/* ── Hide on mobile only ── */
@media (max-width: 768px) {
  .mobile-hide { display: none !important; }
}

/* ── Weekly hero stats grid ── */
.wkly-hero-stats {
  margin-top: 20px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.wkly-stat { display: flex; flex-direction: column; gap: 4px; }
.wkly-num {
  font-family: var(--display);
  font-size: 28px;
  color: var(--text);
}
.wkly-num.gold { color: var(--gold); }
.wkly-num.green { color: var(--green); }
.wkly-num.red { color: var(--red); }
.wkly-lbl {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ══ 768px ══ */
@media (max-width: 768px) {

  /* ── nav ── */
  nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: fixed; top: 64px; left: 0; right: 0;
    background: rgba(8,8,8,0.98);
    padding: 20px 24px; gap: 18px;
    border-bottom: 1px solid var(--border); z-index: 99;
  }
  .nav-toggle { display: flex; }
  .nav-socials { display: none; }
  .nav-cta { font-size: 9px; padding: 8px 14px; }

  /* ── sections: تقليل padding ── */
  section, .stat-section { padding: 24px 14px !important; }
  .page-hero { padding: 88px 14px 28px !important; display: block !important; min-height: auto !important; }
  .hero-logo-side { display: none !important; }
  .page-hero-content, .hero-content { width: 100% !important; }
  .about-image-wrap { display: none !important; }
  .about-grid { grid-template-columns: 1fr !important; }
  .section-header { margin-bottom: 16px !important; }
  .section-title { font-size: clamp(26px, 7vw, 38px) !important; letter-spacing: 1px !important; }
  .section-sub { font-size: 13px !important; margin-top: 8px !important; }

  /* ── dashboard: 3 cols ── */
  .dashboard-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 2px !important; }
  .dash-card { padding: 10px 8px !important; }
  .dash-value { font-size: 20px !important; letter-spacing: 0 !important; }
  .dash-label { font-size: 6.5px !important; letter-spacing: 1px !important; margin-bottom: 4px !important; }

  /* ── period: 3 cols ── */
  .period-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 2px !important; }
  .period-card { padding: 10px 8px !important; }
  .period-value { font-size: 18px !important; }
  .period-label { font-size: 6.5px !important; letter-spacing: 1px !important; }

  /* ── confidence A B C ── */
  .confidence-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 2px !important; margin-top: 12px !important; }
  .conf-card { padding: 12px 8px !important; }
  .conf-grade { font-size: 28px !important; }
  .conf-rate { font-size: 16px !important; }
  .conf-bar-wrap { margin: 6px 0 !important; }

  /* ── summary (track record): نفس تصميم dash-card ── */
  .summary-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 2px !important; }
  .sum-card { padding: 10px 8px !important; }
  .sum-value { font-family: var(--display) !important; font-size: 20px !important; letter-spacing: 0 !important; line-height: 1 !important; }
  .sum-label { font-family: var(--mono) !important; font-size: 6.5px !important; letter-spacing: 1.5px !important; margin-bottom: 4px !important; color: var(--muted) !important; }

  /* ── period inline grids (track-record): 3 cols ── */
  [style*="grid-template-columns:repeat(3,1fr)"] {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  [style*="grid-template-columns:repeat(3,1fr)"] .sum-card {
    padding: 10px 8px !important;
  }
  [style*="grid-template-columns:repeat(3,1fr)"] .sum-value {
    font-size: 18px !important;
  }

  /* ── statistics cards: نفس تصميم dash-card ── */
  .cards-row { grid-template-columns: repeat(3, 1fr) !important; gap: 2px !important; }
  .cards-row.col-4 { grid-template-columns: repeat(2, 1fr) !important; gap: 2px !important; }
  .s-card { padding: 10px 8px !important; }
  .s-value { font-family: var(--display) !important; font-size: 20px !important; letter-spacing: 0 !important; line-height: 1 !important; }
  .s-label { font-family: var(--mono) !important; font-size: 6.5px !important; letter-spacing: 1.5px !important; margin-bottom: 4px !important; color: var(--muted) !important; }

  /* period 30/60/90 و grades: مضمون 3 cols */
  .period-3-row, .grade-3-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2px !important;
  }
  .period-3-row .s-card, .grade-3-row .s-card {
    padding: 10px 8px !important;
    min-width: 0 !important;
  }
  .period-3-row .s-value, .grade-3-row .s-value {
    font-family: var(--display) !important;
    font-size: 18px !important;
    letter-spacing: 0 !important;
  }
  .period-3-row .s-label, .grade-3-row .s-label {
    font-family: var(--mono) !important;
    font-size: 6.5px !important;
    letter-spacing: 1px !important;
    margin-bottom: 4px !important;
  }
  /* إخفاء الـ bar وsub في الـ grade cards على الجوال */
  .grade-3-row .grade-bar-track, .grade-3-row .s-sub { display: none !important; }

  /* ── beyond earnings ── */
  .be-sg, .be-sg2 { grid-template-columns: repeat(3, 1fr) !important; gap: 2px !important; }
  .be-ag { grid-template-columns: 1fr !important; }
  .be-st { padding: 10px 8px !important; }
  .be-stv { font-size: 18px !important; }
  .be-stl { font-size: 6.5px !important; }

  /* ── live forecasts ── */
  #predSummaryGrid { grid-template-columns: repeat(3, 1fr) !important; gap: 2px !important; }

  /* ── how it works ── */
  .how-steps { grid-template-columns: repeat(2, 1fr) !important; gap: 2px !important; }
  .how-step { padding: 14px 10px !important; }
  .step-num { font-size: 32px !important; margin-bottom: 8px !important; }

  /* ── recent ── */
  .recent-grid { grid-template-columns: 1fr !important; }
  .recent-card { padding: 12px !important; }

  /* ── schedule ── */
  .sched-week-bar, .sched-sessions-row, .sched-tickers-grid { display: none !important; }
  #schedMobileDays { display: block !important; }
  .schedule-header { flex-direction: column !important; gap: 8px !important; }

  /* ── buttons ── */
  .btn-primary, .btn-secondary { padding: 10px 16px !important; font-size: 10px !important; }

  /* ── footer ── */
  footer { padding: 20px 14px 16px !important; }
  .footer-top { flex-direction: column !important; gap: 10px !important; }
  .footer-social-links { flex-wrap: wrap !important; gap: 6px !important; }
  .footer-copy { flex-direction: column !important; gap: 4px !important; font-size: 9px !important; }

  /* ── UX ── */
  .btn-primary, .btn-secondary, a { -webkit-tap-highlight-color: transparent; }
  body { -webkit-text-size-adjust: 100%; }

  /* ── ticker modal — نفس اللابتوب على الموبايل ── */
  .ticker-modal-overlay { padding: 0 !important; align-items: flex-end !important; }
  .ticker-modal { border-radius: 0 !important; height: auto !important; max-height: 92vh !important; width: 100% !important; max-width: 100% !important; }
  .ticker-modal-header { padding: 12px 16px !important; }
  .ticker-modal-symbol { font-size: 22px !important; letter-spacing: 2px !important; }
  .ticker-modal-price .price-val { font-size: 18px !important; }
  .ticker-modal-price .price-chg { font-size: 10px !important; }
  .ticker-modal-row { display: grid !important; grid-template-columns: 1fr 1fr !important; border-bottom: 1px solid var(--border) !important; gap: 0 !important; }
  .ticker-modal-stat { padding: 14px 16px !important; border-right: 1px solid var(--border) !important; background: transparent !important; border-radius: 0 !important; border-top: none !important; border-left: none !important; border-bottom: none !important; }
  .ticker-modal-stat:last-child { border-right: none !important; }
  /* يغطي كلا الـ selectors: مباشر ومتداخل */
  .stat-label,
  .ticker-modal-stat .stat-label { font-size: 8px !important; letter-spacing: 1.5px !important; margin-bottom: 6px !important; }
  .stat-val,
  .ticker-modal-stat .stat-val { font-size: 20px !important; letter-spacing: 0.5px !important; line-height: 1 !important; }
  .ticker-modal-history-header { padding: 10px 16px !important; font-size: 8px !important; }
  .ticker-modal-history-row { padding: 9px 16px !important; font-size: 10px !important; gap: 6px !important; grid-template-columns: 52px 1fr 1fr 70px !important; }
  .ticker-chart-inner { height: 220px !important; }
}

/* ══ 480px ══ */
@media (max-width: 480px) {

  nav { padding: 12px 16px; }
  .nav-logo { font-size: 16px; }
  .nav-cta { display: none; }

  section, .stat-section { padding: 28px 14px; }
  .page-hero { padding: 88px 14px 32px !important; }
  #hero { padding: 88px 14px 32px !important; }
  .section-title { font-size: clamp(24px, 7vw, 36px) !important; }

  .dashboard-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .dash-card { padding: 12px 8px !important; }
  .dash-value { font-size: 24px !important; }

  .period-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .period-card { padding: 10px 6px !important; }
  .period-value { font-size: 18px !important; }
  .period-label { font-size: 6px !important; }

  .confidence-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .conf-card { padding: 10px 6px !important; }
  .conf-grade { font-size: 26px !important; }
  .conf-rate { font-size: 14px !important; }

  .wkly-hero-stats { grid-template-columns: repeat(3, 1fr) !important; }
  .wkly-num { font-size: 18px !important; }

  .summary-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .cards-row { grid-template-columns: repeat(2, 1fr) !important; }
  .cards-row.col-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .be-sg, .be-sg2 { grid-template-columns: repeat(2, 1fr) !important; }
  .how-steps { grid-template-columns: 1fr !important; }
  #predSummaryGrid { grid-template-columns: repeat(2, 1fr) !important; }

  .btn-primary, .btn-secondary {
    display: block !important; width: 100% !important;
    text-align: center !important; margin-bottom: 8px !important;
    padding: 12px 14px !important; font-size: 10px !important;
  }

  footer { padding: 20px 14px 16px !important; }
  .ticker-modal-row { grid-template-columns: 1fr 1fr !important; gap: 0 !important; }
  .ticker-modal-stat { padding: 12px 12px !important; border-right: 1px solid var(--border) !important; background: transparent !important; border-top: none !important; border-left: none !important; border-bottom: none !important; }
  .ticker-modal-stat:last-child { border-right: none !important; }
  .stat-val, .ticker-modal-stat .stat-val { font-size: 18px !important; }
}


/* ══════════════════════════════════════════
   DESKTOP SPACING REFINEMENT (≥ 769px only)
   ══════════════════════════════════════════ */
@media (min-width: 769px) {
  /* ── Hero — توحيد كل صفحة ── */
  .page-hero,
  #track-hero,
  #be-hero,
  #hero {
    padding-top: 128px !important;
    padding-bottom: 52px !important;
  }

  /* ── Sections ── */
  section:not(#hero):not(#track-hero),
  .stat-section {
    padding-top: 44px !important;
    padding-bottom: 44px !important;
  }

  /* ── beyond sections ── */
  #be-stats,
  #be-accuracy,
  #be-monthly,
  #be-chips,
  #be-tbl,
  #be-access {
    padding-top: 44px !important;
    padding-bottom: 44px !important;
  }

  /* ── section header spacing ── */
  .section-tag      { margin-bottom: 10px !important; }
  .section-title    { margin-bottom: 10px !important; }
  .section-header   { margin-bottom: 28px !important; }

  /* ── page-hero inner text ── */
  .page-hero .section-tag,
  #track-hero .section-tag,
  #be-hero .be-badge     { margin-bottom: 12px !important; }

  .page-hero .section-title,
  #track-hero .section-title { margin-bottom: 12px !important; }

  .page-hero .section-sub,
  #track-hero .section-sub   { margin-top: 8px !important; margin-bottom: 0 !important; }

  /* ── gap بين hero والقسم التالي ── */
  .page-hero + *,
  #track-hero + *,
  #be-hero + * { margin-top: 0 !important; }
}

/* ─── PERFORMANCE: Card Reveal (IntersectionObserver) ─── */
.card-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.38s ease, transform 0.38s ease;
  will-change: opacity, transform;
}
.card-reveal.card-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── PERFORMANCE: Skeleton loading placeholder ─── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 4px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── PERFORMANCE: content-visibility for off-screen sections ─── */
@media (min-width: 769px) {
  .cv-auto {
    content-visibility: auto;
    contain-intrinsic-size: 0 400px;
  }
}

/* ─── PERFORMANCE: Reduce paint on hover ─── */
.recent-card,
.week-card,
.conf-card {
  transform: translateZ(0);
  backface-visibility: hidden;
}
