/* ==========================================================================
   Crypto Trading Academy - "tech glass" theme (v2, November 2026).
   One stylesheet, no build step. Fonts come from Google Fonts (header.php).

   Sections: tokens, backdrop, base, layout, header, navigation, ticker, hero,
             buttons, cards, badges, tables, KPI, progress, curriculum, chart,
             trading, lesson, quiz, forms, popovers, pricing, glossary, footer,
             motion, responsive, artwork, tools, watchlist, shell extras
             (palette, drawer, tab bar), exams, replay, performance.

   RULES (keep them when editing)
   1. backdrop-filter, transform and filter make an element the containing
      block of its position:fixed descendants and a "backdrop root" for nested
      blurs. Put them on leaf surfaces only (cards, panels, popovers). The
      header keeps its blur on ::before for that reason.
   2. No backdrop-filter on repeated items (table rows, list rows, chips).
   3. Hover effects sit behind (hover: hover) and (pointer: fine).
   4. Everything animated must still be readable with motion switched off:
      .reveal is only hidden when <html class="js-motion"> is set by fx.js.
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: dark;

  /* Canvas */
  --bg: #04060e;
  --ink: #0a1020;               /* solid stand-in where glass cannot be used */

  /* Glass surfaces (translucent: the backdrop shows through) */
  --bg-soft: rgba(255, 255, 255, .032);
  --panel: rgba(255, 255, 255, .05);
  --panel-2: rgba(255, 255, 255, .08);
  --panel-3: rgba(255, 255, 255, .125);
  --line: rgba(150, 172, 255, .17);
  --line-soft: rgba(150, 172, 255, .09);

  --glass-bg: linear-gradient(155deg, rgba(255, 255, 255, .088), rgba(255, 255, 255, .028) 52%, rgba(255, 255, 255, .052));
  --glass-border: rgba(162, 182, 255, .18);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .13);
  --glass-blur: blur(18px) saturate(165%);
  --glass-strong: rgba(9, 13, 28, .9);       /* menus, palette, drawer */
  --chrome: rgba(5, 8, 19, .62);             /* header, tab bar */
  --dim: rgba(2, 4, 12, .6);                 /* behind overlays */

  /* Text */
  --text: #ebf0ff;
  --text-dim: #b7c3df;
  --muted: #8593b5;

  /* Brand */
  --accent: #4f8cff;
  --accent-2: #8b5cf6;
  --accent-3: #22d3ee;
  --gold: #f6c453;
  --grad: linear-gradient(118deg, var(--accent-3) 0%, var(--accent) 46%, var(--accent-2) 100%);
  --grad-soft: linear-gradient(118deg, rgba(34, 211, 238, .16), rgba(79, 140, 255, .14) 46%, rgba(139, 92, 246, .16));

  /* Semantic */
  --up: #22d67f;
  --down: #ff5470;
  --warn: #ffc857;

  /* Glows */
  --glow-accent: 0 0 0 1px rgba(79, 140, 255, .32), 0 10px 40px -12px rgba(79, 140, 255, .55);
  --glow-cyan: 0 0 26px -6px rgba(34, 211, 238, .6);
  --glow-up: 0 0 24px -6px rgba(34, 214, 127, .55);
  --glow-down: 0 0 24px -6px rgba(255, 84, 112, .55);
  --aur-1: rgba(79, 140, 255, .30);
  --aur-2: rgba(139, 92, 246, .26);
  --aur-3: rgba(34, 211, 238, .17);
  --aur-4: rgba(217, 70, 239, .11);
  --grid: rgba(150, 172, 255, .055);
  --spot-rgb: 126, 170, 255;                 /* pointer spotlight on cards */

  /* Shape */
  --radius: 18px;
  --radius-sm: 11px;
  --radius-lg: 26px;
  --shadow: 0 22px 60px -28px rgba(0, 0, 0, .85), 0 2px 10px -6px rgba(0, 0, 0, .5);
  --shadow-lift: 0 34px 90px -34px rgba(0, 0, 0, .95), 0 0 0 1px rgba(120, 150, 255, .06);
  --maxw: 1200px;
  --maxw-wide: 1440px;

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.45, .64, 1);
  --fast: .18s var(--ease);
  --med: .34s var(--ease);
  --slow: .6s var(--ease);

  --star-gold: var(--gold);
  --mx: 50%;
  --my: 0%;
}

/* Light theme, opt-in with data-theme="light" on <html>. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2fb;
  --ink: #ffffff;
  --bg-soft: rgba(255, 255, 255, .5);
  --panel: rgba(255, 255, 255, .6);
  --panel-2: rgba(255, 255, 255, .8);
  --panel-3: rgba(255, 255, 255, .96);
  --line: rgba(24, 38, 92, .13);
  --line-soft: rgba(24, 38, 92, .07);
  --glass-bg: linear-gradient(155deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .52) 55%, rgba(255, 255, 255, .7));
  --glass-border: rgba(255, 255, 255, .9);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .95);
  --glass-strong: rgba(255, 255, 255, .93);
  --chrome: rgba(255, 255, 255, .7);
  --dim: rgba(15, 23, 42, .32);
  --text: #0e1630;
  --text-dim: #33415f;
  --muted: #5a6885;
  --aur-1: rgba(79, 140, 255, .24);
  --aur-2: rgba(139, 92, 246, .18);
  --aur-3: rgba(34, 211, 238, .17);
  --aur-4: rgba(246, 196, 83, .13);
  --grid: rgba(24, 38, 92, .05);
  --spot-rgb: 79, 140, 255;
  --shadow: 0 20px 50px -26px rgba(24, 38, 92, .34), 0 2px 8px -5px rgba(24, 38, 92, .18);
  --shadow-lift: 0 30px 70px -30px rgba(24, 38, 92, .45);
  --star-gold: #d89b00;
}

/* No backdrop-filter: floating chrome becomes near-opaque instead. */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  :root { --chrome: rgba(6, 9, 20, .95); --glass-strong: rgba(9, 13, 28, .98); --panel: rgba(18, 25, 46, .92); }
  :root[data-theme="light"] { --chrome: rgba(255, 255, 255, .96); --glass-strong: #fff; --panel: rgba(255, 255, 255, .95); }
}

/* Lets the spotlight fade instead of snapping, where @property is supported. */
@property --spot { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }

/* ---------------------------------------------------------------- backdrop */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Aurora: two slow colour fields behind everything, then a fine grid. html has
   no background of its own, so the body colour becomes the canvas and stays
   underneath these layers. */
html::before, html::after, body::before, body::after {
  content: ""; position: fixed; pointer-events: none; z-index: -1;
}
html::before, html::after { inset: -20%; will-change: transform; }
html::before {
  background:
    radial-gradient(circle 42vmax at 18% 22%, var(--aur-1), transparent 70%),
    radial-gradient(circle 36vmax at 84% 78%, var(--aur-3), transparent 70%);
  animation: auroraA 42s ease-in-out infinite alternate;
}
html::after {
  background:
    radial-gradient(circle 40vmax at 82% 12%, var(--aur-2), transparent 70%),
    radial-gradient(circle 34vmax at 16% 88%, var(--aur-4), transparent 70%);
  animation: auroraB 56s ease-in-out infinite alternate;
}
body::before {
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 92% 74% at 50% 18%, #000 12%, transparent 78%);
          mask-image: radial-gradient(ellipse 92% 74% at 50% 18%, #000 12%, transparent 78%);
}
body::after {
  inset: 0;
  background: radial-gradient(120% 55% at 50% 112%, rgba(79, 140, 255, .09), transparent 62%);
}
@keyframes auroraA {
  0%   { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(4%, 3%, 0) rotate(7deg) scale(1.1); }
  100% { transform: translate3d(-2%, 5%, 0) rotate(-6deg) scale(1.04); }
}
@keyframes auroraB {
  0%   { transform: translate3d(3%, 2%, 0) rotate(0deg) scale(1.05); }
  50%  { transform: translate3d(-5%, -3%, 0) rotate(-8deg) scale(1); }
  100% { transform: translate3d(2%, -5%, 0) rotate(6deg) scale(1.12); }
}

/* Layers added by fx.js. */
.fx-net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.4s ease; }
.fx-net.on { opacity: .8; }
.fx-orb {
  position: fixed; top: 0; left: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(34, 211, 238, .14), transparent);
  z-index: -1; pointer-events: none; opacity: 0; transition: opacity .6s ease; will-change: transform;
}
.fx-orb.on { opacity: 1; }
.fx-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 400; pointer-events: none;
  background: var(--grad); box-shadow: 0 0 12px rgba(34, 211, 238, .7);
  transform: scaleX(0); transform-origin: 0 50%;
}
.fx-confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 500; pointer-events: none; }

/* -------------------------------------------------------------------- base */

img, svg { max-width: 100%; }
img { height: auto; }

a { color: var(--accent); text-decoration: none; transition: color var(--fast); }
a:hover { color: var(--accent-3); }

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.16; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.028em; }
h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.08rem, 2vw, 1.3rem); font-weight: 650; letter-spacing: -.018em; }
p { margin: 0 0 1em; }

code, kbd, .mono, .num { font-family: var(--mono); font-size: .92em; font-variant-numeric: tabular-nums; }
code { background: var(--panel-2); padding: .14em .42em; border-radius: 6px; border: 1px solid var(--line-soft); }
kbd {
  display: inline-block; padding: .1em .45em; border-radius: 6px; font-size: .74rem; line-height: 1.5;
  color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px;
}
pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
      padding: 16px; overflow-x: auto; font-size: .88rem; line-height: 1.6; }
pre code { background: none; border: 0; padding: 0; }

::selection { background: rgba(79, 140, 255, .38); color: #fff; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(150, 172, 255, .28) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(150, 172, 255, .24); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }

/* ------------------------------------------------------------------ layout */

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: var(--maxw-wide); }
.section { padding: 72px 0; }
.section-sm { padding: 40px 0; }
.muted { color: var(--muted); }
.dim { color: var(--text-dim); }
.center { text-align: center; }
.right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.lead { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--text-dim); max-width: 64ch; }

.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.split-left { grid-template-columns: 300px minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }   /* children may shrink: a wide table scrolls inside its panel */

.section-head { margin-bottom: 30px; }
.section-head h2 { margin-bottom: .3em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  color: var(--accent-3); margin-bottom: 12px;
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg);
  background: var(--accent-3); box-shadow: 0 0 12px var(--accent-3);
}

.grad, .hero h1 .grad {
  background: linear-gradient(110deg, var(--accent-3) 0%, var(--accent) 34%, var(--accent-2) 66%, var(--accent-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 220% auto; animation: shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: 220% center; } }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent);
  color: #fff; padding: 10px 16px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; top: 0; }

:focus-visible { outline: 2px solid var(--accent-3); outline-offset: 3px; border-radius: 4px; }

/* Breadcrumbs above a page title. */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; font-size: .84rem; color: var(--muted); }
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--accent-3); }
.crumbs .sep { opacity: .5; }

/* ------------------------------------------------------------------ header */

.site-header { position: sticky; top: 0; z-index: 60; }
/* The frost lives on ::before so the header is neither a containing block
   for fixed children nor a backdrop root for the menus that hang from it. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--chrome);
  -webkit-backdrop-filter: blur(22px) saturate(175%);
          backdrop-filter: blur(22px) saturate(175%);
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow var(--med);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 4%, var(--accent-3) 30%, var(--accent-2) 70%, transparent 96%);
  opacity: 0; transition: opacity var(--med);
}
.site-header.scrolled::before { box-shadow: 0 14px 40px -24px rgba(0, 0, 0, .95); }
.site-header.scrolled::after { opacity: .55; }
.header-inner { position: relative; display: flex; align-items: center; gap: 14px; min-height: 64px; }

.brand { display: flex; align-items: center; gap: 11px; color: var(--text); font-family: var(--display); font-weight: 700; letter-spacing: -.02em; flex: none; }
.brand:hover { color: var(--text); }
.brand svg, .brand img { transition: transform var(--med), filter var(--med); }
@media (hover: hover) and (pointer: fine) {
  .brand:hover svg, .brand:hover img { transform: scale(1.04); filter: drop-shadow(0 0 12px rgba(79, 140, 255, .55)); }
}
.brand-mark {
  position: relative; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--grad);
  font-size: .8rem; font-weight: 800; letter-spacing: .03em; color: #fff;
  box-shadow: 0 6px 20px -8px rgba(79, 140, 255, .9);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0; border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.4), transparent 45%);
  mix-blend-mode: overlay;
}
.brand-text { font-size: .98rem; }
@media (max-width: 420px) { .brand-text { display: none; } }

/* -------------------------------------------------------------- navigation */

.main-nav { display: flex; align-items: center; gap: 2px; margin-left: 10px; }
.nav-group { position: relative; }
.nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  color: var(--text-dim); font: inherit; font-size: .92rem; font-weight: 550; white-space: nowrap;
  transition: color var(--fast), background var(--fast);
}
.nav-link .chev { width: 13px; height: 13px; opacity: .65; transition: transform var(--fast); }
.nav-link:hover, .nav-group.open > .nav-link { color: var(--text); background: var(--panel-2); }
.nav-group.open > .nav-link .chev { transform: rotate(180deg); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 1px; height: 2px; border-radius: 2px;
  background: var(--grad); box-shadow: 0 0 10px rgba(34, 211, 238, .7);
}

.nav-drop {
  position: absolute; top: calc(100% + 12px); left: -8px; z-index: 90;
  width: 330px; padding: 8px; border-radius: 18px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
          backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi), 0 30px 80px -24px rgba(0, 0, 0, .9);
  opacity: 0; visibility: hidden; transform: translateY(8px) scale(.98); transform-origin: 20% 0;
  transition: opacity var(--fast), transform var(--fast), visibility 0s linear .18s;
}
.nav-drop::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; } /* hover bridge */
.nav-group.open > .nav-drop {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
@media (hover: hover) and (pointer: fine) {
  .nav-group:hover > .nav-drop { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav-group:hover > .nav-link { color: var(--text); background: var(--panel-2); }
  .nav-group:hover > .nav-link .chev { transform: rotate(180deg); }
}
.nav-drop-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px;
  color: var(--text-dim); transition: background var(--fast), transform var(--fast);
}
.nav-drop-item:hover, .nav-drop-item:focus-visible { background: var(--panel-2); color: var(--text); }
.nav-drop-item.active { background: var(--grad-soft); }
.nav-drop-ico {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  color: var(--accent-3); background: var(--grad-soft); border: 1px solid var(--line);
  transition: transform var(--med), box-shadow var(--med);
}
.nav-drop-item:hover .nav-drop-ico { transform: translateY(-1px) scale(1.05); box-shadow: var(--glow-cyan); }
.nav-drop-item b { display: block; color: var(--text); font-size: .92rem; font-weight: 600; line-height: 1.3; }
.nav-drop-item small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.4; margin-top: 2px; }
.nav-drop-item .tier-badge { margin-left: 6px; vertical-align: 1px; padding: 1px 7px; font-size: .62rem; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-actions > a:not(.btn) { padding: 8px 10px; border-radius: 10px; color: var(--text-dim); font-size: .92rem; font-weight: 550; }
.header-actions > a:not(.btn):hover { color: var(--text); background: var(--panel-2); }

.search-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 38px; min-width: 176px; padding: 0 9px 0 12px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font: inherit; font-size: .86rem; cursor: pointer;
  transition: border-color var(--fast), color var(--fast), box-shadow var(--fast);
}
.search-btn:hover { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 140, 255, .12); }
.search-btn kbd { margin-left: auto; }

