/* ============================================================
   SPREADLY — "GLACIER" DESIGN SYSTEM  ·  v2
   Visual layer only. Loads after each page's inline styles and
   re-skins them through the shared CSS-variable vocabulary.
   No selectors that JS depends on are removed or renamed.

   Direction: premium glacial fintech. Ice-white surfaces,
   aurora gradients (sky / violet / teal), measured glassmorphism,
   Inter type + JetBrains Mono data, AA contrast,
   150–420ms motion on a single easing curve.
   ============================================================ */

/* ─────────────────────────────────────────────
   1 · TOKENS
   Redefines each page's local vocabulary (--bg, --primary, …)
   plus the rates/rules vocabulary (--background, --muted, …)
   and adds the --cex-* system scale.
   ───────────────────────────────────────────── */
:root {
  /* backgrounds & surfaces */
  --bg:            #FFFFFF;
  --bg-alt:        #F5F7FA;
  --surface:       #FFFFFF;
  --surface-2:     #F5F7FA;
  --surface-3:     #E8EEFF;

  /* text */
  --text:          #0A0B0D;
  --text-2:        #3A3C42;
  --text-muted:    #5B6068;
  --text-on-primary:#FFFFFF;

  /* brand */
  --primary:       #0052FF;
  --primary-hover: #0045D8;
  --primary-active:#0038B0;
  --primary-soft:  #E8EEFF;
  --primary-text:  #0045D8;

  /* borders */
  --border:        #DEE1E6;
  --border-soft:   #EEF2F7;
  --border-strong: #C9D6E5;

  /* inputs */
  --input-bg:      #FFFFFF;
  --input-border:  #C9D6E5;
  --input-focus:   #0052FF;
  --ring:          0 0 0 4px rgba(0,82,255,.16);

  /* status */
  --success:       #12A150;  --success-soft: #E6F7EE;
  --danger:        #E0304A;  --danger-soft:  #FDEBEE;
  --warning:       #D97706;  --warning-soft: #FEF3E2;

  /* radii */
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 24px; --r-pill: 999px;

  /* shadows */
  --shadow-xs: 0 1px 2px rgba(10,11,13,.04);
  --shadow-sm: 0 2px 8px rgba(10,11,13,.04);
  --shadow-md: 0 8px 24px rgba(7,21,43,.18);
  --shadow-lg: 0 16px 36px rgba(7,21,43,.22);

  /* motion */
  --ease: cubic-bezier(.22,1,.36,1); --fast:160ms; --med:240ms;

  /* fonts */
  --ff:      -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ============ LEGACY ALIASES (keep other pages working) ============ */
  --card:            var(--surface);
  --card-hi:         var(--surface-2);
  --foreground:      var(--text);
  --foreground-2:    var(--text-2);
  --muted-fg:        var(--text-muted);

  --sky-1:           var(--primary-soft);
  --sky-2:           var(--primary);
  --sky-3:           var(--surface-2);
  --primary-deep:    var(--primary-active);

  --background:        var(--bg);
  --bg-soft:           var(--surface-2);
  --muted:             var(--surface-2);
  --muted-foreground:  var(--text-muted);
  --primary-foreground:var(--text-on-primary);
  --accent-soft:       var(--primary-soft);
  --emerald:           var(--success);
  --red:               var(--danger);
  --warm:              var(--warning);

  --cex-navy:      var(--text);
  --cex-ink:       var(--text);
  --cex-blue:      var(--primary);
  --cex-blue-2:    var(--primary-hover);
  --cex-violet:    var(--primary);
  --cex-teal:      var(--success);
  --cex-sky:       var(--bg-alt);
  --cex-sky-2:     var(--surface-2);
  --cex-line:      var(--border-strong);
  --cex-line-soft: var(--border);

  /* Glassmorphism removed — flattened to solid values */
  --cex-glass:        #FFFFFF;
  --cex-glass-strong: #FFFFFF;
  --cex-glass-line:   var(--border);
  --cex-glass-edge:   var(--border-strong);
  --cex-blur:         none;

  /* Gradient CTAs/lines flattened to solid brand color */
  --cex-cta:         var(--primary);
  --cex-cta-hover:   var(--primary-hover);
  --cex-aurora-line: var(--primary);

  --cex-r-xs: var(--r-xs);
  --cex-r-sm: var(--r-sm);
  --cex-r-md: var(--r-md);
  --cex-r-lg: var(--r-lg);
  --cex-r-xl: var(--r-xl);
  --radius:    var(--r-lg);
  --radius-sm: var(--r-sm);

  --cex-shadow-xs: var(--shadow-xs);
  --cex-shadow-sm: var(--shadow-sm);
  --cex-shadow:    var(--shadow-md);
  --cex-shadow-lg: var(--shadow-lg);
  --cex-glow:      var(--shadow-md);

  --cex-ease:      var(--ease);
  --cex-ease-in:   cubic-bezier(0.55, 0, 0.55, 0.2);
  --cex-fast:      var(--fast);
  --cex-med:       var(--med);
  --cex-slow:      420ms;

  accent-color: var(--primary-active);
}

/* ─────────────────────────────────────────────
   2 · BASE & AURORA CANVAS
   ───────────────────────────────────────────── */
html {
  scroll-padding-top: 96px;
}

body {
  background-color: var(--bg);
}

