/* ===== Vent Academy — HVAC engineering design system ===== */
/* Self-hosted Vazirmatn — static weights for reliable rendering across browsers. */
@font-face{font-family:'Vazirmatn';src:url('/assets/fonts/vaz-Regular.woff2') format('woff2');font-weight:400;font-display:swap;font-style:normal}
@font-face{font-family:'Vazirmatn';src:url('/assets/fonts/vaz-Medium.woff2') format('woff2');font-weight:500;font-display:swap;font-style:normal}
@font-face{font-family:'Vazirmatn';src:url('/assets/fonts/vaz-SemiBold.woff2') format('woff2');font-weight:600;font-display:swap;font-style:normal}
@font-face{font-family:'Vazirmatn';src:url('/assets/fonts/vaz-Bold.woff2') format('woff2');font-weight:700 900;font-display:swap;font-style:normal}
@font-face{font-family:'JBMono';src:url('/assets/fonts/mono.woff2') format('woff2');font-weight:100 800;font-display:swap;font-style:normal}
:root{
  /* cool engineering palette */
  --primary-50:#E3F0F9; --primary-100:#DBF2F4; --primary-400:#3E97D1;
  --primary-500:#0E6BA8; --primary-600:#0A4E7A; --primary-700:#072033;
  --teal:#11A6B8; --teal-bright:#22D3EE; --secondary-500:#11A6B8; --secondary-600:#0E6BA8;
  --accent-500:#C9501A; --accent-600:#A63C0E; --accent-light:#F0641E; --accent-2:#E0A106; /* warm = action; -500 darkened for AA white-text (≥4.5:1), -light kept for decorative fills; -2 = gold stars (decorative) */
  --gold:#FFC24A;
  --success:#1E9E6A; --warning:#E0A106; --error:#D6453D; --info:#0E6BA8;
  --ink:#0B2740; --ink-muted:#5A7184; --faint:#607789;
  --navy:#072033; --navy-2:#0E2A40;

  --n-0:#ffffff; --n-50:#F4F7FA; --n-100:#EDF2F7; --n-200:#E4ECF3;
  --n-300:#D9E2EC; --n-400:#B7C6D6; --n-500:#8497A8; --n-600:#5A7184;
  --n-700:#334a60; --n-800:#13344E; --n-900:#0B2740;

  --bg:#F4F7FA; --surface:#ffffff; --surface-2:#F0F4F8; --text:#0B2740;
  --text-muted:#5A7184; --border:#D9E2EC; --border-strong:#B7C6D6; --grid-line:#E4ECF3;

  --radius:12px; --radius-sm:8px; --radius-lg:20px;
  --shadow-sm:0 1px 2px rgba(11,39,64,.06);
  --shadow:0 8px 24px rgba(11,39,64,.10);
  --shadow-lg:0 18px 44px rgba(11,39,64,.14);

  --grad:linear-gradient(135deg,#0E6BA8,#11A6B8);           /* cool = brand/structure */
  --grad-soft:linear-gradient(110deg,#0A4E7A 0%,#0E6BA8 45%,#11A6B8 100%);
  --grad-cta:linear-gradient(135deg,#C24E18 0%,#A63C0E 100%); /* warm = action; darkened so white text passes WCAG AA (≥4.5:1) */
  --grad-heat:linear-gradient(135deg,#F0641E,#E0A106);
  --grad-progress:linear-gradient(90deg,#11A6B8,#0E6BA8);
  --grad-navy:linear-gradient(165deg,#072033,#0E2A40);
  --grad-airflow:linear-gradient(90deg,rgba(34,211,238,0),rgba(34,211,238,.9) 50%,rgba(17,166,184,0));
  --hero-wash:radial-gradient(1100px 520px at 88% -8%,rgba(17,166,184,.16),transparent 60%),radial-gradient(900px 460px at 0% 4%,rgba(14,107,168,.12),transparent 62%);

  --font:'Vazirmatn','InterVar','Segoe UI',Tahoma,system-ui,-apple-system,'Iranian Sans',sans-serif;
  --font-mono:'JBMono','Vazirmatn',ui-monospace,'Cascadia Code',Consolas,monospace;
  --blueprint:linear-gradient(var(--grid-line) 1px,transparent 1px),linear-gradient(90deg,var(--grid-line) 1px,transparent 1px);
  --maxw:1200px;
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:var(--font);background:var(--bg);background-image:var(--hero-wash);background-attachment:fixed;color:var(--ink);line-height:1.75;-webkit-font-smoothing:antialiased;min-height:100vh;display:flex;flex-direction:column}
[dir=ltr] body{line-height:1.6}
[dir=ltr]{text-align:left}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
button{font-family:inherit;cursor:pointer;border:none;background:none}
input,select,textarea{font-family:inherit;font-size:1rem}
::selection{background:rgba(14,107,168,.22)}
.app{flex:1;width:100%;max-width:var(--maxw);margin:0 auto;padding:24px 20px 64px}
.mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums slashed-zero;letter-spacing:.02em}

/* ===== Buttons (squarer = technical) ===== */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 22px;border-radius:var(--radius-sm);font-weight:600;font-size:.95rem;transition:.18s;white-space:nowrap;border:1px solid transparent}
.btn-primary{background:var(--grad-cta);color:#fff;box-shadow:var(--shadow-sm);font-weight:700} /* warm action */
.btn-primary:hover{filter:brightness(1.05);transform:translateY(-1px)}
.btn-cool{background:var(--grad);color:#fff;font-weight:700}
.btn-cool:hover{filter:brightness(1.06);transform:translateY(-1px)}
.btn-ghost{background:var(--surface-2);color:var(--ink);border-color:var(--border)}
.btn-ghost:hover{background:var(--n-200)}
.btn-outline{border:1px solid var(--border-strong);color:var(--ink);background:var(--surface)}
.btn-outline:hover{border-color:var(--primary-500);color:var(--primary-600)}
.btn-block{width:100%}
.btn-lg{padding:14px 28px;font-size:1.02rem}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none}
.btn-link{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.95rem}

/* ===== Navbar ===== */
.navbar{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.85);backdrop-filter:saturate(160%) blur(14px);border-bottom:1px solid var(--border)}
.nav-inner{max-width:var(--maxw);margin:0 auto;padding:12px 20px;display:flex;align-items:center;gap:18px}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:1.25rem;color:var(--ink)}
.brand .logo{width:38px;height:38px;border-radius:10px;background:var(--grad);display:grid;place-items:center;color:#fff;font-weight:900;box-shadow:0 4px 12px rgba(17,166,184,.35)}
.brand .logo-img{background:none;box-shadow:none;overflow:hidden;width:auto;height:40px;border-radius:8px}
.brand .logo-img img{height:40px;width:auto;display:block;object-fit:contain}
.brand .grad-text{color:var(--ink)}
.brand .tag{font-size:.7rem;color:var(--ink-muted);font-weight:600;margin-top:2px}
.nav-links{display:flex;gap:4px;margin-inline-start:12px}
.nav-links a{position:relative;padding:8px 12px;color:var(--ink-muted);font-weight:600;transition:.16s}
.nav-links a::after{content:"";position:absolute;inset-inline:12px;bottom:2px;height:2px;background:var(--grad);transform:scaleX(0);transition:.18s;border-radius:2px}
.nav-links a:hover,.nav-links a.active{color:var(--ink)}
.nav-links a:hover::after,.nav-links a.active::after{transform:scaleX(1)}
.nav-spacer{flex:1}
.nav-actions{display:flex;align-items:center;gap:10px}
.lang-toggle{width:42px;height:38px;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--border);font-weight:700;color:var(--ink-muted);font-size:.8rem;font-family:var(--font-mono)}
.lang-toggle:hover{border-color:var(--border-strong)}
.avatar-btn{display:flex;align-items:center;gap:8px;padding:5px 12px 5px 5px;border-radius:30px;background:var(--surface-2);border:1px solid var(--border)}
.avatar-btn:hover{border-color:var(--border-strong)}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--grad);color:#fff;display:grid;place-items:center;font-weight:700;font-size:.85rem;overflow:hidden}
.menu{position:relative}
.menu-pop{position:absolute;top:calc(100% + 8px);inset-inline-end:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);min-width:220px;padding:8px;display:none;z-index:60}
.menu-pop.open{display:block;animation:popin .15s ease}
.menu-pop a,.menu-pop button{display:flex;align-items:center;gap:10px;width:100%;text-align:start;padding:10px 12px;border-radius:var(--radius-sm);color:var(--ink);font-weight:500;font-size:.92rem}
.menu-pop a:hover,.menu-pop button:hover{background:var(--surface-2)}
.menu-pop .sep{height:1px;background:var(--border);margin:6px 4px}

/* ===== Hero ===== */
.hero{position:relative;border-radius:var(--radius-lg);overflow:hidden;background:var(--surface);border:1px solid var(--border);padding:54px 44px;margin-bottom:40px}
.hero::before{content:"";position:absolute;inset:0;background-image:var(--blueprint);background-size:28px 28px;opacity:.6;-webkit-mask-image:radial-gradient(120% 120% at 90% 0%,#000,transparent 65%);mask-image:radial-gradient(120% 120% at 90% 0%,#000,transparent 65%);pointer-events:none}
.hero-grid{position:relative;z-index:2;display:grid;grid-template-columns:1.3fr .9fr;gap:32px;align-items:center}
.hero-kicker{font-family:var(--font-mono);font-size:.78rem;letter-spacing:.1em;color:var(--primary-600);font-weight:700;margin-bottom:14px;display:inline-flex;align-items:center;gap:8px}
.hero-kicker::before{content:"";width:22px;height:2px;background:var(--grad);border-radius:2px}
.hero h1{font-size:clamp(1.7rem,3.4vw,2.6rem);font-weight:800;line-height:1.3;margin-bottom:16px;color:var(--ink)}
.hero h1 .hl{background:var(--grad);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.hero p{font-size:1.08rem;color:var(--ink-muted);margin-bottom:26px;max-width:560px}
.hero-actions{display:flex;gap:14px;flex-wrap:wrap}
.hero-trust{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:20px}
.hero-badges{display:flex;gap:26px;margin-top:30px;flex-wrap:wrap}
.hero-badge b{display:block;font-size:1.5rem;font-weight:800;color:var(--ink);font-family:var(--font-mono)}
.hero-badge span{color:var(--ink-muted);font-size:.85rem}
.hero-art{position:relative;z-index:2}
.hero-svg{width:100%;height:auto;display:block}

/* spec / telemetry card */
.spec-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;position:relative}
.spec-card::before{content:"";display:block;height:4px;background:var(--grad)}
.spec-head{display:flex;gap:8px;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--border)}
.spec-body{padding:18px 16px;display:flex;flex-direction:column;gap:12px}
.spec-num{font-family:var(--font-mono);font-size:2rem;font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.spec-label{font-family:var(--font-mono);font-size:.7rem;letter-spacing:.12em;color:var(--primary-600);text-transform:uppercase}
.spec-line{display:flex;justify-content:space-between;align-items:center;font-family:var(--font-mono);font-size:.82rem;color:var(--ink-muted)}

.std-chip{display:inline-flex;align-items:center;gap:6px;font-family:var(--font-mono);font-size:.7rem;background:var(--primary-50);color:var(--primary-700);border:1px solid var(--border);padding:3px 9px;border-radius:30px}
.std-chip::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--teal)}

/* ===== Sections ===== */
.section{margin-bottom:46px}
.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;gap:12px}
.section-head h2{font-size:1.5rem;font-weight:800;color:var(--ink);position:relative;padding-inline-start:14px}
.section-head h2::before{content:"";position:absolute;inset-inline-start:0;top:6px;bottom:6px;width:4px;border-radius:2px;background:var(--grad)}
.section-head a{color:var(--primary-600);font-weight:700;font-size:.95rem}

