/* ============================================================
   AI English School — Custom design system
   Pastel, organic, high-end. Sits on top of Tailwind (CDN).
   ============================================================ */

:root {
  --cream: #FBF7F1;
  --warm-white: #FFFCF6;
  --ink: #3A3550;
  --ink-soft: #6E6786;
  --accent: #9D7BC4;
  --radius-organic: 42% 58% 56% 44% / 55% 42% 58% 45%;
  --shadow-soft: 0 24px 60px -28px rgba(58, 53, 80, 0.28);
  --shadow-card: 0 18px 44px -24px rgba(58, 53, 80, 0.22);
}

* { -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  overflow-x: hidden;
}

/* gentle layered backdrop wash */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% 8%, rgba(229, 218, 240, 0.55), transparent 60%),
    radial-gradient(50% 45% at 92% 14%, rgba(214, 235, 220, 0.5), transparent 60%),
    radial-gradient(55% 50% at 78% 96%, rgba(242, 220, 220, 0.45), transparent 60%);
}

.font-display { font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; }

/* lock scroll when overlay open */
body.aes-locked { overflow: hidden; }

/* ---------- Eyebrow label ---------- */
.aes-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent);
}
.aes-eyebrow::before {
  content: ""; width: 26px; height: 1.5px; background: currentColor; border-radius: 2px; opacity: .7;
}

/* ============================================================
   HEADER
   ============================================================ */
#site-header { transition: background .4s ease, box-shadow .4s ease, padding .4s ease; }
#site-header.is-scrolled {
  background: rgba(255, 252, 246, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px -22px rgba(58, 53, 80, 0.35);
}
.nav-link { position: relative; color: var(--ink); opacity: .8; transition: opacity .25s; }
.nav-link:hover { opacity: 1; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--accent); border-radius: 2px; transition: width .3s ease;
}
.nav-link:hover::after, .nav-link.is-active::after { width: 100%; }
.nav-link.is-active { opacity: 1; color: var(--accent); }

/* logo mark */
.aes-logo-mark {
  width: 38px; height: 38px; border-radius: 14px 26px 18px 30px;
  background: linear-gradient(135deg, #E5DAF0, #D6EBDC);
  display: grid; place-items: center; color: var(--ink); font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}

/* cart badge */
.aes-cart-btn { position: relative; }
.aes-cart-count {
  position: absolute; top: -6px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
  transform: scale(1); transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.aes-cart-count.is-empty { transform: scale(0); }

/* mobile menu */
#mobile-menu {
  position: fixed; inset: 0 0 0 auto; width: min(86vw, 380px); z-index: 70;
  background: var(--warm-white); padding: 7rem 2rem 2rem;
  transform: translateX(105%); transition: transform .45s cubic-bezier(.16,1,.3,1);
  box-shadow: var(--shadow-soft);
}
#mobile-menu.is-open { transform: translateX(0); }
#mobile-menu a { display: block; padding: .9rem 0; font-family: 'Fraunces', serif; font-size: 1.6rem; color: var(--ink); border-bottom: 1px solid rgba(58,53,80,.08); }

/* ============================================================
   HERO
   ============================================================ */
.aes-hero-title { line-height: 0.98; letter-spacing: -0.02em; }
.aes-hero-title em { font-style: italic; color: var(--accent); }

/* morphing organic blob */
.aes-blob {
  position: relative; border-radius: var(--radius-organic);
  background: linear-gradient(135deg, #EFE6F7 0%, #D6EBDC 60%, #F2DCDC 100%);
  animation: morph 14s ease-in-out infinite;
  box-shadow: var(--shadow-soft);
}
.aes-blob::after {
  content: ""; position: absolute; inset: 8%; border-radius: var(--radius-organic);
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.6), transparent 55%);
  animation: morph 18s ease-in-out infinite reverse;
}
@keyframes morph {
  0%, 100% { border-radius: 42% 58% 56% 44% / 55% 42% 58% 45%; }
  33% { border-radius: 58% 42% 44% 56% / 42% 55% 45% 58%; }
  66% { border-radius: 48% 52% 60% 40% / 58% 48% 52% 42%; }
}

/* floating glass cards inside hero */
.aes-float-card {
  background: rgba(255, 252, 246, 0.72); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.6); border-radius: 22px;
  box-shadow: var(--shadow-card);
  animation: floaty 6s ease-in-out infinite;
}
.aes-float-card.delay { animation-delay: -3s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--tilt, 0deg)); }
  50% { transform: translateY(-12px) rotate(var(--tilt, 0deg)); }
}

/* rotating ring badge */
.aes-badge-ring { position: relative; width: 132px; height: 132px; }
.aes-badge-ring svg { width: 100%; height: 100%; animation: spin 22s linear infinite; }
.aes-badge-ring .aes-badge-core {
  position: absolute; inset: 0; display: grid; place-items: center;
  width: 64px; height: 64px; margin: auto; border-radius: 50%;
  background: var(--ink); color: var(--warm-white);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* buttons */
.aes-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; border-radius: 999px; padding: .85rem 1.6rem; cursor: pointer;
  transition: transform .2s ease, box-shadow .3s ease, background .3s ease, color .3s;
  border: 1px solid transparent; white-space: nowrap;
}
.aes-btn-primary { background: var(--ink); color: var(--warm-white); box-shadow: 0 14px 30px -16px rgba(58,53,80,.6); }
.aes-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -16px rgba(58,53,80,.7); }
.aes-btn-ghost { background: transparent; color: var(--ink); border-color: rgba(58,53,80,.18); }
.aes-btn-ghost:hover { background: rgba(58,53,80,.05); }
.aes-btn-accent { background: var(--accent); color: #fff; }
.aes-btn-accent:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -14px rgba(157,123,196,.7); }

/* ============================================================
   BENTO (features)
   ============================================================ */
.aes-bento {
  border-radius: 30px; padding: 2rem; position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,.5);
  transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s;
}
.aes-bento:hover { transform: translateY(-6px); box-shadow: var(--shadow-card); }
.aes-bento-glyph {
  width: 58px; height: 58px; border-radius: 18px 26px 20px 28px;
  background: rgba(255,255,255,.6); display: grid; place-items: center; color: var(--ink);
}
.aes-bento-glyph svg { width: 30px; height: 30px; }

/* ============================================================
   ZIGZAG (curriculum)
   ============================================================ */