.nav-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.nav-toggle {
  display: none; width: 40px; height: 40px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px;
  cursor: pointer; padding: 0; place-items: center; gap: 5px; align-content: center;
}
.nav-toggle span { display: block; width: 17px; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform var(--fast), opacity var(--fast); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.theme-toggle, .icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 11px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text-dim); cursor: pointer; transition: color var(--fast), border-color var(--fast), transform var(--fast);
}
.theme-toggle:hover, .icon-btn:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle svg { transition: transform .5s var(--spring); }
.theme-toggle:hover svg { transform: rotate(40deg); }

/* --------------------------------------------------------------- ticker bar */

.ticker-bar {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(4, 6, 14, .5);
}
:root[data-theme="light"] .ticker-bar { background: rgba(255, 255, 255, .45); }
.ticker-bar::before, .ticker-bar::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 70px; z-index: 2; pointer-events: none;
}
.ticker-bar::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.ticker-bar::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }

.ticker-track { display: flex; gap: 0; width: max-content; animation: marquee 52s linear infinite; }
.ticker-bar:hover .ticker-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.tk {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 8px 20px; border-right: 1px solid var(--line-soft);
  font-size: .8rem; white-space: nowrap;
}
.tk b { font-family: var(--display); font-weight: 700; letter-spacing: .02em; }
.tk .num { color: var(--text); }

/* -------------------------------------------------------------------- hero */

.hero { position: relative; padding: 78px 0 60px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero h1 .rotate { display: inline-block; min-width: 4.6ch; }
.hero h1 .rotate.swap { animation: wordSwap .5s var(--ease); }
@keyframes wordSwap { 0% { opacity: 0; transform: translateY(.35em); filter: blur(6px); } 100% { opacity: 1; transform: none; filter: none; } }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 24px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hero-stats > div {
  padding: 12px 14px; border-radius: 14px;
  background: var(--glass-bg); border: 1px solid var(--line-soft); box-shadow: var(--glass-hi);
}
.hero-stats div b { display: block; font-family: var(--display); font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.hero-stats div span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-family: var(--mono); }

/* Floating glass panel that holds the hero chart. */
.hero-visual { position: relative; perspective: 1200px; }
/* Two faint orbit rings behind the panel. */
.hero-visual::before, .hero-visual::after {
  content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%; pointer-events: none;
  border: 1px dashed rgba(150, 172, 255, .2);
}
.hero-visual::before { width: 118%; aspect-ratio: 1; margin: -59% 0 0 -59%; animation: spin 80s linear infinite; }
.hero-visual::after { width: 88%; aspect-ratio: 1; margin: -44% 0 0 -44%; border-style: solid; border-color: rgba(34, 211, 238, .12); animation: spin 60s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-panel {
  --c: rgba(34, 211, 238, .75);
  position: relative; z-index: 1; border-radius: var(--radius-lg);
  background:
    linear-gradient(var(--c), var(--c)) 14px 14px / 18px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 14px 14px / 1px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) calc(100% - 14px) calc(100% - 14px) / 18px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) calc(100% - 14px) calc(100% - 14px) / 1px 18px no-repeat,
    var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi), var(--shadow-lift), 0 0 80px -30px rgba(79, 140, 255, .6);
  padding: 20px;
  animation: float 7s ease-in-out infinite;
  transform-style: preserve-3d;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(-.3deg); }
}
/* Gradient edge light. */
.hero-panel::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(34, 211, 238, .75), transparent 38%, transparent 62%, rgba(139, 92, 246, .7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
/* A slow scan line across the panel. */
.hero-panel::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 36%; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .07) 70%, rgba(34, 211, 238, .16));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  animation: scan 6.5s linear infinite; opacity: .8;
}
@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(290%); } }

.hero-badge {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 13px; font-size: .8rem; font-weight: 650;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), var(--shadow);
}
.hero-badge .ico { color: var(--accent-3); }
.hero-badge.b1 { top: -16px; right: 26px; animation: float 6s ease-in-out infinite .6s; }
.hero-badge.b2 { bottom: -18px; left: -14px; animation: float 8s ease-in-out infinite 1.2s; }

/* ---------------------------------------------------------------- buttons */

.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 13px; border: 1px solid transparent;
  font-family: var(--font); font-size: .94rem; font-weight: 650; line-height: 1; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform var(--fast), box-shadow var(--fast), background var(--fast), border-color var(--fast), color var(--fast), filter var(--fast);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(0) scale(.98); }
.btn .ico { flex: none; }
@media (hover: hover) and (pointer: fine) { .btn:hover { transform: translateY(-2px); } }

/* Sheen that sweeps across a filled button on hover. */
.btn-primary::before, .btn-gold::before, .btn-buy::before, .btn-sell::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .34) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease);
}
.btn-primary:hover::before, .btn-gold:hover::before, .btn-buy:hover::before, .btn-sell:hover::before { transform: translateX(120%); }
/* Click ripple, positioned by fx.js. */
.btn .ripple {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, .45); animation: ripple .6s var(--ease) forwards;
}
@keyframes ripple { to { transform: scale(22); opacity: 0; } }

.btn-primary {
  color: #fff;
  background: var(--grad); background-size: 160% 100%; background-position: 0 50%;
  box-shadow: var(--glass-hi), 0 12px 34px -12px rgba(79, 140, 255, .95);
}
.btn-primary:hover { color: #fff; background-position: 100% 50%; box-shadow: var(--glass-hi), 0 18px 44px -12px rgba(79, 140, 255, 1), 0 0 0 1px rgba(34, 211, 238, .4); }

.btn-ghost { color: var(--text); background: var(--panel-2); border-color: var(--glass-border); box-shadow: var(--glass-hi); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); background: var(--panel-3); }

.btn-outline { color: var(--text); border-color: var(--line); background: transparent; }
.btn-outline:hover { color: var(--text); border-color: var(--accent-3); background: var(--panel); box-shadow: 0 0 0 3px rgba(34, 211, 238, .1); }

.btn-gold { color: #241a02; background: linear-gradient(135deg, var(--gold), #ffdf8a);
  box-shadow: var(--glass-hi), 0 12px 30px -14px rgba(246, 196, 83, .9); }
.btn-gold:hover { color: #241a02; }

.btn-buy  { color: #04230f; background: linear-gradient(135deg, #2ee28c, var(--up)); box-shadow: var(--glass-hi), var(--glow-up); }
.btn-sell { color: #2b0409; background: linear-gradient(135deg, #ff7088, var(--down)); box-shadow: var(--glass-hi), var(--glow-down); }
.btn-buy:hover { color: #04230f; }
.btn-sell:hover { color: #2b0409; }

.btn-sm { padding: 8px 14px; font-size: .86rem; border-radius: 10px; }
.btn-lg { padding: 15px 30px; font-size: 1rem; border-radius: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

/* ------------------------------------------------------------------- cards */

/* Every glass surface carries a pointer spotlight: fx.js writes --mx / --my
   and the hover rule raises --spot. It is a background layer, so nothing can
   sit on top of the content. */
.card, .panel, .kpi .box, .chart-shell, .lock-card, .page-banner, .task-card, .toast {
  --spot: 0;
  background:
    radial-gradient(420px circle at var(--mx) var(--my), rgba(var(--spot-rgb), calc(.13 * var(--spot))), transparent 46%),
    var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi), var(--shadow);
}
@media (hover: hover) and (pointer: fine) {
  .card:hover, .panel:hover, .kpi .box:hover, .page-banner:hover, .task-card:hover { --spot: 1; }
}

.card {
  position: relative;
  border-radius: var(--radius);
  padding: 22px;
  transition: transform var(--med), border-color var(--med), box-shadow var(--med), --spot var(--med);
}
.card-pad-sm { padding: 16px; }
.card-hover:hover { border-color: color-mix(in srgb, var(--accent-3) 55%, var(--glass-border)); box-shadow: var(--glass-hi), var(--shadow-lift), 0 0 44px -22px rgba(34, 211, 238, .55); }
@media (hover: hover) and (pointer: fine) { .card-hover:hover { transform: translateY(-4px); } }
.card h3 { margin-bottom: .4em; }
.card > :last-child { margin-bottom: 0; }
a.card { color: inherit; display: block; }
a.card:hover { color: inherit; }

.feature-icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  margin-bottom: 14px; color: var(--accent-3);
  background: var(--grad-soft);
  border: 1px solid var(--line);
  box-shadow: var(--glass-hi);
  transition: transform var(--med), box-shadow var(--med);
}
.card:hover .feature-icon { transform: translateY(-2px) rotate(-4deg) scale(1.06); box-shadow: var(--glass-hi), var(--glow-cyan); }

.panel { border-radius: var(--radius); transition: border-color var(--med), --spot var(--med); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .025); border-radius: var(--radius) var(--radius) 0 0;
}
:root[data-theme="light"] .panel-head { background: rgba(255, 255, 255, .35); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1.02rem; display: inline-flex; align-items: center; gap: 8px; }
.panel-body { padding: 18px; }

/* ------------------------------------------------------------------ badges */

.badge, .tier-badge, .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim);
}
.badge-free  { color: var(--muted); }
.badge-super { color: #cbb2ff; border-color: rgba(139, 92, 246, .5); background: rgba(139, 92, 246, .14); box-shadow: 0 0 18px -8px rgba(139, 92, 246, .9); }
.badge-pro   { color: #ffdf9a; border-color: rgba(246, 196, 83, .5); background: rgba(246, 196, 83, .13); box-shadow: 0 0 18px -8px rgba(246, 196, 83, .9); }
.badge-level { color: var(--accent-3); border-color: rgba(34, 211, 238, .38); background: rgba(34, 211, 238, .10); }
.badge-up    { color: var(--up); border-color: rgba(34, 214, 127, .4); background: rgba(34, 214, 127, .12); }
.badge-down  { color: var(--down); border-color: rgba(255, 84, 112, .4); background: rgba(255, 84, 112, .12); }
.badge-warn  { color: var(--warn); border-color: rgba(255, 200, 87, .45); background: rgba(255, 200, 87, .12); }
.badge-live  { color: var(--up); border-color: rgba(34, 214, 127, .4); background: rgba(34, 214, 127, .10); }
.badge-live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--up);
  box-shadow: 0 0 0 0 rgba(34, 214, 127, .7); animation: pulse 2s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 8px rgba(34, 214, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 214, 127, 0); }
}
:root[data-theme="light"] .badge-pro   { color: #7a4d00; border-color: rgba(180, 120, 0, .45); background: rgba(246, 196, 83, .28); }
:root[data-theme="light"] .badge-super { color: #4c1d95; border-color: rgba(139, 92, 246, .45); background: rgba(139, 92, 246, .16); }
:root[data-theme="light"] .badge-level { color: #0e7490; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }

/* ------------------------------------------------------------------ colour */

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.gold { color: var(--gold); }

/* Flash a cell when its value changes, driven by JS. */
.flash-up   { animation: flashUp .8s var(--ease); }
.flash-down { animation: flashDown .8s var(--ease); }
@keyframes flashUp   { 0% { background: rgba(34, 214, 127, .30); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: rgba(255, 84, 112, .30); } 100% { background: transparent; } }

/* ------------------------------------------------------------------ tables */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
table.data th {
  font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  font-family: var(--mono); color: var(--muted); background: rgba(255, 255, 255, .03); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.data tbody tr { transition: background var(--fast); }
table.data tbody tr:hover { background: var(--panel-2); }
table.data tbody tr:hover > td:first-child { box-shadow: inset 2px 0 0 var(--accent-3); }
:root[data-theme="light"] table.data th { background: rgba(255, 255, 255, .4); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data tbody tr:last-child td { border-bottom: 0; }

.coin-cell { display: flex; align-items: center; gap: 11px; }
.coin-logo {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--panel-3); display: grid; place-items: center;
  font-size: .64rem; font-weight: 800; color: var(--text-dim);
}
.coin-name { display: grid; line-height: 1.25; }
.coin-name b { font-size: .94rem; }
.coin-name span { font-size: .76rem; color: var(--muted); }

.spark { width: 108px; height: 34px; display: block; }
.spark-up { color: var(--up); }
.spark-down { color: var(--down); }

/* --------------------------------------------------------------- KPI boxes */

.kpi { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-6 .box b { font-size: 1.32rem; }
.kpi .box {
  position: relative; overflow: hidden;
  border-radius: var(--radius); padding: 17px;
  transition: transform var(--med), border-color var(--med), --spot var(--med);
}
.kpi .box::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad); opacity: .75;
}
.kpi .box span { display: block; font-family: var(--mono); font-size: .68rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .11em; margin-bottom: 6px; }
.kpi .box b { font-size: 1.5rem; font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.02em; }
.kpi .box small { display: block; font-size: .8rem; margin-top: 3px; }

/* --------------------------------------------------------------- progress */

.progress { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--text) 11%, transparent); overflow: hidden; }
.progress > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 50%, var(--accent-3));
  width: 0; transition: width 1.1s var(--ease);
  box-shadow: 0 0 14px -2px rgba(34, 211, 238, .8);
  position: relative;
}
.progress > i::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .5) 50%, transparent 80%);
  background-size: 220% 100%; animation: barSheen 2.6s linear infinite;
}
@keyframes barSheen { from { background-position: 180% 0; } to { background-position: -60% 0; } }
.progress-lg { height: 12px; }

.ring { --p: 0; display: grid; place-items: center; width: 118px; height: 118px; border-radius: 50%; flex: none;
  background: conic-gradient(from -90deg, var(--accent-3), var(--accent) calc(var(--p) * .6%), var(--accent-2) calc(var(--p) * 1%), color-mix(in srgb, var(--text) 11%, transparent) 0);
  transition: --p 1s var(--ease); position: relative;
  box-shadow: 0 0 36px -12px rgba(34, 211, 238, .7); }
.ring::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--ink);
  box-shadow: inset 0 0 18px rgba(79, 140, 255, .22); }