::selection {
  background: var(--primary-active);
  color: var(--text-on-primary);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* JS-injected ambient canvas — decorative aurora/glow effects removed for
   the flat design system; element kept (JS still creates it) but hidden. */
.cex-aurora {
  display: none;
}

/* ─────────────────────────────────────────────
   3 · TYPOGRAPHY RHYTHM
   ───────────────────────────────────────────── */
.hero-h1,
.sec-h2,
.hero-title,
.login-title,
.page-title,
.markets-h1,
.cta-big h2 {
  letter-spacing: -0.035em !important;
  text-wrap: balance;
}

.hero-h1 { line-height: 1.03 !important; }
.sec-h2  { line-height: 1.08 !important; }

.b-title,
.price-num,
.stat .n,
.stat-value {
  letter-spacing: -0.015em !important;
}

.hero-sub,
.sec-lead,
.markets-sub,
.login-subtitle,
.lead {
  color: var(--muted-fg) !important;
  line-height: 1.66 !important;
  text-wrap: pretty;
}

/* Data is always tabular */
.px, .ch, .chg, .price, .delta, .v, .n,
.stat .n, .price-num, .mc, .vol, .pct,
.hm-balance, .hm-coin-amt, .hm-coin-usd,
.modal-price, .rate-line, .usd, .bal,
.t-pill .px, .t-pill .ch {
  font-variant-numeric: tabular-nums lining-nums;
}

/* Gradient accent for display headlines */
.hero-h1 .accent,
.sec-h2 .accent,
.cta-big h2 .accent,
.logo .accent,
.markets-h1 .accent,
.hero-title .accent {
  color: var(--primary) !important;
}

/* Eyebrows / kickers / tags */
.hero-eyebrow,
.sec-tag,
.eyebrow,
.input-label,
.cex-kicker {
  letter-spacing: 0.15em !important;
  font-weight: 700;
}

/* ─────────────────────────────────────────────
   4 · NAV — frosted glass bar
   ───────────────────────────────────────────── */
.nav,
header.site-header,
.header {
  background: var(--cex-glass) !important;
  border-bottom: 1px solid rgba(201, 214, 229, 0.35) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 10px 34px rgba(10, 11, 13, 0.05);
}

.nav-inner,
.header-inner {
  min-height: 72px;
}

.nav-links a,
.nav-item,
.logout-btn,
.foot-col a,
.team-link {
  transition:
    color var(--cex-fast) var(--cex-ease),
    background var(--cex-fast) var(--cex-ease),
    transform var(--cex-fast) var(--cex-ease),
    border-color var(--cex-fast) var(--cex-ease),
    box-shadow var(--cex-fast) var(--cex-ease);
}

.nav-links a {
  position: relative;
  letter-spacing: 0 !important;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  border-radius: 999px;
  background: var(--cex-aurora-line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--cex-med) var(--cex-ease);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-links a.active { color: var(--primary-deep) !important; }

/* Brand lockup */
.cex-logo-lockup {
  display: inline-flex !important;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--cex-ink);
  text-decoration: none;
  letter-spacing: 0 !important;
}

.cex-logo-mark {
  width: 56px;
  height: 37px;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(0,82,255, 0.22);
}

.cex-logo-copy { display: grid; gap: 1px; line-height: 1; min-width: 0; }

.cex-logo-copy strong {
  display: block;
  color: var(--cex-navy);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em !important;
  white-space: nowrap;
}

.cex-logo-copy span {
  display: block;
  color: var(--primary-deep);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────
   5 · BUTTONS — one system, springy, ≥44px
   ───────────────────────────────────────────── */
.btn,
.hm-btn,
.sm-buy,
.paywall-btn,
.tg-button,
.cookie-actions button,
.foot-news button,
.btc-copy-btn,
.swap-cta,
.swap-btn,
.modal-actions .btn {
  position: relative;
  isolation: isolate;
  border-radius: var(--r-pill) !important;
  letter-spacing: 0 !important;
  min-height: 44px;
  transition:
    transform var(--cex-fast) var(--cex-ease),
    box-shadow var(--cex-med) var(--cex-ease),
    background var(--cex-med) var(--cex-ease),
    border-color var(--cex-fast) var(--cex-ease),
    color var(--cex-fast) var(--cex-ease),
    opacity var(--cex-fast) var(--cex-ease);
}

/* sheen sweep on hover */
.btn::before,
.hm-btn::before,
.tg-button::before,
.swap-cta::before,
.foot-news button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  display: none;
}

.btn:hover::before,
.hm-btn:hover::before,
.tg-button:hover::before,
.swap-cta:hover::before,
.foot-news button:hover::before {
  opacity: 1;
  background-position: -30% 0;
}

.btn:hover,
.hm-btn:hover,
.sm-buy:hover,
.paywall-btn:hover,
.tg-button:hover,
.cookie-actions button:hover,
.foot-news button:hover,
.btc-copy-btn:hover {
  transform: translateY(-2px);
}

.btn:active,
.hm-btn:active,
.sm-buy:active,
.paywall-btn:active,
.tg-button:active,
.cookie-actions button:active,
.foot-news button:active,
.btc-copy-btn:active,
.swap-cta:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 80ms;
}

.btn-primary,
.hm-btn.primary,
.foot-news button,
.cookie-actions .primary,
.paywall-btn,
.tg-button,
.swap-cta,
.swap-btn {
  background: var(--cex-cta) !important;
  color: var(--text-on-primary) !important;
  border-color: transparent !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, var(--cex-glow) !important;
}

.btn-primary:hover,
.hm-btn.primary:hover,
.tg-button:hover,
.swap-cta:hover:not(:disabled) {
  background: var(--cex-cta-hover) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 16px 40px rgba(0, 71, 214, 0.42) !important;
}

.btn-outline,
.btn-ghost,
.hm-btn.outline,
.app-badge,
.lang-switcher button,
.reg-badge,
.status-pill {
  background: var(--cex-glass-strong) !important;
  border-color: var(--cex-glass-edge) !important;
  color: var(--primary-text) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, var(--cex-shadow-xs) !important;
}

.btn-outline:hover,
.btn-ghost:hover,
.hm-btn.outline:hover {
  border-color: var(--primary) !important;
  background: var(--surface) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 1) inset, var(--cex-shadow-sm) !important;
}

.lang-switcher button.active {
  background: var(--cex-cta) !important;
  color: var(--text-on-primary) !important;
  border-color: transparent !important;
}

/* Disabled — quiet, unmistakable */
.btn:disabled,
.swap-cta:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
  box-shadow: none !important;
  filter: saturate(0.35);
}

/* ─────────────────────────────────────────────
   6 · FOCUS — visible, branded
   ───────────────────────────────────────────── */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid rgba(0, 71, 214, 0.5) !important;
  outline-offset: 2px;
  border-radius: var(--cex-r-xs);
}

.skip-link:focus-visible {
  background: var(--cex-navy);
  color: var(--text-on-primary);
}

/* ─────────────────────────────────────────────
   7 · GLASS CARDS — the system surface
   ───────────────────────────────────────────── */
.bento-card,
.bento-strip,
.show-row,
.showcase-mock,
.sec-card,
.step-card,
.test-card,
.price-card,
.faq-item,
.card,
.stat-card,
.score-card,
.risk-sources,
.info-card,
.login-card,
.paywall-card,
.movers-card,
.swap-card,
.panel,
.stats-band,
.hero-inner {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--cex-r-lg) !important;
  box-shadow: var(--cex-shadow-sm);
  transition:
    transform var(--cex-med) var(--cex-ease),
    box-shadow var(--cex-med) var(--cex-ease),
    border-color var(--cex-med) var(--cex-ease);
}