.aes-zig {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
  margin-bottom: 6rem;
}
.aes-zig-flip .aes-zig-art { order: 2; }
.aes-zig-art {
  position: relative; aspect-ratio: 5/4; border-radius: 38% 62% 54% 46% / 52% 44% 56% 48%;
  display: grid; place-items: center; overflow: hidden;
  animation: morph 16s ease-in-out infinite;
  box-shadow: var(--shadow-card);
}
.aes-zig-stage {
  font-family: 'Fraunces', serif; font-size: clamp(4rem, 10vw, 8rem); color: rgba(58,53,80,.18); font-weight: 500;
}
.aes-zig-blob {
  position: absolute; width: 60%; height: 60%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.55), transparent 70%);
  filter: blur(8px);
}
@media (max-width: 768px) {
  .aes-zig { grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 4rem; }
  .aes-zig-flip .aes-zig-art { order: 0; }
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.aes-quote {
  border-radius: 26px; padding: 2rem; position: relative;
  border: 1px solid rgba(255,255,255,.5);
  transform: rotate(var(--rot, 0deg));
  transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s;
}
.aes-quote:hover { transform: rotate(0deg) translateY(-5px); box-shadow: var(--shadow-card); }
.aes-quote-mark {
  font-family: 'Fraunces', serif; font-size: 4.5rem; line-height: .6; color: var(--accent); opacity: .45;
}
.aes-quote-by { display: flex; align-items: center; gap: .85rem; margin-top: 1.5rem; }
.aes-avatar {
  width: 44px; height: 44px; border-radius: 16px 22px 18px 24px;
  background: rgba(255,255,255,.7); color: var(--ink); font-weight: 700;
  display: grid; place-items: center; font-size: .85rem;
}

/* ============================================================
   COURSE CATALOG
   ============================================================ */
.aes-course {
  background: var(--warm-white); border-radius: 28px; overflow: hidden;
  border: 1px solid rgba(58,53,80,.06);
  transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s;
}
.aes-course:hover { transform: translateY(-8px); box-shadow: var(--shadow-soft); }
.aes-course-art {
  position: relative; height: 180px; display: grid; place-items: center; overflow: hidden;
}
.aes-course-blob {
  position: absolute; width: 70%; height: 130%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.5), transparent 70%);
  filter: blur(6px); animation: floaty 7s ease-in-out infinite;
}
.aes-course-level {
  position: absolute; top: 1rem; left: 1rem; z-index: 2;
  background: rgba(255,252,246,.85); backdrop-filter: blur(6px);
  color: var(--ink); font-size: .72rem; font-weight: 600; letter-spacing: .04em;
  padding: .35rem .8rem; border-radius: 999px;
}
.aes-course-price {
  position: relative; z-index: 2;
  font-family: 'Fraunces', serif; font-size: 2.6rem; color: var(--ink); font-weight: 500;
}
.aes-course-price::before { content: "$"; font-size: 1.3rem; vertical-align: top; opacity: .6; margin-right: 2px; }
.aes-course-body { padding: 1.6rem; }
.aes-course-meta { display: flex; gap: 1.2rem; margin-top: 1rem; color: var(--ink-soft); font-size: .85rem; }
.aes-course-meta li { display: flex; align-items: center; gap: .4rem; }
.aes-course-highlights { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.aes-chip {
  font-size: .72rem; padding: .3rem .7rem; border-radius: 999px;
  background: rgba(157,123,196,.1); color: var(--accent); font-weight: 500;
}
.aes-course-foot {
  display: flex; align-items: center; justify-content: space-between; margin-top: 1.5rem;
  padding-top: 1.3rem; border-top: 1px solid rgba(58,53,80,.08);
}
.aes-price-wrap { display: flex; flex-direction: column; gap: 2px; }
.aes-old-price { font-size: .78rem; color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(224,112,126,.6); }
.aes-course-total { font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.aes-discount-badge {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
  background: #e0707e; color: #fff; font-size: .72rem; font-weight: 700;
  padding: .3rem .6rem; border-radius: 999px;
  animation: aes-pulse-badge 2s ease-in-out infinite;
}
@keyframes aes-pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Discount banner (hero) */
.aes-discount-banner {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .5rem 1rem; border-radius: 999px;
  background: linear-gradient(135deg, rgba(224,112,126,.12), rgba(157,123,196,.1));
  border: 1px solid rgba(224,112,126,.2);
}
.aes-discount-banner-tag {
  background: #e0707e; color: #fff; font-size: .72rem; font-weight: 700;
  padding: .2rem .55rem; border-radius: 999px; letter-spacing: .03em;
}
.aes-buy {
  background: var(--ink); color: var(--warm-white); font-weight: 600;
  padding: .6rem 1.2rem; border-radius: 999px; cursor: pointer;
  transition: transform .2s, background .3s, box-shadow .3s;
}
.aes-buy:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(58,53,80,.6); }
.aes-buy.is-pulsing { animation: pulse-buy .7s ease; }
.aes-buy.aes-buy-open { background: var(--emerald); text-decoration: none; display: inline-block; }
.aes-buy.aes-buy-open:hover { background: #6aa77e; }
@keyframes pulse-buy {
  0% { transform: scale(1); } 40% { transform: scale(1.12); background: var(--accent); } 100% { transform: scale(1); }
}

/* filter tabs */
.aes-filter {
  padding: .55rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .9rem;
  color: var(--ink-soft); background: var(--warm-white); border: 1px solid rgba(58,53,80,.1);
  cursor: pointer; transition: all .25s;
}
.aes-filter:hover { color: var(--ink); border-color: rgba(58,53,80,.2); }
.aes-filter.is-active { background: var(--ink); color: var(--warm-white); border-color: var(--ink); }

/* ============================================================
   CART PANEL
   ============================================================ */
.aes-overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(58,53,80,.34);
  backdrop-filter: blur(3px); opacity: 0; visibility: hidden;
  transition: opacity .4s ease, visibility .4s;
}
.aes-overlay.is-open { opacity: 1; visibility: visible; }
.aes-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(94vw, 440px); background: var(--warm-white);
  display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .5s cubic-bezier(.16,1,.3,1);
  box-shadow: var(--shadow-soft);
}
.aes-panel.is-open { transform: translateX(0); }
.aes-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 1.6rem 1.6rem 1.1rem; border-bottom: 1px solid rgba(58,53,80,.08);
}
.aes-icon-btn {
  width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center;
  color: var(--ink); background: rgba(58,53,80,.05); transition: background .25s; cursor: pointer;
}
.aes-icon-btn:hover { background: rgba(58,53,80,.12); }
.aes-panel-body { flex: 1; overflow-y: auto; padding: 1.2rem 1.6rem; }

/* cart lines */
.aes-line { display: grid; grid-template-columns: 60px 1fr auto; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid rgba(58,53,80,.07); }
.aes-thumb { width: 60px; height: 60px; border-radius: 16px 22px 18px 24px; display: block; box-shadow: var(--shadow-card); }
.aes-line-main h3 { font-size: .95rem; }
.aes-qty { display: inline-flex; align-items: center; gap: .5rem; margin-top: .5rem; border: 1px solid rgba(58,53,80,.12); border-radius: 999px; padding: .15rem; }
.aes-qty-btn { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; color: var(--ink); background: transparent; cursor: pointer; transition: background .2s; }
.aes-qty-btn:hover { background: rgba(58,53,80,.08); }
.aes-qty-val { min-width: 20px; text-align: center; font-weight: 600; font-size: .9rem; }
.aes-line-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.aes-remove { font-size: .72rem; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.aes-remove:hover { color: var(--accent); }
.aes-line-price { font-family: 'Fraunces', serif; font-size: 1.15rem; }

/* empty state */
.aes-empty { text-align: center; padding: 3rem 1rem; display: flex; flex-direction: column; align-items: center; }
.aes-empty-blob { width: 90px; height: 90px; border-radius: var(--radius-organic); background: linear-gradient(135deg, #EFE6F7, #D6EBDC); animation: morph 12s ease-in-out infinite; }

/* panel footer */
.aes-panel-foot { padding: 1.3rem 1.6rem; border-top: 1px solid rgba(58,53,80,.08); background: rgba(251,247,241,.6); }
.aes-total-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .8rem; }
.aes-foot-actions { display: flex; gap: .6rem; align-items: center; }

/* checkout form */
.aes-form { display: flex; flex-direction: column; gap: 1rem; }
.aes-field { display: flex; flex-direction: column; gap: .35rem; }
.aes-field span { font-size: .8rem; font-weight: 600; color: var(--ink); }
.aes-field input {
  padding: .8rem .9rem; border-radius: 14px; border: 1px solid rgba(58,53,80,.14);
  background: var(--cream); color: var(--ink); font-size: .95rem; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.aes-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(157,123,196,.15); }
.aes-error { color: #c0566a; font-size: .82rem; background: rgba(242,220,220,.5); padding: .6rem .8rem; border-radius: 12px; transition: opacity .25s; }
.aes-order-summary { margin-top: .5rem; padding-top: 1rem; border-top: 1px dashed rgba(58,53,80,.15); display: flex; flex-direction: column; gap: .4rem; }
.aes-summary-row { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-soft); }

/* success state */
.aes-success { text-align: center; padding: 2rem 1rem; display: flex; flex-direction: column; align-items: center; }
.aes-success-blob { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #D6EBDC, #EFE6F7); display: grid; place-items: center; color: var(--ink); box-shadow: var(--shadow-card); animation: floaty 4s ease-in-out infinite; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.16,1,.3,1); transition-delay: var(--d, 0s); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .aes-blob, .aes-zig-art, .aes-badge-ring svg, .aes-float-card, .aes-course-blob, .aes-success-blob { animation: none !important; }
}

/* ============================================================
   MISC
   ============================================================ */
.aes-divider-wave { display: block; width: 100%; height: 40px; color: rgba(157,123,196,.25); }

/* footer */
.aes-footer-credit { letter-spacing: .02em; }

/* offer page */
.aes-offer-text h2 {
  font-family: var(--font-display), Georgia, serif;
  font-size: 1.5rem; font-weight: 600; color: var(--ink);
  margin-top: 2.5rem; margin-bottom: 1rem;
}
.aes-offer-text p {
  color: var(--ink-soft); line-height: 1.75; font-size: .95rem; margin-bottom: .75rem;
}
.aes-offer-text a { color: var(--accent); text-decoration: underline; }

/* ============================================================
   AUTH MODAL
   ============================================================ */
.aes-auth-modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(0.95);
  width: min(92vw, 420px); z-index: 110;
  background: var(--warm-white); border-radius: 36px;
  padding: 2.5rem 2.2rem 2.2rem; text-align: center;
  opacity: 0; visibility: hidden;
  transition: opacity .35s ease, transform .45s cubic-bezier(.16,1,.3,1), visibility .35s;
  box-shadow: 0 30px 80px -30px rgba(58, 53, 80, 0.4);
  max-height: 90vh; overflow-y: auto;
}
.aes-auth-modal.is-open {
  opacity: 1; visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.aes-auth-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink);
  background: transparent; cursor: pointer; transition: background .2s; border: none;
}
.aes-auth-close:hover { background: rgba(58,53,80,.08); }