.ring b { position: relative; z-index: 1; font-family: var(--display); font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 700; }

/* --------------------------------------------------------------- curriculum */

.module-card { position: relative; overflow: hidden; }
.module-card .mod-no {
  position: absolute; top: -12px; right: 6px; font-size: 5rem; font-weight: 800;
  color: var(--text); opacity: .045; line-height: 1; pointer-events: none;
}
.module-card.locked { opacity: .92; }
.module-card.locked::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(160deg, transparent 40%, rgba(7, 11, 22, .55));
}

.lesson-list { display: grid; gap: 2px; margin-top: 14px; }
.lesson-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border-radius: var(--radius-sm); color: var(--text-dim);
  transition: background var(--fast), color var(--fast), transform var(--fast);
}
.lesson-row:hover { background: var(--panel-2); color: var(--text); text-decoration: none; transform: translateX(3px); }
.lesson-row .lesson-no {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-family: var(--mono); font-size: .74rem; color: var(--muted);
}
.lesson-row.done .lesson-no { background: rgba(34, 214, 127, .15); border-color: rgba(34, 214, 127, .4); color: var(--up); }
.lesson-row .lesson-title { flex: 1; min-width: 0; font-size: .93rem; }
.lesson-row .lesson-meta { font-size: .78rem; color: var(--muted); flex: none; }
.lesson-row.is-locked { opacity: .55; cursor: not-allowed; }

/* -------------------------------------------------------------- lock cards */

.lock-card {
  text-align: center; padding: 40px 26px;
  border-style: dashed; border-radius: var(--radius);
}
.lock-icon {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 16px; color: var(--gold);
  background: rgba(246, 196, 83, .10); border: 1px solid rgba(246, 196, 83, .3);
}
.lock-card h3 { margin-bottom: .3em; }
.lock-card p { max-width: 46ch; margin: 0 auto 18px; }

/* ------------------------------------------------------------------- chart */

.chart-shell { position: relative; border-radius: var(--radius); overflow: hidden; }
.chart-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft); background: rgba(255, 255, 255, .03);
}
.chart-canvas-wrap { position: relative; width: 100%; }
canvas.chart { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: crosshair; }

.tf-group { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; }
.tf-btn {
  padding: 5px 11px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: .8rem; font-weight: 650; border-radius: 7px; font-family: inherit;
  transition: all var(--fast);
}
.tf-btn:hover { color: var(--text); }
.tf-btn.active { background: var(--grad); color: #fff; box-shadow: 0 6px 18px -8px rgba(79, 140, 255, .9); }
.tf-btn[disabled] { opacity: .4; cursor: not-allowed; }

.ind-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted);
  border-radius: 8px; font-size: .78rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all var(--fast);
}
.ind-toggle:hover { color: var(--text); border-color: var(--accent); }
.ind-toggle.on { color: var(--text); border-color: var(--accent); background: rgba(79, 140, 255, .14); }
.ind-toggle .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.chart-tooltip {
  position: absolute; z-index: 5; pointer-events: none; opacity: 0;
  padding: 9px 12px; border-radius: 10px; font-size: .78rem; line-height: 1.55;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(8px); transition: opacity var(--fast);
  font-family: var(--mono); white-space: nowrap;
}
.chart-tooltip.show { opacity: 1; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 9px 14px; font-size: .78rem;
  border-top: 1px solid var(--line); color: var(--muted); font-family: var(--mono); align-items: center; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .lg i { width: 15px; height: 3px; border-radius: 2px; display: inline-block; background: currentColor; }

.ind-group { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* Chart drawing toolbar */
.draw-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 14px; border-bottom: 1px solid var(--line-soft); background: rgba(255, 255, 255, .03);
}
.draw-label { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.draw-btn {
  padding: 4px 10px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted);
  border-radius: 8px; font-size: .78rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all var(--fast);
}
.draw-btn:hover { color: var(--text); border-color: var(--accent); }
.draw-btn.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.draw-color { width: 30px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }

/* Checkout payment method block */
.pay-method { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.pay-method h3 { display: flex; align-items: center; gap: 6px; }

.chart-empty { display: grid; place-items: center; min-height: 220px; color: var(--muted); font-size: .9rem; }

/* ----------------------------------------------------------- order book */

.depth { display: grid; gap: 1px; font-family: var(--mono); font-size: .8rem; }
.depth-row { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 4px 9px; }
.depth-row > span { position: relative; z-index: 1; }
.depth-row .fill { position: absolute; top: 0; bottom: 0; right: 0; opacity: .14; }
.depth-bid .fill { background: var(--up); }
.depth-ask .fill { background: var(--down); }
.depth-bid .px { color: var(--up); }
.depth-ask .px { color: var(--down); }
.depth-mid { padding: 9px; text-align: center; border-block: 1px solid var(--line);
  font-size: 1rem; font-weight: 700; font-family: var(--mono); }

/* ---------------------------------------------------------------- trading */

.side-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 15px; }
.side-toggle button {
  padding: 11px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim);
  border-radius: 10px; font-weight: 700; font-size: .92rem; cursor: pointer; font-family: inherit;
  transition: all var(--fast);
}
.side-toggle button:hover { border-color: var(--accent); }
.side-toggle button.on-buy  { background: var(--up); color: #04230f; border-color: var(--up); box-shadow: var(--glow-up); }
.side-toggle button.on-sell { background: var(--down); color: #2b0409; border-color: var(--down); box-shadow: var(--glow-down); }

.lev-slider { width: 100%; accent-color: var(--accent); }
.lev-marks { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); font-family: var(--mono); }
.lev-value { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; }
.lev-value.hot { color: var(--warn); }
.lev-value.danger { color: var(--down); }

.qty-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.qty-presets button {
  padding: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  border-radius: 8px; font-size: .78rem; cursor: pointer; font-family: inherit; transition: all var(--fast);
}
.qty-presets button:hover { color: var(--text); border-color: var(--accent); }

.order-summary { display: grid; gap: 7px; padding: 13px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .85rem; margin: 14px 0; }
.order-summary div { display: flex; justify-content: space-between; gap: 10px; }
.order-summary .num { font-family: var(--mono); }

.pos-dir { font-weight: 700; font-size: .78rem; letter-spacing: .05em; }
.pos-long { color: var(--up); }
.pos-short { color: var(--down); }

/* ------------------------------------------------------------------ lesson */

.lesson-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 34px; align-items: start; }
.toc { position: sticky; top: 90px; max-height: calc(100vh - 120px); overflow-y: auto; }
.toc-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.toc a { display: block; padding: 6px 0 6px 12px; font-size: .87rem; color: var(--muted);
  border-left: 2px solid var(--line); transition: all var(--fast); }
.toc a:hover, .toc a.active { color: var(--text); border-left-color: var(--accent); }

.lesson-body { font-size: 1.04rem; line-height: 1.78; max-width: 74ch; }
.lesson-body h2 { margin: 1.9em 0 .55em; padding-top: .2em; }
.lesson-body h3 { margin: 1.5em 0 .45em; }
.lesson-body ul, .lesson-body ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.lesson-body li { margin-bottom: .5em; }
.lesson-body strong { color: var(--text); font-weight: 650; }
.lesson-body table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .93rem; }
.lesson-body th, .lesson-body td { border: 1px solid var(--line); padding: 10px 13px; text-align: left; }
.lesson-body th { background: var(--panel-2); font-weight: 650; }
.lesson-body tr:nth-child(even) td { background: color-mix(in srgb, var(--panel) 45%, transparent); }
.lesson-body pre { margin: 1.4em 0; }

.keypoint {
  position: relative; margin: 1.7em 0; padding: 18px 20px 18px 22px;
  background: linear-gradient(120deg, rgba(79, 140, 255, .10), rgba(139, 92, 246, .05));
  border: 1px solid rgba(79, 140, 255, .28); border-radius: var(--radius-sm);
}
.keypoint::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-3));
}
.keypoint p:last-child { margin-bottom: 0; }

.lesson-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.lesson-nav a { flex: 1; min-width: 210px; padding: 15px 18px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel); transition: all var(--fast); }
.lesson-nav a:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.lesson-nav span { display: block; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.lesson-nav b { color: var(--text); font-size: .94rem; }
.lesson-nav .next { text-align: right; }

/* -------------------------------------------------------------------- quiz */

.quiz { counter-reset: q; }
.question { border-top: 1px solid var(--line); padding: 20px 0; }
.question:first-of-type { border-top: 0; }
.question > p.q-text { font-weight: 650; margin-bottom: .8em; }
.options { display: grid; gap: 8px; }
.option {
  display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel);
  transition: all var(--fast);
}
.option:hover { border-color: var(--accent); background: var(--panel-2); }
.option input { margin-top: 4px; accent-color: var(--accent); flex: none; }
.option.correct { border-color: var(--up); background: rgba(34, 214, 127, .10); }
.option.wrong { border-color: var(--down); background: rgba(255, 84, 112, .10); }
.explain { margin-top: 9px; padding: 11px 13px; background: var(--bg-soft);
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; font-size: .89rem; color: var(--text-dim); }
.quiz-result { font-size: 1.15rem; font-weight: 700; margin-top: 18px; }

/* ------------------------------------------------------------------- forms */

.field { margin-bottom: 16px; }
label { display: block; font-size: .87rem; font-weight: 600; margin-bottom: 7px; color: var(--text-dim); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="date"], select, textarea {
  width: 100%; padding: 11px 14px; font: inherit; font-size: .94rem;
  color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--accent-3); background: var(--panel);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .15), 0 0 22px -10px rgba(34, 211, 238, .8);
}
select option { background: var(--ink); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
  border: 1px solid; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.alert p:last-child { margin-bottom: 0; }
.alert-error { border-color: rgba(255, 84, 112, .5); background: rgba(255, 84, 112, .10); color: #ffc2cc; }
.alert-ok { border-color: rgba(34, 214, 127, .5); background: rgba(34, 214, 127, .10); color: #a9f0ca; }
.alert-warn { border-color: rgba(255, 200, 87, .5); background: rgba(255, 200, 87, .10); color: #ffe4a8; }
.alert-info { border-color: var(--line); background: var(--bg-soft); color: var(--text-dim); }
:root[data-theme="light"] .alert-error { color: #9f1239; }
:root[data-theme="light"] .alert-ok { color: #065f46; }
:root[data-theme="light"] .alert-warn { color: #92400e; }

.auth-card { max-width: 440px; margin: 56px auto; }
.auth-card .brand-mark { margin: 0 auto 16px; }

/* Split auth layout: brand/benefits aside + form panel. */
.auth-wrap { padding: 40px 0 64px; }
.auth-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; max-width: 940px; }
.auth-aside { padding: 8px 8px 8px 0; }
.auth-aside h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 20px 0 10px; }
.auth-aside .brand-logo-img { height: 46px; }
.auth-points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; align-items: flex-start; gap: 10px; font-size: .94rem; color: var(--text-dim); }
.auth-points li .ico { color: var(--up); flex: none; margin-top: 1px; }
.auth-panel { padding: 32px; }
@media (max-width: 780px) {
  .auth-split { grid-template-columns: 1fr; gap: 22px; max-width: 460px; }
  .auth-aside { display: none; }
}

/* Password field with an inline show/hide button. */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 62px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 600; padding: 6px 10px; border-radius: 8px;
}
.pw-toggle:hover { color: var(--accent); background: var(--bg-soft); }

/* Password strength meter. */
.pw-meter { height: 4px; border-radius: 3px; background: var(--line); margin: 8px 0 2px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width var(--fast), background var(--fast); }

/* Notification bell and dropdown. */
.notif { position: relative; display: inline-flex; }
.notif-btn { position: relative; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 6px; border-radius: 9px; display: inline-flex; align-items: center; }
.notif-btn:hover { color: var(--text); background: var(--bg-soft); }
.notif-count { position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--down); color: #fff; font-size: .66rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.notif-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 320px; max-width: 86vw;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  z-index: 80; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px;
  border-bottom: 1px solid var(--line); font-weight: 700; font-size: .9rem; }
.notif-mark { border: 0; background: transparent; color: var(--accent); cursor: pointer; font: inherit;
  font-size: .8rem; font-weight: 600; }
.notif-list { max-height: 360px; overflow: auto; }
.notif-empty { padding: 22px 14px; color: var(--muted); font-size: .86rem; margin: 0; text-align: center; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--text-dim); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--bg-soft); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 6px; flex: none; }
.notif-item.unread { color: var(--text); }
.notif-item.unread .notif-dot { background: var(--accent); }
.notif-body { display: flex; flex-direction: column; gap: 2px; }
.notif-msg { font-size: .86rem; line-height: 1.4; }
.notif-time { font-size: .74rem; color: var(--muted); }
@media (max-width: 640px) { .notif-panel { position: fixed; top: 60px; right: 10px; left: 10px; width: auto; } }

/* Toast notifications, injected by JS. */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; max-width: 340px; }
.toast {
  padding: 13px 16px; border-radius: var(--radius-sm); font-size: .89rem;
  background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), var(--shadow-lift);
  animation: toastIn .4s var(--spring);
}
.toast.ok { border-left: 3px solid var(--up); }
.toast.error { border-left: 3px solid var(--down); }
.toast.warn { border-left: 3px solid var(--warn); }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(28px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(28px); } }

/* ----------------------------------------------------------------- pricing */

.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.price-card { position: relative; display: flex; flex-direction: column; padding: 28px 24px; }
.price-card.featured {
  border-color: rgba(139, 92, 246, .55);
  background: linear-gradient(170deg, rgba(139, 92, 246, .22), rgba(255, 255, 255, .05) 55%);
  box-shadow: var(--glass-hi), 0 28px 70px -30px rgba(139, 92, 246, .8);
}
.price-card.featured::before {
  content: "Most popular"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  padding: 5px 14px; border-radius: 999px; font-size: .7rem; font-weight: 750; letter-spacing: .06em;
  color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent));
  white-space: nowrap; box-shadow: 0 8px 20px -8px rgba(139, 92, 246, .9);
}
.price-amount { font-family: var(--display); font-size: 2.9rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.price-amount small { font-size: .95rem; font-weight: 500; color: var(--muted); font-family: var(--font); }
.price-features { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; flex: 1; }
.price-features li { display: flex; gap: 10px; align-items: flex-start; font-size: .91rem; color: var(--text-dim); }
.price-features .ico { flex: none; margin-top: 3px; color: var(--up); }

.compare th:first-child { text-align: left; }
.compare td, .compare th { text-align: center; }
.compare td:first-child { text-align: left; color: var(--text-dim); }

/* --------------------------------------------------------------- glossary */

.letter-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 8px; }
.letter-jump a { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px; font-size: .84rem; color: var(--text-dim);
  background: var(--panel); transition: all var(--fast); }