.bento-card:hover,
.show-row:hover,
.sec-card:hover,
.step-card:hover,
.test-card:hover,
.price-card:hover,
.card:hover,
.stat-card:hover,
.movers-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,82,255, 0.55) !important;
  box-shadow:
    0 1px 0 var(--cex-glass-line) inset,
    var(--cex-shadow) !important;
}

/* top aurora hairline on hover */
.bento-card,
.test-card,
.movers-card,
.swap-card {
  position: relative;
  overflow: hidden;
}

/* price-card keeps its "Most popular" ribbon outside the box —
   no overflow clipping, hairline is inset instead */
.price-card {
  position: relative;
}

.bento-card::after,
.price-card::after,
.test-card::after,
.movers-card::after,
.swap-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 1.4rem;
  right: 1.4rem;
  height: 2px;
  border-radius: 999px;
  background: var(--cex-aurora-line);
  opacity: 0;
  transition: opacity var(--cex-med) var(--cex-ease);
  pointer-events: none;
}

.bento-card:hover::after,
.price-card:hover::after,
.test-card:hover::after,
.movers-card:hover::after,
.swap-card::after {
  opacity: 1;
}

/* Featured pricing card gets permanent aurora edge.
   The "Most popular" ribbon (page's own ::before, at top:-0.7rem) must
   sit ABOVE the aurora hairline (::after, at top:0) — order the pseudo
   layers by z-index so the line never crosses the ribbon text. */
.price-card.featured {
  border-color: rgba(0,82,255, 0.6) !important;
  box-shadow:
    0 1px 0 var(--cex-glass-line) inset,
    var(--cex-shadow) !important;
  margin-top: 0.7rem;            /* room for the ribbon above the edge */
}

.price-card.featured::before {
  z-index: 3;                    /* ribbon on top */
}

.price-card.featured::after {
  opacity: 1;
  z-index: 1;                    /* aurora line below the ribbon */
}

.hero-mock-card {
  border-radius: var(--cex-r-xl) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  box-shadow: var(--cex-shadow-lg) !important;
}

.hero-mock-mini {
  border-radius: var(--cex-r-md) !important;
  background: var(--cex-glass-strong) !important;
  border: 1px solid var(--cex-glass-edge) !important;
  box-shadow: var(--cex-shadow-sm) !important;
}

/* Pills stay round */
.hm-pill,
.hero-eyebrow,
.sec-tag,
.b-tag,
.chip,
.badge,
.refresh-pill,
.status-pill,
.reg-badge {
  border-radius: 999px !important;
}

.hero-eyebrow,
.sec-tag {
  background: var(--cex-glass-strong) !important;
  border: 1px solid var(--cex-glass-edge) !important;
  box-shadow: 0 6px 20px rgba(0,82,255, 0.12);
}

/* ─────────────────────────────────────────────
   7b · CARD FINISH — spotlight + aurora ring
   (adapted from 21st.dev Spotlight Card / Shine Border;
    both layers are JS-injected <i aria-hidden> children)
   ───────────────────────────────────────────── */
.cex-spot { position: relative; }

.cex-spot-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  display: none;
  transition: opacity var(--cex-med) var(--cex-ease);
}

.cex-spot:hover > .cex-spot-glow { opacity: 1; }

/* 1px aurora gradient ring via mask-composite */
.cex-ring {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  display: none;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0.5;
  transition: opacity var(--cex-med) var(--cex-ease);
}

.cex-spot:hover > .cex-ring,
.price-card.featured > .cex-ring { opacity: 0.85; }

/* keep card text above the glow */
.cex-spot > :not(.cex-spot-glow):not(.cex-ring) { position: relative; z-index: 1; }

/* ─────────────────────────────────────────────
   8 · FORMS — calm fields, visible states
   ───────────────────────────────────────────── */
input,
select,
textarea,
.input,
.sm-input,
.foot-news input {
  border-radius: var(--cex-r-sm) !important;
  transition:
    border-color var(--cex-fast) var(--cex-ease),
    box-shadow var(--cex-med) var(--cex-ease),
    background var(--cex-fast) var(--cex-ease);
}

input:focus,
select:focus,
textarea:focus,
.input:focus,
.sm-input:focus-within,
.foot-news input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(0,82,255, 0.16) !important;
  background: var(--surface) !important;
  outline: none !important;
}

.input { min-height: 48px; }
.input-row input, .input-row select { min-height: 44px; }

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

/* ─────────────────────────────────────────────
   9 · TABLES & MARKET DATA
   ───────────────────────────────────────────── */
thead th,
.strip-table .row.head {
  background: var(--surface-2) !important;
  color: var(--text-muted) !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-strong) !important;
}

tbody tr,
.strip-table .row {
  transition: background var(--cex-fast) var(--cex-ease);
}

.coin-icon {
  display: inline-block;
  width: 1.45em;
  height: 1.45em;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  filter: drop-shadow(0 4px 9px rgba(10, 11, 13, 0.14));
}

.ticker-icon { width: 22px; height: 22px; }
.t-pill { gap: 0.55rem !important; }

.market-cell .sym,
.strip-table .pair {
  display: inline-flex !important;
  align-items: center;
  gap: 0.56rem;
}

/* Up/down — color + weight, not color alone */
.up, .ch.up, .chg.up, .delta.up { font-weight: 700; }
.dn, .ch.dn, .chg.dn, .delta.dn { font-weight: 700; }

/* ─────────────────────────────────────────────
   10 · SKELETONS — aurora shimmer
   ───────────────────────────────────────────── */
.skel,
.skel-row,
.cex-skel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--bg-alt) 45%, var(--surface-2) 65%) !important;
  background-size: 220% 100% !important;
  animation: cexShimmer 1.4s linear infinite !important;
  border-radius: var(--cex-r-xs);
}

@keyframes cexShimmer {
  from { background-position: 120% 0; }
  to   { background-position: -120% 0; }
}

/* ─────────────────────────────────────────────
   11 · MODALS & OVERLAYS — blur scrim, spring in
   ───────────────────────────────────────────── */
.modal-bg,
.picker-bg,
.overlay,
.tg-popup-bg {
  background: rgba(10, 11, 13, 0.45) !important;
}