.aes-auth-step { animation: aes-step-in .4s cubic-bezier(.16,1,.3,1); }
@keyframes aes-step-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.aes-auth-icon {
  width: 64px; height: 64px; margin: 0 auto;
  border-radius: 22px 30px 24px 32px;
  display: grid; place-items: center; color: var(--ink);
}
.aes-auth-icon-mail  { background: linear-gradient(135deg, #E5DAF0, #F0E6F7); }
.aes-auth-icon-key   { background: linear-gradient(135deg, #D6EBDC, #E8F3EC); }
.aes-auth-icon-warn  { background: linear-gradient(135deg, #F2DCDC, #F7E8E8); }

.aes-auth-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.aes-auth-input {
  padding: .9rem 1rem; border-radius: 16px;
  border: 1px solid rgba(58,53,80,.14);
  background: var(--cream); color: var(--ink);
  font-size: 1rem; font-family: inherit; text-align: center;
  transition: border-color .2s, box-shadow .2s; width: 100%; box-sizing: border-box;
}
.aes-auth-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(157,123,196,.15);
}
.aes-auth-code {
  font-family: 'Fraunces', serif; font-size: 1.8rem;
  letter-spacing: 0.55em; text-indent: 0.3em;
  max-width: 220px; margin: 0 auto;
}

.aes-auth-links {
  display: flex; justify-content: center; gap: 1.5rem; margin-top: 1.2rem;
}
.aes-auth-links button {
  font-size: .82rem; color: var(--ink-soft); background: none;
  border: none; cursor: pointer; text-decoration: underline;
  text-decoration-color: rgba(58,53,80,.2); transition: color .2s;
}
.aes-auth-links button:hover { color: var(--accent); }
.aes-auth-links button:disabled { opacity: .5; cursor: not-allowed; }

.aes-auth-error {
  margin-top: 1rem; color: #c0566a; font-size: .82rem;
  background: rgba(242,220,220,.4); padding: .6rem .9rem; border-radius: 12px;
}

.aes-auth-success-step { padding: 1.5rem 0; }

/* spinner */
.aes-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: -2px; margin-right: 6px;
}

/* inline code */
.aes-code {
  background: rgba(58,53,80,.08); padding: .15rem .4rem;
  border-radius: 6px; font-size: .85em;
  font-family: 'Courier New', monospace; color: var(--ink);
}

/* ============================================================
   USER CHIP (logged-in header state)
   ============================================================ */
.aes-user-chip {
  display: flex; align-items: center; gap: .55rem;
  padding: .35rem .4rem .35rem .35rem; border-radius: 999px;
  background: rgba(214,235,220,.4); border: 1px solid rgba(58,53,80,.06);
}
.aes-user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #E5DAF0, #D6EBDC);
  display: grid; place-items: center;
  font-size: .72rem; font-weight: 700; color: var(--ink);
}
.aes-user-email {
  font-size: .82rem; color: var(--ink); max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.aes-btn-sm { padding: .5rem 1rem; font-size: .82rem; }

/* ============================================================
   AI ASSISTANT CHAT
   ============================================================ */
.aes-chat-container {
  background: var(--warm-white); border-radius: 32px;
  border: 1px solid rgba(58,53,80,.08); overflow: hidden;
  box-shadow: var(--shadow-card); display: flex; flex-direction: column;
  height: 600px; max-height: 75vh;
}
.aes-chat-header {
  display: flex; align-items: center; gap: .8rem;
  padding: 1.2rem 1.4rem; background: linear-gradient(135deg, #EFE6F7, #D6EBDC);
  border-bottom: 1px solid rgba(58,53,80,.06);
}
.aes-chat-avatar {
  width: 42px; height: 42px; border-radius: 14px 22px 18px 26px;
  background: var(--ink); color: var(--warm-white);
  display: grid; place-items: center; font-family: 'Fraunces', serif; font-weight: 600;
}
.aes-chat-status { display: flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--ink); }
.aes-chat-status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--emerald);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.aes-scenario-picker {
  display: flex; flex-wrap: wrap; gap: .4rem; padding: .8rem 1.4rem;
  border-bottom: 1px solid rgba(58,53,80,.06); background: rgba(251,247,241,.4);
}
.aes-scenario-btn {
  font-size: .76rem; font-weight: 600; padding: .35rem .75rem;
  border-radius: 999px; border: 1px solid rgba(58,53,80,.1);
  background: var(--warm-white); color: var(--ink-soft);
  cursor: pointer; transition: all .2s;
}
.aes-scenario-btn:hover { border-color: rgba(58,53,80,.2); color: var(--ink); }
.aes-scenario-btn.is-active { background: var(--ink); color: var(--warm-white); border-color: var(--ink); }

.aes-chat-body {
  flex: 1; overflow-y: auto; padding: 1.2rem 1.4rem;
  display: flex; flex-direction: column; gap: .7rem; scroll-behavior: smooth;
}
.aes-chat-bubble {
  max-width: 80%; padding: .7rem 1rem; border-radius: 20px 20px 20px 6px;
  font-size: .9rem; line-height: 1.5; word-wrap: break-word;
  animation: chat-in .35s cubic-bezier(.16,1,.3,1);
}
@keyframes chat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.aes-chat-bot {
  background: rgba(229,218,240,.4); color: var(--ink);
  align-self: flex-start; border-radius: 20px 20px 20px 6px;
}
.aes-chat-user {
  background: var(--ink); color: var(--warm-white);
  align-self: flex-end; border-radius: 20px 20px 6px 20px;
}
.aes-chat-typing { display: flex; gap: 4px; align-items: center; }
.aes-chat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.aes-chat-typing span:nth-child(2) { animation-delay: .15s; }
.aes-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.aes-chat-input-row {
  display: flex; gap: .6rem; padding: 1rem 1.4rem;
  border-top: 1px solid rgba(58,53,80,.06); background: var(--warm-white);
}
.aes-chat-input {
  flex: 1; padding: .8rem 1rem; border-radius: 16px;
  border: 1px solid rgba(58,53,80,.14); background: var(--cream);
  color: var(--ink); font-size: .9rem; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.aes-chat-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(157,123,196,.15); }
.aes-chat-send {
  width: 46px; height: 46px; border-radius: 16px; border: none;
  background: var(--ink); color: var(--warm-white); cursor: pointer;
  display: grid; place-items: center; transition: transform .2s, background .3s;
}
.aes-chat-send:hover { transform: scale(1.05); background: var(--accent); }

/* ---------- Auth gate ---------- */
.aes-auth-gate {
  text-align: center; padding: 4rem 2rem; max-width: 480px; margin: 0 auto;
}
.aes-auth-gate-icon {
  width: 80px; height: 80px; margin: 0 auto; border-radius: 26px 34px 28px 32px;
  background: linear-gradient(135deg, #E5DAF0, #D6EBDC);
  display: grid; place-items: center; color: var(--ink);
  animation: floaty 5s ease-in-out infinite;
}

/* ============================================================
   LEVEL TEST
   ============================================================ */
.aes-test-intro { text-align: center; padding: 2rem 1rem; }
.aes-test-intro-icon {
  width: 72px; height: 72px; margin: 0 auto;
  border-radius: 22px 30px 24px 32px; background: linear-gradient(135deg, #E5DAF0, #D6EBDC);
  display: grid; place-items: center; color: var(--ink);
}
.aes-test-meta-row { display: flex; justify-content: center; gap: .5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.aes-test-meta-chip {
  font-size: .76rem; font-weight: 600; padding: .35rem .8rem;
  border-radius: 999px; background: rgba(157,123,196,.12); color: var(--accent);
}

.aes-test-question { max-width: 680px; margin: 0 auto; }
.aes-test-progress { width: 100%; height: 6px; background: rgba(58,53,80,.08); border-radius: 999px; overflow: hidden; margin-bottom: 1.5rem; }
.aes-test-progress-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s cubic-bezier(.16,1,.3,1); }
.aes-test-qhead { display: flex; align-items: center; justify-content: space-between; }
.aes-test-qnum { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.aes-test-level-tag {
  font-size: .72rem; font-weight: 700; padding: .25rem .65rem;
  border-radius: 999px; background: rgba(157,123,196,.15); color: var(--accent);
}

.aes-test-options { display: flex; flex-direction: column; gap: .65rem; margin-top: 1.5rem; }
.aes-test-option {
  display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem;
  border-radius: 18px; border: 1px solid rgba(58,53,80,.1);
  background: var(--warm-white); cursor: pointer; text-align: left;
  transition: all .25s cubic-bezier(.16,1,.3,1); font-size: .95rem; color: var(--ink);
}
.aes-test-option:hover { border-color: var(--accent); background: rgba(157,123,196,.06); transform: translateX(4px); }
.aes-test-option-letter {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: rgba(58,53,80,.06); color: var(--ink); font-weight: 700;
  display: grid; place-items: center; font-size: .85rem;
}
.aes-test-option:hover .aes-test-option-letter { background: var(--accent); color: #fff; }

/* ---------- Result ---------- */
.aes-test-result { text-align: center; max-width: 640px; margin: 0 auto; padding: 2rem 1rem; }
.aes-test-result-badge {
  width: 110px; height: 110px; margin: 0 auto; border-radius: 42% 58% 56% 44% / 55% 42% 58% 45%;
  display: grid; place-items: center; animation: morph 12s ease-in-out infinite;
}
.aes-test-result-level { font-family: 'Fraunces', serif; font-size: 2.4rem; color: var(--ink); font-weight: 600; }

.aes-test-score { margin: 2rem 0; }
.aes-test-score-ring { position: relative; width: 130px; height: 130px; margin: 0 auto; }
.aes-test-score-ring svg { width: 100%; height: 100%; }
.aes-test-score-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: 'Fraunces', serif; font-size: 1.8rem; color: var(--ink); font-weight: 600;
}

.aes-test-breakdown { display: flex; flex-direction: column; gap: .6rem; margin: 2rem 0; max-width: 400px; margin-left: auto; margin-right: auto; }
.aes-test-bd-row { display: flex; align-items: center; gap: .8rem; }
.aes-test-bd-level { font-weight: 700; color: var(--ink); width: 30px; font-size: .85rem; }
.aes-test-bd-bar { flex: 1; height: 8px; background: rgba(58,53,80,.08); border-radius: 999px; overflow: hidden; }
.aes-test-bd-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .8s cubic-bezier(.16,1,.3,1); }
.aes-test-bd-count { font-size: .78rem; color: var(--ink-soft); width: 40px; text-align: right; }

.aes-test-actions { display: flex; gap: .8rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }

/* ---------- Lesson cards ---------- */
.aes-lesson-card {
  background: var(--warm-white); border-radius: 24px; padding: 1.8rem;
  border: 1px solid rgba(58,53,80,.06); transition: transform .3s, box-shadow .3s;
}
.aes-lesson-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.aes-lesson-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 12px 18px 14px 20px;
  background: linear-gradient(135deg, #E5DAF0, #D6EBDC); color: var(--ink);
  font-family: 'Fraunces', serif; font-weight: 600; font-size: .9rem;
}
.aes-vocab-item {
  display: flex; gap: .8rem; padding: .7rem 1rem; border-radius: 14px;
  background: rgba(214,235,220,.25); margin-top: .5rem;
}
.aes-vocab-word { font-weight: 600; color: var(--ink); min-width: 140px; }
.aes-vocab-trans { color: var(--ink-soft); font-size: .9rem; }

/* ============================================================
   COURSE VIEWER (sidebar + lesson detail)
   ============================================================ */
.aes-cw-layout {
  display: grid; grid-template-columns: 300px 1fr; gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .aes-cw-layout { grid-template-columns: 1fr; }
}

/* ---------- Sidebar ---------- */
.aes-cw-sidebar {
  position: sticky; top: 90px; max-height: calc(100vh - 110px);
  overflow-y: auto; padding-right: .5rem;
}
@media (max-width: 900px) {
  .aes-cw-sidebar { position: static; max-height: none; }
}
.aes-cw-sidebar-head {
  margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(58,53,80,.08);
}
.aes-cw-progress-wrap { margin-top: .6rem; }
.aes-cw-progress-track {
  width: 100%; height: 8px; background: rgba(58,53,80,.08);
  border-radius: 999px; overflow: hidden;
}
.aes-cw-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--emerald));
  border-radius: 999px; transition: width .6s cubic-bezier(.16,1,.3,1);
}

/* ---------- Units ---------- */
.aes-cw-unit { margin-bottom: 1.5rem; }
.aes-cw-unit-head { display: flex; align-items: center; justify-content: space-between; }
.aes-cw-unit-title {
  font-family: 'Fraunces', serif; font-size: .95rem; font-weight: 600; color: var(--ink);
}
.aes-cw-unit-badge {
  font-size: .68rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px;
  background: rgba(58,53,80,.06); color: var(--ink-soft);
}
.aes-cw-unit.is-done .aes-cw-unit-badge { background: rgba(123,179,142,.2); color: var(--emerald); }
.aes-cw-unit-desc { font-size: .75rem; color: var(--ink-soft); margin: .3rem 0 .6rem; line-height: 1.4; }

/* ---------- Lesson items ---------- */
.aes-cw-lessons { display: flex; flex-direction: column; gap: .2rem; }
.aes-cw-lesson {
  display: flex; align-items: flex-start; gap: .6rem; width: 100%; text-align: left;
  padding: .55rem .6rem; border-radius: 12px; border: 1px solid transparent;
  background: transparent; cursor: pointer; transition: all .2s;
}
.aes-cw-lesson:hover { background: rgba(58,53,80,.04); }
.aes-cw-lesson.is-active { background: rgba(157,123,196,.1); border-color: rgba(157,123,196,.2); }
.aes-cw-check {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid rgba(58,53,80,.2);
  display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; color: #fff;
  transition: all .25s;
}
.aes-cw-check.is-checked { background: var(--emerald); border-color: var(--emerald); }
.aes-cw-lesson-info { display: flex; flex-direction: column; gap: 1px; }
.aes-cw-lesson-num { font-size: .68rem; color: var(--ink-soft); font-weight: 600; }
.aes-cw-lesson-title { font-size: .85rem; color: var(--ink); line-height: 1.3; }
.aes-cw-lesson.is-done .aes-cw-lesson-title { color: var(--ink-soft); }
.aes-cw-lesson.is-active .aes-cw-lesson-title { color: var(--accent); font-weight: 600; }

/* ---------- Lesson detail ---------- */
.aes-cw-main { min-height: 400px; }
.aes-cw-breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--ink-soft); }
.aes-cw-sep { opacity: .4; }
.aes-cw-objective {
  font-size: 1.05rem; color: var(--ink-soft); margin-top: .5rem;
  padding: .8rem 1rem; border-radius: 14px; background: rgba(229,218,240,.25);
  border-left: 3px solid var(--accent);
}