.letter-jump a:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.letter-jump a.off { opacity: .3; pointer-events: none; }

.glossary-item { border-top: 1px solid var(--line-soft); padding: 17px 0; scroll-margin-top: 90px; }
.glossary-item:first-child { border-top: 0; }
.glossary-item h3 { margin-bottom: .25em; font-size: 1.05rem; }
.glossary-item p { margin-bottom: 0; color: var(--text-dim); font-size: .94rem; }

.res-item { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line-soft); }
.res-item:first-child { border-top: 0; }
.res-kind { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--accent-3); }
.res-item h3 { margin-bottom: .15em; font-size: 1.02rem; }
.res-item p { margin: 0; color: var(--muted); font-size: .92rem; }
.res-by { font-size: .84rem; color: var(--muted); }

/* ------------------------------------------------------------- calculators */

.calc-out { font-family: var(--mono); font-size: 1.02rem; }
.calc-out b { font-size: 1.35rem; color: var(--accent-3); }
.calc-result { display: grid; gap: 9px; padding: 16px; margin-top: 16px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.calc-result div { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.divider { height: 1px; background: var(--line); margin: 26px 0; border: 0; }

/* ---------------------------------------------------------------- avatars */

.avatar { border-radius: 12px; flex: none; display: block; }
.rank-no { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  font-family: var(--mono); font-weight: 700; font-size: .82rem;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.rank-1 { background: rgba(246, 196, 83, .18); border-color: rgba(246, 196, 83, .5); color: var(--gold); }
.rank-2 { background: rgba(203, 213, 225, .14); border-color: rgba(203, 213, 225, .4); color: #cbd5e1; }
.rank-3 { background: rgba(217, 119, 6, .16); border-color: rgba(217, 119, 6, .45); color: #f0a350; }

/* ------------------------------------------------------------- certificate */

.certificate {
  position: relative; padding: 46px 48px 36px; text-align: center; border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(246,196,83,.10), transparent 60%),
    linear-gradient(150deg, #0d1528, #141f3a 60%, #0d1528);
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 30px 80px -40px rgba(246, 196, 83, .5);
  overflow: hidden;
}
/* Gold gradient frame */
.certificate::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); padding: 2px;
  background: linear-gradient(135deg, #f6c453, #fff2c9 25%, #b8860b 50%, #fff2c9 75%, #f6c453);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
/* Inner hairline border */
.certificate::before {
  content: ""; position: absolute; inset: 12px; border: 1px solid rgba(246, 196, 83, .28);
  border-radius: calc(var(--radius-lg) - 8px); pointer-events: none;
}
.cert-eyebrow { letter-spacing: .32em; text-transform: uppercase; font-size: .7rem; color: var(--gold); }
.cert-seal { width: 74px; height: 74px; margin: 14px auto 6px; display: block; }
.certificate h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.4rem, 3.4vw, 2rem);
  margin: 4px 0 2px; color: #fff; letter-spacing: .01em; }
.cert-name { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.7rem, 4.5vw, 2.7rem);
  font-weight: 700; margin: 18px 0 6px;
  background: linear-gradient(110deg, var(--gold), #fff2c9 50%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.cert-track { font-size: 1.02rem; color: var(--text); }
.cert-rule { width: 62%; max-width: 320px; height: 1px; margin: 20px auto;
  background: linear-gradient(90deg, transparent, rgba(246,196,83,.55), transparent); }
.cert-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  margin-top: 26px; text-align: left; }
.cert-foot .sig { flex: 1; }
.cert-foot .sig-line { border-top: 1px solid rgba(255,255,255,.35); padding-top: 6px; font-size: .82rem; color: var(--muted); }
.cert-sig-name { font-family: Georgia, serif; font-style: italic; font-size: 1.05rem; color: #fff; }
.cert-code { font-family: var(--mono); font-size: .82rem; color: var(--muted); letter-spacing: .08em; text-align: right; }
.cert-code b { color: var(--text); letter-spacing: .12em; }

/* ------------------------------------------------------------------ footer */

.site-footer { position: relative; margin-top: 84px; border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 70%); }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-3) 30%, var(--accent-2) 70%, transparent); opacity: .5; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(5, 1fr); gap: 28px; padding: 52px 0 36px; }
.footer-grid a { display: block; padding: 4px 0; color: var(--muted); font-size: .9rem; }
.footer-grid a:hover { color: var(--text); text-decoration: none; }
.footer-brand { font-family: var(--display); font-weight: 700; margin-bottom: 6px; font-size: 1.08rem; }
.footer-head { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .13em; color: var(--accent-3);
  font-weight: 700; margin-bottom: 10px; }
.disclaimer { padding: 22px 0 34px; border-top: 1px solid var(--line-soft); font-size: .84rem; color: var(--muted); }
.disclaimer strong { color: var(--warn); }

/* ------------------------------------------------------------------ motion */

/* Every page eases in. The end state is transform: none, so <main> never
   stays a containing block. */
main { animation: pageIn .55s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Scroll reveal. Armed only when the inline script in <head> has set .js on
   <html>, so a page whose scripts fail to load is never left blank. app.js
   removes the classes again once an element has arrived, which hands its
   transition back to the component's own hover rules. */
.js .reveal {
  opacity: 0; transform: translateY(24px) scale(.985);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.in { opacity: 1; transform: none; }
.reveal-d1 { --d: .07s; }
.reveal-d2 { --d: .14s; }
.reveal-d3 { --d: .21s; }
.reveal-d4 { --d: .28s; }

.count { font-variant-numeric: tabular-nums; }

/* Sparklines draw themselves in (the path carries pathLength="1"). */
.spark .spark-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: sparkDraw 1.5s var(--ease) .25s forwards; }
.spark .spark-fill { opacity: 0; animation: fadeIn .9s ease 1s forwards; }
@keyframes sparkDraw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }

/* Loading placeholder. */
.skel {
  border-radius: 10px; min-height: 14px;
  background: linear-gradient(100deg, var(--panel) 30%, var(--panel-3) 50%, var(--panel) 70%);
  background-size: 220% 100%; animation: barSheen 1.4s linear infinite;
}

/* "+10 XP" lifting off the thing that earned it (fx.js). */
.xp-float {
  position: fixed; z-index: 450; pointer-events: none; transform: translate(-50%, 0);
  padding: 6px 12px; border-radius: 999px; font-family: var(--display); font-weight: 700; font-size: .95rem; color: #04230f;
  background: linear-gradient(135deg, #7af7b9, var(--up)); box-shadow: 0 0 26px -4px rgba(34, 214, 127, .9);
  animation: xpFloat 1.5s var(--ease) forwards;
}
@keyframes xpFloat {
  0%   { opacity: 0; transform: translate(-50%, 8px) scale(.7); }
  18%  { opacity: 1; transform: translate(-50%, -6px) scale(1.08); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -76px) scale(1); }
}

/* A soft pulse for the one thing on a page that wants attention. */
.attn { animation: attn 2.4s ease-in-out infinite; }
@keyframes attn { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .0); } 50% { box-shadow: 0 0 0 6px rgba(34, 211, 238, .14); } }

@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  html::before, html::after { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
  .fx-net, .fx-orb { display: none; }
}

/* ------------------------------------------------------------------ artwork */

.art {
  display: block; width: 100%; height: 140px;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--line);
}
.module-card .art { margin: -22px -22px 16px; width: calc(100% + 44px); }

.art-empty { display: block; margin: 0 auto 14px; opacity: .85; }

.empty-state { text-align: center; padding: 38px 20px; }
.empty-state h3 { margin-bottom: .3em; font-size: 1.05rem; }
.empty-state p { max-width: 42ch; margin: 0 auto 16px; font-size: .92rem; }

.art-backdrop {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; border-radius: inherit;
}
.has-backdrop { position: relative; overflow: hidden; }
.has-backdrop > *:not(.art-backdrop) { position: relative; z-index: 1; }
/* No drawn backdrop any more, so no scrim is needed. */
.page-banner.has-backdrop::after { content: none; }

/* Module cover art tints toward the card on hover, so the text stays readable. */
.module-card:hover .art { filter: saturate(1.15); }
@media (prefers-reduced-motion: reduce) { .module-card:hover .art { filter: none; } }

/* ------------------------------------------------------- photograph slots */

/* A photograph used as module cover art sits in the same box as the SVG. */
img.art { object-fit: cover; }

/* Full-bleed photograph behind a section, dimmed so text stays readable. */
.photo-backdrop { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; }
.photo-backdrop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-backdrop::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(100deg, var(--bg) 8%, color-mix(in srgb, var(--bg) 70%, transparent) 45%, transparent 85%),
    linear-gradient(0deg, var(--bg) 2%, transparent 55%);
}
:root[data-theme="light"] .photo-backdrop img { opacity: .5; }

/* Page header banner. With no photograph it is a clean panel with a soft
   brand-tinted gradient rather than a drawn chart backdrop. */
.page-banner {
  --c: rgba(34, 211, 238, .6);
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  min-height: 150px; display: flex; align-items: flex-end;
  padding: 28px 30px; margin-bottom: 28px;
  /* HUD corner marks, the pointer spotlight, a brand wash, then the glass. */
  background:
    linear-gradient(var(--c), var(--c)) 12px 12px / 16px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 12px 12px / 1px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) calc(100% - 12px) calc(100% - 12px) / 16px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) calc(100% - 12px) calc(100% - 12px) / 1px 16px no-repeat,
    radial-gradient(420px circle at var(--mx) var(--my), rgba(var(--spot-rgb), calc(.13 * var(--spot))), transparent 46%),
    radial-gradient(130% 160% at 0% 0%, rgba(79, 140, 255, .17) 0%, transparent 55%),
    radial-gradient(90% 140% at 100% 100%, rgba(139, 92, 246, .12) 0%, transparent 55%),
    var(--glass-bg);
  transition: --spot var(--med);
}
.page-banner > * { position: relative; z-index: 1; }
.page-banner h1 { margin-bottom: .2em; }
.page-banner .lead { margin-bottom: 0; }
@media (max-width: 720px) { .page-banner { min-height: 150px; padding: 20px; } }

/* Brand logo in the header, inverting with the theme. */
.brand-logo { height: 30px; width: auto; color: var(--text); display: block; }
@media (max-width: 480px) { .brand-logo { height: 26px; } }

/* Inline vector logo: transparent background, wordmark uses the theme text
   colour so it blends on both the dark and light headers. */
.brand-logo-svg { display: flex; align-items: center; color: var(--text); }
.brand-logo-svg svg { height: 40px; width: auto; display: block; }
@media (max-width: 480px) { .brand-logo-svg svg { height: 32px; } }

/* Uploaded brand logo (assets/img/logo.*). A white-background logo is placed on
   a white rounded chip so it reads as intentional on the dark header; a logo
   exported with a transparent background simply shows through. */
/* The MKPAYZ mark is navy on white, so it sits on a white chip to stay legible
   on the dark header. A transparent logo also renders fine here. */
.brand-logo-img {
  height: 44px; max-width: 230px; width: auto; object-fit: contain;
  background: #ffffff; padding: 5px 11px; border-radius: 12px;
  border: 1px solid rgba(10,20,40,.10); box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
@media (max-width: 480px) { .brand-logo-img { height: 36px; padding: 4px 8px; } }

/* Search hit highlighting. */
mark { background: rgba(246, 196, 83, .28); color: var(--text); padding: 0 2px; border-radius: 3px; }

/* ----------------------------------------------- beginner lesson scaffolding */

.intro-label {
  display: flex; align-items: center; gap: 7px;
  font-size: .74rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-3); margin: 0 0 .7em;
}

/* "Before you start": a plain-language framing of the lesson. */
.lesson-intro {
  margin: 22px 0 20px; padding: 20px 22px;
  background: linear-gradient(135deg, rgba(34, 211, 238, .10), rgba(79, 140, 255, .05));
  border: 1px solid rgba(34, 211, 238, .26);
  border-radius: var(--radius);
  font-size: 1.04rem; line-height: 1.75;
}

/* Vocabulary box, collapsible so it does not push the lesson down the page. */
.term-box {
  margin-bottom: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.term-box > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; cursor: pointer; font-weight: 650; font-size: .95rem;
  list-style: none; transition: background var(--fast);
}
.term-box > summary::-webkit-details-marker { display: none; }
.term-box > summary:hover { background: var(--panel-2); }
.term-box > summary > span:first-child { display: flex; align-items: center; gap: 8px; }
.term-box > summary::after {
  content: "+"; font-family: var(--mono); font-size: 1.1rem; color: var(--muted);
  flex: none; margin-left: auto; padding-left: 10px;
}
.term-box[open] > summary { border-bottom: 1px solid var(--line); background: var(--panel-2); }
.term-box[open] > summary::after { content: "\2212"; }

.term-list { display: grid; gap: 1px; padding: 6px 0; }
.term-item {
  display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px;
  padding: 10px 18px; font-size: .93rem; line-height: 1.6;
}
.term-item:nth-child(odd) { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.term-item dfn {
  font-style: normal; font-weight: 650; color: var(--accent-3);
}
.term-item span { color: var(--text-dim); }
@media (max-width: 640px) {
  .term-item { grid-template-columns: 1fr; gap: 3px; }
}

/* Closing line the reader should carry away. */
.takeaway {
  margin: 26px 0 0; padding: 20px 22px;
  background: linear-gradient(135deg, rgba(34, 214, 127, .10), transparent);
  border: 1px solid rgba(34, 214, 127, .28);
  border-left: 3px solid var(--up);
  border-radius: var(--radius);
  font-size: 1.02rem;
}

/* ------------------------------------------------------- dashboard controls */

.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.control-grid > div {
  padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--line-soft);
}
.control-grid span {
  display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin-bottom: 3px;
}
.control-grid b { display: block; font-family: var(--mono); font-size: 1.1rem; font-weight: 700; }
.control-grid small { display: block; font-size: .76rem; margin-top: 2px; }
@media (max-width: 420px) { .control-grid { grid-template-columns: 1fr; } }