.modal,
.picker,
.tg-popup {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--cex-r-xl) !important;
  box-shadow: 0 24px 60px rgba(10, 11, 13, 0.18) !important;
}

.modal-bg.open .modal,
.modal-bg.active .modal,
.picker-bg.open .picker,
.picker-bg.active .picker,
.overlay.active .tg-popup {
  animation: cexPop var(--cex-slow) var(--cex-ease) both;
}

@keyframes cexPop {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close,
.picker-head button,
#pickerClose,
#modalClose {
  border-radius: 999px !important;
  min-width: 40px;
  min-height: 40px;
  transition: background var(--cex-fast) var(--cex-ease), transform var(--cex-fast) var(--cex-ease);
}

.modal-close:hover,
#pickerClose:hover,
#modalClose:hover {
  background: var(--muted) !important;
  transform: rotate(90deg);
}

/* ─────────────────────────────────────────────
   12 · COOKIE BANNER & TOASTY THINGS
   ───────────────────────────────────────────── */
.cookie-banner {
  background: var(--cex-glass-strong) !important;
  border-radius: var(--cex-r-lg) !important;
  border: 1px solid var(--cex-glass-edge) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 24px 70px rgba(10, 11, 13, 0.18) !important;
  animation-delay: 0.2s !important;
}

/* ─────────────────────────────────────────────
   13 · FOOTER
   ───────────────────────────────────────────── */
footer,
.foot {
  position: relative;
}

footer::before,
.foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
  pointer-events: none;
}

.footer-logo-img {
  width: 180px;
  max-width: 100%;
  height: auto;
  margin-bottom: 14px;
  border-radius: var(--cex-r-sm);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--cex-shadow-sm);
}

.foot-col a { border-radius: 6px; }
.foot-col a:hover { color: var(--primary-deep) !important; transform: translateX(2px); }

/* ─────────────────────────────────────────────
   14 · REVEAL-ON-SCROLL (additive; pages without
   their own .reveal system get .cex-rev via JS)
   ───────────────────────────────────────────── */
.cex-rev {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 640ms var(--cex-ease),
    transform 640ms var(--cex-ease);
  transition-delay: var(--cex-rev-delay, 0ms);
  will-change: opacity, transform;
}

.cex-rev.cex-in {
  opacity: 1;
  transform: none;
}

.cex-rise { animation: cexRise 620ms var(--cex-ease) both; }

@keyframes cexRise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* number flash when live prices tick */
.cex-num-flash { animation: cexNumFlash 700ms var(--cex-ease); }

@keyframes cexNumFlash {
  0%   { color: var(--primary-deep); }
  100% { color: inherit; }
}

/* ─────────────────────────────────────────────
   15 · TOUCH TARGETS & SMALL A11Y
   ───────────────────────────────────────────── */
.nav-links a,
.foot-col a,
.footer-note a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  min-width: 32px;
}

.lang-switcher button { min-height: 38px; min-width: 46px; }

.chip {
  display: inline-flex !important;
  align-items: center;
  gap: 0.45rem;
  min-height: 30px;
  border: 1px solid var(--cex-glass-edge) !important;
}

.burger {
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--cex-r-sm) !important;
}

/* ─────────────────────────────────────────────
   16 · LEGACY DASHBOARD-HTML HELPERS (kept)
   ───────────────────────────────────────────── */
body.cex-login-page,
body.cex-rates-page,
body.cex-policy-page,
body.cex-dashboard-page {
  background: var(--bg) !important;
}

body.cex-rates-page::before,
body.cex-rates-page::after {
  display: none !important;
}

.cex-dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  margin: 0 0 24px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--cex-r-lg);
  background: var(--surface);
  box-shadow: var(--cex-shadow-sm);
}

.cex-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border: 1px solid var(--cex-glass-edge);
  border-radius: 999px;
  color: var(--primary-deep);
  background: var(--cex-glass-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cex-dashboard-hero h2 {
  margin: 0 0 6px;
  color: var(--cex-navy);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.06;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.cex-dashboard-hero p {
  max-width: 54ch;
  color: var(--foreground-2);
  font-size: 15px;
  line-height: 1.55;
}

.cex-hero-metrics { display: grid; gap: 8px; min-width: 230px; }

.cex-hero-metrics span {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px;
  border: 1px solid var(--cex-glass-edge);
  border-radius: var(--cex-r-sm);
  background: var(--cex-glass-strong);
  color: var(--muted-fg);
  font-size: 12px;
  font-weight: 700;
}

.cex-hero-metrics strong { color: var(--cex-navy); font-weight: 850; }

.cex-network-strip,
.login-coin-strip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.cex-network-strip {
  margin-top: 16px;
  padding: 8px;
  border: 1px solid var(--cex-glass-edge);
  border-radius: var(--cex-r-sm);
  background: var(--cex-glass);
}

.cex-network-strip img,
.login-coin-strip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  filter: drop-shadow(0 5px 10px rgba(10, 11, 13, 0.13));
  transition: transform 220ms var(--cex-ease);
}

.cex-network-strip img:hover,
.login-coin-strip img:hover {
  transform: translateY(-2px) scale(1.07);
}

.sidebar {
  background: rgba(255, 255, 255, 0.84) !important;
  box-shadow: 18px 0 44px rgba(10, 11, 13, 0.045);
}

.sidebar-label,
.stat-label,
.score-label,
.risk-sources-title,
.info-card-title,
.form-label {
  letter-spacing: 0.11em !important;
}

.nav-item { border: 1px solid transparent !important; }

.nav-item:hover {
  transform: translateX(2px);
  border-color: var(--cex-glass-edge) !important;
}

.nav-item.active {
  background: var(--cex-cta) !important;
  color: var(--text-on-primary) !important;
  box-shadow: var(--cex-glow);
}

.stat-card { position: relative; overflow: hidden; min-height: 144px; }

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--cex-aurora-line);
}

.stat-value { color: var(--cex-navy) !important; }

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cex-navy) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

.card-title::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cex-blue);
  box-shadow: 0 0 0 5px rgba(0,82,255, 0.14);
}

.coin-support { align-items: flex-start !important; gap: 10px !important; }

.coin-mini-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 92px;
  padding-top: 1px;
}

.coin-mini-row img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  filter: drop-shadow(0 3px 7px rgba(10, 11, 13, 0.13));
}