.aes-cw-content { margin-top: 1.5rem; }
.aes-cw-text { font-size: 1rem; line-height: 1.7; color: var(--ink); opacity: .85; margin: 1rem 0; }
.aes-cw-block-title {
  font-family: 'Fraunces', serif; font-size: 1.15rem; color: var(--ink);
  margin: 1.5rem 0 .6rem; font-weight: 500;
}

/* ---------- Grammar box ---------- */
.aes-cw-grammar {
  margin: 1.2rem 0; border-radius: 18px; overflow: hidden;
  background: rgba(214,235,220,.2); border: 1px solid rgba(123,179,142,.15);
}
.aes-cw-grammar-head {
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem 1rem; background: rgba(214,235,220,.3);
  font-weight: 600; font-size: .85rem; color: var(--ink);
}
.aes-cw-grammar-rule {
  margin: 0; padding: 1rem; font-family: 'Courier New', monospace;
  font-size: .85rem; line-height: 1.7; color: var(--ink); white-space: pre-wrap;
}

/* ---------- Vocab ---------- */
.aes-cw-vocab { margin: 1rem 0; }

/* ---------- Dialogue ---------- */
.aes-cw-dialogue { margin: 1.2rem 0; }
.aes-cw-dialogue-box {
  border-radius: 18px; padding: 1.2rem; display: flex; flex-direction: column; gap: .7rem;
  background: rgba(251,247,241,.6); border: 1px solid rgba(58,53,80,.06);
}
.aes-cw-line { display: flex; flex-direction: column; gap: .2rem; max-width: 80%; }
.aes-cw-line-0 { align-self: flex-start; }
.aes-cw-line-1 { align-self: flex-end; align-items: flex-end; }
.aes-cw-speaker { font-size: .72rem; font-weight: 600; color: var(--accent); }
.aes-cw-line-1 .aes-cw-speaker { color: var(--emerald); }
.aes-cw-line-text {
  padding: .6rem .9rem; border-radius: 16px 16px 16px 4px; font-size: .9rem; line-height: 1.5;
}
.aes-cw-line-0 .aes-cw-line-text { background: rgba(229,218,240,.4); color: var(--ink); }
.aes-cw-line-1 .aes-cw-line-text { background: rgba(214,235,220,.4); color: var(--ink); border-radius: 16px 16px 4px 16px; }