/* Module covers fade into the glass card instead of sitting on a solid one. */
.module-card .art { -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
/* ---------------------------------------------------------- user options menu */
.umenu { position: relative; display: inline-flex; }
.umenu-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--glass-border, var(--line)); border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .07); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background var(--fast), border-color var(--fast);
}
.umenu-btn:hover { background: rgba(255, 255, 255, .12); border-color: var(--accent); }
.umenu-btn .avatar { width: 30px; height: 30px; border-radius: 50%; }
.umenu-panel {
  position: absolute; top: calc(100% + 10px); right: 0; width: 280px; z-index: 80; overflow: hidden;
  background: var(--glass-bg, var(--panel)); border: 1px solid var(--glass-border, var(--line)); border-radius: 16px;
  box-shadow: var(--glass-hi, none), var(--shadow-lift);
  -webkit-backdrop-filter: var(--glass-blur, blur(16px)); backdrop-filter: var(--glass-blur, blur(16px));
}
.umenu-head { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-size: .92rem; }
.umenu-head .avatar { border-radius: 50%; flex: none; }
.umenu-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  color: var(--text-dim); font-size: .9rem; font-weight: 550; text-decoration: none;
  transition: background var(--fast), color var(--fast);
}
.umenu-item:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.umenu-item .ico { color: var(--muted); flex: none; }
.umenu-item .badge { margin-left: auto; }
.umenu-sep { position: relative; height: 1px; margin: 6px 0; background: var(--line-soft); }
.umenu-sep span {
  position: absolute; left: 16px; top: -7px; padding: 0 6px; font-size: .66rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--gold); background: var(--bg);
}
@media (max-width: 640px) {
  .umenu-name { display: none; }
  .umenu-panel { position: fixed; top: 60px; right: 10px; left: 10px; width: auto; }
}

/* Uploaded avatar image. */
.avatar-img { border-radius: 12px; object-fit: cover; display: block; }
.umenu .avatar-img, .umenu-head .avatar-img { border-radius: 50%; }

/* Hands-on task lesson card. */
.task-card {
  margin: 0 0 24px; padding: 22px 24px; border-radius: var(--radius);
  background: var(--glass-bg, var(--panel)); border: 1px solid rgba(79, 140, 255, .35);
  box-shadow: var(--glass-hi, none), 0 0 0 1px rgba(79, 140, 255, .08), var(--shadow);
  -webkit-backdrop-filter: var(--glass-blur, none); backdrop-filter: var(--glass-blur, none);
}
.task-card.pass { border-color: rgba(34, 214, 127, .5); box-shadow: var(--glass-hi, none), 0 0 40px -18px rgba(34, 214, 127, .8), var(--shadow); }
.task-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; color: var(--accent-3); }
.task-card.pass .task-status { color: var(--up); }
.task-steps { margin: 0 0 14px; padding-left: 1.3em; color: var(--text-dim); font-size: .95rem; display: grid; gap: 6px; }
.task-detail { font-family: var(--mono); font-size: .84rem; color: var(--muted); margin: 0 0 14px; }
.task-card.pass .task-detail { color: var(--up); }

/* ---------------------------------------------------- popovers over content */
/* Menus and the notification panel must read over any page: near-opaque fill,
   heavy blur, and a dimmed, blurred backdrop behind them while open. */
.umenu-panel, .notif-panel {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)),
    color-mix(in srgb, var(--bg) 92%, #ffffff 8%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  border-color: rgba(255, 255, 255, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 30px 80px -24px rgba(0, 0, 0, .95), 0 0 0 1px rgba(0, 0, 0, .35);
  z-index: 90;
}
:root[data-theme="light"] .umenu-panel, :root[data-theme="light"] .notif-panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .9));
  border-color: rgba(15, 23, 42, .12);
  box-shadow: 0 30px 70px -28px rgba(15, 23, 42, .5);
}
.umenu-item:hover, .notif-item:hover { background: rgba(255, 255, 255, .09); }
:root[data-theme="light"] .umenu-item:hover, :root[data-theme="light"] .notif-item:hover { background: rgba(15, 23, 42, .06); }
.umenu-sep span { background: color-mix(in srgb, var(--bg) 92%, #ffffff 8%); }

/* Long menus scroll inside themselves. The panels hang from the sticky header,
   so scrolling the page never brings their lower rows into view; the
   administrator's account menu is taller than most laptop screens. app.js sets
   the exact height on open (CTA.popoverFit); this is the fallback. */
.umenu-panel, .notif-panel {
  max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .28) transparent;
}
.umenu-panel::-webkit-scrollbar, .notif-panel::-webkit-scrollbar { width: 8px; }
.umenu-panel::-webkit-scrollbar-thumb, .notif-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .22); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box;
}
:root[data-theme="light"] .umenu-panel, :root[data-theme="light"] .notif-panel { scrollbar-color: rgba(15, 23, 42, .3) transparent; }
:root[data-theme="light"] .umenu-panel::-webkit-scrollbar-thumb,
:root[data-theme="light"] .notif-panel::-webkit-scrollbar-thumb { background-color: rgba(15, 23, 42, .25); }
/* A soft edge at the bottom says "there is more below" while the menu scrolls. */
.umenu-panel.is-scrollable:not(.at-end) { -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); }
/* Shorter rows on short screens, so most menus fit without scrolling at all. */
@media (max-height: 860px) {
  .umenu-head { padding: 11px 16px; }
  .umenu-item { padding: 8px 16px; }
  .umenu-sep { margin: 5px 0; }
}

/* Backdrop injected by JS while a header popover is open. Sits under the header
   (z 60) so the header and its menu stay crisp; everything else dims and blurs. */
.popover-backdrop {
  position: fixed; inset: 0; z-index: 55; cursor: default;
  background: rgba(3, 6, 14, .45);
  -webkit-backdrop-filter: blur(6px) saturate(80%);
  backdrop-filter: blur(6px) saturate(80%);
  opacity: 0; transition: opacity var(--med);
}
.popover-backdrop.show { opacity: 1; }
:root[data-theme="light"] .popover-backdrop { background: rgba(15, 23, 42, .28); }
@media (prefers-reduced-motion: reduce) { .popover-backdrop { transition: none; } }

/* ------------------------------------------------- native controls, themed */
/* Tell the browser which scheme we are in so its own widgets (file button,
   select popups, date pickers, scrollbars) stop rendering stale white. */

/* File inputs: the field is a glass box, the picker is a proper button. */
input[type="file"] {
  width: 100%; padding: 6px 8px; font: inherit; font-size: .9rem; color: var(--text-dim);
  background: rgba(255, 255, 255, .05); border: 1px solid var(--glass-border, var(--line));
  border-radius: var(--radius-sm); cursor: pointer;
}
input[type="file"]::file-selector-button, input[type="file"]::-webkit-file-upload-button {
  margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 9px; cursor: pointer;
  font: inherit; font-size: .86rem; font-weight: 650; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -10px rgba(79, 140, 255, .9);
  transition: transform var(--fast), box-shadow var(--fast);
}
input[type="file"]:hover::file-selector-button, input[type="file"]:hover::-webkit-file-upload-button { transform: translateY(-1px); }
:root[data-theme="light"] input[type="file"] { background: rgba(255, 255, 255, .7); }

/* Range sliders, checkboxes, radios, colour pickers. */
input[type="range"] { accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input[type="color"] { background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-border, var(--line)); }
select option { background: color-mix(in srgb, var(--bg) 92%, #fff 8%); color: var(--text); }

/* Any leftover unstyled <button> falls back to a ghost button rather than the
   browser's grey. Styled buttons override this through their own classes. */
button:not([class]) {
  font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer;
  padding: 8px 14px; border-radius: 9px; color: var(--text);
  background: rgba(255, 255, 255, .07); border: 1px solid var(--glass-border, var(--line));
}

/* Auth page logo: same inline mark as the header, centred, no chip. */
.auth-logo { display: flex; justify-content: center; margin: 0 auto 14px; color: var(--text); }
.auth-logo .brand-logo-img { margin: 0 auto; }

/* Quiz: a locked (correct) question fades its other options and shows the explanation. */
.question.locked .option:not(.correct) { opacity: .45; }
.question.locked .option { cursor: default; }
.question .explain { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .88rem;
  color: var(--text-dim); background: rgba(34, 214, 127, .08); border: 1px solid rgba(34, 214, 127, .25); }

/* Coach block: Manuel speaking directly to the student inside a lesson. */
.lesson-body .coach {
  display: flex; gap: 14px; align-items: flex-start; margin: 22px 0; padding: 16px 18px;
  border-radius: var(--radius); border: 1px solid rgba(246, 196, 83, .35);
  background: linear-gradient(135deg, rgba(246, 196, 83, .10), rgba(255, 255, 255, .02));
}
.lesson-body .coach::before {
  content: "M"; flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-family: Georgia, serif; font-weight: 700; color: #241a02;
  background: linear-gradient(135deg, var(--gold), #ffdf8a); box-shadow: 0 6px 18px -8px rgba(246, 196, 83, .9);
}
.lesson-body .coach p { margin: 0 0 .5em; font-size: .97rem; }
.lesson-body .coach p:last-child { margin-bottom: 0; }
.lesson-body .coach strong:first-child { color: var(--gold); }
.lesson-body .try-it {
  margin: 18px 0; padding: 12px 16px; border-left: 3px solid var(--accent-3); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(34, 211, 238, .07); font-size: .93rem;
}

/* ---------------------------------------------- adaptive quiz + sequence lock */
.question.was-wrong { border-left: 3px solid var(--down); padding-left: 12px; }
.question .option.revealed { border-color: var(--up); background: rgba(34, 214, 127, .12); }
.question .explain.explain-wrong { background: rgba(255, 84, 112, .08); border-color: rgba(255, 84, 112, .3); }
.question .option.wrong { border-color: var(--down); background: rgba(255, 84, 112, .10); }
.lesson-row.is-locked, .is-locked-card { opacity: .6; cursor: not-allowed; }
.is-locked-card:hover { transform: none; }
.lesson-nav a.is-locked { opacity: .55; pointer-events: none; }

/* Automatic analysis panel */
.analysis .an-summary { font-size: .98rem; margin: 0 0 14px; color: var(--text); }
.an-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.an-levels > div { padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .04); border: 1px solid var(--line-soft); }
.an-levels span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 3px; }
.an-levels b { font-size: 1.02rem; }
.an-reasons { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.an-reasons li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--text-dim); }
.an-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: currentColor; }
.an-dot.up { color: var(--up); } .an-dot.down { color: var(--down); } .an-dot.gold { color: var(--gold); } .an-dot.muted { color: var(--muted); }

/* Kwacha FX tool inside lessons */
.lesson-body .fx-tool { margin: 22px 0; padding: 18px; border-radius: var(--radius); border: 1px solid rgba(34, 211, 238, .3);
  background: linear-gradient(135deg, rgba(34, 211, 238, .08), rgba(255, 255, 255, .02)); }
.fx-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fx-head b { display: inline-flex; align-items: center; gap: 6px; }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.lesson-body .fx-out { width: 100%; font-size: .9rem; }
.lesson-body .fx-out td, .lesson-body .fx-out th { padding: 8px 10px; }
.lesson-body .fx-out .num { font-family: var(--mono); text-align: right; }