.result-banner {
  background: var(--danger-soft) !important;
}

.paywall-card { border: 1px solid var(--cex-glass-edge) !important; }

.tg-popup-header,
.tg-popup-confirm {
  background: var(--cex-cta) !important;
}

header.site-header + main .hero,
header.site-header + main .card {
  box-shadow: var(--cex-shadow-sm) !important;
}

header.site-header + main .hero-inner {
  background: var(--surface) !important;
}

body.cex-rates-page .hero-inner::after { display: none !important; }

.swap-btn {
  box-shadow: var(--cex-glow) !important;
}

/* ─────────────────────────────────────────────
   17 · RESPONSIVE POLISH
   ───────────────────────────────────────────── */
@media (max-width: 720px) {
  .cex-dashboard-hero { grid-template-columns: 1fr; padding: 22px; }
  .cex-hero-metrics { min-width: 0; }

  .hero-actions .btn { width: 100%; }

  .cex-logo-mark { width: 48px; height: 32px; }
  .cex-logo-copy strong { font-size: 0.9rem; }
  .cex-logo-copy span { font-size: 0.56rem; letter-spacing: 0.2em; }

  .nav-cta .btn-ghost { display: none; }
  .footer-logo-img { width: 160px; }
}

@media (max-width: 600px) {
  /* keep the bar to logo + one primary action on phones */
  body.cex-home-page .nav-cta .btn-outline { display: none; }
  body.cex-home-page .nav-inner { gap: 0.75rem; }
  body.cex-home-page .cex-logo-copy strong { font-size: 0.85rem; }
}

@media (max-width: 430px) {
  .cex-logo-copy span { display: none; }
  .nav-cta .btn { padding-inline: 0.9rem; font-size: 0.88rem; }
}

/* ─────────────────────────────────────────────
   H · HOMEPAGE (body.cex-home-page)
   ───────────────────────────────────────────── */
body.cex-home-page .hero {
  position: relative;
  padding-top: 3.4rem !important;
  padding-bottom: 3.4rem !important;
}

body.cex-home-page .hero-inner {
  /* hero grid itself is not a card — undo the glass-card capture */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  perspective: 1100px;
}

body.cex-home-page .hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--border);
  pointer-events: none;
}

body.cex-home-page .hero-h1 {
  font-size: clamp(2.9rem, 5.6vw, 4.35rem) !important;
  max-width: 13.5ch;
}

body.cex-home-page .hero-sub { max-width: 34rem !important; }

body.cex-home-page .hero-mock { transform-style: preserve-3d; }

body.cex-home-page .hero-trust .check {
  color: var(--success);
  font-weight: 700;
}

/* Ticker — frosted strip with soft edges */
body.cex-home-page .ticker {
  background: var(--cex-glass) !important;
  border-top: 1px solid rgba(201, 214, 229, 0.35);
  border-bottom: 1px solid rgba(201, 214, 229, 0.35);
}

body.cex-home-page .ticker::before {
  background: linear-gradient(90deg, var(--bg), transparent) !important;
}

body.cex-home-page .ticker::after {
  background: linear-gradient(-90deg, var(--bg), transparent) !important;
}

body.cex-home-page .t-pill {
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  transition: background var(--cex-fast) var(--cex-ease), transform var(--cex-fast) var(--cex-ease);
}

body.cex-home-page .t-pill:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
}

/* Trust badges — glass chips */
body.cex-home-page .trust-badge {
  background: var(--cex-glass-strong);
  border: 1px solid var(--cex-glass-edge);
  border-radius: var(--cex-r-md);
  padding: 0.7rem 1rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, var(--cex-shadow-xs);
  transition: transform var(--cex-fast) var(--cex-ease), box-shadow var(--cex-med) var(--cex-ease), border-color var(--cex-fast) var(--cex-ease);
}

body.cex-home-page .trust-badge:hover {
  transform: translateY(-2px);
  border-color: rgba(0,82,255, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.95) inset, var(--cex-shadow-sm);
}

body.cex-home-page .trust-badge svg { color: var(--primary-deep); }

/* Stats — engraved aurora numerals */
body.cex-home-page .stat .n {
  font-weight: 700;
  color: var(--text);
}

body.cex-home-page .stat .n .small {
  color: var(--primary-active);
  background: none;
}

body.cex-home-page .stat .l { color: var(--muted-fg); }

/* Bento — featured tile gets the aurora wash */
body.cex-home-page .bento-card.feat {
  background: var(--surface) !important;
  border: 1px solid var(--border-strong) !important;
}

body.cex-home-page .b-icon {
  border-radius: var(--cex-r-sm);
  background: var(--primary-soft);
  border: 1px solid var(--border);
  color: var(--primary-text);
  box-shadow: var(--cex-shadow-xs);
}

body.cex-home-page .bento-card .b-tag {
  background: var(--cex-glass-strong);
  border: 1px solid var(--cex-glass-edge);
  color: var(--primary-deep);
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
}