/* ---------- Tip ---------- */
.aes-cw-tip {
  display: flex; gap: .7rem; margin: 1.2rem 0; padding: 1rem 1.1rem;
  border-radius: 16px; background: rgba(242,220,220,.25); border: 1px solid rgba(242,220,220,.3);
}
.aes-cw-tip svg { flex-shrink: 0; color: var(--accent); margin-top: 2px; }
.aes-cw-tip p { font-size: .9rem; line-height: 1.5; color: var(--ink); opacity: .85; margin: 0; }

/* ---------- Lesson footer ---------- */
.aes-cw-lesson-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(58,53,80,.08);
  flex-wrap: wrap;
}
.aes-cw-lesson-foot .aes-btn { min-width: auto; }
.aes-cw-lesson-foot .aes-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- Practice box ---------- */
.aes-cw-practice {
  margin-top: 2rem; padding: 1.5rem; border-radius: 20px;
  background: linear-gradient(135deg, rgba(229,218,240,.25), rgba(214,235,220,.2));
  border: 1px solid rgba(157,123,196,.1); text-align: center;
}

/* ============================================================
   QUIZ ENGINE
   ============================================================ */
.aes-quiz-start { text-align: center; padding: 1.5rem; }
.aes-cw-done-badge { display: inline-block; margin-top: .8rem; font-size: .8rem; color: var(--emerald); font-weight: 600; }

.aes-quiz-q { animation: aes-step-in .4s cubic-bezier(.16,1,.3,1); }
.aes-quiz-progress { width: 100%; height: 5px; background: rgba(58,53,80,.08); border-radius: 999px; overflow: hidden; margin-bottom: 1rem; }
.aes-quiz-progress-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s cubic-bezier(.16,1,.3,1); }
.aes-quiz-q-num { font-size: .8rem; color: var(--ink-soft); font-weight: 600; }