/* Chart demos inside lessons ({{CHART ...}} placeholders) */
.lesson-body .lesson-chart {
  margin: 26px 0; padding: 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
}
.lesson-chart-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: .88rem;
}
.lesson-chart-name { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lesson-chart-name b { font-family: var(--mono); }
.lesson-chart-ctl { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lesson-chart-mount { position: relative; width: 100%; }
.lesson-chart-legend { flex-wrap: wrap; row-gap: 5px; }
.lesson-chart-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.lesson-chart-legend .lg i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.lesson-body .lesson-chart-caption { margin: 0; padding: 12px 14px; font-size: .92rem; color: var(--text-dim); border-top: 1px solid var(--line-soft); }
@media (max-width: 720px) { .lesson-chart-head .btn { display: none; } }

/* Small-screen "use a computer" notice. Hidden on wide screens by the media query. */
.pc-note {
  display: none; align-items: center; gap: 10px; margin: 12px 16px 0; padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: .84rem; color: var(--text-dim);
  background: rgba(79, 140, 255, .10); border: 1px solid rgba(79, 140, 255, .3);
}
.pc-note .ico { color: var(--accent-3); flex: none; }
.pc-note span { flex: 1; }
.pc-note-close { border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 2px 6px; }
@media (max-width: 820px) { .pc-note:not([hidden]) { display: flex; } }

/* ---- Strategy backtester ---- (backtest.php, tools.php card) */
.bt-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
.bt-form { position: sticky; top: 84px; }
.bt-params { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 14px 0; margin: 0 0 16px; min-width: 0; }
.bt-params[hidden] { display: none; }
.bt-params legend { padding: 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.bt-kpi6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bt-kpi6 .box b { font-size: 1.25rem; }
.bt-curve { padding: 14px 14px 10px; }
.bt-curve canvas { display: block; width: 100%; }
.bt-detail { margin-top: 0; grid-template-columns: 1fr 1fr; }
.bt-reason { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; border: 1px solid var(--line); color: var(--text-dim); background: var(--panel-2); }
.bt-reason-stop { color: var(--down); border-color: rgba(255, 84, 112, .45); background: rgba(255, 84, 112, .10); }
.bt-reason-target { color: var(--up); border-color: rgba(34, 214, 127, .45); background: rgba(34, 214, 127, .10); }
.bt-reason-signal { color: var(--accent); border-color: rgba(79, 140, 255, .45); background: rgba(79, 140, 255, .10); }
.bt-rules { margin: 0 0 14px; padding-left: 20px; font-size: .92rem; }
.bt-rules li { margin-bottom: 7px; }
.bt-caveats { margin-bottom: 0; }
.bt-caveats p { margin: 0 0 6px; }
.bt-caveats ul { margin: 0; padding-left: 18px; font-size: .88rem; }
.bt-caveats li { margin-bottom: 4px; }
.bt-tools-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.bt-tools-card h2 { margin: 6px 0 6px; font-size: 1.3rem; }
.bt-tools-card p { margin: 0; max-width: 62ch; }
.bt-tools-card .btn { flex: none; }
@media (max-width: 1000px) {
  .bt-layout { grid-template-columns: 1fr; }
  .bt-form { position: static; }
  .bt-kpi6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .bt-kpi6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-detail { grid-template-columns: 1fr; }
  .bt-tools-card { flex-direction: column; align-items: flex-start; }
}

/* ---- Strategy builder ---- */
/* strategy.php list, editor and print view; the tools.php card row. */
.st-tools-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.st-tools-row .bt-tools-card { margin-bottom: 0; flex-direction: column; align-items: flex-start; }
.st-list { display: grid; gap: 16px; }
.st-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.st-item-head h2 { margin: 0; font-size: 1.15rem; }
.st-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 8px; font-size: .86rem; color: var(--text-dim); }
.st-meta b { color: var(--text); font-weight: 600; }
.st-journal { margin: 0; font-size: .86rem; }
.st-journal b { font-weight: 600; }
.st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.st-actions form { margin: 0; }
.st-missing { font-size: .84rem; color: var(--muted); }
.st-missing b { color: var(--gold); font-weight: 600; }
.st-status-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; padding: 12px 16px;
  font-size: .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2);
}
.st-status-bar-ctl { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.st-status-bar-ctl form { margin: 0; }
.st-num { max-width: 220px; }
.st-count { display: block; margin-top: 4px; font-size: .76rem; text-align: right; color: var(--muted); font-family: var(--mono); }
.st-count.is-near { color: var(--gold); }
.st-tests { margin: 0; padding-left: 20px; font-size: .88rem; color: var(--text-dim); }
.st-tests li { margin-bottom: 8px; }
.st-tests b { color: var(--text); font-weight: 600; }

/* Print view: a one-page document on screen, plain black on white on paper. */
.st-print { max-width: 860px; }
.st-print-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.st-doc { padding: 40px 48px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.st-doc-head { padding-bottom: 14px; margin-bottom: 24px; border-bottom: 2px solid var(--line); }
.st-doc-head h1 { margin: 0 0 8px; font-size: 1.7rem; }
.st-doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: .86rem; color: var(--muted); }
.st-doc section { margin-bottom: 18px; break-inside: avoid; }
.st-doc h2 { margin: 0 0 4px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.st-doc p { margin: 0; line-height: 1.6; white-space: pre-line; }
.st-doc-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.st-doc-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.st-blank { color: var(--muted); font-style: italic; }
@media (max-width: 760px) {
  .st-tools-row { grid-template-columns: 1fr; }
  .st-doc { padding: 24px 20px; }
  .st-doc-numbers { grid-template-columns: 1fr; }
  .st-status-bar-ctl { margin-left: 0; }
}
@media print {
  @page { margin: 18mm; }
  .pc-note, .st-print-actions, body:has(.st-print) > .wrap { display: none !important; }
  .st-print { max-width: none; padding: 0; }
  body:has(.st-print) .section-sm { padding: 0; }
  .st-doc { padding: 0; border: 0; border-radius: 0; background: #fff; color: #000; box-shadow: none; }
  .st-doc-head { border-color: #000; }
  .st-doc h1, .st-doc p { color: #000; }
  .st-doc h2, .st-doc-meta, .st-doc-foot, .st-blank { color: #444; }
  .st-doc .badge { color: #000; background: none; border-color: #999; }
  .st-doc-foot { border-color: #999; }
}

/* Chart-pattern schematic diagrams inside lessons (fibonacci-and-patterns) */
.lesson-body .pattern-fig {
  margin: 22px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel-2); color: var(--text);
}
.lesson-body .pattern-fig svg { display: block; width: 100%; height: auto; }
.lesson-body .pattern-fig figcaption { margin-top: 8px; font-size: .9rem; color: var(--text-dim); }
.lesson-body .pattern-fig text { fill: var(--muted); font-family: var(--mono); }

/* ------------------------------------------------------------- coin logos */

/* Logos ship in assets/img/coins. A thin ring keeps the dark ones (XRP, SOL)
   visible on the dark panels. */
img.coin-logo { background: transparent; object-fit: contain; box-shadow: 0 0 0 1px var(--line-soft); }
.sym-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tk .coin-logo { align-self: center; box-shadow: none; }

/* -------------------------------------------------------- watchlist star */


svg.star { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; vertical-align: -2px; }
svg.title-star { color: var(--star-gold); fill: var(--star-gold); vertical-align: -3px;
  filter: drop-shadow(0 0 8px rgba(246, 196, 83, .45)); }

.star-btn {
  position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--muted);
  font-family: inherit; cursor: pointer;
  transition: color var(--fast), background var(--fast), border-color var(--fast);
}
.star-btn .star { width: 18px; height: 18px; fill: transparent; transition: fill var(--fast), transform var(--med); }
.star-btn:hover { color: var(--star-gold); background: rgba(246, 196, 83, .10); }
.star-btn:hover .star { transform: scale(1.12) rotate(-8deg); }
.star-btn:focus-visible { outline: 2px solid var(--star-gold); outline-offset: 2px; }
.star-btn.on { color: var(--star-gold); background: rgba(246, 196, 83, .12); border-color: rgba(246, 196, 83, .35); }
.star-btn.on:hover { background: rgba(246, 196, 83, .20); }
.star-btn.on .star { fill: currentColor; filter: drop-shadow(0 0 6px rgba(246, 196, 83, .55)); }
.star-btn[aria-busy="true"] { opacity: .6; cursor: progress; }

/* Labelled pill on the single market page. */
.star-btn-label {
  width: auto; height: auto; grid-auto-flow: column; gap: 7px; padding: 7px 14px 7px 11px;
  border-radius: 999px; border-color: var(--line); background: var(--bg-soft);
  color: var(--text-dim); font-size: .86rem; font-weight: 600;
}
.star-btn-label .star { width: 16px; height: 16px; color: var(--muted); }
.star-btn-label:hover .star, .star-btn-label.on .star { color: var(--star-gold); }
.star-btn-label.on { color: var(--text); border-color: rgba(246, 196, 83, .55); background: rgba(246, 196, 83, .12); }

/* Pop and a ring when a market is added. */
.star-btn.star-pop .star { animation: starPop .5s var(--ease); }
.star-btn.star-pop:not(.star-btn-label)::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--star-gold); pointer-events: none; animation: starRing .55s var(--ease) forwards;
}
@keyframes starPop { 0% { transform: scale(.6); } 45% { transform: scale(1.3) rotate(-10deg); } 100% { transform: scale(1); } }
@keyframes starRing { 0% { opacity: .9; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.6); } }

table.data td.star-cell { width: 44px; padding: 6px 0 6px 10px; }
table.data th.star-head { width: 44px; padding-left: 18px; color: var(--star-gold); }

/* A starred market shows on its whole row: a gold edge and a faint gold wash.
   Not on the watchlist page, where every row is starred. */
table.data:not(#watch-table) tbody tr:has(.watch-btn.on) > td:first-child { box-shadow: inset 3px 0 0 var(--star-gold); }
table.data:not(#watch-table) tbody tr:has(.watch-btn.on) { background: linear-gradient(90deg, rgba(246, 196, 83, .08), transparent 45%); }
table.data:not(#watch-table) tbody tr:has(.watch-btn.on):hover { background: linear-gradient(90deg, rgba(246, 196, 83, .12), var(--panel-2) 45%); }

/* Rows hidden by a filter follow the last visible one, so tr:last-child no longer
   finds it. A rule of its own: a browser without :has() drops only this one. */
table.data tbody tr:not([hidden]):not(:has(~ tr:not([hidden]))) > td { border-bottom: 0; }

/* ------------------------------------------------------ board filter tabs */

.board-head { flex-wrap: wrap; gap: 12px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.seg-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font: inherit; font-size: .88rem; font-weight: 650;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: color var(--fast), background var(--fast), box-shadow var(--fast);
}
.seg-btn:hover { color: var(--text); }
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg-btn.active { background: var(--panel-3); color: var(--text); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .6); }
.seg-btn .star { color: var(--star-gold); }
.seg-btn > svg, .seg-count { flex-shrink: 0; }
.seg-btn.active .star { fill: var(--star-gold); }
.seg-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px;
  border-radius: 99px; background: var(--panel-3); color: var(--text-dim);
  font-family: var(--mono); font-size: .72rem; font-weight: 700;
}
.seg-btn.active .seg-count { background: var(--accent); color: #fff; }
input.board-search { width: 200px; padding: 7px 12px; font-size: .86rem; }
table.data tr.board-empty:hover { background: transparent; }
.board-empty[hidden] { display: none; }
@media (max-width: 640px) {
  .board-head > .row { width: 100%; }
  input.board-search { flex: 1; width: auto; min-width: 0; }
  .seg { max-width: 100%; flex-wrap: wrap; }
  .seg-btn { padding: 7px 10px; }
}

/* Screener "watchlist only" switch. */
label.check-chip {
  display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft);
  color: var(--text-dim); font-size: .86rem; font-weight: 600; cursor: pointer;
}
label.check-chip input { width: auto; margin: 0; accent-color: var(--star-gold); }
label.check-chip .star { color: var(--star-gold); }
label.check-chip:has(input:checked) { color: var(--text); border-color: rgba(246, 196, 83, .55); background: rgba(246, 196, 83, .12); }
label.check-chip:has(input:checked) .star { fill: var(--star-gold); }

/* ---------------------------------------------------------- watchlist page */

#watch-kpi[hidden] { display: none; }
.badge-bell { color: var(--star-gold); border-color: rgba(246, 196, 83, .45); background: rgba(246, 196, 83, .10); }
a.badge { text-decoration: none; }

.range-bar {
  position: relative; height: 6px; margin: 6px 0 5px; border-radius: 99px;
  background: linear-gradient(90deg, rgba(255, 84, 112, .55), rgba(141, 154, 182, .35) 50%, rgba(34, 214, 127, .55));
}
.range-dot {
  position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%;
  background: var(--text); box-shadow: 0 0 0 3px var(--panel); transition: left .6s var(--ease);
}
.range-ends { display: flex; justify-content: space-between; gap: 8px; font-size: .72rem; color: var(--muted); }

.watch-add-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.watch-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 8px 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-soft); transition: border-color var(--fast), transform var(--fast);
}
.watch-chip[hidden] { display: none; }
.watch-chip:hover { border-color: rgba(246, 196, 83, .45); transform: translateY(-1px); }
.watch-chip .coin-cell { min-width: 0; color: var(--text); }
.watch-chip .coin-name > span { display: flex; gap: 6px; font-family: var(--mono); }
/* .coin-name span mutes every span; the 24h change keeps its colour. */
.watch-chip .ch.up { color: var(--up); }
.watch-chip .ch.down { color: var(--down); }

tr.row-in { animation: rowIn .9s var(--ease); }
@keyframes rowIn { from { background: rgba(246, 196, 83, .18); } to { background: transparent; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .star-btn .star, .star-btn.star-pop .star, tr.row-in, .range-dot { animation: none; transition: none; }
  .star-btn.star-pop:not(.star-btn-label)::after { animation: none; content: none; }
  .star-btn:hover .star, .watch-chip:hover { transform: none; }
}

/* The bell renders its count hidden when nothing is unread; display: inline-flex
   on .notif-count used to override that and show a red 0. */
.notif-count[hidden] { display: none; }

/* ==========================================================================
   SHELL EXTRAS: mobile drawer, bottom tab bar, command palette, dialogs.
   All four are direct children of <body>, never of the header.
   ========================================================================== */

/* ------------------------------------------------------------------ drawer */

.drawer { position: fixed; inset: 0; z-index: 120; visibility: hidden; pointer-events: none; transition: visibility 0s linear .42s; }
.drawer::before {
  content: ""; position: absolute; inset: 0; background: var(--dim);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity var(--med);
}
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(390px, 92vw); overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 16px calc(26px + env(safe-area-inset-bottom));
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(26px) saturate(180%); backdrop-filter: blur(26px) saturate(180%);
  border-left: 1px solid var(--glass-border);
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, .9);
  transform: translateX(104%); transition: transform .42s var(--ease);
}
.drawer.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.drawer.open::before { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
html.drawer-open, html.modal-open { overflow: hidden; }

.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.drawer .search-btn { width: 100%; min-width: 0; height: 44px; padding: 0 12px 0 14px; justify-content: flex-start; }
.drawer .search-btn span, .drawer .search-btn kbd { display: inline-block; }
.drawer-user { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; padding: 12px; border-radius: 14px; background: var(--grad-soft); border: 1px solid var(--line); color: var(--text); }
.drawer-user .avatar { border-radius: 50%; }
.drawer-user small { display: block; color: var(--muted); font-size: .78rem; }
.drawer-title { margin: 18px 4px 6px; font-family: var(--mono); font-size: .66rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--accent-3); }
.drawer-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  color: var(--text-dim); font-size: .98rem; font-weight: 550;
}
.drawer-link .ico { color: var(--muted); flex: none; }
.drawer-link:hover, .drawer-link.active { color: var(--text); background: var(--panel-2); }
.drawer-link.active .ico { color: var(--accent-3); }
.drawer-link .tier-badge, .drawer-link .badge { margin-left: auto; }
.drawer.open .drawer-link, .drawer.open .drawer-title { animation: drawerIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms + 80ms); }
@keyframes drawerIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.drawer-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.drawer-foot .btn { width: 100%; }

/* ----------------------------------------------------------------- tab bar */

.tabbar { display: none; }

/* --------------------------------------------------------- command palette */

.palette {
  position: fixed; inset: 0; z-index: 300; display: grid; justify-items: center; align-items: start;
  padding: 11vh 16px 16px; visibility: hidden; pointer-events: none; transition: visibility 0s linear .22s;
}
.palette::before {
  content: ""; position: absolute; inset: 0; background: var(--dim);
  -webkit-backdrop-filter: blur(8px) saturate(80%); backdrop-filter: blur(8px) saturate(80%);
  opacity: 0; transition: opacity .22s ease;
}
.palette.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.palette.open::before { opacity: 1; }
.palette-box {
  position: relative; width: min(680px, 100%); max-height: min(72vh, 620px); display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; background: var(--glass-strong);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi), 0 40px 120px -30px rgba(0, 0, 0, .95), 0 0 0 1px rgba(34, 211, 238, .14), 0 0 80px -30px rgba(34, 211, 238, .5);
  transform: translateY(-12px) scale(.97); opacity: 0; transition: transform .3s var(--spring), opacity .2s ease;
}
.palette.open .palette-box { transform: none; opacity: 1; }
.palette-input-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); color: var(--accent-3); }
input.palette-input, input.palette-input:focus {
  flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; padding: 4px 0; border-radius: 0;
  font-size: 1.05rem; color: var(--text);
}
.palette-list { overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.palette-group { padding: 10px 10px 4px; font-family: var(--mono); font-size: .64rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--text-dim); cursor: pointer; }
.palette-item:hover { color: var(--text-dim); }
.palette-item.sel { background: var(--grad-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--accent-3); }
.pi-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--accent-3); background: var(--panel-2); border: 1px solid var(--line-soft); }
.pi-ico img { width: 20px; height: 20px; }
.pi-text { min-width: 0; flex: 1; }
.pi-text b { display: block; color: var(--text); font-weight: 600; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-text small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-kind { flex: none; font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.palette-empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: .92rem; }
.palette-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line-soft); font-size: .74rem; color: var(--muted); }
.palette-foot kbd { margin-right: 4px; }

/* ----------------------------------------------------------------- dialogs */