/* Showcase mock browser bar */
body.cex-home-page .sm-bar .dot:nth-child(1) { background: #FCA5A5; }
body.cex-home-page .sm-bar .dot:nth-child(2) { background: #FCD34D; }
body.cex-home-page .sm-bar .dot:nth-child(3) { background: #86EFAC; }

/* Press logos — quiet by default, ink on hover */
body.cex-home-page .press-logo {
  opacity: 0.5;
  filter: grayscale(1);
  transition: opacity var(--cex-fast) var(--cex-ease), filter var(--cex-fast) var(--cex-ease), transform var(--cex-fast) var(--cex-ease);
}

body.cex-home-page .press-logo:hover {
  opacity: 1;
  filter: none;
  transform: translateY(-2px);
}

/* FAQ */
body.cex-home-page .faq-item { overflow: hidden; }

body.cex-home-page .faq-q {
  transition: color var(--cex-fast) var(--cex-ease);
}

body.cex-home-page .faq-item[open] .faq-q { color: var(--primary-deep); }

/* Big CTA — aurora stage */
body.cex-home-page .cta-big {
  background: var(--bg-alt) !important;
}

body.cex-home-page .status-pill .dot,
body.cex-home-page .hero-eyebrow .dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(18, 161, 80, 0.18);
}

/* Featured plan ribbon — readable on brand gradient */
body.cex-home-page .price-card.featured::before {
  background: var(--cex-cta) !important;
  box-shadow: 0 6px 16px rgba(0, 71, 214, 0.38);
  letter-spacing: 0.06em;
}

/* Cookie actions secondary button */
body.cex-home-page .cookie-actions button:not(.primary) {
  background: var(--cex-glass-strong);
  border: 1px solid var(--cex-glass-edge);
  border-radius: var(--cex-r-sm);
}

/* ─────────────────────────────────────────────
   M · MARKETS (body.cex-markets-page)
   Bloomberg density: tight rows, mono data,
   sticky frosted header, surgical hover.
   ───────────────────────────────────────────── */
body.cex-markets-page .markets-h1 {
  font-size: clamp(2.3rem, 4.8vw, 3.6rem) !important;
}

/* Table panel — the centrepiece (terminal corner ticks + glass) */
body.cex-markets-page .tbl-wrap {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--cex-r-lg) !important;
  box-shadow: 0 1px 0 var(--cex-glass-line) inset, var(--cex-shadow) !important;
}

body.cex-markets-page .tbl thead th {
  background: rgba(232, 240, 255, 0.92) !important;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 0.78rem 0.9rem;
  transition: color var(--cex-fast) var(--cex-ease), background var(--cex-fast) var(--cex-ease);
}

body.cex-markets-page .tbl thead th:hover {
  color: var(--primary-deep) !important;
  background: rgba(232, 244, 253, 0.95) !important;
}

body.cex-markets-page .tbl thead th.sorted {
  color: var(--primary-deep) !important;
  box-shadow: 0 -2px 0 var(--primary-deep) inset;
}

/* Dense, readable rows with a precise hover rail (desktop density;
   the page's own mobile paddings stay in charge below 761px) */
@media (min-width: 761px) {
  body.cex-markets-page .tbl tbody td {
    padding: 0.72rem 0.9rem;
  }
}

body.cex-markets-page .tbl tbody tr {
  position: relative;
  transition: background var(--cex-fast) var(--cex-ease), box-shadow var(--cex-fast) var(--cex-ease);
}

body.cex-markets-page .tbl tbody tr:hover {
  background: var(--surface-2) !important;
  box-shadow: 3px 0 0 var(--primary) inset;
}

body.cex-markets-page .tbl tbody td:first-child {
  color: var(--text-muted);
  font-size: 0.8rem;
}

body.cex-markets-page .asset-cell img {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--cex-shadow-xs);
  transition: transform var(--cex-fast) var(--cex-ease);
}

body.cex-markets-page .tbl tbody tr:hover .asset-cell img {
  transform: scale(1.08);
}

/* % change pills — chip look, AA text */
body.cex-markets-page .pct {
  border-radius: 999px !important;
  padding: 0.2rem 0.6rem !important;
  font-size: 0.8rem !important;
}

body.cex-markets-page .pct.up {
  color: var(--success) !important;
  background: rgba(18, 161, 80, 0.12) !important;
}

body.cex-markets-page .pct.dn {
  color: var(--danger) !important;
  background: rgba(224, 48, 74, 0.1) !important;
}

body.cex-markets-page .delta.up { color: var(--success) !important; }
body.cex-markets-page .delta.dn { color: var(--danger) !important; }

/* Sparklines get a soft glow */
body.cex-markets-page .spark {
  filter: drop-shadow(0 3px 6px rgba(0,82,255, 0.25));
}

/* Stats band — aurora numerals like the homepage */
body.cex-markets-page .stat-card .v {
  color: var(--text);
}

body.cex-markets-page .stat-card .v .delta {
  background: none;
}

/* Movers */
body.cex-markets-page .movers-card h3 { color: var(--muted-fg); }

body.cex-markets-page .movers-card h3 .ico { color: var(--success); }

body.cex-markets-page .mover-row {
  border: 1px solid transparent;
  transition: background var(--cex-fast) var(--cex-ease), border-color var(--cex-fast) var(--cex-ease), transform var(--cex-fast) var(--cex-ease);
}

body.cex-markets-page .mover-row:hover {
  background: rgba(232, 240, 255, 0.9) !important;
  border-color: var(--cex-glass-edge);
  transform: translateX(3px);
}

body.cex-markets-page .mover-row .ico {
  background: var(--surface);
  border: 1px solid var(--border-soft);
}

body.cex-markets-page .mover-row .chg.up { color: var(--success); }
body.cex-markets-page .mover-row .chg.dn { color: var(--danger); }

/* Toolbar */
body.cex-markets-page .search input {
  height: 2.75rem;
  background: var(--cex-glass-strong) !important;
  border-color: var(--cex-glass-edge) !important;
}

body.cex-markets-page .chip {
  min-height: 38px;
  background: var(--cex-glass-strong) !important;
}

body.cex-markets-page .chip:hover {
  transform: translateY(-1px);
}

body.cex-markets-page .chip.active {
  background: var(--cex-cta) !important;
  border-color: transparent !important;
  color: var(--text-on-primary) !important;
  box-shadow: 0 6px 16px rgba(0, 71, 214, 0.3);
}

body.cex-markets-page .refresh-pill {
  font-variant-numeric: tabular-nums;
}

/* Detail modal internals */
body.cex-markets-page .modal-grid .cell {
  background: rgba(232, 240, 255, 0.75);
  border: 1px solid var(--border-soft);
  border-radius: var(--cex-r-sm);
  transition: border-color var(--cex-fast) var(--cex-ease);
}

body.cex-markets-page .modal-grid .cell:hover {
  border-color: var(--cex-glass-edge);
}

body.cex-markets-page .modal-price {
  font-family: var(--ff-mono);
  letter-spacing: -0.02em;
}

/* ─────────────────────────────────────────────
   T · TRADE (body.cex-trade-page) — the swap desk
   ───────────────────────────────────────────── */
body.cex-trade-page .hero-h1 {
  font-size: clamp(2.3rem, 4.8vw, 3.6rem) !important;
}

/* Swap card is the hero artifact */
body.cex-trade-page .swap-card {
  border-radius: var(--cex-r-xl) !important;
  padding: 1.6rem;
  box-shadow:
    0 1px 0 var(--cex-glass-line) inset,
    var(--cex-shadow-lg) !important;
}

body.cex-trade-page .swap-card:hover {
  transform: none;            /* a tool, not a tile — no lift */
}