/* ===== Cards ===== */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:22px}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-sm);transition:.2s;display:flex;flex-direction:column;position:relative}
.card::before{content:"";display:block;height:5px;background:var(--grad-progress)}
.card.heat::before{background:var(--grad-heat)}
.card:hover{transform:translateY(-4px);box-shadow:var(--shadow);border-color:var(--primary-400)}
.card-thumb{position:relative;aspect-ratio:16/9;background:var(--grad-soft);overflow:hidden}
.card-thumb::after{content:"";position:absolute;inset:0;background-image:var(--blueprint);background-size:22px 22px;opacity:.18}
.card-thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:.4s;z-index:2}
.card:hover .card-thumb img{transform:scale(1.05)}
.card-thumb .ph{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-weight:800;font-size:1.05rem;padding:14px;text-align:center;z-index:1}
/* course detail hero poster (image over gradient+title fallback) */
.detail-poster{position:relative;aspect-ratio:21/9;border-radius:var(--radius-lg);overflow:hidden;margin-bottom:24px;display:grid;place-items:center;padding:30px;text-align:center}
.detail-poster img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:1}
.detail-poster .poster-title{position:relative;z-index:2;color:#fff;margin:0;font-size:1.7rem;font-weight:800;line-height:1.4;text-shadow:0 2px 14px rgba(2,12,22,.55);background:rgba(4,18,31,.30);padding:8px 20px;border-radius:12px;backdrop-filter:blur(2px)}
/* gallery picker rows + live preview thumbnail */
.pick-row{display:flex;gap:8px;align-items:center}
.pick-preview{width:48px;height:48px;flex:none;object-fit:cover;border-radius:8px;border:1px solid var(--border);background:var(--surface-2)}
.dur-chip{position:absolute;bottom:10px;inset-inline-end:10px;z-index:2;font-family:var(--font-mono);font-size:.72rem;background:rgba(7,32,51,.75);color:#fff;padding:3px 9px;border-radius:6px;backdrop-filter:blur(3px)}
.badge{position:absolute;top:12px;inset-inline-start:12px;z-index:2;background:rgba(7,32,51,.8);color:#fff;padding:4px 11px;border-radius:30px;font-size:.78rem;font-weight:700;backdrop-filter:blur(4px)}
.badge.free{background:var(--success)}
/* The discount badge used to be pinned to the END edge — the same corner as
   .wish-heart — so a discounted course seen by a signed-in visitor showed the
   white heart sitting directly on top of the percentage. The heart owns the end
   corner; every badge stays on the start corner, like .badge and .badge.free. */
.badge.off{background:var(--accent-500)}
.card-body{padding:16px 18px;display:flex;flex-direction:column;gap:9px;flex:1}
.card-cat{font-size:.78rem;color:var(--primary-600);font-weight:700}
.card-title{font-weight:700;font-size:1.05rem;line-height:1.6;color:var(--ink);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card-inst{display:flex;align-items:center;gap:8px;color:var(--ink-muted);font-size:.85rem}
.card-inst .avatar{width:24px;height:24px;font-size:.7rem}
.card-meta{display:flex;align-items:center;gap:14px;color:var(--ink-muted);font-size:.82rem}
.stars{color:var(--accent-2);font-weight:700}
.card-foot{display:flex;align-items:center;justify-content:space-between;margin-top:auto;padding-top:12px;border-top:1px solid var(--border)}
.price{font-weight:800;font-size:1.05rem;color:var(--ink);font-family:var(--font-mono);font-variant-numeric:tabular-nums}
.price .old{font-size:.78rem;color:var(--faint);text-decoration:line-through;font-weight:500;margin-inline-start:6px}
.price.free{color:var(--success)}

/* ===== Filters ===== */
.toolbar{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:24px;align-items:center}
.search-box{flex:1;min-width:220px;position:relative}
.search-box input{width:100%;padding:12px 16px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);transition:.16s}
.search-box input:focus{outline:none;border-color:var(--primary-500);box-shadow:0 0 0 3px rgba(14,107,168,.15)}
select.field{padding:11px 14px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--ink);font-weight:600;cursor:pointer}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}
.chip{padding:8px 16px;border-radius:30px;background:var(--surface);border:1px solid var(--border);font-weight:600;font-size:.9rem;transition:.16s;color:var(--ink-muted)}
.chip:hover{border-color:var(--primary-400)}
.chip.active{background:var(--primary-500);color:#fff;border-color:var(--primary-500)}

/* ===== Course detail ===== */
.detail{display:grid;grid-template-columns:1fr 360px;gap:32px;align-items:start}
.detail-main h1{font-size:1.9rem;font-weight:800;margin-bottom:14px;color:var(--ink)}
.detail-desc{color:var(--ink-muted);font-size:1.04rem;margin-bottom:26px;white-space:pre-line}
.curriculum{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.lesson-row{display:flex;align-items:center;gap:14px;padding:15px 18px;border-bottom:1px solid var(--border);transition:.15s}
.lesson-row:last-child{border-bottom:none}
.lesson-row:hover{background:var(--surface-2)}
.lesson-num{width:30px;height:30px;border-radius:8px;background:var(--primary-50);color:var(--primary-600);display:grid;place-items:center;font-weight:700;font-size:.85rem;flex-shrink:0;font-family:var(--font-mono)}
.lesson-row .t{flex:1;font-weight:600;color:var(--ink)}
.lesson-row .dur{color:var(--ink-muted);font-size:.85rem;font-family:var(--font-mono)}
.lesson-row .lock{color:var(--faint)}
.lesson-row.playable{cursor:pointer}
.lesson-row.playable .lesson-num{background:var(--primary-500);color:#fff}
.sidebar-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;position:sticky;top:84px}
.sidebar-card::before{content:"";display:block;height:5px;background:var(--grad-progress)}
.sidebar-thumb{aspect-ratio:16/9;background:var(--grad-soft);position:relative}
.sidebar-thumb::after{content:"";position:absolute;inset:0;background-image:var(--blueprint);background-size:24px 24px;opacity:.18}
.sidebar-body{padding:20px}
.sidebar-price{font-size:1.7rem;font-weight:800;color:var(--ink);margin-bottom:4px;font-family:var(--font-mono);font-variant-numeric:tabular-nums}
.sidebar-meta{display:flex;flex-direction:column;gap:10px;margin:18px 0;color:var(--ink-muted);font-size:.92rem}
.sidebar-meta div{display:flex;align-items:center;gap:9px}
.sidebar-actions{display:flex;gap:8px;margin-top:10px}
.sidebar-act{flex:1;padding:9px 8px;font-size:.86rem;font-weight:700}
.sidebar-act.on{color:var(--accent-600);border-color:var(--accent-500);background:var(--primary-50)}

/* ===== Video player ===== */
.player-wrap{background:#04121f;border-radius:var(--radius);overflow:hidden;margin-bottom:22px;box-shadow:var(--shadow-lg)}
.player-wrap video{width:100%;display:block;aspect-ratio:16/9;background:#04121f}
.lesson-list-side{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.progress-bar{height:8px;background:var(--n-200);border-radius:30px;overflow:hidden}
.progress-bar i{display:block;height:100%;background:var(--grad-progress);border-radius:30px;transition:width .4s}

/* ===== Auth / forms ===== */
.auth-card{max-width:440px;margin:40px auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);padding:36px 32px}
.auth-card h2{font-size:1.45rem;font-weight:800;margin-bottom:6px;text-align:center;color:var(--ink)}
.auth-card .sub{color:var(--ink-muted);text-align:center;margin-bottom:24px}
.form-group{margin-bottom:16px}
.form-group label{display:block;font-weight:600;margin-bottom:7px;font-size:.92rem;color:var(--ink)}
.form-control{width:100%;padding:12px 15px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);transition:.16s;color:var(--ink)}
.form-control:focus{outline:none;border-color:var(--primary-500);box-shadow:0 0 0 3px rgba(14,107,168,.15)}
.otp-input{letter-spacing:.6em;text-align:center;font-size:1.4rem;font-weight:700;font-family:var(--font-mono)}
.otp-timer{color:var(--ink-muted);font-weight:600;font-size:.85rem;font-family:var(--font-mono)}
/* login modal branded hero */
.login-hero{text-align:center;margin:-4px 0 16px}
.login-glyph{width:60px;height:60px;margin:0 auto 10px;border-radius:16px;display:flex;align-items:center;justify-content:center;font-size:1.9rem;color:#fff;background:linear-gradient(135deg,var(--primary-600),var(--teal));box-shadow:0 8px 22px -8px rgba(14,107,168,.6)}
.login-glyph img{width:100%;height:100%;object-fit:contain;border-radius:16px}
.login-welcome{font-size:1.25rem;font-weight:800;color:var(--ink)}
.login-sub{color:var(--ink-muted);font-size:.9rem;margin-top:2px}
.login-chips{display:flex;flex-wrap:wrap;gap:7px;justify-content:center;margin-bottom:18px}
.lchip{font-size:.76rem;font-weight:700;color:var(--primary-700);background:var(--primary-50);border:1px solid var(--primary-100);border-radius:999px;padding:5px 11px}
/* checkout: course preview + summary + gateway picker + trust */
.co-preview{display:flex;gap:14px;align-items:center;margin:6px 0 18px}
.co-poster{width:84px;height:56px;border-radius:10px;flex-shrink:0;overflow:hidden;box-shadow:var(--shadow-sm)}
.co-poster img{width:100%;height:100%;object-fit:cover}
.co-title{font-weight:800;color:var(--ink);line-height:1.4}
.co-meta{color:var(--ink-muted);font-size:.82rem;margin-top:4px}
.co-summary{background:var(--n-50);border:1px solid var(--border);border-radius:var(--radius);padding:16px 18px;margin-bottom:20px}
.co-row{display:flex;justify-content:space-between;margin-bottom:8px}
.co-row.co-muted{color:var(--ink-muted)}
.co-total{border-top:1px solid var(--border);padding-top:11px;margin-top:4px;margin-bottom:0;font-size:1.18rem}
.co-total b:last-child{color:var(--primary-700);font-family:var(--font-mono);font-variant-numeric:tabular-nums}
.gw-list{display:flex;flex-direction:column;gap:10px;margin-bottom:20px}
.gw-opt{display:flex;align-items:center;gap:12px;padding:13px 15px;border:1.5px solid var(--border);border-radius:var(--radius-sm);cursor:pointer;transition:border-color .15s,background .15s}
.gw-opt:hover{border-color:var(--primary-400)}
.gw-opt input{position:absolute;opacity:0;pointer-events:none}
.gw-emoji{font-size:1.2rem}
.gw-name{flex:1;font-weight:700;color:var(--ink)}
.gw-check{opacity:0;color:var(--primary-600);font-weight:900}
.gw-opt.sel{border-color:var(--primary-500);background:var(--primary-50)}
.gw-opt.sel .gw-check{opacity:1}
.co-trust{display:flex;flex-wrap:wrap;justify-content:center;gap:14px;margin-top:16px;color:var(--ink-muted);font-size:.8rem;font-weight:600}
.dev-hint{background:var(--primary-50);border:1px dashed var(--primary-400);color:var(--primary-700);padding:10px 14px;border-radius:8px;font-size:.88rem;margin-bottom:16px;text-align:center}

/* ===== Dashboard ===== */
.dash-head{display:flex;align-items:center;gap:16px;margin-bottom:28px;flex-wrap:wrap}
.dash-head .avatar{width:60px;height:60px;font-size:1.3rem}
.dash-head-id{flex:1;min-width:180px}
.dash-head h1{font-size:1.5rem;font-weight:800;color:var(--ink)}
.dash-head p{color:var(--ink-muted)}
.dash-glance{display:flex;gap:10px}
.dg-item{min-width:78px;text-align:center;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 12px;position:relative;overflow:hidden}
.dg-item::before{content:'';position:absolute;top:0;inset-inline-start:0;width:3px;height:100%;background:linear-gradient(var(--primary-500),var(--teal))}
.dg-v{font-size:1.4rem;font-weight:800;color:var(--primary-700);font-variant-numeric:tabular-nums;line-height:1}
.dg-l{font-size:.72rem;color:var(--ink-muted);margin-top:4px;font-weight:600}
@media(max-width:560px){.dash-glance{width:100%;justify-content:space-between}.dg-item{flex:1}}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);margin-bottom:26px;overflow-x:auto}
.tabs button{padding:12px 16px;font-weight:700;color:var(--ink-muted);border-bottom:3px solid transparent;white-space:nowrap}
.tabs button.active{color:var(--primary-600);border-color:var(--primary-500)}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:18px;margin-bottom:30px}
.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px 20px;box-shadow:var(--shadow-sm);position:relative;overflow:hidden}
.stat::before{content:"";position:absolute;top:0;inset-inline:0;height:3px;background:var(--grad)}
.stat .ic{width:44px;height:44px;border-radius:10px;display:grid;place-items:center;font-size:1.2rem;margin-bottom:12px;background:var(--primary-50)}
.stat .v{font-size:1.6rem;font-weight:800;color:var(--ink);font-family:var(--font-mono);font-variant-numeric:tabular-nums}
.stat .l{color:var(--ink-muted);font-size:.88rem}
.enrolled-row{display:flex;gap:16px;align-items:center;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px;margin-bottom:14px}
.enrolled-row .thumb{width:120px;aspect-ratio:16/9;border-radius:8px;background:var(--grad-soft);flex-shrink:0;overflow:hidden}
.enrolled-row .info{flex:1}
.enrolled-row h4{font-weight:700;margin-bottom:8px;color:var(--ink)}

/* ===== Tables ===== */
.table-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:auto;box-shadow:var(--shadow-sm)}
table{width:100%;border-collapse:collapse;font-size:.92rem}
th,td{padding:13px 16px;text-align:start;border-bottom:1px solid var(--border);white-space:nowrap}
th{background:var(--surface-2);font-weight:700;color:var(--ink-muted);font-size:.82rem}
tr:last-child td{border-bottom:none}
tr:hover td{background:var(--surface-2)}
td.mono,th.mono{font-family:var(--font-mono)}
.pill{display:inline-block;padding:3px 11px;border-radius:30px;font-size:.78rem;font-weight:700}
.pill.completed{background:var(--success-soft,#DEF3E9);color:#166534}
.pill.pending{background:#FBF1D9;color:#854d0e}
.pill.failed{background:#FBE3E1;color:#991b1b}
.pill.role{background:var(--primary-50);color:var(--primary-700)}

/* ===== Modal ===== */
.modal-overlay{position:fixed;inset:0;background:rgba(7,32,51,.55);backdrop-filter:blur(4px);display:grid;place-items:center;z-index:100;padding:20px;animation:fade .2s}
.modal{background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);width:100%;max-width:480px;animation:popin .22s ease;max-height:92vh;overflow:auto}
.modal.wide{max-width:760px}
/* size:"lg" was passed at 5 call sites but never had a rule — those modals
   silently rendered at the narrow 480px default. */
.modal.lg{max-width:820px}
/* editor modals: large & comfortable on desktop, near-fullscreen on phones, with
   a sticky action bar so Cancel/Draft/Save are always reachable while scrolling */
.modal.editor{max-width:min(940px,96vw);width:96vw;display:flex;flex-direction:column;max-height:92vh}
.modal.editor .modal-head{flex:0 0 auto}
.modal.editor .modal-body{flex:1 1 auto;overflow:auto}
.modal-foot{position:sticky;bottom:0;z-index:2;display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end;background:var(--surface);border-top:1px solid var(--border);margin:18px -22px -22px;padding:14px 22px}
.modal-foot .grow{margin-inline-end:auto;color:var(--ink-muted);font-size:.85rem}
@media(max-width:680px){
  .modal-overlay{padding:0}
  .modal.editor{max-width:100vw;width:100vw;height:100dvh;max-height:100dvh;border-radius:0}
  .modal.editor .modal-foot .btn{flex:1 1 auto;min-width:88px}
}
.btn-draft{background:var(--surface-2);color:var(--ink);border:1px solid var(--border-strong);font-weight:700}
.btn-draft:hover{border-color:var(--primary-500);color:var(--primary-600)}
/* status pills for posts list */
.pill.draft{background:#EDEFF2;color:#5A7184}
.pill.scheduled{background:#FFF1DC;color:#9A5B12}
.pill.published{background:#DEF3E6;color:#1E7A4E}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--border)}
.modal-head h3{font-weight:800;font-size:1.15rem;color:var(--ink)}
.modal-close{font-size:1.3rem;color:var(--ink-muted);width:34px;height:34px;border-radius:8px}
.modal-close:hover{background:var(--surface-2)}
.modal-body{padding:22px}

/* ===== misc ===== */
.toast{position:fixed;top:20px;inset-inline:0;margin:0 auto;width:max-content;max-width:90%;z-index:200;background:var(--navy);color:#fff;padding:13px 22px;border-radius:10px;box-shadow:var(--shadow-lg);opacity:0;transform:translateY(-20px);transition:.3s;pointer-events:none;font-weight:600}
.toast.show{opacity:1;transform:translateY(0)}
.toast.error{background:var(--error)}
.toast.success{background:var(--success)}
.empty{text-align:center;padding:60px 20px;color:var(--ink-muted)}
.empty .ic{font-size:3rem;margin-bottom:14px}
.spinner{width:42px;height:42px;border:4px solid var(--primary-100);border-top-color:var(--primary-500);border-radius:50%;animation:spin .8s linear infinite}
.page-loader{display:grid;place-items:center;min-height:50vh}
.center{display:grid;place-items:center;min-height:50vh}
.gateway-card{max-width:460px;margin:50px auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);overflow:hidden;text-align:center}
.gateway-top{background:var(--grad);color:#fff;padding:26px}
.gateway-body{padding:30px}
.result-icon{width:90px;height:90px;border-radius:50%;display:grid;place-items:center;font-size:2.6rem;margin:0 auto 18px}
.result-icon.ok{background:#DEF3E9;color:var(--success)}
.result-icon.bad{background:#FBE3E1;color:var(--error)}

/* ===== KYC ===== */
.kyc-banner{padding:14px 20px;border-radius:var(--radius);margin-bottom:22px;font-weight:600;background:#FCE9DD;border:1px solid var(--accent-500);color:#9a3412}
.kyc-banner.ok{background:#DEF3E9;border-color:var(--success);color:#166534}
.kyc-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.upload-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface-2)}
.upload-row b{font-size:.92rem}
/* KYC upload block: preview + progress + size hint (friendly for older users) */
.kyc-up{padding:14px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface-2)}
.kyc-up-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.kyc-up-head b{font-size:.98rem}
.kyc-up-body{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.kyc-prev{width:84px;height:84px;object-fit:cover;border-radius:10px;border:1px solid var(--border-strong);background:#fff}
.kyc-pick{min-height:46px;font-size:1rem}
.kyc-bar{height:8px;border-radius:6px;background:var(--n-200);overflow:hidden;margin-top:12px}
.kyc-bar-fill{height:100%;width:0;background:var(--grad);transition:width .2s ease}
.kyc-note{margin-top:8px;font-size:.86rem;color:var(--ink-muted);line-height:1.7}
.kyc-note.err{color:var(--error);font-weight:600}
.kyc-note.ok{color:var(--success);font-weight:700}

/* ===== Certificate (engineering seal) ===== */
.cert-page{max-width:920px;margin:0 auto}
.cert-actions{display:flex;gap:12px;justify-content:center;margin-bottom:24px;flex-wrap:wrap}
.certificate{background:var(--grad-navy);border-radius:var(--radius-lg);padding:14px;box-shadow:var(--shadow-lg);position:relative;overflow:hidden}
.certificate::before{content:"";position:absolute;inset:0;background-image:var(--blueprint);background-size:30px 30px;opacity:.07}
.cert-inner{position:relative;border:1px solid rgba(120,170,220,.28);border-radius:16px;background:rgba(7,32,51,.4);padding:46px 40px;text-align:center;color:#E6EEF5}
.cert-seal{width:84px;height:84px;border-radius:50%;background:rgba(255,255,255,.04);border:2px solid var(--teal);box-shadow:0 0 0 4px rgba(17,166,184,.12),inset 0 0 0 1px var(--gold);color:var(--gold);display:grid;place-items:center;font-size:2rem;margin:0 auto 14px}
.cert-brand{font-size:1.05rem;font-weight:800;letter-spacing:.04em;color:var(--teal-bright)}
.cert-title{font-size:1.7rem;font-weight:800;margin:14px 0 24px;color:#fff}
.cert-sub{color:#9FB3CC;font-size:1rem}
.cert-name{font-size:1.9rem;font-weight:800;margin:10px 0;color:#fff}
.cert-nc{color:#9FB3CC;font-size:.9rem;margin-bottom:14px;font-family:var(--font-mono)}
.cert-course{font-size:1.4rem;font-weight:800;color:var(--teal-bright);margin:10px 0 26px}
.cert-foot{display:flex;justify-content:center;gap:40px;flex-wrap:wrap;margin-top:22px;border-top:1px solid rgba(120,170,220,.2);padding-top:22px}
.cert-foot div{display:flex;flex-direction:column;gap:4px}
.cert-foot span{color:#9FB3CC;font-size:.78rem}
.cert-foot b{font-size:.98rem;color:#E6EEF5;font-family:var(--font-mono)}
/* bilingual sheet: the English half sits under each Persian line, quieter.
   The global [dir=ltr]{text-align:left} would push every English line to the
   left edge of a centred sheet, so the sheet re-centres its own. */
.cert-inner [dir=ltr]{text-align:center}
.cert-en{color:#9FB3CC;font-size:.86rem;letter-spacing:.02em;margin-top:2px}
.cert-title-en{font-size:1.05rem;font-weight:700;color:#C9D8E8;margin:-18px 0 22px}
.cert-name-en{font-size:1.25rem;font-weight:700;color:#E6EEF5;margin:-4px 0 8px;letter-spacing:.03em}
.cert-course-en{font-size:1.05rem;font-weight:700;color:var(--teal-bright);margin:-18px 0 26px}
.cert-foot .cert-foot-en{font-size:.82rem;color:#C9D8E8}
.cert-verify{align-items:center}
/* the QR needs its white quiet zone to scan, so it sits on its own white tile */
.cert-qr{width:104px;height:104px;background:#fff;border-radius:8px;padding:2px;margin-bottom:6px}
.cert-qr svg{width:100%;height:100%;display:block}
.cert-foot .cert-url{font-size:.72rem;color:#C9D8E8;max-width:220px;word-break:break-all}

@media print{
  body{background:#fff;background-image:none}
  #navbar,#footer,#toast,#modal-root,.cert-actions,.nav-actions,.receipt-actions{display:none !important}
  .app{padding:0;max-width:none}
  .certificate,.receipt-sheet{box-shadow:none}
  /* Browsers drop background colours when printing unless told otherwise, and
     this sheet is light text on a dark navy ground: printed as-is it came out
     pale grey on white paper, close to blank. Keep the colours on paper. */
  .certificate,.certificate *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .cert-page{page:certificate;max-width:none}
  .certificate{break-inside:avoid}
  /* One landscape A4 is about 1060 x 730 px. The screen layout is ~1150 px
     tall, which printed as two pages with the QR cut in half — unscannable.
     Measured with a real print-to-PDF, not guessed: tighten every vertical
     gap for paper only. */
  .certificate{padding:8px}
  .cert-inner{padding:16px 28px 14px}
  .cert-seal{width:50px;height:50px;font-size:1.25rem;margin-bottom:4px}
  .cert-brand{font-size:.95rem}
  .cert-title{font-size:1.45rem;margin:6px 0 16px}
  .cert-title-en{margin:-14px 0 10px}
  .cert-name{font-size:1.55rem;margin:4px 0}
  .cert-name-en{margin:-2px 0 4px}
  .cert-nc{margin-bottom:6px}
  .cert-course{font-size:1.2rem;margin:4px 0 12px}
  .cert-course-en{margin:-10px 0 10px}
  .cert-foot{margin-top:8px;padding-top:10px;gap:34px}
  .cert-qr{width:86px;height:86px;margin-bottom:4px}
  .cert-verify,.cert-foot > div{break-inside:avoid}
}
/* the certificate prints on one landscape A4; receipts keep the default page */
@page certificate{size:A4 landscape;margin:8mm}

/* ===== Purchase receipt / فاکتور ===== */
.receipt-wrap{max-width:560px;margin:24px auto}
.receipt-sheet{background:#fff;border:1px solid var(--border);border-radius:var(--radius-lg);padding:26px 28px;box-shadow:var(--shadow)}
.receipt-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding-bottom:16px;border-bottom:2px solid var(--primary-500);margin-bottom:18px}
.receipt-brand{display:flex;align-items:center;gap:10px}
.receipt-brand .logo{width:42px;height:42px;display:grid;place-items:center;background:var(--grad);color:#fff;border-radius:12px;font-size:1.3rem}
.receipt-brand b{display:block;font-size:1.1rem;color:var(--ink)}
.receipt-brand span{font-size:.82rem;color:var(--ink-muted)}
.receipt-inv{text-align:end}
.receipt-inv span{display:block;font-size:.72rem;color:var(--ink-muted)}
.receipt-inv b{font-family:var(--font-mono);color:var(--ink)}
.receipt-table{width:100%;border-collapse:collapse}
.receipt-table td{padding:10px 4px;border-bottom:1px solid var(--grid-line);vertical-align:top}
.receipt-table .rc-k{color:var(--ink-muted);font-size:.88rem;width:42%}
.receipt-table .rc-v{font-weight:600;color:var(--ink)}
.receipt-foot{display:flex;flex-wrap:wrap;gap:14px;justify-content:space-between;margin-top:18px;padding-top:14px;border-top:1px dashed var(--border);color:var(--ink-muted);font-size:.82rem}
.receipt-actions{display:flex;gap:12px;justify-content:center;margin-top:18px;flex-wrap:wrap}
.receipt-link{color:var(--primary-600);font-weight:700;white-space:nowrap}
.receipt-link:hover{text-decoration:underline}

/* ===== Footer (navy anchor) ===== */
.footer{background:var(--grad-navy);color:#9FB3CC;padding:40px 20px 26px;margin-top:auto;position:relative;overflow:hidden}
.footer::before{content:"";position:absolute;inset:0;background-image:var(--blueprint);background-size:32px 32px;opacity:.05}
.footer-inner{position:relative;max-width:var(--maxw);margin:0 auto;display:flex;flex-wrap:wrap;gap:30px;justify-content:space-between}
.footer .brand{color:#fff;margin-bottom:12px}
.footer .brand .grad-text{color:#fff}
.footer a{color:#9FB3CC;display:block;padding:4px 0;font-size:.92rem}
.footer a:hover{color:#fff}
.footer h4{color:#fff;margin-bottom:12px;font-size:1rem}
.footer-bottom{position:relative;max-width:var(--maxw);margin:24px auto 0;padding-top:20px;border-top:1px solid rgba(120,170,220,.2);text-align:center;color:#5A7184;font-size:.86rem}

/* ===== Settings (admin) ===== */
.set-section{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px;margin-bottom:18px}
.set-section h3{font-weight:800;color:var(--ink);margin-bottom:4px}
.set-section .hint{color:var(--ink-muted);font-size:.88rem;margin-bottom:16px}
.set-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-bottom:12px}
.repeat-item{display:flex;gap:8px;align-items:center;margin-bottom:8px;flex-wrap:wrap}
.repeat-item input{flex:1;min-width:120px}
.color-row{display:flex;align-items:center;gap:8px}
.color-row input[type=color]{width:42px;height:38px;padding:2px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}
.toggle{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface-2);font-weight:600;font-size:.9rem;cursor:pointer}
.save-bar{position:sticky;bottom:0;background:rgba(255,255,255,.92);backdrop-filter:blur(8px);border-top:1px solid var(--border);padding:14px 0;margin-top:10px;display:flex;justify-content:flex-end;gap:10px;z-index:5}

/* ===== media gallery ===== */
.media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px}
.media-cell{border:1px solid var(--border);border-radius:var(--radius-sm);overflow:hidden;background:var(--surface)}
.media-thumb{aspect-ratio:1;display:grid;place-items:center;background:var(--surface-2);font-size:2rem;overflow:hidden}
.media-thumb img{width:100%;height:100%;object-fit:cover}
/* stepped (≤3 level) gallery categories */
.cat-cascade{display:flex;flex-direction:column;gap:7px}
.cat-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.cat-row .chip{font-size:.82rem}
.cat-step{display:flex;align-items:center;gap:6px}
.cat-step .form-control{min-width:0;flex:1}
.cat-sep{color:var(--faint);font-weight:800}
.media-thumb video{width:100%;height:100%;object-fit:cover}
.media-meta{display:flex;flex-direction:column;padding:6px 8px;font-size:.78rem;gap:3px}
.media-meta>div{display:flex;gap:6px}
/* ===== media manager ===== */
.mm-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:4px}
.mm-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.mm-kinds{margin:10px 0 2px}
.mm-catbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:8px 0;min-height:26px}
.mm-catpath{font-weight:700;color:var(--ink);font-family:var(--font-mono);font-size:.85rem}
.mm-drop{border:2px dashed transparent;border-radius:var(--radius);transition:.15s;padding:4px;margin-top:6px}
.mm-drop.mm-dragover{border-color:var(--accent-500);background:var(--primary-50)}
.mm-title{font-weight:600;font-size:.82rem;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mm-sub{font-size:.72rem;color:var(--ink-muted);font-family:var(--font-mono)}
.mm-actions{display:flex;gap:8px;margin-top:2px}
.mm-grant-tools{margin-bottom:8px;font-size:.85rem}
.mm-grant-tree{max-height:48vh;overflow:auto;border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px}
.mm-grant{display:flex;align-items:center;gap:8px;padding:5px 4px;border-radius:6px;cursor:pointer}
.mm-grant:hover{background:var(--surface-2)}
.hero-img{width:100%;height:auto;border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);display:block}
/* footer social icons */
.footer-social{display:flex;gap:8px;margin-top:10px}
.footer-social .soc{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:rgba(255,255,255,.08);font-size:1rem;text-decoration:none;transition:.15s}
.footer-social .soc:hover{background:var(--accent-500);transform:translateY(-2px)}
/* ===== admin sidebar shell ===== */
.admin-shell{display:grid;grid-template-columns:236px 1fr;gap:22px;align-items:start;margin-top:8px}
.admin-side{position:sticky;top:84px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow-sm)}
.admin-side-head{display:flex;align-items:center;gap:10px;padding:4px 4px 14px;border-bottom:1px solid var(--border);margin-bottom:10px}
.admin-side-head .avatar{width:38px;height:38px;font-size:1.1rem}
.admin-side-head b{display:block;font-size:1rem;color:var(--ink)}
.admin-side-head span{font-size:.76rem;color:var(--ink-muted)}
.admin-nav{display:flex;flex-direction:column;gap:3px}
.admin-nav button{display:flex;align-items:center;gap:10px;width:100%;text-align:start;padding:10px 12px;border:0;border-radius:10px;background:transparent;cursor:pointer;font-family:inherit;font-size:.92rem;font-weight:600;color:var(--ink-muted)}
.admin-nav button .ic{font-size:1.05rem}
.admin-nav button:hover{background:var(--surface-2);color:var(--ink)}
.admin-nav button.active{background:var(--primary-50);color:var(--primary-600)}
/* collapsible group tree (R3) */
.ag-group{display:flex;flex-direction:column}
.ag-head{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:10px;cursor:pointer;font-weight:800;font-size:.82rem;color:var(--ink);text-transform:none;user-select:none}
.ag-head .ic{font-size:1.05rem}
.ag-head:hover{background:var(--surface-2)}
.ag-caret{margin-inline-start:auto;font-size:.7rem;color:var(--ink-muted);transition:transform .15s}
.ag-group.open .ag-caret{transform:rotate(180deg)}
.ag-items{display:none;flex-direction:column;gap:2px;padding-inline-start:8px;margin:2px 0 6px}
.ag-group.open .ag-items{display:flex}
.ag-items button{font-size:.88rem;padding:8px 12px}
.admin-main{min-width:0}
@media(max-width:860px){.admin-shell{grid-template-columns:1fr}.admin-side{position:static}.admin-nav{flex-direction:row;flex-wrap:wrap}.admin-nav button{width:auto}}
/* ===== rich text editor ===== */
.rte-restore{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:8px;padding:8px 12px;border-radius:var(--radius-sm);background:#FFF1DC;border:1px solid var(--accent-500);color:#9a3412;font-size:.86rem;font-weight:600}
.rte-restore span{flex:1;min-width:160px}
.rte-restore .btn{min-height:34px;padding:5px 12px}
.rte{border:1px solid var(--border);border-radius:var(--radius-sm);overflow:hidden;background:var(--surface)}
.rte-bar{display:flex;flex-wrap:wrap;gap:3px;align-items:center;padding:6px;background:var(--surface-2);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:2}
.rte-bar button{min-width:32px;height:30px;padding:0 8px;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;font-size:.9rem;font-family:inherit;color:var(--ink)}
.rte-bar button:hover{background:var(--surface);border-color:var(--border)}
.rte-bar button.active{background:var(--primary-500);border-color:var(--primary-500);color:#fff;box-shadow:0 0 0 3px var(--primary-50)}
.rte-bar button[data-act="painter"].active{background:var(--accent-500);border-color:var(--accent-500);box-shadow:0 0 0 3px #FCE9DD;animation:painterPulse 1.1s ease-in-out infinite}
@keyframes painterPulse{0%,100%{box-shadow:0 0 0 2px #FCE9DD}50%{box-shadow:0 0 0 5px #FCE9DD}}
.rte-body.rte-painting,.rte-body.rte-painting *{cursor:copy!important}
.rte-painter-hint{display:flex;align-items:center;gap:10px;background:#FFF1DC;border:1px solid var(--accent-500);color:#9a3412;font-size:.85rem;font-weight:700;padding:7px 12px;border-radius:0 0 var(--radius-sm) var(--radius-sm);border-top:0}
.rte-painter-hint button{margin-inline-start:auto;background:var(--accent-500);color:#fff;border:0;border-radius:6px;padding:4px 12px;cursor:pointer;font-family:inherit;font-weight:700}
.rte-block{height:30px;border:1px solid var(--border);border-radius:6px;background:var(--surface);font-family:inherit;font-size:.85rem;padding:0 6px;color:var(--ink)}
.rte-font{height:30px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--ink);font-size:.82rem;padding:0 6px;cursor:pointer;max-width:120px}
.rte-sep{width:1px;height:20px;background:var(--border);margin:0 4px}
.rte-body{min-height:200px;max-height:48vh;overflow:auto;padding:14px 16px;line-height:1.9;outline:none}
.rte-ins{height:30px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--ink);font-size:.82rem;font-weight:600;padding:0 6px;cursor:pointer}

/* ===== content blocks (editor palette + public render) ===== */
.cblock{margin:16px 0}
.cblock.note,.cblock.warn,.cblock.tip{padding:12px 16px;border-inline-start:4px solid;border-radius:var(--radius-sm)}
.cblock.note{border-color:var(--primary-500);background:var(--primary-50)}
.cblock.warn{border-color:var(--accent-500);background:#FCE9DD}
.cblock.tip{border-color:var(--success);background:#DEF3E9}
.cblock.note>b,.cblock.warn>b,.cblock.tip>b{display:block;margin-bottom:3px;font-weight:800}
.cblock.note>b{color:var(--primary-700)}.cblock.warn>b{color:#9a3412}.cblock.tip>b{color:#166534}
.cblock.note>p,.cblock.warn>p,.cblock.tip>p{margin:0}
.cblock.cols{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.cblock.cols>div{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:12px 14px}
.cblock.spec{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;background:var(--surface)}
.cblock.spec .spec-t{background:var(--grad);color:#fff;padding:8px 14px;font-weight:800;font-family:var(--font-mono);letter-spacing:.02em}
.cblock.spec .spec-r{display:flex;justify-content:space-between;gap:12px;padding:9px 14px;border-top:1px solid var(--border)}
.cblock.acc{border:1px solid var(--border);border-radius:var(--radius-sm);padding:4px 14px;background:var(--surface)}
.cblock.acc>summary{font-weight:700;cursor:pointer;padding:8px 0;list-style:none}
.cblock.acc>summary::-webkit-details-marker{display:none}
.cblock.acc>summary::before{content:"▸ ";color:var(--primary-500)}
.cblock.acc[open]>summary::before{content:"▾ "}
@media(max-width:600px){.cblock.cols{grid-template-columns:1fr}}
.rte-body:empty::before{content:attr(data-ph);color:var(--faint)}
.rte-body h1{font-size:1.6rem;font-weight:800;margin:.6em 0 .3em}
.rte-body h2{font-size:1.3rem;font-weight:800;margin:.6em 0 .3em}
.rte-body h3{font-size:1.1rem;font-weight:700;margin:.5em 0 .3em}
.rte-body p{margin:.5em 0}
.rte-body ul,.rte-body ol{margin:.5em 0;padding-inline-start:1.6em}
.rte-body blockquote{border-inline-start:3px solid var(--accent-500);margin:.6em 0;padding:.2em 1em;color:var(--ink-muted);background:var(--surface-2)}
.rte-body img{max-width:100%;border-radius:8px;margin:.4em 0}
.rte-body a{color:var(--primary-600);text-decoration:underline}
/* rendered article content (blog / pages / course description) */
.article-body h1{font-size:1.7rem;font-weight:800;margin:1em 0 .4em}
.article-body h2{font-size:1.35rem;font-weight:800;margin:1em 0 .4em}
.article-body h3{font-size:1.12rem;font-weight:700;margin:.8em 0 .3em}
.article-body p{margin:.7em 0}
.article-body ul,.article-body ol{margin:.7em 0;padding-inline-start:1.7em}
.article-body li{margin:.3em 0}
.article-body blockquote{border-inline-start:3px solid var(--accent-500);margin:1em 0;padding:.4em 1.2em;color:var(--ink-muted);background:var(--surface-2);border-radius:0 8px 8px 0}
.article-body img{max-width:100%;border-radius:10px;margin:.8em 0}
.article-body a{color:var(--primary-600);text-decoration:underline}
.article-body hr{border:none;border-top:1px solid var(--border);margin:1.4em 0}
/* editor color/size controls */
.rte-color{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:6px;cursor:pointer;position:relative;font-weight:800;color:var(--ink)}
.rte-color:hover{background:var(--surface)}
.rte-color input[type=color]{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%;padding:0;border:0}
.rte-hi{background:#fff3a0}
.rte-size{height:30px;border:1px solid var(--border);border-radius:6px;background:var(--surface);font-family:inherit;font-size:.82rem;padding:0 4px;color:var(--ink)}
/* CTA (call-to-action) block — editor + rendered articles */
.cta-block,.rte-body .cta-block{background:var(--primary-50);border:1px solid var(--border);border-inline-start:4px solid var(--accent-500);border-radius:var(--radius);padding:18px 20px;margin:18px 0;text-align:center}
.cta-title{font-weight:800;font-size:1.15rem;color:var(--ink);margin-bottom:6px}
.cta-text{color:var(--ink-muted);margin-bottom:12px}
.cta-btn{display:inline-block;background:var(--grad-cta);color:#fff;font-weight:700;padding:11px 26px;border-radius:var(--radius-sm);text-decoration:none;box-shadow:var(--shadow-sm)}
.cta-btn:hover{filter:brightness(1.05)}
/* CTA color variants (block accent bar + button); teal darkened for AA white text */
.cta-block.cta-navy{border-inline-start-color:var(--primary-600)}
.cta-block.cta-navy .cta-btn{background:linear-gradient(135deg,var(--navy),var(--primary-600))}
.cta-block.cta-teal{border-inline-start-color:var(--teal)}
.cta-block.cta-teal .cta-btn{background:linear-gradient(135deg,#0A5966,#0E7C8C)}
.cta-block.cta-light{background:var(--surface);border-inline-start-color:var(--border-strong)}
.cta-block.cta-light .cta-btn{background:var(--surface);color:var(--primary-600);border:2px solid var(--primary-600);box-shadow:none}
.cta-block.cta-light .cta-btn:hover{background:var(--primary-50);filter:none}
/* CTA shape variants */
.cta-block.cta-pill{border-radius:999px;padding-inline:28px}
.cta-block.cta-pill .cta-btn{border-radius:999px}
.cta-block.cta-sharp{border-radius:4px}
.cta-block.cta-sharp .cta-btn{border-radius:4px}
/* editable affordance inside the rich-text editor */
.rte-body .cta-block{cursor:pointer;position:relative;transition:box-shadow .15s ease}
.rte-body .cta-block:hover{box-shadow:0 0 0 2px var(--teal)}
.rte-body .cta-block:hover::after{content:'✎';position:absolute;top:6px;inset-inline-end:10px;font-size:.9rem;color:var(--secondary-600)}
/* color swatches in the CTA dialog */
.cta-swatches{display:flex;gap:8px;padding-top:4px}
.cta-swatch{width:34px;height:34px;border-radius:8px;border:2px solid var(--border);cursor:pointer;transition:transform .1s ease;padding:0}
@media(max-width:900px){.cta-swatch{width:44px;height:44px}}
.cta-swatch:hover{transform:scale(1.08)}
.cta-swatch.sel{border-color:var(--ink);box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--teal)}
.cta-swatch.sw-cta-accent{background:var(--grad-cta)}
.cta-swatch.sw-cta-navy{background:linear-gradient(135deg,var(--navy),var(--primary-600))}
.cta-swatch.sw-cta-teal{background:linear-gradient(135deg,#0A5966,#0E7C8C)}
.cta-swatch.sw-cta-light{background:var(--surface);border-color:var(--primary-600)}
/* curriculum sections (accordion) — admin manager + public course detail */
.cm-section,.cur-section{border:1px solid var(--border);border-radius:var(--radius-sm);margin-bottom:10px;overflow:hidden;background:var(--surface)}
.cm-section>summary,.cur-section>summary{cursor:pointer;padding:12px 14px;font-weight:800;color:var(--ink);background:var(--surface-2);list-style:none;display:flex;align-items:center;gap:8px;user-select:none}
.cm-section>summary::-webkit-details-marker,.cur-section>summary::-webkit-details-marker{display:none}
.cm-section>summary::after,.cur-section>summary::after{content:'▾';margin-inline-start:auto;color:var(--ink-muted);transition:transform .15s}
.cm-section[open]>summary::after,.cur-section[open]>summary::after{transform:rotate(180deg)}
.cm-count,.cur-count{font-size:.78rem;font-weight:700;color:var(--primary-700);background:var(--primary-50);border-radius:999px;padding:2px 9px}
.cm-section-body,.cur-section-body{padding:8px 10px}
/* contract template picker */
.tpl-pick{display:block;width:100%;text-align:start;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:13px 15px;margin-bottom:10px;cursor:pointer;transition:border-color .15s,background .15s}
.tpl-pick:hover{border-color:var(--primary-500);background:var(--primary-50)}
.tpl-name{font-weight:800;color:var(--ink);display:flex;align-items:center;gap:8px}
.tpl-desc{color:var(--ink-muted);font-size:.86rem;margin-top:4px}
/* gallery image editor (crop/rotate) */
.img-ed-bar{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-bottom:12px}
.img-ed-bar .btn{padding:7px 12px}
.img-ed-bar .btn.active,#ie-cropbtn.active{background:var(--accent-500);color:#fff;border-color:var(--accent-500)}
.img-ed-stage{position:relative;display:flex;justify-content:center;background:var(--surface-2);border-radius:var(--radius);padding:10px;min-height:120px}
.img-ed-stage canvas{max-width:100%;border-radius:6px;box-shadow:var(--shadow-sm);touch-action:none}
.ie-crop{position:absolute;border:2px dashed #fff;box-shadow:0 0 0 9999px rgba(4,18,31,.45);cursor:move;touch-action:none}
.ie-h{position:absolute;inset-inline-end:-7px;inset-block-end:-7px;width:14px;height:14px;background:var(--accent-500);border:2px solid #fff;border-radius:3px;cursor:nwse-resize}
.img-ed-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:14px}

/* ===== article / blog / banners ===== */
.article{max-width:820px;margin:0 auto}
.article h1{font-size:1.9rem;font-weight:800;color:var(--ink)}
.article-body{color:var(--ink);font-size:1.06rem;line-height:2.05}
.article-body br{display:block;margin-bottom:8px;content:""}
.banner-slot{display:block;border-radius:var(--radius-lg);overflow:hidden;margin-bottom:28px;box-shadow:var(--shadow-sm)}
.banner-slot img{width:100%;display:block}
.banner-carousel{position:relative;border-radius:var(--radius-lg);overflow:hidden;margin-bottom:28px;box-shadow:var(--shadow-sm)}
.banner-carousel .banner-track{display:flex;transition:transform .5s ease}
.banner-carousel .banner-slot{flex:0 0 100%;margin-bottom:0;border-radius:0;box-shadow:none}
.banner-nav{position:absolute;top:50%;transform:translateY(-50%);width:36px;height:36px;border-radius:50%;border:none;background:rgba(11,39,64,.45);color:#fff;font-size:1.3rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:2}
.banner-nav:hover{background:rgba(11,39,64,.7)}
.banner-nav.prev{inset-inline-start:12px}
.banner-nav.next{inset-inline-end:12px}
.banner-dots{position:absolute;bottom:12px;inset-inline-start:0;inset-inline-end:0;display:flex;justify-content:center;gap:7px;z-index:2}
.banner-dot{width:8px;height:8px;border-radius:50%;border:none;background:rgba(255,255,255,.55);cursor:pointer;padding:0}
.banner-dot.active{background:#fff;width:22px;border-radius:5px}

/* ===== generic comments (posts/pages/courses) ===== */
.comments-block{margin-top:40px;padding-top:28px;border-top:1px solid var(--border)}
.comments-title{font-size:1.2rem;font-weight:800;margin-bottom:16px}
.comments-list{display:flex;flex-direction:column;gap:14px;margin-bottom:22px}
.comment-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:12px 16px}
.comment-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px}
.comment-date{color:var(--faint);font-size:.8rem}
.comment-body{color:var(--ink);line-height:1.9;word-break:break-word}
.comments-empty{color:var(--faint);font-size:.92rem}
.comment-form{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:18px}
.comment-login-cta{text-align:center}
.comment-login-cta p{color:var(--ink-muted);margin-bottom:14px}
.seg-tabs{display:flex;gap:8px;flex-wrap:wrap}
.seg-tabs button{padding:6px 14px;border-radius:30px;border:1px solid var(--border);background:var(--surface);color:var(--ink-muted);font-size:.85rem;font-weight:600}
.seg-tabs button.active{background:var(--primary-600);color:#fff;border-color:var(--primary-600)}
.banner-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:18px;margin-bottom:28px}
.promo-card{position:relative;border-radius:var(--radius);overflow:hidden;min-height:140px;display:grid;place-items:center;background:var(--grad-soft);color:#fff;font-weight:800;padding:20px;text-align:center}

/* ===== secure PRO player (custom chrome) ===== */
.pp{position:relative;background:#04121f;border-radius:var(--radius);overflow:hidden;margin-bottom:14px;box-shadow:var(--shadow-lg);aspect-ratio:16/9;outline:none;user-select:none}
.pp-video{width:100%;height:100%;display:block;background:#04121f;object-fit:contain}
.pp-video::-webkit-media-controls{display:none!important}
.pp-wm{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:6}
.pp-wm span{position:absolute;top:14%;inset-inline-start:10%;color:rgba(255,255,255,.20);font-family:var(--font-mono);font-size:.78rem;white-space:nowrap;text-shadow:0 1px 2px rgba(0,0,0,.5);transition:top 1.6s ease,inset-inline-start 1.6s ease}
.pp-spinner{position:absolute;inset:0;margin:auto;width:46px;height:46px;border:4px solid rgba(255,255,255,.25);border-top-color:#fff;border-radius:50%;animation:ppspin .9s linear infinite;z-index:7}
@keyframes ppspin{to{transform:rotate(360deg)}}
.pp-big{position:absolute;inset:0;margin:auto;width:74px;height:74px;border-radius:50%;background:rgba(4,18,31,.55);border:2px solid rgba(255,255,255,.7);color:#fff;display:grid;place-items:center;cursor:pointer;z-index:8;backdrop-filter:blur(3px)}
.pp-big:hover{background:var(--accent-500);border-color:var(--accent-500)}
.pp-err,.pp-resume{position:absolute;inset:0;margin:auto;z-index:9;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;background:rgba(4,18,31,.80);color:#fff;text-align:center;padding:20px}
.pp-resume-row{display:flex;gap:10px}
.pp-menu{position:absolute;inset-inline-end:12px;inset-block-end:64px;z-index:10;background:rgba(8,22,36,.96);border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:10px;min-width:178px;max-height:62%;overflow:auto;box-shadow:var(--shadow-lg)}
.pp-mg{display:flex;flex-wrap:wrap;gap:5px;align-items:center;padding:6px 2px;border-bottom:1px solid rgba(255,255,255,.08)}
.pp-mg:last-child{border-bottom:0}
.pp-mg>span{flex-basis:100%;color:var(--teal-bright,#5fd3c4);font-size:.72rem;font-weight:700;margin-bottom:3px}
.pp-mg button{background:rgba(255,255,255,.07);color:#e7eef5;border:0;border-radius:7px;padding:4px 9px;font-size:.8rem;cursor:pointer;font-family:inherit}
.pp-mg button.on,.pp-mg button:hover{background:var(--accent-500);color:#fff}
.pp-bar{position:absolute;inset-inline:0;inset-block-end:0;z-index:9;padding:6px 12px 9px;background:linear-gradient(transparent,rgba(2,10,18,.88));opacity:0;transform:translateY(6px);transition:opacity .25s,transform .25s}
.pp.pp-show .pp-bar{opacity:1;transform:none}
.pp:not(.pp-show){cursor:none}
.pp-seek{position:relative;height:16px;display:flex;align-items:center;cursor:pointer;margin-bottom:2px}
.pp-seek::before{content:'';position:absolute;inset-inline:0;height:4px;background:rgba(255,255,255,.22);border-radius:4px}
.pp-buf{position:absolute;inset-inline-start:0;height:4px;background:rgba(255,255,255,.38);border-radius:4px;width:0}
.pp-cur{position:absolute;inset-inline-start:0;height:4px;background:var(--accent-500);border-radius:4px;width:0}
.pp-knob{position:absolute;inset-inline-end:-6px;top:50%;transform:translateY(-50%);width:12px;height:12px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.5)}
.pp-tip{position:absolute;bottom:18px;transform:translateX(50%);background:#0a1622;color:#fff;font-family:var(--font-mono);font-size:.72rem;padding:2px 6px;border-radius:5px;pointer-events:none;white-space:nowrap}
.pp-ctrls{display:flex;align-items:center;gap:4px}
.pp-c{background:transparent;border:0;color:#eaf1f8;min-width:34px;height:34px;padding:0 6px;border-radius:8px;display:grid;place-items:center;cursor:pointer;font-size:.88rem;font-family:inherit}
.pp-c:hover{background:rgba(255,255,255,.14)}
.pp-vol{width:74px;accent-color:var(--accent-500);cursor:pointer}
.pp-time{color:#cdd9e5;font-size:.78rem;margin-inline-start:4px}
.pp-spacer{flex:1}
.pp:fullscreen{aspect-ratio:auto;width:100%;height:100%;margin:0}
.pp:fullscreen .pp-video{height:100%}
@media(max-width:640px){.pp-vol{width:46px}.pp-time{font-size:.68rem}.pp-c{min-width:30px}}
.player-note{color:var(--ink-muted);font-size:.85rem;margin-top:8px;display:flex;align-items:center;gap:6px}
.live-card{background:var(--grad-navy);color:#E6EEF5;border-radius:var(--radius);padding:34px 28px;text-align:center;box-shadow:var(--shadow-lg)}
.live-card h3{font-size:1.4rem;font-weight:800;margin:10px 0;color:#fff}
.live-card .btn-primary{margin-top:16px}
.live-badge{display:inline-block;font-family:var(--font-mono);font-weight:800;letter-spacing:.08em;color:var(--teal-bright)}
.audio-card{background:var(--grad-navy);border-radius:var(--radius);padding:30px;display:flex;flex-direction:column;align-items:center;gap:18px;box-shadow:var(--shadow-lg)}
.audio-art{width:90px;height:90px;border-radius:50%;background:var(--grad);display:grid;place-items:center;font-size:2.6rem}

/* ===== bell / notifications / wishlist / bundles ===== */
.bell-btn{position:relative;width:40px;height:38px;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--border);font-size:1.05rem}
.bell-btn:hover{border-color:var(--border-strong)}
.bell-badge{position:absolute;top:-4px;inset-inline-end:-4px;min-width:18px;height:18px;padding:0 4px;border-radius:10px;background:var(--accent-500);color:#fff;font-size:.7rem;font-weight:800;display:grid;place-items:center;font-family:var(--font-mono)}
.notif-item{display:flex;gap:12px;align-items:flex-start;padding:12px 8px;border-bottom:1px solid var(--border)}
.notif-item.unread{background:var(--primary-50)}
.notif-item .ic{font-size:1.2rem}
.notif-item h5{font-weight:700;font-size:.92rem;color:var(--ink)}
.notif-item p{color:var(--ink-muted);font-size:.85rem}
.notif-item span{color:var(--faint);font-size:.75rem}
.wish-heart{position:absolute;top:12px;inset-inline-end:12px;z-index:3;width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.92);display:grid;place-items:center;font-size:1rem;box-shadow:var(--shadow-sm);transition:.15s}
.wish-heart:hover{transform:scale(1.12)}
.wish-heart.on{background:var(--accent-500)}
.prereq-banner{display:flex;align-items:center;gap:10px;background:#FBF1D9;border:1px solid var(--warning);color:#854d0e;border-radius:var(--radius);padding:12px 16px;margin-bottom:18px;font-weight:600}
.lesson-row.locked{opacity:.62}
.lesson-row.locked .lesson-num{background:var(--n-200);color:var(--faint)}

/* ===== animations ===== */
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes fade{from{opacity:0}}
@keyframes popin{from{opacity:0;transform:translateY(10px) scale(.98)}}
@keyframes slideUp{from{opacity:0;transform:translateY(24px)}}
@keyframes flow{to{stroke-dashoffset:-180}}
@keyframes sonar{from{r:3.5;opacity:.6}to{r:13;opacity:0}}
.fade-in{animation:fade .4s ease}
.slide-up{animation:slideUp .5s ease both}
@media (prefers-reduced-motion:reduce){.hero-svg *{animation:none !important}}

.rating-num{color:var(--ink-muted);font-weight:700;font-size:.82rem;font-family:var(--font-mono)}
.rating-new{display:inline-flex;align-items:center;font-size:.78rem;font-weight:700;color:var(--teal);background:var(--primary-100);padding:2px 9px;border-radius:30px}
/* certificate promise on course sidebar (surfaces a key buying motive) */
.cert-promise{margin-top:14px;padding:10px 12px;border-radius:var(--radius-sm);background:var(--primary-50);
  color:var(--primary-700);font-size:.86rem;font-weight:600;line-height:1.7;display:flex;gap:8px;align-items:flex-start;border:1px solid var(--border)}

/* loading skeletons (perceived-faster grids) */
.skel{background:linear-gradient(90deg,var(--n-100) 25%,var(--n-200) 37%,var(--n-100) 63%);background-size:400% 100%;animation:skelshine 1.4s ease infinite;border-radius:6px}
@keyframes skelshine{0%{background-position:100% 0}100%{background-position:-100% 0}}
.skel-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.skel-thumb{aspect-ratio:16/10;border-radius:0}
.skel-body{padding:16px 18px;display:flex;flex-direction:column;gap:10px}
.skel-line{height:12px}
.skel-line.w90{width:90%}.skel-line.w60{width:60%}.skel-line.w40{width:40%}
@media (prefers-reduced-motion:reduce){.skel{animation:none}}

/* eNamad / trust seals row in footer */
.footer-trust{position:relative;display:flex;flex-wrap:wrap;gap:14px;align-items:center;justify-content:center;padding:16px 0 4px;margin-top:8px;border-top:1px solid rgba(255,255,255,.12)}
.footer-trust img{max-height:90px;width:auto;border-radius:8px;background:#fff;padding:4px}

/* ===== a11y: keyboard focus + touch targets ===== */
/* visible focus ring for keyboard users (mouse clicks stay clean via :focus-visible) */
a:focus-visible,button:focus-visible,[tabindex]:focus-visible,.chip:focus-visible,
.lang-toggle:focus-visible,.modal-close:focus-visible,summary:focus-visible{
  outline:3px solid var(--primary-500);outline-offset:2px;border-radius:6px;
}
.form-control:focus-visible,select.field:focus-visible,.search-box input:focus-visible{outline:none}
/* hamburger toggle — desktop hidden, revealed on mobile */
.nav-toggle{display:none;width:44px;height:44px;border-radius:var(--radius-sm);background:var(--surface-2);
  border:1px solid var(--border);font-size:1.35rem;color:var(--ink);align-items:center;justify-content:center}

/* app-like route transition (retriggered by setHTML each navigation) */
.rt-in{animation:rtin .3s cubic-bezier(.2,.7,.3,1)}
@keyframes rtin{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.rt-in{animation:none}}

/* ===== responsive ===== */
@media(max-width:900px){
  .detail{grid-template-columns:1fr}
  .sidebar-card{position:static;order:-1}
  .hero-grid{grid-template-columns:1fr}
  /* mobile hero: keep the telemetry spec-card (hide only the wide SVG) so it isn't bare */
  .hero-art{display:block;margin-top:20px}
  .hero-svg{display:none}
  .spec-card{margin-top:0 !important}
  .hero{padding:40px 24px}
  /* mobile nav: hamburger reveals a full-width drop drawer (was display:none = no nav at all) */
  .nav-inner{position:relative;flex-wrap:wrap}
  .nav-toggle{display:inline-flex}
  .nav-links{display:none;position:absolute;top:100%;inset-inline:0;flex-direction:column;gap:2px;
    margin:0;padding:8px;background:var(--surface);border-bottom:1px solid var(--border);
    box-shadow:var(--shadow-lg);max-height:75vh;overflow:auto;z-index:60}
  .nav-links.open{display:flex}
  .nav-links a{padding:13px 16px;min-height:48px;display:flex;align-items:center;border-radius:var(--radius-sm);color:var(--ink)}
  .nav-links a::after{display:none}
  .nav-links a:hover,.nav-links a.active{background:var(--surface-2)}
  /* touch targets ≥44px */
  .btn,.lang-toggle,.bell-btn,.avatar-btn,.modal-close,.chip{min-height:44px}
  .kyc-grid{grid-template-columns:1fr}
  .cert-inner{padding:30px 20px}
  .cert-title,.cert-name{font-size:1.5rem}
}

/* ============================================================
   PREMIUM POLISH LAYER — artful HVAC finish (elevates, doesn't rebrand)
   ============================================================ */

/* themed scrollbar (matches the cool brand gradient) */
*{scrollbar-width:thin;scrollbar-color:var(--primary-400) transparent}
*::-webkit-scrollbar{width:11px;height:11px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{background:linear-gradient(var(--primary-400),var(--teal));border-radius:20px;border:3px solid var(--bg);background-clip:padding-box}
*::-webkit-scrollbar-thumb:hover{background:linear-gradient(var(--primary-500),var(--primary-400));background-clip:padding-box}
::selection{background:rgba(17,166,184,.24);color:var(--ink)}

/* premium primary/cool buttons: soft glow + a light sheen sweep on hover */
.btn-primary{box-shadow:0 6px 18px -6px rgba(194,78,24,.55)}
.btn-cool{box-shadow:0 6px 18px -6px rgba(14,107,168,.5)}
.btn-primary,.btn-cool{position:relative;overflow:hidden;isolation:isolate}
.btn-primary::after,.btn-cool::after{content:"";position:absolute;inset:0 auto 0 -140%;width:55%;
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.4),transparent);transform:skewX(-18deg);z-index:-1}
.btn-primary:hover::after,.btn-cool:hover::after{animation:sheen .7s ease}
@keyframes sheen{to{inset:0 auto 0 160%}}

/* cards: staggered entrance + deeper cool hover glow + smoother easing */
.card{transition:transform .24s cubic-bezier(.2,.7,.3,1),box-shadow .24s,border-color .24s}
.card:hover{box-shadow:0 22px 46px -14px rgba(14,107,168,.30)}
.grid > .card{animation:cardin .5s cubic-bezier(.2,.7,.3,1) both}
.grid > .card:nth-child(2){animation-delay:.04s}.grid > .card:nth-child(3){animation-delay:.08s}
.grid > .card:nth-child(4){animation-delay:.12s}.grid > .card:nth-child(5){animation-delay:.16s}
.grid > .card:nth-child(6){animation-delay:.2s}.grid > .card:nth-child(n+7){animation-delay:.24s}
@keyframes cardin{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}

/* hero: gentle float on the telemetry art + ambient teal aurora */
.hero-art{animation:floaty 7s ease-in-out infinite}
@keyframes floaty{0%,100%{transform:translateY(0)}50%{transform:translateY(-9px)}}
.hero::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:radial-gradient(55% 75% at 100% 0,rgba(17,166,184,.12),transparent 62%),
             radial-gradient(45% 60% at 0 100%,rgba(14,107,168,.08),transparent 60%)}
.spec-card{box-shadow:0 18px 44px -16px rgba(11,39,64,.35)}

/* nav active link gets a soft under-glow; brand logo subtle lift on hover */
.nav-links a.active{color:var(--primary-700)}
.brand{transition:.2s}.brand:hover .logo{transform:translateY(-1px) rotate(-3deg)}
.brand .logo{transition:.25s}

/* chips + std-chips: tactile hover */
.chip{transition:.16s}.chip:hover{border-color:var(--primary-400);color:var(--ink);transform:translateY(-1px)}
.std-chip{transition:.16s}.std-chip:hover{background:var(--primary-100);border-color:var(--primary-400)}

/* empty-state: framed illustration card instead of a bare emoji */
.empty{background:var(--surface);border:1px dashed var(--border-strong);border-radius:var(--radius-lg);
  padding:48px 24px;display:flex;flex-direction:column;align-items:center;gap:6px}
.empty .ic{font-size:2.6rem;margin-bottom:6px;filter:drop-shadow(0 6px 14px rgba(14,107,168,.18))}
.empty .empty-art{width:96px;height:96px;margin-bottom:6px;opacity:.9}
.empty p{max-width:420px;font-size:1rem}

/* section heads: a faint airflow tick after the title bar */
.section-head h2::after{content:"";display:inline-block;width:26px;height:2px;margin-inline-start:10px;vertical-align:middle;
  background:linear-gradient(90deg,var(--teal),transparent);border-radius:2px}

/* inputs: focus glow already exists; add a subtle lift to primary form buttons */
.form-control,select.field{transition:border-color .16s,box-shadow .16s,background .16s}

/* stat cards + repeat items: hairline polish */
.stat{transition:.2s}.stat:hover{transform:translateY(-3px);box-shadow:var(--shadow)}
.stat .ic{background:linear-gradient(135deg,var(--primary-50),var(--primary-100));color:var(--primary-600)}
/* cohesive KPI icon tones — HVAC cool palette + gold/green accents */
.stat .ic.ic-teal{background:linear-gradient(135deg,#D6F1F4,#B4E6EC);color:#0A5966}
.stat .ic.ic-blue{background:linear-gradient(135deg,var(--primary-50),var(--primary-100));color:var(--primary-600)}
.stat .ic.ic-navy{background:linear-gradient(135deg,#DCE6EF,#C2D3E2);color:var(--navy)}
.stat .ic.ic-gold{background:linear-gradient(135deg,#FBF0D2,#F6E1A8);color:#8A6100}
.stat .ic.ic-green{background:linear-gradient(135deg,#D8F1E4,#BEE7D0);color:#166534}

/* dashboard/admin surface polish */
.tabs button{border-radius:8px 8px 0 0;transition:color .16s,background .16s}
.tabs button:hover{color:var(--ink);background:var(--surface-2)}
.admin-nav button{transition:.15s}
.admin-nav button.active{box-shadow:inset 3px 0 0 var(--primary-500)}
[dir=ltr] .admin-nav button.active{box-shadow:inset -3px 0 0 var(--primary-500)}
.enrolled-row{transition:transform .2s,box-shadow .2s,border-color .2s}
.enrolled-row:hover{border-color:var(--primary-400);box-shadow:0 10px 24px -14px rgba(14,107,168,.3)}
.set-section{transition:box-shadow .2s}
.repeat-item{transition:.15s}
th:first-child,td:first-child{font-weight:600;color:var(--ink)}

@media (prefers-reduced-motion:reduce){
  .grid > .card,.hero-art,.btn-primary::after,.btn-cool::after,.stat{animation:none!important;transition:none!important}
}

/* ===== SEO audit scorecard ===== */
.seo-scorecard{display:flex;gap:20px;align-items:center;flex-wrap:wrap;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:18px 20px;margin-bottom:16px}
.seo-score{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:110px;height:110px;border:4px solid var(--ink-muted);border-radius:50%}
.seo-grade{font-size:2rem;font-weight:800;line-height:1}
.seo-num{font-size:1.1rem;font-weight:700;color:var(--ink)}
.seo-num span{font-size:.75rem;color:var(--ink-muted)}
.seo-summary{display:flex;flex-direction:column;gap:6px}
.seo-allgood{padding:24px;text-align:center;background:#DEF3E9;border:1px solid var(--success);border-radius:var(--radius);color:#166534;font-weight:700}
@media (prefers-color-scheme:dark){.seo-allgood{background:rgba(22,101,52,.18)}}
/* ===== settings horizontal tabs ===== */
.set-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:18px;border-bottom:2px solid var(--border);padding-bottom:0}
.set-tab{background:transparent;border:1px solid transparent;border-bottom:0;border-radius:var(--radius-sm) var(--radius-sm) 0 0;padding:9px 16px;font-family:inherit;font-size:.88rem;font-weight:700;color:var(--ink-muted);cursor:pointer;margin-bottom:-2px;white-space:nowrap}
.set-tab:hover{color:var(--ink);background:var(--surface-2)}
.set-tab.active{color:var(--primary-600);background:var(--surface);border-color:var(--border);border-bottom:2px solid var(--surface)}
.set-pane[hidden]{display:none}
.seo-h{margin:18px 0 10px;font-size:.95rem;font-weight:800;color:var(--ink)}
.seo-groups{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px;margin-bottom:8px}
.seo-group{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:12px 14px}
.seo-group-top{display:flex;justify-content:space-between;gap:10px;align-items:center;font-weight:700;font-size:.86rem}
.seo-group-top b{white-space:nowrap;color:var(--ink-muted);font-variant-numeric:tabular-nums}
.seo-bar{height:7px;border-radius:4px;background:var(--border);overflow:hidden;margin-top:8px}
.seo-bar-fill{display:block;height:100%;border-radius:4px}
.seo-bar-fill.sev-error{background:var(--danger)}
.seo-bar-fill.sev-warning{background:#ea580c}
.seo-bar-fill.sev-info{background:var(--primary-500)}

/* ---- Manageable lists: toolbar, sortable headers, row actions, pager ----
   Shared by the users and enrollments admin lists (search + filters + sort +
   trash toggle) so both surfaces look and behave the same. */
.list-toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:10px 0 14px}
.list-toolbar .form-control{margin:0}
.th-sort{background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer;font-weight:600}
.th-sort:hover{color:var(--primary-600,#0E6BA8)}
.th-sort.on{color:var(--primary-600,#0E6BA8)}
.row-actions{display:flex;gap:2px;align-items:center;white-space:nowrap}
.row-actions .btn{padding:4px 7px}
.muted{color:var(--muted);opacity:.7}
.pager{display:flex;gap:12px;align-items:center;justify-content:center;margin-top:14px}
.pager .btn[disabled]{opacity:.45;cursor:not-allowed}
.ue-meta{padding:8px 10px;background:var(--surface-2,#F6F8FA);border:1px solid var(--border);border-radius:8px;line-height:1.9}

/* ============================================================================
   PWA — install prompt + standalone-mode chrome
   ========================================================================= */

/* Installed mode has no browser chrome, so the page owns the notch and the
   home-indicator strip. Without this the footer sits under the iPhone home bar. */
@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* A single compact row: mark, one line of text, one small button, a close X.
   An install nag is an interruption — it should read in one glance and take as
   little of the screen as it can. NO dark-mode variant: this site is light-only,
   so keying off the visitor's OS produced a dark slab on a white page. */
.pwa-install{
  position:fixed; z-index:96;
  inset-inline-start:14px; bottom:calc(14px + env(safe-area-inset-bottom,0px));
  max-width:360px;
  display:flex; align-items:center; gap:10px;
  padding:9px 10px 9px 12px;
  background:var(--surface); color:var(--ink);
  border:1px solid var(--border); border-radius:999px;
  box-shadow:var(--shadow);
  animation:pwa-rise .28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes pwa-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

.pwa-install .pwa-mark{
  width:32px;height:32px;border-radius:50%;
  background:var(--grad); color:#fff;
  display:grid;place-items:center;
  font-size:.95rem;font-weight:800;flex:0 0 auto;overflow:hidden;
}
.pwa-install .pwa-mark img{width:100%;height:100%;object-fit:cover}

.pwa-install .pwa-copy{min-width:0;flex:1}
.pwa-install .pwa-title{
  font-size:.85rem;font-weight:700;line-height:1.5;color:var(--ink);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
/* The second line is redundant at this size — the button says what happens. */
.pwa-install .pwa-sub{display:none}

.pwa-install .pwa-actions{flex:0 0 auto}
.pwa-install .pwa-go{
  background:var(--grad-cta);color:#fff;border:0;border-radius:999px;
  min-height:34px;padding:0 15px;
  font:inherit;font-weight:700;font-size:.82rem;
  cursor:pointer;white-space:nowrap;transition:filter .15s ease;
}
.pwa-install .pwa-go:hover{filter:brightness(1.06)}
.pwa-install .pwa-x{
  background:none;border:0;cursor:pointer;flex:0 0 auto;
  color:var(--ink-muted);font-size:1rem;line-height:1;
  width:28px;height:28px;border-radius:50%;
}
.pwa-install .pwa-x:hover{background:var(--surface-2);color:var(--ink)}

/* Phones: span the width but stay one row and stay short. */
@media (max-width:560px){
  .pwa-install{inset-inline:10px;max-width:none;bottom:calc(10px + env(safe-area-inset-bottom,0px))}
  .pwa-install .pwa-title{font-size:.8rem}
}

/* iOS Safari never fires beforeinstallprompt, so those users get steps. */
.pwa-steps{margin:0;padding-inline-start:18px;line-height:2;font-size:.9rem;color:var(--ink)}
.pwa-steps b{color:var(--primary-500)}
.pwa-ios-icon{
  display:inline-grid;place-items:center;width:22px;height:22px;border-radius:6px;
  background:var(--primary-50);color:var(--primary-600);vertical-align:-5px;margin:0 2px;
}

@media (prefers-reduced-motion:reduce){
  .pwa-install{animation:none}
  .pwa-install .pwa-go{transition:none}
}

/* ============================================================================
   Course thumbnails — the gradient is a fallback, the image goes ON TOP
   .sidebar-thumb paints a blueprint overlay via ::after, which is positioned
   and therefore stacks above plain children; the image needs its own layer or
   it renders underneath the overlay.
   ========================================================================= */
.sidebar-thumb{overflow:hidden}
.sidebar-thumb img{position:relative;z-index:1;width:100%;height:100%;object-fit:cover;display:block}
.enrolled-row .thumb img{width:100%;height:100%;object-fit:cover;display:block}

/* ============================================================================
   Wide admin tables on narrow screens
   These lists grew to ten columns. The container already scrolled, but nothing
   told you it could, so the last columns simply looked cut off.
   ========================================================================= */
.table-wrap{
  overflow-x:auto; -webkit-overflow-scrolling:touch;
  /* Edge shadows that appear only while there IS more to scroll to — they are
     painted by the background and pinned/scrolled respectively. */
  background-image:
    linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)),
    linear-gradient(to right, rgba(255,255,255,0), var(--surface) 70%),
    linear-gradient(to right, rgba(11,39,64,.10), rgba(11,39,64,0)),
    linear-gradient(to left,  rgba(11,39,64,.10), rgba(11,39,64,0));
  background-position:left center, right center, left center, right center;
  background-repeat:no-repeat;
  background-size:36px 100%, 36px 100%, 14px 100%, 14px 100%;
  background-attachment:local, local, scroll, scroll;
}
.table-wrap table{min-width:max-content}

/* Progressive disclosure: drop the least load-bearing columns first so the
   identifying ones (name, phone, status, actions) survive on a phone. */
@media (max-width:1100px){ .col-opt-3{display:none} }
@media (max-width:900px){  .col-opt-2{display:none} }
@media (max-width:680px){  .col-opt-1{display:none} }

/* Coupon product picker — a site with fifty courses would otherwise turn the
   coupon modal into an endless scroll. */
.cp-picklist{
  max-height:190px; overflow-y:auto;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:10px 12px; display:flex; flex-direction:column; gap:6px;
  background:var(--surface-2);
}
.cp-pickgroup{
  font-size:.76rem; font-weight:800; color:var(--ink-muted);
  text-transform:uppercase; letter-spacing:.04em;
  margin-top:4px; padding-bottom:2px; border-bottom:1px solid var(--border);
}
.cp-pickgroup:first-child{margin-top:0}

/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN ELEVATION v2 — 2025 finish over the HVAC engineering identity.
   Additive only: no class is renamed, no layout is restructured. Everything
   here refines depth, motion and micro-interaction on the surfaces both the
   user and admin sides already share (.card / .stat / .table-wrap / .set-section
   / .admin-side / .sidebar-card / buttons / modals / forms).
   The reveal system's hidden state is applied ONLY by JS — if the script fails,
   nothing is ever left invisible.
   ═══════════════════════════════════════════════════════════════════════════ */

:root{
  --ease-out:cubic-bezier(.2,.7,.3,1);
  --ease-spring:cubic-bezier(.22,.98,.36,1.06);
  /* layered, brand-tinted elevation — cooler and deeper than a flat grey drop */
  --lift-1:0 1px 0 rgba(255,255,255,.65) inset, 0 2px 6px -2px rgba(11,39,64,.10);
  --lift-2:0 1px 0 rgba(255,255,255,.7) inset, 0 12px 30px -14px rgba(11,39,64,.22);
  --lift-3:0 1px 0 rgba(255,255,255,.75) inset, 0 26px 60px -22px rgba(14,107,168,.34);
}

/* ---- reveal-on-scroll (JS adds .reveal, then .in when in view) ------------ */
.reveal{opacity:0;transform:translateY(20px);will-change:opacity,transform;
  transition:opacity .62s var(--ease-out), transform .62s var(--ease-out)}
.reveal.in{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){
  .reveal,.reveal.in{opacity:1 !important;transform:none !important;transition:none}
}

/* ---- reading / scroll progress rail at the very top ---------------------- */
.scroll-progress{position:fixed;top:0;inset-inline:0;height:3px;z-index:120;pointer-events:none;background:transparent}
.scroll-progress i{display:block;height:100%;width:0;transform-origin:0 50%;
  background:linear-gradient(90deg,var(--teal-bright),var(--teal),var(--primary-500));
  box-shadow:0 0 10px rgba(34,211,238,.55)}
[dir=rtl] .scroll-progress i{transform-origin:100% 50%}
@media print{.scroll-progress{display:none}}

/* ---- depth pass on the shared surfaces ----------------------------------- */
.card,.stat,.spec-card,.set-section,.curriculum,.sidebar-card,.auth-card,
.co-summary,.gateway-card,.receipt-sheet,.admin-side,.table-wrap,.dg-item{
  box-shadow:var(--lift-2);
}
.card{transition:transform .26s var(--ease-out),box-shadow .26s,border-color .26s}
.card:hover{transform:translateY(-5px);box-shadow:var(--lift-3);border-color:var(--primary-400)}

/* stat tiles: lift + the top accent bar brightens on hover */
.stat{transition:transform .22s var(--ease-out),box-shadow .22s}
.stat:hover{transform:translateY(-3px);box-shadow:var(--lift-3)}
.stat::before{transition:filter .22s,height .22s}
.stat:hover::before{height:4px;filter:brightness(1.15) saturate(1.2)}
.stat .v{font-variant-numeric:tabular-nums;letter-spacing:-.01em}

/* ---- buttons: press feedback + a touch more spring ----------------------- */
.btn{transition:transform .16s var(--ease-spring),filter .16s,box-shadow .18s,background .18s,border-color .18s}
.btn:not(:disabled):active{transform:translateY(1px) scale(.985)}
.btn-primary:hover,.btn-cool:hover{transform:translateY(-2px)}
.btn-primary:hover{box-shadow:0 12px 26px -8px rgba(194,78,24,.6)}
.btn-cool:hover{box-shadow:0 12px 26px -8px rgba(14,107,168,.55)}

/* ---- forms: a calmer, teal focus ring + hover cue ------------------------ */
.form-control,select.field,.search-box input{transition:border-color .16s,box-shadow .18s,background .16s}
.form-control:hover,select.field:hover,.search-box input:hover{border-color:var(--border-strong)}
.form-control:focus,select.field:focus,.search-box input:focus{
  border-color:var(--teal);box-shadow:0 0 0 4px rgba(17,166,184,.16)}

/* ---- the course buy-box: living accent bar + real elevation -------------- */
.sidebar-card{box-shadow:var(--lift-3)}
.sidebar-card::before,.card::before,.spec-card::before,.stat::before,.dg-item::before{background-size:200% 100%}
.sidebar-card::before{
  background:linear-gradient(90deg,var(--primary-600),var(--teal),var(--teal-bright),var(--teal),var(--primary-600));
  background-size:220% 100%;animation:railflow 5.5s linear infinite}
@keyframes railflow{to{background-position:220% 0}}
@media (prefers-reduced-motion:reduce){.sidebar-card::before{animation:none}}

/* ---- nav: crisper glass + an animated active pill ------------------------ */
.navbar{background:rgba(247,250,252,.72);backdrop-filter:saturate(180%) blur(18px);-webkit-backdrop-filter:saturate(180%) blur(18px)}
.nav-links a::after{height:2px;transition:transform .22s var(--ease-spring)}

/* ---- pills: hairline ring for definition on tinted fills ----------------- */
.pill{box-shadow:inset 0 0 0 1px rgba(11,39,64,.06)}

/* ---- tables: sticky header + zebra for long admin lists ------------------ */
.table-wrap table thead th{position:sticky;top:0;z-index:3;
  background:linear-gradient(var(--surface-2),var(--surface-2))}
.table-wrap tbody tr:nth-child(even) td{background:rgba(14,107,168,.028)}
.table-wrap tbody tr{transition:background .12s}
.table-wrap tbody tr:hover td{background:var(--primary-50)}

/* ---- admin sidebar: active item gets a moving accent rail ---------------- */
.admin-nav button{position:relative;transition:background .16s,color .16s,transform .16s}
.admin-nav button::before{content:"";position:absolute;inset-inline-start:0;top:50%;translate:0 -50%;
  width:3px;height:0;border-radius:3px;background:var(--grad);transition:height .2s var(--ease-spring)}
.admin-nav button.active{background:var(--primary-50);color:var(--primary-600)}
.admin-nav button.active::before{height:60%}
.admin-nav button:not(.active):hover{transform:translateX(2px)}
[dir=rtl] .admin-nav button:not(.active):hover{transform:translateX(-2px)}
.admin-side{box-shadow:var(--lift-2)}

/* ---- modal: a softer spring entrance ------------------------------------- */
.modal{animation:modalSpring .34s var(--ease-spring)}
@keyframes modalSpring{from{opacity:0;transform:translateY(18px) scale(.965)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.modal{animation:none}}
.modal-overlay{background:rgba(7,32,51,.5);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}

/* ---- course card: a soft shine that sweeps the poster on hover ----------- */
.card-thumb::before{content:"";position:absolute;inset:0;z-index:3;pointer-events:none;opacity:0;
  background:linear-gradient(115deg,transparent 30%,rgba(255,255,255,.28) 48%,transparent 62%);
  transform:translateX(-60%);transition:opacity .1s}
.card:hover .card-thumb::before{opacity:1;animation:thumbShine .8s var(--ease-out)}
@keyframes thumbShine{from{transform:translateX(-60%)}to{transform:translateX(60%)}}
@media (prefers-reduced-motion:reduce){.card:hover .card-thumb::before{animation:none;opacity:0}}

/* ---- section headings: the accent bar grows in when revealed ------------- */
.section-head h2::before{transition:transform .5s var(--ease-spring);transform-origin:top}
.reveal .section-head h2::before,.section-head.reveal h2::before{transform:scaleY(0)}
.reveal.in .section-head h2::before,.section-head.reveal.in h2::before{transform:scaleY(1)}

/* ---- hero: slow blueprint drift for a sense of live machinery ------------ */
.hero::before{animation:bpDrift 26s linear infinite}
@keyframes bpDrift{to{background-position:28px 28px}}
@media (prefers-reduced-motion:reduce){.hero::before{animation:none}}

/* ---- empty state: gentle breathing on the illustration ------------------- */
.empty .empty-art{animation:floaty 7s ease-in-out infinite}

/* ---- number count-up keeps digits from reflowing while animating --------- */
.counting{font-variant-numeric:tabular-nums}

/* ── Accessibility fix surfaced during the elevation pass ───────────────────
   @keyframes fade / slideUp define ONLY their `from` state, so a browser in
   prefers-reduced-motion freezes them at that first frame — opacity:0 — leaving
   the hero and other .fade-in / .slide-up content invisible. Disabling the
   animation there shows the content immediately, which is the correct
   reduced-motion behaviour regardless. (Pre-existing; not introduced by v2.) */
@media (prefers-reduced-motion:reduce){
  .fade-in,.slide-up{animation:none !important}
}

/* ── Course imagery: fill the frame AND never crop ─────────────────────────
   Two complaints, one cause. Course posters are often promotional banners with
   text baked into the picture, so `object-fit:cover` cut the headline off; but
   switching everything to `contain` left empty bars, and an image that does not
   fill its frame looks broken.

   Neither fit setting can satisfy both inside a FIXED box. So the big detail
   poster stops being a fixed box: with an image it sizes itself to that image,
   full width, at the image's own height. Nothing is cropped and there are no
   bars, because the frame IS the picture. The 21:9 box remains for the
   title-only fallback, which has no image to disagree with.

   Grid tiles keep `cover`: a card grid needs equal heights, so a tile has a
   fixed box by definition, and a letterboxed thumbnail in a grid reads as a
   defect. Cropping a decorative thumbnail is the expected trade there. */
.detail-poster.has-img{position:relative;overflow:hidden;aspect-ratio:auto;padding:0;display:block}
/* the blurred backdrop only ever shows behind a very tall image (see max-height) */
.detail-poster.has-img::before{content:"";position:absolute;inset:0;z-index:0;
  background:var(--pi) center/cover no-repeat;filter:blur(24px) saturate(1.15);
  transform:scale(1.18);opacity:.55}
/* No max-height on purpose. Capping the height brings the empty bars back for
   exactly the tall images the cap is meant to tame, and the owner has now
   reported BOTH failure modes. Width-only sizing makes the rule absolute: the
   frame IS the picture, at any shape, so it can never crop and never letterbox.
   A banner that is too tall is an editorial choice, visible immediately, and
   fixed by uploading a different picture. */
.detail-poster.has-img img{position:relative;z-index:1;width:100%;height:auto;display:block}
.card-thumb img,.sidebar-thumb img{object-fit:cover}

/* ── Course detail: stop long article content forcing horizontal scroll ─────
   .detail-main is a grid item; grid/flex items default to min-width:auto and so
   refuse to shrink below their content's min-content width. A long unbreakable
   token (a URL, a wide code block) in the course description then forced the
   column wider than the phone and the whole page scrolled sideways. min-width:0
   lets the column shrink; the wrap rules make the content reflow instead. */
.detail-main{min-width:0}
.detail-desc,.article-body{overflow-wrap:anywhere;word-break:break-word}
.article-body pre,.article-body table{max-width:100%;overflow-x:auto;display:block}
.article-body img{height:auto}

/* ── Discount code box at checkout ───────────────────────────────────────────
   The coupon engine lived only on the server; checkout had nowhere to type a
   code, so every code the admin issued was unusable. */
.coupon-box{margin:14px 0 10px}
.coupon-box>label{display:block;font-weight:700;margin-bottom:8px}
.coupon-row{display:flex;gap:8px;align-items:stretch;flex-wrap:wrap}
.coupon-row .form-control{flex:1 1 160px;min-width:0}
.coupon-row .btn{flex:0 0 auto;white-space:nowrap}
.coupon-msg{min-height:20px;margin-top:6px;font-size:.9rem;line-height:1.7}
.coupon-msg.good{color:var(--success,#15803d)}
.coupon-msg.bad{color:var(--error,#b91c1c)}

/* ── Gift purchase ─────────────────────────────────────────────────────────── */
.gift-box{margin:12px 0;padding:12px;border:1px solid var(--border);border-radius:var(--radius-md,12px);background:var(--surface-2)}
.gift-box .toggle{font-weight:700}
.gift-fields{margin-top:10px;display:grid;gap:10px}
.gift-fields .form-group{margin:0}
.gift-note{font-size:.88rem;color:var(--ink-muted);line-height:1.8;margin-top:6px}

/* ── Hero airflow field (WebGL) ──────────────────────────────────────────────
   Sits above the blueprint texture and below the content. Purely decorative:
   pointer-events:none so it can never eat a click, and if the script never
   inserts it (no WebGL, a throw, a lost context) the hero looks exactly as it
   did before — the element simply is not there. */
.hero-flow{position:absolute;inset:0;z-index:1;width:100%;height:100%;
  pointer-events:none;user-select:none;display:block;border-radius:inherit}
@media print{.hero-flow{display:none}}

/* ===== editor v2: tables, formulas, code view, import, SEO panel ===== */
.rte-bar .rte-off{opacity:.35;pointer-events:none}
.rte-bar sub,.rte-bar sup{font-size:.65em}
.rte-tbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:6px 10px;background:var(--primary-50);border-bottom:1px solid var(--border);font-size:.8rem}
.rte-tbar[hidden]{display:none}
.rte-tbar span{font-weight:700;margin-inline-end:4px}
.rte-tbar button{border:1px solid var(--border);background:var(--surface);border-radius:6px;padding:2px 8px;cursor:pointer;font-family:inherit;font-size:.78rem;color:var(--ink)}
.rte-tbar button.danger{color:#b42318;border-color:#f1b5ae}
.rte-code{width:100%;min-height:260px;max-height:60vh;border:0;border-top:1px solid var(--border);padding:12px 14px;font-family:var(--font-mono);font-size:.82rem;line-height:1.7;background:#0f1720;color:#d6e2ea;resize:vertical;outline:none;white-space:pre-wrap;box-sizing:border-box}
.rte-code[hidden]{display:none}
.rte-body table,.article-body table{border-collapse:collapse;width:100%;margin:14px 0;font-size:.92em}
.rte-body th,.rte-body td,.article-body th,.article-body td{border:1px solid var(--border);padding:7px 10px;text-align:start;vertical-align:top}
.rte-body th,.article-body th{background:var(--surface-2);font-weight:800}
.article-body table{display:table!important;overflow:visible}
.article-body tbody tr:nth-child(even) td{background:color-mix(in srgb,var(--surface-2) 55%,transparent)}
.tbl-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;margin:14px 0}
.tbl-wrap>table{margin:0;min-width:520px}
.rte-body .math{display:inline-block;direction:ltr;unicode-bidi:isolate;font-family:var(--font-mono);font-size:.85em;background:#EEF4FF;color:#1d3f8a;border:1px dashed #9db6e8;border-radius:5px;padding:0 6px;cursor:pointer}
.rte-body .math::before{content:"∑ ";opacity:.6}
.rte-body .math.math-block{display:block;text-align:center;margin:10px 0;padding:6px}
.article-body .math{direction:ltr;unicode-bidi:isolate}
.article-body .math.math-block{display:block;text-align:center;margin:16px 0;overflow-x:auto;overflow-y:hidden}
.article-body sub,.article-body sup,.rte-body sub,.rte-body sup{font-size:.72em;line-height:0}
.mx-prev{min-height:52px;padding:12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface-2);margin-bottom:10px;overflow-x:auto;text-align:center}
.mx-prev.err{color:#b42318;font-size:.8rem;text-align:start;font-family:var(--font-mono)}
.rte-progress{position:fixed;inset-inline-start:50%;bottom:24px;transform:translateX(50%);z-index:3000;background:var(--ink);color:var(--surface);padding:10px 18px;border-radius:999px;font-size:.9rem;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.seo-box{border:1px solid var(--border);border-radius:var(--radius);padding:4px 14px 12px;margin-top:6px;background:var(--surface)}
.seo-box>summary{cursor:pointer;font-weight:800;padding:8px 0}
.seo-box .cnt{font-size:.72rem;color:var(--faint);font-weight:400;margin-inline-start:6px}
.seo-box .cnt.over{color:#b42318;font-weight:700}
.seo-snippet{border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 14px;margin:6px 0 14px;background:var(--surface-2);font-family:Arial,Vazirmatn,sans-serif}
.seo-snippet .s-url{font-size:.78rem;color:#188038}
.seo-snippet .s-title{font-size:1.05rem;color:#1a0dab;margin:2px 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.seo-snippet .s-desc{font-size:.84rem;color:#4d5156;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.kw-check{display:flex;flex-wrap:wrap;gap:6px;margin:-4px 0 12px;font-size:.78rem}
.kw-check span{padding:1px 8px;border-radius:999px}
.kw-check .ok{background:#DEF3E9;color:#166534}.kw-check .no{background:#FDECEA;color:#b42318}
.hint.ok{color:#166534}.hint.err{color:#b42318}
.draft-banner{margin:12px 0;padding:10px 14px;border-radius:var(--radius-sm);background:#FFF4D6;border:1px solid #f0c36d;color:#7a4b00;font-weight:700;font-size:.9rem}
.ai-seo{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:4px 0 10px}
.ai-seo .hint{font-size:.76rem;flex:1;min-width:200px}
.toc{border:1px solid var(--border);border-inline-start:4px solid var(--primary-500);border-radius:var(--radius-sm);background:var(--surface-2);padding:6px 16px;margin:8px 0 22px}
.toc>summary{cursor:pointer;font-weight:800;padding:6px 0}
.toc ol{margin:4px 0 8px;padding-inline-start:22px;columns:2;column-gap:28px}
.toc li{margin:3px 0;break-inside:avoid;font-size:.92rem}
.toc li.sub{margin-inline-start:16px;list-style:circle;font-size:.86rem}
.toc a{color:var(--ink);text-decoration:none}.toc a:hover{color:var(--primary-600);text-decoration:underline}
@media (max-width:700px){.toc ol{columns:1}}
.article-body h2,.article-body h3{scroll-margin-top:84px}
.post-related{max-width:1100px;margin:36px auto 10px;padding:0 16px}
.preview-frame{background:var(--bg,var(--surface));border-radius:var(--radius);padding:8px}
.post-related .card p{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