.modal {
  position: fixed; inset: 0; z-index: 320; display: grid; place-items: center; padding: 18px;
  visibility: hidden; pointer-events: none; transition: visibility 0s linear .22s;
}
.modal::before {
  content: ""; position: absolute; inset: 0; background: var(--dim);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .22s ease;
}
.modal.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.modal.open::before { opacity: 1; }
.modal-box {
  position: relative; width: min(480px, 100%); max-height: 88vh; overflow-y: auto;
  border-radius: 20px; background: var(--glass-strong);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi), 0 40px 120px -30px rgba(0, 0, 0, .95), 0 0 0 1px rgba(34, 211, 238, .1);
  transform: translateY(10px) scale(.96); opacity: 0; transition: transform .3s var(--spring), opacity .2s ease;
}
.modal-wide .modal-box { width: min(720px, 100%); }
.modal.open .modal-box { transform: none; opacity: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal-head h3 { margin: 0; font-size: 1.12rem; }
.modal-body { padding: 12px 20px 4px; color: var(--text-dim); font-size: .95rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 16px 20px 20px; }
.modal-x { border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 8px; }
.modal-x:hover { color: var(--text); background: var(--panel-2); }

/* ------------------------------------------------------------ small pieces */

/* Compact stat chip: a label over a number. */
.stat-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-chip { padding: 9px 14px; border-radius: 13px; background: var(--panel); border: 1px solid var(--line-soft); min-width: 104px; }
.stat-chip span { display: block; font-family: var(--mono); font-size: .64rem; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.stat-chip b { font-family: var(--display); font-variant-numeric: tabular-nums; font-size: 1.12rem; }

/* Hairline with a glowing centre. */
.glow-rule { height: 1px; border: 0; margin: 28px 0; background: linear-gradient(90deg, transparent, var(--accent-3) 35%, var(--accent-2) 65%, transparent); opacity: .5; }

/* Segmented tab strip used by tools, practice and performance. */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 5px; margin-bottom: 20px; border-radius: 15px; background: var(--bg-soft); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border: 0; border-radius: 11px; cursor: pointer;
  background: transparent; color: var(--muted); font: inherit; font-size: .9rem; font-weight: 650; white-space: nowrap; text-decoration: none;
  transition: color var(--fast), background var(--fast), box-shadow var(--fast);
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; background: var(--grad); box-shadow: 0 8px 22px -10px rgba(79, 140, 255, .95); }
.tab-panel[hidden] { display: none; }
.tab-panel { animation: popIn .35s var(--ease); }

/* Tooltip from a data-tip attribute. */
[data-tip] { position: relative; }
@media (hover: hover) and (pointer: fine) {
  [data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 50;
    width: max-content; max-width: 260px; padding: 7px 10px; border-radius: 9px; white-space: normal;
    font-family: var(--font); font-size: .76rem; font-weight: 500; line-height: 1.4; letter-spacing: 0; text-transform: none; color: var(--text);
    background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); animation: popIn .18s var(--ease);
  }
}

/* ==========================================================================
   QUESTIONS, EXAMS, PRACTICE
   ========================================================================== */

/* Lesson page: a calmer title than the marketing pages. */
.lesson-layout h1 { font-size: clamp(1.8rem, 3.8vw, 2.7rem); }

/* -------------------------------------------------------- question blocks */

.question { border-top: 1px solid var(--line-soft); padding: 22px 0; transition: border-color var(--med); }
.question:first-of-type { border-top: 0; }
.question > p.q-text { display: flex; gap: 12px; align-items: flex-start; font-weight: 650; font-size: 1.02rem; line-height: 1.5; margin-bottom: .8em; }
.q-no {
  flex: none; display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 9px;
  font-family: var(--mono); font-size: .78rem; font-weight: 700; color: var(--accent-3);
  background: var(--grad-soft); border: 1px solid var(--line);
}
.q-hint { margin: -4px 0 10px; font-size: .82rem; color: var(--muted); }
.q-context { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--line-soft); font-size: .92rem; overflow-x: auto; }
.q-context table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.q-context th, .q-context td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.q-context th { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.q-context td.num, .q-context th.num { text-align: right; font-family: var(--mono); }
.q-context p:last-child { margin-bottom: 0; }

.option {
  position: relative; display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; margin: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel);
  font-size: .95rem; font-weight: 500; color: var(--text-dim);
  transition: border-color var(--fast), background var(--fast), transform var(--fast), box-shadow var(--fast);
}
.option:hover { border-color: var(--accent); background: var(--panel-2); color: var(--text); }
.option.picked { border-color: var(--accent-3); background: rgba(34, 211, 238, .09); color: var(--text); box-shadow: 0 0 0 1px rgba(34, 211, 238, .25), 0 0 26px -14px rgba(34, 211, 238, .9); }
.option input { margin-top: 3px; accent-color: var(--accent-3); flex: none; width: 16px; height: 16px; }
.option.correct { border-color: var(--up); background: rgba(34, 214, 127, .11); color: var(--text); box-shadow: none; }
.option.wrong { border-color: var(--down); background: rgba(255, 84, 112, .10); box-shadow: none; }
.question.locked .option:not(.correct) { opacity: .45; }
.question.locked .option, .question.was-wrong .option { cursor: default; }
.question.was-wrong { border-left: 3px solid var(--down); padding-left: 14px; }
.question .option.revealed { border-color: var(--up); background: rgba(34, 214, 127, .12); }
.question.just-right { animation: lockIn .7s var(--spring); }
@keyframes lockIn { 0% { transform: scale(1); } 35% { transform: scale(1.012); } 100% { transform: scale(1); } }
.question.nudge { animation: shake .5s var(--ease); }

/* Typed-number answers. */
.q-num { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); overflow: hidden; transition: border-color var(--fast), box-shadow var(--fast); }
.q-num:focus-within { border-color: var(--accent-3); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }
.q-affix { display: grid; place-items: center; padding: 0 13px; font-family: var(--mono); font-weight: 700; color: var(--muted); background: var(--panel-2); }
input.q-num-input, input.q-num-input:focus {
  width: 190px; max-width: 60vw; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  font-family: var(--mono); font-size: 1.1rem; font-weight: 700; padding: 12px 14px;
}
input.q-num-input.is-right { color: var(--up); }
input.q-num-input.is-wrong { color: var(--down); text-decoration: line-through; }

/* Put-in-order answers. */
.q-order { list-style: none; counter-reset: ord; margin: 0; padding: 0; display: grid; gap: 8px; }
.q-order li {
  counter-increment: ord; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); font-size: .95rem;
}
.q-order li.moved { animation: popIn .25s var(--ease); }
.q-order-no::before { content: counter(ord); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-family: var(--mono); font-size: .76rem; font-weight: 700; color: var(--accent-3); background: var(--grad-soft); }
.q-order-text { flex: 1; min-width: 0; }
.q-order-btns { display: inline-flex; gap: 4px; flex: none; }
.q-order-btns button {
  width: 32px; height: 32px; padding: 0; border-radius: 9px; cursor: pointer; font-size: 1rem; line-height: 1;
  color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--line); transition: all var(--fast);
}
.q-order-btns button:hover:not(:disabled) { color: var(--text); border-color: var(--accent-3); }
.q-order-btns button:disabled { opacity: .35; cursor: default; }
.q-order li:first-child [data-move="-1"], .q-order li:last-child [data-move="1"] { opacity: .3; }
.q-order.is-right li { border-color: rgba(34, 214, 127, .5); background: rgba(34, 214, 127, .08); }
.q-order.is-wrong li { border-color: rgba(255, 84, 112, .45); }

.question .explain {
  margin-top: 12px; padding: 11px 14px; border-radius: var(--radius-sm); font-size: .9rem; line-height: 1.6;
  color: var(--text-dim); background: rgba(34, 214, 127, .08); border: 1px solid rgba(34, 214, 127, .25); border-left-width: 3px;
  animation: popIn .35s var(--ease);
}
.question .explain.explain-wrong { background: rgba(255, 84, 112, .08); border-color: rgba(255, 84, 112, .3); }

/* Lock-in meter in the quiz header: one segment per slot. */
.quiz-meter { display: inline-flex; gap: 4px; }
.quiz-meter i { width: 22px; height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--text) 13%, transparent); transition: background var(--med), box-shadow var(--med); }
.quiz-meter i.on { background: var(--up); box-shadow: 0 0 10px rgba(34, 214, 127, .8); }
.quiz-result { font-family: var(--display); font-size: 1.1rem; font-weight: 700; margin: 0; }

/* ------------------------------------------------------------------ exams */

.exam-bar {
  position: sticky; top: 72px; z-index: 30; margin-bottom: 16px; padding: 14px 16px 12px; border-radius: var(--radius);
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: var(--glass-hi), var(--shadow);
}
.exam-bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.exam-title { font-size: 1.12rem; margin: 0; }
.exam-timer {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 11px;
  font-family: var(--mono); color: var(--accent-3); background: rgba(34, 211, 238, .09); border: 1px solid rgba(34, 211, 238, .3);
}
.exam-timer b { font-size: 1.02rem; letter-spacing: .04em; }
.exam-timer.is-low { color: var(--down); background: rgba(255, 84, 112, .1); border-color: rgba(255, 84, 112, .4); animation: attn 1.2s ease-in-out infinite; }
.exam-dots { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.exam-dot {
  width: 30px; height: 28px; padding: 0; border-radius: 8px; cursor: pointer;
  font-family: var(--mono); font-size: .72rem; font-weight: 700; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line-soft); transition: all var(--fast);
}
.exam-dot:hover { color: var(--text); border-color: var(--accent); }
.exam-dot.is-done { color: var(--text); background: rgba(79, 140, 255, .2); border-color: rgba(79, 140, 255, .5); }
.exam-dot.is-right { color: var(--up); background: rgba(34, 214, 127, .14); border-color: rgba(34, 214, 127, .5); }
.exam-dot.is-wrong { color: var(--down); background: rgba(255, 84, 112, .12); border-color: rgba(255, 84, 112, .5); }
.exam-dot.is-flagged { box-shadow: inset 0 -3px 0 var(--gold); }
.exam-dot.is-current { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 0 16px -4px rgba(34, 211, 238, .9); }
.exam-stage { padding: 22px 24px; }
.exam-stage .question { border: 0; padding: 4px 0 6px; }
.exam-stage .question > p.q-text { font-size: 1.12rem; }
.exam-enter { animation: popIn .32s var(--ease); }
.exam-count { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 6px; }
.exam-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }

.exam-result.is-pass { border-color: rgba(34, 214, 127, .45); box-shadow: var(--glass-hi), var(--shadow), 0 0 70px -30px rgba(34, 214, 127, .8); }
.exam-result.is-fail { border-color: rgba(255, 200, 87, .4); }
.exam-lesson-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; font-size: .92rem; }
.exam-lesson-row .progress { grid-column: 1 / -1; }
.exam-lesson-row a { color: var(--text); }
.exam-review-item { border-top: 1px solid var(--line-soft); }
.exam-review-item:first-child { border-top: 0; }
.exam-review-item[hidden] { display: none; }
.exam-review-item .question { border: 0; padding-bottom: 6px; }
.exam-source { margin: 0 0 18px; font-size: .82rem; color: var(--muted); }

/* --------------------------------------------------------------- practice */

.practice-card { display: flex; flex-direction: column; }
.practice-card p { flex: 1; font-size: .93rem; }
.practice-card .practice-state { flex: none; display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: .88rem; margin: 0 0 12px; }
.practice-card form, .practice-card .btn { align-self: flex-start; }
.practice-card.is-due { border-color: rgba(246, 196, 83, .5); box-shadow: var(--glass-hi), var(--shadow), 0 0 50px -24px rgba(246, 196, 83, .8); }
.exam-card.is-passed { border-color: rgba(34, 214, 127, .4); }
.exam-card form { margin: 0; }
.ring.ring-sm { width: 62px; height: 62px; }
.ring.ring-sm::after { inset: 6px; }
.ring.ring-sm b { font-size: .95rem; }
.final-card {
  border-color: rgba(246, 196, 83, .42);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(246, 196, 83, .14), transparent 55%),
    var(--glass-bg);
}

@media (max-width: 720px) {
  .exam-bar { top: 66px; padding: 12px; }
  .exam-stage { padding: 16px; }
  .exam-dot { width: 27px; height: 26px; }
  .exam-nav .btn { flex: 1 1 auto; }
}

/* ==========================================================================
   REPLAY TRAINER, PERFORMANCE
   ========================================================================== */

.replay-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-top: 1px solid var(--line-soft); background: rgba(255, 255, 255, .03);
}
.replay-bar select { padding: 7px 34px 7px 12px; font-size: .86rem; }
.replay-progress { flex: 1; min-width: 180px; display: grid; gap: 5px; }
.replay-progress span { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; }
.replay-pos { padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-soft); transition: border-color var(--med), box-shadow var(--med); }
.replay-pos.is-up { border-color: rgba(34, 214, 127, .5); box-shadow: 0 0 34px -18px rgba(34, 214, 127, .9); }
.replay-pos.is-down { border-color: rgba(255, 84, 112, .45); box-shadow: 0 0 34px -18px rgba(255, 84, 112, .8); }
.replay-pos b.num { font-family: var(--display); font-size: 1.5rem; }

.perf-curve { display: block; width: 100%; height: auto; color: var(--accent-3); }
.perf-curve.is-down { color: var(--down); }
.perf-curve .pc-grid { stroke: var(--line-soft); stroke-width: 1; }
.perf-curve .pc-base, .perf-bars .pc-base { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 5; opacity: .7; }
.perf-curve .pc-axis { fill: var(--muted); font-family: var(--mono); font-size: 11px; }
.perf-curve .pc-dot { fill: var(--accent-3); stroke: var(--ink); stroke-width: 2; filter: drop-shadow(0 0 6px rgba(34, 211, 238, .9)); }
.perf-caption { margin: 14px 0 6px; font-size: .82rem; color: var(--muted); }
.perf-bars { display: block; width: 100%; height: auto; }
.perf-bars .pb-up { fill: var(--up); opacity: .85; }
.perf-bars .pb-down { fill: var(--down); opacity: .85; }

.insight { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); border-left: 3px solid var(--muted); background: var(--bg-soft); font-size: .89rem; }
.insight b { display: block; margin-bottom: 3px; color: var(--text); font-size: .93rem; }
.insight p { color: var(--text-dim); line-height: 1.55; }
.insight-up { border-left-color: var(--up); }
.insight-down { border-left-color: var(--down); }
.insight-gold { border-left-color: var(--gold); }

/* Risk of ruin simulator (tools.php). */
.mc-canvas-wrap { margin-top: 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); background: var(--bg-soft); overflow: hidden; }
.mc-canvas-wrap canvas { display: block; width: 100%; }
#mc-out .box b { font-size: 1.35rem; }