/* Token fields — frosted wells */
body.cex-trade-page .token-row {
  background: rgba(232, 240, 255, 0.7) !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: var(--cex-r-md) !important;
  transition: border-color var(--cex-fast) var(--cex-ease), box-shadow var(--cex-med) var(--cex-ease), background var(--cex-fast) var(--cex-ease);
}

body.cex-trade-page .token-row:focus-within {
  background: var(--surface) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(0,82,255, 0.16) !important;
}

body.cex-trade-page .token-row input {
  font-size: 1.9rem;
  letter-spacing: -0.03em;
}

body.cex-trade-page .token-row .label .bal .max {
  color: var(--primary-deep);
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--cex-glass-edge);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  transition: background var(--cex-fast) var(--cex-ease), color var(--cex-fast) var(--cex-ease), border-color var(--cex-fast) var(--cex-ease);
}

body.cex-trade-page .token-row .label .bal .max:hover {
  background: var(--primary-deep);
  border-color: var(--primary-deep);
  color: var(--text-on-primary);
}

/* Token pick pills */
body.cex-trade-page .token-pick {
  background: var(--surface) !important;
  border: 1px solid var(--cex-glass-edge) !important;
  box-shadow: var(--cex-shadow-xs) !important;
  min-height: 44px;
  transition: border-color var(--cex-fast) var(--cex-ease), box-shadow var(--cex-med) var(--cex-ease), transform var(--cex-fast) var(--cex-ease);
}

body.cex-trade-page .token-pick:hover {
  border-color: var(--primary) !important;
  transform: translateY(-1px);
  box-shadow: var(--cex-shadow-sm) !important;
}

body.cex-trade-page .token-pick img {
  background: var(--card-hi);
  border: 1px solid var(--border-soft);
}

/* Flip button — aurora coin */
body.cex-trade-page .swap-direction button {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--surface);
  border: 4px solid var(--bg);
  color: var(--primary-text);
  box-shadow: var(--cex-shadow-sm), 0 0 0 1px var(--border);
  transition: transform var(--cex-med) var(--cex-ease), color var(--cex-fast) var(--cex-ease), box-shadow var(--cex-med) var(--cex-ease);
}

body.cex-trade-page .swap-direction button:hover {
  transform: rotate(180deg) scale(1.05);
  color: var(--text-on-primary);
  background: var(--cex-cta);
  box-shadow: var(--cex-glow), 0 0 0 1px transparent;
}

body.cex-trade-page .swap-direction button:active {
  transform: rotate(180deg) scale(0.94);
}

/* Rate / fee disclosure */
body.cex-trade-page .rate-row,
body.cex-trade-page .fee-list {
  background: rgba(232, 240, 255, 0.7) !important;
  border-color: var(--border-soft) !important;
}

body.cex-trade-page .rate-row {
  border-radius: var(--cex-r-sm) !important;
  transition: border-color var(--cex-fast) var(--cex-ease), background var(--cex-fast) var(--cex-ease);
}

body.cex-trade-page .rate-row:hover {
  border-color: var(--cex-glass-edge) !important;
  background: rgba(232, 240, 255, 0.95) !important;
}

body.cex-trade-page .rate-row.open {
  border-radius: var(--cex-r-sm) var(--cex-r-sm) 0 0 !important;
}

body.cex-trade-page .fee-list {
  border-radius: 0 0 var(--cex-r-sm) var(--cex-r-sm) !important;
}

/* Status messages — AA text on soft fills */
body.cex-trade-page .swap-msg {
  border-radius: var(--cex-r-sm);
  font-weight: 500;
}

body.cex-trade-page .swap-msg.err {
  background: rgba(224, 48, 74, 0.07) !important;
  color: var(--danger) !important;
  border: 1px solid rgba(224, 48, 74, 0.22) !important;
}

body.cex-trade-page .swap-msg.warn {
  background: rgba(217, 119, 6, 0.08) !important;
  color: var(--warning) !important;
  border: 1px solid rgba(217, 119, 6, 0.25) !important;
}

body.cex-trade-page .swap-msg.ok {
  background: rgba(18, 161, 80, 0.09) !important;
  color: var(--success) !important;
  border: 1px solid rgba(18, 161, 80, 0.25) !important;
}

/* Big CTA */
body.cex-trade-page .swap-cta {
  border-radius: var(--cex-r-md) !important;
  font-weight: 700;
  letter-spacing: 0.01em !important;
}

/* Side panels */
body.cex-trade-page .panel h3 { letter-spacing: 0.12em; }

body.cex-trade-page .kv .v .up { color: var(--success); }

body.cex-trade-page .bullets li svg { color: var(--success); }

/* Picker rows */
body.cex-trade-page .picker-row {
  border: 1px solid transparent;
  transition: background var(--cex-fast) var(--cex-ease), border-color var(--cex-fast) var(--cex-ease), transform var(--cex-fast) var(--cex-ease);
}

body.cex-trade-page .picker-row:hover {
  background: rgba(232, 240, 255, 0.95) !important;
  border-color: var(--cex-glass-edge);
  transform: translateX(3px);
}

body.cex-trade-page .picker-row img {
  background: var(--surface);
  border: 1px solid var(--border-soft);
}

body.cex-trade-page .picker-search input {
  min-height: 44px;
  background: rgba(232, 240, 255, 0.8) !important;
}

body.cex-trade-page .empty-state .ic {
  background: var(--primary-soft);
  border: 1px solid var(--border);
  color: var(--primary-text);
}

/* ─────────────────────────────────────────────
   L · LOGIN (body.cex-login-page)
   ───────────────────────────────────────────── */
body.cex-login-page .login-card {
  max-width: 470px !important;
  padding: 44px 40px !important;
  border-radius: var(--cex-r-xl) !important;
}

/* aurora hairline across the card top */
body.cex-login-page .login-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cex-aurora-line);
  z-index: 2;
  pointer-events: none;
}

body.cex-login-page .login-logo {
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
  margin-bottom: 26px !important;
}

body.cex-login-page .login-logo-img {
  width: min(240px, 72vw);
  height: auto;
  border-radius: var(--cex-r-sm);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--cex-shadow-sm);
  transition: transform var(--cex-med) var(--cex-ease);
}

body.cex-login-page .login-logo:hover .login-logo-img {
  transform: translateY(-2px) scale(1.015);
}

body.cex-login-page .login-coin-strip {
  justify-content: center;
  width: 100%;
  margin: 0 0 26px;
  padding: 10px 12px;
  border: 1px solid var(--cex-glass-edge);
  border-radius: 999px;
  background: rgba(232, 240, 255, 0.72);
}