.aes-quiz-options { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.aes-quiz-option {
  display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem;
  border-radius: 14px; border: 2px solid rgba(58,53,80,.1);
  background: var(--warm-white); cursor: pointer; text-align: left;
  transition: all .2s; font-size: .95rem; color: var(--ink); width: 100%;
}
.aes-quiz-option:hover:not(:disabled) { border-color: var(--accent); background: rgba(157,123,196,.06); transform: translateX(4px); }
.aes-quiz-option-letter {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: rgba(58,53,80,.06); color: var(--ink); font-weight: 700;
  display: grid; place-items: center; font-size: .8rem; transition: all .25s;
}
.aes-quiz-option:hover:not(:disabled) .aes-quiz-option-letter { background: var(--accent); color: #fff; }

.aes-quiz-option.is-correct { border-color: var(--emerald); background: rgba(123,179,142,.15); }
.aes-quiz-option.is-correct .aes-quiz-option-letter { background: var(--emerald); color: #fff; }
.aes-quiz-option.is-wrong { border-color: #e0707e; background: rgba(224,112,126,.12); }
.aes-quiz-option.is-wrong .aes-quiz-option-letter { background: #e0707e; color: #fff; }
.aes-quiz-option:disabled { cursor: default; }

.aes-quiz-feedback {
  display: flex; gap: .8rem; margin-top: 1rem; padding: 1rem;
  border-radius: 14px; animation: aes-step-in .35s cubic-bezier(.16,1,.3,1);
}
.aes-quiz-feedback.is-correct { background: rgba(123,179,142,.12); border: 1px solid rgba(123,179,142,.2); }
.aes-quiz-feedback.is-wrong { background: rgba(224,112,126,.1); border: 1px solid rgba(224,112,126,.15); }
.aes-quiz-feedback-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.2rem; font-weight: 700;
}
.aes-quiz-feedback.is-correct .aes-quiz-feedback-icon { background: var(--emerald); color: #fff; }
.aes-quiz-feedback.is-wrong .aes-quiz-feedback-icon { background: #e0707e; color: #fff; }
.aes-quiz-feedback-title { font-weight: 600; color: var(--ink); font-size: .9rem; }
.aes-quiz-feedback-explain { color: var(--ink-soft); font-size: .85rem; margin-top: .2rem; }

.aes-quiz-correct-flash { animation: aes-flash-green .6s ease; }
@keyframes aes-flash-green {
  0% { background: transparent; }
  30% { background: rgba(123,179,142,.15); }
  100% { background: transparent; }
}
@keyframes aes-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.aes-shake { animation: aes-shake .5s ease; }

.aes-quiz-result { text-align: center; padding: 2rem 1rem; animation: aes-step-in .4s cubic-bezier(.16,1,.3,1); }
.aes-quiz-result-icon { font-size: 3rem; }
.aes-quiz-retry-msg { color: var(--ink-soft); font-size: .9rem; margin: 1rem 0; max-width: 360px; margin-left: auto; margin-right: auto; }
.aes-quiz-actions { display: flex; gap: .8rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }

/* ============================================================
   VIDEO PLAYER
   ============================================================ */
.aes-cw-video { border-radius: 20px; overflow: hidden; }
.aes-cw-video-frame {
  border-radius: 20px; padding: 2.5rem 2rem; text-align: center;
  background: linear-gradient(135deg, #2a2540, #3a3550);
  position: relative; min-height: 240px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.aes-cw-slide-in { animation: aes-slide-fade .5s cubic-bezier(.16,1,.3,1); }
@keyframes aes-slide-fade {
  from { opacity: 0; transform: translateY(15px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.aes-cw-video-emoji { font-size: 3.5rem; line-height: 1; }
.aes-cw-video-frame h4 { color: #fff !important; }
.aes-cw-video-frame p { color: rgba(255,255,255,.7) !important; }
.aes-cw-video-progress {
  width: 100%; height: 4px; background: rgba(255,255,255,.15);
  border-radius: 999px; overflow: hidden; margin-top: 1.5rem;
}
.aes-cw-video-progress-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s linear; }
.aes-cw-video-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: .8rem; }
.aes-cw-video-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.15); color: #fff; cursor: pointer;
  font-size: 1.1rem; display: grid; place-items: center; transition: background .2s;
}
.aes-cw-video-btn:hover { background: rgba(255,255,255,.25); }
.aes-cw-video-counter { font-size: .75rem; color: rgba(255,255,255,.6); }

/* ============================================================
   COINS
   ============================================================ */
.aes-cw-sidebar-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.aes-cw-coin-wrap { position: relative; display: flex; align-items: center; gap: .35rem; }
.aes-cw-coin-icon { font-size: 1.2rem; }
.aes-cw-coin-balance { font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 600; color: var(--ink); }
.aes-coin-pop {
  position: absolute; top: -8px; right: -30px; font-size: .8rem; font-weight: 700;
  color: var(--accent); opacity: 0; pointer-events: none;
}
.aes-coin-pop.is-show { animation: aes-coin-pop 1.2s ease forwards; }
@keyframes aes-coin-pop {
  0% { opacity: 0; transform: translateY(0); }
  20% { opacity: 1; transform: translateY(-10px); }
  100% { opacity: 0; transform: translateY(-30px); }
}

.aes-cw-theme-btn {
  width: 36px; height: 36px; border-radius: 12px; border: 1px solid rgba(58,53,80,.1);
  background: var(--warm-white); cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center; transition: all .2s;
}
.aes-cw-theme-btn:hover { border-color: var(--accent); }

/* ---------- Level headers ---------- */
.aes-cw-level { margin-bottom: 1.5rem; }
.aes-cw-level-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; padding-bottom: .5rem; border-bottom: 2px solid rgba(157,123,196,.15); }
.aes-cw-level-tag {
  font-size: .7rem; font-weight: 700; padding: .2rem .55rem; border-radius: 8px;
  background: var(--accent); color: #fff; letter-spacing: .05em;
}
.aes-cw-level-title { font-family: 'Fraunces', serif; font-size: .95rem; color: var(--ink); }

/* ---------- Section heads ---------- */
.aes-cw-section { margin-top: 2rem; }
.aes-cw-section-head { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.aes-cw-section-head h3 { font-family: 'Fraunces', serif; font-size: 1.3rem; color: var(--ink); }
.aes-cw-section-icon { font-size: 1.3rem; }
.aes-cw-reading-title { font-family: 'Fraunces', serif; font-size: 1.15rem; color: var(--ink); margin-bottom: .5rem; }
.aes-cw-reading-text { font-size: .95rem; line-height: 1.7; color: var(--ink); opacity: .82; }

/* ============================================================
   DARK THEME
   ============================================================ */
body.aes-dark { background: #1a1726; color: #d8d4e8; }
body.aes-dark::before {
  background:
    radial-gradient(60% 50% at 12% 8%, rgba(157,123,196,.15), transparent 60%),
    radial-gradient(50% 45% at 92% 14%, rgba(123,179,142,.1), transparent 60%);
}
body.aes-dark .text-ink { color: #d8d4e8 !important; }
body.aes-dark .text-ink\/55, body.aes-dark .text-ink\/60, body.aes-dark .text-ink\/65 { color: rgba(216,212,232,.6) !important; }
body.aes-dark .bg-warmWhite, body.aes-dark .aes-cw-lesson-detail { background: #23203a !important; }
body.aes-dark .aes-bento, body.aes-dark .aes-course { background: #23203a !important; border-color: rgba(255,255,255,.06); }
body.aes-dark .aes-cw-sidebar { background: transparent; }
body.aes-dark .aes-cw-unit-desc, body.aes-dark .aes-cw-lesson-num { color: rgba(216,212,232,.4); }
body.aes-dark .aes-cw-lesson:hover { background: rgba(255,255,255,.04); }
body.aes-dark .aes-cw-lesson.is-active { background: rgba(157,123,196,.15); }
body.aes-dark .aes-cw-check { border-color: rgba(255,255,255,.15); }
body.aes-dark .aes-quiz-option { background: #23203a; border-color: rgba(255,255,255,.08); color: #d8d4e8; }
body.aes-dark .aes-quiz-option:hover:not(:disabled) { background: rgba(157,123,196,.1); }
body.aes-dark .aes-quiz-option-letter { background: rgba(255,255,255,.08); color: #d8d4e8; }
body.aes-dark .aes-vocab-item { background: rgba(255,255,255,.04); }
body.aes-dark .aes-cw-objective { background: rgba(157,123,196,.1); }
body.aes-dark .aes-cw-grammar { background: rgba(123,179,142,.08); }
body.aes-dark .aes-cw-grammar-head { background: rgba(123,179,142,.12); }
body.aes-dark .aes-cw-tip { background: rgba(224,112,126,.08); }
body.aes-dark #site-header.is-scrolled { background: rgba(26,23,38,.85); }
body.aes-dark #site-header.is-scrolled .aes-logo-mark { background: linear-gradient(135deg,#9D7BC4,#7BB38E); }
body.aes-dark #mobile-menu { background: #23203a; }
body.aes-dark #mobile-menu a { color: #d8d4e8; border-color: rgba(255,255,255,.06); }
body.aes-dark .aes-cw-video-frame { background: linear-gradient(135deg, #15131f, #1f1c30); }
body.aes-dark .aes-auth-modal { background: #23203a; }
body.aes-dark .aes-auth-input { background: #1a1726; color: #d8d4e8; }
body.aes-dark .aes-panel { background: #23203a; }

/* ============================================================
   STANDALONE APP MODE
   ============================================================ */
.aes-app-body { overflow-x: hidden; }

/* Top bar */
.aes-app-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.2rem; background: rgba(255, 252, 246, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(58, 53, 80, 0.08);
}
body.aes-dark .aes-app-topbar { background: rgba(35, 32, 58, 0.9); border-color: rgba(255,255,255,.06); }

.aes-app-topbar-left { display: flex; align-items: center; gap: .6rem; }
.aes-app-back {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: var(--ink); background: rgba(58,53,80,.05); transition: all .2s;
}
.aes-app-back:hover { background: rgba(58,53,80,.12); transform: translateX(-2px); }
body.aes-dark .aes-app-back { color: #d8d4e8; background: rgba(255,255,255,.06); }
.aes-app-title { color: var(--ink) !important; }

.aes-app-topbar-right { display: flex; align-items: center; gap: .8rem; }
.aes-app-coins { position: relative; display: flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border-radius: 999px; background: rgba(214,235,220,.3); }
body.aes-dark .aes-app-coins { background: rgba(123,179,142,.12); }
.aes-app-coin-icon { font-size: 1rem; }
.aes-app-coin-balance { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1rem; color: var(--ink) !important; }
body.aes-dark .aes-app-coin-balance { color: #d8d4e8 !important; }

.aes-app-auth-slot { display: flex; align-items: center; gap: .5rem; }
.aes-app-theme-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(58,53,80,.1);
  background: transparent; cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center; transition: all .2s;
}
body.aes-dark .aes-app-theme-btn { border-color: rgba(255,255,255,.1); }

/* Auth gate */
.aes-app-gate {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 80px 2rem 2rem; text-align: center;
}
.aes-app-gate-content { max-width: 420px; }
.aes-app-back-link { display: inline-block; margin-top: 1.5rem; font-size: .85rem; color: var(--ink-soft); text-decoration: underline; transition: color .2s; }
.aes-app-back-link:hover { color: var(--accent); }

/* Content wrapper — starts below top bar */
#course-content { padding-top: 80px; padding-bottom: 2rem; max-width: 1400px; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }

.aes-app-progress-wrap { margin-bottom: 1.5rem; }

.aes-app-layout { gap: 2rem; }

/* AI assistant section */
.aes-app-assistant { margin-top: 4rem; padding-bottom: 3rem; }

/* Dark theme for app elements */
body.aes-dark .aes-app-gate { background: #1a1726; }
body.aes-dark .aes-app-gate h1 { color: #d8d4e8 !important; }
body.aes-dark .aes-app-gate p { color: rgba(216,212,232,.6) !important; }

/* Mobile: top bar gets smaller, title hidden */
@media (max-width: 640px) {
  .aes-app-title { display: none; }
  #course-content { padding-left: 1rem; padding-right: 1rem; }
}

/* ============================================================
   PAID COURSE VIEWER (v2)
   ============================================================ */

/* ---------- Lesson cards (overview grid) ---------- */
.aes-pcv-lesson-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.4rem; border-radius: 22px;
  background: var(--warm-white); border: 1px solid rgba(58,53,80,.08);
  cursor: pointer;
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s, border-color .3s;
}
.aes-pcv-lesson-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: rgba(157,123,196,.2); }
.aes-pcv-lesson-card.is-locked { opacity: .5; cursor: not-allowed; }
.aes-pcv-lesson-card.is-locked:hover { transform: none; box-shadow: none; border-color: rgba(58,53,80,.08); }
.aes-pcv-lesson-card.is-done { border-color: rgba(123,179,142,.35); }

.aes-pcv-lesson-num {
  display: grid; place-items: center; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 14px 20px 16px 22px;
  background: linear-gradient(135deg, #E5DAF0, #D6EBDC); color: var(--ink);
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 1rem;
}
.aes-pcv-lesson-card.is-done .aes-pcv-lesson-num {
  background: linear-gradient(135deg, #D6EBDC, #BFE3CE); color: var(--emerald);
}

.aes-pcv-lesson-info { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 0; }
.aes-pcv-lesson-info h3 { font-size: .98rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.aes-pcv-lesson-info p { font-size: .82rem; color: var(--ink-soft); line-height: 1.4; }

.aes-pcv-lesson-meta { display: flex; align-items: center; gap: .8rem; margin-top: .4rem; font-size: .76rem; color: var(--ink-soft); }
.aes-pcv-progress-mini {
  font-weight: 600; padding: .12rem .5rem; border-radius: 999px;
  background: rgba(157,123,196,.1); color: var(--accent);
}
.aes-pcv-lesson-arrow { font-size: 1.2rem; color: var(--ink-soft); flex-shrink: 0; }
.aes-pcv-lock { font-size: 1.1rem; flex-shrink: 0; }

/* ---------- Back button ---------- */
.aes-pcv-back { margin-bottom: 1.5rem; }
.aes-pcv-back-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: 999px;
  background: transparent; color: var(--ink-soft); border: 1px solid rgba(58,53,80,.12);
  cursor: pointer; font-size: .85rem; font-weight: 500; transition: all .2s;
}
.aes-pcv-back-btn:hover { color: var(--ink); border-color: rgba(58,53,80,.25); background: rgba(58,53,80,.03); }

/* ---------- Lesson header ---------- */
.aes-pcv-lesson-header { margin-bottom: 1.5rem; }
.aes-pcv-lesson-badge {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .04em;
  padding: .25rem .7rem; border-radius: 999px;
  background: rgba(157,123,196,.12); color: var(--accent); margin-bottom: .6rem;
}
.aes-pcv-lesson-header h2 { font-family: 'Fraunces', serif; font-size: 1.8rem; color: var(--ink); font-weight: 600; }
.aes-pcv-lesson-header p { color: var(--ink-soft); margin-top: .3rem; font-size: .95rem; }
.aes-pcv-time { display: inline-block; margin-top: .5rem; font-size: .8rem; color: var(--ink-soft); }

/* ---------- Tabs ---------- */
.aes-pcv-tabs {
  display: flex; gap: .4rem; border-bottom: 1px solid rgba(58,53,80,.1);
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.aes-pcv-tab {
  padding: .6rem 1rem; border-radius: 12px 12px 0 0;
  cursor: pointer; font-size: .85rem; font-weight: 500; color: var(--ink-soft);
  background: transparent; border: none; border-bottom: 2px solid transparent;
  transition: all .2s;
}
.aes-pcv-tab:hover { color: var(--ink); }
.aes-pcv-tab.is-active { color: var(--ink); background: rgba(157,123,196,.08); border-bottom-color: var(--accent); }
.aes-pcv-tab.is-done { color: var(--emerald); }

.aes-pcv-tab-content { padding: .5rem 0; }

/* ---------- Theory ---------- */
.aes-pcv-theory { max-width: 700px; }
.aes-pcv-theory h3 { font-family: 'Fraunces', serif; font-size: 1.3rem; color: var(--ink); margin-bottom: 1rem; }
.aes-pcv-reading p { line-height: 1.8; color: rgba(58,53,80,.75); margin-bottom: 1rem; }

.aes-pcv-lang-toggle {
  display: inline-flex; gap: 0; border-radius: 999px; overflow: hidden;
  border: 1px solid rgba(58,53,80,.15); margin-bottom: 1.5rem;
}
.aes-pcv-lang-btn {
  padding: .4rem 1.2rem; font-size: .8rem; font-weight: 600;
  background: transparent; color: rgba(58,53,80,.5); border: none; cursor: pointer;
  transition: background .2s, color .2s;
}
.aes-pcv-lang-btn.is-active { background: var(--ink); color: var(--warm-white); }

.aes-pcv-vocab { margin-top: 1.5rem; }
.aes-pcv-vocab h4 { font-size: .95rem; font-weight: 600; color: var(--ink); margin-bottom: .6rem; }
.aes-pcv-vocab-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: .6rem .8rem; border-bottom: 1px solid rgba(58,53,80,.07);
}
.aes-pcv-vocab-word { font-weight: 600; color: var(--ink); }
.aes-pcv-vocab-trans { color: rgba(58,53,80,.55); font-size: .85rem; }

/* ---------- Video ---------- */
.aes-pcv-video-frame {
  aspect-ratio: 16/9; border-radius: 20px; overflow: hidden;
  background: var(--warm-white);
  display: grid; place-items: center; padding: 2rem; position: relative;
  border: 1px solid rgba(58,53,80,.08);
}
.aes-pcv-video-slide { text-align: center; transition: opacity .3s; }
.aes-pcv-slide-in { animation: aes-slide-fade .5s cubic-bezier(.16,1,.3,1); }
.aes-pcv-video-emoji { font-size: 4rem; line-height: 1; }
.aes-pcv-video-slide h4 { color: var(--ink) !important; margin-top: .8rem; font-family: 'Fraunces', serif; font-size: 1.2rem; }
.aes-pcv-video-slide p { color: var(--ink-soft) !important; margin-top: .4rem; font-size: .9rem; }
.aes-pcv-video-progress {
  width: 100%; height: 4px; background: rgba(58,53,80,.1);
  border-radius: 999px; overflow: hidden; margin-top: 1.5rem;
}
.aes-pcv-video-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s ease; }
.aes-pcv-video-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: .8rem; }
.aes-pcv-video-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(58,53,80,.06); color: var(--ink); cursor: pointer;
  font-size: 1.1rem; display: grid; place-items: center; transition: background .2s;
}
.aes-pcv-video-btn:hover { background: rgba(58,53,80,.12); }

/* ---------- Quiz ---------- */
.aes-pcv-quiz-start { text-align: center; padding: 1.5rem; }
.aes-pcv-quiz-progress { width: 100%; height: 5px; background: rgba(58,53,80,.08); border-radius: 999px; overflow: hidden; margin-bottom: 1rem; }
.aes-pcv-quiz-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s ease; }
.aes-pcv-quiz-num { font-size: .8rem; color: var(--ink-soft); font-weight: 600; }
.aes-pcv-quiz-options { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }

.aes-pcv-quiz-option {
  display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left;
  padding: .9rem 1.1rem; border-radius: 14px; border: 2px solid rgba(58,53,80,.1);
  background: var(--warm-white); cursor: pointer; font-size: .95rem; color: var(--ink);
  transition: all .2s;
}
.aes-pcv-quiz-option:hover:not(:disabled) { border-color: var(--accent); background: rgba(157,123,196,.06); transform: translateX(4px); }
.aes-pcv-quiz-option.is-correct { border-color: var(--emerald); background: rgba(123,179,142,.15); }
.aes-pcv-quiz-option.is-wrong { border-color: #e0707e; background: rgba(224,112,126,.12); }
.aes-pcv-quiz-option:disabled { cursor: default; }
.aes-pcv-option-letter {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: rgba(58,53,80,.06); color: var(--ink); font-weight: 700;
  display: grid; place-items: center; font-size: .8rem;
}
.aes-pcv-quiz-option.is-correct .aes-pcv-option-letter { background: var(--emerald); color: #fff; }
.aes-pcv-quiz-option.is-wrong .aes-pcv-option-letter { background: #e0707e; color: #fff; }

.aes-pcv-quiz-feedback {
  display: flex; gap: .8rem; margin-top: 1rem; padding: 1rem;
  border-radius: 14px; animation: aes-step-in .35s cubic-bezier(.16,1,.3,1);
}
.aes-pcv-quiz-feedback.is-correct { background: rgba(123,179,142,.12); border: 1px solid rgba(123,179,142,.2); }
.aes-pcv-quiz-feedback.is-wrong { background: rgba(224,112,126,.1); border: 1px solid rgba(224,112,126,.15); }
.aes-pcv-feedback-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.2rem; font-weight: 700;
}
.aes-pcv-quiz-feedback.is-correct .aes-pcv-feedback-icon { background: var(--emerald); color: #fff; }
.aes-pcv-quiz-feedback.is-wrong .aes-pcv-feedback-icon { background: #e0707e; color: #fff; }
.aes-pcv-feedback-title { font-weight: 600; color: var(--ink); font-size: .9rem; }
.aes-pcv-feedback-explain { color: var(--ink-soft); font-size: .85rem; margin-top: .2rem; }

/* ---------- Quiz result ---------- */
.aes-pcv-quiz-result { text-align: center; padding: 2rem 1rem; animation: aes-step-in .4s cubic-bezier(.16,1,.3,1); }
.aes-pcv-result-icon { font-size: 3rem; text-align: center; }
.aes-pcv-quiz-actions { display: flex; gap: .8rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.aes-pcv-quiz-done { text-align: center; padding: 2rem 1rem; }

/* ---------- Homework ---------- */
.aes-pcv-homework { max-width: 680px; }
.aes-pcv-ex-type {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .04em;
  padding: .2rem .6rem; border-radius: 999px;
  background: rgba(157,123,196,.12); color: var(--accent);
}
.aes-pcv-ex-question { font-size: 1.05rem; color: var(--ink); margin: .8rem 0 1.2rem; line-height: 1.5; }

.aes-pcv-input {
  width: 100%; padding: .8rem 1rem; border-radius: 14px;
  border: 1px solid rgba(58,53,80,.14); background: var(--cream);
  color: var(--ink); font-size: .95rem; font-family: inherit;
  transition: border-color .2s, box-shadow .2s; box-sizing: border-box;
}
.aes-pcv-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(157,123,196,.15); }

.aes-pcv-order-words { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.aes-pcv-word {
  padding: .5rem .9rem; border: 1px solid rgba(58,53,80,.15); border-radius: 12px;
  background: var(--warm-white); cursor: pointer; font-size: .9rem; color: var(--ink);
  transition: all .2s;
}
.aes-pcv-word:hover:not(:disabled) { border-color: var(--accent); background: rgba(157,123,196,.06); }
.aes-pcv-word.is-used { opacity: .3; }
.aes-pcv-order-answer {
  min-height: 50px; padding: .6rem .8rem;
  border: 2px dashed rgba(58,53,80,.15); border-radius: 14px;
  display: flex; align-items: center; flex-wrap: wrap; gap: .3rem;
}
.aes-pcv-selected-word { font-size: .9rem; color: var(--ink); font-weight: 500; }
.aes-pcv-clear {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  border-radius: 8px; border: none; background: rgba(58,53,80,.06);
  color: var(--ink-soft); cursor: pointer; font-size: .9rem; transition: background .2s;
}
.aes-pcv-clear:hover { background: rgba(58,53,80,.12); }

/* ---------- Done badge & complete ---------- */
.aes-pcv-done-badge { color: var(--emerald); font-weight: 600; display: inline-block; margin-top: .8rem; }
.aes-pcv-complete-btn { margin-top: 2rem; }
.aes-pcv-course-done { font-size: 1.5rem; color: var(--emerald); font-weight: 600; text-align: center; }

/* ---------- Error state ---------- */
.aes-pcv-error { text-align: center; padding: 3rem 1rem; }
.aes-pcv-error h2 { font-family: 'Fraunces', serif; font-size: 1.5rem; color: var(--ink); margin-bottom: 1rem; }

/* ---------- Dark theme overrides ---------- */
body.aes-dark .aes-pcv-lesson-card { background: #23203a; border-color: rgba(255,255,255,.06); }
body.aes-dark .aes-pcv-lesson-card.is-done { border-color: rgba(123,179,142,.3); }
body.aes-dark .aes-pcv-lesson-info h3 { color: #d8d4e8; }
body.aes-dark .aes-pcv-lesson-info p,
body.aes-dark .aes-pcv-lesson-meta { color: rgba(216,212,232,.5); }
body.aes-dark .aes-pcv-lesson-header h2 { color: #d8d4e8; }
body.aes-dark .aes-pcv-lesson-header p { color: rgba(216,212,232,.6); }
body.aes-dark .aes-pcv-reading p { color: rgba(216,212,232,.65); }
body.aes-dark .aes-pcv-vocab-word { color: #d8d4e8; }
body.aes-dark .aes-pcv-vocab-trans { color: rgba(216,212,232,.5); }
body.aes-dark .aes-pcv-vocab-item { border-color: rgba(255,255,255,.06); }
body.aes-dark .aes-pcv-video-frame { background: #1a1726; border-color: rgba(255,255,255,.06); }
body.aes-dark .aes-pcv-video-slide h4 { color: #d8d4e8 !important; }
body.aes-dark .aes-pcv-video-slide p { color: rgba(216,212,232,.6) !important; }
body.aes-dark .aes-pcv-video-btn { background: rgba(255,255,255,.08); color: #d8d4e8; }
body.aes-dark .aes-pcv-quiz-option { background: #23203a; border-color: rgba(255,255,255,.08); color: #d8d4e8; }
body.aes-dark .aes-pcv-quiz-option:hover:not(:disabled) { background: rgba(157,123,196,.1); }
body.aes-dark .aes-pcv-option-letter { background: rgba(255,255,255,.08); color: #d8d4e8; }
body.aes-dark .aes-pcv-input { background: #1a1726; color: #d8d4e8; border-color: rgba(255,255,255,.1); }
body.aes-dark .aes-pcv-word { background: #23203a; border-color: rgba(255,255,255,.1); color: #d8d4e8; }
body.aes-dark .aes-pcv-order-answer { border-color: rgba(255,255,255,.12); }
body.aes-dark .aes-pcv-back-btn { color: rgba(216,212,232,.6); border-color: rgba(255,255,255,.1); }
body.aes-dark .aes-pcv-back-btn:hover { color: #d8d4e8; background: rgba(255,255,255,.04); }
body.aes-dark .aes-pcv-video-progress { background: rgba(255,255,255,.1); }
body.aes-dark .aes-pcv-quiz-progress { background: rgba(255,255,255,.08); }

/* ============================================================
   AVATAR SYSTEM
   ============================================================ */
.aes-avatar {
  border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; position: relative;
}
.aes-avatar span { position: absolute; line-height: 1; }
.aes-avatar-base { font-size: 1.8rem; z-index: 1; }
.aes-avatar-hat { top: -6%; z-index: 2; font-size: 1.2rem; }
.aes-avatar-glasses { top: 42%; z-index: 3; font-size: 1rem; }
.aes-avatar-acc { top: 2%; right: -4%; z-index: 4; font-size: 1.1rem; }
.aes-avatar-slot { display: inline-block; }

/* ============================================================
   AVATAR SHOP
   ============================================================ */
.aes-shop-item {
  padding: 1.5rem; border-radius: 24px; text-align: center;
  background: var(--warm-white); border: 1px solid rgba(58,53,80,.08);
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s;
}
.aes-shop-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.aes-shop-preview {
  width: 80px; height: 80px; margin: 0 auto .8rem;
  border-radius: 50%; display: grid; place-items: center; overflow: hidden;
}
.aes-shop-price { display: flex; align-items: center; justify-content: center; gap: .3rem; font-weight: 600; color: var(--ink); }
.aes-shop-btn { margin-top: .8rem; }
body.aes-dark .aes-shop-item { background: #23203a; border-color: rgba(255,255,255,.06); }
body.aes-dark .aes-shop-price { color: #d8d4e8; }