/* Simulator ticket: "size it from your stop". */
.risk-sizer { margin: 0 0 16px; border: 1px solid rgba(34, 211, 238, .3); border-radius: var(--radius-sm); background: rgba(34, 211, 238, .05); overflow: hidden; }
.risk-sizer > summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 11px 13px; cursor: pointer; list-style: none;
  font-size: .9rem; font-weight: 650; color: var(--text);
}
.risk-sizer > summary::-webkit-details-marker { display: none; }
.risk-sizer > summary .ico { color: var(--accent-3); }
.risk-sizer > summary .badge { margin-left: auto; }
.risk-sizer[open] > summary { border-bottom: 1px solid var(--line-soft); }
.risk-sizer-body { padding: 13px; }
.risk-sizer .field { margin-bottom: 12px; }
.atr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; font-size: .84rem; color: var(--text-dim); }
.atr-row[hidden] { display: none; }
.atr-row small { flex: 1 1 100%; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.atr-presets { display: inline-flex; gap: 6px; margin-left: auto; }
.atr-btn {
  padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(34, 211, 238, .35); background: rgba(34, 211, 238, .08);
  color: var(--text); font: 600 .76rem var(--mono); cursor: pointer; transition: background var(--fast), border-color var(--fast);
}
.atr-btn:hover { background: rgba(34, 211, 238, .18); border-color: var(--accent-3); }
label.check-line { display: flex; gap: 9px; align-items: flex-start; margin: 12px 0 0; font-size: .84rem; font-weight: 500; color: var(--text-dim); cursor: pointer; }
label.check-line input { width: 16px; height: 16px; margin-top: 2px; flex: none; accent-color: var(--accent-3); }

/* ==========================================================================
   PAGE PIECES: dashboard, home path, module exam strip, lesson progress
   ========================================================================== */

/* --------------------------------------------------------------- dashboard */

.dash-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-hero .avatar { border-radius: 18px; box-shadow: 0 0 0 2px rgba(34, 211, 238, .35), 0 0 30px -8px rgba(34, 211, 238, .7); }
.dash-rank { flex: 1 1 260px; max-width: 360px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-soft); }
.today-card { display: flex; flex-direction: column; }
.today-card > .row { margin-top: auto; }
.today-card form { margin: 0; }
.today-card .eyebrow { margin-bottom: 8px; }
.today-card h2 { margin-bottom: .35em; }
.today-main { border-color: rgba(79, 140, 255, .42); background:
    radial-gradient(420px circle at var(--mx) var(--my), rgba(var(--spot-rgb), calc(.13 * var(--spot))), transparent 46%),
    radial-gradient(120% 140% at 0% 0%, rgba(79, 140, 255, .16), transparent 55%),
    var(--glass-bg); }
.today-card.is-due { border-color: rgba(246, 196, 83, .42); }
.today-card .ico { vertical-align: -3px; color: var(--muted); }
.today-card .btn .ico { color: inherit; }

.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tool-tile {
  display: flex; gap: 11px; align-items: center; padding: 11px 12px; border-radius: 13px; min-width: 0;
  color: var(--text-dim); background: var(--bg-soft); border: 1px solid var(--line-soft);
  transition: border-color var(--fast), background var(--fast), transform var(--fast);
}
.tool-tile:hover { color: var(--text); border-color: var(--accent-3); background: var(--panel-2); }
@media (hover: hover) and (pointer: fine) { .tool-tile:hover { transform: translateY(-2px); } .tool-tile:hover .nav-drop-ico { box-shadow: var(--glow-cyan); } }
.tool-tile b { display: block; color: var(--text); font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-tile small { display: block; color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-tile > span:last-child { min-width: 0; }
.upsell-card { border-color: rgba(139, 92, 246, .45); background: linear-gradient(160deg, rgba(139, 92, 246, .18), rgba(255, 255, 255, .04) 60%); }

/* ------------------------------------------------- module exam strip, path */

.exam-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 14px; border-radius: 13px;
  background: var(--bg-soft); border: 1px dashed var(--line);
}
.exam-strip.is-ready { border-style: solid; border-color: rgba(246, 196, 83, .5); background: rgba(246, 196, 83, .07); }
.exam-strip.is-passed { border-style: solid; border-color: rgba(34, 214, 127, .45); background: rgba(34, 214, 127, .07); }
.exam-strip p { margin: 0; font-size: .9rem; color: var(--text-dim); }
.exam-strip p b { color: var(--text); }
.exam-strip form { margin: 0; }

/* Home: the four-step loop, joined by a line that lights up. */
.loop { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; counter-reset: loop; position: relative; }
.loop::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 34px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-3), var(--accent), var(--accent-2), var(--accent-3)); background-size: 200% 100%;
  opacity: .55; animation: loopFlow 6s linear infinite;
}
@keyframes loopFlow { to { background-position: -200% 0; } }
.loop-step { position: relative; text-align: center; padding: 0 8px; counter-increment: loop; }
.loop-no {
  position: relative; display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 22px;
  color: var(--accent-3); background: var(--ink); border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi), 0 0 34px -10px rgba(34, 211, 238, .75);
  transition: transform var(--med);
}
.loop-no::after { content: counter(loop); position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-family: var(--mono); font-size: .72rem; font-weight: 700; color: #fff; background: var(--grad); }
.loop-step:hover .loop-no { transform: translateY(-4px) rotate(-4deg); }
.loop-step h3 { margin-bottom: .3em; }
.loop-step p { color: var(--muted); font-size: .9rem; margin: 0; }

/* ------------------------------------------------------------ lesson page */

.lesson-meta-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lesson-step { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toc { padding: 14px 6px 14px 14px; border-radius: 14px; background: var(--bg-soft); border: 1px solid var(--line-soft); }
.toc a.active { color: var(--accent-3); border-left-color: var(--accent-3); }
.lesson-body h2 { scroll-margin-top: 92px; }
.lesson-body h2::before { content: ""; display: block; width: 34px; height: 3px; border-radius: 3px; margin-bottom: 14px; background: var(--grad); }
.lesson-body a { text-decoration: underline; text-decoration-color: rgba(79, 140, 255, .4); text-underline-offset: 3px; }
.lesson-body blockquote { margin: 1.4em 0; padding: 12px 18px; border-left: 3px solid var(--accent-2); background: rgba(139, 92, 246, .07); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-dim); }
.complete-card { text-align: center; }
.complete-card.is-done { border-color: rgba(34, 214, 127, .45); box-shadow: var(--glass-hi), var(--shadow), 0 0 60px -28px rgba(34, 214, 127, .9); }

@media (max-width: 960px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 30px; }
  .loop::before { display: none; }
}
@media (max-width: 480px) {
  .tool-tile small { display: none; }
  .dash-hero .avatar { width: 46px !important; height: 46px !important; }
}

/* ------------------------------------------------------------ portfolio risk */
.heat-meter { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line-soft); background: var(--panel); }
.heat-track { position: relative; height: 14px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.heat-track-sm { height: 8px; }
.heat-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--up); transition: width .9s var(--ease, ease); }
.heat-fill.gold { background: var(--gold); }
.heat-fill.down { background: var(--down); box-shadow: 0 0 14px rgba(255, 84, 112, .6); }
.heat-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .75; }
table.corr { width: 100%; border-collapse: separate; border-spacing: 2px; font-family: var(--mono); font-size: .74rem; font-variant-numeric: tabular-nums; }
table.corr th { padding: 6px 4px; font-weight: 600; color: var(--muted); text-align: center; white-space: nowrap; }
table.corr th.is-held { color: var(--accent-3); }
table.corr td { padding: 7px 4px; text-align: center; border-radius: 5px; color: var(--text); min-width: 38px; }
table.corr td.is-self { background: color-mix(in srgb, var(--text) 6%, transparent); }
.table-scroll:has(table.corr) { padding: 4px 14px 10px; }

/* ----------------------------------------------------------- go-live readiness */
.ready-hero {
  display: flex; gap: 26px; align-items: center; margin: 0 0 18px; padding: 22px 24px; border-radius: var(--radius);
  background: var(--glass-bg, var(--panel)); border: 1px solid var(--glass-border, var(--line));
  box-shadow: var(--glass-hi, none), var(--shadow);
  -webkit-backdrop-filter: var(--glass-blur, none); backdrop-filter: var(--glass-blur, none);
}
.ready-hero.is-ready { border-color: rgba(34, 214, 127, .5); box-shadow: var(--glass-hi, none), 0 0 46px -20px rgba(34, 214, 127, .85), var(--shadow); }
.ready-hero .ring b { font-size: 1.35rem; }
.ready-verdict { min-width: 0; }
.ready-verdict h2 { font-size: clamp(1.2rem, 2.4vw, 1.55rem); margin: 4px 0 6px; }
.ready-have { display: inline-block; margin-left: 6px; font-family: var(--mono); font-size: .84rem; color: var(--gold); }

.ladder { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: none; }
.ladder-step {
  position: relative; display: grid; gap: 4px; align-content: start; padding: 14px 14px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft); background: var(--bg-soft); font-size: .86rem; color: var(--text-dim);
}
.ladder-step b { color: var(--text); font-size: .93rem; }
.ladder-step small { color: var(--muted); line-height: 1.4; }
.ladder-step .badge { justify-self: start; margin-top: 4px; }
.ladder-n {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 700; font-size: .8rem;
  border: 1px solid var(--line); color: var(--muted);
}
.ladder-step.is-here { border-color: rgba(79, 140, 255, .55); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.ladder-step.is-here .ladder-n { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 0 18px -4px rgba(34, 211, 238, .8); }
.ladder-step.is-done { border-color: rgba(34, 214, 127, .45); }
.ladder-step.is-done .ladder-n { border-color: transparent; background: var(--up); color: #04150c; }
.ladder-step.is-later { opacity: .72; }

.gates { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.gate { display: flex; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line-soft); }
.gate:first-child { border-top: 0; padding-top: 4px; }
.gate-ico {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted);
}
.gate.is-pass .gate-ico { background: rgba(34, 214, 127, .16); border-color: rgba(34, 214, 127, .5); color: var(--up); }
.gate.is-fail .gate-ico { background: rgba(255, 84, 112, .10); border-color: rgba(255, 84, 112, .4); color: var(--down); }
.gate.is-locked .gate-ico { color: var(--gold); border-color: rgba(246, 196, 83, .45); }
.gate-main { flex: 1; min-width: 0; }
.gate-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gate-top b { font-size: .97rem; }
.gate-have { font-family: var(--mono); font-size: .82rem; color: var(--text-dim); text-align: right; }
.gate.is-pass .gate-have { color: var(--up); }
.gate.is-fail .gate-have { color: var(--gold); }
.gate-main p { margin: 4px 0 8px; font-size: .88rem; color: var(--muted); line-height: 1.5; }
.gate.is-pass .gate-main p { margin-bottom: 0; }
.gate .progress { height: 6px; }

/* Dashboard card that points at the scorecard. */
.ready-mini { display: flex; gap: 14px; align-items: center; }
.ready-mini .ring { flex: none; }
.ready-mini p { margin: 0; font-size: .88rem; }

@media (max-width: 860px) {
  .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .ready-hero { flex-direction: column; align-items: flex-start; gap: 16px; padding: 18px; }
  .ladder { grid-template-columns: 1fr; }
  .gate-have { text-align: left; }
}

/* ==========================================================================
   RESPONSIVE. Last in the file so these rules win over the components above.
   The owner checks on a 412px Android phone; test there and at 375px.
   ========================================================================== */

@media (max-width: 1180px) {
  .search-btn { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .search-btn span, .search-btn kbd { display: none; }
}

@media (max-width: 1240px) {
  .kpi-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .main-nav { display: none; }
  .nav-toggle { display: grid; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .lesson-layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; display: none; }
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 48px 0 44px; }
  .hero-visual::before, .hero-visual::after { display: none; }
  .split, .split-left { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .price-card.featured { order: -1; }
}

@media (max-width: 820px) {
  /* Bottom tab bar: the five places a phone user goes. */
  .tabbar {
    position: fixed; z-index: 70; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: 62px; padding: 0 4px;
    border-radius: 22px; background: var(--chrome);
    -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-hi), 0 18px 50px -18px rgba(0, 0, 0, .95);
  }
  .tabbar a, .tabbar button {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; padding: 0;
    border: 0; background: none; cursor: pointer; font-family: inherit;
    color: var(--muted); font-size: .64rem; font-weight: 650; letter-spacing: .02em;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar .ico { transition: transform .3s var(--spring), color var(--fast); }
  .tabbar a:active .ico, .tabbar button:active .ico { transform: scale(.86); }
  .tabbar .active { color: var(--text); }
  .tabbar .active .ico { color: var(--accent-3); filter: drop-shadow(0 0 8px rgba(34, 211, 238, .85)); transform: translateY(-1px); }
  .tabbar .active::before {
    content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 4px 4px;
    background: var(--grad); box-shadow: 0 0 12px rgba(34, 211, 238, .9);
  }
  body { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .toast-wrap { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .header-actions .hide-sm { display: none; }
}

@media (max-width: 720px) {
  .section { padding: 46px 0; }
  .section-sm { padding: 26px 0; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-badge { display: none; }
  .card { padding: 18px; }
  .certificate { padding: 34px 20px; }
  table.data th, table.data td { padding: 10px; font-size: .86rem; }
  .page-banner { min-height: 0; padding: 22px 20px; }

  /* Cheaper effects on phones: a calmer aurora, lighter blur, no pointer orb. */
  html::before, html::after { animation-duration: 80s; }
  .fx-orb { display: none; }
  .card, .panel, .kpi .box, .chart-shell, .lock-card, .page-banner, .task-card {
    -webkit-backdrop-filter: blur(12px) saturate(150%); backdrop-filter: blur(12px) saturate(150%);
  }
}

@media (max-width: 640px) {
  /* The header menus hang from the header itself, full width. */
  .notif, .umenu { position: static; }
  .notif-panel, .umenu-panel {
    position: absolute; top: calc(100% + 8px); left: 10px; right: 10px; width: auto; max-width: none;
    max-height: calc(100vh - 190px); overflow-y: auto;
  }
  .umenu-name { display: none; }
  .umenu-btn { padding: 3px; }
  .umenu-btn > svg:not(.avatar) { display: none; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 14px; }
  .kpi { gap: 10px; }
  .kpi .box { padding: 13px; }
  .kpi .box b { font-size: 1.22rem; }
  .qty-presets { grid-template-columns: repeat(2, 1fr); }
  .toast-wrap { left: 14px; right: 14px; max-width: none; }
  .header-inner { gap: 8px; }
  .header-actions { gap: 6px; }
  .header-actions .hide-xs { display: none; }
  .btn-lg { padding: 14px 22px; }
  .hero-cta .btn { flex: 1 1 100%; }
}

@media print {
  .site-header, .site-footer, .ticker-bar, .btn, .toast-wrap, .tabbar, .drawer, .palette, .modal, .fx-net, .fx-orb, .fx-progress, .pc-note { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  html::before, html::after, body::before, body::after { display: none; }
  main { animation: none; }
  .certificate { border: 2px solid #b8860b; box-shadow: none; }
}