body.cex-login-page .login-coin-strip img { width: 24px; height: 24px; }

body.cex-login-page .tg-button {
  border-radius: var(--cex-r-md) !important;
  min-height: 54px;
}

body.cex-login-page .login-note { max-width: 36ch; margin-inline: auto; }

/* Confirm dialog buttons */
body.cex-login-page .tg-popup-cancel,
body.cex-login-page .tg-popup-confirm {
  min-height: 46px;
  border-radius: var(--cex-r-sm) !important;
  transition: transform var(--cex-fast) var(--cex-ease), box-shadow var(--cex-med) var(--cex-ease), background var(--cex-fast) var(--cex-ease), border-color var(--cex-fast) var(--cex-ease);
}

body.cex-login-page .tg-popup-cancel:hover { transform: translateY(-1px); }

body.cex-login-page .tg-popup-confirm {
  box-shadow: var(--cex-glow);
}

body.cex-login-page .tg-popup-confirm:hover {
  transform: translateY(-1px);
  background: var(--cex-cta-hover) !important;
}

/* Full-screen states */
body.cex-login-page .loading-overlay {
  background: var(--bg) !important;
}

body.cex-login-page .loading-spinner {
  border-width: 3px;
  border-color: rgba(0,82,255, 0.18);
  border-top-color: var(--primary-deep);
}

/* ─────────────────────────────────────────────
   R · RATES (body.cex-rates-page) + RULES (body.cex-policy-page)
   Content typography, converter, market grid.
   ───────────────────────────────────────────── */
body.cex-rates-page .hero,
body.cex-policy-page .hero {
  background: var(--cex-aurora-line) !important;
  padding: 1.5px !important;
  box-shadow: var(--cex-shadow) !important;
  border: none !important;
}

body.cex-rates-page .hero-inner,
body.cex-policy-page .hero-inner {
  border-radius: calc(var(--cex-r-lg) - 1.5px) !important;
}

body.cex-rates-page .hero-title,
body.cex-policy-page .hero-title {
  font-weight: 700;
  letter-spacing: -0.03em !important;
}

body.cex-rates-page .hero-eyebrow,
body.cex-policy-page .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.35rem 0.85rem;
}

body.cex-rates-page .card h2 .icon-pill,
body.cex-policy-page .card h2 .num {
  background: var(--cex-cta) !important;
  color: var(--text-on-primary) !important;
  box-shadow: 0 4px 12px rgba(0, 71, 214, 0.3);
}

/* Converter wells */
body.cex-rates-page .input-block {
  background: rgba(232, 240, 255, 0.75) !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: var(--cex-r-md) !important;
  transition: border-color var(--cex-fast) var(--cex-ease), box-shadow var(--cex-med) var(--cex-ease), background var(--cex-fast) var(--cex-ease);
}

body.cex-rates-page .input-block:focus-within {
  background: var(--surface) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(0,82,255, 0.16) !important;
}

body.cex-rates-page .input-row select {
  border-radius: 999px !important;
  border: 1px solid var(--cex-glass-edge) !important;
  background-color: var(--text-on-primary) !important;
  font-weight: 700;
  min-height: 44px;
  cursor: pointer;
}

body.cex-rates-page .input-row input {
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
}

body.cex-rates-page .swap-btn {
  width: 52px;
  height: 52px;
  border-radius: 16px !important;
}

body.cex-rates-page .rate-line {
  background: rgba(232, 240, 255, 0.8);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* Market grid cells */
body.cex-rates-page .market-cell {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--cex-r-md) !important;
  box-shadow: var(--cex-shadow-xs);
  transition: transform var(--cex-med) var(--cex-ease), box-shadow var(--cex-med) var(--cex-ease), border-color var(--cex-fast) var(--cex-ease);
}

body.cex-rates-page .market-cell:hover {
  transform: translateY(-3px);
  border-color: rgba(0,82,255, 0.55) !important;
  box-shadow: var(--cex-shadow-sm) !important;
}

body.cex-rates-page .market-cell .price {
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

body.cex-rates-page .chg {
  border-radius: 999px !important;
  font-variant-numeric: tabular-nums;
}

body.cex-rates-page .chg.up {
  color: var(--success) !important;
  background: rgba(18, 161, 80, 0.12) !important;
}

body.cex-rates-page .chg.down {
  color: var(--danger) !important;
  background: rgba(224, 48, 74, 0.1) !important;
}

/* RULES content typography */
body.cex-policy-page main p,
body.cex-policy-page .card p,
body.cex-policy-page .card li {
  line-height: 1.7;
}

body.cex-policy-page .card h2 {
  letter-spacing: -0.015em;
}

body.cex-policy-page .callout {
  border-radius: var(--cex-r-md) !important;
  border-width: 1px !important;
}

body.cex-policy-page .chip {
  font-variant-numeric: tabular-nums;
}

body.cex-policy-page .info-row {
  border-radius: var(--cex-r-sm);
}

/* ─────────────────────────────────────────────
   18 · REDUCED MOTION — kill it all
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .cex-aurora { display: none; }

  .cex-rev {
    opacity: 1;
    transform: none;
  }
}

/* Homepage hero: remove green status-dot and green check bullets per design review (index.html hero only) */
body.cex-home-page .hero-eyebrow .dot { display: none; }
body.cex-home-page .hero-trust .check { display: none; }

/* Fix: homepage trust-badge row overflows viewport horizontally in the 760-1079px range
   (5-column grid too cramped for "Chain analytics" / "Insured custody" label widths).
   Step the grid at 3 columns in that range (2-col mobile default is untouched below 760px),
   full 5 columns only from 1080px up. */
@media (min-width: 760px) {
  body.cex-home-page .trust-row { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1080px) {
  body.cex-home-page .trust-row { grid-template-columns: repeat(5, 1fr); gap: 1.25rem; }
}

/* Fix: homepage pricing grid (.prices) uses grid-template-columns: repeat(3, 1fr) — plain 1fr
   tracks don't shrink below the content's min-content width, so the price-tag copy text forces
   the grid wider than its container from 760px up, causing horizontal page overflow/scrollbar.
   minmax(0,1fr) lets the tracks shrink and wrap normally instead. */
@media (min-width: 760px) {
  body.cex-home-page .prices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
